/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as s,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{Settings as r}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as a}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as c}from"../../interactive/visualElements/LaserlineVisualElement.js";const d=Symbol("visualElements");let h=class extends t{constructor(e){super(e),this._settings=new r({getTheme:()=>this.view.effectiveTheme}),this._visualElements=null}initialize(){this._createVisuals()}destroy(){this.removeHandles(d)}update({location:e,laserlineVisible:t,verticalLineVisible:i=!1,intersectsWorldUp:s=!1}){this.updateLocation(e,s),this.setVisibility(t,i)}updateLocation(e,t){const i=this._visualElements;if(null==i)return;const{laserline:s,verticalLine:l}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&l.setStartEndFromWorldDownAtLocation(e)}setVisibility(e,t=!1){const i=this._visualElements;null!=i&&(i.laserline.attached=e,i.verticalLine.attached=t)}get test(){}_createVisuals(){const e=this._settings.visualElements,t=new c({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),n=new a({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._visualElements={laserline:t,verticalLine:n},this.addHandles([s(()=>e.zVerticalLine,e=>e.apply(n),l),s(()=>e.heightPlane,e=>e.apply(t),l),i(()=>{t.destroy(),n.destroy(),this._visualElements=null})],d)}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n()],h.prototype,"_settings",void 0),e([n()],h.prototype,"_visualElements",void 0),h=e([o("esri.views.3d.analysis.Viewshed.ViewshedInteractionVisuals")],h);export{h as ViewshedInteractionVisuals};
