@arcgis/core 4.34.0-next.94 → 4.34.0-next.96

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 (766) hide show
  1. package/analysis/ElevationProfileAnalysis.js +1 -1
  2. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +5 -0
  4. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  5. package/analysis/featureReferenceUtils.js +1 -1
  6. package/applications/Components/featureUtils.d.ts +1 -0
  7. package/applications/Components/featureUtils.js +1 -1
  8. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/{57c08ccb75e3135978d1.js → 0086a09441627842d34a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/02bc183e30e3392bb76d.js +1 -0
  12. package/assets/esri/core/workers/chunks/{155dcbd957f8787a45c3.js → 05eee334d58a0b9f6316.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{0f37204f86d2997a2811.js → 06e60fc7715d08ede59d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{94ddf029698991d853b9.js → 0811ac64d08454460fb1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{6391ce002fbde9f27a77.js → 081a7082dc281ca7662a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3c3b1dc95f03082e4d5b.js → 083f1c2fd0b59a0bf4c3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +1 -0
  18. package/assets/esri/core/workers/chunks/{c6cae8471c5d4ae40c65.js → 145c6a7cdcc9893efb27.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{0cfded1acf92f89a13cb.js → 14ace5dc4b8984212a57.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{39a5863355cccaabd2d6.js → 1762ff76350065750c75.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a98b284b147258629947.js → 188272af9a6470ccfe31.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{ce8f56cf371812b57a46.js → 19699769deff862e29ce.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ce2fcaa21d6efcdf4da5.js → 1b85967d1178956ee36b.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{bf9d09493fd849ea69fd.js → 1fd459234917a51b6ae1.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{0aaaf4d1c4a5d284216e.js → 22bb877b85ae250d7819.js} +1 -1
  26. package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e5d974593043d5e2b502.js → 2795a2817ebe3298c350.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{71fef0a33b7ed9456e47.js → 28a5f8978817e0471a2a.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{07a7ca89ef2ca4fc090b.js → 2a30afa043e3f88655d9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{41f275401e1cde7eee20.js → 2a8b75d2445680571759.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{6b208f5d423da64c8559.js → 2a900a632a1231deb713.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{0e5e565df6ec71445f2e.js → 2bbe8277578b033f92d4.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{77e611724a499d36eacc.js → 2c72e185b780bbbb1c9f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{38d874d7f815f5329420.js → 2ca8b0c1ca399fd5dc2f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{c799f1c03cb22ef52f5f.js → 2d51e9c9b73301b6879c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{cd0c222a36caa7f80860.js → 2f9e79a67eae746d55d3.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{0856cd281efd71bfe3c4.js → 3116b35a92cc0afd9fd3.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{e153b61560a7a869db63.js → 319c3f46f2afb8f3e5a9.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{b8f55ee77ab6ea4c289e.js → 326a76a4e80269d4029d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{28bb6896c5fd353ca5e9.js → 3367b8565226646decec.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{8513c9282c44bb0a736e.js → 3495162f4608f5205d87.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{c38360d912f256519e06.js → 3496e025e48cf580250d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{4753793daf0b7ff8b5ff.js → 35255e2b980f650490d8.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{d2df6e685d6cffc5f486.js → 37d05d9796917c3d4b7a.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{7b17f52019762aa21af8.js → 3815ffa13e7b439bca6e.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{de34c21d3e6913befe5a.js → 3b65d6a78fbffca37fbd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{2698f656405876f4bd20.js → 3ccdce156b906574bd29.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0ceb68ff73e5d39e837a.js → 3ffdf73aaecc42448f8a.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{68f5a2d2666636c3f807.js → 40b81d1c2d53cf598b8e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4239572007ecfac49dc1.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f3284d4e0d41efb0b4a0.js → 441ead5bce80f639934e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{97eb2cfc1f036feea9a9.js → 44c3b5a507814103f4b4.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{6f29951f5a2da068b257.js → 456161a323be7d640c61.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{b18887a6dc86f0c8324a.js → 48646f3d95a3f2b17e78.js} +1 -1
  55. package/assets/esri/core/workers/chunks/49571d6875de1f2e7e25.js +33 -0
  56. package/assets/esri/core/workers/chunks/{1bbc0dfad4cd72a1c42b.js → 4a2bf3c8da24abd8b9e2.js} +6 -6
  57. package/assets/esri/core/workers/chunks/4b13749b74059a7837d2.js +1 -0
  58. package/assets/esri/core/workers/chunks/{c8e4fe0e3b109eb80e8e.js → 4b83b45df0c4005d078d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{896c7d137bfd7a8fa0bc.js → 4f01be74dd26e639330f.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{b5c829e904bc9cb5347d.js → 50a5caa96c111dda5c60.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{98381404f2d99a1f9341.js → 50e1c63d0b6196dd365e.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{899f493412acd5a5d91f.js → 5132ca68e8c7af111a47.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{d08b80583a23ba253c7e.js → 56916e56c20465428dd4.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{bbdadced49446c907361.js → 578789c040846ea3759b.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{f62717338075df626eda.js → 5a527a47285a5995cff9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +1 -0
  67. package/assets/esri/core/workers/chunks/{56edb55b53779e7fd31e.js → 5d2e5774768d8f290343.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6e5175b43220d6692263.js → 5d3661d1fe46dd29aae9.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{0652d7e525d99e39c957.js → 5fb2ce028b371b3a8acb.js} +1 -1
  70. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +1 -0
  71. package/assets/esri/core/workers/chunks/{71c6c0b26253c4ca1b68.js → 630efe10c871425b6a95.js} +1 -1
  72. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +1 -0
  73. package/assets/esri/core/workers/chunks/{61e8e159f1f336569b27.js → 65111858957f43eacd8c.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{0427f66b56ec6601deb0.js → 6ac90d88e5f931b1a003.js} +1 -1
  75. package/assets/esri/core/workers/chunks/6c842b955fdd40b39914.js +1 -0
  76. package/assets/esri/core/workers/chunks/{08b0fc6bfe9640ee2525.js → 6cd379bb66dc4cf5d2bf.js} +1 -1
  77. package/assets/esri/core/workers/chunks/6ec77a8142fbfa805b5a.js +1 -0
  78. package/assets/esri/core/workers/chunks/{541bffd61006d0e36166.js → 6f4bd0ee85e7e5a74340.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{648c91a9822bc9d6ee47.js → 701a1835684cf815bcb7.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{f71b76c9506178124fa3.js → 70af1b5b3d2f3f395441.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d7adef4093ce19ad356d.js → 72846fb9c87c6642daf0.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{f88fe2e8fbc763bdc940.js → 73c1d43070b4fe1e5c1e.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{cab2a1382bdd32bb34d8.js → 7421f9575487cdc9e28e.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{a845c68e76382a73da5e.js → 7633537dc0c65d655baf.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{82e0d22619dc26920ca9.js → 7698f4f4471b6e1c12ef.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{9a0b9d931c1a29e81475.js → 76e444bd625cf3d35877.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{b265472ac3f949a7f40c.js → 773d76253588bcf14eaa.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{77705d0c7c17bd46d81a.js → 7810f870d71f80ca4f41.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{56de25a6fe659a5b5c2b.js → 78b35a19332e58c8c279.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{e4833b718a813a8d125b.js → 79012b873d2b7786be77.js} +1 -1
  91. package/assets/esri/core/workers/chunks/7a6a96edc892d7060b7d.js +1 -0
  92. package/assets/esri/core/workers/chunks/7b3ff47cdbb6af38530d.js +1 -0
  93. package/assets/esri/core/workers/chunks/{04dbdaa63c950f32b8f0.js → 7e8f7fa884d6d41ebae2.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{48133effac2eacc2196e.js → 7fa324900c147ba51019.js} +1 -1
  95. package/assets/esri/core/workers/chunks/80c492f8fdab7698596a.js +1 -0
  96. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +1 -0
  97. package/assets/esri/core/workers/chunks/{0037abf0a82d1ed32e91.js → 8215015f11221a354273.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{cb6a9b43406f4fbe10b2.js → 82f1cd3896401c85df35.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{2bb61f80473b495163e3.js → 83ab8c8bc9e6990114a8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{03b455e9405a8b6fec68.js → 8659abd4b46f153b6902.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{19bd0b56d82446dbb7c5.js → 868ee8f429e7caddc045.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{1fc7df018c8f802565a6.js → 86b978a48b539e9fc5b8.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{4dfcd03082be83600f3a.js → 88add09190569b04e824.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{65e279516170ddbd4a65.js → 89027f6800e17fab8973.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{a6533bab3b2fbc1e2a47.js → 8b16aa50d879b92a5375.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{2b9c9a35a6e1f56920b5.js → 9027f22a04ac2076ff0e.js} +14 -14
  107. package/assets/esri/core/workers/chunks/{edaf059c7ea18088c3dd.js → 91df8638b8b904e6d8c5.js} +1 -1
  108. package/assets/esri/core/workers/chunks/92c306d02569e7cd9af3.js +1 -0
  109. package/assets/esri/core/workers/chunks/{fdadf11f31384c09db9f.js → 94486f3fcba48fa93aa8.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{a0fab8cd791c33d3895d.js → 98dbafa4d45fdf790fff.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{2b867cec6ada339f1c8f.js → 9958a3ed4aa787d19e00.js} +1 -1
  112. package/assets/esri/core/workers/chunks/9a723d739ac44b45432c.js +1 -0
  113. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +1 -0
  114. package/assets/esri/core/workers/chunks/{9d9a639f7388a29e7c96.js → 9e4f37367d61a2e13053.js} +1 -1
  115. package/assets/esri/core/workers/chunks/a16526adc0dbffdc1ffc.js +1 -0
  116. package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +1 -0
  117. package/assets/esri/core/workers/chunks/{c4641c2c130c7b8bcdee.js → a1c4509a3865139eb570.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{e2fdc4dc1ab9decd731e.js → a4db5c9a90107e097df8.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{176f56de787bf486be9f.js → a7bd294996e6c8b8354a.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{80a155496deef2c02a3e.js → a878061845e594b2d72c.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{8f426cb210a4250517d5.js → ad3e18c4c65aa2cd1ceb.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{0328eaea66c1db98da1c.js → ae807912acc19a166264.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{0a981061df08da19372c.js → ae8c387d59be87457567.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{5caf49e679ed0c27e0bd.js → aea8553a2aa54cfd694b.js} +1 -1
  125. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +1 -0
  126. package/assets/esri/core/workers/chunks/{70c8f69eed14d55c5cf6.js → b2add7338258ca7c24dd.js} +1 -1
  127. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +1 -0
  128. package/assets/esri/core/workers/chunks/{26081b6486c623735657.js → b4ea675831627d9808dd.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{35ca317490540fae437c.js → b54202dcab8df080e991.js} +1 -1
  130. package/assets/esri/core/workers/chunks/ba212ba895ccf573eedf.js +1 -0
  131. package/assets/esri/core/workers/chunks/{95bae3c275f1483eb7ed.js → bcff6178e9d16b1b6191.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{2845a0810e9c00bf30f8.js → bf775fe489213cfc08b1.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{4823e4522bd7379d858e.js → bfc1e8aec7aace3ff30e.js} +1 -1
  134. package/assets/esri/core/workers/chunks/c0849628a7fbc6869340.js +1 -0
  135. package/assets/esri/core/workers/chunks/{20003728a679479b14dc.js → c31583229a1100b66a18.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{9346437b152b20bdcf8a.js → c941d15190fc08523d0d.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{5746c4861af83c1d57a8.js → cf11b1dcc2cff30229b6.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{fe1dcf9f81da4adbb1fe.js → cf13625a033f9903655f.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{1990162dcf73601d54f7.js → d3cd9c24edf7520d0824.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{73db6c070b049fe05147.js → d57edb77c6deee36cce5.js} +1 -1
  141. package/assets/esri/core/workers/chunks/{6e4ec9fa931c69e4e4ba.js → da573ecc68e6aa8f6da9.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{bdf0ab95401c6d8fbc7d.js → db559437b571462fb3db.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{512dcd6e34e217029391.js → deb2854bb7d082a26f52.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{5993427325d1add18ed9.js → dede989d59c4b416af68.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{18e9cb71fa020e93d139.js → df5ecb3339d9301a6f5b.js} +1 -1
  146. package/assets/esri/core/workers/chunks/{e22b400636094fc7b6c0.js → dfbf2e17058aa876f96a.js} +1 -1
  147. package/assets/esri/core/workers/chunks/dfc37c2ce51e6a34fd87.js +1 -0
  148. package/assets/esri/core/workers/chunks/{c5c6a32a24005478c976.js → e032f3d2ee19790f8c79.js} +1 -1
  149. package/assets/esri/core/workers/chunks/{3d7923d25734d03a4d27.js → e1dba29f5fd1ee5fc999.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{352511dbc67166face40.js → e2e32e2f04cce9e932fd.js} +1 -1
  151. package/assets/esri/core/workers/chunks/e5bcc44f3dc6fc90835a.js +1 -0
  152. package/assets/esri/core/workers/chunks/{bb0a1be03bb9d621432c.js → e7638b9ab6674bc8a18f.js} +1 -1
  153. package/assets/esri/core/workers/chunks/{edef1e2254c992459c63.js → eb1a7bb8b14e651bc241.js} +1 -1
  154. package/assets/esri/core/workers/chunks/f09242e97196ad177c10.js +1 -0
  155. package/assets/esri/core/workers/chunks/{779ee975efebb838b5d6.js → f154336b4af011cd0c56.js} +1 -1
  156. package/assets/esri/core/workers/chunks/{3807d0b9b1894731174d.js → f1be3a177328a169128f.js} +1 -1
  157. package/assets/esri/core/workers/chunks/{0810dbbf348a927392e7.js → f59c782898d931810374.js} +1 -1
  158. package/assets/esri/core/workers/chunks/{c9159ebf930af3f336f3.js → f5d89b48f62fba78fd10.js} +1 -1
  159. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +1 -0
  160. package/assets/esri/core/workers/chunks/{b510c07dfd0d31683b08.js → f7a9d2da07196a0989ae.js} +1 -1
  161. package/assets/esri/core/workers/chunks/{143503f6eb270c4683f8.js → f7c99e9c8d19352af38d.js} +1 -1
  162. package/assets/esri/core/workers/chunks/{79ab06fb4c91ac8da323.js → f839b86bee15deaf84e4.js} +1 -1
  163. package/assets/esri/core/workers/chunks/{9adecee0ed2f1df3b0d2.js → f85e2b6a285fa8ad60aa.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{024063fe2bbb27899094.js → fbbccca5b1bcffb31c4e.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{009556f323e58271bc7a.js → fc4417d1260b717a9385.js} +1 -1
  166. package/assets/esri/core/workers/chunks/{6810ecdeccf4b7eae5e2.js → fdaf8fb5a3cc7abea44b.js} +1 -1
  167. package/assets/esri/core/workers/chunks/{05072093e0209ef5db20.js → fe3f95fda29e4844b153.js} +1 -1
  168. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  169. package/assets/esri/themes/base/widgets/_Editor.scss +4 -0
  170. package/assets/esri/themes/dark/main.css +1 -1
  171. package/assets/esri/themes/light/main.css +1 -1
  172. package/assets/esri/themes/light/view.css +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  202. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  203. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  204. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  205. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  206. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  207. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  208. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  209. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  210. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  211. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  212. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  213. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  233. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  234. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  235. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  236. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  237. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  238. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  252. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  253. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  254. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  258. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  259. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  260. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  261. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  262. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  263. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  264. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  265. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  266. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  267. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  268. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  269. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  270. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  271. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  272. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  273. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  274. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  275. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  276. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  277. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  278. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  279. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  280. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  281. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  282. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  283. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  284. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  285. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  286. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  287. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  288. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  289. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  290. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  291. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  292. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  293. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  294. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  295. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  296. package/chunks/Envelope.js +1 -1
  297. package/chunks/Fog.glsl.js +2 -2
  298. package/chunks/Geometry.js +1 -1
  299. package/chunks/GlowBlur.glsl.js +8 -9
  300. package/chunks/GlowComposition.glsl.js +15 -16
  301. package/chunks/Laserlines.glsl.js +12 -12
  302. package/chunks/MultiPathImpl.js +1 -1
  303. package/chunks/Point2D.js +1 -1
  304. package/chunks/PointRenderer.glsl.js +1 -1
  305. package/chunks/Precipitation.glsl.js +2 -2
  306. package/chunks/Terrain.glsl.js +1 -1
  307. package/chunks/boundedPlane.js +1 -1
  308. package/chunks/bundle.js +1 -1
  309. package/chunks/cameraUtilsPlanar.js +1 -1
  310. package/chunks/cameraUtilsSpherical.js +1 -1
  311. package/chunks/sphere.js +1 -1
  312. package/chunks/vec32.js +1 -1
  313. package/config.js +1 -1
  314. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  315. package/core/accessorSupport/extensions/serializableProperty/utils.js +5 -0
  316. package/core/accessorSupport/extensions/serializableProperty.js +1 -1
  317. package/core/accessorSupport/read.js +1 -1
  318. package/core/accessorSupport/write.js +1 -1
  319. package/core/dedupeResult.js +5 -0
  320. package/core/has.js +1 -1
  321. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  322. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  323. package/core/perspectiveUtils.js +1 -1
  324. package/core/workers/workerFactory.js +1 -1
  325. package/editing/geometry/lineUtils.js +1 -1
  326. package/geometry/Mesh.js +1 -1
  327. package/geometry/operators/support/jsonConverter.js +1 -1
  328. package/geometry/projection/localLinearScaleFactors.js +1 -1
  329. package/geometry/projection/projectDirection.js +1 -1
  330. package/geometry/projection/projectVec3Array.js +1 -1
  331. package/geometry/support/axisAngle.js +1 -1
  332. package/geometry/support/axisAngleDegrees.js +1 -1
  333. package/geometry/support/buffer/internals/Vec3.js +1 -1
  334. package/geometry/support/clipRay.js +1 -1
  335. package/geometry/support/coordinateSystem.js +1 -1
  336. package/geometry/support/frustum.js +1 -1
  337. package/geometry/support/lineSegment.js +1 -1
  338. package/geometry/support/meshUtils/centerAt.js +1 -1
  339. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  340. package/geometry/support/meshUtils/loadExternal.js +1 -1
  341. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  342. package/geometry/support/meshUtils/merge.js +1 -1
  343. package/geometry/support/meshUtils/rotate.js +1 -1
  344. package/geometry/support/meshUtils/scale.js +1 -1
  345. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  346. package/geometry/support/plane.js +1 -1
  347. package/geometry/support/polygonUtils.js +1 -1
  348. package/geometry/support/ray.js +1 -1
  349. package/geometry/support/sphereUtils.js +1 -1
  350. package/geometry/support/triangle.js +1 -1
  351. package/geometry/support/vector.js +1 -1
  352. package/interfaces.d.ts +256 -188
  353. package/kernel.js +1 -1
  354. package/layers/FeatureLayer.js +1 -1
  355. package/layers/KnowledgeGraphLayer.js +1 -1
  356. package/layers/LinkChartLayer.js +1 -1
  357. package/layers/VoxelWasmPerSceneView.js +1 -1
  358. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  359. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  360. package/layers/graphics/sources/ParquetSource.js +1 -1
  361. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  362. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  363. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  364. package/layers/graphics/sources/support/QueryTask.js +1 -1
  365. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  366. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  367. package/layers/knowledgeGraph/layerUtils.js +1 -1
  368. package/layers/mixins/ArcGISImageService.js +1 -1
  369. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  370. package/layers/orientedImagery/transformations/utils.js +1 -1
  371. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  372. package/layers/support/Sublayer.js +1 -1
  373. package/layers/support/capabilities.js +1 -1
  374. package/layers/support/featurePopupQueryUtils.js +1 -1
  375. package/layers/support/layerUtils.js +1 -1
  376. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  377. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  378. package/layers/support/tiles3DUtils.js +1 -1
  379. package/layers/video/VideoCameraSensorModel.js +1 -1
  380. package/layers/voxel/VoxelVolume.js +1 -1
  381. package/layers/voxel/voxelPlaneUtils.js +1 -1
  382. package/package.json +3 -3
  383. package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
  384. package/rest/query/executePivotQuery.js +5 -0
  385. package/rest/query/operations/query.js +1 -1
  386. package/rest/query/operations/queryPivot.js +5 -0
  387. package/rest/query/operations/queryUtils.js +5 -0
  388. package/rest/support/PivotDefinition.js +5 -0
  389. package/rest/support/PivotQuery.js +5 -0
  390. package/rest/support/UnPivotDefinition.js +5 -0
  391. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  392. package/smartMapping/support/adapters/support/utils.js +1 -1
  393. package/support/basemapDefinitions.js +1 -1
  394. package/support/revision.js +1 -1
  395. package/views/2d/GoToManager.js +1 -1
  396. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  397. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  398. package/views/2d/engine/flow/dataUtils.js +1 -1
  399. package/views/2d/engine/flow/utils.js +1 -1
  400. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  401. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  402. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  403. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  404. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  405. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  406. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  407. package/views/2d/layers/RouteLayerView2D.js +1 -1
  408. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  409. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  410. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  411. package/views/2d/navigation/actions/Pan.js +1 -1
  412. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  413. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  414. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  415. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  416. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  417. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  418. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +5 -0
  419. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  420. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  421. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  422. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  423. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  424. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  425. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  426. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  431. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  432. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  433. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  434. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  435. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  436. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  437. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  438. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  439. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  440. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  441. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  442. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.js +1 -1
  443. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  444. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  445. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +5 -0
  446. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  447. package/views/3d/analysis/support/measurementUtils.js +1 -1
  448. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  449. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  450. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  451. package/views/3d/camera/constraintUtils/common.js +1 -1
  452. package/views/3d/camera/constraintUtils/distance.js +1 -1
  453. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  454. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  455. package/views/3d/camera/intersectionUtils.js +1 -1
  456. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  457. package/views/3d/environment/CloudsParameters.js +1 -1
  458. package/views/3d/environment/EnvironmentManager.js +1 -1
  459. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  460. package/views/3d/environment/Fog.js +1 -1
  461. package/views/3d/environment/MarsAtmosphere.js +1 -1
  462. package/views/3d/glTF/loader.js +1 -1
  463. package/views/3d/interactive/Manipulator3D.js +1 -1
  464. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  465. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  466. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  467. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  468. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  469. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  470. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  471. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  472. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  473. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  474. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  475. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  476. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  477. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  478. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  479. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  480. package/views/3d/interactive/manipulatorUtils.js +1 -1
  481. package/views/3d/interactive/support/viewUtils.js +1 -1
  482. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  483. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  484. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  485. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  486. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  487. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  488. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  489. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  490. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  491. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  492. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  493. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  494. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  495. package/views/3d/layers/FlowSubView3D.js +1 -1
  496. package/views/3d/layers/I3SMeshView3D.js +1 -1
  497. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  498. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  499. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  500. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  501. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  502. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  503. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  504. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  505. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  506. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  507. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  508. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  509. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  510. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  511. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  512. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  513. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  514. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  515. package/views/3d/layers/graphics/Labeler.js +1 -1
  516. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  517. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  518. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  519. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  520. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  521. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  522. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  523. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  524. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  525. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  526. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  527. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  528. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  529. package/views/3d/layers/support/uvUtils.js +1 -1
  530. package/views/3d/state/Frustum.js +1 -1
  531. package/views/3d/state/NearFarHeuristic.js +1 -1
  532. package/views/3d/state/controllers/FovController.js +1 -1
  533. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  534. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  535. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  536. package/views/3d/state/controllers/RotateController.js +1 -1
  537. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  538. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  539. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  540. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  541. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  542. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  543. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  544. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  545. package/views/3d/state/utils/navigationUtils.js +1 -1
  546. package/views/3d/state/utils/viewUtils.js +1 -1
  547. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  548. package/views/3d/support/RenderCoordsHelper.js +1 -1
  549. package/views/3d/support/cameraUtils.js +1 -1
  550. package/views/3d/support/cameraUtilsInternal.js +1 -1
  551. package/views/3d/support/dito.js +1 -1
  552. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  553. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  554. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  555. package/views/3d/support/flow/constants.js +1 -1
  556. package/views/3d/support/geometryUtils/ray.js +1 -1
  557. package/views/3d/support/intersectionUtils.js +1 -1
  558. package/views/3d/support/mathUtils.js +1 -1
  559. package/views/3d/support/orientedBoundingBox.js +1 -1
  560. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  561. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  562. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  563. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  564. package/views/3d/support/sunUtils.js +1 -1
  565. package/views/3d/support/viewpointUtils.js +1 -1
  566. package/views/3d/terrain/OverlayManager.js +1 -1
  567. package/views/3d/terrain/OverlayRenderer.js +1 -1
  568. package/views/3d/terrain/PatchGeometry.js +1 -1
  569. package/views/3d/terrain/PatchRenderData.js +1 -1
  570. package/views/3d/terrain/SphericalPatch.js +1 -1
  571. package/views/3d/terrain/TerrainRenderer.js +1 -1
  572. package/views/3d/terrain/TerrainSurface.js +1 -1
  573. package/views/3d/terrain/Tile.js +1 -1
  574. package/views/3d/webgl/RenderCamera.js +1 -1
  575. package/views/3d/webgl-engine/Stage.js +1 -1
  576. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  577. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  578. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  579. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  580. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  581. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +1 -1
  582. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  583. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  584. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  585. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  586. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  587. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  588. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  589. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  590. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +7 -7
  591. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  592. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  593. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  594. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  595. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  596. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  597. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  598. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  599. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  600. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  601. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  602. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  603. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  604. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  605. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  606. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  607. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  608. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  609. package/views/3d/webgl-engine/lib/Path.js +1 -1
  610. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  611. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  612. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  613. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  614. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  615. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  616. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  617. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  618. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  619. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  620. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  621. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  622. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  623. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  624. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  625. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  626. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  627. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  628. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  629. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  630. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  631. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  632. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  633. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  634. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  635. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  636. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  637. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  638. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  639. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  640. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  641. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  642. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  643. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  644. package/views/3d/webgl.js +1 -1
  645. package/views/DOMContainer.js +1 -1
  646. package/views/SceneView.js +1 -1
  647. package/views/View.js +1 -1
  648. package/views/View2D.js +1 -1
  649. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  650. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -0
  651. package/views/analysis/ElevationProfile/ElevationProfileError.js +5 -0
  652. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  653. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  654. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  655. package/views/analysis/ElevationProfile/elevationProfileErrors.js +5 -0
  656. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  657. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  658. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  659. package/views/analysis/ElevationProfile/elevationProfileLayerUtils.js +5 -0
  660. package/views/analysis/ExclusiveOperationManager.js +1 -1
  661. package/views/draw/support/Reshape.js +1 -1
  662. package/views/draw/support/createUtils.js +1 -1
  663. package/views/draw/support/helpMessageUtils3d.js +1 -1
  664. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  665. package/views/interactive/GraphicManipulator.js +1 -1
  666. package/views/interactive/coordinateHelper.js +1 -1
  667. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  668. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  669. package/views/interactive/sketch/constraintUtils.js +1 -1
  670. package/views/interactive/sketch/constraints.js +1 -1
  671. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  672. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  673. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  674. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  675. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  676. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  677. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  678. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  679. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  680. package/views/layers/FeatureLayerView.d.ts +1 -1
  681. package/views/layers/FeatureLayerView.js +1 -1
  682. package/views/layers/SceneLayerView.js +1 -1
  683. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  684. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  685. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  686. package/views/popupAdapter.js +1 -1
  687. package/views/support/angularMeasurementUtils.js +1 -1
  688. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  689. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  690. package/views/support/geometry3dUtils.js +1 -1
  691. package/widgets/Daylight/DaylightViewModel.js +1 -1
  692. package/widgets/Daylight.js +1 -1
  693. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  694. package/widgets/Editor/EditorViewModel.js +1 -1
  695. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  696. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  697. package/widgets/Editor/UpdateWorkflow.js +1 -1
  698. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  699. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  700. package/widgets/Editor/components/UploadDetails.js +1 -1
  701. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js +5 -0
  702. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +5 -0
  703. package/widgets/Editor/css.js +1 -1
  704. package/widgets/Editor/modelUploadUtils.js +1 -1
  705. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  706. package/widgets/Editor/workflowUtils.js +1 -1
  707. package/widgets/Editor.js +1 -1
  708. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  709. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  710. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  711. package/widgets/FeatureTable/FieldColumn.js +1 -1
  712. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  713. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  714. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  715. package/widgets/Legend/LegendViewModel.js +1 -1
  716. package/widgets/Legend.js +1 -1
  717. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  718. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  719. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  720. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  721. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  722. package/widgets/OrientedImageryViewer.js +1 -1
  723. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  724. package/widgets/PanoramicViewer/PanoramicZoomManager.js +5 -0
  725. package/widgets/PanoramicViewer/PanoramicZoomViewModel.js +1 -1
  726. package/widgets/PanoramicViewer/constants.js +1 -1
  727. package/widgets/PanoramicViewer/support/ClosestMap.js +5 -0
  728. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  729. package/widgets/PanoramicViewer/support/PanoramicMeshWorker.js +1 -1
  730. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +5 -0
  731. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +5 -0
  732. package/widgets/PanoramicViewer/support/importUtils.js +5 -0
  733. package/widgets/PanoramicViewer/utils.js +1 -1
  734. package/widgets/PanoramicViewer.js +1 -1
  735. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  736. package/widgets/support/forms/formUtils.js +1 -1
  737. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +0 -4
  738. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +0 -1
  739. package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +0 -1
  740. package/assets/esri/core/workers/chunks/0ca5060c81a1a05b8be3.js +0 -1
  741. package/assets/esri/core/workers/chunks/1214c126af0de25a4b4a.js +0 -1
  742. package/assets/esri/core/workers/chunks/147f6e7b147beaa4ed29.js +0 -1
  743. package/assets/esri/core/workers/chunks/1f2d13466c60a6b57717.js +0 -1
  744. package/assets/esri/core/workers/chunks/23e600e368ac829680b5.js +0 -1
  745. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +0 -1
  746. package/assets/esri/core/workers/chunks/3dcdbba706a8034b6ba3.js +0 -1
  747. package/assets/esri/core/workers/chunks/3e11a893271caa11a881.js +0 -1
  748. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +0 -1
  749. package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +0 -1
  750. package/assets/esri/core/workers/chunks/56b3bb68b61b77138186.js +0 -1
  751. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +0 -1
  752. package/assets/esri/core/workers/chunks/633faa9cec8988ab06af.js +0 -33
  753. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +0 -1
  754. package/assets/esri/core/workers/chunks/8d63b42aea32ce2e5d09.js +0 -1
  755. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +0 -1
  756. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +0 -1
  757. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +0 -1
  758. package/assets/esri/core/workers/chunks/c473b15d4d52f0a63d20.js +0 -1
  759. package/assets/esri/core/workers/chunks/c547692862df95d22818.js +0 -1
  760. package/assets/esri/core/workers/chunks/c84665db250b05e2829d.js +0 -1
  761. package/assets/esri/core/workers/chunks/c86ca87959f04075e834.js +0 -1
  762. package/assets/esri/core/workers/chunks/ef75cad6570b14a42b62.js +0 -1
  763. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +0 -1
  764. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +0 -5
  765. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +0 -5
  766. package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import w from"../../../geometry/Extent.js";import q from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as x}from"../applyEditsUtils.js";import{createDrawingInfo as v}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as J}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import C from"../../../time/TimeExtent.js";import{isSafeToEditVersion as L,isVersionInEditSession as k,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let G=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,uniqueIdFields:i,url:t.path})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);J(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,w={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await L(this.layer.url,g,!0);const q=k(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(w.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),w.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),w.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(w.adds=d.length?JSON.stringify(d):null,w.updates=y.length?JSON.stringify(y):null,w.deletes=h.length?u?JSON.stringify(h):h.join(","):null,w.attachments=m&&JSON.stringify(m),w.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:w});q&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!F(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&w.fromJSON(c),timeExtent:l&&C.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(H)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=v(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new q(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:x(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],G.prototype,"type",void 0),e([f({constructOnly:!0})],G.prototype,"layer",void 0),e([f({constructOnly:!0})],G.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],G.prototype,"queryTask",null),G=e([g("esri.layers.graphics.sources.FeatureLayerSource")],G);const H=1e3;export{G as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import q from"../../../geometry/Extent.js";import w from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as x}from"../applyEditsUtils.js";import{createDrawingInfo as v}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as J}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import k from"../../../time/TimeExtent.js";import{isSafeToEditVersion as C,isVersionInEditSession as L,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let G=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,uniqueIdFields:i,url:t.path})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);J(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,q={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await C(this.layer.url,g,!0);const w=L(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(q.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),q.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),q.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(q.adds=d.length?JSON.stringify(d):null,q.updates=y.length?JSON.stringify(y):null,q.deletes=h.length?u?JSON.stringify(h):h.join(","):null,q.attachments=m&&JSON.stringify(m),q.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:q});w&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!F(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&q.fromJSON(c),timeExtent:l&&k.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(H)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=v(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new w(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:x(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],G.prototype,"type",void 0),e([f({constructOnly:!0})],G.prototype,"layer",void 0),e([f({constructOnly:!0})],G.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],G.prototype,"queryTask",null),G=e([g("esri.layers.graphics.sources.FeatureLayerSource")],G);const H=1e3;export{G 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as s}from"../../../core/Loadable.js";import{escapeRegExpString as r}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/SpatialReference.js";import{typeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{queryFeatureSetJSON as u,crsDefault as n,getSpatialReferenceWkid as c,getServerLandingPage as l,getServerConformance as d,getServerCollections as m,getServerOpenApi as y,getCollectionDefinition as f,crsPrefix as g}from"../../ogc/ogcFeatureUtils.js";import{zeroQueryBins as h}from"../../support/capabilities.js";import S from"../../../rest/support/FeatureSet.js";let C=class extends s{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:r},layer:{apiKey:o,customParameters:p,effectiveMaxRecordCount:i}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:i,queryParameters:{apiKey:o,customParameters:p},spatialReference:s,supportedCrs:r}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(e=>S.fromJSON(e))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>u(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const s=new RegExp(`^${r(t)}$`,"i");return e.conformsTo.some(e=>s.test(e))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:h,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??n,s=c(t);return null==s?i.WGS84:new i({wkid:s})}_getSupportedSpatialReferences(e,t){const s="#/crs",r=e.crs??[n],o=r.includes(s)?r.filter(e=>e!==s).concat(t.crs??[]):r,p=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return o.filter(e=>!p.test(e))}async _loadOGCServices(e,s){const o=null!=s?s.signal:null,{apiKey:p,collectionId:i,customParameters:u,fields:n,geometryType:h,hasZ:S,objectIdField:C,timeInfo:R,url:w}=e,v={fields:n?.map(e=>e.toJSON()),geometryType:a.toJSON(h),hasZ:S??!1,objectIdField:C,timeInfo:R?.toJSON()},x={apiKey:p,customParameters:u,signal:o},O=await l(w,x),[j,D]=await Promise.all([d(O,x),m(O,x)]);if(!this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new t("ogc-feature-layer:no-geojson-support","Server does not support geojson");const F=D.collections.find(({id:e})=>e===i);if(!F)throw new t("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const T=this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await y(O,x):null,A=await f(F,v,x),Q=this._getMaxRecordCount(T),b=this._getCapabilities(A.hasZ,Q),q=this._getStorageSpatialReference(F).toJSON(),P=this._getSupportedSpatialReferences(F,D),G=new RegExp(`^${r(g)}`,"i"),_={};for(const t of P){const e=c(t);null!=e&&(_[e]||(_[e]=t.replace(G,"")))}this.featureDefinition={capabilities:b,collection:F,layerDefinition:A,spatialReference:q,supportedCrs:_}}};e([o()],C.prototype,"featureDefinition",void 0),e([o({constructOnly:!0})],C.prototype,"layer",void 0),e([o()],C.prototype,"type",void 0),C=e([p("esri.layers.graphics.sources.OGCFeatureSource")],C);export{C as OGCFeatureSource};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as s}from"../../../core/Loadable.js";import{escapeRegExpString as r}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/SpatialReference.js";import{typeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{queryFeatureSetJSON as u,crsDefault as n,getSpatialReferenceWkid as c,getServerLandingPage as l,getServerConformance as d,getServerCollections as m,getServerOpenApi as y,getCollectionDefinition as f,crsPrefix as g}from"../../ogc/ogcFeatureUtils.js";import{zeroQueryBins as h}from"../../support/capabilities.js";import S from"../../../rest/support/FeatureSet.js";let C=class extends s{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:r},layer:{apiKey:o,customParameters:p,effectiveMaxRecordCount:i}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:i,queryParameters:{apiKey:o,customParameters:p},spatialReference:s,supportedCrs:r}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(e=>S.fromJSON(e))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>u(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const s=new RegExp(`^${r(t)}$`,"i");return e.conformsTo.some(e=>s.test(e))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:h,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??n,s=c(t);return null==s?i.WGS84:new i({wkid:s})}_getSupportedSpatialReferences(e,t){const s="#/crs",r=e.crs??[n],o=r.includes(s)?r.filter(e=>e!==s).concat(t.crs??[]):r,p=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return o.filter(e=>!p.test(e))}async _loadOGCServices(e,s){const o=null!=s?s.signal:null,{apiKey:p,collectionId:i,customParameters:u,fields:n,geometryType:h,hasZ:S,objectIdField:C,timeInfo:R,url:v}=e,w={fields:n?.map(e=>e.toJSON()),geometryType:a.toJSON(h),hasZ:S??!1,objectIdField:C,timeInfo:R?.toJSON()},x={apiKey:p,customParameters:u,signal:o},O=await l(v,x),[j,D]=await Promise.all([d(O,x),m(O,x)]);if(!this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new t("ogc-feature-layer:no-geojson-support","Server does not support geojson");const F=D.collections.find(({id:e})=>e===i);if(!F)throw new t("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const T=this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await y(O,x):null,A=await f(F,w,x),Q=this._getMaxRecordCount(T),P=this._getCapabilities(A.hasZ,Q),b=this._getStorageSpatialReference(F).toJSON(),q=this._getSupportedSpatialReferences(F,D),G=new RegExp(`^${r(g)}`,"i"),_={};for(const t of q){const e=c(t);null!=e&&(_[e]||(_[e]=t.replace(G,"")))}this.featureDefinition={capabilities:P,collection:F,layerDefinition:A,spatialReference:b,supportedCrs:_}}};e([o()],C.prototype,"featureDefinition",void 0),e([o({constructOnly:!0})],C.prototype,"layer",void 0),e([o()],C.prototype,"type",void 0),C=e([p("esri.layers.graphics.sources.OGCFeatureSource")],C);export{C as OGCFeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{Loadable as s}from"../../../core/Loadable.js";import e from"../../../core/Logger.js";import{open as r}from"../../../core/workers/workers.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Extent.js";import{toParquetJSONGeometryType as i}from"../../support/parquetUtils.js";import u from"../../../rest/support/FeatureSet.js";let n=class extends s{constructor(t){super(t),this.type="parquet"}load(t){const s=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(s)),Promise.resolve(this)}destroy(){this._connection.destroy()}setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{e.getLogger(this).warn("Failed to update customParameters")})}async updateFiles(t){await this._proxy.updateFiles(t)}async queryFeaturesJSON(t,s={}){return await this.load(s),this._proxy.queryFeatures(t.toJSON(),{signal:s?.signal})}async queryFeatures(t,s={}){const e=await this.queryFeaturesJSON(t,{signal:s?.signal});return u.fromJSON(e)}async queryObjectIds(t,s){return await this._proxy.queryObjectIds(t.toJSON(),{signal:s?.signal})}async queryFeatureCount(t,s){return this._proxy.queryFeatureCount(t.toJSON(),{signal:s?.signal})}async queryExtent(t,s){if(null==this.layer.encoding)return e.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:s?.signal});return{count:r.count,extent:a.fromJSON(r.extent)}}async _initialize(t){this._connection=await r("ParquetSourceWorker",{strategy:"dedicated"}),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:s}=await this._proxy.load({urls:this.layer.urls.items,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?i(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),encoding:this.layer.encoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});this.sourceJSON=s,this.capabilities=l()}};function l(){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}t([o()],n.prototype,"type",void 0),t([o({constructOnly:!0})],n.prototype,"layer",void 0),t([o()],n.prototype,"sourceJSON",void 0),t([o()],n.prototype,"capabilities",void 0),n=t([p("esri.layers.graphics.sources.ParquetSource")],n);export{n as ParquetSource};
5
+ import{__decorate as t}from"tslib";import{Loadable as e}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{open as s}from"../../../core/workers/workers.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Extent.js";import{toParquetJSONGeometryType as n}from"../../support/parquetUtils.js";import u from"../../../rest/support/FeatureSet.js";let l=class extends e{constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),Promise.resolve(this)}destroy(){this._connection.destroy()}setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{r.getLogger(this).warn("Failed to update customParameters")})}async updateFiles(t){await this._proxy.updateFiles(t)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return u.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.encoding)return r.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const s=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:s.count,extent:a.fromJSON(s.extent)}}async _initialize(t){this._connection=await s("ParquetSourceWorker",{strategy:"dedicated"}),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:e,capabilities:r}=await this._proxy.load({urls:this.layer.urls.items,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?n(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),encoding:this.layer.encoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});this.sourceJSON=e,this.capabilities=r}};t([o()],l.prototype,"type",void 0),t([o({constructOnly:!0})],l.prototype,"layer",void 0),t([o()],l.prototype,"sourceJSON",void 0),t([o()],l.prototype,"capabilities",void 0),l=t([i("esri.layers.graphics.sources.ParquetSource")],l);export{l as ParquetSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as h}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as j,createDefaultAttributesFunction as F,createDrawingInfo as E}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as b,loadGeometryEngineForSimplify as T,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as O,getFieldDefaultLength as Q}from"../../../support/fieldUtils.js";import{utc as k}from"../../../../time/constants.js";const D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:b};class A{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const m=new R(o);let h=m.get(d);h?("esriFieldTypeString"!==h.type&&(h.type="esriFieldTypeOID"),h.editable=!1,h.nullable=!1,d=h.name):(h={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(h));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==h.name){const e=O(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=Q(a))}if(c){if(c.startTimeField){const e=m.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=m.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=m.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?E(l):void 0,b=m.dateFields.length?{timeZoneIANA:k}:null,T={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:I??void 0,templates:j(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}},w={type:"object-id",fieldName:d};this._queryEngine=new f({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:w,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(h);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(_,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,T.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:A,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=A,v){const{start:e,end:t}=v;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([T(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(h(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=w(i,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[s],r.push(n))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:o,spatialReference:u,featureStore:l,fieldsIndex:p}=this._queryEngine,c=[],y={type:"object-id",fieldName:o};for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(p,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[o];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??u;d.geometry=h(S(d.geometry,e),e,u)}c.push(d),s.push(q(d.attributes[o]))}}l.addMany(d([],c,i,a,r,y))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,d={type:"object-id",fieldName:a};for(const y of t){const{attributes:t,geometry:m}=y,f=t?.[a];if(null==f){e.push(x(`Identifier field ${a} missing`));continue}if(!u.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const g=p(u.getFeature(f),s,r,i);if(null!=m){if(s!==n(m)){e.push(x("Incorrect geometry type."));continue}const t=m.spatialReference??o;g.geometry=h(S(m,t),t,o)}if(t){const s=w(l,g.attributes,t);if(s){e.push(s);continue}}u.add(c(g,s,r,i,d)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{A as default};
5
+ import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as h}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as j,createDefaultAttributesFunction as F,createDrawingInfo as E}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as b,loadGeometryEngineForSimplify as T,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as O,getFieldDefaultLength as Q}from"../../../support/fieldUtils.js";import{utc as k}from"../../../../time/constants.js";const D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:b};class A{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const m=new R(o);let h=m.get(d);h?("esriFieldTypeString"!==h.type&&(h.type="esriFieldTypeOID"),h.editable=!1,h.nullable=!1,d=h.name):(h={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(h));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==h.name){const e=O(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=Q(a))}if(c){if(c.startTimeField){const e=m.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=m.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=m.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?E(l):void 0,b=m.dateFields.length?{timeZoneIANA:k}:null,T={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:I??void 0,templates:j(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}},w={type:"object-id",fieldName:d};this._queryEngine=new f({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:w,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(h);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(_,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,T.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:A,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=A,v){const{start:e,end:t}=v;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([T(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(h(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=w(i,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[s],r.push(n))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:o,spatialReference:u,featureStore:l,fieldsIndex:p}=this._queryEngine,c=[],y={type:"object-id",fieldName:o};for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(p,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[o];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??u;d.geometry=h(S(d.geometry,e),e,u)}c.push(d),s.push(q(d.attributes[o]))}}l.addMany(d([],c,i,a,r,y))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,d={type:"object-id",fieldName:a};for(const y of t){const{attributes:t,geometry:m}=y,f=t?.[a];if(null==f){e.push(x(`Identifier field ${a} missing`));continue}if(!u.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const g=p(u.getFeature(f),s,r,i);if(null!=m){if(s!==n(m)){e.push(x("Incorrect geometry type."));continue}const t=m.spatialReference??o;g.geometry=h(S(m,t),t,o)}if(t){const s=w(l,g.attributes,t);if(s){e.push(s);continue}}u.add(c(g,s,r,i,d)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{A 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import u from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import E from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as _,getFieldDefaultValue as x}from"../../../support/fieldUtils.js";import{utc as R}from"../../../../time/constants.js";const q=s,O={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:h};function w(e){return i(e)?null!=e.z:!!e.hasZ}function Q(e){return i(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,r=this._inferLayerProperties(s,t.fields),n=t.fields||[],a=null!=t.hasM?t.hasM:!!r.hasM,p=null!=t.hasZ?t.hasZ:!!r.hasZ,h=!t.spatialReference&&!r.spatialReference,g=h?q:t.spatialReference||r.spatialReference,I=h?O:null,b=t.geometryType||r.geometryType,F=!b;let j=t.objectIdField||r.objectIdField,w=t.timeInfo;const Q=new E(n);if(!F&&(h&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!j)throw new e("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(r.objectIdField&&j!==r.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${j}" doesn't match the field name "${r.objectIdField}", found in the provided fields`}),j=r.objectIdField),j&&!r.objectIdField){const e=Q.get(j);e?(j=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):n.unshift({alias:j,name:j,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of n){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===j&&(o.type="esriFieldTypeOID"),!T.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=_(o))}const S={};for(const e of n)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=x(e);void 0!==t&&(S[e.name]=t)}if(w){if(w.startTimeField){const e=Q.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=Q.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=Q.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const v=Q.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??R}:null;this._createDefaultAttributes=c(S,j);const A={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:m(b),templates:y(S),extent:I,geometryType:b,objectIdField:j,fields:n,hasZ:p,hasM:a,timeInfo:w,dateFieldsTimeReference:v},assignedObjectIds:{}},M={type:"object-id",fieldName:j};if(this._queryEngine=new f({fieldsIndex:E.fromLayerJSON({fields:n,timeInfo:w,dateFieldsTimeReference:v}),geometryType:b,hasM:a,hasZ:p,featureIdInfo:M,spatialReference:g,featureStore:new u({geometryType:b,hasM:a,hasZ:p}),timeInfo:w}),!s?.length)return this._nextObjectId=o,A;const Z=l(j,s);return this._nextObjectId=Z+1,await d(s,g),this._loadInitialFeatures(A,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),d(e.adds,t),d(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,r,n=null,a=null,o=null;for(const l of e){const e=l.geometry;if(null!=e&&(n||(n=t(e)),a||(a=e.spatialReference),null==s&&(s=w(e)),null==r&&(r=Q(e)),n&&a&&null!=s&&null!=r))break}if(i&&i.length){let e=null;i.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:n,spatialReference:a,objectIdField:o,hasM:r,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:n,hasZ:a,objectIdField:o,spatialReference:l,featureStore:u,fieldsIndex:d}=this._queryEngine,f=[],c={type:"object-id",fieldName:o};for(const r of i){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==t(r.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),n=b(d,i,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(i,r.attributes,!0),r.attributes=i,null!=r.uid&&(e.assignedObjectIds[r.uid]=r.attributes[o]),null!=r.geometry&&(r.geometry=p(r.geometry,r.geometry.spatialReference,l)),f.push(r))}u.addMany(r([],f,s,a,n,c));const{fullExtent:y,timeExtent:m}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=y,m){const{start:t,end:i}=m;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),s?.length){for(const e of s)r.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,i){const{addResults:s}=e,{geometryType:n,hasM:a,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,featureIdInfo:f,fieldsIndex:c}=this._queryEngine,y=[];for(const r of i){if(r.geometry&&n!==t(r.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),a=b(c,i,r.attributes);if(a)s.push(a);else{if(this._assignObjectId(i,r.attributes),r.attributes=i,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??u;r.geometry=p(j(r.geometry,e),e,u)}y.push(r),s.push(F(r.attributes[l]))}}d.addMany(r([],y,n,o,a,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:r,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:f,featureIdInfo:c}=this._queryEngine;for(const y of i){const{attributes:i,geometry:m}=y,h=i?.[l];if(null==h){e.push(I(`Identifier field ${l} missing`));continue}if(!d.has(h)){e.push(I(`Feature with object id ${h} missing`));continue}const g=n(d.getFeature(h),s,o,r);if(null!=m){if(s!==t(m)){e.push(I("Incorrect geometry type."));continue}const i=m.spatialReference??u;g.geometry=p(j(m,i),i,u)}if(i){const t=b(f,g.attributes,i);if(t){e.push(t);continue}}d.add(a(g,s,o,r,c)),e.push(F(h))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}export{S as default};
5
+ import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import u from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import E from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as _,getFieldDefaultValue as x}from"../../../support/fieldUtils.js";import{utc as R}from"../../../../time/constants.js";const q=s,O={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:h};function Q(e){return i(e)?null!=e.z:!!e.hasZ}function w(e){return i(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,r=this._inferLayerProperties(s,t.fields),n=t.fields||[],a=null!=t.hasM?t.hasM:!!r.hasM,p=null!=t.hasZ?t.hasZ:!!r.hasZ,h=!t.spatialReference&&!r.spatialReference,g=h?q:t.spatialReference||r.spatialReference,I=h?O:null,b=t.geometryType||r.geometryType,F=!b;let j=t.objectIdField||r.objectIdField,Q=t.timeInfo;const w=new E(n);if(!F&&(h&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!j)throw new e("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(r.objectIdField&&j!==r.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${j}" doesn't match the field name "${r.objectIdField}", found in the provided fields`}),j=r.objectIdField),j&&!r.objectIdField){const e=w.get(j);e?(j=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):n.unshift({alias:j,name:j,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of n){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===j&&(o.type="esriFieldTypeOID"),!T.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=_(o))}const S={};for(const e of n)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=x(e);void 0!==t&&(S[e.name]=t)}if(Q){if(Q.startTimeField){const e=w.get(Q.startTimeField);e?(Q.startTimeField=e.name,e.type="esriFieldTypeDate"):Q.startTimeField=null}if(Q.endTimeField){const e=w.get(Q.endTimeField);e?(Q.endTimeField=e.name,e.type="esriFieldTypeDate"):Q.endTimeField=null}if(Q.trackIdField){const e=w.get(Q.trackIdField);e?Q.trackIdField=e.name:(Q.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:Q}}))}Q.startTimeField||Q.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:Q}}),Q=null)}const v=w.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??R}:null;this._createDefaultAttributes=c(S,j);const A={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:m(b),templates:y(S),extent:I,geometryType:b,objectIdField:j,fields:n,hasZ:p,hasM:a,timeInfo:Q,dateFieldsTimeReference:v},assignedObjectIds:{}},M={type:"object-id",fieldName:j};if(this._queryEngine=new f({fieldsIndex:E.fromLayerJSON({fields:n,timeInfo:Q,dateFieldsTimeReference:v}),geometryType:b,hasM:a,hasZ:p,featureIdInfo:M,spatialReference:g,featureStore:new u({geometryType:b,hasM:a,hasZ:p}),timeInfo:Q}),!s?.length)return this._nextObjectId=o,A;const Z=l(j,s);return this._nextObjectId=Z+1,await d(s,g),this._loadInitialFeatures(A,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),d(e.adds,t),d(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,r,n=null,a=null,o=null;for(const l of e){const e=l.geometry;if(null!=e&&(n||(n=t(e)),a||(a=e.spatialReference),null==s&&(s=Q(e)),null==r&&(r=w(e)),n&&a&&null!=s&&null!=r))break}if(i&&i.length){let e=null;i.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:n,spatialReference:a,objectIdField:o,hasM:r,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:n,hasZ:a,objectIdField:o,spatialReference:l,featureStore:u,fieldsIndex:d}=this._queryEngine,f=[],c={type:"object-id",fieldName:o};for(const r of i){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==t(r.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),n=b(d,i,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(i,r.attributes,!0),r.attributes=i,null!=r.uid&&(e.assignedObjectIds[r.uid]=r.attributes[o]),null!=r.geometry&&(r.geometry=p(r.geometry,r.geometry.spatialReference,l)),f.push(r))}u.addMany(r([],f,s,a,n,c));const{fullExtent:y,timeExtent:m}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=y,m){const{start:t,end:i}=m;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),s?.length){for(const e of s)r.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,i){const{addResults:s}=e,{geometryType:n,hasM:a,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,featureIdInfo:f,fieldsIndex:c}=this._queryEngine,y=[];for(const r of i){if(r.geometry&&n!==t(r.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),a=b(c,i,r.attributes);if(a)s.push(a);else{if(this._assignObjectId(i,r.attributes),r.attributes=i,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??u;r.geometry=p(j(r.geometry,e),e,u)}y.push(r),s.push(F(r.attributes[l]))}}d.addMany(r([],y,n,o,a,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:r,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:f,featureIdInfo:c}=this._queryEngine;for(const y of i){const{attributes:i,geometry:m}=y,h=i?.[l];if(null==h){e.push(I(`Identifier field ${l} missing`));continue}if(!d.has(h)){e.push(I(`Feature with object id ${h} missing`));continue}const g=n(d.getFeature(h),s,o,r);if(null!=m){if(s!==t(m)){e.push(I("Incorrect geometry type."));continue}const i=m.spatialReference??u;g.geometry=p(j(m,i),i,u)}if(i){const t=b(f,g.attributes,i);if(t){e.push(t);continue}}d.add(a(g,s,o,r,c)),e.push(F(h))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}export{S 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import o from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{QueueProcessor as a}from"../../../../core/QueueProcessor.js";import u from"../../../../geometry/SpatialReference.js";import{set as l,create as f,expandWithRect as c,expandWithAABB as d,negativeInfinity as m,fromRect as p}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as h,QueryEngine as y}from"../../data/QueryEngine.js";import{QueryEngineResult as g}from"../../data/QueryEngineResult.js";import{createDrawingInfo as _}from"./clientSideDefaults.js";import w from"../../../support/Field.js";import I from"../../../support/FieldsIndex.js";import{collectSQLFieldNames as R}from"../../../support/fieldUtils.js";import{fromParquetEncodingJSON as x}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as F,fromParquetJSONGeometryType as S,toParquetJSONGeometryType as j}from"../../../support/parquetUtils.js";import{createParquetFile as b,readGeoMetadata as q}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as C}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as O}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as v}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as Q}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as E}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const G=new C,T=8e3,P="__OBJECTID";class N{constructor(){this._fileInfos=new Map,this._queue=new a({concurrency:1,process:(e,t)=>this._executeQuery(e,t)})}async load(s){const i=s.spatialReference?u.fromJSON(s.spatialReference):void 0;if(i&&!i.isWGS84&&!i.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const a=await F({urls:new r(s.urls),fields:s.fields?.map(e=>w.fromJSON(e)),encoding:s.encoding?x(s.encoding):s.encoding,geometryType:s.geometryType?S(s.geometryType):null,spatialReference:i},{customParameters:s.customParameters});let d;if(a.geometryType&&a.encoding){if(!a.spatialReference)throw new o("parquet:unsupported","SpatialReference must be defined");if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(n.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:a.spatialReference}),a.spatialReference=u.WGS84),d={geometryType:j(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.encoding.toJSON(),displayOptimization:a.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=d;for(const e of s.urls){const t=await b(e,{geometryInfo:d,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(e,{index:this._fileInfos.size,file:t})}const p=this._fileInfos.values().next().value?.file;if(!p)return{layerDefinition:{}};const{fields:h}=a;if(null==h)throw new o("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",h);h.push(new w({name:P,type:"oid",alias:P}));const y={fields:h.map(e=>({...e.toJSON(),column:p.columnForFieldName(e.name)})),timeZoneByFieldName:null},g=I.fromJSON(y);this._fieldsIndex=g;const R=j(a.geometryType??"point");if(this._metadata=Q.createFeature({fieldsIndex:y,geometryType:R,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:u.fromJSON(d?.spatialReference),aggregateAdapter:null,timeInfo:null,definitionExpression:null},a.spatialReference&&(this._fullExtent=W(this._fileInfos.values(),a.spatialReference.toJSON())),null==this._fullExtent&&"location"===a.encoding?.type){const{latitudeFieldName:r,longitudeFieldName:s}=a.encoding,o=this._fieldsIndex.get(r)?.column,n=this._fieldsIndex.get(s)?.column,i=l(f(),m);for(const a of this._fileInfos.values())for(const r of a.file.rowGroups()){const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.columnDescriptorForAttribute(o),!1),a=e(s,r.columnDescriptorForAttribute(n),!1),u=[a.minValue(),t.minValue(),a.maxValue(),t.maxValue()];c(i,u),r.free()}catch(q){s.error=q,s.hasError=!0}finally{t(s)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:a.spatialReference?.toJSON()}}return{layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:_(R),extent:this._fullExtent??void 0,geometryType:R,encoding:a.encoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.file.free();this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.file.free(),this._fileInfos.delete(r));for(const r of t){const e=await b(r,{geometryInfo:this._geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(r,{index:this._fileInfos.size,file:e})}}async queryFeatures(e,t){if(this._validateQuery(e),e.objectIds?.length){return(await this._enqueueQuery(e,t)).createQueryResponse()}e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0;return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){if(this._validateQuery(e),!A(e))return this._getFeatureCount();e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.resultOffset=e.resultOffset??0,delete e.outFields,delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponseForCount()}async queryObjectIds(e,t){if(this._validateQuery(e),!A(e))return Array.from({length:this._getFeatureCount()},(e,t)=>t);e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0,delete e.returnGeometry,delete e.outFields;return(await this._enqueueQuery(e,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){if(this._validateQuery(e),this._fullExtent&&!A(e))return{count:this._getFeatureCount(),extent:this._fullExtent};const r=s(this._metadata.spatialReference);e.resultOffset=e.resultOffset??0,e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.returnGeometry=!0,delete e.outFields;const o=l(f(),m),n=f(),i=await this._enqueueQuery(e,t);let a=0;for(const s of i.items)s.getBounds(n)&&(d(o,n),a+=1);return{count:a,extent:h(o,r,e.outSR?s(e.outSR):r,r,!1)}}_getFeatureCount(){return Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(e.outStatistics)throw new o("parquet:unsupported","Statistics queries are not supported",{query:e});if(e.orderByFields?.length)throw new o("parquet:unsupported","Queries using orderBy are not supported",{query:e})}async*_fetchChunks(e,t){for(const r of this._fileInfos.values()){const s=r.file.numRows(),o=Math.ceil(s/T);for(let n=0;n<o;n++){const s=n*T,o=await r.file.readChunk(s,T,e.fields,e.returnGeometry,t);for(const e of o){const t=new E(this._metadata,this._fieldsIndex,e,0,r.index),s=new O(t,null,0,!1),o=k(this._metadata,[s],this._queryEngineParams);yield o}}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.objectIds?.length)for(const i of this._fileInfos.values()){const s=[],o=(await i.file.readChunksByRowId(new Uint32Array(e.objectIds),r.fields,r.returnGeometry,t)).map((e,t)=>new E(this._metadata,this._fieldsIndex,e,t,i.index)).map((e,t)=>new O(e,null,t,!1)),n=k(this._metadata,o,this._queryEngineParams),a=await n.executeQueryForOpaqueFeatures(e,t);for(const e of a)s.push(e);return new g(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}let s=e.resultRecordCount,o=e.resultOffset;i(s),i(o),delete e.resultRecordCount,delete e.resultOffset;const n=[];for await(const i of this._fetchChunks(r,t)){const r=await i.executeQueryForOpaqueFeatures(e,t);if(r.length>o){const t=r.slice(o,Math.min(o+s,r.length));for(const e of t)n.push(e);if(o=0,s-=t.length,0===s)return new g(n,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}else o-=r.length}return new g(n,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}async _getReadParams(e){const t=new Set;if(e.where&&await R(t,this._fieldsIndex,e.where),e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:this._getAttributeIds(Array.from(t)),returnGeometry:!!e.returnGeometry||!!e.geometry}}_getAttributeIds(e){if(null==e)return new Uint32Array;if(e.includes("*"))return new Uint32Array(this._fieldsIndex.fields.map(e=>e.column).filter(e=>null!=e));const t=[];for(const r of e){const e=this._fieldsIndex.get(r);if(null==e)throw new o("unknown-field",`Field ${r} does not exist`);null==e.column||t.push(e.column)}return new Uint32Array(t)}}function A(e){return Object.keys(e).some(e=>M(e))}function M(e){switch(e){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"where":case"objectIds":case"historicMoment":return!0;default:return!1}}function k(e,t,r){const s=new v(()=>e);for(const o of t)s.insert(o);return new y({...r,featureStore:s})}function J(e){switch(e.length){case 4:return p(f(),e);case 6:return e;default:throw new o("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function W(e,t){const r=l(f(),m);for(const s of e){const e=q(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const o=J(t.bbox);d(r,o)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}export{N as default};
5
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import s from"../../../../core/Collection.js";import{toConst as r}from"../../../../core/compilerUtils.js";import o from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import a from"../../../../geometry/SpatialReference.js";import{set as u,create as p,expandWithRect as l,expandWithAABB as c,negativeInfinity as d,fromRect as f}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as m,QueryEngine as y}from"../../data/QueryEngine.js";import{QueryEngineResult as h}from"../../data/QueryEngineResult.js";import{createDrawingInfo as g}from"./clientSideDefaults.js";import _ from"../../../support/Field.js";import w from"../../../support/FieldsIndex.js";import{collectSQLFieldNames as I}from"../../../support/fieldUtils.js";import{fromParquetEncodingJSON as R}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as x,fromParquetJSONGeometryType as S,toParquetJSONGeometryType as F}from"../../../support/parquetUtils.js";import{createParquetFile as C,readGeoMetadata as q}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as b}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as v}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as O}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as j}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as Q}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const A=new b,B=8e3,T="__OBJECTID";class G{constructor(){this._fileInfos=new Map,this._queue=new n({concurrency:1,process:(e,t)=>this._executeQuery(e,t)})}async load(r){const n=r.spatialReference?a.fromJSON(r.spatialReference):void 0;if(n&&!n.isWGS84&&!n.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const c=await x({urls:new s(r.urls),fields:r.fields?.map(e=>_.fromJSON(e)),encoding:r.encoding?R(r.encoding):r.encoding,geometryType:r.geometryType?S(r.geometryType):null,spatialReference:n},{customParameters:r.customParameters});let f;if(c.geometryType&&c.encoding){if(!c.spatialReference)throw new o("parquet:unsupported","SpatialReference must be defined");if(!c.spatialReference.isGeographic&&!c.spatialReference.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");c.spatialReference.isGeographic&&!c.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:c.spatialReference}),c.spatialReference=a.WGS84),f={geometryType:F(c.geometryType),spatialReference:c.spatialReference.toJSON(),encoding:c.encoding.toJSON(),displayOptimization:c.displayOptimization}}this.setCustomParameters(r.customParameters),this._geometryInfo=f;for(const e of r.urls){const t=await C(e,{geometryInfo:f,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(e,{index:this._fileInfos.size,file:t})}this._capabilities=k(await this.getFileStatistics());const m=this._fileInfos.values().next().value?.file;if(!m)return{layerDefinition:{},capabilities:k(null)};const{fields:y}=c;if(null==y)throw new o("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",y);y.push(new _({name:T,type:"oid",alias:T}));const h={fields:y.map(e=>({...e.toJSON(),column:m.columnForFieldName(e.name)})),timeZoneByFieldName:null},I=w.fromJSON(h);this._fieldsIndex=I;const q=F(c.geometryType??"point");if(this._metadata=j.createFeature({fieldsIndex:h,geometryType:q,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:c.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:f?.spatialReference??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},c.spatialReference&&(this._fullExtent=U(this._fileInfos.values(),c.spatialReference.toJSON())),null==this._fullExtent&&"location"===c.encoding?.type){const{latitudeFieldName:s,longitudeFieldName:r}=c.encoding,o=this._fieldsIndex.get(s)?.column,i=this._fieldsIndex.get(r)?.column,n=u(p(),d);for(const a of this._fileInfos.values())for(const s of a.file.rowGroups()){const r={stack:[],error:void 0,hasError:!1};try{const t=e(r,s.columnDescriptorForAttribute(o),!1),a=e(r,s.columnDescriptorForAttribute(i),!1),u=[a.minValue(),t.minValue(),a.maxValue(),t.maxValue()];l(n,u),s.free()}catch(b){r.error=b,r.hasError=!0}finally{t(r)}}this._fullExtent={xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:c.spatialReference?.toJSON()}}return{capabilities:this._capabilities,layerDefinition:{fields:c.fields?.map(e=>e.toJSON()),drawingInfo:g(q),extent:this._fullExtent??void 0,geometryType:q,encoding:c.encoding?.toJSON(),displayOptimization:c.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.file.free();this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}getFileStatistics(){if(!this._fileInfos.size)return null;const e=Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.byteLength(),0);return{featureCount:this._getFeatureCount(),byteLength:e}}async updateFiles(e){const t=new Set(e);for(const[s,r]of this._fileInfos.entries())t.has(s)?t.delete(s):(r.file.free(),this._fileInfos.delete(s));for(const s of t){const e=await C(s,{geometryInfo:this._geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(s,{index:this._fileInfos.size,file:e})}}async queryFeatures(e,t){this._validateQuery(e),N(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){if(this._validateQuery(e),!D(e))return this._getFeatureCount();delete e.outFields,delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponseForCount()}async queryObjectIds(e,t){if(this._validateQuery(e),!D(e))return Array.from({length:this._getFeatureCount()},(e,t)=>t);e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0,delete e.returnGeometry,delete e.outFields;return(await this._enqueueQuery(e,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){if(this._validateQuery(e),this._fullExtent&&!D(e))return{count:this._getFeatureCount(),extent:this._fullExtent};const s=r(this._metadata.spatialReference);e.returnGeometry=!0,delete e.outFields;const o=u(p(),d),i=p(),n=await this._enqueueQuery(e,t);let a=0;for(const r of n.items)r.getBounds(i)&&(c(o,i),a+=1);return{count:a,extent:m(o,s,e.outSR?r(e.outSR):s,s,!1)}}_getFeatureCount(){return Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new o("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new o("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new o("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async*_fetchChunks(e,t){for(const s of this._fileInfos.values()){const r=s.file.numRows(),o=Math.ceil(r/B);for(let i=0;i<o;i++){const r=i*B,o=await s.file.readChunk(r,B,e.fields,e.returnGeometry,t);for(const e of o){const t=new Q(this._metadata,this._fieldsIndex,e,0,s.index),r=new v(t,null,0,!1),o=P(this._metadata,[r],this._queryEngineParams);yield o}}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const s=await this._getReadParams(e);if(e.objectIds?.length)for(const n of this._fileInfos.values()){const r=[],o=(await n.file.readChunksByRowId(new Uint32Array(e.objectIds),s.fields,s.returnGeometry,t)).map((e,t)=>new Q(this._metadata,this._fieldsIndex,e,t,n.index)).map((e,t)=>new v(e,null,t,!1)),i=P(this._metadata,o,this._queryEngineParams),a=await i.executeQueryForOpaqueFeatures(e,t);for(const e of a)r.push(e);return new h(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:A})}let r=e.resultRecordCount??this._getFeatureCount(),o=e.resultOffset??0;delete e.resultRecordCount,delete e.resultOffset;const i=[];for await(const n of this._fetchChunks(s,t)){const s=await n.executeQueryForOpaqueFeatures(e,t);if(s.length>o){const t=s.slice(o,Math.min(o+r,s.length));for(const e of t)i.push(e);if(o=0,r-=t.length,0===r)return new h(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:A})}else o-=s.length}return new h(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:A})}async _getReadParams(e){const t=new Set;if(e.where&&await I(t,this._fieldsIndex,e.where),e.outStatistics)for(const s of e.outStatistics)null!=s.onStatisticField&&t.add(s.onStatisticField);if(e.outFields)for(const s of e.outFields)t.add(s);return{fields:this._getAttributeIds(Array.from(t)),returnGeometry:!!e.returnGeometry||!!e.geometry}}_getAttributeIds(e){if(null==e)return new Uint32Array;if(e.includes("*"))return new Uint32Array(this._fieldsIndex.fields.map(e=>e.column).filter(e=>null!=e));const t=[];for(const s of e){const e=this._fieldsIndex.get(s);if(null==e)throw new o("unknown-field",`Field ${s} does not exist`);null==e.column||t.push(e.column)}return new Uint32Array(t)}}function D(e){return Object.keys(e).some(e=>E(e))}function E(e){switch(e){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"where":case"objectIds":case"historicMoment":return!0;default:return!1}}function P(e,t,s){const r=new O(()=>e);for(const o of t)r.insert(o);return new y({...s,featureStore:r})}function M(e){switch(e.length){case 4:return f(p(),e);case 6:return e;default:throw new o("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function U(e,t){const s=u(p(),d);for(const r of e){const e=q(r.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const o=M(t.bbox);c(s,o)}return{xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:t}}function k(e){const t=e?.featureCount;let s=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(s=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:s,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:s,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:s,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function N(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{G 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as o}from"../../../../core/promiseUtils.js";import{urlToObject as s}from"../../../../core/urlUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as a}from"../../../support/infoFor3D.js";import{DataLayerSource as c}from"../../../support/source/DataLayerSource.js";import{parseUrl as p}from"../../../../rest/utils.js";import{executeForCount as l}from"../../../../rest/query/executeForCount.js";import{executeForExtent as d}from"../../../../rest/query/executeForExtent.js";import{executeForIds as m}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as y}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import f from"../../../../rest/support/FeatureSet.js";import F from"../../../../rest/support/Query.js";let S=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return s(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),o=null!=e.outStatistics?.[0],s=has("featurelayer-pbf-statistics"),i=(!o||s)&&!0!==e.returnTrueCurves;let u;if(this.pbfSupported&&i)try{u=await h(this.url,r,t,{uniqueIdFields:this.uniqueIdFields})}catch(n){if("query:parsing-pbf"!==n.name)throw n;this.pbfSupported=!1}return this.pbfSupported&&i||(u=await y(this.url,r,t,{uniqueIdFields:this.uniqueIdFields})),this._normalizeFields(u.fields),u}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return f.fromJSON(t);const{meshFeatureSetFromJSON:s}=await o(import("../../../../rest/support/meshFeatureSet.js"),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return l(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return d(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return m(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await o(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await o(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:i}=await o(import("../../../../rest/query/operations/queryAttachments.js"),t),u=p(this.url);return i(u,await(this.queryAttachmentsSupported?r(u,e,t):s(u,e,t)))}async executeAttributeBinsQuery(e,t){const{executeAttributeBinsQuery:r}=await o(import("../../../../rest/query/executeAttributeBinsQuery.js"),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await o(import("../../../../rest/query/executeTopFeaturesQuery.js"),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await o(import("../../../../rest/query/executeForTopIds.js"),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await o(import("../../../../rest/query/executeForTopExtents.js"),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await o(import("../../../../rest/query/executeForTopCount.js"),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=F.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:o}=this;if(null!=o&&this._queryIs3DObjectFormat(e)){if(t=t===e?t.clone():t,t.formatOf3DObjects=a(o),!t.formatOf3DObjects)throw new r("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!n(t.outSpatialReference,this.sourceSpatialReference))throw new r("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:r,originY:s,originZ:i,translationX:u,translationY:n,translationZ:a,scaleX:c,scaleY:p,scaleZ:l,rotationX:d,rotationY:m,rotationZ:y,rotationDeg:h}=o.transformFieldRoles;t.outFields.push(r,s,i,u,n,a,c,p,l,d,m,y,h)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};e([i({type:c})],S.prototype,"dynamicDataSource",void 0),e([i()],S.prototype,"fieldsIndex",void 0),e([i()],S.prototype,"gdbVersion",void 0),e([i()],S.prototype,"infoFor3D",void 0),e([i({readOnly:!0})],S.prototype,"parsedUrl",null),e([i()],S.prototype,"pbfSupported",void 0),e([i()],S.prototype,"queryAttachmentsSupported",void 0),e([i()],S.prototype,"sourceSpatialReference",void 0),e([i()],S.prototype,"uniqueIdFields",void 0),e([i({type:String})],S.prototype,"url",void 0),S=e([u("esri.layers.graphics.sources.support.QueryTask")],S);export{S as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as o}from"../../../../core/promiseUtils.js";import{urlToObject as s}from"../../../../core/urlUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as a}from"../../../support/infoFor3D.js";import{DataLayerSource as c}from"../../../support/source/DataLayerSource.js";import{parseUrl as p}from"../../../../rest/utils.js";import{executeForCount as l}from"../../../../rest/query/executeForCount.js";import{executeForExtent as d}from"../../../../rest/query/executeForExtent.js";import{executeForIds as m}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as y}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import f from"../../../../rest/support/FeatureSet.js";import F from"../../../../rest/support/Query.js";let S=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return s(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),o=null!=e.outStatistics?.[0],s=has("featurelayer-pbf-statistics"),i=(!o||s)&&!0!==e.returnTrueCurves;let u;if(this.pbfSupported&&i)try{u=await h(this.url,r,t,{uniqueIdFields:this.uniqueIdFields})}catch(n){if("query:parsing-pbf"!==n.name)throw n;this.pbfSupported=!1}return this.pbfSupported&&i||(u=await y(this.url,r,t,{uniqueIdFields:this.uniqueIdFields})),this._normalizeFields(u.fields),u}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return f.fromJSON(t);const{meshFeatureSetFromJSON:s}=await o(import("../../../../rest/support/meshFeatureSet.js"),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return l(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return d(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return m(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await o(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await o(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:i}=await o(import("../../../../rest/query/operations/queryAttachments.js"),t),u=p(this.url);return i(u,await(this.queryAttachmentsSupported?r(u,e,t):s(u,e,t)))}async executeAttributeBinsQuery(e,t){const{executeAttributeBinsQuery:r}=await o(import("../../../../rest/query/executeAttributeBinsQuery.js"),t);return r(this.parsedUrl,e,t)}async executePivotQuery(e,t){const{executePivotQuery:r}=await o(import("../../../../rest/query/executePivotQuery.js"),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await o(import("../../../../rest/query/executeTopFeaturesQuery.js"),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await o(import("../../../../rest/query/executeForTopIds.js"),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await o(import("../../../../rest/query/executeForTopExtents.js"),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await o(import("../../../../rest/query/executeForTopCount.js"),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=F.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:o}=this;if(null!=o&&this._queryIs3DObjectFormat(e)){if(t=t===e?t.clone():t,t.formatOf3DObjects=a(o),!t.formatOf3DObjects)throw new r("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!n(t.outSpatialReference,this.sourceSpatialReference))throw new r("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:r,originY:s,originZ:i,translationX:u,translationY:n,translationZ:a,scaleX:c,scaleY:p,scaleZ:l,rotationX:d,rotationY:m,rotationZ:y,rotationDeg:h}=o.transformFieldRoles;t.outFields.push(r,s,i,u,n,a,c,p,l,d,m,y,h)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};e([i({type:c})],S.prototype,"dynamicDataSource",void 0),e([i()],S.prototype,"fieldsIndex",void 0),e([i()],S.prototype,"gdbVersion",void 0),e([i()],S.prototype,"infoFor3D",void 0),e([i({readOnly:!0})],S.prototype,"parsedUrl",null),e([i()],S.prototype,"pbfSupported",void 0),e([i()],S.prototype,"queryAttachmentsSupported",void 0),e([i()],S.prototype,"sourceSpatialReference",void 0),e([i()],S.prototype,"uniqueIdFields",void 0),e([i({type:String})],S.prototype,"url",void 0),S=e([u("esri.layers.graphics.sources.support.QueryTask")],S);export{S 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.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{queryBinsCapabilities as s,queryCapabilities as r}from"../../data/QueryEngineCapabilities.js";import{defaultPointSymbolJSON as e,defaultPolylineSymbolJSON as p,defaultPolygonSymbolJSON as o}from"../../../../symbols/support/defaultsJSON.js";function u(t){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===t||"esriGeometryMultipoint"===t?e:"esriGeometryPolyline"===t?p:o}}}const n=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let i=1;function a(t,s){if(has("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${c(s)} = null;`;for(const s in t){r+=`this${c(s)} = ${JSON.stringify(t[s])};`}const e=new Function(`\n return class AttributesClass$${i++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new e}catch(r){return()=>({[s]:null,...t})}}function c(t){return n.test(t)?`.${t}`:`["${t}"]`}function l(s={}){return[{name:"New Feature",description:"",prototype:{attributes:t(s)}}]}function y(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{y as createCapabilities,a as createDefaultAttributesFunction,l as createDefaultTemplate,u as createDrawingInfo};
5
+ import has from"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{queryBinsCapabilities as s,queryCapabilities as r}from"../../data/QueryEngineCapabilities.js";import{defaultPointSymbolJSON as e,defaultPolylineSymbolJSON as p,defaultPolygonSymbolJSON as o}from"../../../../symbols/support/defaultsJSON.js";function u(t){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===t||"esriGeometryMultipoint"===t?e:"esriGeometryPolyline"===t?p:o}}}const n=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let i=1;function a(t,s){if(has("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${c(s)} = null;`;for(const s in t){r+=`this${c(s)} = ${JSON.stringify(t[s])};`}const e=new Function(`\n return class AttributesClass$${i++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new e}catch(r){return()=>({[s]:null,...t})}}function c(t){return n.test(t)?`.${t}`:`["${t}"]`}function l(s={}){return[{name:"New Feature",description:"",prototype:{attributes:t(s)}}]}function y(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{y as createCapabilities,a as createDefaultAttributesFunction,l as createDefaultTemplate,u as createDrawingInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONMixin as o}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import p from"../../geometry/Extent.js";import l from"../../geometry/Point.js";import y from"../../geometry/Polygon.js";import u from"../../geometry/Polyline.js";import{initializeProjection as m,project as d}from"../../geometry/projectionUtils.js";import h from"../../geometry/SpatialReference.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import f from"../../graphic/KnowledgeGraphGraphicOrigin.js";import j from"../../graphic/LinkChartGraphicOrigin.js";import b from"../Layer.js";import w from"../graphics/data/FeatureStore.js";import{QueryEngine as T}from"../graphics/data/QueryEngine.js";import{createCapabilities as I,createDrawingInfo as v}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as O,systemAggregationCountFieldName as S,systemIsSpatialFieldName as E,systemLayoutGeometryFieldName as x,systemOriginIdFieldName as N,systemDestinationIdFieldName as L}from"./constants.js";import{KnowledgeGraphSublayerBase as F}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as _,getLinkChartDefaultLabelingInfo as R,getMapDefaultLabelingInfo as Q,getKGSublayerSymbolColor as C,getDefaultLCRelationshipSublayerSymbol as k}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as P,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as G,displayFilterEnabledProperty as D,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as U,featureEffectProperty as Z}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as B,orderByProperty as V}from"../mixins/OrderedLayer.js";import{RefreshableLayer as K}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as H}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as X,minScale as $,opacity as ee,popupEnabled as te}from"../support/commonProperties.js";import{featureReductionProperty as re}from"../support/featureReductionUtils.js";import ie from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ne}from"../support/fieldUtils.js";import se from"../support/LabelClass.js";import{reader as ae}from"../support/labelingInfo.js";import pe from"../support/TimeInfo.js";import le from"../../renderers/SimpleRenderer.js";import{fromJSON as ye}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ue}from"../../renderers/support/typeUtils.js";import me from"../../rest/support/FeatureSet.js";import de from"../../rest/support/Query.js";import{createPopupTemplate as he}from"../../support/popupUtils.js";import{applyColorToSymbol as ce}from"../../symbols/support/utils.js";import ge from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=je(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=je(e.write))}return e}function je(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=be(e)),e):!0===e?we():e}function be(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=Te.call(this,e,t);return r.enabled?{...o,...r}:r}}function we(){return{overridePolicy:Te}}function Te(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Ie.call(this,e,t)}),i}function Ie(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let ve=class extends(F(G(A(U(M(B(W(H(K(o(b))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=I(!1,!0),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=O,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const e=new MessageChannel;return new ge(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=de.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(ie.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ie.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ie.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1}),ie.fromJSON({name:E,type:"esriFieldTypeInteger",alias:E,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return x;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case"knowledge-graph":return new f(this.parent,this);case"link-chart":return new j(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set("graphTypeName",e)}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?_(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?R(this.graphType,this.graphTypeName,e):Q(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),r=C(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new le({type:"simple",symbol:k(r)});const e=ye(v(g.toJSON("point")).renderer);return ce(e.symbol,r),e}const i=ye(v(g.toJSON(this.geometryType)).renderer);return ce(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??h.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return he(this,e)}createQuery(){return new de({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=this.graphicOrigin,n=me.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return n.features.forEach(e=>{e.sourceLayer=this,e.origin=o}),n}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),n=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new p(n.extent):new p,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=de.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new w({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new T({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new de({where:"1=1",outFields:[O]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>ne(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=de.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await m(i.spatialReference,c),r.geometry=d(i instanceof y||i instanceof u||i instanceof l?i:i.extent,c)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function Oe(e,t,r){const o=[["ESRI__AGGREGATION_COUNT",S],["ESRI__ORIGIN_ID",N],["ESRI__DESTINATION_ID",L],["ESRI__LAYOUT_GEOMETRY",x]];try{for(const t of e)for(const[e,r]of o)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){i.getLogger(this).warn("Error updating labelingInfo",n)}return ae(e,t,r)}e([n(fe(r(P)))],ve.prototype,"blendMode",void 0),e([n()],ve.prototype,"capabilities",void 0),e([n({readOnly:!0})],ve.prototype,"userHasUpdateItemPrivileges",null),e([n({json:{origins:{"web-scene":{write:!1}},write:we()}})],ve.prototype,"charts",void 0),e([n({readOnly:!0})],ve.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],ve.prototype,"definitionExpression",void 0),e([n()],ve.prototype,"displayField",void 0),e([n(fe(r(D)))],ve.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],ve.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],ve.prototype,"effect",void 0),e([n()],ve.prototype,"elevationInfo",void 0),e([n(fe(r(Z)))],ve.prototype,"featureEffect",void 0),e([n(fe(r(re)))],ve.prototype,"featureReduction",null),e([n()],ve.prototype,"fields",null),e([n()],ve.prototype,"geometryType",null),e([n()],ve.prototype,"geometryFieldName",null),e([n({readOnly:!0})],ve.prototype,"graphicOrigin",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],ve.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],ve.prototype,"graphTypeName",null),e([n()],ve.prototype,"hasM",null),e([n()],ve.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],ve.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],ve.prototype,"labelsVisible",void 0),e([n({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Oe,write:we()}})],ve.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],ve.prototype,"layerType",void 0),e([n(fe(r(z)))],ve.prototype,"legendEnabled",void 0),e([n(fe(r(X)))],ve.prototype,"maxScale",void 0),e([n(fe(r($)))],ve.prototype,"minScale",void 0),e([n()],ve.prototype,"objectIdField",void 0),e([n()],ve.prototype,"objectType",void 0),e([n(fe(r(ee)))],ve.prototype,"opacity",void 0),e([n(fe(r(V)))],ve.prototype,"orderBy",void 0),e([n({clonable:!1})],ve.prototype,"parent",void 0),e([n()],ve.prototype,"parentCompositeLayer",void 0),e([n(fe(r(te)))],ve.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],ve.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Ie}}})],ve.prototype,"refreshInterval",void 0),e([n({types:ue,json:{name:"layerDefinition.drawingInfo.renderer",write:we()}})],ve.prototype,"renderer",null),e([n()],ve.prototype,"source",void 0),e([n()],ve.prototype,"spatialReference",null),e([n({type:pe,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:Ie},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Ie}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Ie}}}}})],ve.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],ve.prototype,"title",null),e([a("title")],ve.prototype,"writeTitle",null),e([n({json:{read:!1}})],ve.prototype,"type",void 0),e([n(fe(r(Y)))],ve.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:we()}})],ve.prototype,"visible",void 0),ve=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],ve);export{ve as default};
5
+ import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import r from"../../core/Error.js";import{clone as i}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as n}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import d from"../../geometry/Polyline.js";import{initializeProjection as h,project as m}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as g}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as f}from"../../geometry/support/typeUtils.js";import b from"../../graphic/KnowledgeGraphGraphicOrigin.js";import j from"../../graphic/LinkChartGraphicOrigin.js";import w from"../Layer.js";import T from"../graphics/data/FeatureStore.js";import{QueryEngine as v}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as E,systemAggregationCountFieldName as O,systemIsSpatialFieldName as S,systemLayoutGeometryFieldName as x,systemOriginIdFieldName as N,systemDestinationIdFieldName as L}from"./constants.js";import{KnowledgeGraphSublayerBase as F}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as _,getDisplayLabelProperty as R,getLinkChartDefaultLabelingInfo as C,getMapDefaultLabelingInfo as k,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as M,convertLayerEditsToGraphEdits as P,convertGraphEditsResultToFeatureEdits as G}from"./layerUtils.js";import{BlendLayer as D,blendModeProperty as J,effectProperty as q}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as U,displayFilterEnabledProperty as A,displayFilterInfoProperty as B}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as Z,featureEffectProperty as K}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as V}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as H,orderByProperty as W}from"../mixins/OrderedLayer.js";import{RefreshableLayer as Y}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as z}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as X,useViewTimeProperty as $}from"../mixins/TemporalLayer.js";import{legendEnabled as ee,maxScale as te,minScale as re,opacity as ie,popupEnabled as oe}from"../support/commonProperties.js";import{featureReductionProperty as ne}from"../support/featureReductionUtils.js";import se from"../support/Field.js";import{fixRendererFields as ae,fixTimeInfoFields as pe}from"../support/fieldUtils.js";import le from"../support/LabelClass.js";import{reader as ye}from"../support/labelingInfo.js";import ue from"../support/TimeInfo.js";import de from"../../renderers/SimpleRenderer.js";import{fromJSON as he}from"../../renderers/support/jsonUtils.js";import{rendererTypes as me}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as ce}from"../../rest/knowledgeGraphService.js";import ge from"../../rest/support/FeatureSet.js";import fe from"../../rest/support/Query.js";import{createPopupTemplate as be}from"../../support/popupUtils.js";import{applyColorToSymbol as je}from"../../symbols/support/utils.js";import we from"../../core/workers/RemoteClient.js";function Te(e){if(!e.json)return e;e.json.write=ve(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ve(e.write))}return e}function ve(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=Ie(e)),e):!0===e?Ee():e}function Ie(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=Oe.call(this,e,t);return r.enabled?{...o,...r}:r}}function Ee(){return{overridePolicy:Oe}}function Oe(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Se.call(this,e,t)}),i}function Se(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let xe=class extends(F(U(V(Z(D(H(X(z(Y(n(w))))))))))){constructor(e){super(e),this.blendMode="normal",this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=E,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const e=new MessageChannel;return new we(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=fe.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:_(null)}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.capabilities.operations.supportsEditing}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get isTable(){return"link-chart"!==this.parentCompositeLayer.type&&null==this.geometryFieldName}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(se.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(se.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),se.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1}),se.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?f.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return x;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case"knowledge-graph":return new b(this.parent,this);case"link-chart":return new j(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set("graphTypeName",e)}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?R(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?C(this.graphType,this.graphTypeName,e):k(this.graphTypeName,this.geometryType,e)}set renderer(e){ae(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new de({type:"simple",symbol:M(r)});const e=he(I(f.toJSON("point")).renderer);return je(e.symbol,r),e}const i=he(I(f.toJSON(this.geometryType)).renderer);return je(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return be(this,e)}createQuery(){return new fe({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=this.graphicOrigin,n=ge.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return n.features.forEach(e=>{e.sourceLayer=this,e.origin=o}),n}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),n=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=fe.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer.dataManager.knowledgeGraph)throw new r("knowledge-graph-sublayer:no-knowledge-graph","ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded");const t=P(e,this);t.options={cascadeDelete:!0,cascadeProvenanceDelete:!!this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance||void 0};const i=await ce(this.parentCompositeLayer.dataManager.knowledgeGraph,t),o=G(i,this.graphTypeName),n={addedFeatures:o.addFeatureResults,updatedFeatures:o.updateFeatureResults,deletedFeatures:o.deleteFeatureResults,addedAttachments:o.addAttachmentResults,deletedAttachments:o.deleteAttachmentResults,updatedAttachments:o.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit("edits",n),this.emit("apply-edits",{result:Promise.resolve(n)}),o}loadQueryEngine(e){const t=new T({geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new v({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new fe({where:"1=1",outFields:[E]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>pe(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=fe.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await h(i.spatialReference,g),r.geometry=m(i instanceof u||i instanceof d||i instanceof y?i:i.extent,g)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function Ne(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",O],["ESRI__ORIGIN_ID",N],["ESRI__DESTINATION_ID",L],["ESRI__LAYOUT_GEOMETRY",x]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return ye(e,t,r)}e([s(Te(i(J)))],xe.prototype,"blendMode",void 0),e([s({readOnly:!0})],xe.prototype,"capabilities",null),e([s({readOnly:!0})],xe.prototype,"userHasUpdateItemPrivileges",null),e([s({type:Boolean})],xe.prototype,"editingEnabled",null),e([s()],xe.prototype,"isTable",null),e([s({json:{origins:{"web-scene":{write:!1}},write:Ee()}})],xe.prototype,"charts",void 0),e([s({readOnly:!0})],xe.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],xe.prototype,"definitionExpression",void 0),e([s(Te(i(A)))],xe.prototype,"displayFilterEnabled",void 0),e([s(Te(i(B)))],xe.prototype,"displayFilterInfo",void 0),e([s(Te(i(q)))],xe.prototype,"effect",void 0),e([s()],xe.prototype,"elevationInfo",void 0),e([s(Te(i(K)))],xe.prototype,"featureEffect",void 0),e([s(Te(i(ne)))],xe.prototype,"featureReduction",null),e([s()],xe.prototype,"fields",null),e([s()],xe.prototype,"geometryType",null),e([s()],xe.prototype,"geometryFieldName",null),e([s({readOnly:!0})],xe.prototype,"graphicOrigin",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"graphTypeName",null),e([s()],xe.prototype,"hasM",null),e([s()],xe.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],xe.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],xe.prototype,"labelsVisible",void 0),e([s({type:[le],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ne,write:Ee()}})],xe.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],xe.prototype,"layerType",void 0),e([s(Te(i(ee)))],xe.prototype,"legendEnabled",void 0),e([s(Te(i(te)))],xe.prototype,"maxScale",void 0),e([s(Te(i(re)))],xe.prototype,"minScale",void 0),e([s()],xe.prototype,"objectIdField",void 0),e([s()],xe.prototype,"objectType",void 0),e([s(Te(i(ie)))],xe.prototype,"opacity",void 0),e([s(Te(i(W)))],xe.prototype,"orderBy",void 0),e([s({clonable:!1})],xe.prototype,"parent",void 0),e([s()],xe.prototype,"parentCompositeLayer",void 0),e([s(Te(i(oe)))],xe.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],xe.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Se}}})],xe.prototype,"refreshInterval",void 0),e([s({types:me,json:{name:"layerDefinition.drawingInfo.renderer",write:Ee()}})],xe.prototype,"renderer",null),e([s()],xe.prototype,"source",void 0),e([s()],xe.prototype,"spatialReference",null),e([s({type:ue,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:Se},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Se}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Se}}}}})],xe.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],xe.prototype,"title",null),e([p("title")],xe.prototype,"writeTitle",null),e([s({json:{read:!1}})],xe.prototype,"type",void 0),e([s(Te(i($)))],xe.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:Ee()}})],xe.prototype,"visible",void 0),xe=e([a("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],xe);export{xe 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import n from"../support/LabelClass.js";import o from"../support/LabelExpressionInfo.js";import{fetchClientDataAtKeys as a}from"../../rest/knowledgeGraphService.js";import r from"../../symbols/CIMSymbol.js";import l from"../../symbols/TextSymbol.js";const t={initializeLayersFromClientData:async(e,n,o)=>{if(n||(n=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===n?.length)return;const r=new Map;for(const a of n)r.set(a,s(e,a));const l=await a(e.dataManager.knowledgeGraph,Array.from(r.values()),{requestOptions:{signal:o?.signal}});for(const a of[...e.layers,...e.tables]){const n=a.objectType.name;if(null==n)continue;const o=l.get(s(e,n));if(o){const e=JSON.parse(o);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),a.read(e,{origin:"service"})}}}},s=(e,n)=>"knowledge-graph"===e.type?`${n}/Map`:`${n}/LinkChart/LinkChartSubLayer`;async function i(e,n,o){return t.initializeLayersFromClientData(e,n,o)}const b=["#4a0932","#b31515","#18382e","#a64f1b","#102432","#8c213f","#ed9310","#2c6954","#144d59","#ffc730","#75351e","#454f4b","#78b1c2","#191921","#8f8f82","#9be0c0","#dbb658","#87b051","#11495c","#c43541","#9c5596","#44498b","#ad9d63","#86afb3","#5c98ca","#b0bfa2","#73241f","#b86b53","#d9d78c","#3e756d","#f260a1","#a0d17d","#c27c30","#eb82eb","#ffdf3c","#ffb259","#ab52b3","#3cccb4","#0095ba","#d92b30"],c="#8f8f82";function f(n){return n<0||n>=b.length?new e(c):new e(b[n])}function m(e){const n=e.toArray();return new r({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,style:"solid",width:.75,color:n},{type:"CIMVectorMarker",enable:!0,size:6,markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-10,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[1.96,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:n}]}}]}]}}})}function p(e){let n="ESRI__ID",o=4;for(const a of e)if(a.name){if("name"===a.name.toLowerCase()){n=a.name;break}a.name.toLowerCase().includes("name")?(n=a.name,o=2):"esriFieldTypeString"===a.fieldType&&o>3&&(n=a.name,o=3)}return n}function y(e,a,r){const t={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},s=new n({labelExpressionInfo:new o({expression:"ESRI__ID"===r?`${a}`:`$feature.${r}`}),labelPlacement:"above-center",symbol:new l(t)}),i=new n({labelExpressionInfo:new o({expression:`'${a}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new l({...t,yoffset:"12px"})});return"entity"===e?[s]:[i]}function w(e,a,r){const t={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},s="ESRI__ID"===r?`${e}`:`$feature.${r}`;return"point"===a?[new n({labelExpressionInfo:new o({expression:s}),labelPlacement:"above-center",symbol:new l(t)})]:"polyline"===a?[new n({labelExpressionInfo:new o({expression:s}),labelPlacement:"center-along",repeatLabel:!0,symbol:new l(t)})]:"polygon"===a?[new n({labelExpressionInfo:new o({expression:s}),labelPlacement:"always-horizontal",symbol:new l(t)})]:null}export{c as fallbackKGSublayerSymbolHexColor,m as getDefaultLCRelationshipSublayerSymbol,p as getDisplayLabelProperty,f as getKGSublayerSymbolColor,y as getLinkChartDefaultLabelingInfo,w as getMapDefaultLabelingInfo,i as initializeLayersFromClientData,t as layerUtils};
5
+ import e from"../../Color.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{queryBinsCapabilities as s,queryCapabilities as a}from"../graphics/data/QueryEngineCapabilities.js";import{systemOidFieldName as o}from"./constants.js";import r from"../support/LabelClass.js";import n from"../support/LabelExpressionInfo.js";import{fetchClientDataAtKeys as p}from"../../rest/knowledgeGraphService.js";import i from"../../rest/knowledgeGraph/Entity.js";import l from"../../rest/knowledgeGraph/GraphApplyEdits.js";import u from"../../rest/knowledgeGraph/Relationship.js";import{isGraphic as d}from"../../support/guards.js";import c from"../../symbols/CIMSymbol.js";import y from"../../symbols/TextSymbol.js";const m={initializeLayersFromClientData:async(e,t,s)=>{if(t||(t=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===t?.length)return;const a=new Map;for(const r of t)a.set(r,f(e,r));const o=await p(e.dataManager.knowledgeGraph,Array.from(a.values()),{requestOptions:{signal:s?.signal}});for(const r of[...e.layers,...e.tables]){const t=r.objectType.name;if(null==t)continue;const s=o.get(f(e,t));if(s){const e=JSON.parse(s);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),r.read(e,{origin:"service"})}}}},f=(e,t)=>"knowledge-graph"===e.type?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function b(e,t,s){return m.initializeLayersFromClientData(e,t,s)}const h=["#4a0932","#b31515","#18382e","#a64f1b","#102432","#8c213f","#ed9310","#2c6954","#144d59","#ffc730","#75351e","#454f4b","#78b1c2","#191921","#8f8f82","#9be0c0","#dbb658","#87b051","#11495c","#c43541","#9c5596","#44498b","#ad9d63","#86afb3","#5c98ca","#b0bfa2","#73241f","#b86b53","#d9d78c","#3e756d","#f260a1","#a0d17d","#c27c30","#eb82eb","#ffdf3c","#ffb259","#ab52b3","#3cccb4","#0095ba","#d92b30"],g="#8f8f82";function w(t){return t<0||t>=h.length?new e(g):new e(h[t])}function I(e){const t=e.toArray();return new c({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,style:"solid",width:.75,color:t},{type:"CIMVectorMarker",enable:!0,size:6,markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-10,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[1.96,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}]}]}}})}function C(e){let t="ESRI__ID",s=4;for(const a of e)if(a.name){if("name"===a.name.toLowerCase()){t=a.name;break}a.name.toLowerCase().includes("name")?(t=a.name,s=2):"esriFieldTypeString"===a.fieldType&&s>3&&(t=a.name,s=3)}return t}function S(e,t,s){const a={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},o=new r({labelExpressionInfo:new n({expression:"ESRI__ID"===s?`${t}`:`$feature.${s}`}),labelPlacement:"above-center",symbol:new y(a)}),p=new r({labelExpressionInfo:new n({expression:`'${t}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new y({...a,yoffset:"12px"})});return"entity"===e?[o]:[p]}function A(e,t,s){const a={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},o="ESRI__ID"===s?`${e}`:`$feature.${s}`;return"point"===t?[new r({labelExpressionInfo:new n({expression:o}),labelPlacement:"above-center",symbol:new y(a)})]:"polyline"===t?[new r({labelExpressionInfo:new n({expression:o}),labelPlacement:"center-along",repeatLabel:!0,symbol:new y(a)})]:"polygon"===t?[new r({labelExpressionInfo:new n({expression:o}),labelPlacement:"always-horizontal",symbol:new y(a)})]:null}const M={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function L(e){const{capabilities:t,allowGeometryUpdates:o,serviceCapabilities:{geometryCapabilities:{supportsZValues:r,supportsMValues:n}}}=e?.serviceDefinition||M,p=e?.dataModel.arcgisManaged?t:t.filter(e=>"Query"===e),i=new Set(p);return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:n,supportsZ:r},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:i.has("Create"),supportsDelete:i.has("Delete"),supportsEditing:i.has("Editing"),supportsChangeTracking:!1,supportsQuery:i.has("Query"),supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:i.has("Update"),supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:a,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&o,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:i.has("Delete"),supportsUpdateByAnonymous:!1,supportsUpdateByOthers:i.has("Update"),supportsAsyncApplyEdits:!1,zDefault:void 0}}}function R(e,s){const a=new l,r=s.graphTypeName,n=s.graphType,p=e=>{for(const t of s.fields)t.editable||delete e[t.name];for(const t of Object.keys(e))t.includes("ESRI__")&&delete e[t]};for(const t of e.addFeatures??[])p(t.attributes),t.sourceLayer.graphTypeName===r&&("entity"===n?(a.entityAdds||(a.entityAdds=[]),a.entityAdds.push(new i({properties:t.attributes,typeName:r}))):(a.relationshipAdds||(a.relationshipAdds=[]),a.relationshipAdds.push(new u({properties:t.attributes,typeName:r}))));for(const t of e.updateFeatures??[]){const e=t.attributes[o];p(t.attributes),t.sourceLayer.graphTypeName===r&&("entity"===n?(a.entityUpdates||(a.entityUpdates=[]),a.entityUpdates.push(new i({id:e,properties:t.attributes,typeName:r}))):(a.relationshipUpdates||(a.relationshipUpdates=[]),a.relationshipUpdates.push(new u({id:e,properties:t.attributes,typeName:r}))))}const c=new Map;for(const i of e.deleteFeatures??[])if(d(i)){const e=i,s=t(c,e.sourceLayer.graphTypeName,()=>({typeName:e.sourceLayer.graphTypeName,ids:[]}));e.sourceLayer.graphTypeName===r&&s.ids.push(e.attributes[o])}else if(i.objectId&&"string"==typeof i.objectId){t(c,r,()=>({typeName:r,ids:[]})).ids.push(i.objectId)}for(const t of c.values())t.ids.length>0&&("entity"===n?(a.entityDeletes||(a.entityDeletes=[]),a.entityDeletes.push({typeName:t.typeName,ids:t.ids})):(a.relationshipDeletes||(a.relationshipDeletes=[]),a.relationshipDeletes.push({typeName:t.typeName,ids:t.ids})));return a}function j(e,t){const s={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const a of e.editResults)if(a.typeName===t){for(const e of a.adds)s.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of a.updates)s.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of a.deletes)s.deleteFeatureResults.push({objectId:e.id,globalId:e.id})}return s}export{j as convertGraphEditsResultToFeatureEdits,R as convertLayerEditsToGraphEdits,L as createCapabilitiesFromKnowledgeGraph,g as fallbackKGSublayerSymbolHexColor,I as getDefaultLCRelationshipSublayerSymbol,C as getDisplayLabelProperty,w as getKGSublayerSymbolColor,S as getLinkChartDefaultLabelingInfo,A as getMapDefaultLabelingInfo,b as initializeLayersFromClientData,m as layerUtils};