/*
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 e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{E as o}from"../../../chunks/vec32.js";import{getEndpoint as s}from"../../../geometry/support/curves/curveUtils.js";import{SegmentLabels as n}from"../../interactive/SegmentLabels.js";let i=class extends n{getCameraOrExtent({view:e}){return e.extent}toScreenPointArray({view:e,editGeometryOperations:r},o,s=t()){const{coordinateHelper:n}=r.data,i=e.toScreen(n.arrayToPoint(o));return i&&(s[0]=i.x,s[1]=i.y),s}getRing(e,t,r,n,i){const a=[];for(const o of t.parts[i].iterateVertices())o.leftSegment?a.push(o.leftSegment.toCurveOrCoordinate()):a.push(o.pos);if(0===i&&null!=r&&a.push(n.vectorToArray(r)),a.length<2)return a;const c=a[0],p=a.at(-1),m=n.toXYZ(n.arrayToVector(s(c))),l=n.toXYZ(n.arrayToVector(s(p)));return"polygon"===e.type&&a.length>2&&!o(m,l)&&a.push(c),a}};i=e([r("esri.views.2d.interactive.SegmentLabels2D")],i);export{i as SegmentLabels2D};
