/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{watch as s,syncAndInitial as l,initial as o}from"../../../core/reactiveUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import n from"./DynamicLayerView3D.js";import p from"./ImagerySubView3D.js";import{ImageHighlightHelper3D as d}from"./support/ImageHighlightHelper3D.js";import g from"../support/flow/FlowSubViewExtent3D.js";import{ImageryLayerViewMixin as u}from"../../layers/ImageryLayerViewMixin.js";import{isPixelHighlightTarget as m}from"../../layers/support/highlightUtils.js";let y=class extends(u(n)){constructor(){super(...arguments),this.type="imagery-3d"}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add(()=>this.layer?.exportImageServiceParameters?.version,e),this._updatingHandles.add(()=>this.layer?.renderer,e),this._updatingHandles.add(()=>this.timeExtent,e),this._highlightHelper=new d({view:this.view,layer:this.layer,updatingHandles:this._updatingHandles}),this.addHandles([i(this._highlightHelper),s(()=>this.suspended,e=>this._highlightHelper.suspended=e,l)])}_initSubView(){this.addHandles([s(()=>this.layer.renderer,e=>this._recreateSubView(e),o)])}_recreateSubView(e){const t="flow"===e?.type,i="flow"===this.subView?.type,r=this.subView;r&&t===i||(this.subView=t?new g({layerView:this}):new p({layerView:this}),r?.destroy())}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e,i){if("number"==typeof e||"string"==typeof e||m(e))return r();if(Array.isArray(e)||t.isCollection(e)){const t=e.at(0);if(null==t||"number"==typeof t||"string"==typeof t)return r()}return this._highlightHelper.highlight(e,i)}isUpdating(){return super.isUpdating()||this._highlightHelper.updating}};e([h()],y.prototype,"highlightOptions",null),e([h()],y.prototype,"pixelData",null),y=e([a("esri.views.3d.layers.ImageryLayerView3D")],y);const c=y;export{c as default};
