/*
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","../../../Color","../../../core/has","../../../core/handleUtils","../../../core/maybe","../../../chunks/vec3","../../../chunks/vec3f64","./visualElements/ExtendedLineVisualElement","./visualElements/ParallelLineVisualElement","./visualElements/PointVisualElement","./visualElements/RightAngleQuadVisualElement","../webgl-engine/lib/Material","../../interactive/snapping/Settings","../../interactive/snapping/snappingUtils","../../interactive/snapping/SnappingVisualizer","../../interactive/support/viewUtils"],(function(e,n,t,i,a,l,o,r,s,d,u,c,p,f,g,v,E){"use strict";let h=function(e){function i(){return e.apply(this,arguments)||this}n._inheritsLoose(i,e);var v=i.prototype;return v.visualizeIntersectionPoint=function(e,n){const{coordinateHelper:i,view:o}=n;return a.destroyHandle(new u.PointVisualElement({view:o,primitive:"circle",geometry:i.vectorToPoint(e.intersectionPoint),elevationInfo:l.unwrapOr(e.elevationInfo,n.elevationInfo),size:20,outlineSize:2,color:[0,0,0,0],outlineColor:t.toUnitRGBA(f.defaults.orange),pixelSnappingEnabled:!1}))},v.visualizePoint=function(e,n){const{coordinateHelper:i,view:o}=n;return a.destroyHandle(new u.PointVisualElement({view:o,primitive:"circle",geometry:i.vectorToPoint(e.point),elevationInfo:l.unwrapOr(e.elevationInfo,n.elevationInfo),size:20,outlineSize:2,color:[0,0,0,0],outlineColor:t.toUnitRGBA(f.defaults.orange),pixelSnappingEnabled:!1}))},v.visualizeLine=function(e,n){const{coordinateHelper:t,view:i}=n;return a.destroyHandle(this._createLineSegmentHintFromMap(e.type,e.lineStart,e.lineEnd,t,l.unwrapOr(e.elevationInfo,n.elevationInfo),i,e.fadeLeft,e.fadeRight))},v.visualizeParallelSign=function(e,n){const{coordinateHelper:i,view:r}=n,s=l.unwrapOr(e.elevationInfo,n.elevationInfo),u=E.anyMapPointToRender(e.lineStart,i,s,n.view),c=E.anyMapPointToRender(e.lineEnd,i,s,n.view),g=o.lerp(c,u,c,.5),v=new d.ParallelLineVisualElement({view:r,attached:!1,offset:f.defaults.parallelLineHintOffset,length:f.defaults.parallelLineHintLength,width:f.defaults.parallelLineHintWidth,color:t.toUnitRGBA(f.defaults.orange),location:g,renderOccluded:p.RenderOccludedFlag.Opaque});return v.setDirectionFromPoints(u,g),v.attached=!0,a.destroyHandle(v)},v.visualizeRightAngleQuad=function(e,n){const{coordinateHelper:i,view:o}=n,r=l.unwrapOr(e.elevationInfo,n.elevationInfo);return a.destroyHandle(new c.RightAngleQuadVisualElement({view:o,attached:!0,color:t.toUnitRGBA(f.defaults.orange),renderOccluded:p.RenderOccludedFlag.Transparent,outlineRenderOccluded:p.RenderOccludedFlag.Opaque,outlineColor:t.toUnitRGBA(f.defaults.orange),outlineSize:f.defaults.rightAngleHintOutlineSize,size:f.defaults.rightAngleHintSize,geometry:{previous:E.anyMapPointToRender(e.previousVertex,i,r,o),center:E.anyMapPointToRender(e.centerVertex,i,r,o),next:E.anyMapPointToRender(e.nextVertex,i,r,o)}}))},v._createLineSegmentHintFromMap=function(e,n,t,i,a,l,o=!0,s=!0){const d=r.create(),u=r.create();return E.anyMapPointsToRenderWithEqualRelativeZ(n,t,i,a,l,d,u),this._createLineSegmentHint(e,l,d,u,o,s)},v._createLineSegmentHint=function(e,n,i,a,l=!0,o=!0){const r=new s.ExtendedLineVisualElement({view:n,extensionType:s.ExtensionType.FADED,start:i,end:a,color:t.toUnitRGBA(f.defaults.orange),renderOccluded:p.RenderOccludedFlag.Opaque});switch(e){case g.LineSegmentHintType.TARGET:r.width=f.defaults.lineHintWidthTarget,r.fadedExtensions={start:0,end:f.defaults.lineHintFadedExtensions};break;case g.LineSegmentHintType.REFERENCE_EXTENSION:r.width=f.defaults.lineHintWidthReference,r.fadedExtensions={start:0,end:0};break;case g.LineSegmentHintType.REFERENCE:r.width=f.defaults.lineHintWidthReference,r.fadedExtensions={start:l?f.defaults.lineHintFadedExtensions:0,end:o?f.defaults.lineHintFadedExtensions:0}}return r.attached=!0,r},i}(v.SnappingVisualizer);e.SnappingVisualizer3D=h,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
