@arcgis/core 4.30.0 → 4.30.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 (41) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{c39237c00c1d588dc107.js → 25c41ceb1951d80f4798.js} +1 -1
  3. package/assets/esri/core/workers/chunks/61500e48a3d672445e14.js +1 -0
  4. package/assets/esri/core/workers/chunks/{f13fb6b712e364bbf48c.js → 61e1f1564a8440f186e7.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{70ebc0e38eb1cfb79320.js → 85701ca4ebc2de529053.js} +1 -1
  6. package/assets/esri/core/workers/chunks/88e8547079b299572bfe.js +1 -0
  7. package/assets/esri/core/workers/chunks/{403f73017bf763f7471c.js → 91f8f99c6f64e85458f3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{37dfb3ff86c4ef1b26c1.js → a9efe7abda35995d0dd8.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{4cf5414d67aa888f2322.js → d502a5fe47e77d63ae5e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/d6c954272cc96d6b7987.js +1 -0
  11. package/assets/esri/core/workers/chunks/{aa198e898b46c6e89d0b.js → e2c927ef4d88a0a8104b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{880e8329e264b6156fbc.js → e3a049ebcb0b89f16228.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f927c28f2fa78ec68235.js → ed9c88afccc5041d899a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{31f7a3c8e1a5b4ca4a73.js → fb97d6cc841c67c09d5c.js} +1 -1
  15. package/assets/esri/themes/base/widgets/_Grid.scss +3 -1
  16. package/assets/esri/themes/dark/main.css +1 -1
  17. package/assets/esri/themes/light/main.css +1 -1
  18. package/assets/esri/themes/light/view.css +1 -1
  19. package/chunks/persistableUrlUtils.js +1 -1
  20. package/identity/IdentityManagerBase.js +1 -1
  21. package/interfaces.d.ts +94 -50
  22. package/kernel.js +1 -1
  23. package/layers/CatalogLayer.js +1 -1
  24. package/layers/mixins/EditBusLayer.js +1 -1
  25. package/layers/support/MediaElementBase.js +1 -1
  26. package/package.json +1 -1
  27. package/portal/support/layersLoader.js +1 -1
  28. package/portal/support/loadUtils.js +1 -1
  29. package/portal/support/urlUtils.js +1 -1
  30. package/rest/imageService/fetchRasterInfo.js +1 -1
  31. package/support/persistableUrlUtils.js +1 -1
  32. package/support/revision.js +1 -1
  33. package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
  34. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  35. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  36. package/widgets/FeatureForm.js +1 -1
  37. package/widgets/FeatureTable/Grid/Column.js +1 -1
  38. package/widgets/FeatureTable.js +1 -1
  39. package/assets/esri/core/workers/chunks/20d447aa01a66a464363.js +0 -1
  40. package/assets/esri/core/workers/chunks/2b39f50b92fe27c30497.js +0 -1
  41. package/assets/esri/core/workers/chunks/8865ca9cb8d867d48d2d.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1737],{70668:(e,t,i)=>{i.d(t,{A:()=>c});var r=i(90237),s=i(69540),n=i(25482),o=i(88930),a=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),d=i(40608),u=i(73133);let p=class extends((0,s.O)(n.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r._)([(0,l.e)(u.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,r._)([(0,d.$)("esri.TimeInterval")],p);const c=p},54239:(e,t,i)=>{i.d(t,{A:()=>w});var r,s=i(90237),n=i(4576),o=i(66552),a=i(25482),l=i(83047),d=i(67076),u=i(10107),p=(i(44208),i(53966),i(36005)),c=i(40608),h=i(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=y.jsonValues.slice();(0,n.Xy)(f,"orthometric");const m=(0,o.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=r=class extends a.oY{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return y.write(e,t,i)}readHeightModel(e,t,i){return y.read(e)||(i?.messages&&i.messages.push(function(e,t){return new d.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:i})),null)}readHeightUnit(e,t,i){return m.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readHeightUnitService(e,t,i){return(0,l.LA)(e)||m.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new r({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=(0,l.k1)(t);return new r({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new r;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new d.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal"}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,h.K)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,p.w)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.MZ)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:m.write}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,p.w)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,p.w)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=r=(0,s._)([(0,c.$)("esri.geometry.HeightModelInfo")],g);const w=g},13899:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Oe});var r=i(90237),s=i(52106),n=i(13874),o=(i(86162),i(94409),i(65345),i(42980),i(39290),i(92438),i(96576),i(93618),i(65494),i(15036)),a=i(69540),l=i(5503),d=i(49186),u=i(53966),p=i(92071),c=i(74887),h=i(36708),y=i(10107),f=(i(44208),i(87811),i(88620)),m=i(36005),g=i(40608),v=i(35666),w=i(1535),_=i(86738),I=i(4146),b=i(55726),F=i(52136),A=i(18768),S=i(69208),M=i(47685),L=i(16131),x=i(8303),T=i(25036),E=i(58947),O=i(82935),j=i(60945),Z=i(70668),P=i(25482),U=i(30524);function R({associatedLayer:e,serviceUpdateTimeStamp:t}){const i=e?.editingInfo?.lastEditDate,r=e?.serverGens,s=null!=i,n=null!=t,o=s&&n&&t.lastUpdate!==i.getTime();return s&&(o||!n&&r?.minServerGen!==r?.serverGen)}var $=i(96184);const D=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return(0,U.sv)(t,this.fieldsIndex),t}set timeInfo(e){(0,U.sv)(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:i,endTimeField:r}=t;if(null==i&&null==r)return;if(R({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let r=null;try{const i=await(this.fetchStatistics?.(t,e));r=i?.stats}catch{}if(null==r)return null;const{minTimeStr:s,min:n,maxTimeStr:o,max:a}=r,l=t===i?s??n:o??a;return null!=l?new Date(l):null},[n,o]=await Promise.all([s(i),s(r)]);if(null!=i&&null==n||null!=r&&null==o)return;const a=new j.A({start:n,end:o});this.setAtOrigin("timeInfo",new $.A({endField:r,startField:i,fullTimeExtent:a}),"service")}};return(0,r._)([(0,y.MZ)({type:$.A,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),(0,r._)([(0,y.MZ)({type:j.A,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),(0,r._)([(0,y.MZ)({type:Z.A,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),(0,r._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),(0,r._)([(0,y.MZ)({type:N,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=(0,r._)([(0,g.$)("esri.layers.mixins.TemporalSceneLayer")],t),t};let N=class extends P.oY{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};(0,r._)([(0,y.MZ)({type:String})],N.prototype,"endTimeField",void 0),(0,r._)([(0,y.MZ)({type:String})],N.prototype,"startTimeField",void 0),N=(0,r._)([(0,g.$)("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],N);var C=i(60694),k=i(92009),H=i(4071),q=i(10873),V=i(15426),G=i(40530),K=i(67202),Q=i(17036),W=i(95466),J=i(50805),B=i(20557),Y=i(81457),z=i(39383),X=i(37352),ee=i(4513);let te=class extends P.oY{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,r._)([(0,y.MZ)({type:String,json:{read:!0,write:!0}})],te.prototype,"name",void 0),(0,r._)([(0,y.MZ)({type:String,json:{read:!0,write:!0}})],te.prototype,"field",void 0),(0,r._)([(0,y.MZ)({type:[Number],json:{read:!0,write:!0}})],te.prototype,"currentRangeExtent",void 0),(0,r._)([(0,y.MZ)({type:[Number],json:{read:!0,write:!0}})],te.prototype,"fullRangeExtent",void 0),(0,r._)([(0,y.MZ)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],te.prototype,"type",void 0),te=(0,r._)([(0,g.$)("esri.layers.support.RangeInfo")],te);var ie,re=i(78888),se=i(4718),ne=i(87024),oe=i(67076),ae=i(39829),le=i(57251);let de=ie=class extends((0,P.Te)(l.A.ofType(ae.A))){constructor(e){super(e)}clone(){return new ie(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((i=>{if(!t.equals(i.spatialReference)){if(!(0,le.canProjectWithoutEngine)(i.spatialReference,t))return e?.messages&&e.messages.push(new oe.A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const r=new ae.A;(0,le.projectPolygon)(i,r,t),i=r}const r=i.toJSON(e);return delete r.spatialReference,r})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new oe.A("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const i=new ie;return e.forEach((e=>i.add(ae.A.fromJSON(e,t)))),i}};de=ie=(0,r._)([(0,g.$)("esri.layers.support.PolygonCollection")],de);const ue=de;var pe,ce=i(97159);let he=pe=class extends P.oY{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new ue,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.OH))}readGeometries(e,t,i){Array.isArray(e)?this.geometries=ue.fromJSON(e,i):this._geometriesSource={url:(0,ce.f)(e,i),context:i}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:i,context:r}=this._geometriesSource,s=await(0,re.A)(i,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map((e=>({...e,spatialReference:n})));this.geometries=ue.fromJSON(o,r),this._geometriesSource=null}clone(){const e=new pe({geometries:(0,se.o8)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,r._)([(0,y.MZ)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],he.prototype,"spatialRelationship",void 0),(0,r._)([(0,y.MZ)({type:ue,nonNullable:!0,json:{write:!0}}),(0,ne.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],he.prototype,"geometries",void 0),(0,r._)([(0,m.w)(["web-scene","portal-item"],"geometries")],he.prototype,"readGeometries",null),he=pe=(0,r._)([(0,g.$)("esri.layers.support.SceneFilter")],he);const ye=he;var fe=i(84952),me=i(8947),ge=i(61956),ve=i(24212),we=i(57465),_e=i(30291);async function Ie(e){const t=[];for(const i of e)i.name.toLowerCase().endsWith(".zip")?t.push(be(i)):t.push(Promise.resolve(i));return(await Promise.all(t)).flat()}async function be(e){const{BlobReader:t,ZipReader:r,BlobWriter:s}=await Promise.all([i.e(8392),i.e(9588)]).then(i.bind(i,9588)),n=[],o=new r(new t(e));return(await o.getEntries()).forEach((e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new s,i=e.getData?.(t).then((t=>new File([t],e.filename)));i&&n.push(i)})),Promise.all(n)}var Fe=i(28030),Ae=i(45671),Se=i(78553);const Me=new Set(["3DObject","Point"]),Le=(0,Q.p)();let xe=class extends(D((0,M.w6)((0,E.w6)((0,A.b)((0,L.q)((0,x.A)((0,T.j)((0,p.P)((0,S.d)((0,F.p)((0,a.O)(I.A)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new l.A,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const i=this.getFeatureType(t?.feature)?.domains?.[e];return i&&"inherited"!==i.type?i:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new W.A(this.fields)}readNodePages(e,t,i){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:J.W4.fromJSON(e,i)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,V.C$)(this.associatedLayer)}get geometryType(){return Ee[this.profile]||"mesh"}set renderer(e){(0,U.yp)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:H.P;const{query:t,queryRelated:i,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:p},operations:{supportsEditing:c,supportsAdd:h,supportsUpdate:y,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,_=!!this.associatedLayer?.infoFor3D&&(0,we.Vo)();return{query:t,queryRelated:i,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:_&&o,supportsUploadWithItemId:n},data:{supportsAttachment:p,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:c&&w,supportsAdd:_&&h&&w,supportsDelete:_&&f&&w,supportsUpdate:y&&w,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const i=t.store.profile;return null!=i&&Te[i]?Te[i]:(u.A.getLogger(this).error("Unknown or missing profile",{profile:i,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(c.QP),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await(0,me.L)(this,{origin:"service"},t),(0,U.yp)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){u.A.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ge.A;return"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const i=(0,U.hL)(this.fieldsIndex,await(0,Ae.TO)(this,(0,Ae.D8)(this)));return(0,Fe.s1)(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,i,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const i=await this.queryCachedAttributes(e,[t]);if(!i||0===i.length)throw new d.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const r=new s.A;return r.attributes=i[0],r.layer=this,r.sourceLayer=this,r}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(u.A.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,_e.tn)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d.A("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(E.Xh.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(E.Xh.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await i.e(6247).then(i.bind(i,78628));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new d.A(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new d.A(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,C.Wo)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,V.GA)(n,e.deleteFeatures,o)}),r(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const i=e=>{throw u.A.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||i(new d.A("invalid:layer","SceneLayer has no capability for mesh conversion"));const r=await this.extractAndFilterFiles(e),s=r.reduce(((e,t)=>(0,B.oF)(this.infoFor3D,t)?e+1:e),0);0===s&&i(new b.VP),s>1&&i(new b.XQ);const n=this.spatialReference,o=t?.location??new _.A({x:0,y:0,z:0,spatialReference:n}),a=o.spatialReference.isGeographic?"local":"georeferenced",l=w.A.createWithExternalSource(o,r,{vertexSpace:a}),[p]=await this.uploadAssets([l],t);return p}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await Ie(e)).filter((e=>(0,B.fu)(t,e))):e}validateLayer(e){if(e.layerType&&!Me.has(e.layerType))throw new d.A("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d.A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let i=!1,r=!1;if(null==e)i=!0,r=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":i=!0,r=s;break;case"vertex-reference-frame":i=!0,r=!s;break;default:i=!1}}if(!i)throw new d.A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!r)throw new d.A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new d.A("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some((t=>t.name===e.name)),i=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||i,supportsLayerQuery:i};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const i=this.getField(t.name);i?(!i.domain&&t.domain&&(i.domain=t.domain.clone()),i.editable=t.editable,i.nullable=t.nullable,i.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,f.oY)(this);for(let i=0;i<e.length;i++){const r=e[i],s=this.originIdOf(r),n=this.associatedLayer.originIdOf(r);s<n&&(n===v.Gr.SERVICE||n===v.Gr.PORTAL_ITEM)&&t.setAtOrigin(r,this.associatedLayer[r],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");(0,we.Vo)()&&null!=this.associatedLayer?.infoFor3D&&e&&(0,C.Wo)(this.associatedLayer?.url)&&R(this)&&(0,f.oY)(this).setAtOrigin("fullExtent",e.clone(),v.Gr.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:i,portalItem:r}=await(0,k.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ee.S.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:i,portalItem:r}),await this.associatedLayer.load()}catch(e){(0,c.zf)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.C_)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?u.A.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):u.A.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,ve.XF)(u.A.getLogger(this),(0,ve.$7)("Mesh scene layers","relative-to-scene",e)),(0,ve.XF)(u.A.getLogger(this),(0,ve.tW)("Scene layers",e))}async fetchStatistics(e,t){return await async function({fieldName:e,statisticsInfo:t,errorContext:i,fieldsIndex:r,path:s,customParameters:n,apiKey:o,signal:a}){if(null==t)throw new d.A(`${i}:no-cached-statistics`,"Cached statistics are not available for this layer");const l=r.get(e);if(null==l)throw new d.A(`${i}:field-unexisting`,`Field '${e}' does not exist on the layer`);const u=t.find((e=>e.name===l.name));if(null==u)throw new d.A(`${i}:no-cached-statistics`,"Cached statistics for this attribute are not available");const p=(0,fe.fj)(s,u.href),{data:c}=await(0,re.A)(p,{query:{f:"json",...n,token:o},responseType:"json",signal:a});return c}({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};(0,r._)([(0,y.MZ)({types:{key:"type",base:G.c,typeMap:{selection:K.A}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],xe.prototype,"featureReduction",void 0),(0,r._)([(0,y.MZ)({type:[te],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],xe.prototype,"rangeInfos",void 0),(0,r._)([(0,y.MZ)({json:{read:!1}})],xe.prototype,"associatedLayer",void 0),(0,r._)([(0,y.MZ)({type:["show","hide"]})],xe.prototype,"listMode",void 0),(0,r._)([(0,y.MZ)({type:["ArcGISSceneServiceLayer"]})],xe.prototype,"operationalLayerType",void 0),(0,r._)([(0,y.MZ)({json:{read:!1},readOnly:!0})],xe.prototype,"type",void 0),(0,r._)([(0,y.MZ)({...Le.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"fields",void 0),(0,r._)([(0,y.MZ)()],xe.prototype,"types",null),(0,r._)([(0,y.MZ)()],xe.prototype,"typeIdField",null),(0,r._)([(0,y.MZ)()],xe.prototype,"templates",null),(0,r._)([(0,y.MZ)()],xe.prototype,"formTemplate",null),(0,r._)([(0,y.MZ)({readOnly:!0,clonable:!1})],xe.prototype,"fieldsIndex",null),(0,r._)([(0,y.MZ)({type:X.A,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],xe.prototype,"floorInfo",void 0),(0,r._)([(0,y.MZ)(Le.outFields)],xe.prototype,"outFields",void 0),(0,r._)([(0,y.MZ)({type:J.W4,readOnly:!0,json:{read:!1}})],xe.prototype,"nodePages",void 0),(0,r._)([(0,m.w)("service","nodePages",["nodePages","pointNodePages"])],xe.prototype,"readNodePages",null),(0,r._)([(0,y.MZ)({type:[J.uV],readOnly:!0})],xe.prototype,"materialDefinitions",void 0),(0,r._)([(0,y.MZ)({type:[J.Ot],readOnly:!0})],xe.prototype,"textureSetDefinitions",void 0),(0,r._)([(0,y.MZ)({type:[J.L0],readOnly:!0})],xe.prototype,"geometryDefinitions",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"serviceUpdateTimeStamp",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"attributeStorageInfo",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"statisticsInfo",void 0),(0,r._)([(0,y.MZ)({type:l.A.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],xe.prototype,"excludeObjectIds",void 0),(0,r._)([(0,y.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],xe.prototype,"definitionExpression",void 0),(0,r._)([(0,y.MZ)({type:ye,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],xe.prototype,"filter",void 0),(0,r._)([(0,y.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],xe.prototype,"path",void 0),(0,r._)([(0,y.MZ)(q.Yj)],xe.prototype,"elevationInfo",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"effectiveCapabilities",null),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"effectiveEditingEnabled",null),(0,r._)([(0,y.MZ)({type:String})],xe.prototype,"geometryType",null),(0,r._)([(0,y.MZ)(q.kF)],xe.prototype,"labelsVisible",void 0),(0,r._)([(0,y.MZ)({type:[Y.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:z.w},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:z.w},write:!0}})],xe.prototype,"labelingInfo",void 0),(0,r._)([(0,y.MZ)(q.fV)],xe.prototype,"legendEnabled",void 0),(0,r._)([(0,y.MZ)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const i=t.layerDefinition?.drawingInfo?.transparency;return void 0!==i?(0,Se.D)(i):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],xe.prototype,"opacity",void 0),(0,r._)([(0,y.MZ)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"priority",void 0),(0,r._)([(0,y.MZ)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"semantic",void 0),(0,r._)([(0,y.MZ)({types:o.X,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],xe.prototype,"renderer",null),(0,r._)([(0,y.MZ)({json:{read:!1}})],xe.prototype,"cachedDrawingInfo",void 0),(0,r._)([(0,m.w)("service","cachedDrawingInfo")],xe.prototype,"readCachedDrawingInfo",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"capabilities",null),(0,r._)([(0,y.MZ)({type:Boolean,json:{read:!1}})],xe.prototype,"editingEnabled",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{write:!1,read:!1}})],xe.prototype,"infoFor3D",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{write:!1,read:!1}})],xe.prototype,"relationships",null),(0,r._)([(0,y.MZ)(q.M6)],xe.prototype,"popupEnabled",void 0),(0,r._)([(0,y.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],xe.prototype,"popupTemplate",void 0),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"defaultPopupTemplate",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"objectIdField",void 0),(0,r._)([(0,m.w)("service","objectIdField",["objectIdField","fields"])],xe.prototype,"readObjectIdField",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"globalIdField",void 0),(0,r._)([(0,m.w)("service","globalIdField",["globalIdField","fields"])],xe.prototype,"readGlobalIdField",null),(0,r._)([(0,y.MZ)({readOnly:!0,type:String,json:{read:!1}})],xe.prototype,"displayField",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"profile",void 0),(0,r._)([(0,m.w)("service","profile",["store.profile"])],xe.prototype,"readProfile",null),(0,r._)([(0,y.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],xe.prototype,"normalReferenceFrame",void 0),(0,r._)([(0,y.MZ)(q.PY)],xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r._)([(0,y.MZ)({json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"serviceItemId",void 0),(0,r._)([(0,y.MZ)(O.B)],xe.prototype,"useViewTime",null),xe=(0,r._)([(0,g.$)("esri.layers.SceneLayer")],xe);const Te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Ee={"mesh-pyramids":"mesh",points:"point"},Oe=xe},55726:(e,t,i)=>{i.d(t,{$1:()=>d,H2:()=>h,MT:()=>y,VP:()=>f,WF:()=>u,Wt:()=>o,XQ:()=>m,hK:()=>c,nS:()=>p,uh:()=>a,xY:()=>l});var r=i(49186);const s="upload-assets",n=()=>new Error;class o extends r.A{constructor(){super(`${s}:unsupported`,"Layer does not support asset uploads.",n())}}class a extends r.A{constructor(){super(`${s}:no-glb-support`,"Layer does not support glb.",n())}}class l extends r.A{constructor(){super(`${s}:no-supported-source`,"No supported external source found",n())}}class d extends r.A{constructor(){super(`${s}:not-base-64`,"Expected gltf data in base64 format after conversion.",n())}}class u extends r.A{constructor(){super(`${s}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",n())}}class p extends r.A{constructor(e,t){super(`${s}:bad-response`,`Bad response. Uploaded ${e} items and received ${t} results.`,n())}}class c extends r.A{constructor(e,t){super(`${s}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${t?.code??"-1"}. Error message: ${t?.messages??"unknown"}`,n())}}class h extends r.A{constructor(e){super(`${s}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,n())}}class y extends r.A{constructor(){super(`${s}:convert3D-failed`,"convert3D failed.")}}class f extends r.A{constructor(){super("invalid-input:no-model","No supported model found")}}class m extends r.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},52136:(e,t,i)=>{i.d(t,{p:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=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,s.MZ)({type:String})],t.prototype,"apiKey",null),t=(0,r._)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],t),t}},18768:(e,t,i)=>{i.d(t,{b:()=>l});var r=i(90237),s=i(53966),n=i(10107),o=(i(44208),i(87811),i(40608)),a=i(60694);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,a.qg)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,s.A.getLogger(this)))}};return(0,r._)([(0,n.MZ)()],t.prototype,"title",null),(0,r._)([(0,n.MZ)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.$)("esri.layers.mixins.ArcGISService")],t),t}},69208:(e,t,i)=>{i.d(t,{d:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,r._)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,r._)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},47685:(e,t,i)=>{i.d(t,{Mk:()=>h,Zk:()=>p,w6:()=>m});var r=i(90237),s=i(65529),n=i(4718),o=i(74887),a=i(10107),l=(i(44208),i(53966),i(40608)),d=i(20816);const u=new s.A.EventEmitter;function p(e,t,i=null,r=!1){const s=(0,o.Tw)();return r=null==t||r,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:i,mayReceiveServiceEdits:r,result:s.promise}),s}const c=Symbol();function h(e){return null!=e&&"object"==typeof e&&c in e}function y(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,i){const r=new URL(e).host,s=d.Z3.get(r),n=e=>!e||e===s;return n(t)&&n(i)||t===i}const m=e=>{var t;let i=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:i,gdbVersion:r,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,l=null!=i&&null!=this.layerId&&i===this.layerId,d=y(this),u=y(this)&&f(t,r,this.gdbVersion);if(!a||d&&!u||!l&&!s)return;this.lastEditsEventDate=new Date;const p=o.then((e=>{if(l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.o8)(e)),e;const i=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(i){const{adds:t,updates:r,deletes:s}=i.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:r?r.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return this.emit("edits",o),o}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,s.historicMoment)&&this.emit("edits",s),s})).then((e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,e.historicMoment)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:i,moment:r}=e,s=t===this.url,n=y(this),o=y(this)&&f(t,i,this.gdbVersion),a=y(this)&&!f(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==r&&(this.historicMoment=r)},this.when().then((()=>{this.addHandles(function(e){return u.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return u.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(e,t,i){return"historicMoment"in this&&this.historicMoment!==i&&(0,d.w5)(e,t)}};return t=c,(0,r._)([(0,a.MZ)()],i.prototype,"lastEditsEventDate",void 0),i=(0,r._)([(0,l.$)("esri.layers.mixins.EditBusLayer")],i),i}},8303:(e,t,i)=>{i.d(t,{A:()=>b});var r=i(90237),s=i(92602),n=i(70333),o=i(78888),a=i(60999),l=i(49186),d=i(53966),u=i(97768),p=i(74887),c=i(84952),h=i(10107),y=(i(44208),i(87811),i(36005)),f=i(40608),m=i(43937),g=i(83531),v=i(20655),w=i(80812),_=i(41318),I=i(10407);const b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new w.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await Promise.all([i.e(5356),i.e(1204)]).then(i.bind(i,41204));return(0,p.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.QP)(e),!0))))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:r},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===i.id;if(r&&i.portal.user)return(0,I.It)(i);let s,o;if(r)s=i.portal.url;else try{s=await(0,g.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!s||!(0,c.b8)(s,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,l=!1,d=!1;if(!o)return{features:{edit:a,fullEdit:l},content:{updateItem:d}};try{if(r?await i.reload():(i=new w.default({id:e,portal:{url:s}}),await i.load(t)),i.portal.user)return(0,I.It)(i)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:l},content:{updateItem:d}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const i=F.credential===t?F.user:await this._fetchEditingUser(e);return F.credential=t,F.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=n.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(r))return s.user;const l=`${r}/community/self`,d=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?_.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return i&&r&&!(0,c.ut)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,h.MZ)({type:w.default})],t.prototype,"portalItem",null),(0,r._)([(0,y.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,h.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},F={credential:null,user:null}},25036:(e,t,i)=>{i.d(t,{j:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const i=this._get("effectiveScaleRange");return i&&i.minScale===e.minScale&&i.maxScale===e.maxScale?i:e}};return(0,r._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,r._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,r._)([(0,s.MZ)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,r._)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],t),t}},82935:(e,t,i)=>{i.d(t,{B:()=>h,e:()=>y});var r=i(90237),s=i(60945),n=i(70668),o=i(10107),a=(i(44208),i(53966),i(87811),i(36005)),l=i(40608),d=i(89317),u=i(30524),p=i(96184),c=i(73133);const h={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d.K}}},y=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const i=t.timeInfo.exportOptions;if(!i)return null;const r=i.timeOffset,s=c.j.fromJSON(i.timeOffsetUnits);return r&&s?new n.A({value:r,unit:s}):null}set timeInfo(e){(0,u.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,r._)([(0,o.MZ)({type:s.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,r._)([(0,o.MZ)({type:n.A})],t.prototype,"timeOffset",void 0),(0,r._)([(0,a.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,r._)([(0,o.MZ)({value:null,type:p.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,r._)([(0,o.MZ)(h)],t.prototype,"useViewTime",void 0),t=(0,r._)([(0,l.$)("esri.layers.mixins.TemporalLayer")],t),t}},40530:(e,t,i)=>{i.d(t,{c:()=>a});var r=i(90237),s=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608));let a=class extends s.oY{constructor(){super(...arguments),this.type=null}};(0,r._)([(0,n.MZ)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,r._)([(0,o.$)("esri.layers.support.FeatureReduction")],a)},67202:(e,t,i)=>{i.d(t,{A:()=>d});var r,s=i(90237),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),a=i(40530);let l=r=class extends a.c{constructor(e){super(e),this.type="selection"}clone(){return new r}};(0,s._)([(0,n.MZ)({type:["selection"]})],l.prototype,"type",void 0),l=r=(0,s._)([(0,o.$)("esri.layers.support.FeatureReductionSelection")],l);const d=l},37352:(e,t,i)=>{i.d(t,{A:()=>u});var r,s=i(90237),n=i(5503),o=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(40608));let d=r=class extends o.oY{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"floorField",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllMode",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllLevelIds",void 0),d=r=(0,s._)([(0,l.$)("esri.layers.support.LayerFloorInfo")],d);const u=d},96184:(e,t,i)=>{i.d(t,{A:()=>f});var r=i(90237),s=i(60945),n=i(70668),o=i(69540),a=i(25482),l=i(10107),d=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),p=i(43937),c=i(56400);function h(e,t){return n.A.fromJSON({value:e,unit:t})}let y=class extends((0,o.O)(a.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?s.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?h(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?h(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,r._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],y.prototype,"cumulative",void 0),(0,r._)([(0,l.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"endField",void 0),(0,r._)([(0,l.MZ)({type:s.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"fullTimeExtent",void 0),(0,r._)([(0,d.w)("fullTimeExtent",["timeExtent"])],y.prototype,"readFullTimeExtent",null),(0,r._)([(0,p.K)("fullTimeExtent")],y.prototype,"writeFullTimeExtent",null),(0,r._)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"hasLiveData",void 0),(0,r._)([(0,l.MZ)({type:n.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"interval",void 0),(0,r._)([(0,d.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],y.prototype,"readInterval",null),(0,r._)([(0,p.K)("interval")],y.prototype,"writeInterval",null),(0,r._)([(0,l.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"startField",void 0),(0,r._)([(0,l.MZ)((0,c.P6)("timeReference",!0))],y.prototype,"timeZone",void 0),(0,r._)([(0,l.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"trackIdField",void 0),(0,r._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],y.prototype,"useTime",void 0),(0,r._)([(0,l.MZ)({type:[Date],json:{read:!1}})],y.prototype,"stops",void 0),y=(0,r._)([(0,u.$)("esri.layers.support.TimeInfo")],y);const f=y},17036:(e,t,i)=>{i.d(t,{p:()=>l});var r=i(44208),s=i(53966),n=i(20437),o=i(95466),a=i(30524);function l(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,r.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const i=this.fieldsIndex?.has(t);i||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},20557:(e,t,i)=>{i.d(t,{E1:()=>a,Fm:()=>l,JZ:()=>y,R_:()=>o,fu:()=>s,oF:()=>n,rq:()=>d});const r=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=p(t.name,e?.supportedFormats??[])}function n(e,t){if(!e)return!1;const i=d(t,e.supportedFormats??[]);return null!=i&&e.editFormats.includes(i)}function o(e,t){return c(function(e,t){const i=e.toLowerCase();return u(t).find((e=>h(e)===i))}(e,t))}function a(e,t){return c(p(e,t))}function l(e,t){return h(function(e,t){return u(t).find((t=>c(t)===e))}(e,t))}function d(e,t){return a(e.name,t)??o(e.type,t)}function u(e){return[...r,...e]}function p(e,t){const i=e.toLowerCase();return u(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>i.endsWith(e)))))}function c(e){return e?.[0]}function h(e){return e?.[1].toLowerCase()}function y(e){return e.tables?.find((e=>"assetMaps"===e.role))}},73133:(e,t,i)=>{i.d(t,{j:()=>r});const r=(0,i(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},8947:(e,t,i)=>{i.d(t,{L:()=>o});var r=i(60999),s=i(74887),n=i(67076);async function o(e,t,i){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,r.Ke)(o.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new n.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},20816:(e,t,i)=>{i.d(t,{TA:()=>s,We:()=>a,Z3:()=>n,ZJ:()=>l,w5:()=>d});var r=i(78888);const s=(0,i(13069).vD)(),n=new Map,o=new Map;async function a(e,t,i){if(!e||!i)return!1;if(!t)return!0;const s=new URL(e).host;let o=n.get(s);if(!o){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");o=(await(0,r.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return o===t}async function l(e,t,r=!1){if(!e||!t)return!0;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=o.get(n)?.entries();if(a)for(const[e,o]of a)if(o.name===t){const t=!o.stack?.hasForwardEdits();if(!t&&r){const[{deleteForwardEdits:t},{default:r}]=await Promise.all([i.e(2186).then(i.bind(i,32186)),i.e(2558).then(i.bind(i,32558))]),a=await t(n,e,new r({sessionId:s,moment:o.moment}));return a.success&&o.stack?.clearForwardEdits(),a.success}return t}return!0}function d(e,t){if(!e)return!1;const i=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=o.get(i)?.entries();if(r)for(const[e,i]of r)if(i.name===t)return"edit"===i.lockType;return!1}new Map}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1737],{70668:(e,t,i)=>{i.d(t,{A:()=>c});var r=i(90237),s=i(69540),n=i(25482),o=i(88930),a=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),d=i(40608),u=i(73133);let p=class extends((0,s.O)(n.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r._)([(0,l.e)(u.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,r._)([(0,d.$)("esri.TimeInterval")],p);const c=p},54239:(e,t,i)=>{i.d(t,{A:()=>w});var r,s=i(90237),n=i(4576),o=i(66552),a=i(25482),l=i(83047),d=i(67076),u=i(10107),p=(i(44208),i(53966),i(36005)),c=i(40608),h=i(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=y.jsonValues.slice();(0,n.Xy)(f,"orthometric");const m=(0,o.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=r=class extends a.oY{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return y.write(e,t,i)}readHeightModel(e,t,i){return y.read(e)||(i?.messages&&i.messages.push(function(e,t){return new d.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:i})),null)}readHeightUnit(e,t,i){return m.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readHeightUnitService(e,t,i){return(0,l.LA)(e)||m.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new r({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=(0,l.k1)(t);return new r({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new r;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new d.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal"}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,h.K)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,p.w)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.MZ)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:m.write}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,p.w)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,p.w)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=r=(0,s._)([(0,c.$)("esri.geometry.HeightModelInfo")],g);const w=g},13899:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Oe});var r=i(90237),s=i(52106),n=i(13874),o=(i(86162),i(94409),i(65345),i(42980),i(39290),i(92438),i(96576),i(93618),i(65494),i(15036)),a=i(69540),l=i(5503),d=i(49186),u=i(53966),p=i(92071),c=i(74887),h=i(36708),y=i(10107),f=(i(44208),i(87811),i(88620)),m=i(36005),g=i(40608),v=i(35666),w=i(1535),_=i(86738),I=i(4146),b=i(55726),F=i(52136),A=i(18768),S=i(69208),M=i(47685),L=i(16131),x=i(8303),T=i(25036),E=i(58947),O=i(82935),j=i(60945),Z=i(70668),P=i(25482),U=i(30524);function R({associatedLayer:e,serviceUpdateTimeStamp:t}){const i=e?.editingInfo?.lastEditDate,r=e?.serverGens,s=null!=i,n=null!=t,o=s&&n&&t.lastUpdate!==i.getTime();return s&&(o||!n&&r?.minServerGen!==r?.serverGen)}var $=i(96184);const D=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return(0,U.sv)(t,this.fieldsIndex),t}set timeInfo(e){(0,U.sv)(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:i,endTimeField:r}=t;if(null==i&&null==r)return;if(R({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let r=null;try{const i=await(this.fetchStatistics?.(t,e));r=i?.stats}catch{}if(null==r)return null;const{minTimeStr:s,min:n,maxTimeStr:o,max:a}=r,l=t===i?s??n:o??a;return null!=l?new Date(l):null},[n,o]=await Promise.all([s(i),s(r)]);if(null!=i&&null==n||null!=r&&null==o)return;const a=new j.A({start:n,end:o});this.setAtOrigin("timeInfo",new $.A({endField:r,startField:i,fullTimeExtent:a}),"service")}};return(0,r._)([(0,y.MZ)({type:$.A,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),(0,r._)([(0,y.MZ)({type:j.A,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),(0,r._)([(0,y.MZ)({type:Z.A,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),(0,r._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),(0,r._)([(0,y.MZ)({type:N,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=(0,r._)([(0,g.$)("esri.layers.mixins.TemporalSceneLayer")],t),t};let N=class extends P.oY{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};(0,r._)([(0,y.MZ)({type:String})],N.prototype,"endTimeField",void 0),(0,r._)([(0,y.MZ)({type:String})],N.prototype,"startTimeField",void 0),N=(0,r._)([(0,g.$)("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],N);var C=i(60694),k=i(92009),H=i(4071),q=i(10873),V=i(15426),G=i(40530),K=i(67202),Q=i(17036),W=i(95466),J=i(50805),B=i(20557),Y=i(81457),z=i(39383),X=i(37352),ee=i(4513);let te=class extends P.oY{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,r._)([(0,y.MZ)({type:String,json:{read:!0,write:!0}})],te.prototype,"name",void 0),(0,r._)([(0,y.MZ)({type:String,json:{read:!0,write:!0}})],te.prototype,"field",void 0),(0,r._)([(0,y.MZ)({type:[Number],json:{read:!0,write:!0}})],te.prototype,"currentRangeExtent",void 0),(0,r._)([(0,y.MZ)({type:[Number],json:{read:!0,write:!0}})],te.prototype,"fullRangeExtent",void 0),(0,r._)([(0,y.MZ)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],te.prototype,"type",void 0),te=(0,r._)([(0,g.$)("esri.layers.support.RangeInfo")],te);var ie,re=i(78888),se=i(4718),ne=i(87024),oe=i(67076),ae=i(39829),le=i(57251);let de=ie=class extends((0,P.Te)(l.A.ofType(ae.A))){constructor(e){super(e)}clone(){return new ie(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((i=>{if(!t.equals(i.spatialReference)){if(!(0,le.canProjectWithoutEngine)(i.spatialReference,t))return e?.messages&&e.messages.push(new oe.A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const r=new ae.A;(0,le.projectPolygon)(i,r,t),i=r}const r=i.toJSON(e);return delete r.spatialReference,r})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new oe.A("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const i=new ie;return e.forEach((e=>i.add(ae.A.fromJSON(e,t)))),i}};de=ie=(0,r._)([(0,g.$)("esri.layers.support.PolygonCollection")],de);const ue=de;var pe,ce=i(97159);let he=pe=class extends P.oY{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new ue,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.OH))}readGeometries(e,t,i){Array.isArray(e)?this.geometries=ue.fromJSON(e,i):this._geometriesSource={url:(0,ce.f)(e,i),context:i}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:i,context:r}=this._geometriesSource,s=await(0,re.A)(i,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map((e=>({...e,spatialReference:n})));this.geometries=ue.fromJSON(o,r),this._geometriesSource=null}clone(){const e=new pe({geometries:(0,se.o8)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,r._)([(0,y.MZ)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],he.prototype,"spatialRelationship",void 0),(0,r._)([(0,y.MZ)({type:ue,nonNullable:!0,json:{write:!0}}),(0,ne.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],he.prototype,"geometries",void 0),(0,r._)([(0,m.w)(["web-scene","portal-item"],"geometries")],he.prototype,"readGeometries",null),he=pe=(0,r._)([(0,g.$)("esri.layers.support.SceneFilter")],he);const ye=he;var fe=i(84952),me=i(8947),ge=i(61956),ve=i(24212),we=i(57465),_e=i(30291);async function Ie(e){const t=[];for(const i of e)i.name.toLowerCase().endsWith(".zip")?t.push(be(i)):t.push(Promise.resolve(i));return(await Promise.all(t)).flat()}async function be(e){const{BlobReader:t,ZipReader:r,BlobWriter:s}=await Promise.all([i.e(8392),i.e(9588)]).then(i.bind(i,9588)),n=[],o=new r(new t(e));return(await o.getEntries()).forEach((e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new s,i=e.getData?.(t).then((t=>new File([t],e.filename)));i&&n.push(i)})),Promise.all(n)}var Fe=i(28030),Ae=i(45671),Se=i(78553);const Me=new Set(["3DObject","Point"]),Le=(0,Q.p)();let xe=class extends(D((0,M.w6)((0,E.w6)((0,A.b)((0,L.q)((0,x.A)((0,T.j)((0,p.P)((0,S.d)((0,F.p)((0,a.O)(I.A)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new l.A,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const i=this.getFeatureType(t?.feature)?.domains?.[e];return i&&"inherited"!==i.type?i:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new W.A(this.fields)}readNodePages(e,t,i){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:J.W4.fromJSON(e,i)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,V.C$)(this.associatedLayer)}get geometryType(){return Ee[this.profile]||"mesh"}set renderer(e){(0,U.yp)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:H.P;const{query:t,queryRelated:i,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:p},operations:{supportsEditing:c,supportsAdd:h,supportsUpdate:y,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,_=!!this.associatedLayer?.infoFor3D&&(0,we.Vo)();return{query:t,queryRelated:i,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:_&&o,supportsUploadWithItemId:n},data:{supportsAttachment:p,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:c&&w,supportsAdd:_&&h&&w,supportsDelete:_&&f&&w,supportsUpdate:y&&w,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const i=t.store.profile;return null!=i&&Te[i]?Te[i]:(u.A.getLogger(this).error("Unknown or missing profile",{profile:i,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(c.QP),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await(0,me.L)(this,{origin:"service"},t),(0,U.yp)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){u.A.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ge.A;return"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const i=(0,U.hL)(this.fieldsIndex,await(0,Ae.TO)(this,(0,Ae.D8)(this)));return(0,Fe.s1)(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,i,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const i=await this.queryCachedAttributes(e,[t]);if(!i||0===i.length)throw new d.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const r=new s.A;return r.attributes=i[0],r.layer=this,r.sourceLayer=this,r}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((i=>i.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(u.A.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,_e.tn)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d.A("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(E.Xh.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(E.Xh.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await i.e(6247).then(i.bind(i,78628));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new d.A(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new d.A(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,C.Wo)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,V.GA)(n,e.deleteFeatures,o)}),r(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const i=e=>{throw u.A.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||i(new d.A("invalid:layer","SceneLayer has no capability for mesh conversion"));const r=await this.extractAndFilterFiles(e),s=r.reduce(((e,t)=>(0,B.oF)(this.infoFor3D,t)?e+1:e),0);0===s&&i(new b.VP),s>1&&i(new b.XQ);const n=this.spatialReference,o=t?.location??new _.A({x:0,y:0,z:0,spatialReference:n}),a=o.spatialReference.isGeographic?"local":"georeferenced",l=w.A.createWithExternalSource(o,r,{vertexSpace:a}),[p]=await this.uploadAssets([l],t);return p}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await Ie(e)).filter((e=>(0,B.fu)(t,e))):e}validateLayer(e){if(e.layerType&&!Me.has(e.layerType))throw new d.A("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d.A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let i=!1,r=!1;if(null==e)i=!0,r=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":i=!0,r=s;break;case"vertex-reference-frame":i=!0,r=!s;break;default:i=!1}}if(!i)throw new d.A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!r)throw new d.A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new d.A("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some((t=>t.name===e.name)),i=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||i,supportsLayerQuery:i};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const i=this.getField(t.name);i?(!i.domain&&t.domain&&(i.domain=t.domain.clone()),i.editable=t.editable,i.nullable=t.nullable,i.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,f.oY)(this);for(let i=0;i<e.length;i++){const r=e[i],s=this.originIdOf(r),n=this.associatedLayer.originIdOf(r);s<n&&(n===v.Gr.SERVICE||n===v.Gr.PORTAL_ITEM)&&t.setAtOrigin(r,this.associatedLayer[r],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");(0,we.Vo)()&&null!=this.associatedLayer?.infoFor3D&&e&&(0,C.Wo)(this.associatedLayer?.url)&&R(this)&&(0,f.oY)(this).setAtOrigin("fullExtent",e.clone(),v.Gr.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:i,portalItem:r}=await(0,k.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ee.S.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:i,portalItem:r}),await this.associatedLayer.load()}catch(e){(0,c.zf)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.C_)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?u.A.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):u.A.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,ve.XF)(u.A.getLogger(this),(0,ve.$7)("Mesh scene layers","relative-to-scene",e)),(0,ve.XF)(u.A.getLogger(this),(0,ve.tW)("Scene layers",e))}async fetchStatistics(e,t){return await async function({fieldName:e,statisticsInfo:t,errorContext:i,fieldsIndex:r,path:s,customParameters:n,apiKey:o,signal:a}){if(null==t)throw new d.A(`${i}:no-cached-statistics`,"Cached statistics are not available for this layer");const l=r.get(e);if(null==l)throw new d.A(`${i}:field-unexisting`,`Field '${e}' does not exist on the layer`);const u=t.find((e=>e.name===l.name));if(null==u)throw new d.A(`${i}:no-cached-statistics`,"Cached statistics for this attribute are not available");const p=(0,fe.fj)(s,u.href),{data:c}=await(0,re.A)(p,{query:{f:"json",...n,token:o},responseType:"json",signal:a});return c}({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};(0,r._)([(0,y.MZ)({types:{key:"type",base:G.c,typeMap:{selection:K.A}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],xe.prototype,"featureReduction",void 0),(0,r._)([(0,y.MZ)({type:[te],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],xe.prototype,"rangeInfos",void 0),(0,r._)([(0,y.MZ)({json:{read:!1}})],xe.prototype,"associatedLayer",void 0),(0,r._)([(0,y.MZ)({type:["show","hide"]})],xe.prototype,"listMode",void 0),(0,r._)([(0,y.MZ)({type:["ArcGISSceneServiceLayer"]})],xe.prototype,"operationalLayerType",void 0),(0,r._)([(0,y.MZ)({json:{read:!1},readOnly:!0})],xe.prototype,"type",void 0),(0,r._)([(0,y.MZ)({...Le.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"fields",void 0),(0,r._)([(0,y.MZ)()],xe.prototype,"types",null),(0,r._)([(0,y.MZ)()],xe.prototype,"typeIdField",null),(0,r._)([(0,y.MZ)()],xe.prototype,"templates",null),(0,r._)([(0,y.MZ)()],xe.prototype,"formTemplate",null),(0,r._)([(0,y.MZ)({readOnly:!0,clonable:!1})],xe.prototype,"fieldsIndex",null),(0,r._)([(0,y.MZ)({type:X.A,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],xe.prototype,"floorInfo",void 0),(0,r._)([(0,y.MZ)(Le.outFields)],xe.prototype,"outFields",void 0),(0,r._)([(0,y.MZ)({type:J.W4,readOnly:!0,json:{read:!1}})],xe.prototype,"nodePages",void 0),(0,r._)([(0,m.w)("service","nodePages",["nodePages","pointNodePages"])],xe.prototype,"readNodePages",null),(0,r._)([(0,y.MZ)({type:[J.uV],readOnly:!0})],xe.prototype,"materialDefinitions",void 0),(0,r._)([(0,y.MZ)({type:[J.Ot],readOnly:!0})],xe.prototype,"textureSetDefinitions",void 0),(0,r._)([(0,y.MZ)({type:[J.L0],readOnly:!0})],xe.prototype,"geometryDefinitions",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"serviceUpdateTimeStamp",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"attributeStorageInfo",void 0),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"statisticsInfo",void 0),(0,r._)([(0,y.MZ)({type:l.A.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],xe.prototype,"excludeObjectIds",void 0),(0,r._)([(0,y.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],xe.prototype,"definitionExpression",void 0),(0,r._)([(0,y.MZ)({type:ye,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],xe.prototype,"filter",void 0),(0,r._)([(0,y.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],xe.prototype,"path",void 0),(0,r._)([(0,y.MZ)(q.Yj)],xe.prototype,"elevationInfo",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"effectiveCapabilities",null),(0,r._)([(0,y.MZ)({readOnly:!0})],xe.prototype,"effectiveEditingEnabled",null),(0,r._)([(0,y.MZ)({type:String})],xe.prototype,"geometryType",null),(0,r._)([(0,y.MZ)(q.kF)],xe.prototype,"labelsVisible",void 0),(0,r._)([(0,y.MZ)({type:[Y.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:z.w},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:z.w},write:!0}})],xe.prototype,"labelingInfo",void 0),(0,r._)([(0,y.MZ)(q.fV)],xe.prototype,"legendEnabled",void 0),(0,r._)([(0,y.MZ)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const i=t.layerDefinition?.drawingInfo?.transparency;return void 0!==i?(0,Se.D)(i):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],xe.prototype,"opacity",void 0),(0,r._)([(0,y.MZ)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"priority",void 0),(0,r._)([(0,y.MZ)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"semantic",void 0),(0,r._)([(0,y.MZ)({types:o.X,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],xe.prototype,"renderer",null),(0,r._)([(0,y.MZ)({json:{read:!1}})],xe.prototype,"cachedDrawingInfo",void 0),(0,r._)([(0,m.w)("service","cachedDrawingInfo")],xe.prototype,"readCachedDrawingInfo",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"capabilities",null),(0,r._)([(0,y.MZ)({type:Boolean,json:{read:!1}})],xe.prototype,"editingEnabled",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{write:!1,read:!1}})],xe.prototype,"infoFor3D",null),(0,r._)([(0,y.MZ)({readOnly:!0,json:{write:!1,read:!1}})],xe.prototype,"relationships",null),(0,r._)([(0,y.MZ)(q.M6)],xe.prototype,"popupEnabled",void 0),(0,r._)([(0,y.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],xe.prototype,"popupTemplate",void 0),(0,r._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"defaultPopupTemplate",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"objectIdField",void 0),(0,r._)([(0,m.w)("service","objectIdField",["objectIdField","fields"])],xe.prototype,"readObjectIdField",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"globalIdField",void 0),(0,r._)([(0,m.w)("service","globalIdField",["globalIdField","fields"])],xe.prototype,"readGlobalIdField",null),(0,r._)([(0,y.MZ)({readOnly:!0,type:String,json:{read:!1}})],xe.prototype,"displayField",null),(0,r._)([(0,y.MZ)({type:String,json:{read:!1}})],xe.prototype,"profile",void 0),(0,r._)([(0,m.w)("service","profile",["store.profile"])],xe.prototype,"readProfile",null),(0,r._)([(0,y.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],xe.prototype,"normalReferenceFrame",void 0),(0,r._)([(0,y.MZ)(q.PY)],xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r._)([(0,y.MZ)({json:{read:!1,origins:{service:{read:!0}}}})],xe.prototype,"serviceItemId",void 0),(0,r._)([(0,y.MZ)(O.B)],xe.prototype,"useViewTime",null),xe=(0,r._)([(0,g.$)("esri.layers.SceneLayer")],xe);const Te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Ee={"mesh-pyramids":"mesh",points:"point"},Oe=xe},55726:(e,t,i)=>{i.d(t,{$1:()=>d,H2:()=>h,MT:()=>y,VP:()=>f,WF:()=>u,Wt:()=>o,XQ:()=>m,hK:()=>c,nS:()=>p,uh:()=>a,xY:()=>l});var r=i(49186);const s="upload-assets",n=()=>new Error;class o extends r.A{constructor(){super(`${s}:unsupported`,"Layer does not support asset uploads.",n())}}class a extends r.A{constructor(){super(`${s}:no-glb-support`,"Layer does not support glb.",n())}}class l extends r.A{constructor(){super(`${s}:no-supported-source`,"No supported external source found",n())}}class d extends r.A{constructor(){super(`${s}:not-base-64`,"Expected gltf data in base64 format after conversion.",n())}}class u extends r.A{constructor(){super(`${s}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",n())}}class p extends r.A{constructor(e,t){super(`${s}:bad-response`,`Bad response. Uploaded ${e} items and received ${t} results.`,n())}}class c extends r.A{constructor(e,t){super(`${s}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${t?.code??"-1"}. Error message: ${t?.messages??"unknown"}`,n())}}class h extends r.A{constructor(e){super(`${s}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,n())}}class y extends r.A{constructor(){super(`${s}:convert3D-failed`,"convert3D failed.")}}class f extends r.A{constructor(){super("invalid-input:no-model","No supported model found")}}class m extends r.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},52136:(e,t,i)=>{i.d(t,{p:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=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,s.MZ)({type:String})],t.prototype,"apiKey",null),t=(0,r._)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],t),t}},18768:(e,t,i)=>{i.d(t,{b:()=>l});var r=i(90237),s=i(53966),n=i(10107),o=(i(44208),i(87811),i(40608)),a=i(60694);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,a.qg)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,s.A.getLogger(this)))}};return(0,r._)([(0,n.MZ)()],t.prototype,"title",null),(0,r._)([(0,n.MZ)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.$)("esri.layers.mixins.ArcGISService")],t),t}},69208:(e,t,i)=>{i.d(t,{d:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,r._)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,r._)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},47685:(e,t,i)=>{i.d(t,{Mk:()=>h,Zk:()=>p,w6:()=>m});var r=i(90237),s=i(65529),n=i(4718),o=i(74887),a=i(10107),l=(i(44208),i(53966),i(40608)),d=i(20816);const u=new s.A.EventEmitter;function p(e,t,i=null,r=!1){const s=(0,o.Tw)();return r=null==t||r,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:i,mayReceiveServiceEdits:r,result:s.promise}),s}const c=Symbol();function h(e){return null!=e&&"object"==typeof e&&c in e}function y(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,i){const r=new URL(e).host,s=d.Z3.get(r),n=e=>!e||e===s;return n(t)&&n(i)||t===i}const m=e=>{var t;let i=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:i,gdbVersion:r,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,l=null!=i&&null!=this.layerId&&i===this.layerId,d=y(this),u=y(this)&&f(t,r,this.gdbVersion);if(!a||d&&!u||!l&&!s)return;const p=o.then((e=>{if(this.lastEditsEventDate=new Date,l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.o8)(e)),e;const i=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(i){const{adds:t,updates:r,deletes:s}=i.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:r?r.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return this.emit("edits",o),o}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,s.historicMoment)&&this.emit("edits",s),s})).then((e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,e.historicMoment)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:i,moment:r}=e,s=t===this.url,n=y(this),o=y(this)&&f(t,i,this.gdbVersion),a=y(this)&&!f(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==r&&(this.historicMoment=r)},this.when().then((()=>{this.addHandles(function(e){return u.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return u.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(e,t,i){return"historicMoment"in this&&this.historicMoment!==i&&(0,d.w5)(e,t)}};return t=c,(0,r._)([(0,a.MZ)()],i.prototype,"lastEditsEventDate",void 0),i=(0,r._)([(0,l.$)("esri.layers.mixins.EditBusLayer")],i),i}},8303:(e,t,i)=>{i.d(t,{A:()=>b});var r=i(90237),s=i(92602),n=i(70333),o=i(78888),a=i(60999),l=i(49186),d=i(53966),u=i(97768),p=i(74887),c=i(84952),h=i(10107),y=(i(44208),i(87811),i(36005)),f=i(40608),m=i(43937),g=i(83531),v=i(20655),w=i(80812),_=i(41318),I=i(10407);const b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new w.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await Promise.all([i.e(5356),i.e(1204)]).then(i.bind(i,41204));return(0,p.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.QP)(e),!0))))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:r},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===i.id;if(r&&i.portal.user)return(0,I.It)(i);let s,o;if(r)s=i.portal.url;else try{s=await(0,g.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!s||!(0,c.b8)(s,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,l=!1,d=!1;if(!o)return{features:{edit:a,fullEdit:l},content:{updateItem:d}};try{if(r?await i.reload():(i=new w.default({id:e,portal:{url:s}}),await i.load(t)),i.portal.user)return(0,I.It)(i)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:l},content:{updateItem:d}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const i=F.credential===t?F.user:await this._fetchEditingUser(e);return F.credential=t,F.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=n.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(r))return s.user;const l=`${r}/community/self`,d=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?_.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return i&&r&&!(0,c.ut)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,h.MZ)({type:w.default})],t.prototype,"portalItem",null),(0,r._)([(0,y.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,h.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},F={credential:null,user:null}},25036:(e,t,i)=>{i.d(t,{j:()=>o});var r=i(90237),s=i(10107),n=(i(44208),i(53966),i(87811),i(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const i=this._get("effectiveScaleRange");return i&&i.minScale===e.minScale&&i.maxScale===e.maxScale?i:e}};return(0,r._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,r._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,r._)([(0,s.MZ)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,r._)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],t),t}},82935:(e,t,i)=>{i.d(t,{B:()=>h,e:()=>y});var r=i(90237),s=i(60945),n=i(70668),o=i(10107),a=(i(44208),i(53966),i(87811),i(36005)),l=i(40608),d=i(89317),u=i(30524),p=i(96184),c=i(73133);const h={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d.K}}},y=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const i=t.timeInfo.exportOptions;if(!i)return null;const r=i.timeOffset,s=c.j.fromJSON(i.timeOffsetUnits);return r&&s?new n.A({value:r,unit:s}):null}set timeInfo(e){(0,u.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,r._)([(0,o.MZ)({type:s.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,r._)([(0,o.MZ)({type:n.A})],t.prototype,"timeOffset",void 0),(0,r._)([(0,a.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,r._)([(0,o.MZ)({value:null,type:p.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,r._)([(0,o.MZ)(h)],t.prototype,"useViewTime",void 0),t=(0,r._)([(0,l.$)("esri.layers.mixins.TemporalLayer")],t),t}},40530:(e,t,i)=>{i.d(t,{c:()=>a});var r=i(90237),s=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608));let a=class extends s.oY{constructor(){super(...arguments),this.type=null}};(0,r._)([(0,n.MZ)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,r._)([(0,o.$)("esri.layers.support.FeatureReduction")],a)},67202:(e,t,i)=>{i.d(t,{A:()=>d});var r,s=i(90237),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),a=i(40530);let l=r=class extends a.c{constructor(e){super(e),this.type="selection"}clone(){return new r}};(0,s._)([(0,n.MZ)({type:["selection"]})],l.prototype,"type",void 0),l=r=(0,s._)([(0,o.$)("esri.layers.support.FeatureReductionSelection")],l);const d=l},37352:(e,t,i)=>{i.d(t,{A:()=>u});var r,s=i(90237),n=i(5503),o=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(40608));let d=r=class extends o.oY{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"floorField",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllMode",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllLevelIds",void 0),d=r=(0,s._)([(0,l.$)("esri.layers.support.LayerFloorInfo")],d);const u=d},96184:(e,t,i)=>{i.d(t,{A:()=>f});var r=i(90237),s=i(60945),n=i(70668),o=i(69540),a=i(25482),l=i(10107),d=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),p=i(43937),c=i(56400);function h(e,t){return n.A.fromJSON({value:e,unit:t})}let y=class extends((0,o.O)(a.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?s.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?h(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?h(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,r._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],y.prototype,"cumulative",void 0),(0,r._)([(0,l.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"endField",void 0),(0,r._)([(0,l.MZ)({type:s.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"fullTimeExtent",void 0),(0,r._)([(0,d.w)("fullTimeExtent",["timeExtent"])],y.prototype,"readFullTimeExtent",null),(0,r._)([(0,p.K)("fullTimeExtent")],y.prototype,"writeFullTimeExtent",null),(0,r._)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"hasLiveData",void 0),(0,r._)([(0,l.MZ)({type:n.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"interval",void 0),(0,r._)([(0,d.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],y.prototype,"readInterval",null),(0,r._)([(0,p.K)("interval")],y.prototype,"writeInterval",null),(0,r._)([(0,l.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"startField",void 0),(0,r._)([(0,l.MZ)((0,c.P6)("timeReference",!0))],y.prototype,"timeZone",void 0),(0,r._)([(0,l.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"trackIdField",void 0),(0,r._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],y.prototype,"useTime",void 0),(0,r._)([(0,l.MZ)({type:[Date],json:{read:!1}})],y.prototype,"stops",void 0),y=(0,r._)([(0,u.$)("esri.layers.support.TimeInfo")],y);const f=y},17036:(e,t,i)=>{i.d(t,{p:()=>l});var r=i(44208),s=i(53966),n=i(20437),o=i(95466),a=i(30524);function l(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,r.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const i=this.fieldsIndex?.has(t);i||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},20557:(e,t,i)=>{i.d(t,{E1:()=>a,Fm:()=>l,JZ:()=>y,R_:()=>o,fu:()=>s,oF:()=>n,rq:()=>d});const r=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=p(t.name,e?.supportedFormats??[])}function n(e,t){if(!e)return!1;const i=d(t,e.supportedFormats??[]);return null!=i&&e.editFormats.includes(i)}function o(e,t){return c(function(e,t){const i=e.toLowerCase();return u(t).find((e=>h(e)===i))}(e,t))}function a(e,t){return c(p(e,t))}function l(e,t){return h(function(e,t){return u(t).find((t=>c(t)===e))}(e,t))}function d(e,t){return a(e.name,t)??o(e.type,t)}function u(e){return[...r,...e]}function p(e,t){const i=e.toLowerCase();return u(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>i.endsWith(e)))))}function c(e){return e?.[0]}function h(e){return e?.[1].toLowerCase()}function y(e){return e.tables?.find((e=>"assetMaps"===e.role))}},73133:(e,t,i)=>{i.d(t,{j:()=>r});const r=(0,i(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},8947:(e,t,i)=>{i.d(t,{L:()=>o});var r=i(60999),s=i(74887),n=i(67076);async function o(e,t,i){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,r.Ke)(o.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new n.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},20816:(e,t,i)=>{i.d(t,{TA:()=>s,We:()=>a,Z3:()=>n,ZJ:()=>l,w5:()=>d});var r=i(78888);const s=(0,i(13069).vD)(),n=new Map,o=new Map;async function a(e,t,i){if(!e||!i)return!1;if(!t)return!0;const s=new URL(e).host;let o=n.get(s);if(!o){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");o=(await(0,r.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return o===t}async function l(e,t,r=!1){if(!e||!t)return!0;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=o.get(n)?.entries();if(a)for(const[e,o]of a)if(o.name===t){const t=!o.stack?.hasForwardEdits();if(!t&&r){const[{deleteForwardEdits:t},{default:r}]=await Promise.all([i.e(2186).then(i.bind(i,32186)),i.e(2558).then(i.bind(i,32558))]),a=await t(n,e,new r({sessionId:s,moment:o.moment}));return a.success&&o.stack?.clearForwardEdits(),a.success}return t}return!0}function d(e,t){if(!e)return!1;const i=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=o.get(i)?.entries();if(r)for(const[e,i]of r)if(i.name===t)return"edit"===i.lockType;return!1}new Map}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5613],{22429:(e,a,t)=>{t.d(a,{v:()=>n});var r=t(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:t}=this;if(t.has(a))return t.get(a);const r=await e.fetchData();return t.set(a,r),r}async fetchCustomParameters(e,a){const t=await this.fetchItemData(e);return t&&"object"==typeof t&&(a?a(t):t.customParameters)||null}}},92009:(e,a,t)=>{t.d(a,{L:()=>o});var r=t(70333),n=t(78888),s=t(49186),i=t(74887),l=t(60694),c=t(20655),u=t(80812);async function o(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new u.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.QP)(e)}return null}(e);null!=s&&(t.portal=new c.A({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.QP)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new u.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.QP)(e),null}}(o);if(!f?.url)throw new s.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=f;const m=await d(f.url,o);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),u=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(u?.layers?.[0]||u?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(r,t)},f=d("anonymous").catch((()=>d("no-prompt"))),[m,w]=await Promise.all([f,c]),h=w?.layers,p=m.data&&m.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(h)){for(let e=0;e<Math.min(h.length,p.length);e++)if(h[e].id===i)return{serverUrl:r,layerId:p[e].id}}else if(null!=i&&i<p.length)return{serverUrl:r,layerId:p[i].id};throw new Error("could not find matching associated sublayer")}},23154:(e,a,t)=>{t.d(a,{K:()=>d,Q:()=>s});var r=t(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,a){const{loadContext:t,...n}=a||{},s=t?await t.fetchServiceMetadata(e,n):await(0,r.V)(e,n);y(s),c(s);const i={serviceJSON:s};if((s.currentVersion??0)<10.5)return i;const l=`${e}/layers`,u=t?await t.fetchServiceMetadata(l,n):await(0,r.V)(l,n);return y(u),c(u),i.layersJSON={layers:u.layers,tables:u.tables},i}function i(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(i),e.tables=e.tables?.filter(l)}function u(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function y(e){e.layers?.forEach(u),e.tables?.forEach(o)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},4513:(e,a,t)=>{t.d(a,{S:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(3161),t.e(9257)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(2944),t.e(8947),t.e(4850),t.e(7110),t.e(2931)]).then(t.bind(t,88303))).default,CSVLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(4174)]).then(t.bind(t,72256))).default,CatalogLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(620),t.e(893),t.e(3622),t.e(2593),t.e(6107)]).then(t.bind(t,79003))).default,DimensionLayer:async()=>(await t.e(1493).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(9186),t.e(5204)]).then(t.bind(t,5111))).default,FeatureLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(9377)]).then(t.bind(t,13600))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(3839)]).then(t.bind(t,17625))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(3161),t.e(1147),t.e(1874),t.e(6184)]).then(t.bind(t,63201))).default,GroupLayer:async()=>(await Promise.all([t.e(3161),t.e(7481)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(893),t.e(2876),t.e(8742),t.e(4135)]).then(t.bind(t,5159))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(2876),t.e(8488),t.e(8742),t.e(9082)]).then(t.bind(t,97327))).default,IntegratedMesh3DTilesLayer:async()=>(await t.e(1528).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(8947),t.e(964),t.e(8003)]).then(t.bind(t,84453))).default,KMLLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(5494),t.e(2469)]).then(t.bind(t,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(835),t.e(3097),t.e(1932),t.e(6289),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(964),t.e(7272)]).then(t.bind(t,42452))).default,LinkChartLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(835),t.e(3097),t.e(1932),t.e(6289),t.e(9519)]).then(t.bind(t,49519))).default,MapImageLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(893),t.e(3622),t.e(591),t.e(7656)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(8739)]).then(t.bind(t,35079))).default,MediaLayer:async()=>(await Promise.all([t.e(3161),t.e(7899)]).then(t.bind(t,87899))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(3089),t.e(4591)]).then(t.bind(t,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(3161),t.e(7430),t.e(349)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(3740)]).then(t.bind(t,16230))).default,PointCloudLayer:async()=>(await Promise.all([t.e(2829),t.e(8947),t.e(171)]).then(t.bind(t,76742))).default,RouteLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(5494),t.e(3920)]).then(t.bind(t,97550))).default,SceneLayer:async()=>(await Promise.all([t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(3030),t.e(2944),t.e(8947),t.e(964),t.e(4850),t.e(1535),t.e(7110),t.e(1737)]).then(t.bind(t,13899))).default,StreamLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(4761)]).then(t.bind(t,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(620),t.e(7e3)]).then(t.bind(t,70048))).default,TileLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(893),t.e(3622),t.e(9186),t.e(591),t.e(1756)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(3161),t.e(9186),t.e(9976),t.e(8705),t.e(9885)]).then(t.bind(t,64152))).default,VideoLayer:async()=>(await Promise.all([t.e(3161),t.e(6875)]).then(t.bind(t,86875))).default,VoxelLayer:async()=>(await Promise.all([t.e(2829),t.e(8947),t.e(964),t.e(1389)]).then(t.bind(t,16183))).default,WFSLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(4322),t.e(9511)]).then(t.bind(t,16350))).default,WMSLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(5181)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(3161),t.e(7430),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(3161),t.e(7430)]).then(t.bind(t,47314))).default}},66964:(e,a,t)=>{t.d(a,{Ju:()=>u,K8:()=>d,XH:()=>o,_r:()=>s,bO:()=>i,iK:()=>y,nu:()=>f,pJ:()=>l,rc:()=>c});var r=t(92009),n=t(23154);function s(e){const a={id:e.id,name:e.name},t=(0,n.K)(e.type);return"FeatureLayer"!==t&&(a.layerType=t),a}async function i(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(s),e.tables=e.tables||r?.tables?.map(s)}return e}function l(e){if(!e)return null;const{layers:a,tables:t}=e;return a?.length?a[0]:t?.length?t[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function u(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>"FeatureLayer"===a?!e:e===a))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"FeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function d(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function f(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(s)}const{serverUrl:n,portalItem:i}=await(0,r.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(s);else{const r=await t.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters});a.tables=r?.tables?.map(s)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},45613:(e,a,t)=>{t.d(a,{fromItem:()=>d,n:()=>f});var r=t(49186),n=t(92009),s=t(23154),i=t(22429),l=t(83531),c=t(4513),u=t(80812),o=t(66964),y=t(10407);async function d(e){let{portalItem:a}=e;!a||a instanceof u.default||(a=new u.default(a));const t=await async function(e){await e.load();const a=new i.v;return async function(e){const a=e.className,t=c.S[a];return{constructor:await t(),properties:e.properties}}(await f(e,a))}(a);return new(0,t.constructor)({portalItem:a,...t.properties})}async function f(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,y.Y)(e,"Map Notes"),t=(0,y.Y)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,y.Y)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.XH)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const t=await m(e,a);if("object"==typeof t){const{sourceJSON:e,className:a}=t,r={sourceJSON:e};return null!=t.id&&(r.layerId=t.id),{className:a||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await a.fetchItemData(e),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:t}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return t}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const t=await m(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.L)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const s=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new r.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function m(e,a,t){const{url:r,type:n}=e,i="Feature Service"===n;if(!r)return{};if(/\/\d+$/.test(r)){if(i){const t=await a.fetchServiceMetadata(r,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:t.id,className:(0,s.K)(t.type),sourceJSON:t}}return{}}await e.load();let l=await a.fetchItemData(e);if(i){const e=await(0,o.bO)(l,r,a),t=w(e);if("object"==typeof t){const a=(0,o.rc)(e,t.id);t.className=(0,o.K8)(a?.layerType)}return t}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return w(l);const c=await a.fetchServiceMetadata(r);return t&&(c.tables=await t()),w(c)}function w(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},24183:(e,a,t)=>{t.d(a,{V:()=>n});var r=t(78888);async function n(e,a){const{data:t}=await(0,r.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5613],{22429:(e,a,t)=>{t.d(a,{v:()=>n});var r=t(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:t}=this;if(t.has(a))return t.get(a);const r=await e.fetchData();return t.set(a,r),r}async fetchCustomParameters(e,a){const t=await this.fetchItemData(e);return t&&"object"==typeof t&&(a?a(t):t.customParameters)||null}}},92009:(e,a,t)=>{t.d(a,{L:()=>o});var r=t(70333),n=t(78888),s=t(49186),i=t(74887),l=t(60694),c=t(20655),u=t(80812);async function o(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new u.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.QP)(e)}return null}(e);null!=s&&(t.portal=new c.A({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.QP)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new u.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.QP)(e),null}}(o);if(!f?.url)throw new s.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=f;const m=await d(f.url,o);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),u=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(u?.layers?.[0]||u?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(r,t)},f=d("anonymous").catch((()=>d("no-prompt"))),[m,w]=await Promise.all([f,c]),h=w?.layers,p=m.data&&m.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(h)){for(let e=0;e<Math.min(h.length,p.length);e++)if(h[e].id===i)return{serverUrl:r,layerId:p[e].id}}else if(null!=i&&i<p.length)return{serverUrl:r,layerId:p[i].id};throw new Error("could not find matching associated sublayer")}},23154:(e,a,t)=>{t.d(a,{K:()=>d,Q:()=>s});var r=t(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,a){const{loadContext:t,...n}=a||{},s=t?await t.fetchServiceMetadata(e,n):await(0,r.V)(e,n);y(s),c(s);const i={serviceJSON:s};if((s.currentVersion??0)<10.5)return i;const l=`${e}/layers`,u=t?await t.fetchServiceMetadata(l,n):await(0,r.V)(l,n);return y(u),c(u),i.layersJSON={layers:u.layers,tables:u.tables},i}function i(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(i),e.tables=e.tables?.filter(l)}function u(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function y(e){e.layers?.forEach(u),e.tables?.forEach(o)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},4513:(e,a,t)=>{t.d(a,{S:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(3161),t.e(9257)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(2944),t.e(8947),t.e(4850),t.e(7110),t.e(2931)]).then(t.bind(t,88303))).default,CSVLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(4174)]).then(t.bind(t,72256))).default,CatalogLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(620),t.e(893),t.e(3622),t.e(2593),t.e(6107)]).then(t.bind(t,79003))).default,DimensionLayer:async()=>(await t.e(1493).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(9186),t.e(5204)]).then(t.bind(t,5111))).default,FeatureLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(9377)]).then(t.bind(t,13600))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(3839)]).then(t.bind(t,17625))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(3161),t.e(1147),t.e(1874),t.e(6184)]).then(t.bind(t,63201))).default,GroupLayer:async()=>(await Promise.all([t.e(3161),t.e(7481)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(893),t.e(2876),t.e(8742),t.e(4135)]).then(t.bind(t,5159))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(2876),t.e(8488),t.e(8742),t.e(9082)]).then(t.bind(t,97327))).default,IntegratedMesh3DTilesLayer:async()=>(await t.e(1528).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(8947),t.e(964),t.e(8003)]).then(t.bind(t,84453))).default,KMLLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(5494),t.e(2469)]).then(t.bind(t,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(835),t.e(3097),t.e(1932),t.e(6289),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(964),t.e(7272)]).then(t.bind(t,42452))).default,LinkChartLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(835),t.e(3097),t.e(1932),t.e(6289),t.e(9519)]).then(t.bind(t,49519))).default,MapImageLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(893),t.e(3622),t.e(591),t.e(7656)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(8739)]).then(t.bind(t,35079))).default,MediaLayer:async()=>(await Promise.all([t.e(3161),t.e(7899)]).then(t.bind(t,87899))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(3089),t.e(4591)]).then(t.bind(t,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(3161),t.e(7430),t.e(349)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(9558),t.e(620),t.e(3600),t.e(3740)]).then(t.bind(t,16230))).default,PointCloudLayer:async()=>(await Promise.all([t.e(2829),t.e(8947),t.e(171)]).then(t.bind(t,76742))).default,RouteLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(5494),t.e(3920)]).then(t.bind(t,97550))).default,SceneLayer:async()=>(await Promise.all([t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(3030),t.e(2944),t.e(8947),t.e(964),t.e(4850),t.e(1535),t.e(7110),t.e(1737)]).then(t.bind(t,13899))).default,StreamLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(4761)]).then(t.bind(t,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(620),t.e(7e3)]).then(t.bind(t,70048))).default,TileLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(9558),t.e(893),t.e(3622),t.e(9186),t.e(591),t.e(1756)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(3161),t.e(9186),t.e(9976),t.e(8705),t.e(9885)]).then(t.bind(t,64152))).default,VideoLayer:async()=>(await Promise.all([t.e(3161),t.e(6875)]).then(t.bind(t,86875))).default,VoxelLayer:async()=>(await Promise.all([t.e(2829),t.e(8947),t.e(964),t.e(1389)]).then(t.bind(t,16183))).default,WFSLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(1132),t.e(9566),t.e(1956),t.e(5494),t.e(4796),t.e(5894),t.e(4322),t.e(9511)]).then(t.bind(t,16350))).default,WMSLayer:async()=>(await Promise.all([t.e(3161),t.e(2829),t.e(1147),t.e(1874),t.e(5181)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(3161),t.e(7430),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(3161),t.e(7430)]).then(t.bind(t,47314))).default}},66964:(e,a,t)=>{t.d(a,{Ju:()=>u,K8:()=>d,XH:()=>o,_r:()=>s,bO:()=>i,iK:()=>y,nu:()=>f,pJ:()=>l,rc:()=>c});var r=t(92009),n=t(23154);function s(e){const a={id:e.id,name:e.name},t=(0,n.K)(e.type);return"FeatureLayer"!==t&&(a.layerType=t),a}async function i(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(s),e.tables=e.tables||r?.tables?.map(s)}return e}function l(e){if(!e)return null;const{layers:a,tables:t}=e;return a?.length?a[0]:t?.length?t[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function u(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>e?e===a:"ArcGISFeatureLayer"===a))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function d(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function f(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(s)}const{serverUrl:n,portalItem:i}=await(0,r.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(s);else{const r=await t.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters});a.tables=r?.tables?.map(s)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},45613:(e,a,t)=>{t.d(a,{fromItem:()=>d,n:()=>f});var r=t(49186),n=t(92009),s=t(23154),i=t(22429),l=t(83531),c=t(4513),u=t(80812),o=t(66964),y=t(10407);async function d(e){let{portalItem:a}=e;!a||a instanceof u.default||(a=new u.default(a));const t=await async function(e){await e.load();const a=new i.v;return async function(e){const a=e.className,t=c.S[a];return{constructor:await t(),properties:e.properties}}(await f(e,a))}(a);return new(0,t.constructor)({portalItem:a,...t.properties})}async function f(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,y.Y)(e,"Map Notes"),t=(0,y.Y)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,y.Y)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.XH)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const t=await m(e,a);if("object"==typeof t){const{sourceJSON:e,className:a}=t,r={sourceJSON:e};return null!=t.id&&(r.layerId=t.id),{className:a||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await a.fetchItemData(e),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:t}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return t}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const t=await m(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.L)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const s=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new r.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function m(e,a,t){const{url:r,type:n}=e,i="Feature Service"===n;if(!r)return{};if(/\/\d+$/.test(r)){if(i){const t=await a.fetchServiceMetadata(r,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:t.id,className:(0,s.K)(t.type),sourceJSON:t}}return{}}await e.load();let l=await a.fetchItemData(e);if(i){const e=await(0,o.bO)(l,r,a),t=w(e);if("object"==typeof t){const a=(0,o.rc)(e,t.id);t.className=(0,o.K8)(a?.layerType)}return t}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return w(l);const c=await a.fetchServiceMetadata(r);return t&&(c.tables=await t()),w(c)}function w(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},24183:(e,a,t)=>{t.d(a,{V:()=>n});var r=t(78888);async function n(e,a){const{data:t}=await(0,r.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);