/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../easing","../Path","../Segment","./planning"],(function(i,e,n,t,o,s){"use strict";let a=function(i){function t(e,n){var t;return(t=i.call(this)||this)._preallocSegments=[new o.Segment,new o.Segment,new o.Segment],t.update(e,n),t}e._inheritsLoose(t,i);var a=t.prototype;return a.update=function(i,e){if(!i)return;this.definition?this.definition.copyFrom(i):this.definition=i.clone();let n=null;e&&e.apex&&(n=s.optimalDistance(i,e.apex)),this.segments.length=0,this._ascensionSegment=null,this._descensionSegment=null,null==n?this._updateWithoutApex():this._updateWithApex(n,e.apex)},a.segmentInterpolateComponentsAt=function(i,e,t){return t=i.interpolateComponentsAt(e,t),i===this._ascensionSegment?t.zoom=n.outQuad(t.zoom):i===this._descensionSegment&&(t.zoom=n.inQuad(t.zoom)),t},a._updateWithApex=function(i,e){const[n,t,o]=this._preallocSegments,s=null!=e.ascensionFactor?e.ascensionFactor:.5,a=Math.min(1-s,null!=e.ascensionFactor?e.descensionFactor:.5),d=1-s-a;n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.compared.targetZoom=i,n.definition.compared.pan=this.definition.compared.pan*s,n.definition.compared.rotate=this.definition.compared.rotate*s,n.update(),this._ascensionSegment=n,this.segments.push(n),d>0&&(t.definition?t.definition.copyFrom(this.definition):t.definition=this.definition.clone(),t.definition.copyFrom(this.definition),t.definition.compared.sourceZoom=i,t.definition.compared.targetZoom=i,t.definition.compared.pan=this.definition.compared.pan*d,t.definition.compared.rotate=this.definition.compared.rotate*d,t.update(),this.segments.push(t)),o.definition?o.definition.copyFrom(this.definition):o.definition=this.definition.clone(),o.definition.compared.sourceZoom=i,o.definition.compared.pan=this.definition.compared.pan*a,o.definition.compared.rotate=this.definition.compared.rotate*a,o.update(),this._descensionSegment=o,this.segments.push(o)},a._updateWithoutApex=function(){const[i]=this._preallocSegments;i.update(this.definition),this.segments.push(i)},t}(t.Path);i.Path=a,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
