/*
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","../../../geometry/geometryEngine","../../../geometry/Polyline","../../../geometry/projection"],(function(e,t,n,r,o){"use strict";let a=function(){function e(){}var a=e.prototype;return a.getPercentageAlong=function(e,t,r){let a=e;const l=this._createPolyline(e.paths,r.wkid);if("point"===t.type){const e=t.x-50,i=t.x+50,c=[[e,t.y-50],[i,t.y+50]];a=this._createPolyline(c,t.spatialReference.wkid);a=o.project(a,r);const u=n.cut(l,a);if(u.length>0){const e=n.planarLength(l,"feet");let t;t=u[0].paths[0][0][0]===l.paths[0][0][0]?n.planarLength(u[0],"feet"):n.planarLength(u[1],"feet");return[t/e]}return[.5]}a=o.project(t,r);const i=n.cut(l,a);if(i.length>0){const e=n.planarLength(l,"feet");return[n.planarLength(i[0],"feet")/e]}return[.5]},a.projectGeometry=function(){var e=t._asyncToGenerator((function*(e,t){return yield o.load(),o.project(e,t)}));function n(t,n){return e.apply(this,arguments)}return n}(),a._createPolyline=function(e,t){return new r({hasZ:!1,hasM:!0,paths:e,spatialReference:{wkid:t}})},e}();e.GeometryHandler=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
