"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5666],{55666(e,t,n){n.r(t),n.d(t,{execute:()=>u,executeMany:()=>i,isConvex:()=>s});var r=n(91577),o=n(83299);function u(e){const t=(0,o.fromGeometry)(e);return(0,o.toGeometry)((0,r.g7)(t.getGeometry()),t.getSpatialReference())}function i(e,t={}){const{merge:n=!1}=t,[u,i]=(0,o.fromGeometries)(e);return(0,r.zo)(u,n).map(e=>(0,o.toGeometry)(e,i))}function s(e){return(0,r.qT)((0,o.fromGeometryToGXGeometry)(e))}},91577(e,t,n){n.d(t,{fz:()=>C,g7:()=>l,qT:()=>p,zo:()=>G});var r=n(76061),o=n(61691),u=n(55537),i=n(95213),s=n(88885),m=n(79187);class c extends o.G{constructor(e,t,n){super(),t||(0,u.a)(""),this.m_progressTracker=n,this.m_index=-1,this.m_bMerge=e,this.m_bDone=!1,this.m_inputGeometryCursor=t}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}next(){if(this.m_bMerge){if(!this.m_bDone){const e=a(this.m_inputGeometryCursor);return this.m_bDone=!0,e}return null}if(!this.m_bDone){const e=this.m_inputGeometryCursor.next();if(null!==e)return(0,u.o)(e),(0,u.c)(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),g(e);this.m_bDone=!0}return null}}function a(e,t){const n=new s.C;let r;for(;r=e.next();)(0,u.o)(r),(0,u.c)(r),n.addGeometry(r);return n.getBoundingGeometry()}function g(e,t){if((0,u.c)(e),e.isEmpty())return e.createInstance();const n=e.getGeometryType();if((0,u.f)(n)){const t=e;if(t.isDegenerate(0)){const e=new i.P;return t.queryStart(e),e}if(t.getGeometryType()===u.G.enumLine){const n=new i.P,r=new s.a({vd:e.getDescription()});return t.queryStart(n),r.startPathPoint(n),t.queryEnd(n),r.lineToPoint(n),r}{const n=new s.a({vd:e.getDescription()});return n.addSegment(t,!0),g(n)}}if(n===u.G.enumEnvelope){const t=e,n=new m.Envelope2D;if(t.queryEnvelope(n),n.xmin===n.xmax&&n.ymin===n.ymax){const e=new i.P;return t.queryCornerByVal(0,e),e}if(n.xmin===n.xmax||n.ymin===n.ymax){const n=new i.P,r=new s.a({vd:e.getDescription()});return t.queryCornerByVal(0,n),r.startPathPoint(n),t.queryCornerByVal(1,n),r.lineToPoint(n),r}{const n=new s.P({vd:e.getDescription()});return n.addEnvelope(t,!1),n}}if(n===u.G.enumGeometryCollection)return a((0,s.g)(e,-1));if(y(e)){if(n===u.G.enumMultiPoint){const t=e,n=new i.P;return t.getPointByVal(0,n),n}return e}return(0,u.g)((0,u.i)(n)),(0,s.f)(e)}function y(e,t){if((0,u.c)(e),e.isEmpty())return!0;const n=e.getGeometryType();if(n===u.G.enumPoint)return!0;if(n===u.G.enumEnvelope){const t=e;return t.getXMin()!==t.getXMax()&&t.getYMin()!==t.getYMax()}if((0,u.f)(n)){const t=e;if(t.isDegenerate(0))return!1;if(n===u.G.enumLine)return!0;const r=new s.a;return r.addSegment(t,!0),y(r)}if(n===u.G.enumMultiPoint)return 1===e.getPointCount();if(n===u.G.enumPolyline){const t=e;return!t.hasNonLinearSegments()&&1===t.getPathCount()&&2===t.getPointCount()&&!t.getXY(0).equals(t.getXY(1))}if(n===u.G.enumGeometryCollection){const t=e;return 1===t.getGeometryCount()&&y(t.getGeometry(0))}const r=e;return!(1!==r.getPathCount()||r.getPointCount()<3)&&(0,s.i)(r,0)}const f=new class{getOperatorType(){return 10102}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n){return new c(t,e,n)}execute(e,t){return g(e)}isConvex(e,t){if((0,u.c)(e),e.isEmpty())return!0;const n=e.getGeometryType();if(n===u.G.enumPoint)return!0;if(n===u.G.enumEnvelope){const t=e;return t.getXMin()!==t.getXMax()&&t.getYMin()!==t.getYMax()}if((0,u.f)(n)){const t=e;return!t.getStartXY().equals(t.getEndXY())}if(n===u.G.enumMultiPoint)return 1===e.getPointCount();if(n===u.G.enumPolyline){const t=e;return 1===t.getPathCount()&&2===t.getPointCount()&&!t.getXY(0).equals(t.getXY(1))}if(n===u.G.enumGeometryCollection){const n=e;return 1===n.getGeometryCount()&&this.isConvex(n.getGeometry(0),t)}const r=e;return!(1!==r.getPathCount()||r.getPointCount()<3)&&(0,s.i)(r,0)}constructOrientedMinimumBoundingBox(e,t,n,r,o){(0,s.e)(e,t,n,r,o)}};function l(e){return f.execute(e,null)}function G(e,t){const n=f.executeMany(new r.S(e),t,null);return Array.from(n)}function p(e){return f.isConvex(e,null)}function C(){return f.supportsCurves()}}}]);