(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-af6276ba"],{"0e25":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s,r=i("c649"),n=i("b7c2");!function(e){e[e.Object=0]="Object",e[e.RenderGeometry=1]="RenderGeometry",e[e.External=2]="External",e[e.COUNT=3]="COUNT"}(s||(s={}));class a{constructor(){this.items=[]}addObject(e,t){this.items.push({type:s.Object,objectStateId:t,object:e})}addRenderGeometry(e,t,i){this.items.push({type:s.RenderGeometry,objectStateId:t,renderGeometry:e,owner:i})}addExternal(e,t){this.items.push({type:s.External,objectStateId:t,remove:e})}remove(e){for(let t=this.items.length-1;t>=0;--t){const i=this.items[t];i.objectStateId===e&&(this._removeObjectStateItem(i),this.items.splice(t,1))}}removeObject(e){for(let t=this.items.length-1;t>=0;--t){const i=this.items[t];i.type===s.Object&&i.object===e&&(this._removeObjectStateItem(i),this.items.splice(t,1))}}removeRenderGeometry(e){for(let t=this.items.length-1;t>=0;--t){const i=this.items[t];i.type===s.RenderGeometry&&i.renderGeometry===e&&(this._removeObjectStateItem(i),this.items.splice(t,1))}}removeAll(){this.items.forEach(e=>{this._removeObjectStateItem(e)}),this.items=[]}_removeObjectStateItem(e){switch(e.type){case s.Object:e.objectStateId.channel===n["f"].Highlight?e.object.removeHighlight(e.objectStateId):e.objectStateId.channel===n["f"].MaskOccludee&&e.object.removeOcclude(e.objectStateId);break;case s.RenderGeometry:e.owner.removeRenderGeometryObjectState(e.renderGeometry,e.objectStateId);break;case s.External:e.remove(e.objectStateId)}}}class c{constructor(e,t){this.stateType=e,this.objectIdField=t,this.objectStateSet=new a,this.ids=new Set,this.paused=!1}hasGraphic(e){if(this.objectIdField){const t=e.graphic.attributes[this.objectIdField];return this.ids.has(t)}return this.ids.has(e.graphic.uid)}}class o{constructor(e){this._graphicsCore=e,this._stateSets=new Array}destroy(){this._stateSets&&this._stateSets.forEach(e=>e.objectStateSet.removeAll()),this._stateSets=null}acquireSet(e,t){const i=new c(e,t);this._stateSets.push(i);const s=Object(r["b"])(()=>this.releaseSet(i));return{set:i,handle:s}}releaseSet(e){e.objectStateSet.removeAll();const t=this._stateSets?this._stateSets.indexOf(e):-1;-1!==t&&this._stateSets.splice(t,1)}_addObjectStateSet(e,t){e.addObjectStateSet(t.stateType,t.objectStateSet)}_removeObjectStateSet(e,t){e.removeObjectState(t.objectStateSet)}setUid(e,t){e.ids.add(t);const i=this._graphicsCore.graphics3DGraphics.get(t);i&&this._addObjectStateSet(i,e)}setUids(e,t){t.forEach(t=>this.setUid(e,t))}setObjectIds(e,t){t.forEach(t=>e.ids.add(t)),this._initializeSet(e)}addGraphic(e){this._stateSets.forEach(t=>{!t.paused&&t.hasGraphic(e)&&this._addObjectStateSet(e,t)})}removeGraphic(e){this._stateSets.forEach(t=>{t.hasGraphic(e)&&this._removeObjectStateSet(e,t)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(e=>e.objectStateSet.removeAll())}_initializeSet(e){const t=this._graphicsCore.graphics3DGraphics;e.objectIdField?t.forEach(t=>{t&&e.hasGraphic(t)&&this._addObjectStateSet(t,e)}):e.ids.forEach(i=>{const s=t.get(i);s&&this._addObjectStateSet(s,e)})}get test(){return{states:this._stateSets}}}},"2cbd":function(e,t,i){"use strict";i.d(t,"a",(function(){return C}));var s=i("a4ee"),r=i("8d60"),n=i("2c4f"),a=i("9096"),c=i("c649"),o=i("b2b2"),h=i("f4cc"),l=i("477c"),d=i("59b2"),u=(i("b50f"),i("c120"),i("cea0"),i("d386")),p=i("0f1c"),b=i("a6a3"),g=i("d3cf"),y=i("d1ac"),f=i("69dd"),m=i("ed70"),O=i("4c84"),j=i("8202"),v=i("ebae"),S=i("0e25"),I=i("3422"),_=i("ba58"),w=i("b7c2");let C=class extends a["a"]{constructor(e){super(e),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new j["a"],this._suspendResumeExtent=null}normalizeCtorArgs(e){const t={...e,scaleVisibility:null,frustumVisibility:null};return delete t.scaleVisibilityEnabled,delete t.frustumVisibilityEnabled,e.scaleVisibilityEnabled&&(t.scaleVisibility=new I["a"]),e.frustumVisibilityEnabled&&(t.frustumVisibility=new v["a"]),t}initialize(){const e=new O["a"]({owner:this,layer:this.owner.layer,preferredUpdatePolicy:w["m"].SYNC,graphicSymbolSupported:!0});this._set("graphicsCore",e);const{layer:t,scaleVisibility:i}=this;if(Object(o["k"])(i)&&"effectiveScaleRange"in t){const e=t;this.updatingHandles.add(()=>e.effectiveScaleRange,()=>i.layerMinMaxScaleChangeHandler())}if("fullOpacity"in this.owner){const e=this.owner;this.updatingHandles.add(()=>e.fullOpacity,()=>this.graphicsCore.opacityChange())}if("elevationInfo"in t){const e=t;this.updatingHandles.add(()=>e.elevationInfo,(e,t)=>{Object(p["a"])(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})}}async setup(){const e=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.elevationAlignment.setup(this,e,this.graphicsCore,this.view.elevationProvider),Object(o["k"])(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const t=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this,this.layer,e,this.graphicsCore,t)}Object(o["k"])(this.frustumVisibility)&&this.frustumVisibility.setup(this),this._set("objectStates",new S["a"](this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(t){if(Object(h["m"])(t))return;throw t}this.destroyed||(this.handles.add(this.view.watch("clippingArea",()=>this._updateClippingExtent(),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("elevationAlignment",Object(o["d"])(this.elevationAlignment)),this._set("scaleVisibility",Object(o["d"])(this.scaleVisibility)),this._set("frustumVisibility",Object(o["d"])(this.frustumVisibility)),this._set("objectStates",Object(o["d"])(this.objectStates)),this._set("graphicsCore",Object(o["d"])(this.graphicsCore))}get layer(){return this.owner.layer}get view(){return this.owner.view}get scaleVisibilitySuspended(){return!(!Object(o["k"])(this.scaleVisibility)||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return!(!Object(o["k"])(this.frustumVisibility)||!this.frustumVisibility.suspended)}get suspended(){var e;return null!=(e=this.owner.suspended)&&e}get updating(){var e;return!!(null!=(e=this.graphicsCore)&&e.updating||Object(o["k"])(this.scaleVisibility)&&this.scaleVisibility.updating||Object(o["k"])(this.frustumVisibility)&&this.frustumVisibility.updating||this.updatingHandles.updating)}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){var e;return null!=(e=this.owner.fullOpacity)?e:1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=Object(y["c"])(e,{renderer:t,arcade:i});if(Object(o["k"])(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return Object(y["d"])(e,{renderer:t,arcade:i,...s})}getGraphicFromGraphicUid(e){if(this.owner.loadedGraphics){const t=this.owner.loadedGraphics.find(t=>t.uid===e);if(t){const e=this.layer instanceof b["a"]?this.layer:null;return Object(g["c"])(t,e)}}}whenGraphicBounds(e,t){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(e,t):Promise.reject()}computeAttachmentOrigin(e,t){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(e,t):null}getSymbolLayerSize(e,t){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(e,t):null}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(w["f"].MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e){if(e instanceof f["a"])return E;if("number"==typeof e)return this.highlight([e]);if(e instanceof r["a"])return this.highlight([e]);if(e instanceof n["a"]&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof r["a"]){const t=e.map(e=>e.uid),{set:i,handle:s}=this.objectStates.acquireSet(w["f"].Highlight,null);return this.objectStates.setUids(i,t),s}if("number"==typeof e[0]){const t=e,{set:i,handle:s}=this.objectStates.acquireSet(w["f"].Highlight,null);return this.objectStates.setObjectIds(i,t),s}}return E}_setupSuspendResumeExtent(){const{scaleVisibility:e,frustumVisibility:t}=this;if(Object(o["j"])(e)&&Object(o["j"])(t))return;const i=({computedExtent:i,extentPadding:s})=>{this._suspendResumeExtent=Object(_["e"])(i,this._suspendResumeExtent,m["a"],s),Object(o["k"])(e)&&e.setExtent(this._suspendResumeExtent),Object(o["k"])(t)&&t.setExtent(this._suspendResumeExtent)};this.handles.add(Object(l["e"])(()=>{var e,t;return{computedExtent:null==(e=this.graphicsCore)?void 0:e.computedExtent,extentPadding:null==(t=this.graphicsCore)?void 0:t.extentPadding}},e=>i(e),l["d"]))}_updateClippingExtent(){const e=this.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};Object(s["a"])([Object(d["b"])()],C.prototype,"type",void 0),Object(s["a"])([Object(d["b"])({constructOnly:!0})],C.prototype,"owner",void 0),Object(s["a"])([Object(d["b"])()],C.prototype,"layer",null),Object(s["a"])([Object(d["b"])()],C.prototype,"view",null),Object(s["a"])([Object(d["b"])({constructOnly:!0})],C.prototype,"graphicsCore",void 0),Object(s["a"])([Object(d["b"])({constructOnly:!0})],C.prototype,"scaleVisibility",void 0),Object(s["a"])([Object(d["b"])({constructOnly:!0})],C.prototype,"frustumVisibility",void 0),Object(s["a"])([Object(d["b"])({readOnly:!0})],C.prototype,"elevationAlignment",void 0),Object(s["a"])([Object(d["b"])({readOnly:!0})],C.prototype,"objectStates",void 0),Object(s["a"])([Object(d["b"])({readOnly:!0})],C.prototype,"scaleVisibilitySuspended",null),Object(s["a"])([Object(d["b"])({readOnly:!0})],C.prototype,"frustumVisibilitySuspended",null),Object(s["a"])([Object(d["b"])()],C.prototype,"suspended",null),Object(s["a"])([Object(d["b"])({readOnly:!0})],C.prototype,"updating",null),Object(s["a"])([Object(d["b"])()],C.prototype,"loadedGraphics",null),Object(s["a"])([Object(d["b"])()],C.prototype,"fullOpacity",null),Object(s["a"])([Object(d["b"])()],C.prototype,"slicePlaneEnabled",null),Object(s["a"])([Object(d["b"])()],C.prototype,"drapeSourceType",null),Object(s["a"])([Object(d["b"])()],C.prototype,"updatePolicy",null),C=Object(s["a"])([Object(u["a"])("esri.views.3d.layers.graphics.GraphicsProcessor")],C);const E=Object(c["b"])()},8202:function(e,t,i){"use strict";i.d(t,"a",(function(){return f}));var s=i("a4ee"),r=i("fc29"),n=i("ce6d"),a=i("af40"),c=i("b2b2"),o=i("59b2"),h=(i("b50f"),i("c120"),i("cea0"),i("d386")),l=i("8a44"),d=i("9180"),u=i("9305");const p=.05;class b{constructor(){this._extents=new l["a"]({allocator:e=>e||Object(d["l"])()}),this._tmpExtent=Object(d["l"])(),this._dirty=!1}get empty(){return 0===this._extents.length}get size(){return this._extents.length}clear(){this._extents.clear()}add(e){this._contains(e)||(this._removeContained(e),Object(d["k"])(this._extents.pushNew(),e),this._dirty=!0)}pop(){return this._dirty&&this._mergeTight(),this._extents.pop()}merge(e){return this._mergeTight(e),e.hasProgressed}_mergeTight(e=u["e"]){const t=this._extents,i=new Set;let s=0;for(;s!==t.length;){t.sort((e,t)=>e[0]-t[0]),s=t.length,i.clear();for(let s=0;s=r[2])break;i.add(s)}i.forEach(s=>{if(r===s)return;if(s[2]<=r[0])return void i.delete(s);const n=Object(d["d"])(r),a=Object(d["d"])(s),c=this._tmpExtent;Object(d["p"])(r,s,c);const o=n+a;(Object(d["d"])(c)-o)/oObject(d["g"])(t,e))}_removeContained(e){this._extents.filterInPlace(t=>!Object(d["g"])(e,t))}get test(){const e=this;return{containsPoint:t=>e._extents.some(e=>Object(d["h"])(e,t))}}}var g=i("b7c2");let y=class extends r["a"]{constructor(){super(...arguments),this.dirtyExtents=new b,this.globalDirty=!1,this.averageExtentUpdateSize=0,this.dirtyGraphicsSet=new Set,this.handles=new a["a"],this.updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new n["a"]}setup(e,t,i,s){this.graphicsCoreOwner=e,this.queryGraphicUIDsInExtent=t,this.graphicsCore=i,this.elevationProvider=s;const r=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add([s.on("elevation-change",e=>this._elevationChanged(e)),this.graphicsCoreOwner.watch("suspended",()=>this._suspendedChange()),r.registerTask(u["c"].ELEVATION_ALIGNMENT,this)])}destroy(){this.dirtyGraphicsSet.clear(),this.handles.destroy(),this.handles=null,this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null}clear(){this.dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){!0===this.graphicsCoreOwner.suspended?this.updateElevation=!1:!1===this.graphicsCoreOwner.suspended&&this.updateElevation&&(this.globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this.globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this.dirtyGraphicsSet.size>0||this.dirtyExtents&&!this.dirtyExtents.empty||this.globalDirty}get updatingRemaining(){return this.dirtyGraphicsSet.size+this.dirtyExtents.size*this.averageExtentUpdateSize}runTask(e){for(this.globalDirty&&(this._markAllGraphicsElevationDirty(),this.globalDirty=!1,e.madeProgress()),e.run(()=>this.dirtyExtents.merge(e));this.running&&!e.done;)this._updateDirtyGraphics(e),this._updateDirtyExtents(e);this.graphicsCoreOwner.view.deconflictor.setDirty(),this.notifyChange("updating")}_updateDirtyGraphics(e){const t=this.graphicsCoreOwner.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===g["m"].ASYNC;for(const s of this.dirtyGraphicsSet.keys()){const r=this.graphicsCore.getGraphics3DGraphicById(s);if(this.dirtyGraphicsSet.delete(s),Object(c["k"])(r)&&(r.alignWithElevation(this.elevationProvider,t,i),e.madeProgress()),e.done)return}}_updateDirtyExtents(e){for(;!this.dirtyExtents.empty&&!e.done;){const t=this.dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:t,spatialReference:i});const s=this.dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(t,i,e=>{const t=this.graphicsCore.getGraphics3DGraphicById(e);Object(c["k"])(t)&&t.needsElevationUpdates()&&this.dirtyGraphicsSet.add(e)}),this.averageExtentUpdateSize=.1*(this.dirtyGraphicsSet.size-s)+.9*this.averageExtentUpdateSize,e.madeProgress()}}_markAllGraphicsElevationDirty(){this.dirtyExtents.clear(),this.dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach((e,t)=>this.dirtyGraphicsSet.add(t))}_elevationChanged(e){if("scene"===e.context&&(!this.graphicsCore.layer.elevationInfo||"relative-to-scene"!==this.graphicsCore.layer.elevationInfo.mode))return;const{extent:t,spatialReference:i}=e;if(this.graphicsCoreOwner.suspended){if(!this.updateElevation){const e=this.graphicsCore.computedExtent;e&&t[2]>e.xmin&&t[0]e.ymin&&t[1]this.processor.graphicsCore.graphicUpdateHandler(e))),this.addResolvingPromise(Object(d["a"])(this).then(e=>this.fullExtentInLocalViewSpatialReference=e)),this.layer.internal?this.notifyChange("updating"):this.handles.add(Object(n["f"])(()=>{var e,t;return null==(e=this.view)||null==(t=e.basemapTerrain)?void 0:t.ready},()=>()=>this.notifyChange("updating"),{once:!0}))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",Object(r["d"])(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){var e;return this.canResume()&&!(null!=(e=this.processor)&&e.frustumVisibilitySuspended)}getSuspendInfo(){var e,t,i,s;const r=super.getSuspendInfo();return r.outsideScaleRange=null!=(e=null==(t=this.processor)?void 0:t.scaleVisibilitySuspended)&&e,r.outsideOfView=null!=(i=null==(s=this.processor)?void 0:s.frustumVisibilitySuspended)&&i,r}async fetchPopupFeatures(e,t){return Object(r["k"])(t)?t.clientGraphics:null}getGraphicFromGraphicUid(e){return this.processor.getGraphicFromGraphicUid(e)}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var i;return null==(i=this.processor)?void 0:i.computeAttachmentOrigin(e,t)}getSymbolLayerSize(e,t){return this.processor.getSymbolLayerSize(e,t)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}get updatePolicy(){var e;return(null==(e=this.processor)?void 0:e.graphicsCore.effectiveUpdatePolicy)||u["m"].SYNC}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.scaleVisibilitySuspended)}isUpdating(){var e,t,i;return!((null==(e=this.processor)||!e.updating)&&(this.layer.internal||null!=(t=this.view)&&null!=(i=t.basemapTerrain)&&i.ready))}get performanceInfo(){var e,t,i,s;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:null!=(e=null==(t=this.processor)?void 0:t.elevationAlignment.updating)&&e,visibilityFrustum:null!=(i=!(null!=(s=this.processor)&&s.frustumVisibilitySuspended))&&i}}};Object(s["a"])([Object(a["b"])()],b.prototype,"loadedGraphics",null),Object(s["a"])([Object(a["b"])({readOnly:!0})],b.prototype,"legendEnabled",null),Object(s["a"])([Object(a["b"])()],b.prototype,"layer",void 0),Object(s["a"])([Object(a["b"])({readOnly:!0})],b.prototype,"processor",void 0),Object(s["a"])([Object(a["b"])({type:Boolean})],b.prototype,"slicePlaneEnabled",void 0),b=Object(s["a"])([Object(c["a"])("esri.views.3d.layers.GraphicsLayerView3D")],b);const g=b},d97e:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("b2b2");function r(e,t){return e?t?4:3:t?3:2}function n(e,t,i,n,o){if(Object(s["j"])(t)||!t.lengths.length)return null;const h="upperLeft"===(null==o?void 0:o.originPosition)?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const l=e.coords,d=[],u=i?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:p,coords:b}=t,g=r(i,n);let y=0;for(const s of p){const e=a(u,b,y,s,i,n,h);e&&d.push(e),y+=s*g}if(d.sort((e,t)=>{let s=h*e[2]-h*t[2];return 0===s&&i&&(s=e[4]-t[4]),s}),d.length){let e=6*d[0][2];l[0]=d[0][0]/e,l[1]=d[0][1]/e,i&&(e=6*d[0][4],l[2]=0!==e?d[0][3]/e:0),(l[0]u[1]||l[1]u[3]||i&&(l[2]u[5]))&&(l.length=0)}if(!l.length){const e=t.lengths[0]?c(b,0,p[0],i,n):null;if(!e)return null;l[0]=e[0],l[1]=e[1],i&&e.length>2&&(l[2]=e[2])}return e}function a(e,t,i,s,n,a,c=1){const o=r(n,a);let h=i,l=i+o,d=0,u=0,p=0,b=0,g=0;for(let r=0,f=s-1;re[1]&&(e[1]=i),se[3]&&(e[3]=s),n&&(re[5]&&(e[5]=r))}if(b*c>0&&(b*=-1),g*c>0&&(g*=-1),!b)return null;const y=[d,u,.5*b];return n&&(y[3]=p,y[4]=.5*g),y}function c(e,t,i,s,n){const a=r(s,n);let c=t,u=t+a,p=0,b=0,g=0,y=0;for(let r=0,f=i-1;r0?s?[b/p,g/p,y/p]:[b/p,g/p]:i>0?s?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,i,s){const r=i-e,n=s-t;return Math.sqrt(r*r+n*n)}function h(e,t,i,s,r,n){const a=s-e,c=r-t,o=n-i;return Math.sqrt(a*a+c*c+o*o)}function l(e,t,i,s){return[e+.5*(i-e),t+.5*(s-t)]}function d(e,t,i,s,r,n){return[e+.5*(s-e),t+.5*(r-t),i+.5*(n-i)]}},ebae:function(e,t,i){"use strict";i.d(t,"a",(function(){return b}));var s=i("a4ee"),r=i("fc29"),n=i("af40"),a=i("3795"),c=i("59b2"),o=(i("b50f"),i("c120"),i("cea0"),i("d386")),h=i("f694"),l=i("6b38"),d=i("9305");const u=1.2;let p=class extends r["a"]{constructor(){super(...arguments),this.suspended=!1,this.extent=null,this.extentIntersectionDirty=!0,this._isVisibleBelowSurface=!1,this.handles=new n["a"],this.graphicsCoreOwner=null,this.updating=!0}setup(e){this.graphicsCoreOwner=e,this.extentIntersection=new l["a"]({renderCoordsHelper:e.view.renderCoordsHelper});const t=e.view,i=t.basemapTerrain,s=t.resourceController.scheduler;this.handles.add([t.on("resize",()=>this._viewChange()),t.state.watch("camera",()=>this._viewChange(),!0),s.registerTask(d["c"].FRUSTUM_VISIBILITY,this),i.on("elevation-bounds-change",()=>this._elevationBoundsChange())]),"local"===t.viewingMode?this.isVisibleBelowSurface=!0:this.handles.add([Object(a["a"])(i,["opacity","wireframe"],()=>this._updateIsVisibleBelowSurface()),Object(a["a"])(t,"map.ground.navigationConstraint.type",()=>this._updateIsVisibleBelowSurface())])}destroy(){this.graphicsCoreOwner=null,this.extent=null,this.extentIntersection=null,this.handles&&(this.handles.destroy(),this.handles=null)}_setDirty(){this.updating||this._set("updating",!0)}setExtent(e){this.extent=e,this.extentIntersectionDirty=!0,this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty(),this.extentIntersectionDirty=!0}set isVisibleBelowSurface(e){this._isVisibleBelowSurface=e,this._setDirty(),this.extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){const e=this.graphicsCoreOwner.view,t=e.basemapTerrain,i="local"===e.viewingMode,s=e.map.ground&&e.map.ground.navigationConstraint&&"none"===e.map.ground.navigationConstraint.type;this.isVisibleBelowSurface=i||!t.opaque||s}_updateExtentIntersection(){if(!this.extentIntersectionDirty)return;this.extentIntersectionDirty=!1;const e=this.graphicsCoreOwner.view;let t;if(this._isVisibleBelowSurface)t=-.3*Object(h["e"])(e.spatialReference).radius;else{const{min:i,max:s}=e.basemapTerrain.elevationBounds;t=i-Math.max(1,(s-i)*(u-1))}this.extentIntersection.update(this.extent,e.spatialReference,t)}get running(){return this.updating}runTask(){if(this._set("updating",!1),!this.extent)return void this._set("suspended",!1);this._updateExtentIntersection();const e=this.graphicsCoreOwner.view.frustum,t=Object(h["e"])(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this.extentIntersection.isVisibleInFrustum(e,t))}};Object(s["a"])([Object(c["b"])({readOnly:!0})],p.prototype,"suspended",void 0),Object(s["a"])([Object(c["b"])({readOnly:!0})],p.prototype,"updating",void 0),p=Object(s["a"])([Object(o["a"])("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],p);const b=p},eec2:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("b2b2"),r=i("9786"),n=i("e2e8");function a(e){const t=e.view.spatialReference,i=e.layer.fullExtent,a=Object(s["k"])(i)&&i.spatialReference;if(Object(s["j"])(i)||!a)return Promise.resolve(null);if(a.equals(t))return Promise.resolve(i.clone());const c=Object(r["d"])(i,t);return Object(s["k"])(c)?Promise.resolve(c):e.view.state.isLocal?Object(n["projectGeometry"])(i,t,e.layer.portalItem).then(t=>!e.destroyed&&t?t:void 0).catch(()=>null):Promise.resolve(null)}}}]); //# sourceMappingURL=chunk-af6276ba.10f773e4.js.map