@arcgis/core 4.34.0-next.100 → 4.34.0-next.102

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 (105) hide show
  1. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{f5d89b48f62fba78fd10.js → 151defe707bceb3a56a4.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{a0ac5bd5d8800dcd6fd6.js → 2651f2b84e1ead967bb8.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 2f03d33f4ca8a48461fc.js} +1 -1
  6. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  7. package/assets/esri/core/workers/chunks/{363f6f6cdf11481afbff.js → 3ee5c5b946d578a9d003.js} +1 -1
  8. package/assets/esri/core/workers/chunks/48634e0c5b12607972aa.js +1 -0
  9. package/assets/esri/core/workers/chunks/59e916249db1355bb139.js +1 -0
  10. package/assets/esri/core/workers/chunks/{02bc183e30e3392bb76d.js → 5a11b188029040ccd85a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/5a833a08c5b68dc087ec.js +1 -0
  12. package/assets/esri/core/workers/chunks/655360995c1cbc78a5a3.js +1 -0
  13. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  14. package/assets/esri/core/workers/chunks/740e6d2831dcb01ee96a.js +1 -0
  15. package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
  16. package/assets/esri/core/workers/chunks/{ad3e18c4c65aa2cd1ceb.js → 8b086e49e377cf218f3d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/9b8b5cb714a57f89df2c.js +1 -0
  18. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
  19. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  20. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
  21. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
  22. package/assets/esri/core/workers/chunks/{05037129760d444d1729.js → b0cc6d63c3a0fef920a3.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{773d76253588bcf14eaa.js → b92287544ddf73ed7156.js} +1 -1
  24. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
  25. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
  26. package/assets/esri/core/workers/chunks/{5dfdd303cf8616464086.js → c454d741907a2c4de93e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4a2bf3c8da24abd8b9e2.js → c89fff4052fe75345080.js} +1 -1
  28. package/assets/esri/core/workers/chunks/ca4f41c5c6dda7c1b88d.js +1 -0
  29. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  30. package/assets/esri/core/workers/chunks/d1abc375bfa664a907bf.js +1 -0
  31. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  32. package/assets/esri/core/workers/chunks/dd6ba7d5503abba204e6.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dfc37c2ce51e6a34fd87.js → dec0ed841f9ff1ceff43.js} +1 -1
  34. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  35. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  36. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  37. package/assets/esri/themes/dark/main.css +1 -1
  38. package/assets/esri/themes/light/main.css +1 -1
  39. package/assets/esri/themes/light/view.css +1 -1
  40. package/chunks/bundle.js +1 -1
  41. package/config.js +1 -1
  42. package/interfaces.d.ts +36 -2
  43. package/intl/date.js +1 -1
  44. package/intl.d.ts +2 -0
  45. package/intl.js +1 -1
  46. package/kernel.js +1 -1
  47. package/layers/graphics/data/QueryEngineResult.js +1 -1
  48. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  49. package/layers/knowledgeGraph/layerUtils.js +1 -1
  50. package/layers/support/rasterFieldUtils.js +1 -1
  51. package/package.json +2 -2
  52. package/smartMapping/support/utils.js +1 -1
  53. package/support/basemapDefinitions.js +1 -1
  54. package/support/revision.js +1 -1
  55. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  56. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  57. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  58. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  59. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  60. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  61. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  62. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  63. package/views/3d/layers/FlowSubView3D.js +1 -1
  64. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  65. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  66. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  67. package/views/3d/state/controllers/RotateController.js +1 -1
  68. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  69. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  70. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  71. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  72. package/views/3d/state/utils/navigationUtils.js +1 -1
  73. package/views/3d/support/engineContent/line.js +1 -1
  74. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  75. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  76. package/views/3d/support/flow/constants.js +1 -1
  77. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
  78. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  79. package/widgets/BatchAttributeForm.js +1 -1
  80. package/widgets/Directions/css.js +1 -1
  81. package/widgets/Directions.js +1 -1
  82. package/widgets/Editor/EditorViewModel.js +1 -1
  83. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  84. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  85. package/widgets/Editor/workflowUtils.js +1 -1
  86. package/widgets/Editor.js +1 -1
  87. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  88. package/widgets/Feature/FeatureFields.js +1 -1
  89. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  90. package/widgets/Feature/FeatureViewModel.js +1 -1
  91. package/widgets/Feature/support/featureUtils.js +1 -1
  92. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  93. package/widgets/support/ColorPicker.js +1 -1
  94. package/widgets/support/jsxWidgetSupport.js +1 -1
  95. package/assets/esri/core/workers/chunks/14ace5dc4b8984212a57.js +0 -1
  96. package/assets/esri/core/workers/chunks/1b85967d1178956ee36b.js +0 -1
  97. package/assets/esri/core/workers/chunks/22bb877b85ae250d7819.js +0 -1
  98. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  99. package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +0 -1
  100. package/assets/esri/core/workers/chunks/379b84f0ec03acaf5f93.js +0 -1
  101. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  102. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +0 -1
  103. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  104. package/assets/esri/core/workers/chunks/7e8702b3b071e336f58d.js +0 -1
  105. package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +0 -1
package/chunks/bundle.js CHANGED
@@ -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
- let e;function t(t){const r=e.__externref_table_alloc();return e.__wbindgen_export_2.set(r,t),r}function r(r,n){try{return r.apply(this,n)}catch(_){const r=t(_);e.__wbindgen_exn_store(r)}}Symbol.dispose||(Symbol.dispose=Symbol("Symbol.dispose"));const n="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&n.decode();let _=null;function i(){return null!==_&&0!==_.byteLength||(_=new Uint8Array(e.memory.buffer)),_}function o(e,t){return e>>>=0,n.decode(i().subarray(e,e+t))}let s=0;const a="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},c="function"==typeof a.encodeInto?function(e,t){return a.encodeInto(e,t)}:function(e,t){const r=a.encode(e);return t.set(r),{read:e.length,written:r.length}};function u(e,t,r){if(void 0===r){const r=a.encode(e),n=t(r.length,1)>>>0;return i().subarray(n,n+r.length).set(r),s=r.length,n}let n=e.length,_=t(n,1)>>>0;const o=i();let u=0;for(;u<n;u++){const t=e.charCodeAt(u);if(t>127)break;o[_+u]=t}if(u!==n){0!==u&&(e=e.slice(u)),_=r(_,n,n=u+3*e.length,1)>>>0;const t=i().subarray(_+u,_+n);u+=c(e,t).written,_=r(_,n,u,1)>>>0}return s=u,_}let g=null;function l(){return(null===g||!0===g.buffer.detached||void 0===g.buffer.detached&&g.buffer!==e.memory.buffer)&&(g=new DataView(e.memory.buffer)),g}function w(e){return null==e}const b="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{e.__wbindgen_export_6.get(t.dtor)(t.a,t.b)});function d(t,r,n,_){const i={a:t,b:r,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const r=i.a;i.a=0;try{return _(r,i.b,...t)}finally{0===--i.cnt?(e.__wbindgen_export_6.get(i.dtor)(r,i.b),b.unregister(i)):i.a=r}};return o.original=i,b.register(o,i,i),o}function f(e,t){return e>>>=0,i().subarray(e/1,e/1+t)}function p(){e.enableTracing()}let y=null;function h(){return null!==y&&0!==y.byteLength||(y=new Float64Array(e.memory.buffer)),y}function m(e,t){return e>>>=0,h().subarray(e/8,e/8+t)}let F=null;function q(){return null!==F&&0!==F.byteLength||(F=new Uint32Array(e.memory.buffer)),F}function v(e,t){return e>>>=0,q().subarray(e/4,e/4+t)}function k(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function T(t,r){t>>>=0;const n=l(),_=[];for(let i=t;i<t+4*r;i+=4)_.push(e.__wbindgen_export_2.get(n.getUint32(i,!0)));return e.__externref_drop_slice(t,r),_}function z(e,t){const r=t(8*e.length,8)>>>0;return h().set(e,r/8),s=e.length,r}function R(e,r){const n=r(4*e.length,4)>>>0;for(let _=0;_<e.length;_++){const r=t(e[_]);l().setUint32(n+4*_,r,!0)}return s=e.length,n}function O(e,t){const r=t(1*e.length,1)>>>0;return i().set(e,r/1),s=e.length,r}function S(e,t){const r=t(4*e.length,4)>>>0;return q().set(e,r/4),s=e.length,r}function x(t,r,n){e.closure83_externref_shim(t,r,n)}function A(t,r,n,_){e.closure9_externref_shim(t,r,n,_)}const C=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),j=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],M="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_columndescriptor_free(t>>>0,1));class I{static __wrap(e){e>>>=0;const t=Object.create(I.prototype);return t.__wbg_ptr=e,M.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,M.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_columndescriptor_free(t,0)}[Symbol.dispose](){this.free()}name(){let t,r;try{const n=e.columndescriptor_name(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}physicalType(){let t,r;try{const n=e.columndescriptor_physicalType(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}logicalType(){const t=e.columndescriptor_logicalType(this.__wbg_ptr);let r;return 0!==t[0]&&(r=o(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}encodings(){const t=e.columndescriptor_encodings(this.__wbg_ptr);var r=T(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}pageEncodings(){const t=e.columndescriptor_pageEncodings(this.__wbg_ptr);let r;return 0!==t[0]&&(r=T(t[0],t[1]).slice(),e.__wbindgen_free(t[0],4*t[1],4)),r}numValues(){return e.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,r;try{const n=e.columndescriptor_compression(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}compressedSize(){return e.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return e.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){const t=e.columndescriptor_nullCount(this.__wbg_ptr);return 0===t[0]?void 0:t[1]}distinctCount(){const t=e.columndescriptor_distinctCount(this.__wbg_ptr);return 0===t[0]?void 0:t[1]}minValue(){return e.columndescriptor_minValue(this.__wbg_ptr)}maxValue(){return e.columndescriptor_maxValue(this.__wbg_ptr)}}const L="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_fieldmetadata_free(t>>>0,1));class U{static __wrap(e){e>>>=0;const t=Object.create(U.prototype);return t.__wbg_ptr=e,L.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,L.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_fieldmetadata_free(t,0)}[Symbol.dispose](){this.free()}get column(){return e.__wbg_get_fieldmetadata_column(this.__wbg_ptr)>>>0}set column(t){e.__wbg_set_fieldmetadata_column(this.__wbg_ptr,t)}get name(){let t,r;try{const n=e.fieldmetadata_name(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}get type(){const t=e.fieldmetadata_esri_type(this.__wbg_ptr);return j[t]}get physicalType(){const t=e.fieldmetadata_physical_type(this.__wbg_ptr);let r;return 0!==t[0]&&(r=o(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}get logicalType(){const t=e.fieldmetadata_logical_type(this.__wbg_ptr);let r;return 0!==t[0]&&(r=o(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}}const W="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_geometryinfo_free(t>>>0,1));class D{static __wrap(e){e>>>=0;const t=Object.create(D.prototype);return t.__wbg_ptr=e,W.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,W.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_geometryinfo_free(t,0)}[Symbol.dispose](){this.free()}static new(t,r,n,_,i){k(_,H);var o=_.__destroy_into_raw();const a=R(i,e.__wbindgen_malloc),c=s,u=e.geometryinfo_new(t,r,n,o,a,c);return D.__wrap(u)}}const E="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_multiscalegeometryfield_free(t>>>0,1));class B{static __wrap(e){e>>>=0;const t=Object.create(B.prototype);return t.__wbg_ptr=e,E.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof B?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_multiscalegeometryfield_free(t,0)}[Symbol.dispose](){this.free()}get level(){return e.__wbg_get_multiscalegeometryfield_level(this.__wbg_ptr)}set level(t){e.__wbg_set_multiscalegeometryfield_level(this.__wbg_ptr,t)}static new(t,r,n,_){const i=u(r,e.__wbindgen_malloc,e.__wbindgen_realloc),o=s,a=z(n,e.__wbindgen_malloc),c=s,g=z(_,e.__wbindgen_malloc),l=s,w=e.multiscalegeometryfield_new(t,i,o,a,c,g,l);return B.__wrap(w)}has_field(t){const r=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=s;return 0!==e.multiscalegeometryfield_has_field(this.__wbg_ptr,r,n)}}const P="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_pageencodingdescriptor_free(t>>>0,1));class G{static __wrap(e){e>>>=0;const t=Object.create(G.prototype);return t.__wbg_ptr=e,P.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_pageencodingdescriptor_free(t,0)}[Symbol.dispose](){this.free()}pageType(){let t,r;try{const n=e.pageencodingdescriptor_pageType(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}encoding(){let t,r;try{const n=e.pageencodingdescriptor_encoding(this.__wbg_ptr);return t=n[0],r=n[1],o(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}count(){return e.pageencodingdescriptor_count(this.__wbg_ptr)}}const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_parquetchunk_free(t>>>0,1));class X{static __wrap(e){e>>>=0;const t=Object.create(X.prototype);return t.__wbg_ptr=e,V.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_parquetchunk_free(t,0)}[Symbol.dispose](){this.free()}size(){return e.parquetchunk_size(this.__wbg_ptr)>>>0}isEmpty(t){return 0!==e.parquetchunk_isEmpty(this.__wbg_ptr,t)}rowId(t){return e.parquetchunk_rowId(this.__wbg_ptr,t)}readX(t){const r=e.parquetchunk_readX(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readY(t){const r=e.parquetchunk_readY(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readCoords(t){const r=e.parquetchunk_readCoords(this.__wbg_ptr,t);let n;return 0!==r[0]&&(n=m(r[0],r[1]).slice(),e.__wbindgen_free(r[0],8*r[1],8)),n}readLengths(t){const r=e.parquetchunk_readLengths(this.__wbg_ptr,t);let n;return 0!==r[0]&&(n=v(r[0],r[1]).slice(),e.__wbindgen_free(r[0],4*r[1],4)),n}transformGeometry(t,r,n,_,i,o){k(t,J);const s=e.parquetchunk_transformGeometry(this.__wbg_ptr,t.__wbg_ptr,r,n,_,i,o);return 16777215===s?void 0:0!==s}boundsXMin(t){const r=e.parquetchunk_boundsXMin(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsYMin(t){const r=e.parquetchunk_boundsYMin(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsXMax(t){const r=e.parquetchunk_boundsXMax(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsYMax(t){const r=e.parquetchunk_boundsYMax(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readAttribute(t,r){return e.parquetchunk_readAttribute(this.__wbg_ptr,t,r)}}const Y="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_parquetfile_free(t>>>0,1));class N{static __wrap(e){e>>>=0;const t=Object.create(N.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_parquetfile_free(t,0)}[Symbol.dispose](){this.free()}static fromUrl(t,r,n,_){const i=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=s;let a=0;w(_)||(k(_,D),a=_.__destroy_into_raw());return e.parquetfile_fromUrl(i,o,r,n,a)}static fromBinary(t,r){const n=O(t,e.__wbindgen_malloc),_=s;let i=0;w(r)||(k(r,D),i=r.__destroy_into_raw());return e.parquetfile_fromBinary(n,_,i)}version(){return e.parquetfile_version(this.__wbg_ptr)}byteLength(){return e.parquetfile_byteLength(this.__wbg_ptr)}numRows(){return e.parquetfile_numRows(this.__wbg_ptr)>>>0}numFields(){return e.parquetfile_numFields(this.__wbg_ptr)>>>0}numColumns(){return e.parquetfile_numColumns(this.__wbg_ptr)>>>0}createdBy(){const t=e.parquetfile_createdBy(this.__wbg_ptr);let r;return 0!==t[0]&&(r=o(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}keyValueMetadata(t){const r=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=s,_=e.parquetfile_keyValueMetadata(this.__wbg_ptr,r,n);let i;return 0!==_[0]&&(i=o(_[0],_[1]).slice(),e.__wbindgen_free(_[0],1*_[1],1)),i}keys(){const t=e.parquetfile_keys(this.__wbg_ptr);let r;return 0!==t[0]&&(r=T(t[0],t[1]).slice(),e.__wbindgen_free(t[0],4*t[1],4)),r}columnForFieldName(t){const r=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=s,_=e.parquetfile_columnForFieldName(this.__wbg_ptr,r,n);return 4294967297===_?void 0:_}fields(){const t=e.parquetfile_fields(this.__wbg_ptr);var r=T(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}rowGroups(){const t=e.parquetfile_rowGroups(this.__wbg_ptr);var r=T(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}ensureFields(t){const r=S(t,e.__wbindgen_malloc),n=s;return e.parquetfile_ensureFields(this.__wbg_ptr,r,n)}readFirstChunk(t){const r=S(t,e.__wbindgen_malloc),n=s;return e.parquetfile_readFirstChunk(this.__wbg_ptr,r,n)}readChunk(t,r,n,_,i){const o=S(n,e.__wbindgen_malloc),a=s;return e.parquetfile_readChunk(this.__wbg_ptr,t,r,o,a,_,i)}readChunksByRowId(t,r,n,_){const i=S(t,e.__wbindgen_malloc),o=s,a=S(r,e.__wbindgen_malloc),c=s;return e.parquetfile_readChunksByRowId(this.__wbg_ptr,i,o,a,c,n,_)}readAllChunks(t,r,n){const _=S(t,e.__wbindgen_malloc),i=s;return e.parquetfile_readAllChunks(this.__wbg_ptr,_,i,r,n)}queryZChunks(t,r,n,_){const i=S(r,e.__wbindgen_malloc),o=s;return e.parquetfile_queryZChunks(this.__wbg_ptr,t,i,o,n,_)}queryXZChunks(t,r,n){return e.parquetfile_queryXZChunks(this.__wbg_ptr,t,r,n)}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_primarygeometryfield_free(t>>>0,1));class H{static __wrap(e){e>>>=0;const t=Object.create(H.prototype);return t.__wbg_ptr=e,Z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_primarygeometryfield_free(t,0)}[Symbol.dispose](){this.free()}static fromNative(t){const r=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=s,_=e.primarygeometryfield_fromNative(r,n);return H.__wrap(_)}static fromWkb(t){const r=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=s,_=e.primarygeometryfield_fromWkb(r,n);return H.__wrap(_)}static fromLocation(t,r){const n=u(t,e.__wbindgen_malloc,e.__wbindgen_realloc),_=s,i=u(r,e.__wbindgen_malloc,e.__wbindgen_realloc),o=s,a=e.primarygeometryfield_fromLocation(n,_,i,o);return H.__wrap(a)}}const $="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_quantizedgeometrybuffer_free(t>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,$.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_quantizedgeometrybuffer_free(t,0)}[Symbol.dispose](){this.free()}static new(){const t=e.quantizedgeometrybuffer_new();return J.__wrap(t)}readCoordsUnsafe(){return e.quantizedgeometrybuffer_readCoordsUnsafe(this.__wbg_ptr)}readLengthsUnsafe(){return e.quantizedgeometrybuffer_readLengthsUnsafe(this.__wbg_ptr)}}const K="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_rangeproviderjs_free(t>>>0,1));class Q{static __wrap(e){e>>>=0;const t=Object.create(Q.prototype);return t.__wbg_ptr=e,K.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_rangeproviderjs_free(t,0)}[Symbol.dispose](){this.free()}static new(t,r){const n=e.rangeproviderjs_new(t,r);return Q.__wrap(n)}static withFetch(){const t=e.rangeproviderjs_withFetch();return Q.__wrap(t)}}const ee="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_rowgroup_free(t>>>0,1));class te{static __wrap(e){e>>>=0;const t=Object.create(te.prototype);return t.__wbg_ptr=e,ee.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ee.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_rowgroup_free(t,0)}[Symbol.dispose](){this.free()}columnDescriptorForAttribute(t){const r=e.rowgroup_columnDescriptorForAttribute(this.__wbg_ptr,t);return I.__wrap(r)}}async function re(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if("application/wasm"==e.headers.get("Content-Type"))throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{const r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function ne(){const n={wbg:{}};return n.wbg.__wbg_aborted_c078e36031795a9a=function(e){return e.aborted},n.wbg.__wbg_apply_36be6a55257c99bf=function(){return r(function(e,t,r){return e.apply(t,r)},arguments)},n.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},n.wbg.__wbg_call_672a4d21634d4a24=function(){return r(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_call_7cccdd69e0791ae2=function(){return r(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,r){let n,_;try{n=t,_=r,console.error(o(t,r))}finally{e.__wbindgen_free(n,_,1)}},n.wbg.__wbg_fieldmetadata_new=function(e){return U.__wrap(e)},n.wbg.__wbg_get_67b2ba62fc30de12=function(){return r(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_length_6ca527665d89694d=function(e){return e.length},n.wbg.__wbg_length_a446193dc22c12f8=function(e){return e.length},n.wbg.__wbg_multiscalegeometryfield_unwrap=function(e){return B.__unwrap(e)},n.wbg.__wbg_new_23a2665fac83c611=function(e,t){try{var r={a:e,b:t},n=(e,t)=>{const n=r.a;r.a=0;try{return A(n,r.b,e,t)}finally{r.a=n}};return new Promise(n)}finally{r.a=r.b=0}},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_e3b321dcfef89fc7=function(e){return new Uint32Array(e)},n.wbg.__wbg_newnoargs_105ed471475aaf50=function(e,t){return new Function(o(e,t))},n.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(e,t,r){return new Uint32Array(e,t>>>0,r>>>0)},n.wbg.__wbg_newwithbyteoffsetandlength_f254047f7e80e7ff=function(e,t,r){return new Int16Array(e,t>>>0,r>>>0)},n.wbg.__wbg_newwithlength_c4c419ef0bc8a1f8=function(e){return new Array(e>>>0)},n.wbg.__wbg_pageencodingdescriptor_new=function(e){return G.__wrap(e)},n.wbg.__wbg_parquetchunk_new=function(e){return X.__wrap(e)},n.wbg.__wbg_parquetfile_new=function(e){return N.__wrap(e)},n.wbg.__wbg_queueMicrotask_98e746b9f850fe3d=function(e){queueMicrotask(e)},n.wbg.__wbg_queueMicrotask_c847cc8372bec908=function(e){return e.queueMicrotask},n.wbg.__wbg_resolve_4851785c9c5f573d=function(e){return Promise.resolve(e)},n.wbg.__wbg_rowgroup_new=function(e){return te.__wrap(e)},n.wbg.__wbg_set_37837023f3d740e8=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_set_65595bdd868b3009=function(e,t,r){e.set(t,r>>>0)},n.wbg.__wbg_set_d23661d19148b229=function(e,t,r){e.set(t,r>>>0)},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,r){const n=u(r.stack,e.__wbindgen_malloc,e.__wbindgen_realloc),_=s;l().setInt32(t+4,_,!0),l().setInt32(t+0,n,!0)},n.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const e="undefined"==typeof global?null:global;return w(e)?0:t(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const e="undefined"==typeof globalThis?null:globalThis;return w(e)?0:t(e)},n.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const e="undefined"==typeof self?null:self;return w(e)?0:t(e)},n.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const e="undefined"==typeof window?null:window;return w(e)?0:t(e)},n.wbg.__wbg_then_44b73946d2fb3e7d=function(e,t){return e.then(t)},n.wbg.__wbg_then_48b406749878a531=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_valueOf_fdbb54fcdfe33477=function(e){return e.valueOf()},n.wbg.__wbindgen_array_new=function(){return[]},n.wbg.__wbindgen_array_push=function(e,t){e.push(t)},n.wbg.__wbindgen_bigint_from_i64=function(e){return e},n.wbg.__wbindgen_cb_drop=function(e){const t=e.original;if(1==t.cnt--)return t.a=0,!0;return!1},n.wbg.__wbindgen_closure_wrapper1704=function(e,t,r){return d(e,t,84,x)},n.wbg.__wbindgen_init_externref_table=function(){const t=e.__wbindgen_export_2,r=t.grow(4);t.set(0,void 0),t.set(r+0,void 0),t.set(r+1,null),t.set(r+2,!0),t.set(r+3,!1)},n.wbg.__wbindgen_is_function=function(e){return"function"==typeof e},n.wbg.__wbindgen_is_undefined=function(e){return void 0===e},n.wbg.__wbindgen_memory=function(){return e.memory},n.wbg.__wbindgen_number_get=function(e,t){const r="number"==typeof t?t:void 0;l().setFloat64(e+8,w(r)?0:r,!0),l().setInt32(e+0,!w(r),!0)},n.wbg.__wbindgen_number_new=function(e){return e},n.wbg.__wbindgen_string_new=function(e,t){return o(e,t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(o(e,t))},n.wbg.__wbindgen_uint8_array_new=function(t,r){var n=f(t,r).slice();e.__wbindgen_free(t,1*r,1);return n},n}function _e(t,r){return e=t.exports,oe.__wbindgen_wasm_module=r,g=null,y=null,F=null,_=null,e.__wbindgen_start(),e}function ie(t){if(void 0!==e)return e;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const r=ne();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return _e(new WebAssembly.Instance(t,r),t)}async function oe(t){if(void 0!==e)return e;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const r=ne();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:_}=await re(await t,r);return _e(n,_)}export{I as ColumnDescriptor,U as FieldMetadata,D as GeometryInfo,C as GeometryType,B as MultiscaleGeometryField,G as PageEncodingDescriptor,X as ParquetChunk,N as ParquetFile,H as PrimaryGeometryField,J as QuantizedGeometryBuffer,Q as RangeProviderJs,te as RowGroup,oe as default,p as enableTracing,ie as initSync};
5
+ let e;function t(t){const r=e.__externref_table_alloc();return e.__wbindgen_export_2.set(r,t),r}function r(r,n){try{return r.apply(this,n)}catch(_){const r=t(_);e.__wbindgen_exn_store(r)}}let n=null;function _(){return null!==n&&0!==n.byteLength||(n=new Uint8Array(e.memory.buffer)),n}let i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});i.decode();const o=2146435072;let s=0;function a(e,t){return s+=t,s>=o&&(i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),i.decode(),s=t),i.decode(_().subarray(e,e+t))}function c(e,t){return a(e>>>=0,t)}function u(e,t){return e>>>=0,_().subarray(e/1,e/1+t)}let g=null;function l(){return null!==g&&0!==g.byteLength||(g=new Uint32Array(e.memory.buffer)),g}function b(e,t){return e>>>=0,l().subarray(e/4,e/4+t)}let w=0;const p=new TextEncoder;function d(e,t,r){if(void 0===r){const r=p.encode(e),n=t(r.length,1)>>>0;return _().subarray(n,n+r.length).set(r),w=r.length,n}let n=e.length,i=t(n,1)>>>0;const o=_();let s=0;for(;s<n;s++){const t=e.charCodeAt(s);if(t>127)break;o[i+s]=t}if(s!==n){0!==s&&(e=e.slice(s)),i=r(i,n,n=s+3*e.length,1)>>>0;const t=_().subarray(i+s,i+n);s+=p.encodeInto(e,t).written,i=r(i,n,s,1)>>>0}return w=s,i}"encodeInto"in p||(p.encodeInto=function(e,t){const r=p.encode(e);return t.set(r),{read:e.length,written:r.length}});let f=null;function y(){return(null===f||!0===f.buffer.detached||void 0===f.buffer.detached&&f.buffer!==e.memory.buffer)&&(f=new DataView(e.memory.buffer)),f}function h(e){return null==e}const m="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{e.__wbindgen_export_6.get(t.dtor)(t.a,t.b)});function F(t,r,n,_){const i={a:t,b:r,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const r=i.a;i.a=0;try{return _(r,i.b,...t)}finally{0===--i.cnt?(e.__wbindgen_export_6.get(i.dtor)(r,i.b),m.unregister(i)):i.a=r}};return o.original=i,m.register(o,i,i),o}function q(t,r){t>>>=0;const n=y(),_=[];for(let i=t;i<t+4*r;i+=4)_.push(e.__wbindgen_export_2.get(n.getUint32(i,!0)));return e.__externref_drop_slice(t,r),_}let v=null;function k(){return null!==v&&0!==v.byteLength||(v=new Int16Array(e.memory.buffer)),v}function z(e,t){return e>>>=0,k().subarray(e/2,e/2+t)}function R(){e.enableTracing()}let S=null;function T(){return null!==S&&0!==S.byteLength||(S=new Float64Array(e.memory.buffer)),S}function O(e,t){return e>>>=0,T().subarray(e/8,e/8+t)}function A(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function C(e,t){const r=t(8*e.length,8)>>>0;return T().set(e,r/8),w=e.length,r}function x(e,r){const n=r(4*e.length,4)>>>0;for(let _=0;_<e.length;_++){const r=t(e[_]);y().setUint32(n+4*_,r,!0)}return w=e.length,n}function M(e,t){const r=t(1*e.length,1)>>>0;return _().set(e,r/1),w=e.length,r}function j(e,t){const r=t(4*e.length,4)>>>0;return l().set(e,r/4),w=e.length,r}function I(t,r,n){e.closure86_externref_shim(t,r,n)}function L(t,r,n,_){e.closure12_externref_shim(t,r,n,_)}const U=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),W=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],B="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_columndescriptor_free(t>>>0,1));class D{static __wrap(e){e>>>=0;const t=Object.create(D.prototype);return t.__wbg_ptr=e,B.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,B.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_columndescriptor_free(t,0)}name(){let t,r;try{const n=e.columndescriptor_name(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}physicalType(){let t,r;try{const n=e.columndescriptor_physicalType(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}logicalType(){const t=e.columndescriptor_logicalType(this.__wbg_ptr);let r;return 0!==t[0]&&(r=c(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}encodings(){const t=e.columndescriptor_encodings(this.__wbg_ptr);var r=q(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}pageEncodings(){const t=e.columndescriptor_pageEncodings(this.__wbg_ptr);let r;return 0!==t[0]&&(r=q(t[0],t[1]).slice(),e.__wbindgen_free(t[0],4*t[1],4)),r}numValues(){return e.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,r;try{const n=e.columndescriptor_compression(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}compressedSize(){return e.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return e.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){const t=e.columndescriptor_nullCount(this.__wbg_ptr);return 0===t[0]?void 0:t[1]}distinctCount(){const t=e.columndescriptor_distinctCount(this.__wbg_ptr);return 0===t[0]?void 0:t[1]}minValue(){return e.columndescriptor_minValue(this.__wbg_ptr)}maxValue(){return e.columndescriptor_maxValue(this.__wbg_ptr)}}Symbol.dispose&&(D.prototype[Symbol.dispose]=D.prototype.free);const E="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_fieldmetadata_free(t>>>0,1));class P{static __wrap(e){e>>>=0;const t=Object.create(P.prototype);return t.__wbg_ptr=e,E.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_fieldmetadata_free(t,0)}get column(){return e.__wbg_get_fieldmetadata_column(this.__wbg_ptr)>>>0}set column(t){e.__wbg_set_fieldmetadata_column(this.__wbg_ptr,t)}get name(){let t,r;try{const n=e.fieldmetadata_name(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}get type(){const t=e.fieldmetadata_esri_type(this.__wbg_ptr);return W[t]}get physicalType(){const t=e.fieldmetadata_physical_type(this.__wbg_ptr);let r;return 0!==t[0]&&(r=c(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}get logicalType(){const t=e.fieldmetadata_logical_type(this.__wbg_ptr);let r;return 0!==t[0]&&(r=c(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}}Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free);const G="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_geometryinfo_free(t>>>0,1));class V{static __wrap(e){e>>>=0;const t=Object.create(V.prototype);return t.__wbg_ptr=e,G.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_geometryinfo_free(t,0)}static new(t,r,n,_,i){A(_,ee);var o=_.__destroy_into_raw();const s=x(i,e.__wbindgen_malloc),a=w,c=e.geometryinfo_new(t,r,n,o,s,a);return V.__wrap(c)}}Symbol.dispose&&(V.prototype[Symbol.dispose]=V.prototype.free);const X="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_multiscalegeometryfield_free(t>>>0,1));class Y{static __wrap(e){e>>>=0;const t=Object.create(Y.prototype);return t.__wbg_ptr=e,X.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof Y?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_multiscalegeometryfield_free(t,0)}get level(){return e.__wbg_get_multiscalegeometryfield_level(this.__wbg_ptr)}set level(t){e.__wbg_set_multiscalegeometryfield_level(this.__wbg_ptr,t)}static new(t,r,n,_){const i=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w,s=C(n,e.__wbindgen_malloc),a=w,c=C(_,e.__wbindgen_malloc),u=w,g=e.multiscalegeometryfield_new(t,i,o,s,a,c,u);return Y.__wrap(g)}has_field(t){const r=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=w;return 0!==e.multiscalegeometryfield_has_field(this.__wbg_ptr,r,n)}}Symbol.dispose&&(Y.prototype[Symbol.dispose]=Y.prototype.free);const N="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_pageencodingdescriptor_free(t>>>0,1));class Z{static __wrap(e){e>>>=0;const t=Object.create(Z.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,r;try{const n=e.pageencodingdescriptor_pageType(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}encoding(){let t,r;try{const n=e.pageencodingdescriptor_encoding(this.__wbg_ptr);return t=n[0],r=n[1],c(n[0],n[1])}finally{e.__wbindgen_free(t,r,1)}}count(){return e.pageencodingdescriptor_count(this.__wbg_ptr)}}Symbol.dispose&&(Z.prototype[Symbol.dispose]=Z.prototype.free);const H="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_parquetchunk_free(t>>>0,1));class ${static __wrap(e){e>>>=0;const t=Object.create($.prototype);return t.__wbg_ptr=e,H.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_parquetchunk_free(t,0)}size(){return e.parquetchunk_size(this.__wbg_ptr)>>>0}isEmpty(t){return 0!==e.parquetchunk_isEmpty(this.__wbg_ptr,t)}rowId(t){return e.parquetchunk_rowId(this.__wbg_ptr,t)}readX(t){const r=e.parquetchunk_readX(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readY(t){const r=e.parquetchunk_readY(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readCoords(t){const r=e.parquetchunk_readCoords(this.__wbg_ptr,t);let n;return 0!==r[0]&&(n=O(r[0],r[1]).slice(),e.__wbindgen_free(r[0],8*r[1],8)),n}readLengths(t){const r=e.parquetchunk_readLengths(this.__wbg_ptr,t);let n;return 0!==r[0]&&(n=b(r[0],r[1]).slice(),e.__wbindgen_free(r[0],4*r[1],4)),n}transformGeometry(t,r,n,_,i,o){A(t,re);const s=e.parquetchunk_transformGeometry(this.__wbg_ptr,t.__wbg_ptr,r,n,_,i,o);return 16777215===s?void 0:0!==s}boundsXMin(t){const r=e.parquetchunk_boundsXMin(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsYMin(t){const r=e.parquetchunk_boundsYMin(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsXMax(t){const r=e.parquetchunk_boundsXMax(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}boundsYMax(t){const r=e.parquetchunk_boundsYMax(this.__wbg_ptr,t);return 0===r[0]?void 0:r[1]}readAttribute(t,r){return e.parquetchunk_readAttribute(this.__wbg_ptr,t,r)}}Symbol.dispose&&($.prototype[Symbol.dispose]=$.prototype.free);const J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_parquetfile_free(t>>>0,1));class K{static __wrap(e){e>>>=0;const t=Object.create(K.prototype);return t.__wbg_ptr=e,J.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_parquetfile_free(t,0)}static fromUrl(t,r,n,_){const i=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;let s=0;h(_)||(A(_,V),s=_.__destroy_into_raw());return e.parquetfile_fromUrl(i,o,r,n,s)}static fromBinary(t,r){const n=M(t,e.__wbindgen_malloc),_=w;let i=0;h(r)||(A(r,V),i=r.__destroy_into_raw());return e.parquetfile_fromBinary(n,_,i)}version(){return e.parquetfile_version(this.__wbg_ptr)}byteLength(){return e.parquetfile_byteLength(this.__wbg_ptr)}numRows(){return e.parquetfile_numRows(this.__wbg_ptr)>>>0}numFields(){return e.parquetfile_numFields(this.__wbg_ptr)>>>0}numColumns(){return e.parquetfile_numColumns(this.__wbg_ptr)>>>0}createdBy(){const t=e.parquetfile_createdBy(this.__wbg_ptr);let r;return 0!==t[0]&&(r=c(t[0],t[1]).slice(),e.__wbindgen_free(t[0],1*t[1],1)),r}keyValueMetadata(t){const r=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=w,_=e.parquetfile_keyValueMetadata(this.__wbg_ptr,r,n);let i;return 0!==_[0]&&(i=c(_[0],_[1]).slice(),e.__wbindgen_free(_[0],1*_[1],1)),i}keys(){const t=e.parquetfile_keys(this.__wbg_ptr);let r;return 0!==t[0]&&(r=q(t[0],t[1]).slice(),e.__wbindgen_free(t[0],4*t[1],4)),r}columnForFieldName(t){const r=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=w,_=e.parquetfile_columnForFieldName(this.__wbg_ptr,r,n);return 4294967297===_?void 0:_}fields(){const t=e.parquetfile_fields(this.__wbg_ptr);var r=q(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}rowGroups(){const t=e.parquetfile_rowGroups(this.__wbg_ptr);var r=q(t[0],t[1]).slice();return e.__wbindgen_free(t[0],4*t[1],4),r}ensureFields(t){const r=j(t,e.__wbindgen_malloc),n=w;return e.parquetfile_ensureFields(this.__wbg_ptr,r,n)}readFirstChunk(t){const r=j(t,e.__wbindgen_malloc),n=w;return e.parquetfile_readFirstChunk(this.__wbg_ptr,r,n)}readChunk(t,r,n,_,i){const o=j(n,e.__wbindgen_malloc),s=w;return e.parquetfile_readChunk(this.__wbg_ptr,t,r,o,s,_,i)}readChunksByRowId(t,r,n,_){const i=j(t,e.__wbindgen_malloc),o=w,s=j(r,e.__wbindgen_malloc),a=w;return e.parquetfile_readChunksByRowId(this.__wbg_ptr,i,o,s,a,n,_)}readAllChunks(t,r,n){const _=j(t,e.__wbindgen_malloc),i=w;return e.parquetfile_readAllChunks(this.__wbg_ptr,_,i,r,n)}queryZChunks(t,r,n,_){const i=j(r,e.__wbindgen_malloc),o=w;return e.parquetfile_queryZChunks(this.__wbg_ptr,t,i,o,n,_)}queryXZChunks(t,r,n){return e.parquetfile_queryXZChunks(this.__wbg_ptr,t,r,n)}}Symbol.dispose&&(K.prototype[Symbol.dispose]=K.prototype.free);const Q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_primarygeometryfield_free(t>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Q.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_primarygeometryfield_free(t,0)}static fromNative(t){const r=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=w,_=e.primarygeometryfield_fromNative(r,n);return ee.__wrap(_)}static fromWkb(t){const r=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),n=w,_=e.primarygeometryfield_fromWkb(r,n);return ee.__wrap(_)}static fromLocation(t,r){const n=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w,i=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w,s=e.primarygeometryfield_fromLocation(n,_,i,o);return ee.__wrap(s)}}Symbol.dispose&&(ee.prototype[Symbol.dispose]=ee.prototype.free);const te="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_quantizedgeometrybuffer_free(t>>>0,1));class re{static __wrap(e){e>>>=0;const t=Object.create(re.prototype);return t.__wbg_ptr=e,te.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,te.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_quantizedgeometrybuffer_free(t,0)}static new(){const t=e.quantizedgeometrybuffer_new();return re.__wrap(t)}readCoordsUnsafe(){return e.quantizedgeometrybuffer_readCoordsUnsafe(this.__wbg_ptr)}readLengthsUnsafe(){return e.quantizedgeometrybuffer_readLengthsUnsafe(this.__wbg_ptr)}}Symbol.dispose&&(re.prototype[Symbol.dispose]=re.prototype.free);const ne="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_rangeproviderjs_free(t>>>0,1));class _e{static __wrap(e){e>>>=0;const t=Object.create(_e.prototype);return t.__wbg_ptr=e,ne.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ne.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_rangeproviderjs_free(t,0)}static new(t,r){const n=e.rangeproviderjs_new(t,r);return _e.__wrap(n)}static withFetch(){const t=e.rangeproviderjs_withFetch();return _e.__wrap(t)}}Symbol.dispose&&(_e.prototype[Symbol.dispose]=_e.prototype.free);const ie="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>e.__wbg_rowgroup_free(t>>>0,1));class oe{static __wrap(e){e>>>=0;const t=Object.create(oe.prototype);return t.__wbg_ptr=e,ie.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ie.unregister(this),e}free(){const t=this.__destroy_into_raw();e.__wbg_rowgroup_free(t,0)}columnDescriptorForAttribute(t){const r=e.rowgroup_columnDescriptorForAttribute(this.__wbg_ptr,t);return D.__wrap(r)}}Symbol.dispose&&(oe.prototype[Symbol.dispose]=oe.prototype.free);const se=new Set(["basic","cors","default"]);async function ae(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(!(e.ok&&se.has(e.type))||"application/wasm"===e.headers.get("Content-Type"))throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{const r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function ce(){const n={wbg:{}};return n.wbg.__wbg_aborted_bbd6fc8f83561eda=function(e){return e.aborted},n.wbg.__wbg_apply_dc50eb58583d2a57=function(){return r(function(e,t,r){return e.apply(t,r)},arguments)},n.wbg.__wbg_call_13410aac570ffff7=function(){return r(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_call_a5400b25a865cfd8=function(){return r(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,r){let n,_;try{n=t,_=r,console.error(c(t,r))}finally{e.__wbindgen_free(n,_,1)}},n.wbg.__wbg_fieldmetadata_new=function(e){return P.__wrap(e)},n.wbg.__wbg_get_458e874b43b18b25=function(){return r(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_length_555ae304a7c78975=function(e){return e.length},n.wbg.__wbg_length_6bb7e81f9d7713e4=function(e){return e.length},n.wbg.__wbg_multiscalegeometryfield_unwrap=function(e){return Y.__unwrap(e)},n.wbg.__wbg_new_2e3c58a15f39f5f9=function(e,t){try{var r={a:e,b:t},n=(e,t)=>{const n=r.a;r.a=0;try{return L(n,r.b,e,t)}finally{r.a=n}};return new Promise(n)}finally{r.a=r.b=0}},n.wbg.__wbg_new_638ebfaedbf32a5e=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_newnoargs_254190557c45b4ec=function(e,t){return new Function(c(e,t))},n.wbg.__wbg_newwithlength_c2868113efe93526=function(e){return new Array(e>>>0)},n.wbg.__wbg_pageencodingdescriptor_new=function(e){return Z.__wrap(e)},n.wbg.__wbg_parquetchunk_new=function(e){return $.__wrap(e)},n.wbg.__wbg_parquetfile_new=function(e){return K.__wrap(e)},n.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(e,t,r){Uint8Array.prototype.set.call(u(e,t),r)},n.wbg.__wbg_prototypesetcall_c805289d23423a87=function(e,t,r){Uint32Array.prototype.set.call(b(e,t),r)},n.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(e){queueMicrotask(e)},n.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(e){return e.queueMicrotask},n.wbg.__wbg_resolve_4055c623acdd6a1b=function(e){return Promise.resolve(e)},n.wbg.__wbg_rowgroup_new=function(e){return oe.__wrap(e)},n.wbg.__wbg_set_90f6c0f7bd8c0415=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,r){const n=d(r.stack,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;y().setInt32(t+4,_,!0),y().setInt32(t+0,n,!0)},n.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){const e="undefined"==typeof global?null:global;return h(e)?0:t(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){const e="undefined"==typeof globalThis?null:globalThis;return h(e)?0:t(e)},n.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){const e="undefined"==typeof self?null:self;return h(e)?0:t(e)},n.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){const e="undefined"==typeof window?null:window;return h(e)?0:t(e)},n.wbg.__wbg_then_b33a773d723afa3e=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_then_e22500defe16819f=function(e,t){return e.then(t)},n.wbg.__wbg_valueOf_f1ef20623c7bdd1c=function(e){return e.valueOf()},n.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(e){const t=e.original;if(1==t.cnt--)return t.a=0,!0;return!1},n.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(e){return"function"==typeof e},n.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(e){return void 0===e},n.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(e,t){const r="number"==typeof t?t:void 0;y().setFloat64(e+8,h(r)?0:r,!0),y().setInt32(e+0,!h(r),!0)},n.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(e,t){throw new Error(c(e,t))},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){return c(e,t)},n.wbg.__wbindgen_cast_59b536ec5375efa9=function(e,t){return F(e,t,85,I)},n.wbg.__wbindgen_cast_77bc3e92745e9a35=function(t,r){var n=u(t,r).slice();e.__wbindgen_free(t,1*r,1);return n},n.wbg.__wbindgen_cast_7c316abdc43840a3=function(e,t){return b(e,t)},n.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return e},n.wbg.__wbindgen_cast_b4c60c1010b00353=function(t,r){var n=q(t,r).slice();e.__wbindgen_free(t,4*r,4);return n},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return e},n.wbg.__wbindgen_cast_e47ceb6027f5c92c=function(e,t){return z(e,t)},n.wbg.__wbindgen_init_externref_table=function(){const t=e.__wbindgen_export_2,r=t.grow(4);t.set(0,void 0),t.set(r+0,void 0),t.set(r+1,null),t.set(r+2,!0),t.set(r+3,!1)},n}function ue(t,r){return e=t.exports,le.__wbindgen_wasm_module=r,f=null,S=null,v=null,g=null,n=null,e.__wbindgen_start(),e}function ge(t){if(void 0!==e)return e;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const r=ce();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return ue(new WebAssembly.Instance(t,r),t)}async function le(t){if(void 0!==e)return e;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const r=ce();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:_}=await ae(await t,r);return ue(n,_)}export{D as ColumnDescriptor,P as FieldMetadata,V as GeometryInfo,U as GeometryType,Y as MultiscaleGeometryField,Z as PageEncodingDescriptor,$ as ParquetChunk,K as ParquetFile,ee as PrimaryGeometryField,re as QuantizedGeometryBuffer,_e as RangeProviderJs,oe as RowGroup,le as default,R as enableTracing,ge as initSync};
package/config.js CHANGED
@@ -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"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.100";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.102";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/interfaces.d.ts CHANGED
@@ -15966,6 +15966,22 @@ declare namespace __esri {
15966
15966
  | "year"
15967
15967
  | "short-time"
15968
15968
  | "long-time"): Intl.DateTimeFormatOptions;
15969
+ /**
15970
+ * Converts a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DateTimeFieldFormat.html DateTimeFieldFormat} to an [Intl.DateTimeFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Parameters) options object.
15971
+ *
15972
+ * @param format The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DateTimeFieldFormat.html DateTimeFieldFormat} to convert.
15973
+ *
15974
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#convertDateTimeFieldFormatToIntlOptions Read more...}
15975
+ */
15976
+ convertDateTimeFieldFormatToIntlOptions(format: DateTimeFieldFormat): Intl.DateTimeFormatOptions;
15977
+ /**
15978
+ * Converts a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html NumberFieldFormat} to an [Intl.NumberFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat#Parameters) options object.
15979
+ *
15980
+ * @param format The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html NumberFieldFormat} to convert.
15981
+ *
15982
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#convertNumberFieldFormatToIntlOptions Read more...}
15983
+ */
15984
+ convertNumberFieldFormatToIntlOptions(format: NumberFieldFormat): Intl.NumberFormatOptions;
15969
15985
  /**
15970
15986
  * Converts a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#NumberFormat NumberFormat} to an [Intl.NumberFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat#Parameters) object.
15971
15987
  *
@@ -116181,11 +116197,11 @@ declare namespace __esri {
116181
116197
  * Starts an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateFeaturesWorkflow.html UpdateFeaturesWorkflow} using
116182
116198
  * the provided features.
116183
116199
  *
116184
- * @param features The features to be updated.
116200
+ * @param featuresOrInfos The features to be updated.
116185
116201
  *
116186
116202
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startUpdateFeaturesWorkflow Read more...}
116187
116203
  */
116188
- startUpdateFeaturesWorkflow(features: Graphic[]): Promise<void>;
116204
+ startUpdateFeaturesWorkflow(featuresOrInfos: Graphic[] | FeatureInfo[]): Promise<void>;
116189
116205
  /**
116190
116206
  * Starts the update workflow at the feature geometry and attribute editing panel.
116191
116207
  *
@@ -116686,9 +116702,17 @@ declare namespace __esri {
116686
116702
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateFeaturesWorkflowData.html#editorItems Read more...}
116687
116703
  */
116688
116704
  editorItems: EditorItem[];
116705
+ /**
116706
+ * The layers and ids of features that are being updated.
116707
+ *
116708
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateFeaturesWorkflowData.html#featureInfos Read more...}
116709
+ */
116710
+ featureInfos: FeatureInfo[] | nullish;
116689
116711
  /**
116690
116712
  * The features that are being updated.
116691
116713
  *
116714
+ * @deprecated since version 4.34. Refer to [`featureInfos`](#featureInfos) instead.
116715
+ *
116692
116716
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateFeaturesWorkflowData.html#features Read more...}
116693
116717
  */
116694
116718
  features: Graphic[];
@@ -116912,6 +116936,16 @@ declare namespace __esri {
116912
116936
  startAt?: "drawing-splitter-geometry" | "reviewing-features";
116913
116937
  }
116914
116938
 
116939
+ /**
116940
+ * This object provides information required when updating a set of features.
116941
+ *
116942
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#FeatureInfo Read more...}
116943
+ */
116944
+ export interface FeatureInfo {
116945
+ layer: FeatureLayer | GeoJSONLayer | OrientedImageryLayer | SceneLayer | SubtypeSublayer | KnowledgeGraphSublayer;
116946
+ objectIds: (number | string)[];
116947
+ }
116948
+
116915
116949
  /**
116916
116950
  * Configurations used for setting the layer's editable preferences within the Editor.
116917
116951
  *
package/intl/date.js CHANGED
@@ -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{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as e,getLocaleLanguage as o,normalizeLocale as n}from"./locale.js";import{unknown as r,utc as a,system as m,systemTimeZone as h}from"../time/constants.js";import{shortTimeZoneName as i}from"../time/timeZoneUtils.js";import{DateTime as s}from"luxon";const l={year:void 0,month:void 0,day:void 0,weekday:void 0},y={hour:void 0,minute:void 0,second:void 0},d={timeZone:a},g={year:"numeric",month:"numeric",day:"numeric"},u={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},D={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},T={...f,second:"numeric"},S={hourCycle:"h23"},L={...f,...S},w={...T,...S},M={"short-date":g,"short-date-short-time":{...g,...f},"short-date-short-time-24":{...g,...L},"short-date-long-time":{...g,...T},"short-date-long-time-24":{...g,...w},"short-date-le":g,"short-date-le-short-time":{...g,...f},"short-date-le-short-time-24":{...g,...L},"short-date-le-long-time":{...g,...T},"short-date-le-long-time-24":{...g,...w},"long-month-day-year":u,"long-month-day-year-short-time":{...u,...f},"long-month-day-year-short-time-24":{...u,...L},"long-month-day-year-long-time":{...u,...T},"long-month-day-year-long-time-24":{...u,...w},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...L},"day-short-month-year-long-time":{...c,...T},"day-short-month-year-long-time-24":{...c,...w},"long-date":D,"long-date-short-time":{...D,...f},"long-date-short-time-24":{...D,...L},"long-date-long-time":{...D,...T},"long-date-long-time-24":{...D,...w},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":T},Y=t()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Z={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"},p=new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)),v=p.find(({type:t})=>"month"===t)?.value.toLowerCase();function j(){const t=o();return(t&&Z[t])??n()}"mart"!==v&&(Z.bs="sr-Latn-CS");let E=new WeakMap;const k=M["short-date-short-time"],I=M["short-date"];function N(t){let e=E.get(t);if(!e){const o=j(),n=O(t.timeZone??m),r={...t,timeZone:n};e=new Intl.DateTimeFormat(o,r),E.set(t,e)}return e}function C(t){return M[t]}function F(t){const{dateStyle:e,timeStyle:o,hour12:n,year:r,month:a}=t,m={};return e?m.dateStyle=e:r&&(m.year=r,m.month=a||void 0),o&&!m.year&&(m.timeStyle=o,m.hour12="auto"===n?void 0:"always"===n),m}function b(t,e=k){return N(e).format(t)}function x(t,e=k){return b(new Date(t),{...e,...d,...y})}function P(t,e=k){return b(new Date(`1970-01-01T${t}Z`),{...e,...d,...l})}function W(t,e=k){if(e.timeZone)return b(new Date(t),e);const o=s.fromISO(t,{setZone:!0}),n=0===o.offset?a:e.timeZone,r={...e,timeZone:n};return o.toLocaleString(r,{locale:j()})}function O(t){switch(t){case m:return h;case r:return a;default:return t}}function U(t,e){return new Intl.DateTimeFormat(j(),e).formatToParts(t)}function $(t,e=new Date){return U(e,{timeZone:t,timeZoneName:i}).find(({type:t})=>"timeZoneName"===t)?.value}e(()=>{E=new WeakMap});export{C as convertDateFormatToIntlOptions,F as convertDateTimeFieldFormatToIntlOptions,Y as dateFormatJSONMap,k as defaultFormatterOptions,I as defaultFormatterOptionsNoTime,b as formatDate,x as formatDateOnly,P as formatTimeOnly,W as formatTimestamp,N as getDateTimeFormatter,$ as getShortOffsetTimeZoneSuffix,O as resolveTimeZone};
5
+ import{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as e,getLocaleLanguage as o,normalizeLocale as n}from"./locale.js";import{unknown as r,utc as a,system as m,systemTimeZone as h}from"../time/constants.js";import{shortTimeZoneName as i}from"../time/timeZoneUtils.js";import{DateTime as s}from"luxon";const l={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},y={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},d={timeZone:a},g={year:"numeric",month:"numeric",day:"numeric"},u={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},D={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},T={...f,second:"numeric"},S={hourCycle:"h23"},L={...f,...S},v={...T,...S},w={"short-date":g,"short-date-short-time":{...g,...f},"short-date-short-time-24":{...g,...L},"short-date-long-time":{...g,...T},"short-date-long-time-24":{...g,...v},"short-date-le":g,"short-date-le-short-time":{...g,...f},"short-date-le-short-time-24":{...g,...L},"short-date-le-long-time":{...g,...T},"short-date-le-long-time-24":{...g,...v},"long-month-day-year":u,"long-month-day-year-short-time":{...u,...f},"long-month-day-year-short-time-24":{...u,...L},"long-month-day-year-long-time":{...u,...T},"long-month-day-year-long-time-24":{...u,...v},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...L},"day-short-month-year-long-time":{...c,...T},"day-short-month-year-long-time-24":{...c,...v},"long-date":D,"long-date-short-time":{...D,...f},"long-date-short-time-24":{...D,...L},"long-date-long-time":{...D,...T},"long-date-long-time-24":{...D,...v},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":T},M=t()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Y={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"},Z=new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)),p=Z.find(({type:t})=>"month"===t)?.value.toLowerCase();function j(){const t=o();return(t&&Y[t])??n()}"mart"!==p&&(Y.bs="sr-Latn-CS");let E=new WeakMap;const k=w["short-date-short-time"],C=w["short-date"];function I(t){let e=E.get(t);if(!e){const o=j(),n=O(t.timeZone??m),r={...t,timeZone:n};e=new Intl.DateTimeFormat(o,r),E.set(t,e)}return e}function N(t){return w[t]}function F(t){const{dateStyle:e,timeStyle:o,hour12:n,year:r,month:a}=t,m={};return e?m.dateStyle=e:r&&(m.year=r,m.month=a||void 0),o&&!m.year&&(m.timeStyle=o,m.hour12="auto"===n?void 0:"always"===n),m}function b(t,e=k){return I(e).format(t)}function x(t,e=k){return b(new Date(t),{...e,...d,...y})}function P(t,e=k){return b(new Date(`1970-01-01T${t}Z`),{...e,...d,...l})}function W(t,e=k){if(e.timeZone)return b(new Date(t),e);const o=s.fromISO(t,{setZone:!0}),n=0===o.offset?a:e.timeZone,r={...e,timeZone:n};return o.toLocaleString(r,{locale:j()})}function O(t){switch(t){case m:return h;case r:return a;default:return t}}function U(t,e){return new Intl.DateTimeFormat(j(),e).formatToParts(t)}function $(t,e=new Date){return U(e,{timeZone:t,timeZoneName:i}).find(({type:t})=>"timeZoneName"===t)?.value}e(()=>{E=new WeakMap});export{N as convertDateFormatToIntlOptions,F as convertDateTimeFieldFormatToIntlOptions,M as dateFormatJSONMap,k as defaultFormatterOptions,C as defaultFormatterOptionsNoTime,b as formatDate,x as formatDateOnly,P as formatTimeOnly,W as formatTimestamp,I as getDateTimeFormatter,$ as getShortOffsetTimeZoneSuffix,O as resolveTimeZone};
package/intl.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import "./interfaces";
2
2
 
3
3
  export const convertDateFormatToIntlOptions: __esri.intl["convertDateFormatToIntlOptions"];
4
+ export const convertDateTimeFieldFormatToIntlOptions: __esri.intl["convertDateTimeFieldFormatToIntlOptions"];
5
+ export const convertNumberFieldFormatToIntlOptions: __esri.intl["convertNumberFieldFormatToIntlOptions"];
4
6
  export const convertNumberFormatToIntlOptions: __esri.intl["convertNumberFormatToIntlOptions"];
5
7
  export const createJSONLoader: __esri.intl["createJSONLoader"];
6
8
  export const fetchMessageBundle: __esri.intl["fetchMessageBundle"];
package/intl.js CHANGED
@@ -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
- export{convertDateFormatToIntlOptions,formatDate,formatDateOnly,formatTimeOnly,formatTimestamp}from"./intl/date.js";export{convertNumberFormatToIntlOptions,formatNumber}from"./intl/number.js";export{substitute}from"./intl/substitute.js";export{getLocale,getLocaleLanguage,onLocaleChange,prefersRTL,setLocale}from"./intl/locale.js";import{registerMessageBundleLoader as t}from"./intl/messages.js";export{fetchMessageBundle,normalizeMessageBundleLocale}from"./intl/messages.js";import{createJSONLoader as e}from"./intl/t9n.js";import{getAssetUrl as o}from"./assets.js";t(e({pattern:"esri/",location:o}));export{e as createJSONLoader,t as registerMessageBundleLoader};
5
+ export{convertDateFormatToIntlOptions,convertDateTimeFieldFormatToIntlOptions,formatDate,formatDateOnly,formatTimeOnly,formatTimestamp}from"./intl/date.js";export{convertNumberFieldFormatToIntlOptions,convertNumberFormatToIntlOptions,formatNumber}from"./intl/number.js";export{substitute}from"./intl/substitute.js";export{getLocale,getLocaleLanguage,onLocaleChange,prefersRTL,setLocale}from"./intl/locale.js";import{registerMessageBundleLoader as t}from"./intl/messages.js";export{fetchMessageBundle,normalizeMessageBundleLocale}from"./intl/messages.js";import{createJSONLoader as e}from"./intl/t9n.js";import{getAssetUrl as o}from"./assets.js";t(e({pattern:"esri/",location:o}));export{e as createJSONLoader,t as registerMessageBundleLoader};
package/kernel.js CHANGED
@@ -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{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.100",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.102",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -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{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as i}from"../../../geometry/support/centroid.js";import{getPolygonExtent as s,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as m}from"./geometryUtils.js";import{project as d}from"./projectionSupport.js";import{getDateInNumber as h}from"./queryUtils.js";import{makeEdgeCandidate as f,makeVertexCandidate as p}from"./SnappingCandidate.js";import{isDateField as y,isDateOnlyField as g,isTimestampOffsetField as x,isStringField as T,isTimeOnlyField as F}from"../../support/fieldUtils.js";import I from"../../../rest/support/AutoIntervalBinParameters.js";import _ from"../../../rest/support/DateBinParameters.js";import{unitsDict as S}from"../../../rest/support/DateBinUtils.js";import V from"../../../rest/support/FixedBoundariesBinParameters.js";import b from"../../../rest/support/FixedIntervalBinParameters.js";import{calculateStringStatistics as v,calculateStatistics as R,processSummaryStatisticsResult as B,calculateUniqueValuesCount as z,createUVResult as M,calculateClassBreaks as A,resolveCBResult as N,calculateHistogram as D,getAttributeComparator as w,calculatePercentile as P,binIndex as q,getBinParams as Z,isNullCountSupported as j}from"../../../statistics/utils.js";import{utc as G}from"../../../time/constants.js";import{DateTime as C}from"luxon";const O="bin";class E{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new l(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!n.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}n.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:s,items:a}=u[t],r=s.join(",");i&&!e.validateItems(a,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...d(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=Q(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),h=new U(null,0),y=new U(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?J:t.lengths;if(h.coords=i,y.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=h;n.coordsIndex=e;const p=y;p.coordsIndex=t===i-1?m:e+a;const T=g;if(!H(g,r,n,p))continue;const F=(r.x-T.x)/o,I=(r.y-T.y)/l,_=F*F+I*I;_<=1&&u.candidates.push(f(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(p)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,f=y;f.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=h;if(a.coordsIndex=e,c&&t===i-1&&a.x===f.x&&a.y===f.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,y=n*n+m*m;y<=1&&u.candidates.push(p(s.getObjectId(x),d(a),Math.sqrt(y)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=h;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(p(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort((e,t)=>e.distance-t.distance),u}_getPointCreator(e,t,i,s){const a=null==s||o(i,s)?e=>e:e=>d(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=y(m)||g(m)||x(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),f=j({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),p={value:.5,fieldType:m?.type},F=T(m)?v({values:h,supportsNullCount:f,percentileParams:p,outStatisticTypes:c}):R({values:h,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:p,outStatisticTypes:c});return B(F,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},this.items,!1),l=z(o);return M(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),f=A(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return N(f,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return D(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=w(r?.type,n);e.sort((e,t)=>{const s=i(e,a,r),n=i(t,a,r);return o(s,n)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:f,returnM:p}=e,y=null!=d&&t.length>(h||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&p,hasZ:a&&f,objectIdFieldName:n,spatialReference:u(c||o),transform:m&&r(m)||null}}_createFeatures(e,t){const i=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:d,maxAllowableOffset:h,resultOffset:f,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,n,(e,t,s)=>i.getFieldValue(e,t,s)),this.geometryType&&(u||d)){const e=r(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(u&&!d)for(const s of _){const a=this.featureAdapter.getGeometry(s),r=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),geometry:c(this.geometryType,this.hasZ,this.hasM,a,h,e,x,T)});t&&a&&!r.geometry&&(r.centroid=m(this,this.featureAdapter.getCentroid(s,this),e)),F[I++]=r}else if(!u&&d)for(const s of _)F[I++]=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e)});else for(const s of _)F[I++]=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,T)})}else for(const r of _){const e=i.getAttributes(r);e&&(F[I++]=this._addFeatureJSONMetadata(r,{attributes:e}))}const S=f||0;if(null!=p){const e=S+p;F=F.slice(S,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=Q(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)},0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,r=new Map,n=new Map,o=new Map,u=new l(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:f}=e,p=m?.length,y=!!p,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const l of c??[]){const{outStatisticFieldName:e,statisticType:c}=l,h=l,f="exceedslimit"!==c?l.onStatisticField:void 0,F="percentile_disc"===c||"percentile_cont"===c,I="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===p&&(f===g||x)&&"count"===c;if(y){if(!n.has(f)){const e=[];for(const i of m){const s=this._getAttributeValues(u,i,t,a);e.push(s)}n.set(f,this._calculateUniqueValues(e,t,!I&&u.returnDistinctValues))}const i=n.get(f);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:l,itemPositions:c}=i[r],p=n.join(",");if(!d||u.validateItems(l,d)){const i=o.get(p)||{attributes:{}};if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,l);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(u,f,t,a),i=c.map(t=>e[t]);r=F&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,u.returnDistinctValues)}i.attributes[e]=r}let r=0;m.forEach((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=n[t]),o.set(p,i)}}}else if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(u,f,t,a);i.attributes[e]=F&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,u.returnDistinctValues)}const S="min"!==c&&"max"!==c||!T(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:e,alias:e,type:S||"esriFieldTypeDouble"})}const F=y?Array.from(o.values()):[i];return this._sortFeatures(F,h,(e,t)=>e.attributes[t]),f&&(F.length=Math.min(f,F.length)),{fields:s,features:F}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return y(t)||g(t)||x(t)||F(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:m,spatialReference:d,geometryType:h,hasZ:f,hasM:p}=this,y=r.map(e=>c(h,f,p,m.getGeometry(e))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?s(g):a(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?t(g):i(a(o(d,y)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=g,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:r}=e;let n=null;n=i?.has(a)?i.get(a):T(this.fieldsIndex.get(a))||this._isAnyDateField(a)?v({values:t,returnDistinct:s}):R({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:r,orderBy:n}=s,o=this.fieldsIndex.get(i);return P(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,a));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let r=0;r<a;r++){const a=t[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,i,s=!0){const a=new l(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:n,timeZone:o}=t;return r?a.getExpressionValues(i,r,{viewingMode:"map",scale:n,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,r=t.max??0,n=s.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=r){const e=q(s,t);e>-1&&(n[e].count++,n[e].items.push(l))}}return n}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:a}=t,r=[],n=[{name:s??i,alias:s??i,type:a??"esriFieldTypeString"},{name:O,alias:O,type:"esriFieldTypeInteger"}],o=new l(e,this.featureAdapter,this.fieldsIndex),u=new Map,c=[...this.items];this._sortFeatures(c,[i],(e,t,i)=>o.getFieldValue(e,t,i));const m=this._getAttributeValues(o,i,c,u),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const l in d){const{items:t}=d[l],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[s??i]:l}}))),a.fields)for(const e of a.fields)n.some(t=>t.name===e.name)||n.push(e)}return{fields:n,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(I.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(V.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:a,numBins:r,normalizationType:n,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),m=Z(c,{field:s,normalizationField:a,normalizationType:n,normalizationTotal:o,numBins:r,minValue:h(l,!1),maxValue:h(u,!1)}),d=this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n,snapToData:o,returnFullIntervalBin:l}=e,u=a.unit,c=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),m=F(this.fieldsIndex.get(s)),d=S.toJSON(u),f=c.filter(Boolean).sort((e,t)=>e-t),p=null!=r?h(r,m):f[0],y=null!=n?h(n,m):f[f.length-1],g={zone:t.outTimeReference?.ianaTimeZone??G},x=C.fromMillis(p,g),T=C.fromMillis(y,g),I=[];if("last"===o){let e=T;for(;e>x;){const t=e.minus({[d]:a.value});if(t<x){I.unshift([l?t.toMillis():x.toMillis(),e.toMillis()]);break}I.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?x:x.startOf(d);for(;e<=T;){const t=e.plus({[d]:a.value});if(t>T){I.push([e.toMillis(),l?t.toMillis():T.toMillis()]);break}I.push([e.toMillis(),t.toMillis()]),e=t}}const _=this._calculateHistogramBins(c,{intervals:I,min:p,max:y},i);return this._createFeaturesFromHistogramBins(_,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=F(this.fieldsIndex.get(s)),n=e.boundaries.map(e=>h(e,r)).sort((e,t)=>e-t),o=[];for(let c=0;c<n.length-1;c++)o.push([n[c],n[c+1]]);const l={intervals:o,min:n.at(0),max:n.at(-1)},u=this._calculateHistogramBins(a,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=F(this.fieldsIndex.get(s)),u=Z(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:h(r,l),maxValue:h(n,l)},!0),c=this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(c,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",r=i||"upperBoundary",n=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:O,alias:O,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const h of e){const{minValue:e,maxValue:i,items:s}=h,f={attributes:{}};let p;if(f.attributes[a]=m&&d&&null!=e?C.fromMillis(e,{zone:d}).toISO():e,f.attributes[r]=m&&d&&null!=i?C.fromMillis(i,{zone:d}).toISO():i,l?(p=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),f.attributes[O]=++c,"flat"===t.bin.jsonStyle?n.push(...p.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=p.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),n.push(f))):(t.bin?.splitBy&&(f.attributes[O]=++c),p=await this._createStatisticsQueryResponse(t,s,f),n.push(f)),p.fields)for(const t of p.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function H(e,t,i,s){const a=s.x-i.x,r=s.y-i.y,n=t.x-i.x,o=t.y-i.y,l=a*a+r*r;if(0===l)return!1;const u=n*a+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+r*c,!0}function Q(e,t){return e?t?4:3:t?3:2}class U{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const J=[1];export{E as QueryEngineResult};
5
+ import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as i}from"../../../geometry/support/centroid.js";import{getPolygonExtent as s,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as m}from"./geometryUtils.js";import{project as d}from"./projectionSupport.js";import{getDateInNumber as h}from"./queryUtils.js";import{makeEdgeCandidate as f,makeVertexCandidate as p}from"./SnappingCandidate.js";import{isDateField as y,isDateOnlyField as g,isTimestampOffsetField as x,isStringField as T,isTimeOnlyField as F}from"../../support/fieldUtils.js";import I from"../../../rest/support/AutoIntervalBinParameters.js";import _ from"../../../rest/support/DateBinParameters.js";import{unitsDict as S}from"../../../rest/support/DateBinUtils.js";import V from"../../../rest/support/FixedBoundariesBinParameters.js";import b from"../../../rest/support/FixedIntervalBinParameters.js";import{calculateStringStatistics as v,calculateStatistics as R,processSummaryStatisticsResult as B,calculateUniqueValuesCount as z,createUVResult as M,calculateClassBreaks as A,resolveCBResult as N,calculateHistogram as D,getAttributeComparator as w,calculatePercentile as P,binIndex as q,getBinParams as Z,isNullCountSupported as j}from"../../../statistics/utils.js";import{utc as G}from"../../../time/constants.js";import{DateTime as C}from"luxon";const O="bin";class E{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new l(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!n.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}n.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:s,items:a}=u[t],r=s.join(",");i&&!e.validateItems(a,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...d(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=Q(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),h=new U(null,0),y=new U(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?J:t.lengths;if(h.coords=i,y.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=h;n.coordsIndex=e;const p=y;p.coordsIndex=t===i-1?m:e+a;const T=g;if(!H(g,r,n,p))continue;const F=(r.x-T.x)/o,I=(r.y-T.y)/l,_=F*F+I*I;_<=1&&u.candidates.push(f(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(p)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,f=y;f.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=h;if(a.coordsIndex=e,c&&t===i-1&&a.x===f.x&&a.y===f.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,y=n*n+m*m;y<=1&&u.candidates.push(p(s.getObjectId(x),d(a),Math.sqrt(y)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=h;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(p(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort((e,t)=>e.distance-t.distance),u}_getPointCreator(e,t,i,s){const a=null==s||o(i,s)?e=>e:e=>d(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=y(m)||g(m)||x(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),f=j({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),p={value:.5,fieldType:m?.type},F=T(m)?v({values:h,supportsNullCount:f,percentileParams:p,outStatisticTypes:c}):R({values:h,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:p,outStatisticTypes:c});return B(F,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},this.items,!1),l=z(o);return M(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),f=A(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return N(f,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return D(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=w(r?.type,n);e.sort((e,t)=>{const s=i(e,a,r),n=i(t,a,r);return o(s,n)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:f,returnM:p}=e,y=null!=d&&t.length>(h||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&p,hasZ:a&&f,objectIdFieldName:n,spatialReference:u(c||o),transform:m&&r(m)||null}}_createFeatures(e,t){const i=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:d,maxAllowableOffset:h,resultOffset:f,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,n,(e,t,s)=>i.getFieldValue(e,t,s)),this.geometryType&&(u||d)){const e=r(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(u&&!d)for(const s of _){const a=this.featureAdapter.getGeometry(s),r=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),geometry:c(this.geometryType,this.hasZ,this.hasM,a,h,e,x,T)});t&&a&&!r.geometry&&(r.centroid=m(this,this.featureAdapter.getCentroid(s,this),e)),F[I++]=r}else if(!u&&d)for(const s of _)F[I++]=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e)});else for(const s of _)F[I++]=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,T)})}else for(const r of _){const e=i.getAttributes(r);e&&(F[I++]=this._addFeatureJSONMetadata(r,{attributes:e}))}const S=f||0;if(null!=p){const e=S+p;F=F.slice(S,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=Q(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)},0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,r=new Map,n=new Map,o=new Map,u=new l(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:f}=e,p=m?.length,y=!!p,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const l of c??[]){const{outStatisticFieldName:e,statisticType:c}=l,h=l,f="exceedslimit"!==c?l.onStatisticField:void 0,F="percentile_disc"===c||"percentile_cont"===c,I="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===p&&(f===g||x)&&"count"===c;if(y){if(!n.has(f)){const e=[];for(const i of m){const s=this._getAttributeValues(u,i,t,a);e.push(s)}n.set(f,this._calculateUniqueValues(e,t,!I&&u.returnDistinctValues))}const i=n.get(f);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:l,itemPositions:c}=i[r],p=n.join(",");if(!d||u.validateItems(l,d)){const i=o.get(p)||{attributes:{}};if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,l);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(u,f,t,a),i=c.map(t=>e[t]);r=F&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,u.returnDistinctValues)}i.attributes[e]=r}let r=0;m.forEach((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=n[t]),o.set(p,i)}}}else if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(u,f,t,a);i.attributes[e]=F&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,u.returnDistinctValues)}const S="min"!==c&&"max"!==c||!T(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:e,alias:e,type:S||"esriFieldTypeDouble"})}const F=y?Array.from(o.values()):[i];return this._sortFeatures(F,h,(e,t)=>e.attributes[t]),f&&(F.length=Math.min(f,F.length)),{fields:s,features:F}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return y(t)||g(t)||x(t)||F(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:m,spatialReference:d,geometryType:h,hasZ:f,hasM:p}=this,y=r.map(e=>c(h,f,p,m.getGeometry(e))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?s(g):a(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?t(g):i(a(o(d,y)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=g,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:r}=e;let n=null;n=i?.has(a)?i.get(a):T(this.fieldsIndex.get(a))||this._isAnyDateField(a)?v({values:t,returnDistinct:s}):R({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:r,orderBy:n}=s,o=this.fieldsIndex.get(i);return P(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,a));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let r=0;r<a;r++){const a=t[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,i,s=!0){const a=new l(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:n,timeZone:o}=t;return r?a.getExpressionValues(i,r,{viewingMode:"map",scale:n,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,r=t.max??0,n=s.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=r){const e=q(s,t);e>-1&&(n[e].count++,n[e].items.push(l))}}return n}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:a}=t,r=[],n=[{name:s??i,alias:s??i,type:a??"esriFieldTypeString"},{name:O,alias:O,type:"esriFieldTypeInteger"}],o=new l(e,this.featureAdapter,this.fieldsIndex),u=new Map,c=[...this.items];this._sortFeatures(c,[i],(e,t,i)=>o.getFieldValue(e,t,i));const m=this._getAttributeValues(o,i,c,u),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const l in d){const{items:t}=d[l],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[s??i]:l}}))),a.fields)for(const e of a.fields)n.some(t=>t.name===e.name)||n.push(e)}return{fields:n,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(I.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(V.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:a,numBins:r,normalizationType:n,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),m=Z(c,{field:s,normalizationField:a,normalizationType:n,normalizationTotal:o,numBins:r,minValue:h(l,!1),maxValue:h(u,!1)}),d=this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n,snapToData:o,returnFullIntervalBin:l}=e,u=a.unit,c=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),m=F(this.fieldsIndex.get(s)),d=S.toJSON(u),f=c.filter(Boolean).sort((e,t)=>e-t),p=null!=r?h(r,m):f[0],y=null!=n?h(n,m):f[f.length-1],g=[];if(null!=p&&null!=y){const e={zone:t.outTimeReference?.ianaTimeZone??G},i=C.fromMillis(p,e),s=C.fromMillis(y,e);if("last"===o){let e=s;for(;e>i;){const t=e.minus({[d]:a.value});if(t<i){g.unshift([l?t.toMillis():i.toMillis(),e.toMillis()]);break}g.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?i:i.startOf(d);for(;e<=s;){const t=e.plus({[d]:a.value});if(t>s){g.push([e.toMillis(),l?t.toMillis():s.toMillis()]);break}g.push([e.toMillis(),t.toMillis()]),e=t}}}const x=this._calculateHistogramBins(c,{intervals:g,min:p,max:y},i);return this._createFeaturesFromHistogramBins(x,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=F(this.fieldsIndex.get(s)),n=e.boundaries.map(e=>h(e,r)).sort((e,t)=>e-t),o=[];for(let c=0;c<n.length-1;c++)o.push([n[c],n[c+1]]);const l={intervals:o,min:n.at(0),max:n.at(-1)},u=this._calculateHistogramBins(a,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=F(this.fieldsIndex.get(s)),u=Z(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:h(r,l),maxValue:h(n,l)},!0),c=this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(c,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",r=i||"upperBoundary",n=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:O,alias:O,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const h of e){const{minValue:e,maxValue:i,items:s}=h,f={attributes:{}};let p;if(f.attributes[a]=m&&d&&null!=e?C.fromMillis(e,{zone:d}).toISO():e,f.attributes[r]=m&&d&&null!=i?C.fromMillis(i,{zone:d}).toISO():i,l?(p=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),f.attributes[O]=++c,"flat"===t.bin.jsonStyle?n.push(...p.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=p.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),n.push(f))):(t.bin?.splitBy&&(f.attributes[O]=++c),p=await this._createStatisticsQueryResponse(t,s,f),n.push(f)),p.fields)for(const t of p.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function H(e,t,i,s){const a=s.x-i.x,r=s.y-i.y,n=t.x-i.x,o=t.y-i.y,l=a*a+r*r;if(0===l)return!1;const u=n*a+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+r*c,!0}function Q(e,t){return e?t?4:3:t?3:2}class U{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const J=[1];export{E as QueryEngineResult};
@@ -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 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};
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 q,readGeoMetadata as C}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,E=8e3,P="__OBJECTID";class B{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 q(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:P,type:"oid",alias:P}));const h={fields:y.map(e=>({...e.toJSON(),column:m.columnForFieldName(e.name)})),timeZoneByFieldName:null},I=w.fromJSON(h);this._fieldsIndex=I;const C=F(c.geometryType??"point");if(this._metadata=j.createFeature({fieldsIndex:h,geometryType:C,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(C),extent:this._fullExtent??void 0,geometryType:C,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 q(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),!T(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),!T(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&&!T(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/E);for(let i=0;i<o;i++){const r=i*E,o=await s.file.readChunk(r,E,e.fields,e.returnGeometry,t);for(const e of o){const t=new Q(this._metadata,this._fieldsIndex,e,0,s.index),r=D([new v(t,null,0,!1)],this._queryEngineParams);yield r}}}}_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=D((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)),this._queryEngineParams),i=await o.executeQueryForOpaqueFeatures(e,t);for(const e of i)r.push(e);return new h(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.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._queryEngineParams.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._queryEngineParams.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 T(e){return Object.keys(e).some(e=>G(e))}function G(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 D(e,t){const s=new O(null);for(const r of e)s.insert(r);return new y({...t,featureStore:s})}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=C(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{B 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{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};
5
+ import e from"../../Color.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{queryBinsCapabilities as s,queryCapabilities as o}from"../graphics/data/QueryEngineCapabilities.js";import{systemOidFieldName as a}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 o=new Map;for(const r of t)o.set(r,f(e,r));const a=await p(e.dataManager.knowledgeGraph,Array.from(o.values()),{requestOptions:{signal:s?.signal}});for(const r of[...e.layers,...e.tables]){const t=r.objectType.name;if(null==t)continue;const s=a.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 o of e)if(o.name){if("name"===o.name.toLowerCase()){t=o.name;break}o.name.toLowerCase().includes("name")?(t=o.name,s=2):"esriFieldTypeString"===o.fieldType&&s>3&&(t=o.name,s=3)}return t}function S(e,t,s){const o={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},a=new r({labelExpressionInfo:new n({expression:"ESRI__ID"===s?`${t}`:`$feature.${s}`}),labelPlacement:"above-center",symbol:new y(o)}),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({...o,yoffset:"12px"})});return"entity"===e?[a]:[p]}function A(e,t,s){const o={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},a="ESRI__ID"===s?`${e}`:`$feature.${s}`;return"point"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"above-center",symbol:new y(o)})]:"polyline"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"center-along",repeatLabel:!0,symbol:new y(o)})]:"polygon"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"always-horizontal",symbol:new y(o)})]:null}const M={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function L(e){const{capabilities:t,allowGeometryUpdates:a,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:o,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&a,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 o=new l,r=s.graphTypeName,n=s.graphType,p=e=>{const t={...e};for(const o of s.fields)o.editable||delete t[o.name];for(const s of Object.keys(e))s.includes("ESRI__")&&delete t[s];return t};for(const t of e.addFeatures??[]){const e=p(t.attributes);t.sourceLayer.graphTypeName===r&&("entity"===n?(o.entityAdds||(o.entityAdds=[]),o.entityAdds.push(new i({properties:e,typeName:r}))):(o.relationshipAdds||(o.relationshipAdds=[]),o.relationshipAdds.push(new u({properties:e,typeName:r}))))}for(const t of e.updateFeatures??[]){const e=t.attributes[a],s=p(t.attributes);t.sourceLayer.graphTypeName===r&&("entity"===n?(o.entityUpdates||(o.entityUpdates=[]),o.entityUpdates.push(new i({id:e,properties:s,typeName:r}))):(o.relationshipUpdates||(o.relationshipUpdates=[]),o.relationshipUpdates.push(new u({id:e,properties:s,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[a])}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?(o.entityDeletes||(o.entityDeletes=[]),o.entityDeletes.push({typeName:t.typeName,ids:t.ids})):(o.relationshipDeletes||(o.relationshipDeletes=[]),o.relationshipDeletes.push({typeName:t.typeName,ids:t.ids})));return o}function j(e,t){const s={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const o of e.editResults)if(o.typeName===t){for(const e of o.adds)s.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.updates)s.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.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};
@@ -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"./Field.js";const n="Raster.",a="Raster.Dim.",i=".Max",t={servicePixelValue:"Raster.ServicePixelValue",rawServicePixelValue:"Raster.ServicePixelValue.Raw",itemPixelValue:"Raster.ItemPixelValue",magnitude:"Raster.Magnitude",direction:"Raster.Direction",variable:"Raster.Variable"},r=new Map([["quarters","Quarter"],["months","Month"],["weeks","Week of the year"],["days","Day of the year"]]);function l(n,a){return new e({name:n,alias:a,domain:null,editable:!1,length:50,type:"string"})}function s(n,a){return new e({name:n,alias:a,domain:null,editable:!1,type:"double"})}function u(n,a){return new e({name:n,alias:a,domain:null,editable:!1,type:"date"})}function o(e){return l(t.servicePixelValue,e??"Service Pixel Value")}function c(e){return l(t.rawServicePixelValue,e??"Raw Service Pixel Value")}function m(){return l(t.itemPixelValue,"Item Pixel Value")}function f(e){return l(`${t.servicePixelValue}.${e}`,e)}function d(e){return s(`${t.magnitude}`,"Magnitude"+(e?` (${e})`:""))}function $(){return s(`${t.direction}`,"Direction (°)")}function v(e){return e.fields.filter(e=>"oid"!==e.type&&"value"!==e.name.toLowerCase()).map(e=>{const a=e.clone();return a.name=`${n}${e.name}`,a})}function p(e){const n=new Set,r=new Set,o=new Map;e.variables.forEach(({dimensions:e})=>{e.forEach(e=>{if(e.recurring)o.set(e.name,e.unit);else{const a="ISO8601"===e.unit?.trim()?n:r;a.add(e.name),e.hasRanges&&a.add(`${e.name}${i}`)}})});return[l(t.variable,"Variable"),...[...n].map(e=>u(`${a}${e}`,x(e))),...[...r].map(e=>s(`${a}${e}`,x(e))),...[...o].map(([e,n])=>s(`${a}${e}`,h(e,n)))]}function h(e,n){return n=n?.toLowerCase(),n&&r.has(n)?r.get(n):x(e)}function x(e){const n=e.endsWith(i),a=n?e.slice(0,-4):e,t="StdTime"===a?"Standard Time":"StdZ"===a?"Standard Z":a;return n?`${t} Max`:t}function w(e,n){return n?new Date(e):e}function V(e,n,r){r?.length&&(n[t.variable]=r[0].variableName,r.forEach(({dimensionName:t,values:r})=>{if(t&&r?.length){const l=`${a}${t}`,s=e.find(({name:e})=>e===l);if(!s)return;const u="date"===s.type,o=r[0];if(Array.isArray(o)){if(n[`${a}${t}`]=w(o[0],u),null!=o[1]){const r=`${a}${t}${i}`;if(e.some(({name:e})=>e===r)){const e=w(o[1],u);n[r]=e}}}else n[`${a}${t}`]=w(o,u)}}))}function b(e,n){if(n.pixelType.startsWith("f")&&e.forEach(({format:e,fieldName:n})=>{e&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(e.places=2)}),n.multidimensionalInfo){const t=n.multidimensionalInfo.variables.flatMap(({dimensions:e})=>e);e.forEach(({format:e,fieldName:n})=>{if(e&&n?.startsWith(a)){const r=n.slice(a.length),l=`${r}${i}`,s=t.find(({name:e})=>e===r||e===l);s?.values?.every(e=>Number.isInteger(e))&&(e.places=0)}})}}export{V as addMultidimensionalFieldValues,t as commonRasterFieldNames,$ as getDirectionField,m as getItemPixelValueField,d as getMagnitudeField,p as getMultidimensionalFields,f as getProcessedServicePixelValueField,v as getRasterAttributeTableFields,c as getRawServicePixelValueField,o as getServicePixelValueField,a as rasterDimensionFieldPrefix,n as rasterFieldPrefix,b as setDefaultRasterFieldFormats};
5
+ import e from"./Field.js";const a="Raster.",n="Raster.Dim.",t=".Max",i={servicePixelValue:"Raster.ServicePixelValue",rawServicePixelValue:"Raster.ServicePixelValue.Raw",itemPixelValue:"Raster.ItemPixelValue",magnitude:"Raster.Magnitude",direction:"Raster.Direction",variable:"Raster.Variable"},r=new Map([["quarters","Quarter"],["months","Month"],["weeks","Week of the year"],["days","Day of the year"]]);function l(a,n){return new e({name:a,alias:n,domain:null,editable:!1,length:50,type:"string"})}function s(a,n){return new e({name:a,alias:n,domain:null,editable:!1,type:"double"})}function u(a,n){return new e({name:a,alias:n,domain:null,editable:!1,type:"date"})}function o(e){return l(i.servicePixelValue,e??"Service Pixel Value")}function c(e){return l(i.rawServicePixelValue,e??"Raw Service Pixel Value")}function m(){return l(i.itemPixelValue,"Item Pixel Value")}function f(e){return l(`${i.servicePixelValue}.${e}`,e)}function d(e){return s(`${i.magnitude}`,"Magnitude"+(e?` (${e})`:""))}function $(){return s(`${i.direction}`,"Direction (°)")}function v(e){return e.fields.filter(e=>"oid"!==e.type&&"value"!==e.name.toLowerCase()).map(e=>{const n=e.clone();return n.name=`${a}${e.name}`,n})}function p(e){const a=new Set,r=new Set,o=new Map;e.variables.forEach(({dimensions:e})=>{e.forEach(e=>{if(e.recurring)o.set(e.name,e.unit);else{const n="ISO8601"===e.unit?.trim()||"stdtime"===e.name?.trim()?.toLowerCase()?a:r;n.add(e.name),e.hasRanges&&n.add(`${e.name}${t}`)}})});return[l(i.variable,"Variable"),...[...a].map(e=>u(`${n}${e}`,x(e))),...[...r].map(e=>s(`${n}${e}`,x(e))),...[...o].map(([e,a])=>s(`${n}${e}`,h(e,a)))]}function h(e,a){return a=a?.toLowerCase(),a&&r.has(a)?r.get(a):x(e)}function x(e){const a=e.endsWith(t),n=a?e.slice(0,-4):e,i="StdTime"===n?"Standard Time":"StdZ"===n?"Standard Z":n;return a?`${i} Max`:i}function w(e,a){return a?new Date(e):e}function V(e,a,r){r?.length&&(a[i.variable]=r[0].variableName,r.forEach(({dimensionName:i,values:r})=>{if(i&&r?.length){const l=`${n}${i}`,s=e.find(({name:e})=>e===l);if(!s)return;const u="date"===s.type,o=r[0];if(Array.isArray(o)){if(a[`${n}${i}`]=w(o[0],u),null!=o[1]){const r=`${n}${i}${t}`;if(e.some(({name:e})=>e===r)){const e=w(o[1],u);a[r]=e}}}else a[`${n}${i}`]=w(o,u)}}))}function b(e,a){if(a.pixelType.startsWith("f")&&e.forEach(({format:e,fieldName:a})=>{e&&a&&/^raster\.(item|service)pixelvalue/i.test(a)&&(e.places=2)}),a.multidimensionalInfo){const i=a.multidimensionalInfo.variables.flatMap(({dimensions:e})=>e);e.forEach(({format:e,fieldName:a})=>{if(e&&a?.startsWith(n)){const r=a.slice(n.length),l=`${r}${t}`,s=i.find(({name:e})=>e===r||e===l);s?.values?.every(e=>Number.isInteger(e))&&(e.places=0)}})}}export{V as addMultidimensionalFieldValues,i as commonRasterFieldNames,$ as getDirectionField,m as getItemPixelValueField,d as getMagnitudeField,p as getMultidimensionalFields,f as getProcessedServicePixelValueField,v as getRasterAttributeTableFields,c as getRawServicePixelValueField,o as getServicePixelValueField,n as rasterDimensionFieldPrefix,a as rasterFieldPrefix,b as setDefaultRasterFieldFormats};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.100",
3
+ "version": "4.34.0-next.102",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -21,7 +21,7 @@
21
21
  "@amcharts/amcharts5": "~5.14.1",
22
22
  "@arcgis/toolkit": "^4.34.0-next.151",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
- "@esri/calcite-components": "^3.3.0",
24
+ "@esri/calcite-components": "^3.3.1",
25
25
  "@vaadin/grid": "~24.9.1",
26
26
  "@zip.js/zip.js": "~2.8.3",
27
27
  "luxon": "~3.7.2",
@@ -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{formatDate as t,convertDateFormatToIntlOptions as e,formatTimestamp as n,formatTimeOnly as o,formatDateOnly as r}from"../../intl/date.js";import{isDateField as i,isDateOnlyField as s,isTimestampOffsetField as a}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as l}from"../../support/basemapUtils.js";import{loadArcade as u}from"../../support/loadArcade.js";import{utc as d}from"../../time/constants.js";import{getTimeZoneFormattingOptions as m}from"../../time/timeZoneUtils.js";const f=",",c={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},p="percent-of-total",g="field",y={exclude:["median"]},h={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},v=new Set(["integer","small-integer"]);let T=null;const Z=["date","date-only","timestamp-offset"];function $(t){return i(t)||s(t)||a(t)}async function U(t){const{field:e,field2:n,field3:o,normalizationField:r,valueExpression:i,fields:s}=t;let a=[];if(i){if(!T){const{arcadeUtils:t}=await u();T=t}a=T.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),o&&a.push(o),r&&a.push(r),s&&a.push(...s),a}function w(t){let e=t.normalizationType;return e||(t.normalizationField?e=g:null!=t.normalizationTotal&&(e=p)),e??void 0}function S(t){return String(t).padStart(2,"0")}function k(t,e,n){let o;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));o=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${S((n?t.getMonth():t.getUTCMonth())+1)}-${S(n?t.getDate():t.getUTCDate())} ${S(n?t.getHours():t.getUTCHours())}:${S(n?t.getMinutes():t.getUTCMinutes())}:${S(n?t.getSeconds():t.getUTCSeconds())}'`}else o=t;return o}function C(t,e,n,o){const{hasQueryEngine:r}=t,i=`(${k(n,D(t,n),r)} - ${k(e,D(t,e),r)})`;let s=h[o],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function D(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(i(n))return"field"}}function F(t,e=c){for(const n in e)if(e[n].includes(t))return n}function b(t,e,n=!0){let o=null;return t&&("string"==typeof t?e.includes(t)&&(o=t):o=l(t)),n?o||"gray":o}function j(t,e){const n=e&&t.getField(e);return!!n&&v.has(n.type)}function M(t){return`cast(${t} as float)`}function N(i,s){const{format:a,timeZoneOptions:l,fieldType:u}=s??{};let f,c;if(l&&({timeZone:f,timeZoneName:c}=m(l.layerTimeZone,l.datesInUnknownTimezone,l.viewTimeZone,e(a||"short-date-short-time"),u)),"string"==typeof i&&isNaN(Date.parse("time-only"===u?`1970-01-01T${i}Z`:i)))return i;switch(u){case"date-only":{const n=e(a||"short-date");return"string"==typeof i?r(i,{...n}):t(i,{...n,timeZone:d})}case"time-only":{const n=e(a||"short-time");return"string"==typeof i?o(i,n):t(i,{...n,timeZone:d})}case"timestamp-offset":{if(!f&&"string"==typeof i&&new Date(i).toISOString()!==i)return i;const o=a||l?e(a||"short-date-short-time"):void 0,r=o?{...o,timeZone:f,timeZoneName:c}:void 0;return"string"==typeof i?n(i,r):t(i,r)}default:{const n=a||l?e(a||"short-date-short-time"):void 0;return t("string"==typeof i?new Date(i):i,n?{...n,timeZone:f,timeZoneName:c}:void 0)}}}export{M as castIntegerFieldToFloat,Z as dateTypes,c as defaultBasemapGroups,y as defaultStatisticTypes,f as fieldDelimiter,N as formatAnyDate,F as getBasemapGroup,b as getBasemapId,C as getDateDiffSQL,D as getDateType,U as getFieldsList,w as getNormalizationType,$ as isAnyDateField,j as isIntegerField,h as unitValueInDays};
5
+ import{convertDateTimeFieldFormatToIntlOptions as t,formatDate as e,convertDateFormatToIntlOptions as n,formatTimestamp as o,formatTimeOnly as r,formatDateOnly as i}from"../../intl/date.js";import{isDateField as s,isDateOnlyField as a,isTimestampOffsetField as l}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{loadArcade as d}from"../../support/loadArcade.js";import{utc as m}from"../../time/constants.js";import{getTimeZoneFormattingOptions as f}from"../../time/timeZoneUtils.js";const c=",",p={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},g="percent-of-total",y="field",h={exclude:["median"]},v={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},T=new Set(["integer","small-integer"]);let Z=null;const $=["date","date-only","timestamp-offset"];function U(t){return s(t)||a(t)||l(t)}async function w(t){const{field:e,field2:n,field3:o,normalizationField:r,valueExpression:i,fields:s}=t;let a=[];if(i){if(!Z){const{arcadeUtils:t}=await d();Z=t}a=Z.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),o&&a.push(o),r&&a.push(r),s&&a.push(...s),a}function F(t){let e=t.normalizationType;return e||(t.normalizationField?e=y:null!=t.normalizationTotal&&(e=g)),e??void 0}function S(t){return String(t).padStart(2,"0")}function k(t,e,n){let o;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));o=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${S((n?t.getMonth():t.getUTCMonth())+1)}-${S(n?t.getDate():t.getUTCDate())} ${S(n?t.getHours():t.getUTCHours())}:${S(n?t.getMinutes():t.getUTCMinutes())}:${S(n?t.getSeconds():t.getUTCSeconds())}'`}else o=t;return o}function C(t,e,n,o){const{hasQueryEngine:r}=t,i=`(${k(n,D(t,n),r)} - ${k(e,D(t,e),r)})`;let s=v[o],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function D(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(s(n))return"field"}}function b(t,e=p){for(const n in e)if(e[n].includes(t))return n}function j(t,e,n=!0){let o=null;return t&&("string"==typeof t?e.includes(t)&&(o=t):o=u(t)),n?o||"gray":o}function M(t,e){const n=e&&t.getField(e);return!!n&&T.has(n.type)}function N(t){return`cast(${t} as float)`}function x(s,a){const{format:l,fieldFormat:u,timeZoneOptions:d,fieldType:c}=a??{},p=u?t(u):null;let g,y;if(d&&({timeZone:g,timeZoneName:y}=f(d.layerTimeZone,d.datesInUnknownTimezone,d.viewTimeZone,p||n(l||"short-date-short-time"),c)),"string"==typeof s&&isNaN(Date.parse("time-only"===c?`1970-01-01T${s}Z`:s)))return s;switch(c){case"date-only":{const t=p||n(l||"short-date");return"string"==typeof s?i(s,{...t}):e(s,{...t,timeZone:m})}case"time-only":{const t=p||n(l||"short-time");return"string"==typeof s?r(s,t):e(s,{...t,timeZone:m})}case"timestamp-offset":{if(!g&&"string"==typeof s&&new Date(s).toISOString()!==s)return s;const t=l||p||d?p||n(l||"short-date-short-time"):void 0,r=t?{...t,timeZone:g,timeZoneName:y}:void 0;return"string"==typeof s?o(s,r):e(s,r)}default:{const t=l||p||d?p||n(l||"short-date-short-time"):void 0;return e("string"==typeof s?new Date(s):s,t?{...t,timeZone:g,timeZoneName:y}:void 0)}}}export{N as castIntegerFieldToFloat,$ as dateTypes,p as defaultBasemapGroups,h as defaultStatisticTypes,c as fieldDelimiter,x as formatAnyDate,b as getBasemapGroup,j as getBasemapId,C as getDateDiffSQL,D as getDateType,w as getFieldsList,F as getNormalizationType,U as isAnyDateField,M as isIntegerField,v as unitValueInDays};