/*
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 t}from"tslib";import s from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import{LineSnapper as n}from"./LineSnapper.js";import{ParallelLineSnapper as r}from"./ParallelLineSnapper.js";import{RightAngleSnapper as p}from"./RightAngleSnapper.js";import{RightAngleTriangleSnapper as a}from"./RightAngleTriangleSnapper.js";import{sortCandidatesInPlace as c}from"./snappingUtils.js";let h=class extends s{constructor(t){super(t),this.updating=!1,this._snappers=new i,this._domain=2}initialize(){this._snappers.push(new r(this.view,this.options),new n(this.view,this.options,this.geodesicLengthMeasurementUtils),new p(this.view,this.options,this.geodesicLengthMeasurementUtils),new a(this.view,this.options))}set options(t){this._set("options",t);for(const s of this._snappers)s.options=t}async fetchCandidates(t,s,i){if(!(s&this._domain&&this.options.effectiveSelfEnabled))return[];const e=[];for(const o of this._snappers.items)for(const s of o.snap(t,i))e.push(s);return c(t,e),e}};t([e({readOnly:!0})],h.prototype,"updating",void 0),t([e({constructOnly:!0})],h.prototype,"view",void 0),t([e({constructOnly:!0})],h.prototype,"geodesicLengthMeasurementUtils",void 0),t([e()],h.prototype,"options",null),h=t([o("esri.views.interactive.snapping.SelfSnappingEngine")],h);export{h as SelfSnappingEngine};
