/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as t}from"tslib";import s from"../../../core/Accessor.js";import e from"../../../core/Collection.js";import{property as i,subclass as o}from"../../../core/accessorSupport/decorators.js";import{LineSnapper as n}from"./LineSnapper.js";import{ParallelLineSnapper as p}from"./ParallelLineSnapper.js";import{RightAngleSnapper as r}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 e,this._domain=2}initialize(){this._snappers.push(new p(this.view,this.options),new n(this.view,this.options,this.geodesicLengthMeasurementUtils),new r(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,e){if(!(s&this._domain)||!this.options.effectiveSelfEnabled||e.suppressSelfSnapping)return[];const i=[];for(const o of this._snappers.items)for(const s of o.snap(t,e))i.push(s);return c(t,i),i}};t([i({readOnly:!0})],h.prototype,"updating",void 0),t([i({constructOnly:!0})],h.prototype,"view",void 0),t([i({constructOnly:!0})],h.prototype,"geodesicLengthMeasurementUtils",void 0),t([i()],h.prototype,"options",null),h=t([o("esri.views.interactive.snapping.SelfSnappingEngine")],h);export{h as SelfSnappingEngine};
