/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{a as r,d as n,c as s}from"../../../chunks/Geometry.js";import{p as i}from"../../../chunks/SpatialReference.js";import{Envelope2D as u}from"../../../chunks/Envelope2D.js";import{B as o}from"../../../chunks/Bufferer-Dw9Qi4T1.js";class m{getOperatorType(){return 10004}supportsCurves(){return!0}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r,n,s){return this.executeManyEx(e,t,r,Number.NaN,96,n,s)}execute(t,s,i,u){Number.isFinite(i)||r("Invalid distance for buffer operation");const o=new e([t]),m=[i],a=this.executeMany(o,s,m,!1,u).next();return a||n("null buffer output"),a}executeManyEx(e,t,n,s,u,o,m){if(void 0!==n.find(e=>!Number.isFinite(e))&&r("Invalid distance for buffer operation"),o){const r=new a(e,t,n,s,u,!1,m);return(new i).executeMany(r,t,m,2)}return new a(e,t,n,s,u,!1,m)}}class a extends t{constructor(e,t,r,n,s,i,m){super(),this.m_currentUnionEnvelope2D=new u,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=m,this.m_bufferer=new o(m),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_distances=r,this.m_maxDeviation=n,this.m_maxVerticesInFullCircle=s}tock(){return!0}getRank(){return 1}next(){{let e;for(;e=this.m_inputGeoms.next();)return s(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.buffer(e,this.m_distances[this.m_dindex]);return null}}getGeometryID(){return this.m_index}buffer(e,t){return this.m_bufferer.buffer(e,t,this.m_spatialReference,0,0,4,this.m_maxDeviation,this.m_maxVerticesInFullCircle)}}const c=new m;function f(e,t,r){return c.execute(e,t,r,null)}function h(t,r,n,s){const i=c.executeMany(new e(t),r,n,s,null);return Array.from(i)}function l(t,r,n,s,i,u){const o=c.executeManyEx(new e(t),r,n,s,i,u,null);return Array.from(o)}function x(){return c.supportsCurves()}export{f as execute,h as executeMany,l as executeManyEx,x as supportsCurves};
