@arcgis/core 4.33.0-next.20250305 → 4.33.0-next.20250307
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/aiServices.js +5 -0
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/028e2e0fa6971aaaaae8.js +1 -0
- package/assets/esri/core/workers/chunks/0576b035c1654a43ad5c.js +1 -0
- package/assets/esri/core/workers/chunks/081699532b183db1e7c2.js +1 -0
- package/assets/esri/core/workers/chunks/087a09b4c41abef6b516.js +1 -0
- package/assets/esri/core/workers/chunks/{7ec2f531217718e76469.js → 0b4e63e705db09dbe171.js} +1 -1
- package/assets/esri/core/workers/chunks/0c9e933b392616460e62.js +1 -0
- package/assets/esri/core/workers/chunks/{c3d23c45db427a29d596.js → 0f4a2bdf5bb2f4303b7f.js} +1 -1
- package/assets/esri/core/workers/chunks/{f995a74bd9b58c069c07.js → 10631680abe7607616ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{567aa24d7e99e0b5a6cb.js → 1263391920fbb8926ced.js} +1 -1
- package/assets/esri/core/workers/chunks/186387a561364a11e574.js +1 -0
- package/assets/esri/core/workers/chunks/1cc7bbd0f4a8cf06050a.js +1 -0
- package/assets/esri/core/workers/chunks/1d0473dd43c88ab5776d.js +1 -0
- package/assets/esri/core/workers/chunks/{ef46613c3aa363dc1cfc.js → 285e573aa6f3acf70b32.js} +1 -1
- package/assets/esri/core/workers/chunks/2bb508701ad8ccc3d6ab.js +1 -0
- package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +1 -0
- package/assets/esri/core/workers/chunks/37a3533f004bf2e888da.js +1 -0
- package/assets/esri/core/workers/chunks/3be465c653236d6d8c1f.js +1 -0
- package/assets/esri/core/workers/chunks/3e4204502f6e09483c60.js +1 -0
- package/assets/esri/core/workers/chunks/3e9cd82325c473ddbf1f.js +1 -0
- package/assets/esri/core/workers/chunks/{370ab4b33fb7292bb3b8.js → 424e2058228e5f6a183d.js} +1 -1
- package/assets/esri/core/workers/chunks/4496ef270c700078df0c.js +1 -0
- package/assets/esri/core/workers/chunks/458f4c6c8820c1f62f69.js +1 -0
- package/assets/esri/core/workers/chunks/49c346d2fb8538990f45.js +1 -0
- package/assets/esri/core/workers/chunks/4bb65ef7b3a02ebe416e.js +1 -0
- package/assets/esri/core/workers/chunks/4c765464288b6d096d08.js +1 -0
- package/assets/esri/core/workers/chunks/4eb1a2433f675bde12ad.js +1 -0
- package/assets/esri/core/workers/chunks/4ffdff269aae8c293cb4.js +1 -0
- package/assets/esri/core/workers/chunks/55f7b1de8882569861c0.js +1 -0
- package/assets/esri/core/workers/chunks/564cc81c232c97646833.js +1 -0
- package/assets/esri/core/workers/chunks/5a6f7360183693f8490d.js +1 -0
- package/assets/esri/core/workers/chunks/5f8028928ae8e5d27dda.js +1 -0
- package/assets/esri/core/workers/chunks/{c03e6e35082beaec02a6.js → 5fa5bfc70512994f5ec1.js} +1 -1
- package/assets/esri/core/workers/chunks/605eddec7aac891ed141.js +1 -0
- package/assets/esri/core/workers/chunks/66cba22c09f595bba3bf.js +1 -0
- package/assets/esri/core/workers/chunks/6cb5ce0a6bb85c624a21.js +1 -0
- package/assets/esri/core/workers/chunks/{bf9b45604249520b596a.js → 74c01de62ccaed0666e0.js} +1 -1
- package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +1 -0
- package/assets/esri/core/workers/chunks/{b66e8a48ce7098ca43d5.js → 7c3cd6aefd16fcc1a7fd.js} +1 -1
- package/assets/esri/core/workers/chunks/7e0e9ca84490a0c67197.js +1 -0
- package/assets/esri/core/workers/chunks/{3315de71eb8791189c05.js → 835fa4484c58d9b31c78.js} +1 -1
- package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +1 -0
- package/assets/esri/core/workers/chunks/8d636075e5aa053940fc.js +1 -0
- package/assets/esri/core/workers/chunks/{7ca33e03a2fd217b9443.js → 9dfdd8e91897d166d888.js} +1 -1
- package/assets/esri/core/workers/chunks/{790f86ddf57be50e0dd5.js → 9ef509e0853ad41f7690.js} +1 -1
- package/assets/esri/core/workers/chunks/a2377969f76640f1d6fe.js +1 -0
- package/assets/esri/core/workers/chunks/aa3a45e8228216c1739b.js +1 -0
- package/assets/esri/core/workers/chunks/b2289c18c02c868a2939.js +1 -0
- package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +1 -0
- package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +1 -0
- package/assets/esri/core/workers/chunks/bdeac9196f28aff93e68.js +1 -0
- package/assets/esri/core/workers/chunks/c591527543fd75a917d4.js +1 -0
- package/assets/esri/core/workers/chunks/{ca4af35af02e3804042e.js → c6580fdcdc33153008b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe8ee1938d196a70d809.js → ca0572fe5614005acceb.js} +1 -1
- package/assets/esri/core/workers/chunks/{67c1e2c17ea3ca27248c.js → cbbbaccc0d3683e1c0fe.js} +1 -1
- package/assets/esri/core/workers/chunks/ccc6f6f7052985bebdab.js +1 -0
- package/assets/esri/core/workers/chunks/d72d993b36daf6ec2a10.js +1 -0
- package/assets/esri/core/workers/chunks/eb9d2bb8b44a93347274.js +1 -0
- package/assets/esri/core/workers/chunks/f809cbfb744adb4fad29.js +1 -0
- package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +1 -0
- package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +1 -0
- package/assets/esri/core/workers/chunks/fdc9bd8f309af610fa62.js +1 -0
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +2 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/LineMarker.glsl.js +2 -2
- package/chunks/aiServices.js +5 -0
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/copyright.txt +38 -0
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/interfaces.d.ts +11 -3
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/labelFormatUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/DictionaryControlString.js +5 -0
- package/renderers/support/DictionaryLoader.js +1 -1
- package/renderers/support/DictionaryScriptEvaluator.js +5 -0
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/TranslateContent.js +5 -0
- package/rest/support/TranslateParameters.js +5 -0
- package/rest/support/TranslateResult.js +5 -0
- package/rest/translate.js +5 -0
- package/rest/utils.js +1 -1
- package/smartMapping/statistics/support/attributeDensity.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/ArcadeExpression.js +5 -0
- package/support/loadArcade.js +5 -0
- package/support/revision.js +1 -1
- package/symbols/cim/OverrideHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/arcade/callExpressionWithFeature.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/util/DictionaryMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/ComputedAttributeStorage.js +1 -1
- package/views/2d/layers/features/support/ComputedExpression.js +1 -1
- package/views/2d/layers/features/support/DictionaryTemplate.js +5 -0
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
- package/views/3d/layers/graphics/queryForSymbologySnapping.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/dependencySort.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/0121702bc9a1f3a85f1f.js +0 -1
- package/assets/esri/core/workers/chunks/05b7c739115be0490583.js +0 -1
- package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +0 -1
- package/assets/esri/core/workers/chunks/1007c1a908b6e503e0db.js +0 -1
- package/assets/esri/core/workers/chunks/1439f1d84e21e6295e3f.js +0 -1
- package/assets/esri/core/workers/chunks/1912d25f8007685c7aee.js +0 -1
- package/assets/esri/core/workers/chunks/1bd58eaac6f4906bbdae.js +0 -1
- package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +0 -1
- package/assets/esri/core/workers/chunks/2e40f2527345ad85d800.js +0 -1
- package/assets/esri/core/workers/chunks/30f271bbc34f66cbfc23.js +0 -1
- package/assets/esri/core/workers/chunks/36b406131cd864567033.js +0 -1
- package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +0 -1
- package/assets/esri/core/workers/chunks/4c15de6b2b8eefd76b61.js +0 -1
- package/assets/esri/core/workers/chunks/4c596cb20baaae5166de.js +0 -1
- package/assets/esri/core/workers/chunks/4d16b1e50caad0da7838.js +0 -1
- package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +0 -1
- package/assets/esri/core/workers/chunks/5c86df2a5e16877ba614.js +0 -1
- package/assets/esri/core/workers/chunks/62c9171a58160ea099f8.js +0 -1
- package/assets/esri/core/workers/chunks/6a4731b47629604a9ca0.js +0 -1
- package/assets/esri/core/workers/chunks/81c507c0d901448835f4.js +0 -1
- package/assets/esri/core/workers/chunks/8278d9263e9b7e3bf2d1.js +0 -1
- package/assets/esri/core/workers/chunks/8926f672397620591740.js +0 -1
- package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +0 -1
- package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +0 -1
- package/assets/esri/core/workers/chunks/924176d9ab2e070248a8.js +0 -1
- package/assets/esri/core/workers/chunks/988efc508c33ca341e49.js +0 -1
- package/assets/esri/core/workers/chunks/98cbfc72430a378a9451.js +0 -1
- package/assets/esri/core/workers/chunks/9fde9309cb64f1a9301c.js +0 -1
- package/assets/esri/core/workers/chunks/a901c445d36f1a9e7df8.js +0 -1
- package/assets/esri/core/workers/chunks/ab525991f71240d68471.js +0 -1
- package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +0 -1
- package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +0 -1
- package/assets/esri/core/workers/chunks/c15c3fec95f365580902.js +0 -1
- package/assets/esri/core/workers/chunks/c1e343cdf85da40ac10e.js +0 -1
- package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +0 -1
- package/assets/esri/core/workers/chunks/c3dc8d1958ddc71e1129.js +0 -1
- package/assets/esri/core/workers/chunks/c7b0f58550e63ce6ad5b.js +0 -1
- package/assets/esri/core/workers/chunks/ccf8a423eee7ef4ffe4c.js +0 -1
- package/assets/esri/core/workers/chunks/d24321b1eeabe9ec553c.js +0 -1
- package/assets/esri/core/workers/chunks/dd913cb7cf3bb172b34c.js +0 -1
- package/assets/esri/core/workers/chunks/e3e049311bced533c853.js +0 -1
- package/assets/esri/core/workers/chunks/e3e5a215dcd531b1196f.js +0 -1
- package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +0 -1
- package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +0 -1
- package/support/arcadeOnDemand.js +0 -5
- package/views/3d/layers/support/projectExtentUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as o}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as d,equals as u,isWGS84 as p,isWebMercator as c}from"../../geometry/support/spatialReferenceUtils.js";import{isEditBusLayer as h,emitApplyEditsEvent as m}from"../mixins/EditBusLayer.js";import{isValidFieldValue as f}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as y}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as g,getEffectiveLayerCapabilities as b}from"../support/layerUtils.js";function w(e){return null!=e?.applyEdits}function F(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function A(e){return e.every(F)}function v(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function I(e){return e.every(v)}async function $(e,t,a,s={}){let n;const o="gdbVersion"in e?e.gdbVersion:null,l=s.gdbVersion??o;if(h(e)&&e.url)n=m(e.url,e.layerId,l,"original-and-current-features"===s.returnServiceEditsOption);else{n=i(),n.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:n.promise};e.emit("apply-edits",t)}try{const{results:i,edits:o}=await E(e,t,a,s),l=e=>e.filter((e=>!e.error)).map(r),d={edits:o,addedFeatures:l(i.addFeatureResults),updatedFeatures:l(i.updateFeatureResults),deletedFeatures:l(i.deleteFeatureResults),addedAttachments:l(i.addAttachmentResults),updatedAttachments:l(i.updateAttachmentResults),deletedAttachments:l(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return i.editedFeatureResults?.length&&(d.editedFeatures=i.editedFeatureResults),n.resolve(d),i}catch(d){throw n.reject(d),d}}async function E(e,t,r,s){if(await e.load(),!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!g(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:n}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,n)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const i=b(e),n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(V(t,i,r,!!n,!!o,`${e.type}-layer`),!i.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const d={...r};if(null!=d.rollbackOnFailureEnabled||i.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),d.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=G(t,i,`${e.type}-layer`),p=r?.globalIdUsed||l,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>B(e,t)))}u.addFeatures.forEach((t=>O(t,e,p,c))),u.updateFeatures.forEach((t=>k(t,e,p,c))),u.deleteFeatures.forEach((t=>U(t,e,p,c))),u.addAttachments.forEach((t=>L(t,e))),u.updateAttachments.forEach((t=>L(t,e))),l&&await x(u,e);return{edits:await T(u),options:d}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!f(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function j(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,n=t.spatialReference,o="local"===i.type,l=d(n),h=u(n,s),m=h||p(n)&&(p(s)||c(s));if(!(o&&l&&m||!o&&!l&&h))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${n.wkid} is not supported.`)}}function O(e,t,a,r){R(e,t,a,r),j(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),j(e,t);const i=b(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function B(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=o())}async function T(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await l(r),i=t.length,n=a.length;return s.slice(0,i).forEach(((e,a)=>t[a].geometry=e)),s.slice(i,i+n).forEach(((e,t)=>a[t].geometry=e)),e}function D(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function G(e,t,r){const s=D(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(M),s.updateFeatures=s.updateFeatures.map(M),s.addAssetFeatures=[],s}function V(e,t,r,s,i,n){if(!e||!s&&!i)throw new a(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new a(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function M(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!y(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function q(e,t,r,s){if(!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,V as checkEditingCapabilities,I as isFeatureIdentifierArrayWithGlobalId,A as isFeatureIdentifierArrayWithObjectId,v as isFeatureIdentifierWithGlobalId,F as isFeatureIdentifierWithObjectId,D as normalizeCollections,G as normalizeEdits,T as normalizeGeometries,M as shallowCloneFeature,q as uploadAssets};
|
|
5
|
+
import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as o}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as d,equals as u,isWGS84 as p,isWebMercator as c}from"../../geometry/support/spatialReferenceUtils.js";import{isEditBusLayer as h,emitApplyEditsEvent as m}from"../mixins/EditBusLayer.js";import{isValidFieldValue as f}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as y}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as g,getEffectiveLayerCapabilities as b}from"../support/layerUtils.js";function w(e){return null!=e?.applyEdits}function F(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function A(e){return e.every(F)}function v(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function I(e){return e.every(v)}async function $(e,t,a,s={}){let n;const o="gdbVersion"in e?e.gdbVersion:null,l=s.gdbVersion??o;if(h(e)&&e.url)n=m(e.url,e.layerId,l,"original-and-current-features"===s.returnServiceEditsOption);else{n=i(),n.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:n.promise};e.emit("apply-edits",t)}try{const{results:i,edits:o}=await E(e,t,a,s),l=e=>e.filter((e=>!e.error)).map(r),d={edits:o,addedFeatures:l(i.addFeatureResults),updatedFeatures:l(i.updateFeatureResults),deletedFeatures:l(i.deleteFeatureResults),addedAttachments:l(i.addAttachmentResults),updatedAttachments:l(i.updateAttachmentResults),deletedAttachments:l(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return i.editedFeatureResults?.length&&(d.editedFeatures=i.editedFeatureResults),n.resolve(d),i}catch(d){throw n.reject(d),d}}async function E(e,t,r,s){if(await e.load(),!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!g(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:n}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,n)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const i=b(e),n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(V(t,i,r,!!n,!!o,`${e.type}-layer`),!i.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const d={...r};if(null!=d.rollbackOnFailureEnabled||i.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),d.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=G(t,i,`${e.type}-layer`),p=r?.globalIdUsed||l,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>B(e,t)))}u.addFeatures.forEach((t=>O(t,e,p,c))),u.updateFeatures.forEach((t=>k(t,e,p,c))),u.deleteFeatures.forEach((t=>U(t,e,p,c))),u.addAttachments.forEach((t=>L(t,e))),u.updateAttachments.forEach((t=>L(t,e))),l&&await x(u,e);return{edits:await T(u),options:d}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!f(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function j(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,n=t.spatialReference,o="local"===i.type,l=d(n),h=u(n,s),m=h||p(n)&&(p(s)||c(s));if(!(o&&l&&m||!o&&!l&&h))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${n.wkid} is not supported.`)}}function O(e,t,a,r){R(e,t,a,r),j(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),j(e,t);const i=b(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function B(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=o())}async function T(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await l(r),i=t.length,n=a.length;return s.slice(0,i).forEach(((e,a)=>t[a].geometry=e)),s.slice(i,i+n).forEach(((e,t)=>a[t].geometry=e)),e}function D(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function G(e,t,r){const s=D(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(M),s.updateFeatures=s.updateFeatures.map(M),s.addAssetFeatures=[],s}function V(e,t,r,s,i,n){if(!e||!s&&!i)throw new a(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed&&!r.usingFeatureServiceEndpoint)throw new a(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function M(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!y(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function q(e,t,r,s){if(!w(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,V as checkEditingCapabilities,I as isFeatureIdentifierArrayWithGlobalId,A as isFeatureIdentifierArrayWithObjectId,v as isFeatureIdentifierWithGlobalId,F as isFeatureIdentifierWithObjectId,D as normalizeCollections,G as normalizeEdits,T as normalizeGeometries,M as shallowCloneFeature,q as uploadAssets};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{featureHasFields as o,extractSubstitutionTemplatesFromString as n}from"./fieldUtils.js";import{loadArcade as l}from"../../support/
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{featureHasFields as o,extractSubstitutionTemplatesFromString as n}from"./fieldUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";const p="relationships/",c="expression/";let d=class extends t{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){if(this.expressionsUsedInTitle.length>0){return this._get("_arcadeTask")||s((()=>l()))}return null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??import("../../widgets/Feature/support/featureUtils.js").then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new i;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const s=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(s.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:s,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(s,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const s of this.calculatedExpressions?.toArray()??[])try{const t=this._arcadeTask.value.arcade.extractFieldLiterals(s.syntax);for(const s of t){const t=s.split("."),i=this.fieldsIndex.get(t.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const s of t){const t=this.fieldsIndex.get(s);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,s){try{const{attributes:i}=t,r=s?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:a}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(s.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const s=this._createFormattedAttributes(e,t,r).global;return a({attributes:i,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:s,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const s=t.getObjectId();if(null==s)return t;if(!o(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[s];const i=await e.queryFeatures(t);if(1===i?.features.length)return i.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const s of e){if(!s.fieldName)continue;const e=this.fieldsIndex.get(s.fieldName),i=e?.name??s.fieldName;s.fieldName=i,t.set(i.toLowerCase(),s)}return t}_createFormattedAttributes(e,t,s="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],r={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const s=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{r[`expression/${e.name}`]=e.func({vars:{$feature:s}})}catch{}}const a={...t.attributes,...r};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:a,graphic:t,timeZone:s,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return n(e).filter((e=>!(0===e.indexOf(p)||0===e.indexOf(c))))}};e([r({readOnly:!0})],d.prototype,"_arcadeTask",null),e([r()],d.prototype,"_featureUtils",void 0),e([r({readOnly:!0})],d.prototype,"featureUtilsPromise",null),e([r({readOnly:!0})],d.prototype,"calculatedExpressions",null),e([r()],d.prototype,"displayField",void 0),e([r()],d.prototype,"effectivePopupTemplate",void 0),e([r()],d.prototype,"expressionsUsedInTitle",null),e([r()],d.prototype,"fieldsIndex",void 0),e([r()],d.prototype,"fieldInfoMap",null),e([r()],d.prototype,"fields",void 0),e([r()],d.prototype,"objectIdField",void 0),e([r()],d.prototype,"requiredFields",null),d=e([a("esri.layers.support.TitleCreator")],d);const u=d;export{u 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l,DomainValidationError as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as s}from"../../support/arcadeExpressionUtils.js";import{loadArcade as a}from"../../support/arcadeOnDemand.js";import{isStringOrNull as u,isString as f}from"../../support/guards.js";const c=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function p(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(c,"F$1")||null}const m=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],y=["field","normalizationField"];function g(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(F(m,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)F(y,e,n)}function F(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function I(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function w(e,n){return e&&n?(b.clear(),x(b,e,n),Array.from(b).sort()):[]}function x(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)T(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function T(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function h(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map((e=>e.name)):n}function E(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=w(e,n);return t.length/e.fields.length>=i?["*"]:t}async function _(e,n,i){if(!i)return;let t;const r=s(i);if(r)t=[r];else{const{arcadeUtils:e}=await a();t=e.extractFieldNames(i,n?.fields?.map((e=>e.name)))}for(const l of t)T(e,n,l)}async function A(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});x(n,i,l.fieldNames)}}function v({displayField:e,fields:n}){return e||(n?.length?N(n,"name-or-title")||N(n,"unique-identifier")||N(n,"type-or-category")||S(n):null)}function S(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function N(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function $(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function O(e,n,i){i.onStatisticExpression?_(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function D(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(V(e,n,r)),i.fields&&t.push(...i.fields.map((async i=>O(e,n.fieldsIndex,i)))),await Promise.all(t)}async function M(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(V(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(Z(e,i,n));await Promise.all(r)}async function V(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map((i=>_(e,n.fieldsIndex,i.expression))));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(_(e,n.fieldsIndex,l.expressionInfo.expression));await Promise.all(t)}async function R(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&x(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&x(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await A(e,n.fieldsIndex,i.where))}async function j(e,n,i){n&&i&&await Promise.all(i.map((i=>U(e,n,i))))}async function U(e,n,i){n&&i&&(i.valueExpression?await _(e,n.fieldsIndex,i.valueExpression):i.field&&T(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?w(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?w(e.fieldsIndex,Y(e)):[]}function G(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?w(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function P(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map((n=>A(e,t,n.where))))}const q=new Set(["oid","global-id","guid"]),X=new Set(["oid","global-id"]),z=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function B(e){const n=new Set;J(e).forEach((e=>n.add(e))),G(e).forEach((e=>n.add(e.toLowerCase())));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach((e=>n.add(e.toLowerCase()))),Object.values(i.transformFieldRoles).forEach((e=>n.add(e.toLowerCase())))),Array.from(n)}function Y(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function J(e){return Y(e).map((e=>e.toLowerCase()))}function W(e,n){return e.editable&&!q.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||X.has(e.type)||z.some((e=>e.test(i))))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map((n=>Z(e,t,n))))}async function Z(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await _(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach((i=>{T(e,n,i.slice(1,-1))}))}await A(e,n,r)}function ee(e){const n=e.defaultValue;return void 0!==n&&oe(e,n)?n:e.nullable?null:void 0}function ne(e){const n="string"==typeof e?{type:e}:e;return Fe(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ie(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function te(e){return null===e||ie(e)}function re(e){return null===e||Number.isInteger(e)}function le(){return!0}function oe(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?re:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?te:ie;break;case"string":case"esriFieldTypeString":i=e.nullable?u:f;break;default:i=le}return 1===arguments.length?i:i(n)}const se=["integer","small-integer","big-integer"],ae=["single","double"],ue=[...se,...ae],fe=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],ce=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...se,...fe]),pe=new Set([...ae,...ce]),me=t(de,pe);function ye(e){return null!=e&&de.has(e.type)}function ge(e){return null!=e&&me.has(e.type)}function Fe(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function be(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function we(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function xe(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function Te(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function he(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===Se(e,n)}var _e,Ae;function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:oe(e,n)?ge(e)&&!Ne(e.type,Number(n))?_e.OUT_OF_RANGE:null:Ae.INVALID_TYPE}function Ne(e,n){const i="string"==typeof e?Le(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function $e(e,n){const i=l(e,n);return i||(ge(e)?Le(e.type):void 0)}function Le(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"integer":return Me;case"esriFieldTypeBigInteger":case"big-integer":return Ve;case"esriFieldTypeSingle":case"single":return Re;case"esriFieldTypeDouble":case"double":return je}}function Oe(e){if(!ie(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeInteger";if(e>=Ve.min&&e<=Ve.max)return"esriFieldTypeBigInteger"}return e>=Re.min&&e<=Re.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}!function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"}(_e||(_e={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(Ae||(Ae={}));const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Me={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Ve={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},je={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case o.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case o.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case Ae.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case _e.OUT_OF_RANGE:{const{min:e,max:t}=Le(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function ke(e,n){return!Ce(e,n,null)}function Ce(e,n,i){if(!n?.attributes||!e){if(null!=i)for(const n of e??[])i.add(n);return!0}const t=new Set(Object.keys(n.attributes));let r=!1;for(const l of e)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Ge(e,n){const i=new Set;for(const t of n)await _(i,e.fieldsIndex,t);return Array.from(i).sort()}function Pe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some((n=>e.toLowerCase().startsWith(n)))}async function qe(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Xe(e){const n=e?.match(/{[^}]+}/g);return n?n.map((e=>e.slice(1,-1).split(":")[0].trim())):[]}export{_e as NumericRangeValidationError,Ae as TypeValidationError,Ve as bigIntegerRange,_ as collectArcadeFieldNames,P as collectDisplayFilterFields,L as collectElevationFields,D as collectFeatureReductionFields,T as collectField,x as collectFields,R as collectFilterFields,Q as collectLabelingFields,j as collectOrderByInfos,V as collectPopupTemplateFields,M as collectTrackInfoFields,je as doubleRange,Xe as extractSubstitutionTemplatesFromString,ke as featureHasFields,w as fixFields,g as fixRendererFields,I as fixTimeInfoFields,ce as floatJSONTypes,ae as floatTypes,v as getDisplayFieldName,Y as getEditTrackingFields,$ as getElevationFields,Ge as getExpressionFields,C as getFeatureEditFields,G as getFeatureGeometryFields,ne as getFieldDefaultLength,ee as getFieldDefaultValue,$e as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,Oe as getNumericTypeForValue,qe as getRendererFields,k as getTimeFields,fe as integerJSONTypes,Me as integerRange,se as integerTypes,Ie as isDateField,be as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,he as isGlobalIDField,ye as isIntegerField,Ne as isNumberInRange,ge as isNumericField,Te as isObjectIDField,Pe as isRasterPixelValueField,Fe as isStringField,xe as isTimeOnlyField,we as isTimestampOffsetField,Ee as isValidFieldValue,oe as isValueMatchingFieldType,p as normalizeFieldName,ue as numericTypes,E as packFields,Ce as populateMissingFields,m as rendererFields,ve as sanitizeNullFieldValue,Re as singleRange,De as smallIntegerRange,h as unpackFieldNames,Se as validateFieldValue,Ue as validationErrorToString,y as visualVariableFields};
|
|
5
|
+
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l,DomainValidationError as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as s}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as a,isString as u}from"../../support/guards.js";import{loadArcade as f}from"../../support/loadArcade.js";const c=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function p(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(c,"F$1")||null}const m=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],y=["field","normalizationField"];function g(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(F(m,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)F(y,e,n)}function F(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function I(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function w(e,n){return e&&n?(b.clear(),x(b,e,n),Array.from(b).sort()):[]}function x(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)T(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function T(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function h(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map((e=>e.name)):n}function E(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=w(e,n);return t.length/e.fields.length>=i?["*"]:t}async function A(e,n,i){if(!i)return;let t;const r=s(i);if(r)t=[r];else{const{arcadeUtils:e}=await f();t=e.extractFieldNames(i,n?.fields?.map((e=>e.name)))}for(const l of t)T(e,n,l)}async function _(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});x(n,i,l.fieldNames)}}function v({displayField:e,fields:n}){return e||(n?.length?N(n,"name-or-title")||N(n,"unique-identifier")||N(n,"type-or-category")||S(n):null)}function S(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function N(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function $(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function O(e,n,i){i.onStatisticExpression?A(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function D(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(V(e,n,r)),i.fields&&t.push(...i.fields.map((async i=>O(e,n.fieldsIndex,i)))),await Promise.all(t)}async function M(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(V(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(Z(e,i,n));await Promise.all(r)}async function V(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map((i=>A(e,n.fieldsIndex,i.expression))));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(A(e,n.fieldsIndex,l.expressionInfo.expression));await Promise.all(t)}async function R(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&x(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&x(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await _(e,n.fieldsIndex,i.where))}async function j(e,n,i){n&&i&&await Promise.all(i.map((i=>U(e,n,i))))}async function U(e,n,i){n&&i&&(i.valueExpression?await A(e,n.fieldsIndex,i.valueExpression):i.field&&T(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?w(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?w(e.fieldsIndex,Y(e)):[]}function G(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?w(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function P(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map((n=>_(e,t,n.where))))}const q=new Set(["oid","global-id","guid"]),X=new Set(["oid","global-id"]),z=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function B(e){const n=new Set;J(e).forEach((e=>n.add(e))),G(e).forEach((e=>n.add(e.toLowerCase())));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach((e=>n.add(e.toLowerCase()))),Object.values(i.transformFieldRoles).forEach((e=>n.add(e.toLowerCase())))),Array.from(n)}function Y(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function J(e){return Y(e).map((e=>e.toLowerCase()))}function W(e,n){return e.editable&&!q.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||X.has(e.type)||z.some((e=>e.test(i))))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map((n=>Z(e,t,n))))}async function Z(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await A(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach((i=>{T(e,n,i.slice(1,-1))}))}await _(e,n,r)}function ee(e){const n=e.defaultValue;return void 0!==n&&oe(e,n)?n:e.nullable?null:void 0}function ne(e){const n="string"==typeof e?{type:e}:e;return Fe(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ie(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function te(e){return null===e||ie(e)}function re(e){return null===e||Number.isInteger(e)}function le(){return!0}function oe(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?re:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?te:ie;break;case"string":case"esriFieldTypeString":i=e.nullable?a:u;break;default:i=le}return 1===arguments.length?i:i(n)}const se=["integer","small-integer","big-integer"],ae=["single","double"],ue=[...se,...ae],fe=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],ce=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...se,...fe]),pe=new Set([...ae,...ce]),me=t(de,pe);function ye(e){return null!=e&&de.has(e.type)}function ge(e){return null!=e&&me.has(e.type)}function Fe(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function be(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function we(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function xe(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function Te(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function he(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===Se(e,n)}var Ae,_e;function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:oe(e,n)?ge(e)&&!Ne(e.type,Number(n))?Ae.OUT_OF_RANGE:null:_e.INVALID_TYPE}function Ne(e,n){const i="string"==typeof e?Le(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function $e(e,n){const i=l(e,n);return i||(ge(e)?Le(e.type):void 0)}function Le(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"integer":return Me;case"esriFieldTypeBigInteger":case"big-integer":return Ve;case"esriFieldTypeSingle":case"single":return Re;case"esriFieldTypeDouble":case"double":return je}}function Oe(e){if(!ie(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeInteger";if(e>=Ve.min&&e<=Ve.max)return"esriFieldTypeBigInteger"}return e>=Re.min&&e<=Re.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}!function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"}(Ae||(Ae={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(_e||(_e={}));const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Me={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Ve={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},je={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case o.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case o.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case _e.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case Ae.OUT_OF_RANGE:{const{min:e,max:t}=Le(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function ke(e,n){return!Ce(e,n,null)}function Ce(e,n,i){if(!n?.attributes||!e){if(null!=i)for(const n of e??[])i.add(n);return!0}const t=new Set(Object.keys(n.attributes));let r=!1;for(const l of e)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Ge(e,n){const i=new Set;for(const t of n)await A(i,e.fieldsIndex,t);return Array.from(i).sort()}function Pe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some((n=>e.toLowerCase().startsWith(n)))}async function qe(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Xe(e){const n=e?.match(/{[^}]+}/g);return n?n.map((e=>e.slice(1,-1).split(":")[0].trim())):[]}export{Ae as NumericRangeValidationError,_e as TypeValidationError,Ve as bigIntegerRange,A as collectArcadeFieldNames,P as collectDisplayFilterFields,L as collectElevationFields,D as collectFeatureReductionFields,T as collectField,x as collectFields,R as collectFilterFields,Q as collectLabelingFields,j as collectOrderByInfos,V as collectPopupTemplateFields,M as collectTrackInfoFields,je as doubleRange,Xe as extractSubstitutionTemplatesFromString,ke as featureHasFields,w as fixFields,g as fixRendererFields,I as fixTimeInfoFields,ce as floatJSONTypes,ae as floatTypes,v as getDisplayFieldName,Y as getEditTrackingFields,$ as getElevationFields,Ge as getExpressionFields,C as getFeatureEditFields,G as getFeatureGeometryFields,ne as getFieldDefaultLength,ee as getFieldDefaultValue,$e as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,Oe as getNumericTypeForValue,qe as getRendererFields,k as getTimeFields,fe as integerJSONTypes,Me as integerRange,se as integerTypes,Ie as isDateField,be as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,he as isGlobalIDField,ye as isIntegerField,Ne as isNumberInRange,ge as isNumericField,Te as isObjectIDField,Pe as isRasterPixelValueField,Fe as isStringField,xe as isTimeOnlyField,we as isTimestampOffsetField,Ee as isValidFieldValue,oe as isValueMatchingFieldType,p as normalizeFieldName,ue as numericTypes,E as packFields,Ce as populateMissingFields,m as rendererFields,ve as sanitizeNullFieldValue,Re as singleRange,De as smallIntegerRange,h as unpackFieldNames,Se as validateFieldValue,Ue as validationErrorToString,y as visualVariableFields};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import r from"../../core/Logger.js";import{parseWhereClause as t}from"../../core/sql.js";import{formatDate as n,convertDateFormatToIntlOptions as o}from"../../intl/date.js";import{formatNumber as a}from"../../intl/number.js";import{getDomainRange as i}from"./domainUtils.js";import{isIntegerField as l,isNumericField as s,isStringField as u,isDateField as c}from"./fieldUtils.js";import{getLabelExpression as
|
|
5
|
+
import e from"../../core/Error.js";import r from"../../core/Logger.js";import{parseWhereClause as t}from"../../core/sql.js";import{formatDate as n,convertDateFormatToIntlOptions as o}from"../../intl/date.js";import{formatNumber as a}from"../../intl/number.js";import{getDomainRange as i}from"./domainUtils.js";import{isIntegerField as l,isNumericField as s,isStringField as u,isDateField as c}from"./fieldUtils.js";import{getLabelExpression as p,getSingleFieldArcadeExpression as f}from"./labelUtils.js";import{createLabelExpression as m}from"../../support/ArcadeExpression.js";import{getFieldNameFromSimpleExpression as d}from"../../support/arcadeExpressionUtils.js";const g=()=>r.getLogger("esri.layers.support.labelFormatUtils"),w={type:"simple",evaluate:()=>null},y={getAttribute:(e,r)=>e.field(r)};async function b(r,n,o){if(!r||!r.symbol||!n)return w;const a=r.where,i=p(r);let c;if("arcade"===i.type){const r=d(i.expression),t=n.get(r);if(t&&(l(t)||s(t)||u(t)))c={type:"simple",evaluate(e){const r="attributes"in e?e.attributes?.[t.name]:e.field(t.name);return null==r?"":r.toString()}};else{const r=await m(i.expression,o);if(null==r)return w;c={type:"arcade",evaluate(t,o){try{const e="attributes"in t?r.repurposeFeature(t,n):t;e.contextTimeZone=o??null;const a=r.evaluate(e,{$view:{timeZone:o}});if(null!=a)return a.toString()}catch(a){g().error(new e("arcade-expression-error","Encountered an error when evaluating label expression for feature",{error:a,feature:t,expression:i}))}return null},needsHydrationToEvaluate:()=>null==f(i.expression)}}}else c={type:"simple",evaluate:e=>i.expression.replaceAll(/{[^}]*}/g,(r=>{const t=r.slice(1,-1),o=n.get(t);if(!o)return r;let a=null;return a="attributes"in e?e?.attributes?.[o.name]:e.field(o.name),null==a?"":h(a,o)}))};if(a){let r;try{r=await t(a,n)}catch(b){return g().error(new e("bad-where-clause","Encountered an error when evaluating where clause, ignoring",{where:a,error:b})),w}const o=c.evaluate;c.evaluate=(t,n)=>{const i="attributes"in t?void 0:y;try{if(r.testFeature(t,i))return o(t,n)}catch(b){g().error(new e("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:a,feature:t,error:b}))}return null}}return c}function h(e,r){if(null==e)return"";const t=r.domain;if(t)if("codedValue"===t.type||"coded-value"===t.type){const r=e;for(const e of t.codedValues)if(e.code===r)return e.name}else if("range"===t.type){const{max:n,min:o}=i(r),a=+e;if(null!=o&&null!=n&&o<=a&&a<=n)return t.name}let l=e;return c(r)?l=n(l,o("short-date")):s(r)&&(l=a(+l)),l||""}export{b as createLabelFunction,h as formatField};
|
package/libs/parquet/parquet.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as t}from"../../assets.js";import e from"../../request.js";let _;const n=new Array(128).fill(void 0);function r(t){return n[t]}n.push(void 0,null,!0,!1);let i=n.length;function o(t){t<132||(n[t]=i,i=t)}function a(t){const e=r(t);return o(t),e}function s(t){i===n.length&&n.push(n.length+1);const e=i;return i=n[e],n[e]=t,e}const g="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&g.decode();let d=null;function c(){return null!==d&&0!==d.byteLength||(d=new Uint8Array(_.memory.buffer)),d}function w(t,e){return t>>>=0,g.decode(c().subarray(t,t+e))}function l(t,e){return t>>>=0,c().subarray(t/1,t/1+e)}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>{_.__wbindgen_export_1.get(t.dtor)(t.a,t.b)}));function b(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const e=i.a;i.a=0;try{return r(e,i.b,...t)}finally{0==--i.cnt?(_.__wbindgen_export_1.get(i.dtor)(e,i.b),u.unregister(i)):i.a=e}};return o.original=i,u.register(o,i,i),o}function p(t,e,n){_._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6f3c6e2a403d1e3d(t,e,s(n))}function f(){_.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const _=h.encode(t);return e.set(_),{read:t.length,written:_.length}};function I(t,e,_){if(void 0===_){const _=h.encode(t),n=e(_.length,1)>>>0;return c().subarray(n,n+_.length).set(_),y=_.length,n}let n=t.length,r=e(n,1)>>>0;const i=c();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;i[r+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),r=_(r,n,n=o+3*t.length,1)>>>0;const e=c().subarray(r+o,r+n);o+=m(t,e).written,r=_(r,n,o,1)>>>0}return y=o,r}let k=null;function F(){return(null===k||!0===k.buffer.detached||void 0===k.buffer.detached&&k.buffer!==_.memory.buffer)&&(k=new DataView(_.memory.buffer)),k}function v(t,e){try{return t.apply(this,e)}catch(n){_.__wbindgen_exn_store(s(n))}}function R(t,e,n,r){_.wasm_bindgen__convert__closures__invoke2_mut__h367b7e3d952c2b06(t,e,s(n),s(r))}let x=null;function z(){return null!==x&&0!==x.byteLength||(x=new Float64Array(_.memory.buffer)),x}function T(t,e){return t>>>=0,z().subarray(t/8,t/8+e)}let P=null;function M(){return null!==P&&0!==P.byteLength||(P=new Uint32Array(_.memory.buffer)),P}function q(t,e){return t>>>=0,M().subarray(t/4,t/4+e)}function O(t,e){t>>>=0;const _=F(),n=[];for(let r=t;r<t+4*e;r+=4)n.push(a(_.getUint32(r,!0)));return n}let j=null;function C(){return null!==j&&0!==j.byteLength||(j=new Uint16Array(_.memory.buffer)),j}function B(t,e){const _=e(2*t.length,2)>>>0;return C().set(t,_/2),y=t.length,_}function A(t,e){const _=e(4*t.length,4)>>>0,n=F();for(let r=0;r<t.length;r++)n.setUint32(_+4*r,s(t[r]),!0);return y=t.length,_}function S(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function W(t,e){const _=e(8*t.length,8)>>>0;return z().set(t,_/8),y=t.length,_}function G(t,e){const _=e(4*t.length,4)>>>0;return M().set(t,_/4),y=t.length,_}function E(t){return null==t}function U(t,e){const _=e(1*t.length,1)>>>0;return c().set(t,_/1),y=t.length,_}function D(t,e,n){const r=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;return a(_.readMetadata(r,i,s(e),s(n)))}function L(t){const e=U(t,_.__wbindgen_malloc),n=y;return a(_.readMetadataFromFile(e,n))}function V(t,e,n,r,i){const o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),g=y;S(r,tt);var d=r.__destroy_into_raw();let c=0;E(i)||(S(i,rt),c=i.__destroy_into_raw());return a(_.readFile(o,g,s(e),s(n),d,c))}function N(t,e){let n=0;E(t)||(S(t,rt),n=t.__destroy_into_raw());const r=U(e,_.__wbindgen_malloc),i=y;return a(_.readFileFromBinary(n,r,i))}const X=Object.freeze({None:0,0:"None",Snappy:1,1:"Snappy"}),Y=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),$=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_columndescriptor_free(t>>>0,1)));class K{static __wrap(t){t>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=t,J.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_columndescriptor_free(t,0)}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}physicalType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_physicalType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_logicalType(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_encodings(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_pageEncodings(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}numValues(){return _.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_compression(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}compressedSize(){return _.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return _.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_nullCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_distinctCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_minValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_maxValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_fieldmetadata_free(t>>>0,1)));class H{static __wrap(t){t>>>=0;const e=Object.create(H.prototype);return e.__wbg_ptr=t,Q.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_fieldmetadata_free(t,0)}get name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}get index(){return _.fieldmetadata_index(this.__wbg_ptr)}get type(){const t=_.fieldmetadata_esri_type(this.__wbg_ptr);return $[t]}get physicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_physical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_logical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filemetadata_free(t>>>0,1)));class tt{static __wrap(t){t>>>=0;const e=Object.create(tt.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filemetadata_free(t,0)}version(){return _.filemetadata_version(this.__wbg_ptr)}numRows(){return _.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return _.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return _.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_createdBy(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let a;return 0!==e&&(a=w(e,n).slice(),_.__wbindgen_free(e,1*n,1)),a}finally{_.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_keys(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(t){const e=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y,r=_.filemetadata_getFieldIndex(this.__wbg_ptr,e,n);return 16777215===r?void 0:r}getFieldByIndex(t){const e=_.filemetadata_getFieldByIndex(this.__wbg_ptr,t);return 0===e?void 0:H.__wrap(e)}getFields(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_getFields(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const et="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filewriter_free(t>>>0,1)));class _t{static __wrap(t){t>>>=0;const e=Object.create(_t.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filewriter_free(t,0)}static new(t,e){const n=A(t,_.__wbindgen_malloc),r=y,i=_.filewriter_new(n,r,e);return _t.__wrap(i)}writeKeyValue(t,e){const n=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=y,i=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filewriter_writeKeyValue(this.__wbg_ptr,n,r,i,o)}writeI32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,pt);var n=e.__destroy_into_raw();_.filewriter_writeI32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeI64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,yt);var n=e.__destroy_into_raw();_.filewriter_writeI64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,dt);var n=e.__destroy_into_raw();_.filewriter_writeF32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,wt);var n=e.__destroy_into_raw();_.filewriter_writeF64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeGeometryPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,ut);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeStringPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,mt);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeBytesPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,st);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}finish(){try{const i=this.__destroy_into_raw(),o=_.__wbindgen_add_to_stack_pointer(-16);_.filewriter_finish(o,i);var t=F().getInt32(o+0,!0),e=F().getInt32(o+4,!0),n=F().getInt32(o+8,!0);if(F().getInt32(o+12,!0))throw a(n);var r=l(t,e).slice();return _.__wbindgen_free(t,1*e,1),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const nt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_geometryinfodescriptor_free(t>>>0,1)));class rt{static __wrap(t){t>>>=0;const e=Object.create(rt.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_geometryinfodescriptor_free(t,0)}get geometryType(){const t=_.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===t?void 0:t}set geometryType(t){_.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,E(t)?4:t)}get wkbIndex(){const t=_.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set wkbIndex(t){_.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,E(t)?16777215:t)}get lngIndex(){const t=_.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set lngIndex(t){_.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,E(t)?16777215:t)}get latIndex(){const t=_.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set latIndex(t){_.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,E(t)?16777215:t)}get xIndex(){const t=_.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set xIndex(t){_.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,E(t)?16777215:t)}get inWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_inWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set inWkid(t){_.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}get outWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_outWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set outWkid(t){_.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}static new(){const t=_.geometryinfodescriptor_new();return rt.__wrap(t)}setMultiscaleInfo(t){S(t,ot);var e=t.__destroy_into_raw();_.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,e)}}const it="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_multiscaleinfo_free(t>>>0,1)));class ot{static __wrap(t){t>>>=0;const e=Object.create(ot.prototype);return e.__wbg_ptr=t,it.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_multiscaleinfo_free(t,0)}static new(){const t=_.multiscaleinfo_new();return ot.__wrap(t)}push(t,e,n,r,i){_.multiscaleinfo_push(this.__wbg_ptr,t,e,n,r,i)}}const at="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderbytes_free(t>>>0,1)));class st{static __wrap(t){t>>>=0;const e=Object.create(st.prototype);return e.__wbg_ptr=t,at.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,at.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderbytes_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return st.__wrap(t)}push(t){var e=E(t)?0:U(t,_.__wbindgen_malloc),n=y;_.pagebuilderbytes_push(this.__wbg_ptr,e,n)}}const gt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf32_free(t>>>0,1)));class dt{static __wrap(t){t>>>=0;const e=Object.create(dt.prototype);return e.__wbg_ptr=t,gt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return dt.__wrap(t)}push(t){_.pagebuilderf32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ct="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf64_free(t>>>0,1)));class wt{static __wrap(t){t>>>=0;const e=Object.create(wt.prototype);return e.__wbg_ptr=t,ct.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ct.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return wt.__wrap(t)}push(t){_.pagebuilderf64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const lt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuildergeometry_free(t>>>0,1)));class ut{static __wrap(t){t>>>=0;const e=Object.create(ut.prototype);return e.__wbg_ptr=t,lt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuildergeometry_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return ut.__wrap(t)}writeXY(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.pagebuildergeometry_writeXY(r,this.__wbg_ptr,t,e);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePBF(t,e,n,r){try{const o=_.__wbindgen_add_to_stack_pointer(-16),s=W(t,_.__wbindgen_malloc),g=y,d=G(e,_.__wbindgen_malloc),c=y;_.pagebuildergeometry_writePBF(o,this.__wbg_ptr,s,g,d,c,n,r);var i=F().getInt32(o+0,!0);if(F().getInt32(o+4,!0))throw a(i)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolygon(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolygon(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolyline(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolyline(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeMultipoint(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writeMultipoint(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeNone(){_.pagebuildergeometry_writeNone(this.__wbg_ptr)}}const bt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi32_free(t>>>0,1)));class pt{static __wrap(t){t>>>=0;const e=Object.create(pt.prototype);return e.__wbg_ptr=t,bt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return pt.__wrap(t)}push(t){_.pagebuilderi32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi64_free(t>>>0,1)));class yt{static __wrap(t){t>>>=0;const e=Object.create(yt.prototype);return e.__wbg_ptr=t,ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return yt.__wrap(t)}push(t){_.pagebuilderi64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ht="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderstring_free(t>>>0,1)));class mt{static __wrap(t){t>>>=0;const e=Object.create(mt.prototype);return e.__wbg_ptr=t,ht.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderstring_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return mt.__wrap(t)}push(t){var e=E(t)?0:I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y;_.pagebuilderstring_push(this.__wbg_ptr,e,n)}}const It="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pageencodingdescriptor_free(t>>>0,1)));class kt{static __wrap(t){t>>>=0;const e=Object.create(kt.prototype);return e.__wbg_ptr=t,It.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,It.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}encoding(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}count(){return _.pageencodingdescriptor_count(this.__wbg_ptr)}}const Ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetchunk_free(t>>>0,1)));class vt{static __wrap(t){t>>>=0;const e=Object.create(vt.prototype);return e.__wbg_ptr=t,Ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetchunk_free(t,0)}size(){return _.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(t){return 0!==_.parquetchunk_hasField(this.__wbg_ptr,t)}readX(t){return _.parquetchunk_readX(this.__wbg_ptr,t)}readY(t){return _.parquetchunk_readY(this.__wbg_ptr,t)}readCoords(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readCoords(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=T(e,n).slice(),_.__wbindgen_free(e,8*n,8)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readLengths(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readLengths(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=q(e,n).slice(),_.__wbindgen_free(e,4*n,4)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(t,e,n,r,i){const o=_.parquetchunk_readGeometryTransformed(this.__wbg_ptr,t,e,n,r,i);return 0===o?void 0:Tt.__wrap(o)}boundsXMin(t){return _.parquetchunk_boundsXMin(this.__wbg_ptr,t)}boundsYMin(t){return _.parquetchunk_boundsYMin(this.__wbg_ptr,t)}boundsXMax(t){return _.parquetchunk_boundsXMax(this.__wbg_ptr,t)}boundsYMax(t){return _.parquetchunk_boundsYMax(this.__wbg_ptr,t)}readAttribute(t,e){return a(_.parquetchunk_readAttribute(this.__wbg_ptr,t,e))}}const Rt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetfile_free(t>>>0,1)));let xt=class t{static __wrap(e){e>>>=0;const _=Object.create(t.prototype);return _.__wbg_ptr=e,Rt.register(_,_.__wbg_ptr,_),_}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetfile_free(t,0)}metadata(){const t=_.parquetfile_metadata(this.__wbg_ptr);return tt.__wrap(t)}rowGroups(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetfile_rowGroups(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(t,e){const n=B(t,_.__wbindgen_malloc),r=y;return a(_.parquetfile_readChunksWithCallback(this.__wbg_ptr,n,r,s(e)))}readFirstChunk(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readFirstChunk(this.__wbg_ptr,e,n))}readAllChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readAllChunks(this.__wbg_ptr,e,n))}updateChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_updateChunks(this.__wbg_ptr,e,n))}};const zt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_quantizedgeometry_free(t>>>0,1)));class Tt{static __wrap(t){t>>>=0;const e=Object.create(Tt.prototype);return e.__wbg_ptr=t,zt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_quantizedgeometry_free(t,0)}readCoordsUnsafe(){return a(_.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(_.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const Pt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rangeproviderjs_free(t>>>0,1)));class Mt{static __wrap(t){t>>>=0;const e=Object.create(Mt.prototype);return e.__wbg_ptr=t,Pt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rangeproviderjs_free(t,0)}static new(t,e){const n=_.rangeproviderjs_new(s(t),s(e));return Mt.__wrap(n)}static withFetch(){const t=_.rangeproviderjs_withFetch();return Mt.__wrap(t)}}const qt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rowgroup_free(t>>>0,1)));class Ot{static __wrap(t){t>>>=0;const e=Object.create(Ot.prototype);return e.__wbg_ptr=t,qt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rowgroup_free(t,0)}columns(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.rowgroup_columns(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const jt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_schemafield_free(t>>>0,1)));class Ct{static __wrap(t){t>>>=0;const e=Object.create(Ct.prototype);return e.__wbg_ptr=t,jt.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ct?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_schemafield_free(t,0)}static tryNew(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16),o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=y,g=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),d=y;_.schemafield_tryNew(i,o,s,g,d);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);if(F().getInt32(i+8,!0))throw a(r);return Ct.__wrap(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.schemafield_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}}async function Bt(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(_){if("application/wasm"==t.headers.get("Content-Type"))throw _;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",_)}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}}function At(){const t={wbg:{}};return t.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const n=I(r(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;F().setInt32(t+4,i,!0),F().setInt32(t+0,n,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let n,r;try{n=t,r=e,console.error(w(t,e))}finally{_.__wbindgen_free(n,r,1)}},t.wbg.__wbindgen_object_drop_ref=function(t){a(t)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof r(t)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===r(t)},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,e){return s(new Function(w(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return s(r(t))},t.wbg.__wbindgen_number_new=function(t){return s(t)},t.wbg.__wbindgen_string_new=function(t,e){return s(w(t,e))},t.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(t,e){return s(r(t).call(r(e)))}),arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(t,e,_){return s(r(t).call(r(e),r(_)))}),arguments)},t.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(t,e,_,n,i){return s(r(t).call(r(e),r(_),r(n),r(i)))}),arguments)},t.wbg.__wbg_valueOf_563b3487b1b116aa=function(t){return r(t).valueOf()},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){return s(r(t).buffer)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(t,e){try{var _={a:t,b:e},n=(t,e)=>{const n=_.a;_.a=0;try{return R(n,_.b,t,e)}finally{_.a=n}};return s(new Promise(n))}finally{_.a=_.b=0}},t.wbg.__wbg_resolve_570458cb99d56a43=function(t){return s(Promise.resolve(r(t)))},t.wbg.__wbg_then_95e6edc0f89b73b1=function(t,e){return s(r(t).then(r(e)))},t.wbg.__wbg_then_876bb3c633745cc6=function(t,e,_){return s(r(t).then(r(e),r(_)))},t.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(t,e,_){return s(new Int16Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_new_ea1883e1e5e86686=function(t){return s(new Uint8Array(r(t)))},t.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(t,e,_){return s(new Uint32Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(t){return r(t).length},t.wbg.__wbg_set_d1e79e2388520f18=function(t,e,_){r(t).set(r(e),_>>>0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(w(t,e))},t.wbg.__wbindgen_memory=function(){return s(_.memory)},t.wbg.__wbindgen_array_new=function(){return s([])},t.wbg.__wbindgen_array_push=function(t,e){r(t).push(a(e))},t.wbg.__wbindgen_uint8_array_new=function(t,e){var n=l(t,e).slice();_.__wbindgen_free(t,1*e,1);return s(n)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(t){return s(r(t).queueMicrotask)},t.wbg.__wbindgen_cb_drop=function(t){const e=a(t).original;if(1==e.cnt--)return e.a=0,!0;return!1},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(t){queueMicrotask(r(t))},t.wbg.__wbg_parquetchunk_new=function(t){return s(vt.__wrap(t))},t.wbg.__wbg_parquetfile_new=function(t){return s(xt.__wrap(t))},t.wbg.__wbg_filemetadata_new=function(t){return s(tt.__wrap(t))},t.wbg.__wbg_fieldmetadata_new=function(t){return s(H.__wrap(t))},t.wbg.__wbg_rowgroup_new=function(t){return s(Ot.__wrap(t))},t.wbg.__wbg_schemafield_unwrap=function(t){return Ct.__unwrap(a(t))},t.wbg.__wbg_columndescriptor_new=function(t){return s(K.__wrap(t))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return s(kt.__wrap(t))},t.wbg.__wbindgen_closure_wrapper1827=function(t,e,_){return s(b(t,e,163,p))},t}function St(t,e){return _=t.exports,Gt.__wbindgen_wasm_module=e,k=null,x=null,j=null,P=null,d=null,_.__wbindgen_start(),_}function Wt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=At();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return St(new WebAssembly.Instance(t,e),t)}async function Gt(t){if(void 0!==_)return _;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 e=At();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bt(await t,e);return St(n,r)}const Et=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:K,CompressMode:X,FieldMetadata:H,FileMetadata:tt,FileWriter:_t,GeometryInfoDescriptor:rt,GeometryType:Y,MultiScaleInfo:ot,PageBuilderBytes:st,PageBuilderF32:dt,PageBuilderF64:wt,PageBuilderGeometry:ut,PageBuilderI32:pt,PageBuilderI64:yt,PageBuilderString:mt,PageEncodingDescriptor:kt,ParquetChunk:vt,ParquetFile:xt,QuantizedGeometry:Tt,RangeProviderJs:Mt,RowGroup:Ot,SchemaField:Ct,default:Gt,enable_tracing:f,initSync:Wt,readFile:V,readFileFromBinary:N,readMetadata:D,readMetadataFromFile:L},Symbol.toStringTag,{value:"Module"}));let Ut=null;async function Dt(){return Ut||(Ut=Lt()),Ut}async function Lt(){const e=await Promise.resolve().then((()=>Et));return await e.default({module_or_path:t("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),e}const Vt=t=>async function(_,n,r){const i=t(),{data:o}=await e(_,{responseType:"array-buffer",query:i,headers:{range:`bytes=${n}-${r}`}});return o},Nt=t=>async function(_){const n=t(),{data:r}=await e(_,{responseType:"native",method:"head",query:n}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Xt{static async create(t,e){const _=await Dt(),n=await _.readMetadata(t,Vt(e),Nt(e));return Xt.fromFileMetadata(n)}static fromFileMetadata(t){const e=[];for(let _=0;_<t.numFields();_++){const n=t.getFieldByIndex(_);e.push({name:n.name,type:n.type,alias:n.name,index:n.index}),n.free()}return new Xt(t,e)}constructor(t,e){this._inner=t,this.fields=e}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(t){return this._inner.getFieldIndex(t)}tryReadGeoMetadata(){const t=this._inner.keyValueMetadata("geo");return null==t?null:JSON.parse(t)}tryReadEsriMetadata(){const t=this._inner.keyValueMetadata("esri");return null==t?null:JSON.parse(t)}}function Yt(t){switch(t){case"esriGeometryPoint":return Y.Point;case"esriGeometryPolygon":return Y.Polygon;case"esriGeometryPolyline":return Y.Polyline;case"esriGeometryMultipoint":return Y.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${t}`)}}function $t(t,e,_){const n=rt.new();if(n.geometryType=Yt(t.geometryType),"location"===t.type)n.latIndex=e.getFieldIndex(t.latitudeFieldName),n.lngIndex=e.getFieldIndex(t.longitudeFieldName);else{if(null==t.primaryFieldName)throw new Error("InternalError: A primary field name or set of location fields must be defined");if(n.wkbIndex=e.getFieldIndex(t.primaryFieldName),t.multiscale){const _=ot.new();for(const n of t.multiscale.levels){const[t,r]=n.transform.translate,[i,o]=n.transform.scale,a=e.getFieldIndex(n.column);_.push(a,t,r,i,o)}n.setMultiscaleInfo(_)}}return n.inWkid=t.spatialReference.wkid,_&&(n.outWkid=_.wkid),n}class Jt{static async create(t,e){const _=await Dt(),n=Vt(e.getCustomParameters),r=Nt(e.getCustomParameters),i=await D(t,n,r),o=$t(e.geometryInfo,i,e.outSpatialReference),a=await _.readFile(t,n,r,i,o);return new Jt(a,Xt.fromFileMetadata(a.metadata()))}static async fromFile(t,e,_){const n=await Dt(),r=await n.readMetadataFromFile(t),i=e?$t(e,r,_):void 0,o=await n.readFileFromBinary(i,t);return new Jt(o,Xt.fromFileMetadata(o.metadata()))}constructor(t,e){this.inner=t,this.metadata=e}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Jt as ParquetFile,Xt as ParquetMetadata};
|
|
5
|
+
import{getAssetUrl as t}from"../../assets.js";import e from"../../request.js";let _;const n=new Array(128).fill(void 0);function r(t){return n[t]}n.push(void 0,null,!0,!1);let i=n.length;function o(t){t<132||(n[t]=i,i=t)}function a(t){const e=r(t);return o(t),e}function s(t){i===n.length&&n.push(n.length+1);const e=i;return i=n[e],n[e]=t,e}const g="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&g.decode();let d=null;function c(){return null!==d&&0!==d.byteLength||(d=new Uint8Array(_.memory.buffer)),d}function w(t,e){return t>>>=0,g.decode(c().subarray(t,t+e))}function l(t,e){return t>>>=0,c().subarray(t/1,t/1+e)}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>{_.__wbindgen_export_1.get(t.dtor)(t.a,t.b)}));function b(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const e=i.a;i.a=0;try{return r(e,i.b,...t)}finally{0==--i.cnt?(_.__wbindgen_export_1.get(i.dtor)(e,i.b),u.unregister(i)):i.a=e}};return o.original=i,u.register(o,i,i),o}function p(t,e,n){_._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6f3c6e2a403d1e3d(t,e,s(n))}function f(){_.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const _=h.encode(t);return e.set(_),{read:t.length,written:_.length}};function I(t,e,_){if(void 0===_){const _=h.encode(t),n=e(_.length,1)>>>0;return c().subarray(n,n+_.length).set(_),y=_.length,n}let n=t.length,r=e(n,1)>>>0;const i=c();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;i[r+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),r=_(r,n,n=o+3*t.length,1)>>>0;const e=c().subarray(r+o,r+n);o+=m(t,e).written,r=_(r,n,o,1)>>>0}return y=o,r}let k=null;function F(){return(null===k||!0===k.buffer.detached||void 0===k.buffer.detached&&k.buffer!==_.memory.buffer)&&(k=new DataView(_.memory.buffer)),k}function v(t,e){try{return t.apply(this,e)}catch(n){_.__wbindgen_exn_store(s(n))}}function R(t,e,n,r){_.wasm_bindgen__convert__closures__invoke2_mut__h367b7e3d952c2b06(t,e,s(n),s(r))}let x=null;function z(){return null!==x&&0!==x.byteLength||(x=new Float64Array(_.memory.buffer)),x}function T(t,e){return t>>>=0,z().subarray(t/8,t/8+e)}let P=null;function M(){return null!==P&&0!==P.byteLength||(P=new Uint32Array(_.memory.buffer)),P}function q(t,e){return t>>>=0,M().subarray(t/4,t/4+e)}function O(t,e){t>>>=0;const _=F(),n=[];for(let r=t;r<t+4*e;r+=4)n.push(a(_.getUint32(r,!0)));return n}let j=null;function C(){return null!==j&&0!==j.byteLength||(j=new Uint16Array(_.memory.buffer)),j}function B(t,e){const _=e(2*t.length,2)>>>0;return C().set(t,_/2),y=t.length,_}function A(t,e){const _=e(4*t.length,4)>>>0,n=F();for(let r=0;r<t.length;r++)n.setUint32(_+4*r,s(t[r]),!0);return y=t.length,_}function S(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function W(t,e){const _=e(8*t.length,8)>>>0;return z().set(t,_/8),y=t.length,_}function G(t,e){const _=e(4*t.length,4)>>>0;return M().set(t,_/4),y=t.length,_}function E(t){return null==t}function U(t,e){const _=e(1*t.length,1)>>>0;return c().set(t,_/1),y=t.length,_}function D(t,e,n){const r=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;return a(_.readMetadata(r,i,s(e),s(n)))}function L(t){const e=U(t,_.__wbindgen_malloc),n=y;return a(_.readMetadataFromFile(e,n))}function V(t,e,n,r,i){const o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),g=y;S(r,tt);var d=r.__destroy_into_raw();let c=0;E(i)||(S(i,rt),c=i.__destroy_into_raw());return a(_.readFile(o,g,s(e),s(n),d,c))}function N(t,e){let n=0;E(t)||(S(t,rt),n=t.__destroy_into_raw());const r=U(e,_.__wbindgen_malloc),i=y;return a(_.readFileFromBinary(n,r,i))}const X=Object.freeze({None:0,0:"None",Snappy:1,1:"Snappy"}),Y=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),$=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_columndescriptor_free(t>>>0,1)));class Q{static __wrap(t){t>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=t,J.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_columndescriptor_free(t,0)}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}physicalType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_physicalType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_logicalType(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_encodings(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_pageEncodings(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}numValues(){return _.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_compression(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}compressedSize(){return _.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return _.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_nullCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_distinctCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_minValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_maxValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const K="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_fieldmetadata_free(t>>>0,1)));class H{static __wrap(t){t>>>=0;const e=Object.create(H.prototype);return e.__wbg_ptr=t,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_fieldmetadata_free(t,0)}get name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}get index(){return _.fieldmetadata_index(this.__wbg_ptr)}get type(){const t=_.fieldmetadata_esri_type(this.__wbg_ptr);return $[t]}get physicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_physical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_logical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filemetadata_free(t>>>0,1)));class tt{static __wrap(t){t>>>=0;const e=Object.create(tt.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filemetadata_free(t,0)}version(){return _.filemetadata_version(this.__wbg_ptr)}numRows(){return _.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return _.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return _.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_createdBy(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let a;return 0!==e&&(a=w(e,n).slice(),_.__wbindgen_free(e,1*n,1)),a}finally{_.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_keys(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(t){const e=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y,r=_.filemetadata_getFieldIndex(this.__wbg_ptr,e,n);return 16777215===r?void 0:r}getFieldByIndex(t){const e=_.filemetadata_getFieldByIndex(this.__wbg_ptr,t);return 0===e?void 0:H.__wrap(e)}getFields(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_getFields(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const et="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filewriter_free(t>>>0,1)));class _t{static __wrap(t){t>>>=0;const e=Object.create(_t.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filewriter_free(t,0)}static new(t,e){const n=A(t,_.__wbindgen_malloc),r=y,i=_.filewriter_new(n,r,e);return _t.__wrap(i)}writeKeyValue(t,e){const n=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=y,i=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filewriter_writeKeyValue(this.__wbg_ptr,n,r,i,o)}writeI32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,pt);var n=e.__destroy_into_raw();_.filewriter_writeI32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeI64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,yt);var n=e.__destroy_into_raw();_.filewriter_writeI64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,dt);var n=e.__destroy_into_raw();_.filewriter_writeF32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,wt);var n=e.__destroy_into_raw();_.filewriter_writeF64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeGeometryPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,ut);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeStringPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,mt);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeBytesPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,st);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}finish(){try{const i=this.__destroy_into_raw(),o=_.__wbindgen_add_to_stack_pointer(-16);_.filewriter_finish(o,i);var t=F().getInt32(o+0,!0),e=F().getInt32(o+4,!0),n=F().getInt32(o+8,!0);if(F().getInt32(o+12,!0))throw a(n);var r=l(t,e).slice();return _.__wbindgen_free(t,1*e,1),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const nt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_geometryinfodescriptor_free(t>>>0,1)));class rt{static __wrap(t){t>>>=0;const e=Object.create(rt.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_geometryinfodescriptor_free(t,0)}get geometryType(){const t=_.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===t?void 0:t}set geometryType(t){_.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,E(t)?4:t)}get wkbIndex(){const t=_.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set wkbIndex(t){_.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,E(t)?16777215:t)}get lngIndex(){const t=_.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set lngIndex(t){_.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,E(t)?16777215:t)}get latIndex(){const t=_.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set latIndex(t){_.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,E(t)?16777215:t)}get xIndex(){const t=_.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set xIndex(t){_.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,E(t)?16777215:t)}get inWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_inWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set inWkid(t){_.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}get outWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_outWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set outWkid(t){_.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}static new(){const t=_.geometryinfodescriptor_new();return rt.__wrap(t)}setMultiscaleInfo(t){S(t,ot);var e=t.__destroy_into_raw();_.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,e)}}const it="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_multiscaleinfo_free(t>>>0,1)));class ot{static __wrap(t){t>>>=0;const e=Object.create(ot.prototype);return e.__wbg_ptr=t,it.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_multiscaleinfo_free(t,0)}static new(){const t=_.multiscaleinfo_new();return ot.__wrap(t)}push(t,e,n,r,i){_.multiscaleinfo_push(this.__wbg_ptr,t,e,n,r,i)}}const at="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderbytes_free(t>>>0,1)));class st{static __wrap(t){t>>>=0;const e=Object.create(st.prototype);return e.__wbg_ptr=t,at.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,at.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderbytes_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return st.__wrap(t)}push(t){var e=E(t)?0:U(t,_.__wbindgen_malloc),n=y;_.pagebuilderbytes_push(this.__wbg_ptr,e,n)}}const gt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf32_free(t>>>0,1)));class dt{static __wrap(t){t>>>=0;const e=Object.create(dt.prototype);return e.__wbg_ptr=t,gt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return dt.__wrap(t)}push(t){_.pagebuilderf32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ct="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf64_free(t>>>0,1)));class wt{static __wrap(t){t>>>=0;const e=Object.create(wt.prototype);return e.__wbg_ptr=t,ct.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ct.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return wt.__wrap(t)}push(t){_.pagebuilderf64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const lt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuildergeometry_free(t>>>0,1)));class ut{static __wrap(t){t>>>=0;const e=Object.create(ut.prototype);return e.__wbg_ptr=t,lt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuildergeometry_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return ut.__wrap(t)}writeXY(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.pagebuildergeometry_writeXY(r,this.__wbg_ptr,t,e);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePBF(t,e,n,r){try{const o=_.__wbindgen_add_to_stack_pointer(-16),s=W(t,_.__wbindgen_malloc),g=y,d=G(e,_.__wbindgen_malloc),c=y;_.pagebuildergeometry_writePBF(o,this.__wbg_ptr,s,g,d,c,n,r);var i=F().getInt32(o+0,!0);if(F().getInt32(o+4,!0))throw a(i)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolygon(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolygon(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolyline(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolyline(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeMultipoint(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writeMultipoint(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeNone(){_.pagebuildergeometry_writeNone(this.__wbg_ptr)}}const bt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi32_free(t>>>0,1)));class pt{static __wrap(t){t>>>=0;const e=Object.create(pt.prototype);return e.__wbg_ptr=t,bt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return pt.__wrap(t)}push(t){_.pagebuilderi32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi64_free(t>>>0,1)));class yt{static __wrap(t){t>>>=0;const e=Object.create(yt.prototype);return e.__wbg_ptr=t,ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return yt.__wrap(t)}push(t){_.pagebuilderi64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ht="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderstring_free(t>>>0,1)));class mt{static __wrap(t){t>>>=0;const e=Object.create(mt.prototype);return e.__wbg_ptr=t,ht.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderstring_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return mt.__wrap(t)}push(t){var e=E(t)?0:I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y;_.pagebuilderstring_push(this.__wbg_ptr,e,n)}}const It="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pageencodingdescriptor_free(t>>>0,1)));class kt{static __wrap(t){t>>>=0;const e=Object.create(kt.prototype);return e.__wbg_ptr=t,It.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,It.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}encoding(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}count(){return _.pageencodingdescriptor_count(this.__wbg_ptr)}}const Ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetchunk_free(t>>>0,1)));class vt{static __wrap(t){t>>>=0;const e=Object.create(vt.prototype);return e.__wbg_ptr=t,Ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetchunk_free(t,0)}size(){return _.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(t){return 0!==_.parquetchunk_hasField(this.__wbg_ptr,t)}readX(t){return _.parquetchunk_readX(this.__wbg_ptr,t)}readY(t){return _.parquetchunk_readY(this.__wbg_ptr,t)}readCoords(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readCoords(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=T(e,n).slice(),_.__wbindgen_free(e,8*n,8)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readLengths(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readLengths(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=q(e,n).slice(),_.__wbindgen_free(e,4*n,4)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(t,e,n,r,i){const o=_.parquetchunk_readGeometryTransformed(this.__wbg_ptr,t,e,n,r,i);return 0===o?void 0:Tt.__wrap(o)}boundsXMin(t){return _.parquetchunk_boundsXMin(this.__wbg_ptr,t)}boundsYMin(t){return _.parquetchunk_boundsYMin(this.__wbg_ptr,t)}boundsXMax(t){return _.parquetchunk_boundsXMax(this.__wbg_ptr,t)}boundsYMax(t){return _.parquetchunk_boundsYMax(this.__wbg_ptr,t)}readAttribute(t,e){return a(_.parquetchunk_readAttribute(this.__wbg_ptr,t,e))}}const Rt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetfile_free(t>>>0,1)));let xt=class t{static __wrap(e){e>>>=0;const _=Object.create(t.prototype);return _.__wbg_ptr=e,Rt.register(_,_.__wbg_ptr,_),_}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetfile_free(t,0)}metadata(){const t=_.parquetfile_metadata(this.__wbg_ptr);return tt.__wrap(t)}rowGroups(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetfile_rowGroups(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(t,e){const n=B(t,_.__wbindgen_malloc),r=y;return a(_.parquetfile_readChunksWithCallback(this.__wbg_ptr,n,r,s(e)))}readFirstChunk(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readFirstChunk(this.__wbg_ptr,e,n))}readAllChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readAllChunks(this.__wbg_ptr,e,n))}updateChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_updateChunks(this.__wbg_ptr,e,n))}};const zt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_quantizedgeometry_free(t>>>0,1)));class Tt{static __wrap(t){t>>>=0;const e=Object.create(Tt.prototype);return e.__wbg_ptr=t,zt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_quantizedgeometry_free(t,0)}readCoordsUnsafe(){return a(_.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(_.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const Pt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rangeproviderjs_free(t>>>0,1)));class Mt{static __wrap(t){t>>>=0;const e=Object.create(Mt.prototype);return e.__wbg_ptr=t,Pt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rangeproviderjs_free(t,0)}static new(t,e){const n=_.rangeproviderjs_new(s(t),s(e));return Mt.__wrap(n)}static withFetch(){const t=_.rangeproviderjs_withFetch();return Mt.__wrap(t)}}const qt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rowgroup_free(t>>>0,1)));class Ot{static __wrap(t){t>>>=0;const e=Object.create(Ot.prototype);return e.__wbg_ptr=t,qt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rowgroup_free(t,0)}columns(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.rowgroup_columns(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const jt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_schemafield_free(t>>>0,1)));class Ct{static __wrap(t){t>>>=0;const e=Object.create(Ct.prototype);return e.__wbg_ptr=t,jt.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ct?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_schemafield_free(t,0)}static tryNew(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16),o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=y,g=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),d=y;_.schemafield_tryNew(i,o,s,g,d);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);if(F().getInt32(i+8,!0))throw a(r);return Ct.__wrap(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.schemafield_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}}async function Bt(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(_){if("application/wasm"==t.headers.get("Content-Type"))throw _;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",_)}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}}function At(){const t={wbg:{}};return t.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const n=I(r(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;F().setInt32(t+4,i,!0),F().setInt32(t+0,n,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let n,r;try{n=t,r=e,console.error(w(t,e))}finally{_.__wbindgen_free(n,r,1)}},t.wbg.__wbindgen_object_drop_ref=function(t){a(t)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof r(t)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===r(t)},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,e){return s(new Function(w(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return s(r(t))},t.wbg.__wbindgen_number_new=function(t){return s(t)},t.wbg.__wbindgen_string_new=function(t,e){return s(w(t,e))},t.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(t,e){return s(r(t).call(r(e)))}),arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(t,e,_){return s(r(t).call(r(e),r(_)))}),arguments)},t.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(t,e,_,n,i){return s(r(t).call(r(e),r(_),r(n),r(i)))}),arguments)},t.wbg.__wbg_valueOf_563b3487b1b116aa=function(t){return r(t).valueOf()},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){return s(r(t).buffer)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(t,e){try{var _={a:t,b:e},n=(t,e)=>{const n=_.a;_.a=0;try{return R(n,_.b,t,e)}finally{_.a=n}};return s(new Promise(n))}finally{_.a=_.b=0}},t.wbg.__wbg_resolve_570458cb99d56a43=function(t){return s(Promise.resolve(r(t)))},t.wbg.__wbg_then_95e6edc0f89b73b1=function(t,e){return s(r(t).then(r(e)))},t.wbg.__wbg_then_876bb3c633745cc6=function(t,e,_){return s(r(t).then(r(e),r(_)))},t.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(t,e,_){return s(new Int16Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_new_ea1883e1e5e86686=function(t){return s(new Uint8Array(r(t)))},t.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(t,e,_){return s(new Uint32Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(t){return r(t).length},t.wbg.__wbg_set_d1e79e2388520f18=function(t,e,_){r(t).set(r(e),_>>>0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(w(t,e))},t.wbg.__wbindgen_memory=function(){return s(_.memory)},t.wbg.__wbindgen_array_new=function(){return s([])},t.wbg.__wbindgen_array_push=function(t,e){r(t).push(a(e))},t.wbg.__wbindgen_uint8_array_new=function(t,e){var n=l(t,e).slice();_.__wbindgen_free(t,1*e,1);return s(n)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(t){return s(r(t).queueMicrotask)},t.wbg.__wbindgen_cb_drop=function(t){const e=a(t).original;if(1==e.cnt--)return e.a=0,!0;return!1},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(t){queueMicrotask(r(t))},t.wbg.__wbg_parquetchunk_new=function(t){return s(vt.__wrap(t))},t.wbg.__wbg_parquetfile_new=function(t){return s(xt.__wrap(t))},t.wbg.__wbg_filemetadata_new=function(t){return s(tt.__wrap(t))},t.wbg.__wbg_fieldmetadata_new=function(t){return s(H.__wrap(t))},t.wbg.__wbg_rowgroup_new=function(t){return s(Ot.__wrap(t))},t.wbg.__wbg_schemafield_unwrap=function(t){return Ct.__unwrap(a(t))},t.wbg.__wbg_columndescriptor_new=function(t){return s(Q.__wrap(t))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return s(kt.__wrap(t))},t.wbg.__wbindgen_closure_wrapper1832=function(t,e,_){return s(b(t,e,163,p))},t}function St(t,e){return _=t.exports,Gt.__wbindgen_wasm_module=e,k=null,x=null,j=null,P=null,d=null,_.__wbindgen_start(),_}function Wt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=At();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return St(new WebAssembly.Instance(t,e),t)}async function Gt(t){if(void 0!==_)return _;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 e=At();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bt(await t,e);return St(n,r)}const Et=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:Q,CompressMode:X,FieldMetadata:H,FileMetadata:tt,FileWriter:_t,GeometryInfoDescriptor:rt,GeometryType:Y,MultiScaleInfo:ot,PageBuilderBytes:st,PageBuilderF32:dt,PageBuilderF64:wt,PageBuilderGeometry:ut,PageBuilderI32:pt,PageBuilderI64:yt,PageBuilderString:mt,PageEncodingDescriptor:kt,ParquetChunk:vt,ParquetFile:xt,QuantizedGeometry:Tt,RangeProviderJs:Mt,RowGroup:Ot,SchemaField:Ct,default:Gt,enable_tracing:f,initSync:Wt,readFile:V,readFileFromBinary:N,readMetadata:D,readMetadataFromFile:L},Symbol.toStringTag,{value:"Module"}));let Ut=null;async function Dt(){return Ut||(Ut=Lt()),Ut}async function Lt(){const e=await Promise.resolve().then((()=>Et));return await e.default({module_or_path:t("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),e}const Vt=t=>async function(_,n,r){const i=t(),{data:o}=await e(_,{responseType:"array-buffer",query:i,headers:{range:`bytes=${n}-${r}`},useRequestQueue:!0});return o},Nt=t=>async function(_){const n=t(),{data:r}=await e(_,{responseType:"native",method:"head",query:n,useRequestQueue:!0}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Xt{static async create(t,e){const _=await Dt(),n=await _.readMetadata(t,Vt(e),Nt(e));return Xt.fromFileMetadata(n)}static fromFileMetadata(t){const e=[];for(let _=0;_<t.numFields();_++){const n=t.getFieldByIndex(_);e.push({name:n.name,type:n.type,alias:n.name,index:n.index}),n.free()}return new Xt(t,e)}constructor(t,e){this._inner=t,this.fields=e}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(t){return this._inner.getFieldIndex(t)}tryReadGeoMetadata(){const t=this._inner.keyValueMetadata("geo");return null==t?null:JSON.parse(t)}tryReadEsriMetadata(){const t=this._inner.keyValueMetadata("esri");return null==t?null:JSON.parse(t)}}function Yt(t){switch(t){case"esriGeometryPoint":return Y.Point;case"esriGeometryPolygon":return Y.Polygon;case"esriGeometryPolyline":return Y.Polyline;case"esriGeometryMultipoint":return Y.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${t}`)}}function $t(t,e,_){const n=rt.new();if(n.geometryType=Yt(t.geometryType),"location"===t.type)n.latIndex=e.getFieldIndex(t.latitudeFieldName),n.lngIndex=e.getFieldIndex(t.longitudeFieldName);else{if(null==t.primaryFieldName)throw new Error("InternalError: A primary field name or set of location fields must be defined");if(n.wkbIndex=e.getFieldIndex(t.primaryFieldName),t.multiscale){const _=ot.new();for(const n of t.multiscale.levels){const[t,r]=n.transform.translate,[i,o]=n.transform.scale,a=e.getFieldIndex(n.column);_.push(a,t,r,i,o)}n.setMultiscaleInfo(_)}}return n.inWkid=t.spatialReference.wkid,_&&(n.outWkid=_.wkid),n}class Jt{static async create(t,e){const _=await Dt(),n=Vt(e.getCustomParameters),r=Nt(e.getCustomParameters),i=await D(t,n,r),o=$t(e.geometryInfo,i,e.outSpatialReference),a=await _.readFile(t,n,r,i,o);return new Jt(a,Xt.fromFileMetadata(a.metadata()))}static async fromFile(t,e,_){const n=await Dt(),r=await n.readMetadataFromFile(t),i=e?$t(e,r,_):void 0,o=await n.readFileFromBinary(i,t);return new Jt(o,Xt.fromFileMetadata(o.metadata()))}constructor(t,e){this.inner=t,this.metadata=e}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Jt as ParquetFile,Xt as ParquetMetadata};
|
package/package.json
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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../core/accessorSupport/decorators/writer.js";import{ensureType as p,ensureString as c}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as m,collectField as d}from"../layers/support/fieldUtils.js";import h from"./Renderer.js";import{VisualVariablesMixin as f}from"./mixins/VisualVariablesMixin.js";import y from"./support/ClassBreakInfo.js";import{rendererBackgroundFillSymbolProperty as g,rendererSymbolProperty as x}from"./support/commonProperties.js";import b from"./support/RendererLegendOptions.js";import{loadArcade as k}from"../support/
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../core/accessorSupport/decorators/writer.js";import{ensureType as p,ensureString as c}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as m,collectField as d}from"../layers/support/fieldUtils.js";import h from"./Renderer.js";import{VisualVariablesMixin as f}from"./mixins/VisualVariablesMixin.js";import y from"./support/ClassBreakInfo.js";import{rendererBackgroundFillSymbolProperty as g,rendererSymbolProperty as x}from"./support/commonProperties.js";import b from"./support/RendererLegendOptions.js";import{loadArcade as k}from"../support/loadArcade.js";import{ensureType as I}from"../symbols/support/typeUtils.js";var v;const B="log",F="percent-of-total",V="field",S=new s({esriNormalizeByLog:B,esriNormalizeByPercentOfTotal:F,esriNormalizeByField:V}),E=p(y);let j=v=class extends(f(h)){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,s,t){if(!Array.isArray(e))return;let o=s.minValue;return e.map((e=>{const s=new y;return s.read(e,t),null==s.minValue&&(s.minValue=o),null==s.maxValue&&(s.maxValue=s.minValue),o=s.maxValue,s}))}writeClassBreakInfos(e,s,t,o){const i=e.map((e=>e.write({},o)));this._areClassBreaksConsecutive()&&i.forEach((e=>delete e.classMinValue)),s[t]=i}castField(e){return null==e?e:"function"==typeof e?(o.getLogger(this).error(".field: field must be a string value"),null):c(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const s=!!this.normalizationField,t=null!=this.normalizationTotal;return s||t?(e=s&&V||t&&F||null,s&&t&&o.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==V&&e!==F||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,s,o){let i=null;i="number"==typeof e?new y({minValue:e,maxValue:s,symbol:I(o)}):E(t(e)),this.classBreakInfos.push(i),1===this.classBreakInfos.length&&this.notifyChange("minValue")}removeClassBreakInfo(e,s){const t=this.classBreakInfos.length;for(let o=0;o<t;o++){const t=[this.classBreakInfos[o].minValue,this.classBreakInfos[o].maxValue];if(t[0]===e&&t[1]===s){this.classBreakInfos.splice(o,1);break}}}getBreakIndex(e,s){return this.valueExpression&&null==s?.arcade&&o.getLogger(this).warn(""),this.valueExpression?this._getBreakIndexForExpression(e,s):this._getBreakIndexForField(e)}async getClassBreakInfo(e,s){let t=s;this.valueExpression&&null==s?.arcade&&(t={...t,arcade:await k()});const o=this.getBreakIndex(e,t);return-1!==o?this.classBreakInfos[o]:null}getSymbol(e,s){if(this.valueExpression&&null==s?.arcade)return void o.getLogger(this).error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const t=this.getBreakIndex(e,s);return t>-1?this.classBreakInfos[t].symbol:this.defaultSymbol}async getSymbolAsync(e,s){let t=s;if(this.valueExpression&&null==s?.arcade){const e=await k(),{arcadeUtils:s}=e;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),t={...t,arcade:e}}const o=this.getBreakIndex(e,t);return o>-1?this.classBreakInfos[o].symbol:this.defaultSymbol}get symbols(){const e=[];return this.classBreakInfos.forEach((s=>{s.symbol&&e.push(s.symbol)})),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce(((e,s)=>e+s.getAttributeHash()),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),s=JSON.stringify(this.defaultSymbol),t=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${s}.${this.classBreakInfos.reduce(((e,s)=>e+s.getMeshHash()),"")}.${t}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new v({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:t(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:t(this.visualVariables),legendOptions:t(this.legendOptions),authoringInfo:t(this.authoringInfo)})}async collectRequiredFields(e,s){const t=[this.collectVVRequiredFields(e,s),this.collectSymbolFields(e,s)];await Promise.all(t)}async collectSymbolFields(e,s){const t=[...this.symbols.map((t=>t.collectRequiredFields(e,s))),m(e,s,this.valueExpression)];d(e,s,this.field),d(e,s,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(e,s){const{viewingMode:t,scale:o,spatialReference:i,arcade:r,timeZone:a}=s??{},{valueExpression:l}=this;let n=this._compiledValueExpression.valueExpression===l?this._compiledValueExpression.compiledFunction:null;const u=r.arcadeUtils;if(!n){const e=u.createSyntaxTree(l);n=u.createFunction(e),this._compiledValueExpression.compiledFunction=n}this._compiledValueExpression.valueExpression=l;const p=u.executeFunction(n,u.createExecContext(e,u.getViewInfo({viewingMode:t,scale:o,spatialReference:i}),a));return this._getBreakIndexfromInfos(p)}_getBreakIndexForField(e){const s=this.field,t=e.attributes,o=this.normalizationType;let i=parseFloat(t[s]);if(o){const e=this.normalizationTotal,s=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(o===B)i=Math.log(i)*Math.LOG10E;else if(o!==F||null==e||isNaN(e)){if(o===V&&!isNaN(s)){if(isNaN(i)||isNaN(s))return-1;i/=s}}else i=i/e*100}return this._getBreakIndexfromInfos(i)}_getBreakIndexfromInfos(e){const s=this.isMaxInclusive;if(null!=e&&"number"==typeof e&&!isNaN(e))for(let t=0;t<this.classBreakInfos.length;t++){const o=[this.classBreakInfos[t].minValue,this.classBreakInfos[t].maxValue];if(o[0]<=e&&(s?e<=o[1]:e<o[1]))return t}return-1}_areClassBreaksConsecutive(){const e=this.classBreakInfos,s=e.length;for(let t=1;t<s;t++)if(e[t-1].maxValue!==e[t].minValue)return!1;return!0}};e([i(g)],j.prototype,"backgroundFillSymbol",void 0),e([i({type:[y],json:{write:{isRequired:!0}}})],j.prototype,"classBreakInfos",void 0),e([l("classBreakInfos")],j.prototype,"readClassBreakInfos",null),e([u("classBreakInfos")],j.prototype,"writeClassBreakInfos",null),e([i({type:String,json:{write:!0}})],j.prototype,"defaultLabel",void 0),e([i(x)],j.prototype,"defaultSymbol",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"field",void 0),e([r("field")],j.prototype,"castField",null),e([i({type:Boolean})],j.prototype,"isMaxInclusive",void 0),e([i({type:b,json:{write:!0}})],j.prototype,"legendOptions",void 0),e([i({type:Number,readOnly:!0,value:null,json:{read:!1,write:{overridePolicy(){return 0!==this.classBreakInfos.length&&this._areClassBreaksConsecutive()?{enabled:!0}:{enabled:!1}}}}})],j.prototype,"minValue",null),e([i({type:String,json:{write:!0}})],j.prototype,"normalizationField",void 0),e([i({type:Number,json:{write:!0}})],j.prototype,"normalizationTotal",void 0),e([i({type:S.apiValues,value:null,json:{type:S.jsonValues,read:S.read,write:S.write}})],j.prototype,"normalizationType",null),e([a({classBreaks:"class-breaks"})],j.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"valueExpression",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"valueExpressionTitle",void 0),j=v=e([n("esri.renderers.ClassBreaksRenderer")],j);const w=j;export{w 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as r}from"../chunks/tslib.es6.js";import e from"../request.js";import{clone as s}from"../core/lang.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{writer as o}from"../core/accessorSupport/decorators/writer.js";import{collectArcadeFieldNames as n}from"../layers/support/fieldUtils.js";import a from"./Renderer.js";import{VisualVariablesMixin as l}from"./mixins/VisualVariablesMixin.js";import{DictionaryLoader as c}from"./support/DictionaryLoader.js";var p;let u=p=class extends(l(a)){constructor(r){super(r),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){const r=this.getDictionaryInfo();return new c(this.url,this.config,this.fieldMap??{},r)}writeData(r,e){r&&(e.scalingExpressionInfo={expression:r,returnType:"number"})}writeVisualVariables(r,e,s,t){t?.origin||super.writeVisualVariables(r,e,s,t)}clone(){return new p({config:s(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:s(this.fieldMap),url:s(this.url),visualVariables:s(this.visualVariables)})}async getSymbolAsync(r,e,s=!0){return this._loader.getSymbolAsync(r,e,s)}async getSymbolForControlString(r,e,s){return this._loader.getSymbolForControlString(r,e,s)}getDictionaryInfo(){return this._dictionaryInfoPromise||(this._dictionaryInfoPromise=this._fetchDictionaryInfo()),this._dictionaryInfoPromise}async collectRequiredFields(r,e){await this.collectVVRequiredFields(r,e),this.scaleExpression&&await n(r,e,this.scaleExpression);for(const s in this.fieldMap){const t=this.fieldMap[s];e.has(t)&&r.add(t)}}get arcadeRequired(){return!0}getSymbol(){return null}get symbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce(((r,e)=>r+e.getAttributeHash()),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}async _fetchDictionaryInfo(){const{data:r}=await e(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"}});return r}};r([t({type:c})],u.prototype,"_loader",null),r([t({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],u.prototype,"config",void 0),r([t({type:Object,json:{write:!0}})],u.prototype,"fieldMap",void 0),r([t({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],u.prototype,"scaleExpression",void 0),r([o("scaleExpression")],u.prototype,"writeData",null),r([t({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(r){return{enabled:!!r&&!!this.scaleExpression}}}}})],u.prototype,"scaleExpressionTitle",void 0),r([t({type:String,json:{write:!0}})],u.prototype,"url",void 0),r([o("visualVariables")],u.prototype,"writeVisualVariables",null),u=p=r([i("esri.renderers.DictionaryRenderer")],u);const d=u;export{d 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as s}from"../core/lang.js";import i from"../core/Logger.js";import{deepMerge as o}from"../core/object.js";import{watch as l}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{enumeration as n}from"../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import{diff as d}from"../core/accessorSupport/diffUtils.js";import{ensureType as c,ensureString as h}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as m,collectField as y}from"../layers/support/fieldUtils.js";import b from"../portal/Portal.js";import v from"./Renderer.js";import{VisualVariablesMixin as _}from"./mixins/VisualVariablesMixin.js";import{rendererSymbolProperty as V,rendererBackgroundFillSymbolProperty as q}from"./support/commonProperties.js";import g from"./support/RendererLegendOptions.js";import I from"./support/UniqueValue.js";import S from"./support/UniqueValueClass.js";import w from"./support/UniqueValueGroup.js";import U from"./support/UniqueValueInfo.js";import{loadArcade as j}from"../support/arcadeOnDemand.js";import{f as F,t as O}from"../chunks/persistableUrlUtils.js";import G from"../symbols/WebStyleSymbol.js";import{fetchStyle as D}from"../symbols/support/styleUtils.js";import{ensureType as x}from"../symbols/support/typeUtils.js";var E;const M="esri.renderers.UniqueValueRenderer",R=()=>i.getLogger(M),N="uvInfos-watcher",P="uvGroups-watcher",C=",",$=c(U);function z(e){const{field1:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueInfos:l,valueExpression:r}=e,u=!(!t||!s);return[{classes:(l??[]).map((e=>{const{symbol:l,label:n,value:a,description:p}=e,[f,d,c]=u?a?.toString()?.split(o||"")||[]:[a],h=[];return(t||r)&&h.push(f),s&&h.push(d),i&&h.push(c),{symbol:l,label:n,values:[h],description:p}}))}]}function L(e){return null!=e&&""!==e&&("string"!=typeof e||""!==e.trim()&&"<null>"!==e.toLowerCase())||(e=null),e+""}let k=E=class extends(_(v)){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,t){if(!e&&!t)return;if(!e||!t)return{type:"complete",oldValue:e,newValue:t};let s=!1;const i={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let o=0;o<t.length;o++){const l=e.find((e=>e.value===t[o].value));l?d(l,t[o])?(i.changed.push({type:"complete",oldValue:l,newValue:t[o]}),s=!0):i.unchanged.push({oldValue:l,newValue:t[o]}):(i.added.push(t[o]),s=!0)}for(let o=0;o<e.length;o++){t.find((t=>t.value===e[o].value))||(i.removed.push(e[o]),s=!0)}return s?i:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return null==e||"function"==typeof e?e:h(e)}writeField(e,s,i,o){"string"==typeof e?s[i]=e:o?.messages?o.messages.push(new t("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):R().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,s){return s.portal||b.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const e=F(t.styleUrl,s);return Object.freeze({styleUrl:e})}}writeStyleOrigin(e,t,s,i){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=O(e.styleUrl,i))}set uniqueValueGroups(e){this.styleOrigin?R().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?R().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void R().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let s;s="object"==typeof e?$(e):new U({value:e,symbol:x(t)}),this.uniqueValueInfos?.push(s),this._valueInfoMap[L(s.value)]=s,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void R().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;s<t.length;s++){const i=t[s];if(String(i.value)===String(e)){delete this._valueInfoMap[L(e)],t.splice(s,1);break}}this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}async getUniqueValueInfo(e,t){let s=t;return this.valueExpression&&null==t?.arcade&&(s={...s,arcade:await j()}),this._getUniqueValueInfo(e,s)}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void R().error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const s=this._getUniqueValueInfo(e,t);return s?.symbol||this.defaultSymbol}async getSymbolAsync(e,t){let s=t;if(this.valueExpression&&null==s?.arcade){const e=await j(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),s={...s,arcade:e}}const i=this._getUniqueValueInfo(e,s);return i?.symbol||this.defaultSymbol}get symbols(){const e=[];for(const t of this.uniqueValueInfos??[])t.symbol&&e.push(t.symbol);return this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=this.uniqueValueInfos?.reduce(((e,t)=>e+t.getMeshHash()),"");return`${e}.${t}.${s}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new E({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:s(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:s(this.visualVariables),legendOptions:s(this.legendOptions),authoringInfo:s(this.authoringInfo),backgroundFillSymbol:s(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=s(this.uniqueValueInfos),i=s(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(s(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.symbols.map((s=>s.collectRequiredFields(e,t))),m(e,t,this.valueExpression)];y(e,t,this.field),y(e,t,this.field2),y(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return D(this.styleOrigin,{portal:this.portal}).then((e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach((s=>{const i=new G({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=i,this._isDefaultSymbolDerived=!0);const o=new U({value:s.name,symbol:i});t.push(o),this._valueInfoMap[L(s.name)]=o})),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this}))}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",C)}_updateUniqueValues(){null!=this._isInfosSource&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[L(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(N);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(l((()=>({symbol:s.symbol,value:s.value,label:s.label,description:s.description})),((e,t)=>{e!==t&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)}),{sync:!0}));this.addHandles(t,N)}}_watchUniqueValueGroups(){this.removeHandles(P);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(l((()=>({classes:s.classes})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}));for(const e of s.classes??[])t.push(l((()=>({symbol:e.symbol,values:e.values,label:e.label,description:e.description})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}))}this.addHandles(t,P)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueGroups:l,valueExpression:r}=this;if(!t&&!r)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const u=!(!t||!s);for(const n of l)for(const t of n.classes??[]){const{symbol:l,label:r,values:n,description:a}=t;for(const t of n??[]){const{value:n,value2:p,value3:f}=t,d=[n];s&&d.push(p),i&&d.push(f);const c=u?d.join(o||""):d[0]??void 0;e.push(new U({symbol:l,label:r,value:c,description:a}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:s,valueExpression:i,fieldDelimiter:o,uniqueValueInfos:l}=this;if(!t&&!i||!l.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const r=!(!t||!s),u=l.map((e=>{const{symbol:t,label:s,value:i,description:l}=e,[u,n,a]=r?i?.toString()?.split(o||"")||[]:[i];return new S({symbol:t,label:s,description:l,values:[new I({value:u,value2:n,value3:a})]})})),n=[new w({classes:u})];e&&Object.freeze(n),this._set("uniqueValueGroups",n),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:i,spatialReference:o,arcade:l,timeZone:r}=t??{};let u=this._cache.compiledFunc;const n=l.arcadeUtils;if(!u){const e=n.createSyntaxTree(this.valueExpression);u=n.createFunction(e),this._cache.compiledFunc=u}const a=n.executeFunction(u,n.createExecContext(e,n.getViewInfo({viewingMode:s,scale:i,spatialReference:o}),r));return this._valueInfoMap[L(a)]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let i;if(this.field2){const e=this.field2,o=this.field3,l=[];t&&l.push(s[t]),e&&l.push(s[e]),o&&l.push(s[o]),i=l.join(this.fieldDelimiter||"")}else t&&(i=s[t]);return this._valueInfoMap[L(i)]}static fromPortalStyle(e,t){const s=new E(t?.properties);s._set("styleOrigin",Object.freeze({styleName:e})),s._set("portal",t?.portal||b.getDefault());const i=s.populateFromStyle();return i.catch((t=>{R().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",t)})),i}static fromStyleUrl(e,t){const s=new E(t?.properties);s._set("styleOrigin",Object.freeze({styleUrl:e}));const i=s.populateFromStyle();return i.catch((t=>{R().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",t)})),i}};e([r({readOnly:!0})],k.prototype,"_cache",null),e([n({uniqueValue:"unique-value"})],k.prototype,"type",void 0),e([r(q)],k.prototype,"backgroundFillSymbol",void 0),e([r({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],k.prototype,"field",null),e([u("field")],k.prototype,"castField",null),e([f("field")],k.prototype,"writeField",null),e([r({type:String,value:null,json:{write:!0}})],k.prototype,"field2",null),e([r({type:String,value:null,json:{write:!0}})],k.prototype,"field3",null),e([r({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],k.prototype,"orderByClassesEnabled",void 0),e([r({type:String,value:null,json:{write:!0}})],k.prototype,"valueExpression",null),e([r({type:String,json:{write:!0}})],k.prototype,"valueExpressionTitle",void 0),e([r({type:g,json:{write:!0}})],k.prototype,"legendOptions",void 0),e([r({type:String,json:{write:!0}})],k.prototype,"defaultLabel",void 0),e([r(o({...V},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],k.prototype,"defaultSymbol",null),e([r({type:String,value:null,json:{write:!0}})],k.prototype,"fieldDelimiter",null),e([r({type:b,readOnly:!0})],k.prototype,"portal",void 0),e([a("portal",["styleName"])],k.prototype,"readPortal",null),e([r({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],k.prototype,"styleOrigin",void 0),e([a("styleOrigin",["styleName","styleUrl"])],k.prototype,"readStyleOrigin",null),e([f("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],k.prototype,"writeStyleOrigin",null),e([r({type:[w],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||z(t)).map((e=>w.fromJSON(e,s)))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],k.prototype,"uniqueValueGroups",null),e([r({type:[U],json:{read:!1,write:{isRequired:!0,overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0,isRequired:!0}}}}})],k.prototype,"uniqueValueInfos",null),k=E=e([p(M)],k);const A=k;export{A as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as s}from"../core/lang.js";import i from"../core/Logger.js";import{deepMerge as o}from"../core/object.js";import{watch as l}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{enumeration as n}from"../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import{diff as d}from"../core/accessorSupport/diffUtils.js";import{ensureType as c,ensureString as h}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as m,collectField as y}from"../layers/support/fieldUtils.js";import b from"../portal/Portal.js";import v from"./Renderer.js";import{VisualVariablesMixin as _}from"./mixins/VisualVariablesMixin.js";import{rendererSymbolProperty as V,rendererBackgroundFillSymbolProperty as q}from"./support/commonProperties.js";import g from"./support/RendererLegendOptions.js";import I from"./support/UniqueValue.js";import S from"./support/UniqueValueClass.js";import w from"./support/UniqueValueGroup.js";import U from"./support/UniqueValueInfo.js";import{loadArcade as j}from"../support/loadArcade.js";import{f as F,t as O}from"../chunks/persistableUrlUtils.js";import G from"../symbols/WebStyleSymbol.js";import{fetchStyle as D}from"../symbols/support/styleUtils.js";import{ensureType as x}from"../symbols/support/typeUtils.js";var E;const M="esri.renderers.UniqueValueRenderer",R=()=>i.getLogger(M),N="uvInfos-watcher",P="uvGroups-watcher",C=",",$=c(U);function z(e){const{field1:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueInfos:l,valueExpression:r}=e,u=!(!t||!s);return[{classes:(l??[]).map((e=>{const{symbol:l,label:n,value:a,description:p}=e,[f,d,c]=u?a?.toString()?.split(o||"")||[]:[a],h=[];return(t||r)&&h.push(f),s&&h.push(d),i&&h.push(c),{symbol:l,label:n,values:[h],description:p}}))}]}function A(e){return null!=e&&""!==e&&("string"!=typeof e||""!==e.trim()&&"<null>"!==e.toLowerCase())||(e=null),e+""}let L=E=class extends(_(v)){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,t){if(!e&&!t)return;if(!e||!t)return{type:"complete",oldValue:e,newValue:t};let s=!1;const i={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let o=0;o<t.length;o++){const l=e.find((e=>e.value===t[o].value));l?d(l,t[o])?(i.changed.push({type:"complete",oldValue:l,newValue:t[o]}),s=!0):i.unchanged.push({oldValue:l,newValue:t[o]}):(i.added.push(t[o]),s=!0)}for(let o=0;o<e.length;o++){t.find((t=>t.value===e[o].value))||(i.removed.push(e[o]),s=!0)}return s?i:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return null==e||"function"==typeof e?e:h(e)}writeField(e,s,i,o){"string"==typeof e?s[i]=e:o?.messages?o.messages.push(new t("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):R().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,s){return s.portal||b.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const e=F(t.styleUrl,s);return Object.freeze({styleUrl:e})}}writeStyleOrigin(e,t,s,i){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=O(e.styleUrl,i))}set uniqueValueGroups(e){this.styleOrigin?R().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?R().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void R().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let s;s="object"==typeof e?$(e):new U({value:e,symbol:x(t)}),this.uniqueValueInfos?.push(s),this._valueInfoMap[A(s.value)]=s,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void R().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;s<t.length;s++){const i=t[s];if(String(i.value)===String(e)){delete this._valueInfoMap[A(e)],t.splice(s,1);break}}this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}async getUniqueValueInfo(e,t){let s=t;return this.valueExpression&&null==t?.arcade&&(s={...s,arcade:await j()}),this._getUniqueValueInfo(e,s)}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void R().error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const s=this._getUniqueValueInfo(e,t);return s?.symbol||this.defaultSymbol}async getSymbolAsync(e,t){let s=t;if(this.valueExpression&&null==s?.arcade){const e=await j(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),s={...s,arcade:e}}const i=this._getUniqueValueInfo(e,s);return i?.symbol||this.defaultSymbol}get symbols(){const e=[];for(const t of this.uniqueValueInfos??[])t.symbol&&e.push(t.symbol);return this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=this.uniqueValueInfos?.reduce(((e,t)=>e+t.getMeshHash()),"");return`${e}.${t}.${s}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new E({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:s(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:s(this.visualVariables),legendOptions:s(this.legendOptions),authoringInfo:s(this.authoringInfo),backgroundFillSymbol:s(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=s(this.uniqueValueInfos),i=s(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(s(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.symbols.map((s=>s.collectRequiredFields(e,t))),m(e,t,this.valueExpression)];y(e,t,this.field),y(e,t,this.field2),y(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return D(this.styleOrigin,{portal:this.portal}).then((e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach((s=>{const i=new G({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=i,this._isDefaultSymbolDerived=!0);const o=new U({value:s.name,symbol:i});t.push(o),this._valueInfoMap[A(s.name)]=o})),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this}))}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",C)}_updateUniqueValues(){null!=this._isInfosSource&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[A(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(N);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(l((()=>({symbol:s.symbol,value:s.value,label:s.label,description:s.description})),((e,t)=>{e!==t&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)}),{sync:!0}));this.addHandles(t,N)}}_watchUniqueValueGroups(){this.removeHandles(P);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(l((()=>({classes:s.classes})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}));for(const e of s.classes??[])t.push(l((()=>({symbol:e.symbol,values:e.values,label:e.label,description:e.description})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}))}this.addHandles(t,P)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueGroups:l,valueExpression:r}=this;if(!t&&!r)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const u=!(!t||!s);for(const n of l)for(const t of n.classes??[]){const{symbol:l,label:r,values:n,description:a}=t;for(const t of n??[]){const{value:n,value2:p,value3:f}=t,d=[n];s&&d.push(p),i&&d.push(f);const c=u?d.join(o||""):d[0]??void 0;e.push(new U({symbol:l,label:r,value:c,description:a}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:s,valueExpression:i,fieldDelimiter:o,uniqueValueInfos:l}=this;if(!t&&!i||!l.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const r=!(!t||!s),u=l.map((e=>{const{symbol:t,label:s,value:i,description:l}=e,[u,n,a]=r?i?.toString()?.split(o||"")||[]:[i];return new S({symbol:t,label:s,description:l,values:[new I({value:u,value2:n,value3:a})]})})),n=[new w({classes:u})];e&&Object.freeze(n),this._set("uniqueValueGroups",n),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:i,spatialReference:o,arcade:l,timeZone:r}=t??{};let u=this._cache.compiledFunc;const n=l.arcadeUtils;if(!u){const e=n.createSyntaxTree(this.valueExpression);u=n.createFunction(e),this._cache.compiledFunc=u}const a=n.executeFunction(u,n.createExecContext(e,n.getViewInfo({viewingMode:s,scale:i,spatialReference:o}),r));return this._valueInfoMap[A(a)]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let i;if(this.field2){const e=this.field2,o=this.field3,l=[];t&&l.push(s[t]),e&&l.push(s[e]),o&&l.push(s[o]),i=l.join(this.fieldDelimiter||"")}else t&&(i=s[t]);return this._valueInfoMap[A(i)]}static fromPortalStyle(e,t){const s=new E(t?.properties);s._set("styleOrigin",Object.freeze({styleName:e})),s._set("portal",t?.portal||b.getDefault());const i=s.populateFromStyle();return i.catch((t=>{R().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",t)})),i}static fromStyleUrl(e,t){const s=new E(t?.properties);s._set("styleOrigin",Object.freeze({styleUrl:e}));const i=s.populateFromStyle();return i.catch((t=>{R().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",t)})),i}};e([r({readOnly:!0})],L.prototype,"_cache",null),e([n({uniqueValue:"unique-value"})],L.prototype,"type",void 0),e([r(q)],L.prototype,"backgroundFillSymbol",void 0),e([r({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],L.prototype,"field",null),e([u("field")],L.prototype,"castField",null),e([f("field")],L.prototype,"writeField",null),e([r({type:String,value:null,json:{write:!0}})],L.prototype,"field2",null),e([r({type:String,value:null,json:{write:!0}})],L.prototype,"field3",null),e([r({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],L.prototype,"orderByClassesEnabled",void 0),e([r({type:String,value:null,json:{write:!0}})],L.prototype,"valueExpression",null),e([r({type:String,json:{write:!0}})],L.prototype,"valueExpressionTitle",void 0),e([r({type:g,json:{write:!0}})],L.prototype,"legendOptions",void 0),e([r({type:String,json:{write:!0}})],L.prototype,"defaultLabel",void 0),e([r(o({...V},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],L.prototype,"defaultSymbol",null),e([r({type:String,value:null,json:{write:!0}})],L.prototype,"fieldDelimiter",null),e([r({type:b,readOnly:!0})],L.prototype,"portal",void 0),e([a("portal",["styleName"])],L.prototype,"readPortal",null),e([r({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],L.prototype,"styleOrigin",void 0),e([a("styleOrigin",["styleName","styleUrl"])],L.prototype,"readStyleOrigin",null),e([f("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],L.prototype,"writeStyleOrigin",null),e([r({type:[w],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||z(t)).map((e=>w.fromJSON(e,s)))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],L.prototype,"uniqueValueGroups",null),e([r({type:[U],json:{read:!1,write:{isRequired:!0,overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0,isRequired:!0}}}}})],L.prototype,"uniqueValueInfos",null),L=E=e([p(M)],L);const k=L;export{k as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../Color.js";class t{static parse(e,r,n){const l=[],o=[],u=e.split(";");for(let t=0;t<u.length;t++){const e=u[t];if(e)if(e.includes("po:")){const t=e.slice(3).split("|");if(3===t.length){const[e,r,i]=t,n=s(e,r,i);o.push(n)}}else if(e.includes("|")){for(const t of e.split("|"))if(r.has(t)){l.push(t);break}}else if(r.has(e))l.push(e);else if(0===t){l.length=0,l.push(i(n));break}}return new t(l,o)}constructor(e,t){this.partNames=e,this.overrides=t}}function r(t,r){if("DashTemplate"===t)return r.split(" ").map((e=>Number(e)));if("Color"===t){const t=new e(r).toRgba();return[t[0],t[1],t[2],255*t[3]]}return Number(r)}function s(e,t,s){return{primitiveName:e,propertyName:t,value:r(t,s),defaultValue:null}}function i(e){switch(e){case"esriGeometryPolyline":return"Invalid_L";case"esriGeometryPolygon":return"Invalid_A";default:return"Invalid_P"}}export{t as DictionaryControlString};
|