text: (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6028],{89645:(e,t,r)=>{"use strict";r.d(t,{Z:()=>y});var s=r(14983),i=r(35588),o=r(32744),n=r(67380),l=r(84066),a=(r(77645),r(38215),r(45851),r(74184)),d=r(35203);let p=class extends((0,o.p)(i.Z)){constructor(e){super(e),this.getCollections=null}initialize(){this.handles.add((0,d.EH)((()=>this.refresh())))}destroy(){this.getCollections=null}refresh(){const e=(0,n.pC)(this.getCollections)?this.getCollections():null;if((0,n.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,n.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,l.Cb)()],p.prototype,"getCollections",void 0),(0,s._)([(0,l.Cb)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,l.Cb)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,a.j)("esri.core.CollectionFlattener")],p);const y=p},32744:(e,t,r)=>{"use strict";r.d(t,{r:()=>p,p:()=>d});var s=r(14983),i=r(29438),o=r(83403),n=r(84066),l=r(74184),a=r(76770);const d=e=>{let t=class extends e{destroy(){this.destroyed||(this.handles.destroy(),this.updatingHandles.destroy())}get handles(){return this._get("handles")||new o.Z}get updatingHandles(){return this._get("updatingHandles")||new a.t}};return(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,s._)([(0,l.j)("esri.core.HandleOwner")],t),t};let p=class extends(d(i.Z)){};p=(0,s._)([(0,l.j)("esri.core.HandleOwner")],p)},19803:(e,t,r)=>{"use strict";r.d(t,{GZ:()=>l,wF:()=>a});var s=r(38986),i=r(35588),o=r(42790),n=r(67380);async function l(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],l=(...e)=>{for(const t of e)(0,n.Wi)(t)||(Array.isArray(t)?l(...t):i.Z.isCollection(t)?t.forEach((e=>l(e))):o.Z.isLoadable(t)&&r.push(t))};t(l);let a=null;if(await(0,s.UI)(r,(async e=>{!1!==(await(0,s.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load())).ok||a||(a=e)})),a)throw a.loadError;return e}},16028:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ze});var s=r(14983),i=r(35588),o=r(89645),n=r(8811),l=r(14483),a=r(19803),d=r(45851),p=r(67380),y=r(38010),u=r(8764),c=r(99204),h=r(84066),b=r(38215),g=(r(77645),r(79159)),f=r(74184),v=r(61948),m=r(13878),_=r(78351),C=(r(72458),r(56043),r(51186),r(47500),r(93941),r(25330),r(41378),r(88696),r(39232)),w=r(93100),S=r(30223),O=r(42790),j=r(16353),I=r(68720),F=r(56368),x=r(14823),L=r(45610),T=r(75565);let Z=class extends((0,L.I)(y.w)){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.visible=!0,this.opacity=1}readTitle(e,t){return"string"==typeof t.alias?t.alias:"string"==typeof t.name?t.name:""}readIdOnlyOnce(e){return-1!==this.id?this.id:"number"==typeof e?e:void 0}};(0,s._)([(0,h.Cb)({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],Z.prototype,"title",void 0),(0,s._)([(0,g.r)("service","title",["alias","name"])],Z.prototype,"readTitle",null),(0,s._)([(0,h.Cb)()],Z.prototype,"layer",void 0),(0,s._)([(0,h.Cb)({type:b.z8,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Z.prototype,"id",void 0),(0,s._)([(0,g.r)("service","id")],Z.prototype,"readIdOnlyOnce",null),(0,s._)([(0,h.Cb)((0,T.Lx)(String))],Z.prototype,"modelName",void 0),(0,s._)([(0,h.Cb)((0,T.Lx)(Boolean))],Z.prototype,"isEmpty",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{name:"visibility",write:!0}})],Z.prototype,"visible",void 0),(0,s._)([(0,h.Cb)({type:Number,json:{write:!0}})],Z.prototype,"opacity",void 0),Z=(0,s._)([(0,f.j)("esri.layers.buildingSublayers.BuildingSublayer")],Z);const A=Z;var B=r(81422),q=r(50413),E=r(45787),P=r(96803),k=r(18710),N=r(4271),U=r(90625),R=r(10439);const M=d.Z.getLogger("esri.layers.buildingSublayers.BuildingComponentSublayer"),H=(0,q.v)();let Q=class extends(O.Z.LoadableMixin((0,j.v)(A))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.fields=null,this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl.path}/sublayers/${this.id}`,query:this.layer.parsedUrl.query}:null}get fieldsIndex(){return new E.Z(this.fields)}readAssociatedLayer(e,t){const r=this.layer.associatedFeatureServiceItem,s=t.associatedLayerID;return(0,p.pC)(r)&&"number"==typeof s?new x.default({portalItem:r,layerId:s}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return null}get displayField(){return(0,p.pC)(this.associatedLayer)?this.associatedLayer.displayField:null}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const t=(0,p.pC)(e)?e.signal:null,r=this._fetchService(t).then((()=>{this.indexInfo=(0,P.T)(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,M,t)}));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){return(0,U.eZ)(this,e)}async _fetchService(e){const t=(await(0,w.default)(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r,s,i,o;const n=null==(r=this.getFeatureType(null==t?void 0:t.feature))||null==(s=r.domains)?void 0:s[e];return n&&"inherited"!==n.type?n:null!=(i=null==(o=this.getField(e))?void 0:o.domain)?i:null}getFeatureType(e){return e&&(0,p.pC)(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return(0,p.pC)(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return(0,p.pC)(this.associatedLayer)?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=(0,p.pC)(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:B.C,{query:t,data:{supportsZ:r,supportsM:s,isVersioned:i}}=e;return{query:t,data:{supportsZ:r,supportsM:s,isVersioned:i}}}createQuery(){const e=new N.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this.layer,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:(0,p.pC)(this.associatedLayer)}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return(0,p.pC)(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),(0,p.Wi)(this.associatedLayer))throw new n.Z("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n.Z("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};(0,s._)([(0,h.Cb)({readOnly:!0})],Q.prototype,"parsedUrl",null),(0,s._)([(0,h.Cb)({type:k.U4,readOnly:!0})],Q.prototype,"nodePages",void 0),(0,s._)([(0,h.Cb)({type:[k.QI],readOnly:!0})],Q.prototype,"materialDefinitions",void 0),(0,s._)([(0,h.Cb)({type:[k.Yh],readOnly:!0})],Q.prototype,"textureSetDefinitions",void 0),(0,s._)([(0,h.Cb)({type:[k.H3],readOnly:!0})],Q.prototype,"geometryDefinitions",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],Q.prototype,"serviceUpdateTimeStamp",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],Q.prototype,"store",void 0),(0,s._)([(0,h.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],Q.prototype,"rootNode",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],Q.prototype,"attributeStorageInfo",void 0),(0,s._)([(0,h.Cb)(H.fields)],Q.prototype,"fields",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],Q.prototype,"fieldsIndex",null),(0,s._)([(0,h.Cb)({readOnly:!0,type:x.default})],Q.prototype,"associatedLayer",void 0),(0,s._)([(0,g.r)("service","associatedLayer",["associatedLayerID"])],Q.prototype,"readAssociatedLayer",null),(0,s._)([(0,h.Cb)(H.outFields)],Q.prototype,"outFields",void 0),(0,s._)([(0,h.Cb)({type:String,readOnly:!0})],Q.prototype,"objectIdField",null),(0,s._)([(0,h.Cb)({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,"displayField",null),(0,s._)([(0,h.Cb)({readOnly:!0,type:String,aliasOf:"layer.apiKey"})],Q.prototype,"apiKey",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:F.Z,aliasOf:"layer.fullExtent"})],Q.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:v.Z,aliasOf:"layer.spatialReference"})],Q.prototype,"spatialReference",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,aliasOf:"layer.version"})],Q.prototype,"version",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:R.Z,aliasOf:"layer.elevationInfo"})],Q.prototype,"elevationInfo",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:Number,aliasOf:"layer.minScale"})],Q.prototype,"minScale",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:Number,aliasOf:"layer.maxScale"})],Q.prototype,"maxScale",void 0),(0,s._)([(0,h.Cb)({type:["hide","show"],json:{write:!0}})],Q.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({types:C.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Q.prototype,"renderer",void 0),(0,s._)([(0,h.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),(0,s._)([(0,h.Cb)(T.C_)],Q.prototype,"popupEnabled",void 0),(0,s._)([(0,h.Cb)({type:_.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Q.prototype,"popupTemplate",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Q.prototype,"normalReferenceFrame",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Q.prototype,"defaultPopupTemplate",null),(0,s._)([(0,h.Cb)()],Q.prototype,"types",null),(0,s._)([(0,h.Cb)()],Q.prototype,"typeIdField",null),(0,s._)([(0,h.Cb)({json:{write:!1}}),(0,I.J)(new S.Xn({"3DObject":"3d-object",Point:"point"}))],Q.prototype,"layerType",void 0),(0,s._)([(0,h.Cb)()],Q.prototype,"geometryType",null),(0,s._)([(0,h.Cb)()],Q.prototype,"profile",null),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Q.prototype,"capabilities",null),Q=(0,s._)([(0,f.j)("esri.layers.buildingSublayers.BuildingComponentSublayer")],Q);const D=Q;var V,K=r(24623);const W={type:i.Z,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:z}}},read:!1}};function z(e,t,r){if(e&&Array.isArray(e))return new i.Z(e.map((e=>{const t=function(e){return"group"===e.layerType?J:D}(e);if(t){const s=new t;return s.read(e,r),s}r&&r.messages&&e&&r.messages.push(new K.Z("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:r}))})))}let J=V=class extends A{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return(0,a.wF)(this,(e=>V.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)}))))}};var G;(0,s._)([(0,h.Cb)({type:["hide","show","hide-children"],json:{write:!0}})],J.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)(W)],J.prototype,"sublayers",void 0),J=V=(0,s._)([(0,f.j)("esri.layers.buildingSublayers.BuildingGroupSublayer")],J),(G=J||(J={})).sublayersProperty=W,G.readSublayers=z,G.forEachSublayer=function e(t,r){t.forEach((t=>{r(t),"building-group"===t.type&&e(t.sublayers,r)}))};const $=J;var X=r(66684),Y=r(80108),ee=r(13917),te=r(12661),re=r(3956),se=r(11080),ie=r(42963),oe=r(52175);let ne=class extends ie.wq{constructor(){super(...arguments),this.type=null}};(0,s._)([(0,h.Cb)({type:String,readOnly:!0,json:{write:!0}})],ne.prototype,"type",void 0),ne=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterAuthoringInfo")],ne);const le=ne;var ae;let de=ae=class extends ie.wq{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new ae({filterType:this.filterType,filterValues:(0,l.d9)(this.filterValues)})}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],de.prototype,"filterType",void 0),(0,s._)([(0,h.Cb)({type:[String],json:{write:!0}})],de.prototype,"filterValues",void 0),de=ae=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterAuthoringInfoType")],de);const pe=de;var ye;const ue=i.Z.ofType(pe);let ce=ye=class extends ie.wq{clone(){return new ye({filterTypes:(0,l.d9)(this.filterTypes)})}};(0,s._)([(0,h.Cb)({type:ue,json:{write:!0}})],ce.prototype,"filterTypes",void 0),ce=ye=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterAuthoringInfoBlock")],ce);const he=ce;var be;const ge=i.Z.ofType(he);let fe=be=class extends le{constructor(){super(...arguments),this.type="checkbox"}clone(){return new be({filterBlocks:(0,l.d9)(this.filterBlocks)})}};(0,s._)([(0,h.Cb)({type:["checkbox"]})],fe.prototype,"type",void 0),(0,s._)([(0,h.Cb)({type:ge,json:{write:!0}})],fe.prototype,"filterBlocks",void 0),fe=be=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],fe);const ve=fe;let me=class extends ie.wq{};(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],me.prototype,"type",void 0),me=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterMode")],me);const _e=me;var Ce;let we=Ce=class extends _e{constructor(){super(...arguments),this.type="solid"}clone(){return new Ce}};(0,s._)([(0,h.Cb)({type:["solid"],readOnly:!0,json:{write:!0}})],we.prototype,"type",void 0),we=Ce=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterModeSolid")],we);const Se=we;var Oe,je=r(27612);let Ie=Oe=class extends _e{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new Oe({edges:(0,l.d9)(this.edges)})}};(0,s._)([(0,I.J)({wireFrame:"wire-frame"})],Ie.prototype,"type",void 0),(0,s._)([(0,h.Cb)(je.Z)],Ie.prototype,"edges",void 0),Ie=Oe=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterModeWireFrame")],Ie);const Fe=Ie;var xe;let Le=xe=class extends _e{constructor(){super(...arguments),this.type="x-ray"}clone(){return new xe}};(0,s._)([(0,h.Cb)({type:["x-ray"],readOnly:!0,json:{write:!0}})],Le.prototype,"type",void 0),Le=xe=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterModeXRay")],Le);const Te=Le;var Ze;const Ae={nonNullable:!0,types:{key:"type",base:_e,typeMap:{solid:Se,"wire-frame":Fe,"x-ray":Te}},json:{read:e=>{switch(e&&e.type){case"solid":return Se.fromJSON(e);case"wireFrame":return Fe.fromJSON(e);case"x-ray":return Te.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let Be=Ze=class extends ie.wq{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new Se,this.title=""}clone(){return new Ze({filterExpression:this.filterExpression,filterMode:(0,l.d9)(this.filterMode),title:this.title})}};(0,s._)([(0,h.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],Be.prototype,"filterExpression",void 0),(0,s._)([(0,h.Cb)(Ae)],Be.prototype,"filterMode",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],Be.prototype,"title",void 0),Be=Ze=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilterBlock")],Be);const qe=Be;var Ee;const Pe=i.Z.ofType(qe);let ke=Ee=class extends ie.wq{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=(0,oe.D)(),this.name=null}clone(){return new Ee({description:this.description,filterBlocks:(0,l.d9)(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:(0,l.d9)(this.filterAuthoringInfo)})}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"description",void 0),(0,s._)([(0,h.Cb)({type:Pe,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"filterBlocks",void 0),(0,s._)([(0,h.Cb)({types:{key:"type",base:le,typeMap:{checkbox:ve}},json:{read:e=>{switch(e&&e.type){case"checkbox":return ve.fromJSON(e);default:return null}},write:!0}})],ke.prototype,"filterAuthoringInfo",void 0),(0,s._)([(0,h.Cb)({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"id",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"name",void 0),ke=Ee=(0,s._)([(0,f.j)("esri.layers.support.BuildingFilter")],ke);const Ne=ke,Ue=d.Z.getLogger("esri.layers.support.BuildingSummaryStatistics");let Re=class extends ie.wq{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};(0,s._)([(0,h.Cb)({type:String})],Re.prototype,"fieldName",void 0),(0,s._)([(0,h.Cb)({type:String})],Re.prototype,"modelName",void 0),(0,s._)([(0,h.Cb)({type:String})],Re.prototype,"label",void 0),(0,s._)([(0,h.Cb)({type:Number})],Re.prototype,"min",void 0),(0,s._)([(0,h.Cb)({type:Number})],Re.prototype,"max",void 0),(0,s._)([(0,h.Cb)({json:{read:e=>Array.isArray(e)&&(e.every((e=>"string"==typeof e))||e.every((e=>"number"==typeof e)))?e.slice():null}})],Re.prototype,"mostFrequentValues",void 0),(0,s._)([(0,h.Cb)({type:[Number]})],Re.prototype,"subLayerIds",void 0),Re=(0,s._)([(0,f.j)("esri.layers.support.BuildingFieldStatistics")],Re);let Me=class extends(O.Z.LoadableMixin((0,j.v)(ie.wq))){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||"loading"===this.loadStatus?this._get("fields"):(Ue.error("building summary statistics are not loaded"),null)}load(e){const t=(0,p.pC)(e)?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}async _fetchService(e){const t=(await(0,w.default)(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(t,{origin:"service"})}};(0,s._)([(0,h.Cb)({constructOnly:!0,type:String})],Me.prototype,"url",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:[Re],json:{read:{source:"summary"}}})],Me.prototype,"fields",null),Me=(0,s._)([(0,f.j)("esri.layers.support.BuildingSummaryStatistics")],Me);const He=Me;var Qe=r(75661);const De=d.Z.getLogger("esri.layers.BuildingSceneLayer"),Ve=i.Z.ofType(Ne),Ke=(0,l.d9)($.sublayersProperty);Ke.json.origins["web-scene"]={type:[D],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},Ke.json.origins["portal-item"]={type:[D],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}};let We=class extends((0,se.V)((0,Y.Y)((0,ee.q)((0,te.I)((0,re.M)((0,y.R)((0,X.V)(m.Z)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>"building-group"===e.type?e.sublayers:null}),this.sublayers=null,this.sublayerOverrides=null,this.filters=new Ve,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.type="building-scene"}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){this.allSublayers.destroy()}readSublayers(e,t,r){const s=$.readSublayers(e,t,r);return $.forEachSublayer(s,(e=>e.layer=this)),this.sublayerOverrides&&(this.applySublayerOverrides(s,this.sublayerOverrides),this.sublayerOverrides=null),s}applySublayerOverrides(e,{overrides:t,context:r}){$.forEachSublayer(e,(e=>e.read(t.get(e.id),r)))}readSublayerOverrides(e,t){const r=new Map;for(const s of e)null!=s&&"object"==typeof s&&"number"==typeof s.id?r.set(s.id,s):t.messages.push(new n.Z("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:s}));return{overrides:r,context:t}}writeSublayerOverrides(e,t,r){const s=[];$.forEachSublayer(this.sublayers,(e=>{const t=e.write({},r);Object.keys(t).length>1&&s.push(t)})),s.length>0&&(t.sublayers=s)}writeUnappliedOverrides(e,t){t.sublayers=[],e.overrides.forEach((e=>{t.sublayers.push((0,l.d9)(e))}))}write(e,t){return e=super.write(e,t),!t||"web-scene"!==t.origin&&"portal-item"!==t.origin||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,t):this.sublayerOverrides&&this.writeUnappliedOverrides(this.sublayerOverrides,e)),e}read(e,t){if(super.read(e,t),t&&("web-scene"===t.origin||"portal-item"===t.origin)&&null!=e&&Array.isArray(e.sublayers)){const r=this.readSublayerOverrides(e.sublayers,t);this.sublayers?this.applySublayerOverrides(this.sublayers,r):this.sublayerOverrides=r}}readSummaryStatistics(e,t){if("string"==typeof t.statisticsHRef){const e=(0,c.v_)(this.parsedUrl.path,t.statisticsHRef);return new He({url:e})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const t=(0,p.pC)(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(u.r9).then((()=>this._fetchService(t))).then((()=>this._fetchAssociatedFeatureService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}loadAll(){return(0,a.GZ)(this,(e=>{$.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)})),this.summaryStatistics&&e(this.summaryStatistics)}))}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(!e.layerType||"Building"!==e.layerType)throw new n.Z("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}_validateElevationInfo(){const e=this.elevationInfo;e&&("absolute-height"!==e.mode&&De.warn(".elevationInfo=","Building scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&De.warn(".elevationInfo=","Building scene layers do not support featureExpressionInfo"))}async _fetchAssociatedFeatureService(e){const t=new Qe.W(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedFeatureServiceItem=await t.fetchPortalItem()}catch(e){De.warn("Associated feature service item could not be loaded",e)}}};(0,s._)([(0,h.Cb)({type:["BuildingSceneLayer"]})],We.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],We.prototype,"allSublayers",void 0),(0,s._)([(0,h.Cb)(Ke)],We.prototype,"sublayers",void 0),(0,s._)([(0,g.r)("service","sublayers")],We.prototype,"readSublayers",null),(0,s._)([(0,h.Cb)({type:Ve,nonNullable:!0,json:{write:!0}})],We.prototype,"filters",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],We.prototype,"activeFilterId",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:He})],We.prototype,"summaryStatistics",void 0),(0,s._)([(0,g.r)("summaryStatistics",["statisticsHRef"])],We.prototype,"readSummaryStatistics",null),(0,s._)([(0,h.Cb)({type:[String],json:{read:!1}})],We.prototype,"outFields",void 0),(0,s._)([(0,h.Cb)(T.vg)],We.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)({type:["show","hide","hide-children"]})],We.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)((0,T.Lx)(v.Z))],We.prototype,"spatialReference",void 0),(0,s._)([(0,h.Cb)(T.PV)],We.prototype,"elevationInfo",null),(0,s._)([(0,h.Cb)({json:{read:!1},readOnly:!0})],We.prototype,"type",void 0),(0,s._)([(0,h.Cb)()],We.prototype,"associatedFeatureServiceItem",void 0),We=(0,s._)([(0,f.j)("esri.layers.BuildingSceneLayer")],We);const ze=We},76770:(e,t,r)=>{"use strict";r.d(t,{t:()=>c});var s=r(14983),i=r(29438),o=r(83403),n=r(67380),l=r(74476),a=r(40668),d=r(32248),p=r(35203),y=r(84066),u=r(74184);let c=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new o.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,r,s=0){const i=0!=(1&s),o=++this.handleId;i||this.installSyncUpdatingWatch(e,t,o);const n=0!=(2&s)?(0,a.S1)(e,t,r,i):e.watch(t,r,i);return this.handles.add(n,o),{remove:()=>this.handles.remove(o)}}addOnCollectionPropertyChange(e,t,r,s=0){const i=0!=(2&s),o=++this.handleId;return this.handles.add([(0,a.on)(e,t,"after-changes",this.createSyncUpdatingCallback()),(0,a.on)(e,t,"change",r,i?e=>{r({added:e.items,removed:[],moved:[],target:e})}:void 0)],o),{remove:()=>{this.handles.remove(o)}}}addOnCollectionChange(e,t,r=0){const s=0!=(2&r),i=++this.handleId;return this.handles.add([e.on("after-changes",this.createSyncUpdatingCallback()),e.on("change",t)],i),s&&t({added:e.items,removed:[],moved:[],target:e}),{remove:()=>{this.handles.remove(i)}}}addPromise(e){if((0,n.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(h)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const r=()=>this.handles.remove(t);return e.then(r,r),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}installSyncUpdatingWatch(e,t,r){const s=this.createSyncUpdatingCallback(),i=(0,p.U5)((()=>(0,d.$z)(e,t)),s);return this.handles.add(i,r),i}createSyncUpdatingCallback(){return()=>{this.handles.remove(h),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(h))})),h)}}};(0,s._)([(0,y.Cb)({readOnly:!0})],c.prototype,"updating",void 0),c=(0,s._)([(0,u.j)("esri.views.support.WatchUpdatingTracking")],c);const h=-42}}]);