@arcgis/core 4.34.0-next.23 → 4.34.0-next.24
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/parser.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/026fbeb0ff5b9e6c74df.js +1 -0
- package/assets/esri/core/workers/chunks/234cbc290b074eeb5dd6.js +1 -0
- package/assets/esri/core/workers/chunks/{00eef04fd026adaf0df8.js → 36a2a8b6547604bad2ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{63cc4647b7775ff8aedf.js → 44d28849e59f62616e72.js} +1 -1
- package/assets/esri/core/workers/chunks/4c47d327815e281c457e.js +1 -0
- package/assets/esri/core/workers/chunks/{6bb1ecaa0afc2c7de79e.js → 4cc3eeb0b824c53793d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{19ae76283a0cb0fe4dee.js → 4ea96aff38bb301dc40d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cab1a1067f44ce374673.js → 7d7f8f2936ddee65e3da.js} +1 -1
- package/assets/esri/core/workers/chunks/{b57c0ef7bc57e3c91257.js → 865fccacf44ae5b70eba.js} +1 -1
- package/assets/esri/core/workers/chunks/{f43110391f124b8a179c.js → 909a6218db87cba2c9ba.js} +1 -1
- package/assets/esri/core/workers/chunks/a273f80298417edecc07.js +1 -0
- package/assets/esri/core/workers/chunks/{496e02cfe3d84010f675.js → a2ed7a3cd518dd136ec7.js} +1 -1
- package/assets/esri/core/workers/chunks/b32c1b60896a72e0ae90.js +1 -0
- package/assets/esri/core/workers/chunks/{6782114a752b9cc59168.js → b6b8272a74a5c24a6b86.js} +1 -1
- package/assets/esri/core/workers/chunks/b9f66d735a7e63417b3d.js +1 -0
- package/assets/esri/core/workers/chunks/d2ce360961ca4b58666c.js +1 -0
- package/assets/esri/core/workers/chunks/fe1902d63f610cebd947.js +1 -0
- package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/index.js +1 -1
- package/config.js +1 -1
- package/core/MemCachePool.js +1 -1
- package/core/accessorSupport/overrideDefaultsFrom.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/interfaces.d.ts +70 -2
- package/kernel.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/bestImageUtils.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +1 -1
- package/package.json +1 -1
- package/renderers/support/DictionaryControlString.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/images/heading-rotate-svg.js +1 -1
- package/views/3d/analysis/images/tilt-rotate-svg.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/MultipointDrawAction.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/magnifier/mask-svg.js +1 -1
- package/views/magnifier/overlay-svg.js +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/0ba6177ba118a0f032e2.js +0 -1
- package/assets/esri/core/workers/chunks/573a8393bec916dcf16f.js +0 -1
- package/assets/esri/core/workers/chunks/81006d9eed65bbb82962.js +0 -1
- package/assets/esri/core/workers/chunks/9f91d519da67714f915f.js +0 -1
- package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +0 -1
- package/assets/esri/core/workers/chunks/cd64181298d82c8d0e9d.js +0 -1
- package/assets/esri/core/workers/chunks/def8a854a05f17d3538e.js +0 -1
- package/assets/esri/core/workers/chunks/f3d5d92e0aefc2593208.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{ar as o,i as u,d as m,P as l,b as c,as as d,m as _}from"../../../chunks/Point2D.js";import{aA as h,a as f,aB as p,aC as k,c as b,R as y,aD as N,aE as T,aF as g}from"../../../chunks/ProjectionTransformation.js";import{D as v,I as x,P as A,E as S,y as w,z as C,J as D,K as F,t as j}from"../../../chunks/Envelope.js";import{a as z,P as O,S as I,M as E,y as B,z as P,A as V,B as M,F as R,H as U}from"../../../chunks/MultiPathImpl.js";import"./initNoPeFactory.js";function W(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:W}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class Y{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class G{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===G.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===G.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,L=Number.NaN,Y=Number.NaN,G=Number.NaN,K=Number.NaN,q=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=J(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=J(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=J(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=J(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=Z(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=H(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=$(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=$(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,M=$(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,R=$(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=ee(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=$(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=$(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=$(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=$(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=ee(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,L=$(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,Y=$(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=$(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=$(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=ee(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&te(n,me)}else if(b||y||T||N||g){x(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new A({x:P,y:V});N&&e.setZ(M),T&&e.setM(R),g&&e.setID(U),ce=e}else if(w||C||D||F||j||z||O||I||E||B){(Number.isNaN(X)||Number.isNaN(L)||Number.isNaN(Y))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:L,ymax:Y});j&&z&&e.setInterval(1,0,G,K),O&&I&&e.setInterval(2,0,q,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function q(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=q(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,L=!0;if(0!==R.length&&(L=!1,h(R)&&(X=f(R))),X||0===U.length||(L=!1,h(U)&&(X=f(U))),!X&&w>0&&(L=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(L=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),L&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&_&&e.setMParams(M,E),X=T(X,e)}return X}function J(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new z:new O,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const z=4;let O=0,I=0;const E=l.getNAN(),B=m(z,Number.NaN),P=m(z,Number.NaN);let V=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),V=!0,r=1,({segFlag:T,toPointSz:O}=ue(g,B,x,i));else{for(V=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),O=0;4!==i.nextToken();)O===z&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),B[O++]=$(i);O<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(B[0],B[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(ne(A)),u.writePoint2D(2*A,E.setCoords(B[0],B[1])),h&&h.size()===A&&h.resize(re(A)),O>2?(h||(h=v(A+1,Number.NaN)),h.write(A,B[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(re(A)),O>3?(f||(f=v(A+1,Number.NaN)),f.write(A,B[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=O,c(P,B,0,0,I);else if(null!==p)if(V){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(B[0],B[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&O===I&&0===d(B,P,O)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function Z(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=$(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(ne(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(re(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(re(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function H(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(re(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(re(i)),r.write(i,ee(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(re(i)),r.write(i,ee(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function $(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function ee(e){return e.currentInt32Value()}function te(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===O.type||i===z.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===O.type||i===z.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function ne(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function re(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function ie(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),e.queryCoord2D(.5,e.m_interior)):M(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,R(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),V(e),!0}function se(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,R(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),V(e),!0}function ae(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function oe(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ue(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=$(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=$(i),o=i.nextToken(),k=$(i),o=i.nextToken(),b=$(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;me(e.get(),r,c,d,t,_,h)}else le(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),ce(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),de(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;me(e.get(),r,c,N,t,-1,-1)}return a}function me(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,ie(e,t,n,m,0)}function le(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new G({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,se(e,t,n,c,0)}function ce(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new G({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,ae(e,t,n,a,0)}function de(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,oe(e,t,n,m,0)}function _e(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return he(e,t,n,r,i);if(o===s.enumBezier)return fe(e,t,n,r,i);if(o===s.enumRationalBezier2)return pe(e,t,n,r,i);if(o===s.enumBezier2){const s=new B;return s.constructFromQuadraticSegment(e),fe(s,t,n,r,i)}a("")}function he(e,t,r,i,s){n(!P(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return ke(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s),be(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;be(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s);const t=e;be(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),ke(a,o,s.x,s.y,u,m,r,i),be(e.m_cp[0].x,e.m_cp[0].y,r,i),be(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),ke(a,o,s.x,s.y,u,m,r,i),be(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function be(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class ye{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Ne(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Ne(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Te(!0,t,r,a);break;case s.enumPolyline:Te(!1,t,r,a);break;case s.enumMultiPoint:ge(t,r,a);break;case s.enumPoint:ve(t,r,a);break;case s.enumEnvelope:xe(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Se(t,i,a)),a.endObject()}}function Te(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;we(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==T?31&T.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);_e(N.get(),o,u,e,i)&&E++}else we(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(we(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(we(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ge(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),we(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Ae(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Se(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Ae(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function we(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Ce={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class De{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Ce.s_backslash&&t.charCodeAt(r+1)===Ce.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Ce.s_backslash&&t.charCodeAt(r+1)===Ce.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Ce.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Ce.s_doubleQuote:e+='"';break;case Ce.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Ce.s_backslash:e+="\\";break;case Ce.s_forwardslash:e+="/";break;case Ce.s_b:e+="\b";break;case Ce.s_f:e+="\f";break;case Ce.s_n:e+="\n";break;case Ce.s_r:e+="\r";break;case Ce.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===Ce.s_asterisk?this.skipCStyleComments_():e===Ce.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===Ce.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Ce.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Ce.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==Ce.s_doubleQuote;){const n=e===Ce.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===Ce.s_doubleQuote||e===Ce.s_backslash||e===Ce.s_forwardslash||e===Ce.s_b||e===Ce.s_f||e===Ce.s_n||e===Ce.s_r||e===Ce.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===Ce.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=Ce.s_zero&&e<=Ce.s_nine||e>=Ce.s_a&&e<=Ce.s_f||e>=Ce.s_A&&e<=Ce.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Ce.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Ce.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Ce.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Ce.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=Ce.s_zero&&e<=Ce.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=Ce.s_zero&&e<=Ce.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==Ce.s_plus&&e!==Ce.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=Ce.s_zero&&e<=Ce.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===Ce.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=Ce.s_zero&&n<=Ce.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===Ce.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==Ce.s_e&&n!==Ce.s_E||this.exp_();else if(n===Ce.s_e||n===Ce.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Ce.s_beginObject?this.valueStartObject_():e===Ce.s_beginArray?this.valueStartArray_():e===Ce.s_doubleQuote?this.valueString_():e===Ce.s_minus||e>=Ce.s_zero&&e<=Ce.s_zero+9?this.valueNumber_():e===Ce.s_n?this.valueNull_():e===Ce.s_t?this.valueTrue_():e===Ce.s_f?this.valueFalse_():e===Ce.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Ce.s_beginObject&&e!==Ce.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class Fe{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new De({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const je=new Y,ze=new ye,Oe=new Fe;function Ie(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ee(e,t){const n=new L(e,{strict:!1});return n.nextToken(),Oe.execute(0,s.enumUnknown,n,!0,t)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Pe(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Pe(e){return Ee(e,!0)}function Ve(e){return Ee(e,!1).getGeometry()}function Me(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(je.reset(),ze.execute(0,e,t,je),je.getObject())}export{Be as fromGeometries,Pe as fromGeometry,Ve as fromGeometryToGXGeometry,Ie as getSpatialReference,Me as toGeometry};
|
|
5
|
+
import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{ar as o,i as u,d as m,P as l,b as c,as as d,m as _}from"../../../chunks/Point2D.js";import{aA as h,a as f,aB as p,aC as k,c as b,R as y,aD as N,aE as T,aF as g}from"../../../chunks/ProjectionTransformation.js";import{D as v,I as x,P as A,E as S,y as w,z as C,J as D,K as F,t as j}from"../../../chunks/Envelope.js";import{a as z,P as O,S as I,M as E,y as B,z as P,A as V,B as M,F as R,H as U}from"../../../chunks/MultiPathImpl.js";import"./initNoPeFactory.js";function W(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:W}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class Y{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class G{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===G.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===G.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,L=Number.NaN,Y=Number.NaN,G=Number.NaN,K=Number.NaN,q=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=J(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=J(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=J(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=J(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=Z(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=H(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=$(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=$(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,M=$(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,R=$(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=ee(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=$(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=$(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=$(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=$(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=ee(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,L=$(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,Y=$(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=$(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=$(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=ee(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&te(n,me)}else if(b||y||T||N||g){x(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new A({x:P,y:V});N&&e.setZ(M),T&&e.setM(R),g&&e.setID(U),ce=e}else if(w||C||D||F||j||z||O||I||E||B){(Number.isNaN(X)||Number.isNaN(L)||Number.isNaN(Y))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:L,ymax:Y});j&&z&&e.setInterval(1,0,G,K),O&&I&&e.setInterval(2,0,q,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function q(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=q(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,L=!0;if(0!==R.length&&(L=!1,h(R)&&(X=f(R))),X||0===U.length||(L=!1,h(U)&&(X=f(U))),!X&&w>0&&(L=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(L=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),L&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&_&&e.setMParams(M,E),X=T(X,e)}return X}function J(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new z:new O,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const z=4;let O=0,I=0;const E=l.getNAN(),B=m(z,Number.NaN),P=m(z,Number.NaN);let V=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),V=!0,r=1,({segFlag:T,toPointSz:O}=ue(g,B,x,i));else{for(V=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),O=0;4!==i.nextToken();)O===z&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),B[O++]=$(i);O<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(B[0],B[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(ne(A)),u.writePoint2D(2*A,E.setCoords(B[0],B[1])),h&&h.size()===A&&h.resize(re(A)),O>2?(h||(h=v(A+1,Number.NaN)),h.write(A,B[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(re(A)),O>3?(f||(f=v(A+1,Number.NaN)),f.write(A,B[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=O,c(P,B,0,0,I);else if(null!==p)if(V){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(B[0],B[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&O===I&&0===d(B,P,O)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function Z(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=$(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(ne(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(re(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(re(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function H(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(re(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(re(i)),r.write(i,ee(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(re(i)),r.write(i,ee(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function $(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function ee(e){return e.currentInt32Value()}function te(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===O.type||i===z.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===O.type||i===z.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function ne(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function re(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function ie(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),e.queryCoord2D(.5,e.m_interior)):M(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,R(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),V(e),!0}function se(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,R(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,V(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),V(e),!0}function ae(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function oe(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ue(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=$(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=$(i),o=i.nextToken(),k=$(i),o=i.nextToken(),b=$(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=$(i);o=i.nextToken();const r=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=$(i);o=i.nextToken();const n=$(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;me(e.get(),r,c,d,t,_,h)}else le(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),ce(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),de(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;me(e.get(),r,c,N,t,-1,-1)}return a}function me(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,ie(e,t,n,m,0)}function le(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new G({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,se(e,t,n,c,0)}function ce(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new G({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,ae(e,t,n,a,0)}function de(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,oe(e,t,n,m,0)}function _e(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return he(e,t,n,r,i);if(o===s.enumBezier)return fe(e,t,n,r,i);if(o===s.enumRationalBezier2)return pe(e,t,n,r,i);if(o===s.enumBezier2){const s=new B;return s.constructFromQuadraticSegment(e),fe(s,t,n,r,i)}a("")}function he(e,t,r,i,s){n(!P(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return ke(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s),be(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;be(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),ke(o,u,a.x,a.y,m,l,i,s);const t=e;be(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),ke(a,o,s.x,s.y,u,m,r,i),be(e.m_cp[0].x,e.m_cp[0].y,r,i),be(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),ke(a,o,s.x,s.y,u,m,r,i),be(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function be(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class ye{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Ne(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Ne(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Te(!0,t,r,a);break;case s.enumPolyline:Te(!1,t,r,a);break;case s.enumMultiPoint:ge(t,r,a);break;case s.enumPoint:ve(t,r,a);break;case s.enumEnvelope:xe(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Se(t,i,a)),a.endObject()}}function Te(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;we(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==T?31&T.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);_e(N.get(),o,u,e,i)&&E++}else we(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(we(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(we(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ge(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),we(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Ae(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Se(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Ae(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function we(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Ce={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class De{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Ce.s_backslash&&t.charCodeAt(r+1)===Ce.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Ce.s_backslash&&t.charCodeAt(r+1)===Ce.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Ce.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Ce.s_doubleQuote:e+='"';break;case Ce.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Ce.s_backslash:e+="\\";break;case Ce.s_forwardslash:e+="/";break;case Ce.s_b:e+="\b";break;case Ce.s_f:e+="\f";break;case Ce.s_n:e+="\n";break;case Ce.s_r:e+="\r";break;case Ce.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===Ce.s_asterisk?this.skipCStyleComments_():e===Ce.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===Ce.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Ce.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Ce.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==Ce.s_doubleQuote;){const n=e===Ce.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===Ce.s_doubleQuote||e===Ce.s_backslash||e===Ce.s_forwardslash||e===Ce.s_b||e===Ce.s_f||e===Ce.s_n||e===Ce.s_r||e===Ce.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===Ce.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=Ce.s_zero&&e<=Ce.s_nine||e>=Ce.s_a&&e<=Ce.s_f||e>=Ce.s_A&&e<=Ce.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Ce.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Ce.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Ce.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Ce.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=Ce.s_zero&&e<=Ce.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=Ce.s_zero&&e<=Ce.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==Ce.s_plus&&e!==Ce.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=Ce.s_zero&&e<=Ce.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===Ce.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=Ce.s_zero&&n<=Ce.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===Ce.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==Ce.s_e&&n!==Ce.s_E||this.exp_();else if(n===Ce.s_e||n===Ce.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Ce.s_beginObject?this.valueStartObject_():e===Ce.s_beginArray?this.valueStartArray_():e===Ce.s_doubleQuote?this.valueString_():e===Ce.s_minus||e>=Ce.s_zero&&e<=Ce.s_zero+9?this.valueNumber_():e===Ce.s_n?this.valueNull_():e===Ce.s_t?this.valueTrue_():e===Ce.s_f?this.valueFalse_():e===Ce.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Ce.s_beginObject&&e!==Ce.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class Fe{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new De({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const je=new Y,ze=new ye,Oe=new Fe;function Ie(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ee(e,t){const n=new L(e,{strict:!1});return n.nextToken(),Oe.execute(0,s.enumUnknown,n,!0,t)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Pe(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Pe(e){return Ee(e,!0)}function Ve(e){return Ee(e,!1).getGeometry()}function Me(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(je.reset(),ze.execute(0,e,t,je),je.getObject())}export{Be as fromGeometries,Pe as fromGeometry,Ve as fromGeometryToGXGeometry,Ie as getSpatialReference,Me as toGeometry};
|
package/interfaces.d.ts
CHANGED
|
@@ -1311,6 +1311,24 @@ declare namespace __esri {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
|
|
1313
1313
|
export class VolumeMeasurementAnalysis extends Analysis {
|
|
1314
|
+
/**
|
|
1315
|
+
* The measurement type for the volume analysis.
|
|
1316
|
+
*
|
|
1317
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#measureType Read more...}
|
|
1318
|
+
*/
|
|
1319
|
+
measureType: "cut-fill" | "stockpile";
|
|
1320
|
+
/**
|
|
1321
|
+
* The type of analysis.
|
|
1322
|
+
*
|
|
1323
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#type Read more...}
|
|
1324
|
+
*/
|
|
1325
|
+
readonly type: "volume-measurement";
|
|
1326
|
+
/**
|
|
1327
|
+
* Indicates whether the analysis is ready to be computed and interacted with in the view.
|
|
1328
|
+
*
|
|
1329
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#valid Read more...}
|
|
1330
|
+
*/
|
|
1331
|
+
readonly valid: boolean;
|
|
1314
1332
|
/**
|
|
1315
1333
|
* VolumeMeasurementAnalysis computes the volume within a polygonal region and displays the measurement
|
|
1316
1334
|
* in a 3D {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html SceneView}.
|
|
@@ -1318,9 +1336,28 @@ declare namespace __esri {
|
|
|
1318
1336
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html Read more...}
|
|
1319
1337
|
*/
|
|
1320
1338
|
constructor(properties?: VolumeMeasurementAnalysisProperties);
|
|
1339
|
+
/**
|
|
1340
|
+
* Polygon whose volume is to be computed and displayed in the view.
|
|
1341
|
+
*
|
|
1342
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#geometry Read more...}
|
|
1343
|
+
*/
|
|
1344
|
+
get geometry(): Polygon | nullish;
|
|
1345
|
+
set geometry(value: PolygonProperties | nullish);
|
|
1321
1346
|
}
|
|
1322
1347
|
|
|
1323
1348
|
interface VolumeMeasurementAnalysisProperties extends AnalysisProperties {
|
|
1349
|
+
/**
|
|
1350
|
+
* Polygon whose volume is to be computed and displayed in the view.
|
|
1351
|
+
*
|
|
1352
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#geometry Read more...}
|
|
1353
|
+
*/
|
|
1354
|
+
geometry?: PolygonProperties | nullish;
|
|
1355
|
+
/**
|
|
1356
|
+
* The measurement type for the volume analysis.
|
|
1357
|
+
*
|
|
1358
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-VolumeMeasurementAnalysis.html#measureType Read more...}
|
|
1359
|
+
*/
|
|
1360
|
+
measureType?: "cut-fill" | "stockpile";
|
|
1324
1361
|
}
|
|
1325
1362
|
|
|
1326
1363
|
/**
|
|
@@ -1366,7 +1403,7 @@ declare namespace __esri {
|
|
|
1366
1403
|
/**
|
|
1367
1404
|
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1368
1405
|
*
|
|
1369
|
-
* Compiles an Arcade expression
|
|
1406
|
+
* Compiles an Arcade expression into a compiled expression info.
|
|
1370
1407
|
*
|
|
1371
1408
|
* @param params The parameters for compilation.
|
|
1372
1409
|
*/
|
|
@@ -1393,7 +1430,7 @@ declare namespace __esri {
|
|
|
1393
1430
|
export const arcadeFeatureUtils: arcadeFeatureUtils;
|
|
1394
1431
|
|
|
1395
1432
|
export interface arcadeFeatureUtilsCompileExpressionParams {
|
|
1396
|
-
|
|
1433
|
+
expression: string;
|
|
1397
1434
|
createArcadeExecutor: any;
|
|
1398
1435
|
createArcadeProfile: any;
|
|
1399
1436
|
graphic: Graphic;
|
|
@@ -100431,6 +100468,14 @@ declare namespace __esri {
|
|
|
100431
100468
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#layer Read more...}
|
|
100432
100469
|
*/
|
|
100433
100470
|
layer: VideoLayer | nullish;
|
|
100471
|
+
/**
|
|
100472
|
+
* A reference to the associated {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html Map} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html WebMap}.
|
|
100473
|
+
*
|
|
100474
|
+
* @default null
|
|
100475
|
+
*
|
|
100476
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#map Read more...}
|
|
100477
|
+
*/
|
|
100478
|
+
map: Map | WebMap | nullish;
|
|
100434
100479
|
/**
|
|
100435
100480
|
* When `true`, this property indicates whether the view successfully satisfied all dependencies,
|
|
100436
100481
|
* signaling that the following conditions are met.
|
|
@@ -100587,6 +100632,12 @@ declare namespace __esri {
|
|
|
100587
100632
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#layer Read more...}
|
|
100588
100633
|
*/
|
|
100589
100634
|
layer?: VideoLayer | nullish;
|
|
100635
|
+
/**
|
|
100636
|
+
* A reference to the associated {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html Map} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html WebMap}.
|
|
100637
|
+
*
|
|
100638
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html#map Read more...}
|
|
100639
|
+
*/
|
|
100640
|
+
map?: Map | WebMap | nullish;
|
|
100590
100641
|
/**
|
|
100591
100642
|
* Options to configure the navigation behavior of the View.
|
|
100592
100643
|
*
|
|
@@ -108445,6 +108496,20 @@ declare namespace __esri {
|
|
|
108445
108496
|
}
|
|
108446
108497
|
|
|
108447
108498
|
export interface BatchAttributeFormViewModelSubmitEvent {
|
|
108499
|
+
name: "submit";
|
|
108500
|
+
results: SubmitResult[];
|
|
108501
|
+
valid: boolean;
|
|
108502
|
+
}
|
|
108503
|
+
|
|
108504
|
+
/**
|
|
108505
|
+
* Describes the state of a single feature's attribute values at the time of a form submission.
|
|
108506
|
+
*
|
|
108507
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm-BatchAttributeFormViewModel.html#SubmitResult Read more...}
|
|
108508
|
+
*/
|
|
108509
|
+
export interface SubmitResult {
|
|
108510
|
+
feature: Graphic;
|
|
108511
|
+
invalidFields: string[];
|
|
108512
|
+
values: boolean;
|
|
108448
108513
|
}
|
|
108449
108514
|
|
|
108450
108515
|
export interface BatchAttributeFormViewModelValueChangeEvent {
|
|
@@ -108788,6 +108853,9 @@ declare namespace __esri {
|
|
|
108788
108853
|
}
|
|
108789
108854
|
|
|
108790
108855
|
export interface BatchAttributeFormSubmitEvent {
|
|
108856
|
+
name: "submit";
|
|
108857
|
+
results: SubmitResult[];
|
|
108858
|
+
valid: boolean;
|
|
108791
108859
|
}
|
|
108792
108860
|
|
|
108793
108861
|
export interface BatchAttributeFormValueChangeEvent {
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.24",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Clonable.js";import r from"../../../core/Error.js";import o from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../../core/accessorSupport/decorators/writer.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getMetersPerUnitOfSR as h,orientedImageryTypeMap as v}from"./utils.js";import{CameraOrientationType as w}from"../enums/CameraOrientationType.js";import{ltpToGeographic as O}from"../transformations/utils.js";function j(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function b(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const S=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),N=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}});let I=class extends(t.ClonableMixin(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const s in o)r[s.toLowerCase()]=o[s],i[s.toLowerCase()]=s;const n=e.layer??{};n.sequenceOrderField?.length&&(r.sequenceorder=o[n.sequenceOrderField],i.sequenceorder=n.sequenceOrderField),super.read({geometry:a,layer:n,sourceMap:i,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||b("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;return f(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(t===w.LTP){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new m(O([n,s,p],[t,r,o,a]))}const p=new m({x:r,y:o,z:a,spatialReference:s}),c=n?u("point",{wkid:n},s):null;return c&&c(p),p}if("number"!=typeof t)throw j("cameraHeight");const o=this.geometry.clone();return o.z=o.hasZ?o.z:(r??0)+t/h(o.spatialReference),o}set matrix(e){if(!e||9!==e.length)return a.getLogger(this).warn("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null);this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=v.read(r??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===s?p<10?"nadir":"oblique":s}set radial(e){if(e)if("string"!=typeof e)this._set("radial",e);else{const[t,r,o]=e.split(";").map(Number);this._set("radial",[t??0,r??0,o??0])}else this._set("radial",[0,0,0])}readSequenceOrder(e,t){const{layer:r}=t;return t[r.sequenceOrderField.toLowerCase()]}writeSequenceOrder(e,t){if(!e)return;const{sourceMap:r}=this;if(r){t[r.sequenceorder]=e}}set tangential(e){if(e)if("string"!=typeof e)this._set("tangential",e);else{const[t,r]=e.split(";").map(Number);this._set("tangential",[t??0,r??0])}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],I.prototype,"_geometry",void 0),e([i(S())],I.prototype,"a0",void 0),e([i(S())],I.prototype,"a1",void 0),e([i(S())],I.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],I.prototype,"acquisitionDate",void 0),e([i(S())],I.prototype,"b0",void 0),e([i(S())],I.prototype,"b1",void 0),e([i(S())],I.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],I.prototype,"cameraHeading",void 0),e([p("cameraHeading")],I.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],I.prototype,"readCameraHeight",null),e([i()],I.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],I.prototype,"readCamOffset",null),e([l("cameraOffset")],I.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),n(e=>e?d.getCameraOrientation(e):null)],I.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],I.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],I.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],I.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],I.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],I.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],I.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],I.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],I.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],I.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],I.prototype,"readFarDistance",null),e([i(S("focallength"))],I.prototype,"focalLength",void 0),e([i({type:m,json:{name:"geometry"}})],I.prototype,"geometry",null),e([l("geometry")],I.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],I.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],I.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],I.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],I.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],I.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],I.prototype,"readImageRotation",null),e([i()],I.prototype,"isHorizontal",null),e([i()],I.prototype,"isInspection",null),e([i()],I.prototype,"isNadir",null),e([i()],I.prototype,"isOblique",null),e([i()],I.prototype,"isSpherical",null),e([i()],I.prototype,"location",null),e([i(N())],I.prototype,"matrix",null),e([i({json:{write:!0},type:String})],I.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],I.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],I.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"offsetFromStart",void 0),e([p("offsetFromStart",["offsetfromstart"])],I.prototype,"readOffsetFromStart",null),e([i()],I.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],I.prototype,"readOrientationAccuracy",null),e([l("orientationAccuracy")],I.prototype,"writeOrientationAccuracy",null),e([s(v)],I.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],I.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],I.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],I.prototype,"principalY",void 0),e([i(N([0,0,0]))],I.prototype,"radial",null),e([i({type:String})],I.prototype,"sequenceOrder",void 0),e([p("sequenceOrder",["sequenceorder","layer.sequenceOrderField"])],I.prototype,"readSequenceOrder",null),e([l("sequenceOrder")],I.prototype,"writeSequenceOrder",null),e([i({type:Object})],I.prototype,"sourceMap",void 0),e([i(N([0,0]))],I.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],I.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],I.prototype,"readVFOV",null),I=e([c("esri.layers.orientedImagery.core.ExposurePoint")],I);export{I as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Clonable.js";import r from"../../../core/Error.js";import o from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../../core/accessorSupport/decorators/writer.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getMetersPerUnitOfSR as h,orientedImageryTypeMap as v}from"./utils.js";import{CameraOrientationType as w}from"../enums/CameraOrientationType.js";import{ltpToGeographic as O}from"../transformations/utils.js";function j(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function b(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const S=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),N=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}});let I=class extends(t.ClonableMixin(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const s in o)r[s.toLowerCase()]=o[s],i[s.toLowerCase()]=s;const n=e.layer??{};n.sequenceOrderField?.length&&(r.sequenceorder=o[n.sequenceOrderField],i.sequenceorder=n.sequenceOrderField),super.read({geometry:a,layer:n,sourceMap:i,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||b("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;return f(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(t===w.LTP){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new m(O([n,s,p],[t,r,o,a]))}const p=new m({x:r,y:o,z:a,spatialReference:s}),c=n?u("point",{wkid:n},s):null;return c&&c(p),p}if("number"!=typeof t)throw j("cameraHeight");const o=this.geometry.clone();return o.z=o.hasZ?o.z:(r??0)+t/h(o.spatialReference),o}set matrix(e){if(!e||9!==e.length)return a.getLogger(this).warn("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null);this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=v.read(r??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===s?p<10?"nadir":"oblique":s}set radial(e){if(e){if("string"==typeof e){const[t,r,o]=e.split(";").map(Number);return void this._set("radial",[t??0,r??0,o??0])}this._set("radial",e)}else this._set("radial",[0,0,0])}readSequenceOrder(e,t){const{layer:r}=t;return t[r.sequenceOrderField.toLowerCase()]}writeSequenceOrder(e,t){if(!e)return;const{sourceMap:r}=this;if(r){t[r.sequenceorder]=e}}set tangential(e){if(e){if("string"==typeof e){const[t,r]=e.split(";").map(Number);return void this._set("tangential",[t??0,r??0])}this._set("tangential",e)}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],I.prototype,"_geometry",void 0),e([i(S())],I.prototype,"a0",void 0),e([i(S())],I.prototype,"a1",void 0),e([i(S())],I.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],I.prototype,"acquisitionDate",void 0),e([i(S())],I.prototype,"b0",void 0),e([i(S())],I.prototype,"b1",void 0),e([i(S())],I.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],I.prototype,"cameraHeading",void 0),e([p("cameraHeading")],I.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],I.prototype,"readCameraHeight",null),e([i()],I.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],I.prototype,"readCamOffset",null),e([l("cameraOffset")],I.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),n(e=>e?d.getCameraOrientation(e):null)],I.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],I.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],I.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],I.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],I.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],I.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],I.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],I.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],I.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],I.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],I.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],I.prototype,"readFarDistance",null),e([i(S("focallength"))],I.prototype,"focalLength",void 0),e([i({type:m,json:{name:"geometry"}})],I.prototype,"geometry",null),e([l("geometry")],I.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],I.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],I.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],I.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],I.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],I.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],I.prototype,"readImageRotation",null),e([i()],I.prototype,"isHorizontal",null),e([i()],I.prototype,"isInspection",null),e([i()],I.prototype,"isNadir",null),e([i()],I.prototype,"isOblique",null),e([i()],I.prototype,"isSpherical",null),e([i()],I.prototype,"location",null),e([i(N())],I.prototype,"matrix",null),e([i({json:{write:!0},type:String})],I.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],I.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],I.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],I.prototype,"offsetFromStart",void 0),e([p("offsetFromStart",["offsetfromstart"])],I.prototype,"readOffsetFromStart",null),e([i()],I.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],I.prototype,"readOrientationAccuracy",null),e([l("orientationAccuracy")],I.prototype,"writeOrientationAccuracy",null),e([s(v)],I.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],I.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],I.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],I.prototype,"principalY",void 0),e([i(N([0,0,0]))],I.prototype,"radial",null),e([i({type:String})],I.prototype,"sequenceOrder",void 0),e([p("sequenceOrder",["sequenceorder","layer.sequenceOrderField"])],I.prototype,"readSequenceOrder",null),e([l("sequenceOrder")],I.prototype,"writeSequenceOrder",null),e([i({type:Object})],I.prototype,"sourceMap",void 0),e([i(N([0,0]))],I.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],I.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],I.prototype,"readVFOV",null),I=e([c("esri.layers.orientedImagery.core.ExposurePoint")],I);export{I as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{earth as t}from"../../../geometry/support/Ellipsoid.js";import{distance as e}from"../../../geometry/support/pointUtils.js";import a from"./ExposurePoint.js";function i(t){const{camera:e,features:a,selectedPoint:i}=t;if(!a.length)return[];t.currentImage??={attributes:{cameraHeading:0,cameraPitch:0}};const s
|
|
5
|
+
import{earth as t}from"../../../geometry/support/Ellipsoid.js";import{distance as e}from"../../../geometry/support/pointUtils.js";import a from"./ExposurePoint.js";function i(t){const{camera:e,features:a,selectedPoint:i}=t;if(!a.length)return[];t.currentImage??={attributes:{cameraHeading:0,cameraPitch:0}};const r=s(e,i,t.currentImage);return a.map(r)}function s(a,i,s){const h=i.clone();return h.z??=0,h.elevation=i.elevation??0,i=>{const{hfovWeight:n,vfovWeight:o,distanceWeight:c}=r(i.attributes,a?"3d":"2d"),l=i.attributes,{cameraHeight:g,cameraHeading:M,cameraPitch:u,farDistance:f,horizontalFieldOfView:b,verticalFieldOfView:d,isOblique:v}=l,m=l.geometry,W=180*Math.atan2(m.y-h.y,m.x-h.x)/Math.PI,p=e(h,m);let y,x,P=b,I=d,q=!1;a?(y=a.heading,x=a.tilt,P=180,I=180,q=!0):!v||u<10?(y=M,x=u,q=!1):(y=s.attributes.cameraHeading,x=u,q=!0,P=180),y>180&&(y-=360);let H=1;m.spatialReference.isWebMercator&&(H=1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*m.y/t.radius))));const O=Math.sqrt((Math.sqrt((h.x-m.x)**2+(h.y-m.y)**2)/H)**2+((h.z??0)-(h.elevation??0)-g)**2),z=90-180*Math.atan2(h.y-m.y,h.x-m.x)/Math.PI;let j=(Math.abs(z-y)>180?Math.abs(360-Math.abs(z-y)):Math.abs(z-y))/P;j=4*j+1;const w=180*Math.acos((l.cameraHeight-(h.z??0)+(h.elevation??0))/O)/Math.PI;let E=Math.abs(w-x)/I;E=4*E+1;let F=O/Math.sqrt(f**2+g**2);F=4*F+1;const S=n*j+o*E+c*F;let V;if(q){const t=M>180?M-360:M;V=n*((Math.abs(z-t)>180?Math.abs(360-Math.abs(z-t)):Math.abs(z-t))/b*4+1)+o*(Math.abs(w-u)/d*4+1)+c*F}else V=S;return{suitability:S,trueSuitability:V,feature:i,angle:W,distance:p,verticalAngle:Math.abs(180*Math.atan(p/g)/Math.PI)}}}function r(t,e){const i="isOblique"in t?t:new a(t),{isOblique:s,isSpherical:r,isNadir:h}=i;return r?{hfovWeight:"2d"===e?0:1,vfovWeight:"2d"===e?0:.6,distanceWeight:"2d"===e?1:.5}:h?{hfovWeight:.25,vfovWeight:1,distanceWeight:1}:s?{hfovWeight:1,vfovWeight:.25,distanceWeight:1}:{hfovWeight:1,vfovWeight:1,distanceWeight:1}}export{i as calculateSuitabilities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Clonable.js";import e from"../../core/Error.js";import r from"../../core/JSONSupport.js";import n from"../../core/Logger.js";import{transformProjective as i,getProjectiveTransform as s}from"../../core/perspectiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import{invert as m}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as f,create as P}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h,lerp as d,rotate as y}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as g,fromValues as j}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import w from"../../geometry/Point.js";import R from"../../geometry/Polygon.js";import{projectOrLoad as x}from"../../geometry/projectionUtils.js";import v from"../../geometry/SpatialReference.js";import b from"./GeoreferenceBase.js";const S=P(),C=g();let N=class extends r{};t([c({type:Number,json:{write:{isRequired:!0}}})],N.prototype,"x",void 0),t([c({type:Number,json:{write:{isRequired:!0}}})],N.prototype,"y",void 0),N=t([p("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],N);let q=class extends o{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};t([c()],q.prototype,"sourcePoint",void 0),t([c({type:w})],q.prototype,"mapPoint",void 0),q=t([p("esri.layers.support.ControlPointsGeoreference.ControlPoint")],q);let O=class extends(r.JSONSupportMixin(b)){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,o){const e=v.fromJSON(o.spatialReference),r=f(...o.coefficients,1);return t.map(t=>(h(C,t.x,t.y),i(C,C,r),{sourcePoint:t,mapPoint:new w({x:C[0],y:C[1],spatialReference:e})}))}writeControlPoints(t,o,r,i){if(null
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Clonable.js";import e from"../../core/Error.js";import r from"../../core/JSONSupport.js";import n from"../../core/Logger.js";import{transformProjective as i,getProjectiveTransform as s}from"../../core/perspectiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import{invert as m}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as f,create as P}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h,lerp as d,rotate as y}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as g,fromValues as j}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import w from"../../geometry/Point.js";import R from"../../geometry/Polygon.js";import{projectOrLoad as x}from"../../geometry/projectionUtils.js";import v from"../../geometry/SpatialReference.js";import b from"./GeoreferenceBase.js";const S=P(),C=g();let N=class extends r{};t([c({type:Number,json:{write:{isRequired:!0}}})],N.prototype,"x",void 0),t([c({type:Number,json:{write:{isRequired:!0}}})],N.prototype,"y",void 0),N=t([p("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],N);let q=class extends o{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};t([c()],q.prototype,"sourcePoint",void 0),t([c({type:w})],q.prototype,"mapPoint",void 0),q=t([p("esri.layers.support.ControlPointsGeoreference.ControlPoint")],q);let O=class extends(r.JSONSupportMixin(b)){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,o){const e=v.fromJSON(o.spatialReference),r=f(...o.coefficients,1);return t.map(t=>(h(C,t.x,t.y),i(C,C,r),{sourcePoint:t,mapPoint:new w({x:C[0],y:C[1],spatialReference:e})}))}writeControlPoints(t,o,r,i){if(null==this.transform){const t=new e("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:i?.layer,georeference:this});return void(i?.messages?i.messages.push(t):n.getLogger(this).error(t.name,t.message))}null!=t&&T(t[0])&&(o.controlPoints=t.map(t=>{const o=t.sourcePoint;return{x:o.x,y:o.y}}),o.spatialReference=t[0].mapPoint.spatialReference.toJSON(),o.coefficients=this.transform.slice(0,8))}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(S);if(null==t||!T(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return K(t,this.width,this.height,o)}set coords(t){if(null==this.controlPoints||!T(this.controlPoints[0]))return;const o=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,o)))return;const{width:e,height:r}=this,{rings:[[n,s,c,a]]}=t,p={sourcePoint:l(0,r),mapPoint:new w({x:n[0],y:n[1],spatialReference:o})},u={sourcePoint:l(0,0),mapPoint:new w({x:s[0],y:s[1],spatialReference:o})},m={sourcePoint:l(e,0),mapPoint:new w({x:c[0],y:c[1],spatialReference:o})},f={sourcePoint:l(e,r),mapPoint:new w({x:a[0],y:a[1],spatialReference:o})};T(p)&&T(u)&&T(m)&&T(f)&&(B(S,p,u,m,f),this.controlPoints=this.controlPoints.map(({sourcePoint:t})=>(h(C,t.x,t.y),i(C,C,S),{sourcePoint:t,mapPoint:new w({x:C[0],y:C[1],spatialReference:o})})))}get inverseTransform(){return null==this.transform?null:m(P(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!T(this.controlPoints[0]))return null;h(C,t.x,t.y);const o=this.controlPoints[0].mapPoint.spatialReference;return i(C,C,this.transform),new w({x:C[0],y:C[1],spatialReference:o})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!T(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=x(t,o).geometry)?null:(h(C,t.x,t.y),i(C,C,this.inverseTransform),l(C[0],C[1]))}toSourceNormalized(t){const o=this.toSource(t);return null!=o&&(o.x/=this.width,o.y/=this.height),o}_updateTransform(t){const{controlPoints:o,width:e,height:r}=this;if(!(null!=o&&e>0&&r>0))return null;const[n,i,s,l]=o;if(!T(n))return null;const c=n.mapPoint.spatialReference,a=this._projectControlPoint(i,c),p=this._projectControlPoint(s,c),u=this._projectControlPoint(l,c);if(!a.valid||!p.valid||!u.valid)return null;if(!T(a.controlPoint))return null;null==t&&(t=P());let m=null;return m=T(p.controlPoint)&&T(u.controlPoint)?B(t,n,a.controlPoint,p.controlPoint,u.controlPoint):T(p.controlPoint)?V(t,n,a.controlPoint,p.controlPoint):A(t,n,a.controlPoint),m.every(t=>0===t)?null:m}_projectControlPoint(t,o){if(!T(t))return{valid:!0,controlPoint:t};const{sourcePoint:e,mapPoint:r}=t,{geometry:i,pending:s}=x(r,o);return s?{valid:!1,controlPoint:null}:s||i?{valid:!0,controlPoint:{sourcePoint:e,mapPoint:i}}:(n.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:o}),{valid:!1,controlPoint:null})}};function T(t){return null!=t?.sourcePoint&&null!=t.mapPoint}t([c({type:[q],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[N],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:v,isRequired:!0}}}}})],O.prototype,"controlPoints",void 0),t([a("controlPoints")],O.prototype,"readControlPoints",null),t([u("controlPoints")],O.prototype,"writeControlPoints",null),t([c({clonable:!1})],O.prototype,"coords",null),t([c({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],O.prototype,"height",void 0),t([c({readOnly:!0})],O.prototype,"inverseTransform",null),t([c({readOnly:!0})],O.prototype,"transform",null),t([c({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],O.prototype,"width",void 0),O=t([p("esri.layers.support.ControlPointsGeoreference")],O);const _=g(),M=g(),G=g(),I=g(),J=g(),L=g(),E=g(),U=g(),k=Math.PI/2;function z(t,o,e){h(t,e.sourcePoint.x,e.sourcePoint.y),h(o,e.mapPoint.x,e.mapPoint.y)}function A(t,o,e){return z(_,J,o),z(M,L,e),y(G,M,_,k),y(I,_,M,k),y(E,L,J,-k),y(U,J,L,-k),H(t,_,M,G,I,J,L,E,U)}function V(t,o,e,r){return z(_,J,o),z(M,L,e),z(G,E,r),d(I,_,M,.5),y(I,G,I,Math.PI),d(U,J,L,.5),y(U,E,U,Math.PI),H(t,_,M,G,I,J,L,E,U)}function B(t,o,e,r,n){return z(_,J,o),z(M,L,e),z(G,E,r),z(I,U,n),H(t,_,M,G,I,J,L,E,U)}const W=new Array(8).fill(0),D=new Array(8).fill(0);function F(t,o,e,r,n){return t[0]=o[0],t[1]=o[1],t[2]=e[0],t[3]=e[1],t[4]=r[0],t[5]=r[1],t[6]=n[0],t[7]=n[1],t}function H(t,o,e,r,n,i,l,c,a){return s(t,F(W,o,e,r,n),F(D,i,l,c,a))}function K(t,o,e,r){const n=j(0,e),s=j(0,0),l=j(o,0),c=j(o,e);return i(n,n,t),i(s,s,t),i(l,l,t),i(c,c,t),new R({rings:[[n,s,l,c,n]],spatialReference:r})}export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import s from"../../core/Error.js";import e from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import l from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{SimpleBandStatistics as n}from"./SimpleBandStatistics.js";import{getPixelValueRange as h}from"./rasterFormats/pixelRangeUtils.js";var p;let c=p=class extends e{static createEmptyBand(t,s){return new(p.getPixelArrayConstructor(t))(s)}static combineBandMasks(t){if(t.length<2)return t[0];const s=t[0].length,e=new Uint8Array(s).fill(255);for(let i=0;i<t.length;i++){const l=t[i];for(let t=0;t<s;t++)l[t]||(e[t]=0)}return e}static getPixelArrayConstructor(t){let s;switch(t){case"u1":case"u2":case"u4":case"u8":s=Uint8Array;break;case"u16":s=Uint16Array;break;case"u32":s=Uint32Array;break;case"s8":s=Int8Array;break;case"s16":s=Int16Array;break;case"s32":s=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":s=Float32Array;break;case"f64":s=Float64Array}return s}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let s=t.toLowerCase();return["u1","u2","u4"].includes(s)?s="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(s)||(s="f32"),s}getPlaneCount(){return this.pixels?.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new s("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new n)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(t=>u(t,this.mask));const t=this.mask;let s=0;if(null!=t)for(let e=0;e<t.length;e++)t[e]&&s++;else s=this.width*this.height;this.validPixelCount=s}clamp(t){if(!t||"f64"===t||"f32"===t||!this.pixels)return;const[s,e]=h(t),i=this.pixels,l=this.width*this.height,r=i.length;let o,a,n;const c=[];for(let h=0;h<r;h++){n=p.createEmptyBand(t,l),o=i[h];for(let t=0;t<l;t++)a=o[t],n[t]=a>e?e:a<s?s:a;c.push(n)}this.pixels=c,this.pixelType=t}extractBands(t){const{pixels:s,statistics:e}=this;if(null==t||0===t.length||!s||0===s.length)return this;const i=s.length,l=t.some(t=>t>=s.length),r=i===t.length&&!t.some((t,s)=>t!==s);if(l||r)return this;const o=this.bandMasks?.length===i?t.map(t=>this.bandMasks[t]):void 0;let{mask:a,validPixelCount:n}=this;const{width:h,height:c}=this;return o?.length&&(a=p.combineBandMasks(o),n=a.filter(t=>!!t).length),new p({pixelType:this.pixelType,width:h,height:c,mask:a,bandMasks:o,validPixelCount:n,maskIsAlpha:this.maskIsAlpha,pixels:t.map(t=>s[t]),statistics:e&&t.map(t=>e[t])})}clone(){const t=new p({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount,premultiplyAlpha:this.premultiplyAlpha,depthCount:this.depthCount});let s;null!=this.mask&&(t.mask=new Uint8Array(this.mask)),this.noDataValues&&(t.noDataValues=[...this.noDataValues]),this.bandMasks&&(t.bandMasks=this.bandMasks.map(t=>new Uint8Array(t)));const e=p.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const i=!!this.pixels[0].slice;for(s=0;s<this.pixels.length;s++)t.pixels[s]=i?this.pixels[s].slice():new e(this.pixels[s])}if(this.statistics)for(t.statistics=[],s=0;s<this.statistics.length;s++)t.statistics[s]=i(this.statistics[s]);return t}getTransferableObject(){const{pixels:t,bandMasks:s,mask:e}=this;this.pixels=[],this.bandMasks=void 0,this.mask=void 0;const i=this.toJSON();this.pixels=t,this.bandMasks=s,this.mask=e,i.pixels=t?[...t]:t,i.bandMasks=s?[...s]:s,i.mask=e;const l=[];return[...t??[],e,...s??[]].filter(t=>null!=t&&ArrayBuffer.isView(t)).forEach(t=>{t&&!l.includes(t.buffer)&&l.push(t.buffer)}),{pixelBlock:i,transferList:l}}_fillFrom8Bit(t){const{mask:s,maskIsAlpha:e,premultiplyAlpha:i,pixels:r}=this;if(!t||!r?.length)return void l.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let o,a,n,h;o=a=n=r[0],r.length>=3?(a=r[1],n=r[2]):2===r.length&&(a=r[1]);const p=new Uint32Array(t),c=this.width*this.height;if(o.length===c)if(null!=s&&s.length===c)if(e)for(h=0;h<c;h++){const t=s[h];if(t){const s=t/255;p[h]=i?t<<24|n[h]*s<<16|a[h]*s<<8|o[h]*s:t<<24|n[h]<<16|a[h]<<8|o[h]}}else for(h=0;h<c;h++)s[h]&&(p[h]=255<<24|n[h]<<16|a[h]<<8|o[h]);else for(h=0;h<c;h++)p[h]=255<<24|n[h]<<16|a[h]<<8|o[h];else l.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(t){const{pixels:s,mask:e,statistics:i}=this;if(!t||!s?.length)return void l.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const r=this.pixelType;let o=1,a=0,n=1;if(i&&i.length>0){for(const t of i)if(null!=t.minValue&&(a=Math.min(a,t.minValue)),null!=t.maxValue&&null!=t.minValue){const s=t.maxValue-t.minValue;n=Math.max(n,s)}o=255/n}else{let t=255;"s8"===r?(a=-128,t=127):"u16"===r?t=65535:"s16"===r?(a=-32768,t=32767):"u32"===r?t=4294967295:"s32"===r?(a=-2147483648,t=2147483647):"f32"===r?(a=-34e38,t=34e38):"f64"===r&&(a=-Number.MAX_VALUE,t=Number.MAX_VALUE),o=255/(t-a)}const h=new Uint32Array(t),p=this.width*this.height;let c,u,f,g,m;if(c=u=f=s[0],c.length!==p)return l.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(s.length>=2)if(u=s[1],s.length>=3&&(f=s[2]),null!=e&&e.length===p)for(g=0;g<p;g++)e[g]&&(h[g]=255<<24|(f[g]-a)*o<<16|(u[g]-a)*o<<8|(c[g]-a)*o);else for(g=0;g<p;g++)h[g]=255<<24|(f[g]-a)*o<<16|(u[g]-a)*o<<8|(c[g]-a)*o;else if(null!=e&&e.length===p)for(g=0;g<p;g++)m=(c[g]-a)*o,e[g]&&(h[g]=255<<24|m<<16|m<<8|m);else for(g=0;g<p;g++)m=(c[g]-a)*o,h[g]=255<<24|m<<16|m<<8|m}_fillFrom32Bit(t){const{pixels:s,mask:e}=this;if(!t||!s?.length)return l.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let i,r,o,a;i=r=o=s[0],s.length>=3?(r=s[1],o=s[2]):2===s.length&&(r=s[1]);const n=this.width*this.height;if(i.length!==n)return l.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(null!=e&&e.length===n)for(a=0;a<n;a++)t[h++]=i[a],t[h++]=r[a],t[h++]=o[a],t[h++]=1&e[a];else for(a=0;a<n;a++)t[h++]=i[a],t[h++]=r[a],t[h++]=o[a],t[h++]=1}};function u(t,s){let e=1/0,i=-1/0;const l=t.length;let r,o=0;if(null!=s)for(r=0;r<l;r++)s[r]&&(o=t[r],e=o<e?o:e,i=o>i?o:i);else for(r=0;r<l;r++)o=t[r],e=o<e?o:e,i=o>i?o:i;return new n(e,i)}t([r({json:{write:!0}})],c.prototype,"width",void 0),t([r({json:{write:!0}})],c.prototype,"height",void 0),t([r({json:{write:!0}})],c.prototype,"pixelType",void 0),t([o("pixelType")],c.prototype,"castPixelType",null),t([r({json:{write:!0}})],c.prototype,"validPixelCount",void 0),t([r({json:{write:!0}})],c.prototype,"mask",void 0),t([r({json:{write:!0}})],c.prototype,"maskIsAlpha",void 0),t([r({json:{write:!0}})],c.prototype,"pixels",void 0),t([r()],c.prototype,"premultiplyAlpha",void 0),t([r({json:{write:!0}})],c.prototype,"statistics",void 0),t([r({json:{write:!0}})],c.prototype,"depthCount",void 0),t([r({json:{write:!0}})],c.prototype,"noDataValues",void 0),t([r({json:{write:!0}})],c.prototype,"bandMasks",void 0),c=p=t([a("esri.layers.support.PixelBlock")],c);export{c as default};
|