@arcgis/core 4.26.0-next.20230221 → 4.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/arcade/Feature.js +1 -1
  2. package/arcade/arcadeTimeUtils.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  4. package/arcade/treeAnalysis.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/009cd8f27d2357ec9317.js +1 -0
  7. package/assets/esri/core/workers/chunks/03081e28fe59ba2e8040.js +1 -0
  8. package/assets/esri/core/workers/chunks/{985ffb4dfa8e598c94b5.js → 0d0bca75414f15371baf.js} +1 -1
  9. package/assets/esri/core/workers/chunks/17ce4b146825adcca307.js +1 -0
  10. package/assets/esri/core/workers/chunks/186f2d0c94fa1eca4959.js +1 -0
  11. package/assets/esri/core/workers/chunks/1fd48420dfbbfdb3b051.js +1 -0
  12. package/assets/esri/core/workers/chunks/226bfa115acb8542f21c.js +1 -0
  13. package/assets/esri/core/workers/chunks/253a3e9ce0521a005134.js +1 -0
  14. package/assets/esri/core/workers/chunks/{25abc848a128b24ff66e.js → 3808f33563757fad703d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/38ebf5d20576609566f9.js +1 -0
  16. package/assets/esri/core/workers/chunks/4125b10b1d009f35e75e.js +1 -0
  17. package/assets/esri/core/workers/chunks/48d35993b6ffb76e56e9.js +1 -0
  18. package/assets/esri/core/workers/chunks/5022862c5658e7bb0e04.js +1 -0
  19. package/assets/esri/core/workers/chunks/55782608bee89fa0d6e1.js +1 -0
  20. package/assets/esri/core/workers/chunks/5598996bcf60741aa734.js +1 -0
  21. package/assets/esri/core/workers/chunks/592e9834aa896cdd0e86.js +1 -0
  22. package/assets/esri/core/workers/chunks/5a5e4983c526bf08c7f1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{a6d34147e7dbb1e4609c.js → 5f8acce073b8da5ac6ae.js} +1 -1
  24. package/assets/esri/core/workers/chunks/611c27efa10e4e04d8b6.js +1 -0
  25. package/assets/esri/core/workers/chunks/6ecf0bb8e16159160cde.js +1 -0
  26. package/assets/esri/core/workers/chunks/81949c9d14a8d75c45b6.js +1 -0
  27. package/assets/esri/core/workers/chunks/843a8b87ebecc246598a.js +1 -0
  28. package/assets/esri/core/workers/chunks/84c0a8d41eec91bb5142.js +1 -0
  29. package/assets/esri/core/workers/chunks/85c6a2c7239d0cf73a44.js +1 -0
  30. package/assets/esri/core/workers/chunks/8f3262f33d635cf9f046.js +1 -0
  31. package/assets/esri/core/workers/chunks/9054fd0707a15d037bb9.js +1 -0
  32. package/assets/esri/core/workers/chunks/{c6265aea465769ff758b.js → 995ea389fb778b25d927.js} +1 -1
  33. package/assets/esri/core/workers/chunks/a2e5b67c1c65a93f3c75.js +1 -0
  34. package/assets/esri/core/workers/chunks/a6e57062917ce1a0afa9.js +1 -0
  35. package/assets/esri/core/workers/chunks/b8b6df646ecf5482c5b4.js +1 -0
  36. package/assets/esri/core/workers/chunks/bcdd71e7475777f0f1bb.js +1 -0
  37. package/assets/esri/core/workers/chunks/{97ba79f9bceb42405573.js → bce1d4d6449a646834a1.js} +1 -1
  38. package/assets/esri/core/workers/chunks/c999e9dd748ae449d66e.js +1 -0
  39. package/assets/esri/core/workers/chunks/cb177fb86cf8cec95e87.js +1 -0
  40. package/assets/esri/core/workers/chunks/{3c557a5728c76843561f.js → d3498d28fd01a0ad3899.js} +1 -1
  41. package/assets/esri/core/workers/chunks/dd698ada6b7c03cfd25c.js +1 -0
  42. package/assets/esri/core/workers/chunks/e26acb83eae5eec87ca1.js +1 -0
  43. package/assets/esri/core/workers/chunks/eca1b840c009e5477b80.js +1 -0
  44. package/assets/esri/core/workers/chunks/fbe981e42e92a32d922d.js +1 -0
  45. package/config.js +1 -1
  46. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  47. package/layers/support/layerUtils.js +1 -1
  48. package/layers/support/lazyLayerLoader.js +1 -1
  49. package/package.json +1 -1
  50. package/smartMapping/heuristics/clusterMinSize.js +1 -1
  51. package/support/revision.js +1 -1
  52. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  53. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  54. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  55. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  56. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  57. package/views/layers/ImageryTileLayerView.js +1 -1
  58. package/widgets/Editor.js +1 -1
  59. package/assets/esri/core/workers/chunks/03a811b5a912d83792dd.js +0 -1
  60. package/assets/esri/core/workers/chunks/173febea598431b4e444.js +0 -1
  61. package/assets/esri/core/workers/chunks/1aff09c90f287eeba408.js +0 -1
  62. package/assets/esri/core/workers/chunks/1faf0e2aeabe003e2f64.js +0 -1
  63. package/assets/esri/core/workers/chunks/29662688eedc6df54d4b.js +0 -1
  64. package/assets/esri/core/workers/chunks/2b94b1bc4634f0518890.js +0 -1
  65. package/assets/esri/core/workers/chunks/3664d97f0c2819690cf9.js +0 -1
  66. package/assets/esri/core/workers/chunks/37893e24e4eead6dcec9.js +0 -1
  67. package/assets/esri/core/workers/chunks/3d457f987e2089d67e89.js +0 -1
  68. package/assets/esri/core/workers/chunks/41d25407888326c91566.js +0 -1
  69. package/assets/esri/core/workers/chunks/4503194b1b1d8908a386.js +0 -1
  70. package/assets/esri/core/workers/chunks/4a264b7cfd0a4bc62be9.js +0 -1
  71. package/assets/esri/core/workers/chunks/4cddaa79af86b0981baa.js +0 -1
  72. package/assets/esri/core/workers/chunks/52a06c5eb51ea1d79000.js +0 -1
  73. package/assets/esri/core/workers/chunks/582d12138e6eea62d6fe.js +0 -1
  74. package/assets/esri/core/workers/chunks/5b2bd5829b3831bf9bce.js +0 -1
  75. package/assets/esri/core/workers/chunks/5d946cee3dc0e7311f98.js +0 -1
  76. package/assets/esri/core/workers/chunks/5e9869849d999aac5756.js +0 -1
  77. package/assets/esri/core/workers/chunks/69c89c01783250811b56.js +0 -1
  78. package/assets/esri/core/workers/chunks/72c827a5388a4b1112e3.js +0 -1
  79. package/assets/esri/core/workers/chunks/7db8a429ef7bf11c5bb6.js +0 -1
  80. package/assets/esri/core/workers/chunks/8d52093b6c4bfd087a12.js +0 -1
  81. package/assets/esri/core/workers/chunks/9b449a036598479ad0b0.js +0 -1
  82. package/assets/esri/core/workers/chunks/9c67598554e0d2b2c14a.js +0 -1
  83. package/assets/esri/core/workers/chunks/9f8aad19c5973e201604.js +0 -1
  84. package/assets/esri/core/workers/chunks/9ff12db2f3dcd5749053.js +0 -1
  85. package/assets/esri/core/workers/chunks/a0e3b837262d6d64f605.js +0 -1
  86. package/assets/esri/core/workers/chunks/a213fb1cd2b5da2b7027.js +0 -1
  87. package/assets/esri/core/workers/chunks/a7d2caa47df34a66445a.js +0 -1
  88. package/assets/esri/core/workers/chunks/bb6e4affafef9855b8fd.js +0 -1
  89. package/assets/esri/core/workers/chunks/bd711b7229aa5cfa063b.js +0 -1
  90. package/assets/esri/core/workers/chunks/e384e1daec50f8cdcdd1.js +0 -1
  91. package/assets/esri/core/workers/chunks/eccc725bc3f8047171f7.js +0 -1
  92. package/assets/esri/core/workers/chunks/f7ed302a233d4cfb9060.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6368],{57435:(e,t,r)=>{r.d(t,{Z:()=>p});var i=r(43697),s=r(46791),o=r(70586),n=(r(80442),r(20102),r(92604),r(26258),r(87538)),a=r(5600),l=(r(75215),r(67676),r(52011));let u=class extends s.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.own((0,n.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,o.pC)(this.getCollections)?this.getCollections():null;if((0,o.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,o.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new s.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,a.Cb)()],u.prototype,"getCollections",void 0),(0,i._)([(0,a.Cb)()],u.prototype,"getChildrenFunction",void 0),(0,i._)([(0,a.Cb)()],u.prototype,"itemFilterFunction",void 0),u=(0,i._)([(0,l.j)("esri.core.CollectionFlattener")],u);const p=u},23670:(e,t,r)=>{r.d(t,{G:()=>s});var i=r(20102);let s=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new s(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),n=/^\s*\d+\s*$/;if(!r||!r.match||!r.match(n))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o||!o.match||!o.match(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),l=parseInt(o,10);return new s(a,l,t)}}},68668:(e,t,r)=>{r.d(t,{G:()=>a,w:()=>l});var i=r(66643),s=r(46791),o=r(83379),n=r(70586);async function a(e,t){return await e.load(),l(e,t)}async function l(e,t){const r=[],a=(...e)=>{for(const t of e)(0,n.Wi)(t)||(Array.isArray(t)?a(...t):s.Z.isCollection(t)?t.forEach((e=>a(e))):o.Z.isLoadable(t)&&r.push(t))};t(a);let l=null;if(await(0,i.UI)(r,(async e=>{const t=await(0,i.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||l||(l=t)})),l)throw l.error;return e}},42033:(e,t,r)=>{r.d(t,{E:()=>s,_:()=>o});var i=r(70586);async function s(e,t){const{WhereClause:i}=await r.e(1534).then(r.bind(r,41534));return i.create(e,t)}function o(e,t){return(0,i.pC)(e)?(0,i.pC)(t)?`(${e}) AND (${t})`:e:t}},74654:(e,t,r)=>{r.d(t,{Z:()=>A});var i=r(43697),s=r(15923),o=r(20102),n=r(80442),a=r(70586),l=r(95330),u=r(17452),p=r(5600),d=(r(75215),r(67676),r(52011)),c=r(10158),y=r(11282),h=r(41818),f=(r(66577),r(34599)),m=r(14165),b=r(6570),g=r(5396),S=r(4967),v=r(69285),w=r(98732);function _(e,t){return t}function C(e,t,r,i){switch(r){case 0:return E(e,t+i,0);case 1:return"lowerLeft"===e.originPosition?E(e,t+i,1):function({translate:e,scale:t},r,i){return e[i]-r*t[i]}(e,t+i,1)}}function I(e,t,r,i){return 2===r?E(e,t,2):C(e,t,r,i)}function x(e,t,r,i){return 2===r?E(e,t,3):C(e,t,r,i)}function F(e,t,r,i){return 3===r?E(e,t,3):I(e,t,r,i)}function E({translate:e,scale:t},r,i){return e[i]+r*t[i]}class T{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=_,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,v.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!(0,a.Wi)(t))for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,a.O3)(r),r.push(t);const i=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of i)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:i}=t,s=(0,w.$g)(r.clone(),r,!1,!1,this._transform),o=(0,w.di)(s,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const i=(0,a.s3)(this._transform,"transform");switch(t=this._applyTransform(i,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const i=(0,a.s3)(this._transform,"transform");return this._applyTransform(i,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const i=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(i)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const i=this._transformPathLikeValue(t,r),s=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=i}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?F:t?I:r?x:C}}var O=r(74889);let D=class extends s.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,u.mN)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],s=(0,n.Z)("featurelayer-pbf-statistics"),o=!i||s;let a;if(this.pbfSupported&&o)try{a=await async function(e,t,r){const i=(0,y.en)(e),s={...r},o=m.Z.from(t),n=!o.quantizationParameters,{data:a}=await(0,f.qp)(i,o,new T({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),s);return a}(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await(0,S.F)(this.url,r,t)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,t,i){if(!this._queryIs3DObjectFormat(e)||(0,a.Wi)(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return O.Z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await(0,l.Hl)(Promise.all([r.e(6481),r.e(6459),r.e(1932)]).then(r.bind(r,21932)),i);return s(e,this.infoFor3D,t)}executeForCount(e,t){return(0,h.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const i=(0,y.en)(e);return(0,f.Vr)(i,m.Z.from(t),{...r}).then((e=>({count:e.data.count,extent:b.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,g.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:i},{executeRelationshipQuery:s}]=await(0,l.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:i},{executeRelationshipQueryForCount:s}]=await(0,l.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:i,fetchAttachments:s,processAttachmentQueryResult:o}=await(0,l.Hl)(r.e(540).then(r.bind(r,30540)),t),n=(0,y.en)(this.url);return o(n,await(this.queryAttachmentsSupported?i(n,e,t):s(n,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:i}=await(0,l.Hl)(r.e(1158).then(r.bind(r,71158)),t);return i(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:i}=await(0,l.Hl)(r.e(3992).then(r.bind(r,33992)),t);return i(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:i}=await(0,l.Hl)(r.e(1790).then(r.bind(r,21790)),t);return i(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:i}=await(0,l.Hl)(r.e(4371).then(r.bind(r,14371)),t);return i(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.n.from(e.dynamicDataSource):this.dynamicDataSource),(0,a.pC)(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new o.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if((0,a.Wi)(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,(0,a.Wi)(t.outFields)&&(t.outFields=[]);const{originX:r,originY:i,originZ:s,translationX:o,translationY:n,translationZ:l,scaleX:u,scaleY:p,scaleZ:d,rotationX:c,rotationY:y,rotationZ:h,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(r,i,s,o,n,l,u,p,d,c,y,h,f)}}return t}_normalizeFields(e){if((0,a.pC)(this.fieldsIndex)&&(0,a.pC)(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return(0,a.pC)(this.infoFor3D)&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,i._)([(0,p.Cb)({type:c.n})],D.prototype,"dynamicDataSource",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"fieldsIndex",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"gdbVersion",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"infoFor3D",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],D.prototype,"parsedUrl",null),(0,i._)([(0,p.Cb)()],D.prototype,"pbfSupported",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"queryAttachmentsSupported",void 0),(0,i._)([(0,p.Cb)()],D.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,p.Cb)({type:String})],D.prototype,"url",void 0),D=(0,i._)([(0,d.j)("esri.tasks.QueryTask")],D);const A=D},54295:(e,t,r)=>{r.d(t,{V:()=>n});var i=r(43697),s=r(5600),o=(r(75215),r(67676),r(52011));const n=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},7944:(e,t,r)=>{r.d(t,{O:()=>h});var i=r(43697),s=r(3172),o=r(95330),n=r(17452),a=r(23670),l=r(5600),u=(r(75215),r(67676),r(71715)),p=r(52011),d=r(6570),c=r(82971),y=r(21506);const h=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));if(!r)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const i=this.type,s="tile"!==i&&!!t.supportsDynamicLayers,o=r.includes("query"),n=r.includes("map"),l=!!t.exportTilesAllowed,u=r.includes("tilemap"),p=r.includes("data"),d="tile"!==i&&(!t.tileInfo||s),c="tile"!==i&&(!t.tileInfo||s),y="tile"!==i,h=t.cimVersion&&a.G.parse(t.cimVersion),f=h?.since(1,4)??!1,m=h?.since(2,0)??!1;return{operations:{supportsExportMap:n,supportsExportTiles:l,supportsIdentify:o,supportsQuery:p,supportsTileMap:u},exportMap:n?{supportsArcadeExpressionForLabeling:f,supportsSublayersChanges:y,supportsDynamicLayers:s,supportsSublayerVisibility:d,supportsSublayerDefinitionExpression:c,supportsCIMSymbols:m}:null,exportTiles:l?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("capabilities")||t.hasOwnProperty("tables")?10:t.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),r}async fetchSublayerInfo(e,t){return await this.fetchAllLayersAndTables(t),this._allLayersAndTablesMap?.get(e)}async fetchAllLayersAndTables(e){await this.load(e),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=(0,s.default)((0,n.mN)(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then((e=>{this._allLayersAndTablesMap=new Map;for(const t of e.data.layers)this._allLayersAndTablesMap.set(t.id,t);return{result:e.data}}),(e=>({error:e}))));const t=await this._allLayersAndTablesPromise;if((0,o.k_)(e),"result"in t)return t.result;throw t.error}};return(0,i._)([(0,l.Cb)({readOnly:!0})],t.prototype,"capabilities",void 0),(0,i._)([(0,u.r)("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),(0,i._)([(0,l.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,l.Cb)({type:d.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,l.Cb)(y.id)],t.prototype,"id",void 0),(0,i._)([(0,l.Cb)({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),(0,i._)([(0,l.Cb)(y.C_)],t.prototype,"popupEnabled",void 0),(0,i._)([(0,l.Cb)({type:c.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,u.r)("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=(0,i._)([(0,p.j)("esri.layers.mixins.ArcGISMapService")],t),t}},10343:(e,t,r)=>{r.d(t,{x:()=>g});var i=r(43697),s=r(46791),o=r(57435),n=r(20102),a=r(92604),l=r(17445),u=r(5600),p=(r(75215),r(67676),r(1153)),d=r(52011),c=r(31263),y=r(49867),h=r(32073);const f=a.Z.getLogger("esri.layers.TileLayer"),m=s.Z.ofType(y.Z);function b(e,t){e&&e.forEach((e=>{t(e),e.sublayers&&e.sublayers.length&&b(e.sublayers,t)}))}const g=e=>{let t=class extends e{constructor(...e){super(...e),this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[c.s3.SERVICE]:{},[c.s3.PORTAL_ITEM]:{},[c.s3.WEB_SCENE]:{},[c.s3.WEB_MAP]:{}},this.addHandles((0,l.YP)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),l.Z_))}readSublayers(e,t){if(!t||!e)return;const{sublayersSourceJSON:r}=this,i=(0,c.M9)(t.origin);if(i<c.s3.SERVICE)return;if(r[i]={context:t,visibleLayers:e.visibleLayers||r[i].visibleLayers,layers:e.layers||r[i].layers},i>c.s3.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:s,origin:o}=this.createSublayersForOrigin("web-document"),n=(0,p.vw)(this);n.setDefaultOrigin(o),this._set("sublayers",new m(s)),n.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const t=(0,c.M9)("web-document"===e?"web-map":e);let r=c.s3.SERVICE,i=this.sublayersSourceJSON[c.s3.SERVICE].layers,s=this.sublayersSourceJSON[c.s3.SERVICE].context,o=null;const n=[c.s3.PORTAL_ITEM,c.s3.WEB_SCENE,c.s3.WEB_MAP].filter((e=>e<=t));for(const e of n){const t=this.sublayersSourceJSON[e];(0,h.ac)(t.layers)&&(r=e,i=t.layers,s=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}const a=[c.s3.PORTAL_ITEM,c.s3.WEB_SCENE,c.s3.WEB_MAP].filter((e=>e>r&&e<=t));let l=null;for(const e of a){const{layers:t,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];t&&(l={layers:t,context:i}),r&&(o={visibleLayers:r,context:i})}const u=function(e,t){const r=[],i={};return e?(e.forEach((e=>{const s=new y.Z;if(s.read(e,t),i[s.id]=s,null!=e.parentLayerId&&-1!==e.parentLayerId){const t=i[e.parentLayerId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(s)}else r.unshift(s)})),r):r}(i,s),p=new Map,d=new Set;if(l)for(const e of l.layers)p.set(e.id,e);if(o?.visibleLayers)for(const e of o.visibleLayers)d.add(e);return b(u,(e=>{l&&e.read(p.get(e.id),l.context),o&&e.read({defaultVisibility:d.has(e.id)},o.context)})),{origin:(0,c.x3)(r),sublayers:new m({items:u})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.handles.add(e.on("before-changes",(e=>{f.error(new n.Z("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"allSublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,type:s.Z.ofType(y.Z)})],t.prototype,"serviceSublayers",void 0),(0,i._)([(0,u.Cb)({value:null,type:m,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),t=(0,i._)([(0,d.j)("esri.layers.mixins.SublayersOwner")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>d});var i=r(43697),s=r(2368),o=r(35454),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(52011));const u=new o.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,s.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,i._)([(0,a.Cb)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,i._)([(0,l.j)("esri.layers.support.FeatureTemplate")],p);const d=p},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var i=r(43697),s=r(2368),o=r(96674),n=r(5600),a=(r(75215),r(67676),r(71715)),l=r(52011),u=r(30556),p=r(72729),d=r(70082);let c=class extends((0,s.J)(o.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"id",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i._)([(0,a.r)("domains")],c.prototype,"readDomains",null),(0,i._)([(0,u.c)("domains")],c.prototype,"writeDomains",null),(0,i._)([(0,n.Cb)({type:[d.Z],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i._)([(0,l.j)("esri.layers.support.FeatureType")],c);const y=c},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var i,s=r(43697),o=r(46791),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(52011));let u=i=class extends n.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=i=(0,s._)([(0,l.j)("esri.layers.support.LayerFloorInfo")],u);const p=u},49867:(e,t,r)=>{r.d(t,{Z:()=>X});var i,s=r(43697),o=(r(66577),r(51773)),n=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(9790),u=r(46791),p=r(20102),d=r(3920),c=r(80442),y=r(10699),h=r(22974),f=r(83379),m=r(92604),b=r(70586),g=r(16453),S=r(42033),v=r(17452),w=r(5600),_=r(90578),C=r(71715),I=r(52011),x=r(30556),F=r(75215),E=r(31263),T=r(1153),O=r(74654),D=r(16451),A=r(1231),P=r(99514),L=r(54306),R=r(30707),j=r(56765),M=r(72064),Z=r(10158),V=r(42843),N=r(56545),q=r(14165),Q=r(32163),G=r(6570),k=r(86973);function z(e){return null!=e&&"esriSMS"===e.type}function U(e,t,r){const i=this.originIdOf(t)>=(0,E.M9)(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&"map-image"===r.layer?.type&&(r.writeSublayerStructure||i)}}function B(e,t,r){return{enabled:!!r&&"tile"===r.layer?.type&&this._isOverridden(t)}}function J(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function W(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=(0,E.M9)(r.origin))}}let H=0;const $=new Set;$.add("layer"),$.add("parent"),$.add("loaded"),$.add("loadStatus"),$.add("loadError"),$.add("loadWarnings");let K=i=class extends((0,d.p)((0,g.R)((0,y.IG)(f.Z)))){constructor(e){super(e),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,source:r,url:i}=this;if(!t&&!i)throw new p.Z("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let s=null;if(!t||this.originIdOf("url")>E.s3.SERVICE||"data-layer"===r?.type)s=(await(0,a.default)(i,{responseType:"json",query:{f:"json"},...e})).data;else{let i=this.id;"map-layer"===r?.type&&(i=r.mapLayerId),s=await t.fetchSublayerInfo(i,e)}s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service"}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:o}}=(0,M.h)(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:o},query:{supportsFormatPBF:s}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get fieldsIndex(){return new P.Z(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeGlobalID"===e.type)return e.name}get id(){return this._get("id")??H++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition&&t.layerDefinition.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition&&t.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeOID"===e.type)return e.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const r=t.layerDefinition;return 1-.01*((null!=r?.transparency?r.transparency:r?.drawingInfo?.transparency)??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=(0,F.vU)(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,t="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:r,fieldsIndex:i}=this,s=(0,c.Z)("featurelayer-pbf")&&r?.query.supportsFormatPBF,o=r?.operations?.supportsQueryAttachments??!1;return new O.Z({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:t,sourceSpatialReference:e,queryAttachmentsSupported:o})}set renderer(e){if(e)for(const t of e.getSymbols())if((0,l.dU)(t)){m.Z.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new V.R({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return(0,F.se)(u.Z.ofType(i),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===t?.type)return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${(0,v.B7)(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=(0,T.vw)(this),t=new i;return(0,T.vw)(t).store=e.clone($),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return(0,Q.eZ)(this,e)}createQuery(){return new q.Z({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const{layer:e}=this,t=e?.parsedUrl,i=new(0,(await Promise.all([r.e(5546),r.e(9942),r.e(9238)]).then(r.bind(r,19238))).default)({url:t?.path});return t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source),null!=e?.refreshInterval&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=(0,h.d9)(this.floorInfo)),this.originIdOf("labelingInfo")>E.s3.SERVICE&&(i.labelingInfo=(0,h.d9)(this.labelingInfo)),this.originIdOf("labelsVisible")>E.s3.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>E.s3.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>E.s3.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>E.s3.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>E.s3.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>E.s3.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>E.s3.DEFAULTS&&(i.popupTemplate=(0,h.d9)(this.popupTemplate)),this.originIdOf("renderer")>E.s3.SERVICE&&(i.renderer=(0,h.d9)(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>E.s3.DEFAULTS&&(i.title=this.title),"map-image"===e?.type&&e.originIdOf("customParameters")>E.s3.DEFAULTS&&(i.customParameters=e.customParameters),"tile"===e?.type&&e.originIdOf("customParameters")>E.s3.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let s=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(s=e),!!s)})),s}getFieldDomain(e,t){const r=t&&t.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=N.Z.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new p.Z("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:o,num:n,size:a,start:l,where:u}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||o?.length>0||a?.length>0||n||l||u))throw new p.Z("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||o?.length||u))throw new p.Z("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new p.Z("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new p.Z("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const e of r.features)e.sourceLayer=this;return r}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=(0,S._)(e,this.definitionExpression);(0,b.pC)(r)&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,t)=>(e[t]=this.originIdOf(t),e)),{}),s=Object.keys(i).some((e=>i[e]>E.s3.SERVICE));if(s){const e=t.drawingInfo={};if(i.renderer>E.s3.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>E.s3.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>E.s3.SERVICE){!this.loaded&&this.labelingInfo.some((e=>!e.labelPlacement))&&m.Z.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;(0,b.pC)(this.geometryType)&&(t=(0,R.a)(this.labelingInfo,k.M.toJSON(this.geometryType))),e.labelingInfo=t.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer}))),e.showLabels=!0}i.opacity>E.s3.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of r)z(e.symbol)&&t(e.symbol);"symbol"in e&&z(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&z(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,o;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",o="supportsModification"}const n=(0,T.vw)(this).getDefaultOrigin();if("service"!==n){if(s&&!1===this.layer?.capabilities?.exportMap?.[s])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(o&&!1===this.capabilities?.exportMap[o])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${o}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,t),"service"!==n&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.handles.removeAll()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const t=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==t||t||(m.Z.getLogger(this.declaredClass).error(new p.Z("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;m.Z.getLogger(i).error(new p.Z("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};K.test={isMapImageLayerOverridePolicy:e=>e===J||e===U,isTileImageLayerOverridePolicy:e=>e===B},(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"capabilities",void 0),(0,s._)([(0,C.r)("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],K.prototype,"readCapabilities",null),(0,s._)([(0,w.Cb)()],K.prototype,"defaultPopupTemplate",null),(0,s._)([(0,w.Cb)({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:U}}})],K.prototype,"definitionExpression",null),(0,s._)([(0,w.Cb)({type:[A.Z],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],K.prototype,"fields",void 0),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"fieldsIndex",null),(0,s._)([(0,w.Cb)({type:j.Z,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:U},origins:{"web-scene":{read:!1,write:!1}}}})],K.prototype,"floorInfo",null),(0,s._)([(0,w.Cb)({type:G.Z,json:{read:{source:"layerDefinition.extent"}}})],K.prototype,"fullExtent",void 0),(0,s._)([(0,w.Cb)({type:k.M.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:k.M.read}}}}})],K.prototype,"geometryType",void 0),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"globalIdField",void 0),(0,s._)([(0,C.r)("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],K.prototype,"readGlobalIdFieldFromService",null),(0,s._)([(0,w.Cb)({type:F.z8,json:{write:{ignoreOrigin:!0}}})],K.prototype,"id",null),(0,s._)([(0,w.Cb)({value:null,type:[L.Z],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:J}}})],K.prototype,"labelingInfo",null),(0,s._)([(0,x.c)("labelingInfo")],K.prototype,"writeLabelingInfo",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:J}}})],K.prototype,"labelsVisible",null),(0,s._)([(0,w.Cb)({value:null})],K.prototype,"layer",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:W}}})],K.prototype,"legendEnabled",void 0),(0,s._)([(0,w.Cb)({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],K.prototype,"listMode",null),(0,s._)([(0,w.Cb)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"minScale",null),(0,s._)([(0,C.r)("minScale",["minScale","layerDefinition.minScale"])],K.prototype,"readMinScale",null),(0,s._)([(0,w.Cb)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"maxScale",null),(0,s._)([(0,C.r)("maxScale",["maxScale","layerDefinition.maxScale"])],K.prototype,"readMaxScale",null),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"effectiveScaleRange",null),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"objectIdField",void 0),(0,s._)([(0,C.r)("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],K.prototype,"readObjectIdFieldFromService",null),(0,s._)([(0,w.Cb)({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:J}}})],K.prototype,"opacity",null),(0,s._)([(0,C.r)("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],K.prototype,"readOpacity",null),(0,s._)([(0,x.c)("opacity")],K.prototype,"writeOpacity",null),(0,s._)([(0,w.Cb)({json:{type:F.z8,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:J}}})],K.prototype,"parent",void 0),(0,s._)([(0,x.c)("parent")],K.prototype,"writeParent",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:W,writer(e,t,r){t[r]=!e}}}})],K.prototype,"popupEnabled",void 0),(0,s._)([(0,w.Cb)({type:o.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:W}}})],K.prototype,"popupTemplate",void 0),(0,s._)([(0,w.Cb)({readOnly:!0})],K.prototype,"queryTask",null),(0,s._)([(0,w.Cb)({types:n.A,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J},origins:{"web-scene":{types:n.o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J}}}}})],K.prototype,"renderer",null),(0,s._)([(0,w.Cb)({types:{key:"type",base:null,typeMap:{"data-layer":Z.n,"map-layer":V.R}},cast(e){if(e){if("mapLayerId"in e)return(0,F.TJ)(V.R,e);if("dataSource"in e)return(0,F.TJ)(Z.n,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:J}}})],K.prototype,"source",null),(0,s._)([(0,w.Cb)()],K.prototype,"sourceJSON",void 0),(0,s._)([(0,w.Cb)({value:null,json:{type:[F.z8],write:{target:"subLayerIds",allowNull:!0,overridePolicy:J}}})],K.prototype,"sublayers",null),(0,s._)([(0,_.p)("sublayers")],K.prototype,"castSublayers",null),(0,s._)([(0,x.c)("sublayers")],K.prototype,"writeSublayers",null),(0,s._)([(0,w.Cb)({type:String,json:{name:"name",write:{overridePolicy:W}}})],K.prototype,"title",void 0),(0,s._)([(0,w.Cb)({type:String})],K.prototype,"typeIdField",void 0),(0,s._)([(0,C.r)("typeIdField",["layerDefinition.typeIdField"])],K.prototype,"readTypeIdField",null),(0,s._)([(0,w.Cb)({type:[D.Z],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],K.prototype,"types",void 0),(0,s._)([(0,w.Cb)({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:B}}})],K.prototype,"url",null),(0,s._)([(0,w.Cb)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:J}}})],K.prototype,"visible",null),(0,s._)([(0,x.c)("visible")],K.prototype,"writeVisible",null),K=i=(0,s._)([(0,I.j)("esri.layers.support.Sublayer")],K);const X=K},90082:(e,t,r)=>{r.d(t,{g:()=>s});var i=r(20102);async function s(e,t){try{return await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}}},72064:(e,t,r)=>{r.d(t,{h:()=>d});var i=r(80442),s=r(70586),o=r(66677);const n={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function a(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function l(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function d(e,t){return{analytics:c(e),attachment:y(e),data:h(e),metadata:f(e),operations:m(e.capabilities,e,t),query:b(e,t),queryRelated:g(e),queryTopFeatures:S(e),editing:v(e)}}function c(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:a(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=n[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:a(e,"isDataVersioned",!1),supportsAttachment:a(e,"hasAttachments",!1),supportsM:a(e,"hasM",!1),supportsZ:a(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:a(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const i=e?e.toLowerCase().split(",").map((e=>e.trim())):[],n=r?(0,o.Qc)(r):null,l=i.includes((0,s.pC)(n)&&"MapServer"===n.serverType?"data":"query"),u=i.includes("editing")&&!t.datesInUnknownTimezone;let p=u&&i.includes("create"),d=u&&i.includes("delete"),c=u&&i.includes("update");const y=i.includes("changetracking"),h=t.advancedQueryCapabilities;return u&&!(p||d||c)&&(p=d=c=!0),{supportsCalculate:a(t,"supportsCalculate",!1),supportsTruncate:a(t,"supportsTruncate",!1),supportsValidateSql:a(t,"supportsValidateSql",!1),supportsAdd:p,supportsDelete:d,supportsEditing:u,supportsChangeTracking:y,supportsQuery:l,supportsQueryAnalytics:a(h,"supportsQueryAnalytic",!1),supportsQueryAttachments:a(h,"supportsQueryAttachments",!1),supportsQueryTopFeatures:a(h,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:a(t,"supportsAttachmentsResizing",!1),supportsSync:i.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:a(t,"supportsExceedsLimitStatistics",!1)}}function b(e,t){const r=e.advancedQueryCapabilities,s=e.ownershipBasedAccessControlForFeatures,n=e.archivingInfo,d=e.currentVersion,c=t?.includes("MapServer"),y=!c||d>=(0,i.Z)("mapserver-pbf-version-support"),h=(0,o.M8)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:a(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:a(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:a(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:a(r,"supportsReturningGeometryCentroid",!1),supportsDistance:a(r,"supportsQueryWithDistance",!1),supportsDistinct:a(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:a(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:a(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:a(r,"supportsHavingClause",!1),supportsOrderBy:a(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:a(r,"supportsPagination",!1),supportsQuantization:a(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:a(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:a(e,"supportsReturningQueryGeometry",!1),supportsResultType:a(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:a(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:a(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:a(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:a(r,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:a(s,"allowOthersToQuery",!0),supportsHistoricMoment:a(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&f.has("pbf"),supportsDisjointSpatialRelationship:a(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:a(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:a(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:a(r,"supportsFullTextSearch",!1),maxRecordCountFactor:l(e,"maxRecordCountFactor",void 0),maxRecordCount:l(e,"maxRecordCount",void 0),standardMaxRecordCount:l(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:l(e,"tileMaxRecordCount",void 0)}}function g(e){const t=e.advancedQueryCapabilities,r=a(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:a(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function S(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function v(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:a(e,"allowGeometryUpdates",!0),supportsGlobalId:a(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:a(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:a(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:a(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:a(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:a(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:a(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:a(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:a(t,"allowOthersToUpdate",!0)}}},32073:(e,t,r)=>{r.d(t,{FN:()=>n,QV:()=>o,ac:()=>l});var i=r(70586),s=r(31263);function o(e,t,r){const i=t.flatten((({sublayers:e})=>e)).length;return i!==e.length||!!e.some((e=>e.originIdOf("minScale")>r||e.originIdOf("maxScale")>r||e.originIdOf("renderer")>r||e.originIdOf("labelingInfo")>r||e.originIdOf("opacity")>r||e.originIdOf("labelsVisible")>r||e.originIdOf("source")>r))||!a(e,t)}function n(e,t,r){return!!e.some((e=>{const t=e.source;return!(!t||"map-layer"===t.type&&t.mapLayerId===e.id&&((0,i.Wi)(t.gdbVersion)||t.gdbVersion===r))||e.originIdOf("renderer")>s.s3.SERVICE||e.originIdOf("labelingInfo")>s.s3.SERVICE||e.originIdOf("opacity")>s.s3.SERVICE||e.originIdOf("labelsVisible")>s.s3.SERVICE}))||!a(e,t)}function a(e,t){if(!e||!e.length||(0,i.Wi)(t))return!0;const r=t.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).map((e=>e.id)).toArray();if(e.length>r.length)return!1;let s=0;const o=r.length;for(const{id:t}of e){for(;s<o&&r[s]!==t;)s++;if(s>=o)return!1}return!0}function l(e){return!!e&&e.some((e=>null!=e.minScale||e.layerDefinition&&null!=e.layerDefinition.minScale))}},51706:(e,t,r)=>{var i,s;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?i.Expression:e.field&&"string"==typeof e.field?i.Field:i.Unknown}function l(e,t){const r=t||a(e),o=e.valueUnit||"unknown";return r===i.Unknown?s.Constant:e.stops?s.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?s.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?s.Proportional:s.Additive:s.Identity:s.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>i,hL:()=>s,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(i||(i={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(s||(s={}))},41818:(e,t,r)=>{r.d(t,{P:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.hH)(n,o.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.Ev)(n,o.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>l,e:()=>a});var i=r(11282),s=r(34599),o=r(74889),n=r(14165);async function a(e,t,r){const i=await l(e,t,r);return o.Z.fromJSON(i)}async function l(e,t,r){const o=(0,i.en)(e),a={...r},l=n.Z.from(t),{data:u}=await(0,s.JT)(o,l,l.sourceSpatialReference,a);return u}},28694:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(70586),s=r(69285);function o(e,t,r){if(!r||!r.features||!r.hasZ)return;const o=(0,s.k)(r.geometryType,t,e.outSpatialReference);if(!(0,i.Wi)(o))for(const e of r.features)o(e.geometry)}},56545:(e,t,r)=>{r.d(t,{Z:()=>c});var i,s=r(43697),o=r(96674),n=r(22974),a=r(5600),l=r(75215),u=r(52011),p=r(30556);let d=i=class extends o.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new i((0,n.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"attachmentTypes",void 0),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],d.prototype,"attachmentsWhere",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],d.prototype,"cacheHint",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"globalIds",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],d.prototype,"num",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"objectIds",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{default:!1,write:!0}})],d.prototype,"returnMetadata",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"size",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],d.prototype,"start",void 0),(0,s._)([(0,p.c)("start"),(0,p.c)("num")],d.prototype,"writeStart",null),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],d.prototype,"where",void 0),d=i=(0,s._)([(0,u.j)("esri.rest.support.AttachmentQuery")],d),d.from=(0,l.se)(d);const c=d},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var i,s=r(43697),o=r(66577),n=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(70586),d=r(5600),c=(r(75215),r(71715)),y=r(52011),h=r(30556),f=r(82971),m=r(33955),b=r(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let S=i=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=n.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;(0,p.pC)(o.geometry)&&!a&&(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&(0,p.pC)(u))for(const e in u){const t=u[e],i=l[e]?.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}i.push(o)}return i}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(e&&(0,p.pC)(e.geometry))return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,m.im)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=f.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=o.length;e<t;e++)n?.((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[o,n]}=r,a=this._getHydrationFunction(e,(e=>e*o+i),(e=>s-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&a&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const o=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===i&&n===s||(o.push([e-i,n-s]),i=e,s=n)}else i=t(a[0]),s=r(a[1]),o.push([i,s])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,m.oU)(e)?e.rings:e.paths,s=[];for(let e=0,o=i.length;e<o;e++){const o=i[e],n=this._quantizePoints(o,t,r);n&&s.push(n)}return s.length>0?((0,m.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const i=(0,m.oU)(e)?e.rings:e.paths;let s,o;for(let e=0,n=i.length;e<n;e++){const n=i[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(s+=i[0],o+=i[1]):(s=i[0],o=i[1]),i[0]=t(s),i[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const i=e.points;let s,o;for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],o+=n[1]):(s=n[0],o=n[1]),n[0]=t(s),n[1]=r(o)}}:null}};(0,s._)([(0,d.Cb)({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,d.Cb)({type:[n.Z],json:{write:!0}})],S.prototype,"features",void 0),(0,s._)([(0,c.r)("features")],S.prototype,"readFeatures",null),(0,s._)([(0,d.Cb)({type:[b.Z],json:{write:!0}})],S.prototype,"fields",void 0),(0,s._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],S.prototype,"geometryType",void 0),(0,s._)([(0,h.c)("geometryType")],S.prototype,"writeGeometryType",null),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasM",void 0),(0,s._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasZ",void 0),(0,s._)([(0,d.Cb)({types:o.qM,json:{write:!0}})],S.prototype,"queryGeometry",void 0),(0,s._)([(0,c.r)("queryGeometry")],S.prototype,"readQueryGeometry",null),(0,s._)([(0,d.Cb)({type:f.Z,json:{write:!0}})],S.prototype,"spatialReference",void 0),(0,s._)([(0,h.c)("spatialReference")],S.prototype,"writeSpatialReference",null),(0,s._)([(0,d.Cb)({json:{write:!0}})],S.prototype,"transform",void 0),S=i=(0,s._)([(0,y.j)("esri.rest.support.FeatureSet")],S),S.prototype.toJSON.isDefaultToJSON=!0;const v=S},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>s,eG:()=>l,lF:()=>n,lj:()=>p,qP:()=>a,wW:()=>u});const i=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8008,8062],{52104:(e,a,t)=>{t.d(a,{V:()=>n});var r=t(96187);async function n(e,a){const t=await(0,r.T)(e,a);t.layers=t.layers.filter(s);const n={serviceJSON:t};if((t.currentVersion??0)<10.5)return n;const i=await(0,r.T)(e+"/layers",a);return n.layersJSON={layers:i.layers.filter(s),tables:i.tables},n}function s(e){return!e.type||"Feature Layer"===e.type}},87344:(e,a,t)=>{t.d(a,{T:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(8153)]).then(t.bind(t,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(3975),t.e(5590),t.e(8239),t.e(223)]).then(t.bind(t,30223))).default,CSVLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(9675)]).then(t.bind(t,45425))).default,DimensionLayer:async()=>(await Promise.all([t.e(5103),t.e(81)]).then(t.bind(t,40081))).default,ElevationLayer:async()=>(await Promise.all([t.e(3055),t.e(9230)]).then(t.bind(t,65665))).default,FeatureLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(5159)]).then(t.bind(t,19238))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(7202)]).then(t.bind(t,23477))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(9790),t.e(9538)]).then(t.bind(t,3723))).default,GroupLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(7483)]).then(t.bind(t,89348))).default,ImageryLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(4165),t.e(4599),t.e(6610),t.e(4242),t.e(665)]).then(t.bind(t,45378))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(3055),t.e(6610),t.e(4242),t.e(8104),t.e(8915)]).then(t.bind(t,92045))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(2710),t.e(3975),t.e(1537)]).then(t.bind(t,9310))).default,KMLLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(739)]).then(t.bind(t,42756))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(5103),t.e(690)]).then(t.bind(t,30690))).default,MapImageLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(4599),t.e(6368),t.e(7374)]).then(t.bind(t,27374))).default,MapNotesLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(1227)]).then(t.bind(t,62128))).default,MediaLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(1984)]).then(t.bind(t,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(2855)]).then(t.bind(t,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(9971),t.e(6237)]).then(t.bind(t,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(5132)]).then(t.bind(t,76604))).default,PointCloudLayer:async()=>(await Promise.all([t.e(2710),t.e(4729),t.e(3975),t.e(8643),t.e(6772)]).then(t.bind(t,10608))).default,RouteLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4286)]).then(t.bind(t,40153))).default,SceneLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(9942),t.e(9238),t.e(3975),t.e(5590),t.e(8239),t.e(7476)]).then(t.bind(t,57476))).default,StreamLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(5004)]).then(t.bind(t,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(9942),t.e(908)]).then(t.bind(t,30359))).default,TileLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(4599),t.e(3055),t.e(6368),t.e(8636)]).then(t.bind(t,98636))).default,UnknownLayer:async()=>(await t.e(4166).then(t.bind(t,44166))).default,UnsupportedLayer:async()=>(await t.e(9296).then(t.bind(t,39296))).default,VectorTileLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(3055),t.e(4325),t.e(1785),t.e(719)]).then(t.bind(t,94756))).default,VoxelLayer:async()=>(await Promise.all([t.e(2710),t.e(4729),t.e(3975),t.e(9327)]).then(t.bind(t,28865))).default,WFSLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(8244),t.e(1223),t.e(1423),t.e(4165),t.e(911),t.e(5546),t.e(3974)]).then(t.bind(t,12653))).default,WMSLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(4729),t.e(9790),t.e(2462)]).then(t.bind(t,25906))).default,WMTSLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(9971),t.e(5853)]).then(t.bind(t,55853))).default,WebTileLayer:async()=>(await Promise.all([t.e(2710),t.e(1612),t.e(9971)]).then(t.bind(t,16199))).default}},33516:(e,a,t)=>{t.d(a,{Y:()=>i,h:()=>s});var r=t(17452),n=t(65587);function s(e){return{origin:"portal-item",url:(0,r.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function i(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,r.mN)(e.itemUrl):null,portal:e.portal||n.Z.getDefault(),portalItem:e}}},18062:(e,a,t)=>{t.r(a),t.d(a,{getFirstLayerOrTableId:()=>h,getNumLayersAndTables:()=>g,getSubtypeGroupLayerIds:()=>S,load:()=>p,preprocessFSItemData:()=>b});var r=t(20102),n=t(87085),s=t(66677),i=t(52104),l=t(65587),o=t(15235),c=t(33516),u=t(14661),y=t(40555),d=t(96187);async function p(e,a){const t=e.instance.portalItem;if(t&&t.id)return await t.load(a),function(e){const a=e.instance.portalItem;if(!a?.type||!e.supportedTypes.includes(a.type))throw new r.Z("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:e.supportedTypes.join(", ")})}(e),async function(e,a){const t=e.instance,n=t.portalItem;if(!n)return;const{url:s,title:l}=n,o=(0,c.h)(n);if("group"===t.type)return t.read({title:l},o),async function(e,a){let t;const{portalItem:n}=e;if(!n)return;const s=n.type,l=a.layerModuleTypeMap,o=(0,u._$)(n,"Oriented Imagery Layer")??!1;switch(s){case"Feature Service":t=o?l.OrientedImageryLayer:l.FeatureLayer;break;case"Stream Service":t=l.StreamLayer;break;case"Scene Service":t=l.SceneLayer;break;case"Feature Collection":t=l.FeatureLayer;break;default:throw new r.Z("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}let[c,y]=await Promise.all([t(),L(a)]),p=()=>c;if("Feature Service"===s){if(y=n.url?await b(y,n.url):{},S(y).length){const e=l.SubtypeGroupLayer,a=await e();p=e=>"SubtypeGroupLayer"===e.layerType?a:c}return f(e,p,y,await async function(e){const{layersJSON:a}=await(0,i.V)(e);if(!a)return null;const t=[...a.layers,...a.tables];return e=>t.find((a=>a.id===e.id))}(n.url))}return g(y)>0?f(e,p,y):async function(e,a){const{portalItem:t}=e;if(!t?.url)return;const r=await(0,d.T)(t.url);r&&f(e,a,{layers:r.layers?.map(m),tables:r.tables?.map(m)})}(e,p)}(t,e);s&&t.read({url:s},o);const p=await L(e,a);return p&&t.read(p,o),t.resourceReferences={portalItem:n,paths:o.readResourcePaths??[]},"subtype-group"!==t.type&&t.read({title:l},o),(0,y.y)(t,o)}(e,a)}function m(e){return{id:e.id,name:e.name}}function f(e,a,t,i){let l=t.layers||[];const c=t.tables||[];if("Feature Collection"===e.portalItem?.type&&(l.forEach((e=>{"Table"===e?.layerDefinition?.type&&c.push(e)})),l=l.filter((e=>"Table"!==e?.layerDefinition?.type))),"coverage"in t){const a=function(e){const{coverage:a}=e;if(!a)return null;const t=new URL(a);if(a.toLowerCase().includes("item.html")){const e=t.searchParams.get("id"),a=t.origin;return n.Z.fromPortalItem({portalItem:new o.default({id:e,url:a})})}if((0,s.B5)(a))return n.Z.fromArcGISServerUrl({url:a});throw new r.Z("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}(t);a&&e.add(a)}l.reverse().forEach((r=>{const n=w(e,a(r),t,r,i?.(r));e.add(n)})),c.reverse().forEach((r=>{const n=w(e,a(r),t,r,i?.(r));e.tables.add(n)}))}function w(e,a,t,r,n){const s=e.portalItem,i=new a({portalItem:s.clone(),layerId:r.id});if("sourceJSON"in i&&(i.sourceJSON=n),"subtype-group"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===s.type){const e={origin:"portal-item",portal:s.portal||l.Z.getDefault()};i.read(r,e);const a=t.showLegend;null!=a&&i.read({showLegend:a},e)}return i}async function L(e,a){if(!1===e.supportsData)return;const t=e.instance,r=t.portalItem;if(!r)return;let n=null;try{n=await r.fetchData("json",a)}catch(e){}if(function(e){return"stream"!==e.type&&"oriented-imagery"!==e.type&&"layerId"in e}(t)){let e=null,a=!0;if(n&&g(n)>0){if(null==t.layerId){const e=S(n);t.layerId="subtype-group"===t.type?e?.[0]:h(n)}e=function(e,a){const{layerId:t}=a,r=e.layers?.find((e=>e.id===t))||e.tables?.find((e=>e.id===t));return r&&function(e,a){return!("feature"===a.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===a.type&&!("layerType"in e))}(r,a)?r:null}(n,t),e&&(1===g(n)&&(a=!1),null!=n.showLegend&&(e.showLegend=n.showLegend))}return a&&"service-name"!==t.sublayerTitleMode&&(t.sublayerTitleMode="item-title-and-service-name"),e}return n}async function b(e,a){if(null==e?.layers||null==e?.tables){const t=await(0,d.T)(a);(e=e||{}).layers=e.layers||t?.layers,e.tables=e.tables||t?.tables}return e}function h(e){const a=e.layers;if(a&&a.length)return a[0].id;const t=e.tables;return t&&t.length?t[0].id:null}function g(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function S(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}},28008:(e,a,t)=>{t.r(a),t.d(a,{fromItem:()=>u,selectLayerClassPath:()=>y});var r=t(20102),n=t(84230),s=t(87344),i=t(15235),l=t(18062),o=t(14661),c=t(96187);async function u(e){!e.portalItem||e.portalItem instanceof i.default||(e={...e,portalItem:new i.default(e.portalItem)});const a=await async function(e){return await e.load(),async function(e){const a=s.T[e.className];return{constructor:await a(),properties:e.properties}}(await y(e))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function y(e){switch(e.type){case"Map Service":return async function(e){return await async function(e){return(await(0,c.T)(e.url)).tileInfo}(e)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e);case"Feature Service":return async function(e){if((0,o._$)(e,"Oriented Imagery Layer"))return async function(e){await e.load();const a=await e.fetchData();return a.coverage?{className:"GroupLayer"}:{className:"OrientedImageryLayer",properties:a}}(e);const a=await d(e);if("object"==typeof a){const e={};return null!=a.id&&(e.layerId=a.id),{className:a.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}(e);case"Feature Collection":return async function(e){await e.load();const a=(0,o._$)(e,"Map Notes"),t=(0,o._$)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,o._$)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,l.getNumLayersAndTables)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Scene Service":return async function(e){const a=await d(e);if("object"==typeof a){const t={};let r;if(null!=a.id?(t.layerId=a.id,r=`${e.url}/layers/${a.id}`):r=e.url,e.typeKeywords?.length)for(const a of Object.keys(n.fb))if(e.typeKeywords.includes(a))return{className:n.fb[a]};const s=await(0,c.T)(r);return{className:n.fb[s?.layerType]||"SceneLayer",properties:t}}return!1===a&&"Voxel"===(await(0,c.T)(e.url))?.layerType?{className:"VoxelLayer"}:{className:"GroupLayer"}}(e);case"Image Service":return async function(e){await e.load();const a=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=(await e.fetchData())?.layerType;if("ArcGISTiledImageServiceLayer"===t)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===t)return{className:"ImageryLayer"};const r=await(0,c.T)(e.url),n=r.cacheType?.toLowerCase(),s=r.capabilities?.toLowerCase().includes("tilesonly");return"map"===n||s?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e);case"Stream Service":case"Feed":return{className:"StreamLayer"};case"Vector Tile Service":return{className:"VectorTileLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"CSV":return{className:"CSVLayer"};case"KML":return{className:"KMLLayer"};case"WFS":return{className:"WFSLayer"};case"WMTS":return{className:"WMTSLayer"};case"WMS":return{className:"WMSLayer"};default:throw new r.Z("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function d(e){const a=e.url;if(!a||a.match(/\/\d+$/))return{};await e.load();const t=await e.fetchData();if("Feature Service"===e.type){const e=p(await(0,l.preprocessFSItemData)(t,a));if("object"==typeof e){const a=(0,l.getSubtypeGroupLayerIds)(t);e.className=null!=e.id&&a.includes(e.id)?"SubtypeGroupLayer":"FeatureLayer"}return e}return(0,l.getNumLayersAndTables)(t)>0?p(t):p(await(0,c.T)(a))}function p(e){return 1===(0,l.getNumLayersAndTables)(e)&&{id:(0,l.getFirstLayerOrTableId)(e)}}},40555:(e,a,t)=>{t.d(a,{y:()=>i});var r=t(66643),n=t(95330),s=t(20941);async function i(e,a,t){const i=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(i&&"unique-value"===i.type&&i.styleOrigin){const l=await(0,r.q6)(i.populateFromStyle());if((0,n.k_)(t),!1===l.ok){const t=l.error;a&&a.messages&&a.messages.push(new s.Z("renderer:style-reference",`Failed to create unique value renderer from style reference: ${t.message}`,{error:t,context:a})),e.clear("renderer",a?.origin)}}}},96187:(e,a,t)=>{t.d(a,{T:()=>n});var r=t(3172);async function n(e,a){const{data:t}=await(0,r.default)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5159],{3920:(e,t,s)=>{s.d(t,{p:()=>l,r:()=>u});var r=s(43697),o=s(15923),i=s(61247),n=s(5600),a=s(52011),p=s(72762);const l=e=>{let t=class extends e{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new i.Z}get updatingHandles(){return this._get("updatingHandles")||new p.t}};return(0,r._)([(0,n.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,n.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,a.j)("esri.core.HandleOwner")],t),t};let u=class extends(l(o.Z)){};u=(0,r._)([(0,a.j)("esri.core.HandleOwner")],u)},42033:(e,t,s)=>{s.d(t,{E:()=>o,_:()=>i});var r=s(70586);async function o(e,t){const{WhereClause:r}=await s.e(1534).then(s.bind(s,41534));return r.create(e,t)}function i(e,t){return(0,r.pC)(e)?(0,r.pC)(t)?`(${e}) AND (${t})`:e:t}},72762:(e,t,s)=>{s.d(t,{t:()=>d});var r=s(43697),o=s(15923),i=s(61247),n=s(70586),a=s(17445),p=s(1654),l=s(5600),u=s(52011);let d=class extends o.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new i.Z,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,s={}){return this._installWatch(e,t,s,a.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,a.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:r=!1}={}){const o=++this._handleId;return this._handles.add([(0,a.on)(e,"after-changes",this._createSyncUpdatingCallback(),a.Z_),(0,a.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],o),{remove:()=>this._handles.remove(o)}}addPromise(e){if((0,n.Wi)(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this._handles.has(c)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this._handles.remove(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,s={},r){const o=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,o);const i=r(e,t,s);return this._handles.add(i,o),{remove:()=>this._handles.remove(o)}}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,a.YP)(e,s,{sync:!0,equals:()=>!1});return this._handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this._handles.remove(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add((0,p.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(c))})),c)}}};(0,r._)([(0,l.Cb)({readOnly:!0})],d.prototype,"updating",void 0),d=(0,r._)([(0,u.j)("esri.core.support.WatchUpdatingTracking")],d);const c=-42},54295:(e,t,s)=>{s.d(t,{V:()=>n});var r=s(43697),o=s(5600),i=(s(75215),s(67676),s(52011));const n=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,r._)([(0,o.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,r._)([(0,i.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,s)=>{s.d(t,{Y:()=>l});var r=s(43697),o=s(92604),i=s(70586),n=s(5600),a=(s(75215),s(67676),s(52011)),p=s(66677);const l=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,p.Qc)(this.url);if((0,i.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,p.Nm)(e,o.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,n.Cb)()],t.prototype,"title",null),(0,r._)([(0,n.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,a.j)("esri.layers.mixins.ArcGISService")],t),t}},70082:(e,t,s)=>{s.d(t,{Z:()=>d});var r=s(43697),o=s(2368),i=s(35454),n=s(96674),a=s(5600),p=(s(75215),s(67676),s(52011));const l=new i.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,o.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,r._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"name",void 0),(0,r._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"description",void 0),(0,r._)([(0,a.Cb)({json:{read:l.read,write:l.write}})],u.prototype,"drawingTool",void 0),(0,r._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,r._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,r._)([(0,p.j)("esri.layers.support.FeatureTemplate")],u);const d=u},16451:(e,t,s)=>{s.d(t,{Z:()=>y});var r=s(43697),o=s(2368),i=s(96674),n=s(5600),a=(s(75215),s(67676),s(71715)),p=s(52011),l=s(30556),u=s(72729),d=s(70082);let c=class extends((0,o.J)(i.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const s of Object.keys(e))t[s]=(0,u.im)(e[s]);return t}writeDomains(e,t){const s={};for(const t of Object.keys(e))e[t]&&(s[t]=e[t]?.toJSON());t.domains=s}};(0,r._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"id",void 0),(0,r._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,r._)([(0,n.Cb)({json:{write:!0}})],c.prototype,"domains",void 0),(0,r._)([(0,a.r)("domains")],c.prototype,"readDomains",null),(0,r._)([(0,l.c)("domains")],c.prototype,"writeDomains",null),(0,r._)([(0,n.Cb)({type:[d.Z],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,r._)([(0,p.j)("esri.layers.support.FeatureType")],c);const y=c},56765:(e,t,s)=>{s.d(t,{Z:()=>u});var r,o=s(43697),i=s(46791),n=s(96674),a=s(5600),p=(s(75215),s(67676),s(52011));let l=r=class extends n.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new i.Z}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o._)([(0,a.Cb)({type:String,json:{write:!0}})],l.prototype,"floorField",void 0),(0,o._)([(0,a.Cb)({json:{read:!1,write:!1}})],l.prototype,"viewAllMode",void 0),(0,o._)([(0,a.Cb)({json:{read:!1,write:!1}})],l.prototype,"viewAllLevelIds",void 0),l=r=(0,o._)([(0,p.j)("esri.layers.support.LayerFloorInfo")],l);const u=l},72064:(e,t,s)=>{s.d(t,{h:()=>d});var r=s(80442),o=s(70586),i=s(66677);const n={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function a(e,t,s){return!!(e&&e.hasOwnProperty(t)?e[t]:s)}function p(e,t,s){return e&&e.hasOwnProperty(t)?e[t]:s}function l(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function u(e,t){const s=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!s?.includes(t.toLowerCase())}function d(e,t){return{analytics:c(e),attachment:y(e),data:h(e),metadata:m(e),operations:g(e.capabilities,e,t),query:f(e,t),queryRelated:w(e),queryTopFeatures:v(e),editing:S(e)}}function c(e){return{supportsCacheHint:u(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,s={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:u(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:a(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=n[e.name];t&&(s[t]=!!e.isEnabled)})),s}function h(e){return{isVersioned:a(e,"isDataVersioned",!1),supportsAttachment:a(e,"hasAttachments",!1),supportsM:a(e,"hasM",!1),supportsZ:a(e,"hasZ",!1)}}function m(e){return{supportsAdvancedFieldProperties:a(e,"supportsFieldDescriptionProperty",!1)}}function g(e,t,s){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],n=s?(0,i.Qc)(s):null,p=r.includes((0,o.pC)(n)&&"MapServer"===n.serverType?"data":"query"),l=r.includes("editing")&&!t.datesInUnknownTimezone;let u=l&&r.includes("create"),d=l&&r.includes("delete"),c=l&&r.includes("update");const y=r.includes("changetracking"),h=t.advancedQueryCapabilities;return l&&!(u||d||c)&&(u=d=c=!0),{supportsCalculate:a(t,"supportsCalculate",!1),supportsTruncate:a(t,"supportsTruncate",!1),supportsValidateSql:a(t,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:d,supportsEditing:l,supportsChangeTracking:y,supportsQuery:p,supportsQueryAnalytics:a(h,"supportsQueryAnalytic",!1),supportsQueryAttachments:a(h,"supportsQueryAttachments",!1),supportsQueryTopFeatures:a(h,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:a(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:a(t,"supportsExceedsLimitStatistics",!1)}}function f(e,t){const s=e.advancedQueryCapabilities,o=e.ownershipBasedAccessControlForFeatures,n=e.archivingInfo,d=e.currentVersion,c=t?.includes("MapServer"),y=!c||d>=(0,r.Z)("mapserver-pbf-version-support"),h=(0,i.M8)(t),m=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:a(s,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:a(s,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:a(s,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:l(s),supportsCentroid:a(s,"supportsReturningGeometryCentroid",!1),supportsDistance:a(s,"supportsQueryWithDistance",!1),supportsDistinct:a(s,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:a(s,"supportsReturningQueryExtent",!1),supportsGeometryProperties:a(s,"supportsReturningGeometryProperties",!1),supportsHavingClause:a(s,"supportsHavingClause",!1),supportsOrderBy:a(s,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:a(s,"supportsPagination",!1),supportsQuantization:a(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:a(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:a(e,"supportsReturningQueryGeometry",!1),supportsResultType:a(s,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:a(s,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:a(s,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:a(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:a(s,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:a(o,"allowOthersToQuery",!0),supportsHistoricMoment:a(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&m.has("pbf"),supportsDisjointSpatialRelationship:a(s,"supportsDisjointSpatialRel",!1),supportsCacheHint:a(s,"supportsQueryWithCacheHint",!1)||u(s,"query"),supportsDefaultSpatialReference:a(s,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:a(s,"supportsFullTextSearch",!1),maxRecordCountFactor:p(e,"maxRecordCountFactor",void 0),maxRecordCount:p(e,"maxRecordCount",void 0),standardMaxRecordCount:p(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:p(e,"tileMaxRecordCount",void 0)}}function w(e){const t=e.advancedQueryCapabilities,s=a(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:a(t,"supportsQueryRelatedPagination",!1),supportsCount:s,supportsOrderBy:s,supportsCacheHint:u(t,"queryRelated")}}function v(e){return{supportsCacheHint:u(e.advancedQueryCapabilities,"queryTopFilter")}}function S(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:a(e,"allowGeometryUpdates",!0),supportsGlobalId:a(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:a(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:a(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:a(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:a(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:a(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:a(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:a(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:a(t,"allowOthersToUpdate",!0)}}},51706:(e,t,s)=>{var r,o;function i(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?r.Expression:e.field&&"string"==typeof e.field?r.Field:r.Unknown}function p(e,t){const s=t||a(e),i=e.valueUnit||"unknown";return s===r.Unknown?o.Constant:e.stops?o.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?o.ClampedLinear:"unknown"===i?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?o.Proportional:o.Additive:o.Identity:o.RealWorldSize}s.d(t,{PS:()=>a,QW:()=>p,RY:()=>r,hL:()=>o,iY:()=>i,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(r||(r={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(o||(o={}))},28694:(e,t,s)=>{s.d(t,{p:()=>i});var r=s(70586),o=s(69285);function i(e,t,s){if(!s||!s.features||!s.hasZ)return;const i=(0,o.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(i))for(const e of s.features)i(e.geometry)}},56545:(e,t,s)=>{s.d(t,{Z:()=>c});var r,o=s(43697),i=s(96674),n=s(22974),a=s(5600),p=s(75215),l=s(52011),u=s(30556);let d=r=class extends i.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new r((0,n.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,o._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"attachmentTypes",void 0),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],d.prototype,"attachmentsWhere",void 0),(0,o._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],d.prototype,"cacheHint",void 0),(0,o._)([(0,a.Cb)({type:[String],json:{write:!0}})],d.prototype,"keywords",void 0),(0,o._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"globalIds",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],d.prototype,"num",void 0),(0,o._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"objectIds",void 0),(0,o._)([(0,a.Cb)({type:Boolean,json:{default:!1,write:!0}})],d.prototype,"returnMetadata",void 0),(0,o._)([(0,a.Cb)({type:[Number],json:{write:!0}})],d.prototype,"size",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],d.prototype,"start",void 0),(0,o._)([(0,u.c)("start"),(0,u.c)("num")],d.prototype,"writeStart",null),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],d.prototype,"where",void 0),d=r=(0,o._)([(0,l.j)("esri.rest.support.AttachmentQuery")],d),d.from=(0,p.se)(d);const c=d},74889:(e,t,s)=>{s.d(t,{Z:()=>S});var r,o=s(43697),i=s(66577),n=s(38171),a=s(35454),p=s(96674),l=s(22974),u=s(70586),d=s(5600),c=(s(75215),s(71715)),y=s(52011),h=s(30556),m=s(82971),g=s(33955),f=s(1231);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=r=class extends p.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const s=m.Z.fromJSON(t.spatialReference),r=[];for(let t=0;t<e.length;t++){const o=e[t],i=n.Z.fromJSON(o),a=o.geometry&&o.geometry.spatialReference;(0,u.pC)(i.geometry)&&!a&&(i.geometry.spatialReference=s);const p=o.aggregateGeometries,l=i.aggregateGeometries;if(p&&(0,u.pC)(l))for(const e in l){const t=l[e],r=p[e]?.spatialReference;(0,u.pC)(t)&&!r&&(t.spatialReference=s)}r.push(i)}return r}writeGeometryType(e,t,s,r){if(e)return void w.write(e,t,s,r);const{features:o}=this;if(o)for(const e of o)if(e&&(0,u.pC)(e.geometry))return void w.write(e.geometry.type,t,s,r)}readQueryGeometry(e,t){if(!e)return null;const s=!!e.spatialReference,r=(0,g.im)(e);return r&&!s&&t.spatialReference&&(r.spatialReference=m.Z.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:s}=this;if(s)for(const e of s)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,l.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let s=0;s<t.features.length;s++){const r=t.features[s];if(r.geometry){const t=e&&e[s];r.geometry=t&&t.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,s],translate:[r,o]}=e,i=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((o-e)/s)));for(let e=0,t=i.length;e<t;e++)n?.((0,u.Wg)(i[e].geometry))||(i.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:s}=this;if(!s)return this;const{translate:[r,o],scale:[i,n]}=s,a=this._getHydrationFunction(e,(e=>e*i+r),(e=>o-e*n));for(const{geometry:e}of t)(0,u.pC)(e)&&a&&a(e);return this.transform=null,this}_quantizePoints(e,t,s){let r,o;const i=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=s(a[1]);e===r&&n===o||(i.push([e-r,n-o]),r=e,o=n)}else r=t(a[0]),o=s(a[1]),i.push([r,o])}return i.length>0?i:null}_getQuantizationFunction(e,t,s){return"point"===e?e=>(e.x=t(e.x),e.y=s(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,g.oU)(e)?e.rings:e.paths,o=[];for(let e=0,i=r.length;e<i;e++){const i=r[e],n=this._quantizePoints(i,t,s);n&&o.push(n)}return o.length>0?((0,g.oU)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,s);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,s){return"point"===e?e=>{e.x=t(e.x),e.y=s(e.y)}:"polyline"===e||"polygon"===e?e=>{const r=(0,g.oU)(e)?e.rings:e.paths;let o,i;for(let e=0,n=r.length;e<n;e++){const n=r[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];e>0?(o+=r[0],i+=r[1]):(o=r[0],i=r[1]),r[0]=t(o),r[1]=s(i)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=s(e.ymin),e.xmax=t(e.xmax),e.ymax=s(e.ymax)}:"multipoint"===e?e=>{const r=e.points;let o,i;for(let e=0,n=r.length;e<n;e++){const n=r[e];e>0?(o+=n[0],i+=n[1]):(o=n[0],i=n[1]),n[0]=t(o),n[1]=s(i)}}:null}};(0,o._)([(0,d.Cb)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,d.Cb)({type:[n.Z],json:{write:!0}})],v.prototype,"features",void 0),(0,o._)([(0,c.r)("features")],v.prototype,"readFeatures",null),(0,o._)([(0,d.Cb)({type:[f.Z],json:{write:!0}})],v.prototype,"fields",void 0),(0,o._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],v.prototype,"geometryType",void 0),(0,o._)([(0,h.c)("geometryType")],v.prototype,"writeGeometryType",null),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,o._)([(0,d.Cb)({types:i.qM,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,o._)([(0,c.r)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,o._)([(0,d.Cb)({type:m.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,o._)([(0,h.c)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,o._)([(0,d.Cb)({json:{write:!0}})],v.prototype,"transform",void 0),v=r=(0,o._)([(0,y.j)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const S=v},58333:(e,t,s)=>{s.d(t,{ET:()=>i,I4:()=>o,eG:()=>p,lF:()=>n,lj:()=>u,qP:()=>a,wW:()=>l});const r=[252,146,31,255],o={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},i={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},p={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},l={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},u={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";import{buildDate as s}from"./support/revision.js";const r={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!1,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){{const e="4.26.0";r.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${s}/assets`}r.defaultAssetsPath=r.assetsPath}export{r as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!1,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.26.1";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import s from"../../../request.js";import a from"../../../TimeExtent.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as o}from"../../../core/jsonMap.js";import i from"../../../core/Loadable.js";import{isSome as n,isNone as u,unwrap as l}from"../../../core/maybe.js";import{setDeepValue as d}from"../../../core/object.js";import{debounce as c}from"../../../core/promiseUtils.js";import{join as p,dataComponents as y}from"../../../core/urlUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import f from"../../../geometry/Extent.js";import{fromJSON as g}from"../../../geometry/support/jsonUtils.js";import{AssetMapEditFlags as R}from"../assetEditingSupport.js";import{createDrawingInfo as F}from"./support/clientSideDefaults.js";import b from"./support/QueryTask.js";import{isHostedAgolService as q}from"../../support/arcgisLayerUrl.js";import{unapplyEditsZUnitScaling as I}from"../../../rest/query/operations/editsZScale.js";import _ from"../../../geometry/SpatialReference.js";const w=new o({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function S(e){if("string"==typeof e){const t=y(e);return t||{data:e}}return new Promise(((t,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(y(a.result)),a.onerror=e=>s(e)}))}const O=new Set(["Feature Layer","Table"]),E=new o({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let j=class extends i{constructor(){super(...arguments),this.type="feature-layer",this.refresh=c((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}))}load(e){const t=n(e)?e.signal:null,s=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(s,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:a,gdbVersion:r,spatialReference:o,fieldsIndex:i}=this.layer,n=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&u(a),l=e?.operations?.supportsQueryAttachments??!1;return new b({url:t.path,pbfSupported:n,fieldsIndex:i,infoFor3D:a,dynamicDataSource:s,gdbVersion:r,sourceSpatialReference:o,queryAttachmentsSupported:l})}async addAttachment(e,t){await this.load();const a=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+a+"/addAttachment",o=this._getLayerRequestOptions(),i=this._getFormDataForAttachment(t,o.query);try{const e=await s(r,{body:i});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(a,n)}}async updateAttachment(e,t,a){await this.load();const r=e.attributes[this.layer.objectIdField],o=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",i=this._getLayerRequestOptions({query:{attachmentId:t}}),n=this._getFormDataForAttachment(a,i.query);try{const e=await s(o,{body:n});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(r,u)}}async applyEdits(e,t){await this.load();const a=this.layer.infoFor3D,r=n(a),o=r||(t?.globalIdUsed??!1),i=e.addFeatures?.map((e=>this._serializeFeature(e,a))).filter(n)??[],u=e.updateFeatures?.map((e=>this._serializeFeature(e,a))).filter(n)??[],d=this._getFeatureIds(e.deleteFeatures,o);I(i,u,this.layer.spatialReference);const c=[],p=[],y=[...e.deleteAttachments??[]];for(const s of e.addAttachments??[])c.push(await this._serializeAttachment(s));for(const s of e.updateAttachments??[])p.push(await this._serializeAttachment(s));const h=c.length||p.length||y.length?{adds:c,updates:p,deletes:y}:null;let m,f=null;if(r){f=new Map;const t=[];for(const a of e.addAssets??[])t.push(this._serializeAssetMapEditAndUploadAssets(a,f));const s=await Promise.all(t);m=s.length?{adds:s,updates:[],deletes:[]}:void 0}const g={gdbVersion:t?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:o,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId};t?.returnServiceEditsOption?(g.edits=JSON.stringify([{id:this.layer.layerId,adds:i,updates:u,deletes:d,attachments:h,assetMaps:l(m)}]),g.returnServiceEditsOption=w.toJSON(t?.returnServiceEditsOption),g.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(g.adds=i.length?JSON.stringify(i):null,g.updates=u.length?JSON.stringify(u):null,g.deletes=d.length?o?JSON.stringify(d):d.join(","):null,g.attachments=h&&JSON.stringify(h),g.assetMaps=n(m)?JSON.stringify(m):void 0);const R=this._getLayerRequestOptions({method:"post",query:g}),F=t?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,b=await s(F+"/applyEdits",R);if(r&&null!=b.data&&null!=b.data.assetMaps){const e=b.data,t=this.layer.objectIdField,a=[];for(const s of e.addResults)s.success&&a.push(s.objectId);for(const s of e.updateResults)s.success&&a.push(s.objectId);const r=this._createRequestQueryOptions(),o=await s(F+"/query",{...r,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${a.join(",")})`,outFields:`${t}`}});if(o&&o.data&&o.data.assetMaps&&n(f)){const e=o.data.assetMaps;for(const t of e){const e=f.get(t.parentGlobalId).geometry;n(e)&&"mesh"===e.type&&e.updateExternalSource({source:[{name:t.assetName,source:t.assetName}],extent:e.extent})}}}return this._createEditsResult(b)}async deleteAttachments(e,t){await this.load();const a=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await s(r,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(o){throw this._createAttachmentErrorResult(a,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:o}=this.layer,{data:i}=await s(`${o}/${r}`,t),{id:n,extent:u,fullExtent:l,timeExtent:d}=i,c=u||l;return{id:n,fullExtent:c&&f.fromJSON(c),timeExtent:d&&a.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!q(this.layer.url))return"unavailable";const e=p(this.layer.url,"status"),t=await s(e,{query:{f:"json"}});return E.fromJSON(t.data.status)}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:a}=await s(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:has("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=a}this.sourceJSON=this._patchServiceJSON(e);const a=e.type;if(!O.has(a))throw new r("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}_patchServiceJSON(e){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=F(e.geometryType).renderer;d("drawingInfo.renderer",t,e)}return"esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,t){const{geometry:s,attributes:a}=e;if(n(t)&&n(e.geometry)&&"mesh"===e.geometry.type){const s={...a},r=e.geometry,o=r.origin,i=r.transform;if(s[t.transformFieldRoles.originX]=o.x,s[t.transformFieldRoles.originY]=o.y,s[t.transformFieldRoles.originZ]=o.z,n(i)){const e=i.translation,a=i.scale,r=i.rotation;s[t.transformFieldRoles.translationX]=e[0],s[t.transformFieldRoles.translationY]=-e[2],s[t.transformFieldRoles.translationZ]=e[1],s[t.transformFieldRoles.scaleX]=a[0],s[t.transformFieldRoles.scaleY]=a[1],s[t.transformFieldRoles.scaleZ]=a[2],s[t.transformFieldRoles.rotationX]=r[0],s[t.transformFieldRoles.rotationY]=r[2],s[t.transformFieldRoles.rotationZ]=r[1],s[t.transformFieldRoles.rotationDeg]=r[3]}return{geometry:null,attributes:s}}return u(s)?{attributes:a}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:a}}async _serializeAttachment(e){const{feature:t,attachment:s}=e,{globalId:a,name:r,contentType:o,data:i,uploadId:n}=s,u={globalId:a,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),n)u.uploadId=n;else if(i){const e=await S(i);e&&(u.contentType=e.mediaType,u.data=e.data),i instanceof File&&(u.name=i.name)}return r&&(u.name=r),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(e,t){const a=this.layer.url;let o=null;try{const t=new Blob([e.data],{type:e.mimeType}),i=new FormData;i.append("f","json"),i.append("file",t,`${e.assetName}`);const n={body:i,method:"post",responseType:"json"},{data:u}=await s(`${a}/uploads/upload`,n);if(!u.success)throw new r("feature-layer-source:upload-failure","Expected upload to be successfull.");o={assetType:e.assetType,assetUploadId:u.item.itemID}}catch(y){o=null}if(u(o)){const t=await S(new Blob([e.data]));if(!t.isBase64)throw new r("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");o={assetType:e.assetType,assetData:t.data}}if(u(o))throw new r("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const i={method:"post",query:{f:"json",assets:JSON.stringify([o])},responseType:"json"},n=await s(p(this.layer.parsedUrl.path,"uploadAssets"),i);if(1!==n.data.uploadResults.length||!n.data.uploadResults[0].success)throw new r("feature-layer-source:uploadAssets-failure","Bad response.");const l=n.data.uploadResults[0].assetHash,d=[];e.flags&R.PROJECT_VERTICES&&d.push("PROJECT_VERTICES");const c={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:l,flags:d};return t.set(e.featureGlobalId,e.feature),c}_getFeatureIds(e,t){const s=e?.[0];return s?this._canUseGlobalIds(t,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const t=this.layer.objectIdField;return e.map((e=>e.attributes&&e.attributes[t]))}_canUseGlobalIds(e,t){return e&&"globalId"in t[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map((e=>e.objectId))}_getGlobalIdsFromFeatureIdentifier(e){return e.map((e=>e.globalId))}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,a=[];let r=null;if(Array.isArray(t))for(const n of t)a.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===s&&(r={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else r=t;const o=r?.attachments,i={addFeatureResults:r?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:r?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:r?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(r?.editMoment&&(i.editMoment=r.editMoment),a.length>0){i.editedFeatureResults=[];for(const e of a){const{adds:t,updates:s,deletes:a,spatialReference:r}=e.editedFeatures,o=r?new _(r):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.map((e=>this._createEditedFeature(e,o)))||[],updates:s?.map((e=>({original:this._createEditedFeature(e[0],o),current:this._createEditedFeature(e[1],o)})))||[],deletes:a?.map((e=>this._createEditedFeature(e,o)))||[],spatialReference:o}})}}return i}_createEditedFeature(e,s){return new t({attributes:e.attributes,geometry:g({...e.geometry,spatialReference:s})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new r("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const s=t.details.messages&&t.details.messages[0]||t.message,a=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new r("feature-layer-source:attachment-failure",s,{code:a})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const a in t){const e=t[a];null!=e&&(s.set?s.set(a,e):s.append(a,e))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:a}=this.layer;return{...e,query:{gdbVersion:s,layer:a?JSON.stringify({source:a}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};e([h()],j.prototype,"type",void 0),e([h({constructOnly:!0})],j.prototype,"layer",void 0),e([h({readOnly:!0})],j.prototype,"queryTask",null),j=e([m("esri.layers.graphics.sources.FeatureLayerSource")],j);const T=j;export{T as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{id as s}from"../../../kernel.js";import a from"../../../request.js";import r from"../../../TimeExtent.js";import o from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as i}from"../../../core/jsonMap.js";import n from"../../../core/Loadable.js";import{isSome as u,isNone as l,unwrap as d}from"../../../core/maybe.js";import{setDeepValue as c}from"../../../core/object.js";import{debounce as p}from"../../../core/promiseUtils.js";import{join as h,dataComponents as y}from"../../../core/urlUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as f}from"../../../core/accessorSupport/decorators/subclass.js";import g from"../../../geometry/Extent.js";import{fromJSON as R}from"../../../geometry/support/jsonUtils.js";import{AssetMapEditFlags as F}from"../assetEditingSupport.js";import{createDrawingInfo as b}from"./support/clientSideDefaults.js";import q from"./support/QueryTask.js";import{isHostedAgolService as I}from"../../support/arcgisLayerUrl.js";import{unapplyEditsZUnitScaling as _}from"../../../rest/query/operations/editsZScale.js";import w from"../../../geometry/SpatialReference.js";const E=new i({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function S(e){if("string"==typeof e){const t=y(e);return t||{data:e}}return new Promise(((t,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(y(a.result)),a.onerror=e=>s(e)}))}const O=new Set(["Feature Layer","Table"]),j=new i({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let T=class extends n{constructor(){super(...arguments),this.type="feature-layer",this.refresh=p((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}))}load(e){const t=u(e)?e.signal:null,s=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(s,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:a,gdbVersion:r,spatialReference:o,fieldsIndex:i}=this.layer,n=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&l(a),u=e?.operations?.supportsQueryAttachments??!1;return new q({url:t.path,pbfSupported:n,fieldsIndex:i,infoFor3D:a,dynamicDataSource:s,gdbVersion:r,sourceSpatialReference:o,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/addAttachment",o=this._getLayerRequestOptions(),i=this._getFormDataForAttachment(t,o.query);try{const e=await a(r,{body:i});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(s,n)}}async updateAttachment(e,t,s){await this.load();const r=e.attributes[this.layer.objectIdField],o=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",i=this._getLayerRequestOptions({query:{attachmentId:t}}),n=this._getFormDataForAttachment(s,i.query);try{const e=await a(o,{body:n});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(r,u)}}async applyEdits(e,t){await this.load();const r=this.layer.infoFor3D,o=u(r),i=o||(t?.globalIdUsed??!1),n=e.addFeatures?.map((e=>this._serializeFeature(e,r))).filter(u)??[],l=e.updateFeatures?.map((e=>this._serializeFeature(e,r))).filter(u)??[],c=this._getFeatureIds(e.deleteFeatures,i);_(n,l,this.layer.spatialReference);const p=[],h=[],y=[...e.deleteAttachments??[]];for(const s of e.addAttachments??[])p.push(await this._serializeAttachment(s));for(const s of e.updateAttachments??[])h.push(await this._serializeAttachment(s));const m=p.length||h.length||y.length?{adds:p,updates:h,deletes:y}:null;let f,g=null;if(o){g=new Map;const t=[];for(const a of e.addAssets??[])t.push(this._serializeAssetMapEditAndUploadAssets(a,g));const s=await Promise.all(t);f=s.length?{adds:s,updates:[],deletes:[]}:void 0}const R={gdbVersion:t?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId};t?.returnServiceEditsOption?(R.edits=JSON.stringify([{id:this.layer.layerId,adds:n,updates:l,deletes:c,attachments:m,assetMaps:d(f)}]),R.returnServiceEditsOption=E.toJSON(t?.returnServiceEditsOption),R.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(R.adds=n.length?JSON.stringify(n):null,R.updates=l.length?JSON.stringify(l):null,R.deletes=c.length?i?JSON.stringify(c):c.join(","):null,R.attachments=m&&JSON.stringify(m),R.assetMaps=u(f)?JSON.stringify(f):void 0);const F=this._getLayerRequestOptions({method:"post",query:R}),b=t?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,q=await a(b+"/applyEdits",F);if(!this.layer.capabilities.operations?.supportsEditing&&this.layer.effectiveCapabilities?.operations?.supportsEditing){const e=s?.findCredential(this.layer.url);await(e?.refreshToken())}if(o&&null!=q.data&&null!=q.data.assetMaps){const e=q.data,t=this.layer.objectIdField,s=[];for(const a of e.addResults)a.success&&s.push(a.objectId);for(const a of e.updateResults)a.success&&s.push(a.objectId);const r=this._createRequestQueryOptions(),o=await a(b+"/query",{...r,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${s.join(",")})`,outFields:`${t}`}});if(o&&o.data&&o.data.assetMaps&&u(g)){const e=o.data.assetMaps;for(const t of e){const e=g.get(t.parentGlobalId).geometry;u(e)&&"mesh"===e.type&&e.updateExternalSource({source:[{name:t.assetName,source:t.assetName}],extent:e.extent})}}}return this._createEditsResult(q)}async deleteAttachments(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await a(r,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(o){throw this._createAttachmentErrorResult(s,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:o}=this.layer,{data:i}=await a(`${o}/${s}`,t),{id:n,extent:u,fullExtent:l,timeExtent:d}=i,c=u||l;return{id:n,fullExtent:c&&g.fromJSON(c),timeExtent:d&&r.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!I(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await a(e,{query:{f:"json"}});return j.fromJSON(t.data.status)}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:s}=await a(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:has("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=s}this.sourceJSON=this._patchServiceJSON(e);const s=e.type;if(!O.has(s))throw new o("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}_patchServiceJSON(e){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=b(e.geometryType).renderer;c("drawingInfo.renderer",t,e)}return"esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,t){const{geometry:s,attributes:a}=e;if(u(t)&&u(e.geometry)&&"mesh"===e.geometry.type){const s={...a},r=e.geometry,o=r.origin,i=r.transform;if(s[t.transformFieldRoles.originX]=o.x,s[t.transformFieldRoles.originY]=o.y,s[t.transformFieldRoles.originZ]=o.z,u(i)){const e=i.translation,a=i.scale,r=i.rotation;s[t.transformFieldRoles.translationX]=e[0],s[t.transformFieldRoles.translationY]=-e[2],s[t.transformFieldRoles.translationZ]=e[1],s[t.transformFieldRoles.scaleX]=a[0],s[t.transformFieldRoles.scaleY]=a[1],s[t.transformFieldRoles.scaleZ]=a[2],s[t.transformFieldRoles.rotationX]=r[0],s[t.transformFieldRoles.rotationY]=r[2],s[t.transformFieldRoles.rotationZ]=r[1],s[t.transformFieldRoles.rotationDeg]=r[3]}return{geometry:null,attributes:s}}return l(s)?{attributes:a}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:a}}async _serializeAttachment(e){const{feature:t,attachment:s}=e,{globalId:a,name:r,contentType:o,data:i,uploadId:n}=s,u={globalId:a,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),n)u.uploadId=n;else if(i){const e=await S(i);e&&(u.contentType=e.mediaType,u.data=e.data),i instanceof File&&(u.name=i.name)}return r&&(u.name=r),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(e,t){const s=this.layer.url;let r=null;try{const t=new Blob([e.data],{type:e.mimeType}),i=new FormData;i.append("f","json"),i.append("file",t,`${e.assetName}`);const n={body:i,method:"post",responseType:"json"},{data:u}=await a(`${s}/uploads/upload`,n);if(!u.success)throw new o("feature-layer-source:upload-failure","Expected upload to be successfull.");r={assetType:e.assetType,assetUploadId:u.item.itemID}}catch(p){r=null}if(l(r)){const t=await S(new Blob([e.data]));if(!t.isBase64)throw new o("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");r={assetType:e.assetType,assetData:t.data}}if(l(r))throw new o("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const i={method:"post",query:{f:"json",assets:JSON.stringify([r])},responseType:"json"},n=await a(h(this.layer.parsedUrl.path,"uploadAssets"),i);if(1!==n.data.uploadResults.length||!n.data.uploadResults[0].success)throw new o("feature-layer-source:uploadAssets-failure","Bad response.");const u=n.data.uploadResults[0].assetHash,d=[];e.flags&F.PROJECT_VERTICES&&d.push("PROJECT_VERTICES");const c={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:u,flags:d};return t.set(e.featureGlobalId,e.feature),c}_getFeatureIds(e,t){const s=e?.[0];return s?this._canUseGlobalIds(t,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const t=this.layer.objectIdField;return e.map((e=>e.attributes&&e.attributes[t]))}_canUseGlobalIds(e,t){return e&&"globalId"in t[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map((e=>e.objectId))}_getGlobalIdsFromFeatureIdentifier(e){return e.map((e=>e.globalId))}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,a=[];let r=null;if(Array.isArray(t))for(const n of t)a.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===s&&(r={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else r=t;const o=r?.attachments,i={addFeatureResults:r?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:r?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:r?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(r?.editMoment&&(i.editMoment=r.editMoment),a.length>0){i.editedFeatureResults=[];for(const e of a){const{adds:t,updates:s,deletes:a,spatialReference:r}=e.editedFeatures,o=r?new w(r):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.map((e=>this._createEditedFeature(e,o)))||[],updates:s?.map((e=>({original:this._createEditedFeature(e[0],o),current:this._createEditedFeature(e[1],o)})))||[],deletes:a?.map((e=>this._createEditedFeature(e,o)))||[],spatialReference:o}})}}return i}_createEditedFeature(e,s){return new t({attributes:e.attributes,geometry:R({...e.geometry,spatialReference:s})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new o("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const s=t.details.messages&&t.details.messages[0]||t.message,a=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new o("feature-layer-source:attachment-failure",s,{code:a})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const a in t){const e=t[a];null!=e&&(s.set?s.set(a,e):s.append(a,e))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:a}=this.layer;return{...e,query:{gdbVersion:s,layer:a?JSON.stringify({source:a}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};e([m()],T.prototype,"type",void 0),e([m({constructOnly:!0})],T.prototype,"layer",void 0),e([m({readOnly:!0})],T.prototype,"queryTask",null),T=e([f("esri.layers.graphics.sources.FeatureLayerSource")],T);const A=T;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import t from"../../request.js";import{isSome as n}from"../../core/maybe.js";function r(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function i(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function s(e){return null!=e&&"type"in e&&"group"===e.type}const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function u(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function c(e){return"voxel"===e?.type}function o(e){return"imagery-tile"===e?.type}function l(e){return null!=e&&null!=e.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent.baseLayers.includes(e)}function f(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function p(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function y(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function g(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function d(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function b(r,i){const s=e?.findServerInfo(r);if(null!=s?.currentVersion)return s.owningSystemUrl||null;const a=r.toLowerCase().indexOf("/rest/services");if(-1===a)return null;const u=`${r.substring(0,a)}/rest/info`,c=n(i)?i.signal:null,{data:o}=await t(u,{query:{f:"json"},responseType:"json",signal:c});return o?.owningSystemUrl||null}function m(e){if(!("capabilities"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function v(e){return m(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function h(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function w(e){return!!h(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}export{w as getEffectiveEditingEnabled,v as getEffectiveLayerCapabilities,b as getOwningPortalUrl,d as getTileMaxtrixSetFromActiveLayer,l as isBaseLayer,r as isBasemapSupportedLayer,f as isFeatureCollectionLayer,p as isFeatureServiceLayer,s as isGroupLayer,o as isImageryTileLayer,u as isSceneServiceLayer,i as isTiledLayer,c as isVoxelLayer,a as sceneServiceLayerTypeToClassName,y as serializeLayerDefinitions,g as serializeTimeOptions};
5
+ import{id as e}from"../../kernel.js";import t from"../../request.js";import{isSome as n}from"../../core/maybe.js";function r(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function i(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function s(e){return null!=e&&"type"in e&&"group"===e.type}const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function u(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function c(e){return"voxel"===e?.type}function o(e){return"imagery-tile"===e?.type}function l(e){return null!=e&&null!=e.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent.baseLayers.includes(e)}function f(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function y(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function p(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function g(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function d(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function b(r,i){const s=e?.findServerInfo(r);if(null!=s?.currentVersion)return s.owningSystemUrl||null;const a=r.toLowerCase().indexOf("/rest/services");if(-1===a)return null;const u=`${r.substring(0,a)}/rest/info`,c=n(i)?i.signal:null,{data:o}=await t(u,{query:{f:"json"},responseType:"json",signal:c});return o?.owningSystemUrl||null}function m(e){if(!("capabilities"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function v(e){return m(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function h(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function w(e){return!!h(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}export{w as getEffectiveEditingEnabled,v as getEffectiveLayerCapabilities,b as getOwningPortalUrl,d as getTileMaxtrixSetFromActiveLayer,l as isBaseLayer,r as isBasemapSupportedLayer,f as isFeatureCollectionLayer,y as isFeatureServiceLayer,s as isGroupLayer,o as isImageryTileLayer,u as isSceneServiceLayer,i as isTiledLayer,c as isVoxelLayer,a as sceneServiceLayerTypeToClassName,p as serializeLayerDefinitions,g as serializeTimeOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- const a={BingMapsLayer:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CSVLayer:async()=>(await import("../CSVLayer.js")).default,DimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ElevationLayer:async()=>(await import("../ElevationLayer.js")).default,FeatureLayer:async()=>(await import("../FeatureLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,GeoRSSLayer:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSONLayer:async()=>(await import("../GeoJSONLayer.js")).default,ImageryLayer:async()=>(await import("../ImageryLayer.js")).default,ImageryTileLayer:async()=>(await import("../ImageryTileLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KMLLayer:async()=>(await import("../KMLLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,MapImageLayer:async()=>(await import("../MapImageLayer.js")).default,MapNotesLayer:async()=>(await import("../MapNotesLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMapLayer:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,RouteLayer:async()=>(await import("../RouteLayer.js")).default,SceneLayer:async()=>(await import("../SceneLayer.js")).default,StreamLayer:async()=>(await import("../StreamLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,TileLayer:async()=>(await import("../TileLayer.js")).default,UnknownLayer:async()=>(await import("../UnknownLayer.js")).default,UnsupportedLayer:async()=>(await import("../UnsupportedLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,VoxelLayer:async()=>(await import("../VoxelLayer.js")).default,WebTileLayer:async()=>(await import("../WebTileLayer.js")).default,WFSLayer:async()=>(await import("../WFSLayer.js")).default,WMSLayer:async()=>(await import("../WMSLayer.js")).default,WMTSLayer:async()=>(await import("../WMTSLayer.js")).default};export{a as layerLookupMap};
5
+ const a={BingMapsLayer:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CSVLayer:async()=>(await import("../CSVLayer.js")).default,DimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ElevationLayer:async()=>(await import("../ElevationLayer.js")).default,FeatureLayer:async()=>(await import("../FeatureLayer.js")).default,GeoJSONLayer:async()=>(await import("../GeoJSONLayer.js")).default,GeoRSSLayer:async()=>(await import("../GeoRSSLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,ImageryLayer:async()=>(await import("../ImageryLayer.js")).default,ImageryTileLayer:async()=>(await import("../ImageryTileLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KMLLayer:async()=>(await import("../KMLLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,MapImageLayer:async()=>(await import("../MapImageLayer.js")).default,MapNotesLayer:async()=>(await import("../MapNotesLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMapLayer:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,RouteLayer:async()=>(await import("../RouteLayer.js")).default,SceneLayer:async()=>(await import("../SceneLayer.js")).default,StreamLayer:async()=>(await import("../StreamLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,TileLayer:async()=>(await import("../TileLayer.js")).default,UnknownLayer:async()=>(await import("../UnknownLayer.js")).default,UnsupportedLayer:async()=>(await import("../UnsupportedLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,VoxelLayer:async()=>(await import("../VoxelLayer.js")).default,WFSLayer:async()=>(await import("../WFSLayer.js")).default,WMSLayer:async()=>(await import("../WMSLayer.js")).default,WMTSLayer:async()=>(await import("../WMTSLayer.js")).default,WebTileLayer:async()=>(await import("../WebTileLayer.js")).default};export{a as layerLookupMap};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.26.0-next.20230221",
3
+ "version": "4.26.1",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{px2pt as t}from"../../core/screenUtils.js";import{getTextBounds as e}from"../../views/2d/support/engineHelpers.js";async function n(n,o){await o.when();const r=n.clone();r.text="9";const s=await e(r,o),i=4;return t(s.width)*i}export{n as default};
5
+ import{px2pt as t}from"../../core/screenUtils.js";import{getTextBounds as e}from"../../views/2d/support/engineHelpers.js";async function n(n,o){await o.when();const r=n.clone();r.text="999";const s=await e(r,o);return t(s.width)}export{n 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.26/esri/copyright.txt for details.
4
4
  */
5
- const a="20230221",e="ebea7407a2e01240a6731e06c0a51ab7612dd86d";export{a as buildDate,e as commitHash};
5
+ const a="20230223",b="0854ba88dc8b0906b08c4ba3bef443356a6da5ad";export{a as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as o}from"../../../../core/analysisThemeUtils.js";import{isNone as r,unwrap as s,destroyMaybe as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{project as l}from"../../../../geometry/projection.js";import{isValid as p}from"../../../../geometry/support/spatialReferenceUtils.js";import d from"../../../../layers/GraphicsLayer.js";import{applyCIMSymbolColor as m}from"../../../../symbols/support/cimSymbolUtils.js";import{ViewingMode as y}from"../../../ViewingMode.js";import{DragManipulation as _}from"./manipulations/DragManipulation.js";import{primaryKey as g}from"../../../input/keys.js";import{InteractiveToolBase as f}from"../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as P}from"../../../interactive/editGeometry/interfaces.js";import v from"../../../../symbols/CIMSymbol.js";const S={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:g},k=1,b=10,G=new e("#009AF2");let M=class extends f{constructor(t){super(t),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new d({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0}initialize(){const{view:t,mediaElement:e}=this;if(r(e.georeference))return;const a=e.georeference;"control-points"!==a.type||r(a.coords)||(this._georeference=a,this._initialControlPoints=s(this._georeference.controlPoints),this._controlPointEditGeometryOperations=s(this._georeference.controlPoints).map((({mapPoint:e})=>u.fromGeometry(l(e,t.spatialReference),y.Local))),this._controlPointGraphics=this._controlPointEditGeometryOperations.map(((t,e)=>new i({symbol:new v({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e===this.activeHandle?G.toArray():o().toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:t.data.geometry}))),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map((e=>new _({tool:this,view:t,graphic:e}))),this.addHandles([...this._controlPointManipulations.map(((t,e)=>t.createDragPipeline(this._getInfo.bind(this,e),((t,i)=>{"start"===t.action&&(this._undoStack.push(e),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0),this.updateGraphics()})))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null))]),this._controlPointManipulations.forEach(((t,e)=>{const i=t=>{this.addHandles([t.events.on(["click","grab-changed"],(t=>this.updateActiveHandle(e)))])};t.forEachManipulator(i)})),this.addHandles([t.on("key-down",(i=>{t.activeTool===this&&(i.key!==S.shift||i.repeat||(this._isModifierActive=!0,i.stopPropagation()),i.key!==S.toggleOpacity||i.repeat||(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,i.stopPropagation()),i.key!==S.primaryKey||i.repeat||(this._factor=b,i.stopPropagation()),this._isModifierActive&&(i.key===S.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===S.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===S.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===S.right&&(this._move(this._factor,0),i.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===S.shift&&(this._isModifierActive=!1,e.stopPropagation()),e.key===S.primaryKey&&(this._factor=k,e.stopPropagation()))}))]),t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation())}destroy(){const{map:t}=this.view;this._controlPointManipulations.forEach((t=>t.destroy())),this._controlPointEditGeometryOperations.forEach((t=>t.destroy())),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=a(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return p(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const t=this._undoStack[this._undoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canUndo}canRedo(){const t=this._redoStack[this._redoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canRedo}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();this._controlPointEditGeometryOperations[t].undo(),this.updateGraphics(),this._redoStack.push(t)}}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();this._controlPointEditGeometryOperations[t].redo(),this.updateGraphics(),this._undoStack.push(t)}}refresh(){const{mediaElement:t}=this;if(r(t.georeference))return;const e=t.georeference;"control-points"!==e.type||r(e.coords)||(this._georeference=e,s(this._georeference.controlPoints).forEach((({mapPoint:t},e)=>{const i=this._controlPointEditGeometryOperations[e],o=i.data.components[0].vertices[0];i.setVertexPosition(o,i.data.coordinateHelper.pointToVector(t))})),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._georeference,e=s(t.controlPoints),i=s(e[0].mapPoint).spatialReference,o=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map(((r,a)=>{const n=r.data.geometry;return this._controlPointGraphics[a].geometry=n,{mapPoint:l(n,i),sourcePoint:o?s(e[a]).sourcePoint:t.toSource(n)}}))}updateActiveHandle(t){if(this.activeHandle===t)return;const e=s(this._controlPointGraphics[this.activeHandle].symbol).clone();m(e,o()),this._controlPointGraphics[this.activeHandle].symbol=e;const i=s(this._controlPointGraphics[t].symbol).clone();m(i,G),this._controlPointGraphics[t].symbol=i,this.activeHandle=t,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const t=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=t.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}_getInfo(t){return{editGeometryOperations:this._controlPointEditGeometryOperations[t],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(t,e){const i=this._controlPointEditGeometryOperations[this.activeHandle],o=[];for(const s of i.data.components)o.push(...s.vertices);const r=i.moveVertices(o,t*this.view.resolution,e*this.view.resolution,0,P.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([h()],M.prototype,"_hasValidSpatialReference",null),t([h()],M.prototype,"activeHandle",void 0),t([h({constructOnly:!0,nonNullable:!0})],M.prototype,"mediaElement",void 0),t([h({constructOnly:!0})],M.prototype,"view",void 0),M=t([c("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],M);export{M as ControlPointsTransformTool,S as KEYS};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as o}from"../../../../core/analysisThemeUtils.js";import{destroyMaybe as r,isNone as s,unwrap as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{project as l,initializeProjection as p}from"../../../../geometry/projection.js";import{isValid as d}from"../../../../geometry/support/spatialReferenceUtils.js";import m from"../../../../layers/GraphicsLayer.js";import{applyCIMSymbolColor as y}from"../../../../symbols/support/cimSymbolUtils.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{DragManipulation as g}from"./manipulations/DragManipulation.js";import{primaryKey as f}from"../../../input/keys.js";import{InteractiveToolBase as u}from"../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as v}from"../../../interactive/editGeometry/interfaces.js";import S from"../../../../symbols/CIMSymbol.js";const k={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:f},b=1,G=10,M=new e("#009AF2");let w=class extends u{constructor(t){super(t),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new m({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0}initialize(){this._initialize()}destroy(){const{map:t}=this.view;this._controlPointManipulations.forEach((t=>t.destroy())),this._controlPointEditGeometryOperations.forEach((t=>t.destroy())),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=r(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return d(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const t=this._undoStack[this._undoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canUndo}canRedo(){const t=this._redoStack[this._redoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canRedo}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();this._controlPointEditGeometryOperations[t].undo(),this.updateGraphics(),this._redoStack.push(t)}}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();this._controlPointEditGeometryOperations[t].redo(),this.updateGraphics(),this._undoStack.push(t)}}refresh(){const{mediaElement:t}=this;if(s(t.georeference))return;const e=t.georeference;"control-points"!==e.type||s(e.coords)||(this._georeference=e,a(this._georeference.controlPoints).forEach((({mapPoint:t},e)=>{const i=this._controlPointEditGeometryOperations[e],o=i.data.components[0].vertices[0];i.setVertexPosition(o,i.data.coordinateHelper.pointToVector(t))})),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._georeference,e=a(t.controlPoints),i=a(e[0].mapPoint).spatialReference,o=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map(((r,s)=>{const n=r.data.geometry;return this._controlPointGraphics[s].geometry=n,{mapPoint:l(n,i),sourcePoint:o?a(e[s]).sourcePoint:t.toSource(n)}}))}updateActiveHandle(t){if(this.activeHandle===t)return;const e=a(this._controlPointGraphics[this.activeHandle].symbol).clone();y(e,o()),this._controlPointGraphics[this.activeHandle].symbol=e;const i=a(this._controlPointGraphics[t].symbol).clone();y(i,M),this._controlPointGraphics[t].symbol=i,this.activeHandle=t,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const t=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=t.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}async _initialize(){const{view:t,mediaElement:e}=this;if(s(e.georeference))return;const r=e.georeference;"control-points"!==r.type||s(r.coords)||(this._georeference=r,this._initialControlPoints=a(this._georeference.controlPoints),t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=a(this._georeference.controlPoints).map((({mapPoint:e})=>P.fromGeometry(l(e,t.spatialReference),_.Local))),this._controlPointGraphics=this._controlPointEditGeometryOperations.map(((t,e)=>new i({symbol:new S({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e===this.activeHandle?M.toArray():o().toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:t.data.geometry}))),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map((e=>new g({tool:this,view:t,graphic:e}))),this.addHandles([...this._controlPointManipulations.map(((t,e)=>t.createDragPipeline(this._getInfo.bind(this,e),((t,i)=>{"start"===t.action&&(this._undoStack.push(e),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0),this.updateGraphics()})))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null))]),this._controlPointManipulations.forEach(((t,e)=>{const i=t=>{this.addHandles([t.events.on(["click","grab-changed"],(t=>this.updateActiveHandle(e)))])};t.forEachManipulator(i)})),this.addHandles([t.on("key-down",(i=>{t.activeTool===this&&(i.key!==k.shift||i.repeat||(this._isModifierActive=!0,i.stopPropagation()),i.key!==k.toggleOpacity||i.repeat||(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,i.stopPropagation()),i.key!==k.primaryKey||i.repeat||(this._factor=G,i.stopPropagation()),this._isModifierActive&&(i.key===k.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===k.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===k.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===k.right&&(this._move(this._factor,0),i.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===k.shift&&(this._isModifierActive=!1,e.stopPropagation()),e.key===k.primaryKey&&(this._factor=b,e.stopPropagation()))}))]))}async _loadProjectionEngine(){const t=a(a(this._georeference.controlPoints)[0].mapPoint);return p(t.spatialReference,this.view.spatialReference)}_getInfo(t){return{editGeometryOperations:this._controlPointEditGeometryOperations[t],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(t,e){const i=this._controlPointEditGeometryOperations[this.activeHandle],o=[];for(const s of i.data.components)o.push(...s.vertices);const r=i.moveVertices(o,t*this.view.resolution,e*this.view.resolution,0,v.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([c()],w.prototype,"_hasValidSpatialReference",null),t([c()],w.prototype,"activeHandle",void 0),t([c({constructOnly:!0,nonNullable:!0})],w.prototype,"mediaElement",void 0),t([c({constructOnly:!0})],w.prototype,"view",void 0),w=t([h("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],w);export{w as ControlPointsTransformTool,k as KEYS};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i,getContrastColor as s}from"../../../../core/analysisThemeUtils.js";import{unwrap as o,isSome as r,destroyMaybe as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as h}from"../../../../core/unitUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as l,f as _}from"../../../../chunks/vec2.js";import{a as m,U as d}from"../../../../chunks/vec2f64.js";import{g as y,l as u,n as g,a as f,h as v,b as G}from"../../../../chunks/vec3.js";import{c as w}from"../../../../chunks/vec3f64.js";import{project as R}from"../../../../geometry/projection.js";import{a as b,c as k}from"../../../../chunks/boundedPlane.js";import{equals as j}from"../../../../geometry/support/spatialReferenceUtils.js";import P from"../../../../layers/GraphicsLayer.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{DragManipulation as C}from"./manipulations/DragManipulation.js";import{RotateManipulation as S}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as M}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as T,SnapRotation as O}from"./manipulations/utils.js";import{primaryKey as U}from"../../../input/keys.js";import{InteractiveToolBase as D}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as x}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as L}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as B}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as H}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as V}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as I}from"../../../support/screenUtils.js";import K from"../../../../symbols/SimpleFillSymbol.js";import N from"../../../../symbols/SimpleMarkerSymbol.js";import z from"../../../../geometry/Polygon.js";import W from"../../../../geometry/Point.js";const q={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:U},F=80,J=10,Q=30,X=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Y=1,Z=10;let $=class extends D{constructor(t){super(t),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=b(),this._displayPlaneCache=b(),this._mainAxisCache=m(),this._rotationHandleCache=w(),this._cornerA=w(),this._cornerB=w(),this._cornerC=w(),this._cornerD=w(),this._avgAB=w(),this._avgBC=w(),this._avgCD=w(),this._avgDA=w(),this._preserveAspectRatio=new T,this._snapRotation=new O,this._graphicsLayer=new P({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){const{view:t,target:a}=this;if("georeference"in a){const t=o(a.georeference);this._graphic=new e({geometry:o(t.coords)}),this._initialControlPoints="control-points"===t.type?t.controlPoints:null}else this._graphic=a,this._initialGeometry=o(a.geometry);const h=this._graphic.geometry;this._editGeometryOperations=E.fromGeometry(R(h,t.spatialReference),A.Local),this._backgroundGraphic=new e({symbol:new K({color:"transparent",outline:{type:"simple-line",color:i(),width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new e({symbol:new N({color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((t=>new e({symbol:new N({size:6,style:"square",color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:t}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new C({tool:this,view:t,graphic:this._graphic}),this._rotateManipulation=new S({tool:this,view:t,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((e,i)=>new M({tool:this,view:t,graphic:e,direction:X[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((t=>t.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),t.on("click",(async e=>{if(null!=t.activeTool&&t.activeTool!==this)return;const i=I(e),s=[];t.map.allLayers.forEach((t=>{"vector-tile"!==t.type&&"imagery"!==t.type||s.push(t)}));const o=await this.view.hitTest(i,{exclude:s}),n=o.results;if(0===n.length)t.activeTool=null;else{const e=V(o.results),i="georeference"in a,s=n.map((t=>"media"===t.type?t.element:null)).filter(Boolean),h=[...this._graphicsLayer.graphics,i?null:a].filter(Boolean);i&&s.includes(a)||r(e)&&h.includes(e.graphic)?null==t.activeTool&&(t.activeTool=this):t.activeTool=null}}))]);const p=t=>{this.addHandles(t.events.on("grab-changed",(t=>{"georeference"in a&&("start"===t.action?a.opacity*=.5:"end"===t.action&&(a.opacity*=2))})))};this._dragManipulation.forEachManipulator(p),this._rotateManipulation.forEachManipulator(p),this._scaleManipulations.forEach((t=>t.forEachManipulator(p))),this.addHandles([t.on("key-down",(e=>{t.activeTool===this&&(e.key!==q.shift||e.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,e.stopPropagation()),e.key!==q.toggleOpacity||e.repeat||("georeference"in a&&(a.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),e.stopPropagation()),e.key!==q.primaryKey||e.repeat||(this._factor=Z,e.stopPropagation()),this._isModifierActive&&(e.key===q.plus&&(this._scale(this._factor),e.stopPropagation()),e.key===q.minus&&(this._scale(-this._factor),e.stopPropagation()),e.key===q.up&&(this._move(0,this._factor),e.stopPropagation()),e.key===q.down&&(this._move(0,-this._factor),e.stopPropagation()),e.key===q.left&&(this._move(-this._factor,0),e.stopPropagation()),e.key===q.right&&(this._move(this._factor,0),e.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===q.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,e.stopPropagation()),e.key===q.primaryKey&&(this._factor=Y,e.stopPropagation()))}))]),t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation()}destroy(){const{map:t}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((t=>t.destroy())),this._editGeometryOperations.destroy(),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=a(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const t=this._graphic.geometry;if(!r(t))return null;const e=this._editGeometryOperations.data,i=e.components[0].edges[0],s=l(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);_(s,s);let o=F*this.view.resolution;const a=this.view.spatialReference;return j(a,t.spatialReference)&&(o*=h(a)/h(t.spatialReference)),H(s,e,o,this._planeCache)}get _displayPlane(){const t=this._plane;if(!t)return null;const e=this._displayPlaneCache;k(t,e);const i=J*this.view.resolution;return y(e.basis1,e.basis1,1+i/u(e.basis1)),y(e.basis2,e.basis2,1+i/u(e.basis2)),e}get _backgroundGraphicGeometry(){const t=this._displayPlane;if(!t)return null;const e=this.view.spatialReference;return this._updateDisplayPlaneConrers(t),new z({spatialReference:e,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const t=this._plane;if(!t)return null;const e=this._rotationHandleCache;return g(e,t.basis1),y(e,e,Q*this.view.resolution),f(e,e,t.origin),f(e,e,t.basis1),new W({x:e[0],y:e[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const t=this._displayPlane;if(!t)return[];const e=this.view.spatialReference;this._updateDisplayPlaneConrers(t);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=v(this._avgAB,i,s,.5),n=v(this._avgBC,s,o,.5),h=v(this._avgCD,o,r,.5),p=v(this._avgDA,r,i,.5);return[new W({x:i[0],y:i[1],spatialReference:e}),new W({x:s[0],y:s[1],spatialReference:e}),new W({x:o[0],y:o[1],spatialReference:e}),new W({x:r[0],y:r[1],spatialReference:e}),new W({x:a[0],y:a[1],spatialReference:e}),new W({x:n[0],y:n[1],spatialReference:e}),new W({x:h[0],y:h[1],spatialReference:e}),new W({x:p[0],y:p[1],spatialReference:e})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:t,target:e}=this,i="georeference"in e?o(o(e.georeference).coords):e.geometry,s=this._editGeometryOperations,r=s.data.components[0].vertices,a=x.fromGeometry(R(i,t.spatialReference),A.Local).components[0].vertices;r.forEach(((t,e)=>{s.setVertexPosition(t,a[e].pos)})),this.updateGraphics()}reset(){const{target:t}=this;if("georeference"in t){const e=o(t.georeference);"control-points"===e.type&&(e.controlPoints=this._initialControlPoints)}else t.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._editGeometryOperations.data.geometry;if("georeference"in this.target){o(this.target.georeference).coords=t}this._graphic.geometry=t,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((t,e)=>{this._scaleGraphics[e].geometry=t}))}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}_updateDisplayPlaneConrers(t){const{basis1:e,basis2:i,origin:s}=t,o=this._cornerA;f(o,s,e),f(o,o,i);const r=this._cornerB;f(r,s,e),G(r,r,i);const a=this._cornerC;G(a,s,e),G(a,a,i);const n=this._cornerD;G(n,s,e),f(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(t,e){"start"===t.action&&(this._sharedUndoStack.push({tool:this,operation:e}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(t){const e=this._editGeometryOperations,i=[];for(const a of e.data.components)i.push(...a.vertices);const s=e.data.geometry.extent?.width,o=(s+t*this.view.resolution)/s,r=e.scaleVertices(i,this._plane.origin,d,o,o,L.NEW_STEP,B.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(t,e){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,t*this.view.resolution,e*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([p()],$.prototype,"_plane",null),t([p()],$.prototype,"_backgroundGraphicGeometry",null),t([p()],$.prototype,"_rotateGraphicGeometry",null),t([p()],$.prototype,"_scaleGraphicGeometries",null),t([p()],$.prototype,"preserveAspectRatio",void 0),t([p()],$.prototype,"snapRotation",void 0),t([p({constructOnly:!0,nonNullable:!0})],$.prototype,"target",void 0),t([p({constructOnly:!0})],$.prototype,"view",void 0),$=t([c("esri.views.2d.interactive.editingTools.TransformTool")],$);export{q as KEYS,$ as TransformTool};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i,getContrastColor as s}from"../../../../core/analysisThemeUtils.js";import{destroyMaybe as o,isSome as r,unwrap as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as h}from"../../../../core/unitUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as l,f as _}from"../../../../chunks/vec2.js";import{a as m,U as d}from"../../../../chunks/vec2f64.js";import{g as y,l as u,n as g,a as f,h as v,b as G}from"../../../../chunks/vec3.js";import{c as w}from"../../../../chunks/vec3f64.js";import{project as R,initializeProjection as b}from"../../../../geometry/projection.js";import{a as k,c as j}from"../../../../chunks/boundedPlane.js";import{equals as P}from"../../../../geometry/support/spatialReferenceUtils.js";import A from"../../../../layers/GraphicsLayer.js";import{ViewingMode as C}from"../../../ViewingMode.js";import{DragManipulation as S}from"./manipulations/DragManipulation.js";import{RotateManipulation as M}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as T}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as O,SnapRotation as U}from"./manipulations/utils.js";import{primaryKey as D}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as E}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as L}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as B}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as H}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as V}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as I}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as z}from"../../../support/screenUtils.js";import K from"../../../../geometry/Polygon.js";import N from"../../../../geometry/Point.js";import W from"../../../../symbols/SimpleFillSymbol.js";import q from"../../../../symbols/SimpleMarkerSymbol.js";const F={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:D},J=80,Q=10,X=30,Y=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Z=1,$=10;let tt=class extends x{constructor(t){super(t),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=k(),this._displayPlaneCache=k(),this._mainAxisCache=m(),this._rotationHandleCache=w(),this._cornerA=w(),this._cornerB=w(),this._cornerC=w(),this._cornerD=w(),this._avgAB=w(),this._avgBC=w(),this._avgCD=w(),this._avgDA=w(),this._preserveAspectRatio=new O,this._snapRotation=new U,this._graphicsLayer=new A({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:t}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((t=>t.destroy())),this._editGeometryOperations.destroy(),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=o(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const t=this._graphic.geometry;if(!r(t))return null;const e=this._editGeometryOperations.data,i=e.components[0].edges[0],s=l(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);_(s,s);let o=J*this.view.resolution;const a=this.view.spatialReference;return P(a,t.spatialReference)&&(o*=h(a)/h(t.spatialReference)),V(s,e,o,this._planeCache)}get _displayPlane(){const t=this._plane;if(!t)return null;const e=this._displayPlaneCache;j(t,e);const i=Q*this.view.resolution;return y(e.basis1,e.basis1,1+i/u(e.basis1)),y(e.basis2,e.basis2,1+i/u(e.basis2)),e}get _backgroundGraphicGeometry(){const t=this._displayPlane;if(!t)return null;const e=this.view.spatialReference;return this._updateDisplayPlaneConrers(t),new K({spatialReference:e,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const t=this._plane;if(!t)return null;const e=this._rotationHandleCache;return g(e,t.basis1),y(e,e,X*this.view.resolution),f(e,e,t.origin),f(e,e,t.basis1),new N({x:e[0],y:e[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const t=this._displayPlane;if(!t)return[];const e=this.view.spatialReference;this._updateDisplayPlaneConrers(t);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=v(this._avgAB,i,s,.5),n=v(this._avgBC,s,o,.5),h=v(this._avgCD,o,r,.5),c=v(this._avgDA,r,i,.5);return[new N({x:i[0],y:i[1],spatialReference:e}),new N({x:s[0],y:s[1],spatialReference:e}),new N({x:o[0],y:o[1],spatialReference:e}),new N({x:r[0],y:r[1],spatialReference:e}),new N({x:a[0],y:a[1],spatialReference:e}),new N({x:n[0],y:n[1],spatialReference:e}),new N({x:h[0],y:h[1],spatialReference:e}),new N({x:c[0],y:c[1],spatialReference:e})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:t,target:e}=this,i="georeference"in e?a(a(e.georeference).coords):e.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=E.fromGeometry(R(i,t.spatialReference),C.Local).components[0].vertices;o.forEach(((t,e)=>{s.setVertexPosition(t,r[e].pos)})),this.updateGraphics()}reset(){const{target:t}=this;if("georeference"in t){const e=a(t.georeference);"control-points"===e.type&&(e.controlPoints=this._initialControlPoints)}else t.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._editGeometryOperations.data.geometry;if("georeference"in this.target){a(this.target.georeference).coords=t}this._graphic.geometry=t,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((t,e)=>{this._scaleGraphics[e].geometry=t}))}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}async _initialize(){const{view:t,target:o}=this;if("georeference"in o){const t=a(o.georeference);this._graphic=new e({geometry:a(t.coords)}),this._initialControlPoints="control-points"===t.type?t.controlPoints:null}else this._graphic=o,this._initialGeometry=a(o.geometry);t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=L.fromGeometry(R(this._graphic.geometry,t.spatialReference),C.Local),this._backgroundGraphic=new e({symbol:new W({color:"transparent",outline:{type:"simple-line",color:i(),width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new e({symbol:new q({color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((t=>new e({symbol:new q({size:6,style:"square",color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:t}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new S({tool:this,view:t,graphic:this._graphic}),this._rotateManipulation=new M({tool:this,view:t,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((e,i)=>new T({tool:this,view:t,graphic:e,direction:Y[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((t=>t.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),t.on("click",(async e=>{if(null!=t.activeTool&&t.activeTool!==this)return;const i=z(e),s=[];t.map.allLayers.forEach((t=>{"vector-tile"!==t.type&&"imagery"!==t.type||s.push(t)}));const a=await this.view.hitTest(i,{exclude:s}),n=a.results;if(0===n.length)t.activeTool=null;else{const e=I(a.results),i="georeference"in o,s=n.map((t=>"media"===t.type?t.element:null)).filter(Boolean),h=[...this._graphicsLayer.graphics,i?null:o].filter(Boolean);i&&s.includes(o)||r(e)&&h.includes(e.graphic)?null==t.activeTool&&(t.activeTool=this):t.activeTool=null}}))]);const h=t=>{this.addHandles(t.events.on("grab-changed",(t=>{"georeference"in o&&("start"===t.action?o.opacity*=.5:"end"===t.action&&(o.opacity*=2))})))};this._dragManipulation.forEachManipulator(h),this._rotateManipulation.forEachManipulator(h),this._scaleManipulations.forEach((t=>t.forEachManipulator(h))),this.addHandles([t.on("key-down",(e=>{t.activeTool===this&&(e.key!==F.shift||e.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,e.stopPropagation()),e.key!==F.toggleOpacity||e.repeat||("georeference"in o&&(o.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),e.stopPropagation()),e.key!==F.primaryKey||e.repeat||(this._factor=$,e.stopPropagation()),this._isModifierActive&&(e.key===F.plus&&(this._scale(this._factor),e.stopPropagation()),e.key===F.minus&&(this._scale(-this._factor),e.stopPropagation()),e.key===F.up&&(this._move(0,this._factor),e.stopPropagation()),e.key===F.down&&(this._move(0,-this._factor),e.stopPropagation()),e.key===F.left&&(this._move(-this._factor,0),e.stopPropagation()),e.key===F.right&&(this._move(this._factor,0),e.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===F.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,e.stopPropagation()),e.key===F.primaryKey&&(this._factor=Z,e.stopPropagation()))}))])}async _loadProjectionEngine(){const t=a(this._graphic.geometry);return b(t.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(t){const{basis1:e,basis2:i,origin:s}=t,o=this._cornerA;f(o,s,e),f(o,o,i);const r=this._cornerB;f(r,s,e),G(r,r,i);const a=this._cornerC;G(a,s,e),G(a,a,i);const n=this._cornerD;G(n,s,e),f(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(t,e){"start"===t.action&&(this._sharedUndoStack.push({tool:this,operation:e}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(t){const e=this._editGeometryOperations,i=[];for(const a of e.data.components)i.push(...a.vertices);const s=e.data.geometry.extent?.width,o=(s+t*this.view.resolution)/s,r=e.scaleVertices(i,this._plane.origin,d,o,o,B.NEW_STEP,H.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(t,e){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,t*this.view.resolution,e*this.view.resolution,0,B.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([c()],tt.prototype,"_plane",null),t([c()],tt.prototype,"_backgroundGraphicGeometry",null),t([c()],tt.prototype,"_rotateGraphicGeometry",null),t([c()],tt.prototype,"_scaleGraphicGeometries",null),t([c()],tt.prototype,"preserveAspectRatio",void 0),t([c()],tt.prototype,"snapRotation",void 0),t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"target",void 0),t([c({constructOnly:!0})],tt.prototype,"view",void 0),tt=t([p("esri.views.2d.interactive.editingTools.TransformTool")],tt);export{F as KEYS,tt as TransformTool};