/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../core/Handles","../../../core/maybe","../../../core/reactiveUtils","./constants","./HoveredPoints","./InputRepresentation3D","./ProfileLines3D"],(function(e,t,i,n,o,s,a,r){"use strict";let l=function(){function e(e,o){this._handles=new t,this._inputRepresentation=new a.InputRepresentation3D({view:e}),this._hoveredPoints=new s.HoveredPoints({view:e}),this._profileLines=new r.ProfileLines3D({view:e}),this._handles.add([n.watch((()=>o.viewModel.hoveredPoints),(e=>this._hoveredPoints.update(e)),n.syncAndInitial),n.watch((()=>{const{state:e,editable:t,highlightEnabled:n,viewModel:s}=o,a=s.input;return i.applySome(a,(e=>{e.commitProperty("geometry"),e.commitProperty("layer")})),{input:a,state:e,editable:t,highlightEnabled:n}}),(e=>this._updateInputRepresentation(e)),n.syncAndInitial),n.watch((()=>o.viewModel.chartData),(e=>this._profileLines.update(e)),n.syncAndInitial),n.watch((()=>i.applySome(o.viewModel.input,(e=>e.geometry))),(()=>{this._profileLines.remove()}),n.syncAndInitial)])}var l=e.prototype;return l.destroy=function(){this._handles=i.destroyMaybe(this._handles),this._inputRepresentation=i.destroyMaybe(this._inputRepresentation),this._hoveredPoints=i.destroyMaybe(this._hoveredPoints),this._profileLines=i.destroyMaybe(this._profileLines)},l._updateInputRepresentation=function({input:e,state:t,editable:i,highlightEnabled:n}){const s=this._inputRepresentation;if(!n)return s.remove();t===o.ElevationProfileState.Selected?s.showHighlight(e):t!==o.ElevationProfileState.Created||i?s.remove():s.showReshaping(e)},e}();e.ElevationProfileView3D=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
