@arcgis/core 4.33.0-next.20250501 → 4.33.0-next.20250503
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0219c3f9408d3fa3c9a0.js → 03ee9d0407c230b885ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{de16b771d2c8d816c738.js → 05c80002c37002ac99e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d40c4783f58af1ae0dc.js → 0e8181e7fc1386d08ffc.js} +1 -1
- package/assets/esri/core/workers/chunks/{96e5d192c8d23c1e324f.js → 13e68c43acc8916520db.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6a5911ea21bef32834b.js → 1bc22af4cc4effcbcf2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{84f972d7851d982701a0.js → 1ca7e0d519ecbfe6976f.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b2ab27159500315fbc1.js → 26850ec0917ee355ddb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bd4fe77ba6fb25322e7.js → 29e2b105f55adafc3a6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d63dfa5a60c88e03b28.js → 2c77a543a174e5bc736a.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0ddf4f1c6a351b447c7.js → 30d7d2c7d6e9e5e2ecb9.js} +1 -1
- package/assets/esri/core/workers/chunks/3fb25912b274f264c84e.js +1 -0
- package/assets/esri/core/workers/chunks/{febae745a29a17ca130a.js → 4480e4b61affb3b2e9d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d4a271351fd288277d2.js → 49085a0b3a74e158f32f.js} +1 -1
- package/assets/esri/core/workers/chunks/{392e64a573f67817db02.js → 4cb199b547e5b97e65fb.js} +1 -1
- package/assets/esri/core/workers/chunks/4df36ee2406861c7afa8.js +1 -0
- package/assets/esri/core/workers/chunks/{9652cfd4668b95036c87.js → 532088a72c3ddc50f3be.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba917175ca2a6681501e.js → 563594357f3648652a5c.js} +1 -1
- package/assets/esri/core/workers/chunks/{abfc5f9ac16c3e885c5f.js → 56db71ea7eb8a5652d98.js} +1 -1
- package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
- package/assets/esri/core/workers/chunks/{235efd948ae470a6f238.js → 60b1365d25581ccf0485.js} +1 -1
- package/assets/esri/core/workers/chunks/{3795793643f4db64af0e.js → 63c25455b9cf1b3df76a.js} +1 -1
- package/assets/esri/core/workers/chunks/{909be86782af3deb448e.js → 654fe135d41af81daa13.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd9343c78a7c3acdbbcd.js → 681b2662f6ce936afd7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{65f2b22d8fc12e6d4a87.js → 7000d9158da929a16071.js} +1 -1
- package/assets/esri/core/workers/chunks/{7551011117c3d36ff3db.js → 743cdbff5c4616ddc2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{968956284f44187f0622.js → 8540fb31bd0b29ff1906.js} +1 -1
- package/assets/esri/core/workers/chunks/8c5cea49e48f8858f115.js +1 -0
- package/assets/esri/core/workers/chunks/{237a965bd41ba8903e03.js → 921c040d0497031fd8ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{96d2a0777f5c418055fb.js → 92b48e3365d1cc933113.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d485c07848164099859.js → 95a4da3150ad8e8e36d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{46fb6ba8900286d18b6f.js → 9d564f79b82d427fc1da.js} +1 -1
- package/assets/esri/core/workers/chunks/{00612d6e05b1c8647668.js → 9fff43ffcd5602ccc50f.js} +1 -1
- package/assets/esri/core/workers/chunks/{653ff3e631fea8ad393a.js → a0db1f3ca29e34dfa16f.js} +12 -12
- package/assets/esri/core/workers/chunks/{1cc5c566e68f2255d035.js → a6ca68ef6311ffc365b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a51c75a2932d9da001a.js → a8d043b73e087bee7c40.js} +1 -1
- package/assets/esri/core/workers/chunks/{581180668e0229dcdc14.js → bf190d672dcbaedc1a41.js} +1 -1
- package/assets/esri/core/workers/chunks/{ebfa4a0334401f5e004a.js → c12765e0c8b44e349c2a.js} +1 -1
- package/assets/esri/core/workers/chunks/{afddb94ff4e1a70022c7.js → c3b2b05996e2008adbe3.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fb4884d2de42792abe3.js → d1a9e8db5ba403abe721.js} +1 -1
- package/assets/esri/core/workers/chunks/d35cd309ba7bb8968a22.js +1 -0
- package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a8df1225abd54ff68ed.js → db298b292a4e43cba72d.js} +1 -1
- package/assets/esri/core/workers/chunks/{2bda2cfc6e81818d7d33.js → dcaeb57c69d432118604.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb455fd89b74b70a6a2b.js → e613df03ceb39e29befa.js} +1 -1
- package/assets/esri/core/workers/chunks/{05d7d8ff3e4cbad32580.js → e8dcaa7837b6fe7bff20.js} +1 -1
- package/assets/esri/core/workers/chunks/ec1a4b82cbc44ba45f83.js +1 -0
- package/assets/esri/core/workers/chunks/ec778cc7a55068f51937.js +1 -0
- package/assets/esri/core/workers/chunks/{51339193abddfe37745d.js → f2b63597ae956db74eb3.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +14 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +34 -0
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList.json +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_en.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_en.json +1 -1
- package/chunks/Bufferer-CicaNej1.js +1 -1
- package/chunks/Distance2DCalculator-C1KHhZwD.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-BEJM7I4l.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/pe.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/WKIDUnitConversion.js +1 -1
- package/interfaces.d.ts +31 -0
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +1 -1
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/widgets/Directions/css.js +5 -0
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +5 -0
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +5 -0
- package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/VisibleElements.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +5 -0
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/assets/esri/core/workers/chunks/11b55e7e76e50fe11bbe.js +0 -1
- package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +0 -1
- package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +0 -1
- package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +0 -1
- package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +0 -1
- package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +0 -1
- package/views/3d/webgl-engine/lib/ContentObject.js +0 -5
- package/views/3d/webgl-engine/lib/ContentObjectType.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[591,3169,6061,8125],{60591:(e,t,s)=>{s.r(t),s.d(t,{execute:()=>n.e,executeMany:()=>n.a,supportsCurves:()=>n.s}),s(4576),s(83047),s(70787),s(78125);var n=s(92523)},64523:(e,t,s)=>{s.d(t,{O:()=>c});var n=s(90237),r=s(76061),i=s(55537),a=s(35368),o=s(95213),l=s(83661),u=s(5247);class c{getOperatorType(){return 10204}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n){return new m(e,t,s,n)}execute(e,t,s,n){return e||(0,i.
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[591,3169,6061,8125],{60591:(e,t,s)=>{s.r(t),s.d(t,{execute:()=>n.e,executeMany:()=>n.a,supportsCurves:()=>n.s}),s(4576),s(83047),s(70787),s(78125);var n=s(92523)},64523:(e,t,s)=>{s.d(t,{O:()=>c});var n=s(90237),r=s(76061),i=s(55537),a=s(35368),o=s(95213),l=s(83661),u=s(5247);class c{getOperatorType(){return 10204}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n){return new m(e,t,s,n)}execute(e,t,s,n){return e||(0,i.a)("null param is not allowed."),new m(null,t,s,n).generalize(e)}}class m extends r.G{constructor(e,t,s,n){super(),this.m_pline=null,this.m_point=new o.P,this.m_stack=[],this.m_resultstack=[],this.m_callCount=0,this.m_progressTracker=n,this.m_geoms=e,this.m_maxDeviation=t,this.m_bRemoveDegenerateParts=s}tock(){return!0}getRank(){return 1}next(){const e=this.m_geoms.next();return null===e?null:((0,i.d)(e),this.generalize(e))}getGeometryID(){return this.m_geoms.getGeometryID()}generalize(e){const t=e.getGeometryType();if((0,i.e)(t))return e;if(t===i.G.enumEnvelope){const t=new a.a({vd:e.getDescription()});return t.addEnvelope(e,!1),this.generalize(t)}if((0,i.f)(t)){const t=new a.P({vd:e.getDescription()});return t.addSegment(e,!0),this.generalize(t)}if((0,i.h)(t)||(0,i.t)(""),e.isEmpty()||this.m_maxDeviation<=0)return e;const s=(new u.O).execute(e,0,.05*this.m_maxDeviation,0,this.m_progressTracker);e.hasNonLinearSegments()&&(this.m_maxDeviation*=.95);const r=s,o=e.createInstance();o.getGeometryType()===i.G.enumPolygon&&o.setFillRule(e.getFillRule()),this.m_xy=r.getAttributeStreamRef(0);{const e={stack:[],error:void 0,hasError:!1};try{const t=new a.L;this.m_pline=t,(0,n.b)(e,(0,l.h)((()=>{this.m_pline=null}),!1),!1);for(let e=0,t=r.getPathCount();e<t;e++)this.generalizePath(r.getImpl(),e,o.getImpl())}catch(t){e.error=t,e.hasError=!0}finally{(0,n.c)(e)}}return this.m_resultstack.length=0,this.m_stack.length=0,o}generalizePath(e,t,s){if(e.getPathSize(t)<2)return;this.m_resultstack.length=0,this.m_stack.length=0;const n=e.getPathStart(t),r=e.getPathEnd(t)-1,i=e.isClosedPath(t),a=e.isClosedPathInXYPlane(t);let o=0,u=-1;this.m_stack.push(i?n:r),this.m_stack.push(n);let c=!1,m=!1;for(!this.m_bRemoveDegenerateParts&&a&&(c=!0,m=!0);this.m_stack.length>1;){const t=this.m_stack.at(-1);this.m_stack.pop();const s=this.m_stack.at(-1);let n=e.getXY(t);this.m_pline.setStartXY(n),n=e.getXY(s),this.m_pline.setEndXY(n);const i=[Number.NaN];let a=this.findGreatestDistance(t,s,r,i);a>=0&&(c?c=!1:(m&&i[0]>o&&(o=i[0],u=a),i[0]<=this.m_maxDeviation&&(a=-1))),a>=0?(this.m_stack.push(a),this.m_stack.push(t)):this.m_resultstack.push(t)}i||this.m_resultstack.push(this.m_stack[0]);const h=this.m_resultstack.length;if(h===e.getPathSize(t)&&h===this.m_stack.length)s.addPath(e,t,!0);else if(this.m_resultstack.length>0){if(this.m_bRemoveDegenerateParts&&this.m_resultstack.length<=2){if(i||1===this.m_resultstack.length)return;if(l.P.distance(e.getXY(this.m_resultstack[0]),e.getXY(this.m_resultstack[1]))<=this.m_maxDeviation)return}if(m&&u>=0&&o<=this.m_maxDeviation){const e=this.m_resultstack.at(-1)>u;this.m_resultstack.push(u),e&&(this.m_resultstack[this.m_resultstack.length-2]=(0,l.c)(this.m_resultstack[this.m_resultstack.length-1],this.m_resultstack[this.m_resultstack.length-1]=this.m_resultstack[this.m_resultstack.length-2]))}for(let t=0,n=this.m_resultstack.length;t<n;t++)e.getPointByVal(this.m_resultstack[t],this.m_point),0===t?s.startPathPoint(this.m_point):s.lineToPoint(this.m_point);if(i){for(let e=this.m_resultstack.length;e<3;e++)s.lineToPoint(this.m_point);s.closePathWithLine()}}}findGreatestDistance(e,t,s,n){let r=t-1;t<=e&&(r=s);let i=-1,a=0;const o=new l.P;for(let t=e+1;t<=r;t++){this.m_xy.queryPoint2D(2*t,o);const e=o.x,s=o.y,n=this.m_pline.getClosestCoordinate(o,!1);o.assign(this.m_pline.getCoord2D(n)),o.x-=e,o.y-=s;const r=o.length();r>a&&(i=t,a=r),this.m_callCount++}return n[0]=a,i}}},70787:(e,t,s)=>{s.d(t,{fz:()=>o,g7:()=>i,zo:()=>a});var n=s(76061);const r=new(s(64523).O);function i(e,t,s){return r.execute(e,t,s,null)}function a(e,t,s){const i=r.executeMany(new n.S(e),t,s,null);return Array.from(i)}function o(){return r.supportsCurves()}},76061:(e,t,s)=>{s.d(t,{G:()=>n,S:()=>r});class n{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class r extends n{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,s)=>{s.r(t),s.d(t,{fromExtent:()=>x,fromGeometry:()=>k,fromMultipoint:()=>P,fromPoint:()=>G,fromPolygon:()=>d,fromPolyline:()=>v,fromSpatialReference:()=>C,getSpatialReference:()=>y,toExtent:()=>M,toGeometry:()=>w,toMultipoint:()=>R,toPoint:()=>D,toPolygon:()=>V,toPolyline:()=>z});var n=s(83661),r=(s(79187),s(55537)),i=s(95213),a=s(35368),o=s(12189),l=s(5443),u=s(48526),c=s(86738),m=s(39829),h=s(82799),g=(s(90293),s(83299));const f="_gxVersion",p=2,_=1;function y(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function k(e){switch(e.type){case"point":return G(e);case"multipoint":return P(e);case"polyline":return v(e);case"polygon":return d(e);case"extent":return x(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function x(e){if(!e.getCacheValue(f)){const t=new i.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(p,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(_,0,e.zmin,e.zmax),e.setCacheValue(f,t)}return e.getCacheValue(f)}function P(e){if(!e.getCacheValue(f)){const t=new a.M,s=new i.P,n=e.points,r=e.hasM,o=e.hasZ,l=o?3:2;for(let e=0,i=n.length;e<i;e++){const i=n[e];s.setXYCoords(i[0],i[1]),o&&s.setZ(i[2]??0),r&&s.setM(i[l]??NaN),t.add(s)}e.setCacheValue(f,t)}return e.getCacheValue(f)}function G(e){if(!e.getCacheValue(f)){const t=new i.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(f,t)}return e.getCacheValue(f)}function d(e){if(!e.getCacheValue(f)){const{curveRings:t,hasM:s,hasZ:n,rings:r}=e,i=(0,g.fromGeometryToGXGeometry)({curveRings:t,hasM:s,hasZ:n,rings:r});e.setCacheValue(f,i)}return e.getCacheValue(f)}function v(e){if(!e.getCacheValue(f)){const{curvePaths:t,hasM:s,hasZ:n,paths:r}=e,i=(0,g.fromGeometryToGXGeometry)({curvePaths:t,hasM:s,hasZ:n,paths:r});e.setCacheValue(f,i)}return e.getCacheValue(f)}function C(e){if(e.wkid)return(0,o.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,o.a)(t):null}function w(e,t){if(e)switch(e.getGeometryType()){case r.G.enumPoint:return D(e,t);case r.G.enumEnvelope:return M(e,t);case r.G.enumMultiPoint:return R(e,t);case r.G.enumPolyline:return z(e,t);case r.G.enumPolygon:return V(e,t)}return null}function M(e,t){if(e.isEmpty())return null;const s=new l.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),n=e.getDescription();if(n.hasM()){const t=e.queryInterval(p,0);s.mmin=t.vmin,s.mmax=t.vmax}if(n.hasZ()){const t=e.queryInterval(_,0);s.zmin=t.vmin,s.zmax=t.vmax}return s.setCacheValue(f,e),s}function R(e,t){if(e.isEmpty())return null;const s=e.getDescription(),n=s.hasM(),r=s.hasZ(),a=[],o=new i.P;for(let t=0,s=e.getPointCount();t<s;t++){e.getPointByVal(t,o);const s=[o.getX(),o.getY()];r&&s.push(o.getZ()),n&&s.push(o.getM()),a.push(s)}const l=new u.A({hasM:n,hasZ:r,points:a,spatialReference:t});return l.setCacheValue(f,e),l}function D(e,t){if(e instanceof n.P)return new c.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const s=new c.A({x:e.getX(),y:e.getY(),spatialReference:t}),r=e.getDescription();return r.hasM()&&(s.m=e.getM()),r.hasZ()&&(s.z=e.getZ()),s.setCacheValue(f,e),s}function V(e,t){if(e.isEmpty())return null;const s=m.A.fromJSON({spatialReference:t,...(0,g.toGeometry)(e,null)});return s.setCacheValue(f,e),s}function z(e,t){if(e.isEmpty())return null;const s=h.A.fromJSON({spatialReference:t,...(0,g.toGeometry)(e,null)});return s.setCacheValue(f,e),s}},92523:(e,t,s)=>{s.d(t,{a:()=>l,e:()=>o,g:()=>c,s:()=>u});var n=s(4576),r=s(83047),i=s(70787),a=s(78125);function o(e,t,s={}){const{removeDegenerateParts:n=!1,unit:o}=s,l=(0,a.getSpatialReference)(e);return o&&(t=(0,r.UW)(t,o,l)),(0,a.toGeometry)((0,i.g7)((0,a.fromGeometry)(e),t,n),l)}function l(e,t,s={}){const{removeDegenerateParts:o=!1,unit:l}=s,u=e.map(a.fromGeometry),c=(0,a.getSpatialReference)(e);return l&&(t=(0,r.UW)(t,l,c)),(0,i.zo)(u,t,o).map((e=>(0,a.toGeometry)(e,c))).filter(n.Ru)}const u=(0,i.fz)(),c=Object.freeze(Object.defineProperty({__proto__:null,execute:o,executeMany:l,supportsCurves:u},Symbol.toStringTag,{value:"Module"}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4167,6061],{28879:(e,t,n)=>{n.r(t),n.d(t,{OperatorGeodeticLength:()=>m});var s=n(90237),o=n(55537),r=n(47591),a=n(35368),i=n(83661),c=n(12189),g=n(5247);class m{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n,s){if(4===n)return(new r.O).execute(e,t,s);if(0===t.getCoordinateSystemType()&&(0,o.a)(""),(0,o.d)(e),e.isEmpty()||e.getDimension()<1)return 0;const m=t.getGCS(),u=(0,c.J)();m.querySpheroidData(u);const l=u.majorSemiAxis,h=u.e2,y=m.getUnit().getUnitToBaseFactor();let x;const p=e.getGeometryType();if(p===o.G.enumPolygon?x=e.getBoundary():p===o.G.enumEnvelope?x=(0,a.c)(e):(0,o.f)(p)?(x=new a.P({vd:e.getDescription()}),x.addSegment(e,!0)):x=e,x.hasNonLinearSegments()&&(x=(new g.O).execute(x,0,t.getTolerance(0),0,s)),m!==t){const n=t.getSRToGCSTransform();if(t.isPannable()){x=(0,c.F)(x,t),p===o.G.enumPolyline&&x===e&&(x=e.clone());const n=new i.E;t.getPannableExtent().queryIntervalX(n);for(let e=0,t=x.getPointCount();e<t;e++){const t=x.getXY(e);t.x=(0,c.M)(t.x,n),x.setXY(e,t)}}const r=x.createInstance();x=(0,c.N)(n,x,r,s)?r:(new c.v).execute(x,n,s)}return this._ExecuteMultiPathGeodeticLength(x,n,l,h,y)}_ExecuteMultiPathGeodeticLength(e,t,n,o,r){const a={stack:[],error:void 0,hasError:!1};try{const i=(0,s.b)(a,new c.P,!1);let g=0;const m=e.querySegmentIterator();for(;m.nextPath();)for(;m.hasNextSegment();){const e=m.nextSegment(),s=e.getStartXY(),a=e.getEndXY();s.scale(r),a.scale(r),c.x.geodeticDistance(n,o,s.x,s.y,a.x,a.y,i,null,null,t),g+=i.val}return g}catch(e){a.error=e,a.hasError=!0}finally{(0,s.c)(a)}}}},47591:(e,t,n)=>{n.d(t,{O:()=>x});var s=n(55537),o=n(12189),r=n(35368),a=n(83661),i=n(95213),c=n(79187),g=n(5247),m=n(31139);function u(){return{m_pGcs:new a.P,m_xyz:new i.d,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:l,setLength:h,assign:y}}function l(e,t,n,s){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(s),this.m_geoLength=n}function h(e){this.m_geoLength=e}function y(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class x{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,s,r){if(e.hasNonLinearSegments()&&(e=(new g.O).execute(e,0,t.getTolerance(0),0,r)),t.isPannable()){let s=90,a=-90;if(1===n.getUnit().getUnitToBaseFactor()&&(s*=Math.PI/180,a*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=s,n[2]=0,n[3]=a,o.K.geogToProj(e,2,n),s=n[1],a=n[3]}const i=new c.Envelope2D;e.queryEnvelope(i),i.ymin=a,i.ymax=s,e=(new m.O).execute(e,i,t,r)}else{const n=t.getPCSHorizon();if((e=(new o.g).execute(e,n,t,r))===n){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,s,1,r)}_ExecuteIterativeApproach(e,t,n,r,c,g){const m=(0,o.J)();n.querySpheroidData(m);const l=m.majorSemiAxis,h=m.e2,y=n.getUnit().getUnitToBaseFactor(),x=(0,a.n)(u,40),_=(0,a.d)(40,Number.NaN),f=u(),G=u();let S;const P=[0,0,0,0],w=t.getPECoordSys(),C=new a.P,E=new a.P,v=new a.P,N=new a.P,T=new a.P;let L=0;const b=e.querySegmentIterator();for(;b.nextPath();)for(;b.hasNextSegment();){const e=b.nextSegment();C.assign(e.getStartXY()),E.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(P[0]=C.x,P[1]=C.y,P[2]=E.x,P[3]=E.y,o.K.projToGeog(w,2,P),v.x=P[0]*y,v.y=P[1]*y,N.x=P[2]*y,N.y=P[3]*y):(v.setCoordsPoint2D(C),N.setCoordsPoint2D(E),v.scale(y),N.scale(y));const n=new i.d,r=new i.d;p(l,h,v,n),p(l,h,N,r);let a=d(l,n,r);f.setValues(0,v,Number.NaN,n),G.setValues(1,N,a,r),S=c,x[0].assign(G),_[0]=c;let g=0;for(;;){g>128&&(0,s.c)("iterations exceeded");const n=.5*(f.m_factor+G.m_factor),r=e.getCoord2D(n);2===t.getCoordinateSystemType()?(P[0]=r.x,P[1]=r.y,o.K.projToGeog(w,1,P),T.x=P[0]*y,T.y=P[1]*y):(T.setCoordsPoint2D(r),T.scale(y)),v.setCoordsPoint2D(f.m_pGcs),N.setCoordsPoint2D(G.m_pGcs);const m=new i.d;p(l,h,T,m);const u=d(l,f.m_xyz,m),C=d(l,G.m_xyz,m);a=G.m_geoLength,Number.isNaN(a)&&(a=d(l,f.m_xyz,G.m_xyz));const E=u+C,b=S===c&&E>=20&&Math.abs(E-a)>1e-8*(a+E);if(g+2<40&&(b||Math.abs(E-a)>0&&S>0))G.setLength(C),x[g].assign(G),G.setValues(n,T,u,m),x[++g].assign(G),b?(S=c,_[g]=c):(S--,_[g-1]=S,_[g]=S);else{if(L+=E,0===g)break;f.assign(G),G.assign(x[--g]),S=_[g]}}}return L}execute(e,t,n){if(t&&0!==t.getCoordinateSystemType()||(0,s.a)(""),e.isEmpty()||e.getDimension()<1)return 0;let a=null;const i=t.getGCS();i!==t&&(a=(0,o.w)(t,i,null));const c=e.getGeometryType();if(c===s.G.enumEnvelope){const s=new r.a;return s.addEnvelope(e,!1),this._ExecuteShapePreservingLength(s,t,i,a,n)}if((0,s.f)(c)){const s=new r.P;return s.addSegment(e,!0),this._ExecuteShapePreservingLength(s,t,i,a,n)}return this._ExecuteShapePreservingLength(e,t,i,a,n)}}function p(e,t,n,s){s.assign((0,o.y)(e,t,n))}function d(e,t,n){const s=e,o=new i.d;o.setSub(t,n);const r=o.length();return 2*s*Math.asin(r/(2*s))}},76061:(e,t,n)=>{n.d(t,{G:()=>s,S:()=>o});class s{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class o extends s{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8125],{78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>M,fromGeometry:()=>x,fromMultipoint:()=>V,fromPoint:()=>w,fromPolygon:()=>P,fromPolyline:()=>G,fromSpatialReference:()=>Z,getSpatialReference:()=>C,toExtent:()=>R,toGeometry:()=>v,toMultipoint:()=>d,toPoint:()=>E,toPolygon:()=>k,toPolyline:()=>A});var r=n(83661),a=(n(79187),n(55537)),s=n(95213),o=n(35368),u=n(12189),i=n(5443),c=n(48526),l=n(86738),m=n(39829),f=n(82799),h=(n(90293),n(83299));const p="_gxVersion",g=2,y=1;function C(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return w(e);case"multipoint":return V(e);case"polyline":return G(e);case"polygon":return P(e);case"extent":return M(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function M(e){if(!e.getCacheValue(p)){const t=new s.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new o.M,n=new s.P,r=e.points,a=e.hasM,u=e.hasZ,i=u?3:2;for(let e=0,s=r.length;e<s;e++){const s=r[e];n.setXYCoords(s[0],s[1]),u&&n.setZ(s[2]??0),a&&n.setM(s[i]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function w(e){if(!e.getCacheValue(p)){const t=new s.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function P(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,s=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function G(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,s=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function Z(e){if(e.wkid)return(0,u.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,u.
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8125],{78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>M,fromGeometry:()=>x,fromMultipoint:()=>V,fromPoint:()=>w,fromPolygon:()=>P,fromPolyline:()=>G,fromSpatialReference:()=>Z,getSpatialReference:()=>C,toExtent:()=>R,toGeometry:()=>v,toMultipoint:()=>d,toPoint:()=>E,toPolygon:()=>k,toPolyline:()=>A});var r=n(83661),a=(n(79187),n(55537)),s=n(95213),o=n(35368),u=n(12189),i=n(5443),c=n(48526),l=n(86738),m=n(39829),f=n(82799),h=(n(90293),n(83299));const p="_gxVersion",g=2,y=1;function C(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return w(e);case"multipoint":return V(e);case"polyline":return G(e);case"polygon":return P(e);case"extent":return M(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function M(e){if(!e.getCacheValue(p)){const t=new s.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new o.M,n=new s.P,r=e.points,a=e.hasM,u=e.hasZ,i=u?3:2;for(let e=0,s=r.length;e<s;e++){const s=r[e];n.setXYCoords(s[0],s[1]),u&&n.setZ(s[2]??0),a&&n.setM(s[i]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function w(e){if(!e.getCacheValue(p)){const t=new s.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function P(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,s=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function G(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,s=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function Z(e){if(e.wkid)return(0,u.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,u.a)(t):null}function v(e,t){if(e)switch(e.getGeometryType()){case a.G.enumPoint:return E(e,t);case a.G.enumEnvelope:return R(e,t);case a.G.enumMultiPoint:return d(e,t);case a.G.enumPolyline:return A(e,t);case a.G.enumPolygon:return k(e,t)}return null}function R(e,t){if(e.isEmpty())return null;const n=new i.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(g,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function d(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),a=n.hasZ(),o=[],u=new s.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,u);const n=[u.getX(),u.getY()];a&&n.push(u.getZ()),r&&n.push(u.getM()),o.push(n)}const i=new c.A({hasM:r,hasZ:a,points:o,spatialReference:t});return i.setCacheValue(p,e),i}function E(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),a=e.getDescription();return a.hasM()&&(n.m=e.getM()),a.hasZ()&&(n.z=e.getZ()),n.setCacheValue(p,e),n}function k(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}function A(e,t){if(e.isEmpty())return null;const n=f.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6061,9700],{29821:(e,t,r)=>{r.d(t,{O:()=>n});var s=r(12189);class n extends s.
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6061,9700],{29821:(e,t,r)=>{r.d(t,{O:()=>n});var s=r(12189);class n extends s.e{getOperatorType(){return 6}execute(e,t,r,n){return(0,s.r)(e,t,r,16,n)}}},76061:(e,t,r)=>{r.d(t,{G:()=>s,S:()=>n});class s{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class n extends s{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},85672:(e,t,r)=>{r.r(t),r.d(t,{execute:()=>m});var s=r(29821),n=r(83299);const o=new s.O;function m(e,t){const r=(0,n.fromGeometry)(e);return o.execute(r.getGeometry(),(0,n.fromGeometryToGXGeometry)(t),r.getSpatialReference(),null)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,6061,6468,8125],{36633:(e,t,n)=>{n.d(t,{O:()=>g});var r=n(55537),s=n(79187),o=n(83661),i=n(12189);function a(){return u(new o.P,-1,Number.NaN)}function u(e,t,n){return{m_coordinate:e.clone(),m_vertexIndex:t,m_geometryIndex:0,m_distance:n,m_bRightSide:!1,isEmpty:c}}function c(){return Number.isNaN(this.m_distance)}function m(e,t,n=-1,a=-1){if(e.isEmpty())return 3;const u=e.getGeometryType();if((0,r.f)(u))return function(e,t,n,s){if(n>=0||s>=0)return(0,r.t)("");if(e.isDegenerate(0))return e.getStartXY().equals(t)?2:3;if(!e.isCurve()){const n=o.P.orientationRobust(t,e.getStartXY(),e.getEndXY());return n<0?1:n>0?0:2}const i=e.getClosestCoordinate(t,!1),a=e.getTangent(i),u=e.getCoord2D(i),c=o.P.orientationRobust(t,u,u.add(a));return c<0?1:c>0?0:2}(e,t,n,a);if(u===r.G.enumPolygon)return function(e,t,n,o){(n>=0||o>=0)&&(0,r.t)("");const a=new s.Envelope2D;e.queryEnvelope(a);const u=(0,i.i)(e,t,0);return 0===u?0:1===u?1:2}(e,t,n,a);if(u===r.G.enumPolyline)return function(e,t,n,s){(n<0&&s>=0||n>=0&&s<0)&&(0,r.t)("");const i=e.querySegmentIterator();if(n<0){let e=Number.MAX_VALUE,r=0;for(;i.nextPath();)for(;i.hasNextSegment();){const a=i.nextSegment(),u=a.getClosestCoordinate(t,!1),c=a.getCoord2D(u),m=o.P.sqrDistance(c,t);m<e?(r=1,n=i.getStartPointIndex(),s=i.getPathIndex(),e=m):m===e&&r++}if(0===r)return 3;if(1===r)return i.resetToVertex(n,s),m(i.nextSegment(),t)}const a=function(e,t,n,r){const s={i1:-1,i2:-1,bRight1:!1,bRight2:!1};if(s.i1=function(e,t,n){for(e.resetToVertex(t,n);e.hasNextSegment();)if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex();for(e.resetToVertex(t,n);e.hasPreviousSegment();)if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,n,r),-1!==s.i1){t.resetToVertex(s.i1,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r),a=o.P.sqrDistance(i,e);{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight1=t.crossProduct(r)<0}if(s.i2=function(e,t){for(e.resetToVertex(t,-1),e.nextSegment();e.hasNextSegment();)if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,s.i1),-1!==s.i2){t.resetToVertex(s.i2,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r);if(o.P.sqrDistance(i,e)>a)s.i2=-1;else{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight2=t.crossProduct(r)<0}}if(-1===s.i2&&(s.i2=function(e,t){for(e.resetToVertex(t,-1);e.hasPreviousSegment();)if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,s.i1),-1!==s.i2)){t.resetToVertex(s.i2,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r);if(o.P.sqrDistance(i,e)>a)s.i2=-1;else{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight2=t.crossProduct(r)<0;const o=s.i1;s.i1=s.i2,s.i2=o;const a=s.bRight1;s.bRight1=s.bRight2,s.bRight2=a}}}return s}(t,i,n,s);if(-1!==a.i1&&-1===a.i2)return a.bRight1?1:0;if(-1!==a.i1&&-1!==a.i2){if(a.bRight1===a.bRight2)return a.bRight1?1:0;{i.resetToVertex(a.i1,-1);const e=i.nextSegment().getTangent(1);i.resetToVertex(a.i2,-1);const t=i.nextSegment().getTangent(0);return e.crossProduct(t)>=0?1:0}}return i.resetToVertex(n,s),m(i.nextSegment(),t)}(e,t,n,a);if(u===r.G.enumEnvelope){const n=new s.Envelope2D;return e.queryEnvelope(n),n.contains(t)?n.containsExclusive(t)?1:2:0}return 3}var l=n(95213);class g{getOperatorType(){return 10500}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}getNearestCoordinate(e,t,n,s){if(t.isNAN()&&(0,r.t)("NAN xy coordinates are not allowed"),e.isEmpty())return a();switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertex(e,t);case r.G.enumMultiPoint:return this.multiVertexGetNearestVertex(e,t);case r.G.enumPolyline:case r.G.enumPolygon:return this.multiPathGetNearestCoordinate(e,t,n,s);default:(0,r.b)("")}}getNearestVertex(e,t){if(t.isNAN()&&(0,r.t)("NAN xy coordinates are not allowed"),e.isEmpty())return a();switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertex(e,t);case r.G.enumMultiPoint:case r.G.enumPolyline:case r.G.enumPolygon:return this.multiVertexGetNearestVertex(e,t);default:(0,r.b)("")}}getNearestVertices(e,t,n,s){if(0===s&&(0,r.t)(""),t.isNAN()&&(0,r.t)("NAN xy coordinates are not allowed"),e.isEmpty())return[];switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertices(e,t,n,s);case r.G.enumMultiPoint:case r.G.enumPolyline:case r.G.enumPolygon:return this.multiVertexGetNearestVertices(e,t,n,s);default:(0,r.b)("")}}multiPathGetNearestCoordinate(e,t,n,a){if(e.getGeometryType()===r.G.enumPolygon&&n){const n=new s.Envelope2D;e.queryEnvelope(n);const r=(0,l.c)(null,n,!1);let o;if(o=(0,i.i)(e,t,a?0:r),0!==o){const e=u(t,-1,0);return a&&(e.m_bRightSide=!0),e}}const c=e.querySegmentIterator(),g=new o.P;let f=-1,h=-1,x=Number.MAX_VALUE,d=0;for(;c.nextPath();)for(;c.hasNextSegment();){const e=c.nextSegment(),n=e.getClosestCoordinate(t,!1),r=e.getCoord2D(n),s=o.P.sqrDistance(r,t);s<x?(d=1,g.assign(r),f=c.getStartPointIndex(),h=c.getPathIndex(),x=s):s===x&&d++}-1===f&&(0,r.t)("");const y=u(g,f,Math.sqrt(x));if(a)if(e.getGeometryType()!==r.G.enumPolygon){let n=!1;if(d>1){const r=m(e,t,f,h);n=0!==r&&3!==r}else c.resetToVertex(f,h),n=0!==m(c.nextSegment(),t);y.m_bRightSide=n}else n||0!==(0,i.i)(e,t,0)&&(y.m_bRightSide=!0);return y}pointGetNearestVertex(e,t){const n=e.getXY();return u(n,0,o.P.distance(n,t))}multiVertexGetNearestVertex(e,t){const n=e.getAttributeStreamRef(0),r=e.getPointCount();let s=-1;const i=new o.P;let a=Number.MAX_VALUE;const c=new o.P;for(let e=0;e<r;e++){n.queryPoint2D(2*e,c);const r=o.P.sqrDistance(c,t);r<a&&(i.assign(c),s=e,a=r)}return u(i,s,Math.sqrt(a))}pointGetNearestVertices(e,t,n,r){const s=[];if(0!==r){const r=n*n,i=e.getXY(),a=o.P.sqrDistance(i,t);a<=r&&s.push(u(i,0,Math.sqrt(a)))}return s}multiVertexGetNearestVertices(e,t,n,r){const s=[];if(0!==r){const i=e.getAttributeStreamRef(0),a=e.getPointCount();s.length=r+1;const c=n*n;for(let e=0;e<a;e++){const n=i.read(2*e),r=i.read(2*e+1),a=t.x-n,m=t.y-r,l=a*a+m*m;l<=c&&s.push(u(o.P.construct(n,r),e,Math.sqrt(l)))}s.sort(((e,t)=>e.m_distance-t.m_distance))}return s.slice(0,r)}}},48032:(e,t,n)=>{n.r(t),n.d(t,{getNearestCoordinate:()=>r.g,getNearestVertex:()=>r.a,getNearestVertices:()=>r.b,supportsCurves:()=>r.s}),n(36633),n(83047),n(78125),n(79533);var r=n(59260)},59260:(e,t,n)=>{n.d(t,{a:()=>c,b:()=>m,g:()=>u,p:()=>g,s:()=>l});var r=n(36633),s=n(83047),o=n(78125),i=n(79533);const a=new r.O;function u(e,t,n={}){const{calculateLeftRightSide:r=!1,testPolygonInterior:u=!0,unit:c}=n,m=a.getNearestCoordinate((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY(),u,r);if(c&&m.m_distance){const t=(0,o.getSpatialReference)(e);m.m_distance=(0,s.PQ)(m.m_distance,t,c)}return(0,i.C)(m,e,r)}function c(e,t,n={}){const{unit:r}=n,u=a.getNearestVertex((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY());if(r&&u.m_distance){const t=(0,o.getSpatialReference)(e);u.m_distance=(0,s.PQ)(u.m_distance,t,r)}return(0,i.C)(u,e)}function m(e,t,n,r,u={}){const{unit:c}=u,m=(0,o.getSpatialReference)(e);return c&&n&&(n=(0,s.UW)(n,c,m)),a.getNearestVertices((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY(),n,r).map((t=>(c&&t.m_distance&&(t.m_distance=(0,s.PQ)(t.m_distance,m,c)),(0,i.C)(t,e))))}const l=a.supportsCurves(),g=Object.freeze(Object.defineProperty({__proto__:null,getNearestCoordinate:u,getNearestVertex:c,getNearestVertices:m,supportsCurves:l},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>s});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class s extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>P,fromGeometry:()=>p,fromMultipoint:()=>G,fromPoint:()=>C,fromPolygon:()=>V,fromPolyline:()=>S,fromSpatialReference:()=>N,getSpatialReference:()=>y,toExtent:()=>R,toGeometry:()=>b,toMultipoint:()=>_,toPoint:()=>v,toPolygon:()=>M,toPolyline:()=>w});var r=n(83661),s=(n(79187),n(55537)),o=n(95213),i=n(35368),a=n(12189),u=n(5443),c=n(48526),m=n(86738),l=n(39829),g=n(82799),f=(n(90293),n(83299));const h="_gxVersion",x=2,d=1;function y(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function p(e){switch(e.type){case"point":return C(e);case"multipoint":return G(e);case"polyline":return S(e);case"polygon":return V(e);case"extent":return P(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function P(e){if(!e.getCacheValue(h)){const t=new o.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(x,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(d,0,e.zmin,e.zmax),e.setCacheValue(h,t)}return e.getCacheValue(h)}function G(e){if(!e.getCacheValue(h)){const t=new i.M,n=new o.P,r=e.points,s=e.hasM,a=e.hasZ,u=a?3:2;for(let e=0,o=r.length;e<o;e++){const o=r[e];n.setXYCoords(o[0],o[1]),a&&n.setZ(o[2]??0),s&&n.setM(o[u]??NaN),t.add(n)}e.setCacheValue(h,t)}return e.getCacheValue(h)}function C(e){if(!e.getCacheValue(h)){const t=new o.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(h,t)}return e.getCacheValue(h)}function V(e){if(!e.getCacheValue(h)){const{curveRings:t,hasM:n,hasZ:r,rings:s}=e,o=(0,f.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:s});e.setCacheValue(h,o)}return e.getCacheValue(h)}function S(e){if(!e.getCacheValue(h)){const{curvePaths:t,hasM:n,hasZ:r,paths:s}=e,o=(0,f.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:s});e.setCacheValue(h,o)}return e.getCacheValue(h)}function N(e){if(e.wkid)return(0,a.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,a.b)(t):null}function b(e,t){if(e)switch(e.getGeometryType()){case s.G.enumPoint:return v(e,t);case s.G.enumEnvelope:return R(e,t);case s.G.enumMultiPoint:return _(e,t);case s.G.enumPolyline:return w(e,t);case s.G.enumPolygon:return M(e,t)}return null}function R(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(x,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(d,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(h,e),n}function _(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),s=n.hasZ(),i=[],a=new o.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,a);const n=[a.getX(),a.getY()];s&&n.push(a.getZ()),r&&n.push(a.getM()),i.push(n)}const u=new c.A({hasM:r,hasZ:s,points:i,spatialReference:t});return u.setCacheValue(h,e),u}function v(e,t){if(e instanceof r.P)return new m.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new m.A({x:e.getX(),y:e.getY(),spatialReference:t}),s=e.getDescription();return s.hasM()&&(n.m=e.getM()),s.hasZ()&&(n.z=e.getZ()),n.setCacheValue(h,e),n}function M(e,t){if(e.isEmpty())return null;const n=l.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(h,e),n}function w(e,t){if(e.isEmpty())return null;const n=g.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(h,e),n}},79533:(e,t,n)=>{n.d(t,{C:()=>s});var r=n(78125);function s(e,t,n=!1){const s=(0,r.toPoint)(e.m_coordinate,(0,r.getSpatialReference)(t)),o=e.m_distance,i=e.isEmpty(),a=e.m_bRightSide;return{coordinate:s,distance:o,isEmpty:i,...n&&{isRightSide:a},vertexIndex:e.m_vertexIndex}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,6061,6468,8125],{36633:(e,t,n)=>{n.d(t,{O:()=>g});var r=n(55537),s=n(79187),o=n(83661),i=n(12189);function a(){return u(new o.P,-1,Number.NaN)}function u(e,t,n){return{m_coordinate:e.clone(),m_vertexIndex:t,m_geometryIndex:0,m_distance:n,m_bRightSide:!1,isEmpty:c}}function c(){return Number.isNaN(this.m_distance)}function m(e,t,n=-1,a=-1){if(e.isEmpty())return 3;const u=e.getGeometryType();if((0,r.f)(u))return function(e,t,n,s){if(n>=0||s>=0)return(0,r.a)("");if(e.isDegenerate(0))return e.getStartXY().equals(t)?2:3;if(!e.isCurve()){const n=o.P.orientationRobust(t,e.getStartXY(),e.getEndXY());return n<0?1:n>0?0:2}const i=e.getClosestCoordinate(t,!1),a=e.getTangent(i),u=e.getCoord2D(i),c=o.P.orientationRobust(t,u,u.add(a));return c<0?1:c>0?0:2}(e,t,n,a);if(u===r.G.enumPolygon)return function(e,t,n,o){(n>=0||o>=0)&&(0,r.a)("");const a=new s.Envelope2D;e.queryEnvelope(a);const u=(0,i.h)(e,t,0);return 0===u?0:1===u?1:2}(e,t,n,a);if(u===r.G.enumPolyline)return function(e,t,n,s){(n<0&&s>=0||n>=0&&s<0)&&(0,r.a)("");const i=e.querySegmentIterator();if(n<0){let e=Number.MAX_VALUE,r=0;for(;i.nextPath();)for(;i.hasNextSegment();){const a=i.nextSegment(),u=a.getClosestCoordinate(t,!1),c=a.getCoord2D(u),m=o.P.sqrDistance(c,t);m<e?(r=1,n=i.getStartPointIndex(),s=i.getPathIndex(),e=m):m===e&&r++}if(0===r)return 3;if(1===r)return i.resetToVertex(n,s),m(i.nextSegment(),t)}const a=function(e,t,n,r){const s={i1:-1,i2:-1,bRight1:!1,bRight2:!1};if(s.i1=function(e,t,n){for(e.resetToVertex(t,n);e.hasNextSegment();)if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex();for(e.resetToVertex(t,n);e.hasPreviousSegment();)if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,n,r),-1!==s.i1){t.resetToVertex(s.i1,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r),a=o.P.sqrDistance(i,e);{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight1=t.crossProduct(r)<0}if(s.i2=function(e,t){for(e.resetToVertex(t,-1),e.nextSegment();e.hasNextSegment();)if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,s.i1),-1!==s.i2){t.resetToVertex(s.i2,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r);if(o.P.sqrDistance(i,e)>a)s.i2=-1;else{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight2=t.crossProduct(r)<0}}if(-1===s.i2&&(s.i2=function(e,t){for(e.resetToVertex(t,-1);e.hasPreviousSegment();)if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex();return-1}(t,s.i1),-1!==s.i2)){t.resetToVertex(s.i2,-1);const n=t.nextSegment(),r=n.getClosestCoordinate(e,!1),i=n.getCoord2D(r);if(o.P.sqrDistance(i,e)>a)s.i2=-1;else{const t=i.clone();t.subThis(n.getStartXY());const r=e.clone();r.subThis(n.getStartXY()),s.bRight2=t.crossProduct(r)<0;const o=s.i1;s.i1=s.i2,s.i2=o;const a=s.bRight1;s.bRight1=s.bRight2,s.bRight2=a}}}return s}(t,i,n,s);if(-1!==a.i1&&-1===a.i2)return a.bRight1?1:0;if(-1!==a.i1&&-1!==a.i2){if(a.bRight1===a.bRight2)return a.bRight1?1:0;{i.resetToVertex(a.i1,-1);const e=i.nextSegment().getTangent(1);i.resetToVertex(a.i2,-1);const t=i.nextSegment().getTangent(0);return e.crossProduct(t)>=0?1:0}}return i.resetToVertex(n,s),m(i.nextSegment(),t)}(e,t,n,a);if(u===r.G.enumEnvelope){const n=new s.Envelope2D;return e.queryEnvelope(n),n.contains(t)?n.containsExclusive(t)?1:2:0}return 3}var l=n(95213);class g{getOperatorType(){return 10500}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}getNearestCoordinate(e,t,n,s){if(t.isNAN()&&(0,r.a)("NAN xy coordinates are not allowed"),e.isEmpty())return a();switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertex(e,t);case r.G.enumMultiPoint:return this.multiVertexGetNearestVertex(e,t);case r.G.enumPolyline:case r.G.enumPolygon:return this.multiPathGetNearestCoordinate(e,t,n,s);default:(0,r.t)("")}}getNearestVertex(e,t){if(t.isNAN()&&(0,r.a)("NAN xy coordinates are not allowed"),e.isEmpty())return a();switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertex(e,t);case r.G.enumMultiPoint:case r.G.enumPolyline:case r.G.enumPolygon:return this.multiVertexGetNearestVertex(e,t);default:(0,r.t)("")}}getNearestVertices(e,t,n,s){if(0===s&&(0,r.a)(""),t.isNAN()&&(0,r.a)("NAN xy coordinates are not allowed"),e.isEmpty())return[];switch(e.getGeometryType()){case r.G.enumPoint:return this.pointGetNearestVertices(e,t,n,s);case r.G.enumMultiPoint:case r.G.enumPolyline:case r.G.enumPolygon:return this.multiVertexGetNearestVertices(e,t,n,s);default:(0,r.t)("")}}multiPathGetNearestCoordinate(e,t,n,a){if(e.getGeometryType()===r.G.enumPolygon&&n){const n=new s.Envelope2D;e.queryEnvelope(n);const r=(0,l.a)(null,n,!1);let o;if(o=(0,i.h)(e,t,a?0:r),0!==o){const e=u(t,-1,0);return a&&(e.m_bRightSide=!0),e}}const c=e.querySegmentIterator(),g=new o.P;let f=-1,h=-1,x=Number.MAX_VALUE,d=0;for(;c.nextPath();)for(;c.hasNextSegment();){const e=c.nextSegment(),n=e.getClosestCoordinate(t,!1),r=e.getCoord2D(n),s=o.P.sqrDistance(r,t);s<x?(d=1,g.assign(r),f=c.getStartPointIndex(),h=c.getPathIndex(),x=s):s===x&&d++}-1===f&&(0,r.a)("");const y=u(g,f,Math.sqrt(x));if(a)if(e.getGeometryType()!==r.G.enumPolygon){let n=!1;if(d>1){const r=m(e,t,f,h);n=0!==r&&3!==r}else c.resetToVertex(f,h),n=0!==m(c.nextSegment(),t);y.m_bRightSide=n}else n||0!==(0,i.h)(e,t,0)&&(y.m_bRightSide=!0);return y}pointGetNearestVertex(e,t){const n=e.getXY();return u(n,0,o.P.distance(n,t))}multiVertexGetNearestVertex(e,t){const n=e.getAttributeStreamRef(0),r=e.getPointCount();let s=-1;const i=new o.P;let a=Number.MAX_VALUE;const c=new o.P;for(let e=0;e<r;e++){n.queryPoint2D(2*e,c);const r=o.P.sqrDistance(c,t);r<a&&(i.assign(c),s=e,a=r)}return u(i,s,Math.sqrt(a))}pointGetNearestVertices(e,t,n,r){const s=[];if(0!==r){const r=n*n,i=e.getXY(),a=o.P.sqrDistance(i,t);a<=r&&s.push(u(i,0,Math.sqrt(a)))}return s}multiVertexGetNearestVertices(e,t,n,r){const s=[];if(0!==r){const i=e.getAttributeStreamRef(0),a=e.getPointCount();s.length=r+1;const c=n*n;for(let e=0;e<a;e++){const n=i.read(2*e),r=i.read(2*e+1),a=t.x-n,m=t.y-r,l=a*a+m*m;l<=c&&s.push(u(o.P.construct(n,r),e,Math.sqrt(l)))}s.sort(((e,t)=>e.m_distance-t.m_distance))}return s.slice(0,r)}}},48032:(e,t,n)=>{n.r(t),n.d(t,{getNearestCoordinate:()=>r.g,getNearestVertex:()=>r.a,getNearestVertices:()=>r.b,supportsCurves:()=>r.s}),n(36633),n(83047),n(78125),n(79533);var r=n(59260)},59260:(e,t,n)=>{n.d(t,{a:()=>c,b:()=>m,g:()=>u,p:()=>g,s:()=>l});var r=n(36633),s=n(83047),o=n(78125),i=n(79533);const a=new r.O;function u(e,t,n={}){const{calculateLeftRightSide:r=!1,testPolygonInterior:u=!0,unit:c}=n,m=a.getNearestCoordinate((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY(),u,r);if(c&&m.m_distance){const t=(0,o.getSpatialReference)(e);m.m_distance=(0,s.PQ)(m.m_distance,t,c)}return(0,i.C)(m,e,r)}function c(e,t,n={}){const{unit:r}=n,u=a.getNearestVertex((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY());if(r&&u.m_distance){const t=(0,o.getSpatialReference)(e);u.m_distance=(0,s.PQ)(u.m_distance,t,r)}return(0,i.C)(u,e)}function m(e,t,n,r,u={}){const{unit:c}=u,m=(0,o.getSpatialReference)(e);return c&&n&&(n=(0,s.UW)(n,c,m)),a.getNearestVertices((0,o.fromGeometry)(e),(0,o.fromPoint)(t).getXY(),n,r).map((t=>(c&&t.m_distance&&(t.m_distance=(0,s.PQ)(t.m_distance,m,c)),(0,i.C)(t,e))))}const l=a.supportsCurves(),g=Object.freeze(Object.defineProperty({__proto__:null,getNearestCoordinate:u,getNearestVertex:c,getNearestVertices:m,supportsCurves:l},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>s});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class s extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>P,fromGeometry:()=>p,fromMultipoint:()=>G,fromPoint:()=>C,fromPolygon:()=>V,fromPolyline:()=>S,fromSpatialReference:()=>N,getSpatialReference:()=>y,toExtent:()=>b,toGeometry:()=>R,toMultipoint:()=>_,toPoint:()=>v,toPolygon:()=>M,toPolyline:()=>w});var r=n(83661),s=(n(79187),n(55537)),o=n(95213),i=n(35368),a=n(12189),u=n(5443),c=n(48526),m=n(86738),l=n(39829),g=n(82799),f=(n(90293),n(83299));const h="_gxVersion",x=2,d=1;function y(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function p(e){switch(e.type){case"point":return C(e);case"multipoint":return G(e);case"polyline":return S(e);case"polygon":return V(e);case"extent":return P(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function P(e){if(!e.getCacheValue(h)){const t=new o.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(x,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(d,0,e.zmin,e.zmax),e.setCacheValue(h,t)}return e.getCacheValue(h)}function G(e){if(!e.getCacheValue(h)){const t=new i.M,n=new o.P,r=e.points,s=e.hasM,a=e.hasZ,u=a?3:2;for(let e=0,o=r.length;e<o;e++){const o=r[e];n.setXYCoords(o[0],o[1]),a&&n.setZ(o[2]??0),s&&n.setM(o[u]??NaN),t.add(n)}e.setCacheValue(h,t)}return e.getCacheValue(h)}function C(e){if(!e.getCacheValue(h)){const t=new o.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(h,t)}return e.getCacheValue(h)}function V(e){if(!e.getCacheValue(h)){const{curveRings:t,hasM:n,hasZ:r,rings:s}=e,o=(0,f.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:s});e.setCacheValue(h,o)}return e.getCacheValue(h)}function S(e){if(!e.getCacheValue(h)){const{curvePaths:t,hasM:n,hasZ:r,paths:s}=e,o=(0,f.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:s});e.setCacheValue(h,o)}return e.getCacheValue(h)}function N(e){if(e.wkid)return(0,a.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,a.a)(t):null}function R(e,t){if(e)switch(e.getGeometryType()){case s.G.enumPoint:return v(e,t);case s.G.enumEnvelope:return b(e,t);case s.G.enumMultiPoint:return _(e,t);case s.G.enumPolyline:return w(e,t);case s.G.enumPolygon:return M(e,t)}return null}function b(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(x,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(d,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(h,e),n}function _(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),s=n.hasZ(),i=[],a=new o.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,a);const n=[a.getX(),a.getY()];s&&n.push(a.getZ()),r&&n.push(a.getM()),i.push(n)}const u=new c.A({hasM:r,hasZ:s,points:i,spatialReference:t});return u.setCacheValue(h,e),u}function v(e,t){if(e instanceof r.P)return new m.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new m.A({x:e.getX(),y:e.getY(),spatialReference:t}),s=e.getDescription();return s.hasM()&&(n.m=e.getM()),s.hasZ()&&(n.z=e.getZ()),n.setCacheValue(h,e),n}function M(e,t){if(e.isEmpty())return null;const n=l.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(h,e),n}function w(e,t){if(e.isEmpty())return null;const n=g.A.fromJSON({spatialReference:t,...(0,f.toGeometry)(e,null)});return n.setCacheValue(h,e),n}},79533:(e,t,n)=>{n.d(t,{C:()=>s});var r=n(78125);function s(e,t,n=!1){const s=(0,r.toPoint)(e.m_coordinate,(0,r.getSpatialReference)(t)),o=e.m_distance,i=e.isEmpty(),a=e.m_bRightSide;return{coordinate:s,distance:o,isEmpty:i,...n&&{isRightSide:a},vertexIndex:e.m_vertexIndex}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1878],{11878:(t,s,i)=>{i.d(s,{T:()=>a});var o=i(55537),e=i(83661);class h{constructor(t,s,i){if(t instanceof h)return this.data=t.data,this.N=t.N,this.M=t.M,t.data=null,t.N=0,void(t.M=0);this.data=t,this.N=s,this.M=i}assignCopy(t){return this===t||((0,o.g)(this.N*this.M==t.N*t.M),this.data.set(t.data),this.N=t.N,this.M=t.M),this}setZero(){return this.data?.fill(0),this}setIdentity(){for(let t=0;t<this.N;t++)for(let s=0;s<this.M;s++)this.setRowCol(t,s,t===s?1:0);return this}rows(){return this.N}cols(){return this.M}row(t){return(0,o.g)(0),{}}set(t,s){return this.data[t]=s,this}setRowCol(t,s,i){return this.data[t*this.M+s]=i,this}at(t){return this.data[t]}atRowCol(t,s){return this.data[t*this.M+s]}mulScalar(t,s){(0,o.g)(0)}mul(t,s){if((0,o.g)(this.M===t.rows()),(0,o.g)(this.N===s.rows()),(0,o.g)(t.cols()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mul(t,o),void s.assignCopy(o)}if(s===t){const i=new Float64Array(t.N*t.M),o=new h(i,t.N,t.M);return this.mul(t,o),void s.assignCopy(o)}const i=t.cols();for(let o=0;o<this.N;o++)for(let e=0;e<i;e++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(o,s)*t.atRowCol(s,e);s.setRowCol(o,e,i)}}mulTranspose(t,s){if((0,o.g)(this.M===t.cols()),(0,o.g)(this.N===s.rows()),(0,o.g)(t.rows()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mulTranspose(t,o),void s.assignCopy(o)}if(s===t){const i=new Float64Array(t.N*t.M),o=new h(i,t.N,t.M);return this.mulTranspose(t,o),void s.assignCopy(o)}const i=t.rows();for(let o=0;o<this.N;o++)for(let e=0;e<i;e++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(o,s)*t.atRowCol(e,s);s.setRowCol(o,e,i)}}mulLeft(t,s){(0,o.g)(0)}mulLeftTranspose(t,s){(0,o.g)(0)}mulDiag(t,s){if((0,o.g)(this.M===t.N*t.M),(0,o.g)(this.N===s.rows()),(0,o.g)(this.M===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mulDiag(t,o),void s.assignCopy(o)}const i=this.M;for(let o=0;o<this.N;o++)for(let e=0;e<i;e++)s.setRowCol(o,e,this.atRowCol(o,e)*t.at(e))}transposeInPlace(){if(this.N===this.M){for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++){const i=this.atRowCol(t,s);this.setRowCol(t,s,this.atRowCol(s,t)),this.setRowCol(s,t,i)}return this}const t=new Float64Array(this.N*this.M),s=new h(t,this.N,this.M);return s.assignCopy(this),this.M=(0,e.b)(this.N,this.N=this.M),s.transpose(this),this}transpose(t){if(this!==t){h.checkDims(t,this.M,this.N);for(let s=0;s<this.N;s++)for(let i=0;i<this.M;i++)t.setRowCol(i,s,this.atRowCol(s,i))}else t.transposeInPlace()}add(t,s){}svd(t,s,i,e=!1){if(h.checkDims(t,this.N,this.M),h.checkDims(s,this.M,1),h.checkDims(i,this.M,this.M),e){if((0,o.g)(this.N===this.M),!this.symmetricEigen(s,i))return!1;for(let t=0;t<this.M;++t)s.at(t)<0&&s.set(t,0);return t.assignCopy(i),!0}let r,a,l,y,n,x,w,u=0,C=0,f=0,R=0,d=0;const c=this.M,M=this.N;t.assignCopy(this);const m=new Float64Array(c),N=new h(m,c,1),g=(t,s)=>s>=0?Math.abs(t):-Math.abs(t),b=(t,s)=>{if((t=Math.abs(t))>(s=Math.abs(s))){const i=s/t;return t*Math.sqrt(i*i+1)}if(s>0){const i=t/s;return s*Math.sqrt(i*i+1)}return 0};for(let i=0;i<c;i++){if(u=i+1,N.set(i,R*f),f=y=R=0,i<M){for(let s=i;s<M;s++)R+=Math.abs(t.atRowCol(s,i));if(R){for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)/R),y+=t.atRowCol(s,i)*t.atRowCol(s,i);a=t.atRowCol(i,i),f=-g(Math.sqrt(y),a),l=a*f-y,t.setRowCol(i,i,a-f);for(let s=u;s<c;s++){y=0;for(let o=i;o<M;o++)y+=t.atRowCol(o,i)*t.atRowCol(o,s);a=y/l;for(let o=i;o<M;o++)t.setRowCol(o,s,t.atRowCol(o,s)+a*t.atRowCol(o,i))}for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)*R)}}if(s.set(i,R*f),f=y=R=0,i<M&&i!==c-1){for(let s=u;s<c;s++)R+=Math.abs(t.atRowCol(i,s));if(R){for(let s=u;s<c;s++)t.setRowCol(i,s,t.atRowCol(i,s)/R),y+=t.atRowCol(i,s)*t.atRowCol(i,s);a=t.atRowCol(i,u),f=-g(Math.sqrt(y),a),l=a*f-y,t.setRowCol(i,u,a-f);for(let s=u;s<c;s++)N.set(s,t.atRowCol(i,s)/l);for(let s=u;s<M;s++){y=0;for(let o=u;o<c;o++)y+=t.atRowCol(s,o)*t.atRowCol(i,o);for(let i=u;i<c;i++)t.setRowCol(s,i,t.atRowCol(s,i)+y*N.at(i))}for(let s=u;s<c;s++)t.setRowCol(i,s,t.atRowCol(i,s)*R)}}const o=Math.abs(s.at(i))+Math.abs(N.at(i));d=o>d?o:d}for(let s=c-1;s>=0;s--){if(s<c-1){if(f){for(let o=u;o<c;o++)i.setRowCol(o,s,t.atRowCol(s,o)/t.atRowCol(s,u)/f);for(let o=u;o<c;o++){y=0;for(let e=u;e<c;e++)y+=t.atRowCol(s,e)*i.atRowCol(e,o);for(let t=u;t<c;t++)i.setRowCol(t,o,i.atRowCol(t,o)+y*i.atRowCol(t,s))}}for(let t=u;t<c;t++)i.setRowCol(s,t,0),i.setRowCol(t,s,0)}i.setRowCol(s,s,1),f=N.at(s),u=s}for(let i=(M<c?M:c)-1;i>=0;i--){u=i+1,f=s.at(i);for(let s=u;s<c;s++)t.setRowCol(i,s,0);if(f){f=1/f;for(let s=u;s<c;s++){y=0;for(let o=u;o<M;o++)y+=t.atRowCol(o,i)*t.atRowCol(o,s);a=y/t.atRowCol(i,i)*f;for(let o=i;o<M;o++)t.setRowCol(o,s,t.atRowCol(o,s)+a*t.atRowCol(o,i))}for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)*f)}else for(let s=i;s<M;s++)t.setRowCol(s,i,0);t.setRowCol(i,i,t.atRowCol(i,i)+1)}for(let o=c-1;o>=0;o--)for(let e=1;;e++){let h=1;for(u=o;u>=0;u--){if(C=u-1,Math.abs(N.at(u))+d===d){h=0;break}if(Math.abs(s.at(C))+d===d)break}if(h){r=0,y=1;for(let i=u;i<=o&&(a=y*N.at(i),N.set(i,N.at(i)*r),Math.abs(a)+d!==d);i++){f=s.at(i),l=b(a,f),s.set(i,l),l=1/l,r=f*l,y=-a*l;for(let s=0;s<M;s++)x=t.atRowCol(s,C),w=t.atRowCol(s,i),t.setRowCol(s,C,x*r+w*y),t.setRowCol(s,i,w*r-x*y)}}if(w=s.at(o),u===o){if(w<0){s.set(o,-w);for(let t=0;t<c;t++)i.setRowCol(t,o,-i.atRowCol(t,o))}break}if(100===e)return!1;n=s.at(u),C=o-1,x=s.at(C),f=N.at(C),l=N.at(o),a=((x-w)*(x+w)+(f-l)*(f+l))/(2*l*x),f=b(a,1),a=((n-w)*(n+w)+l*(x/(a+g(f,a))-l))/n,r=y=1;for(let o=u;o<=C;o++){const e=o+1;f=N.at(e),x=s.at(e),l=y*f,f*=r,w=b(a,l),N.set(o,w),r=a/w,y=l/w,a=n*r+f*y,f=f*r-n*y,l=x*y,x*=r;for(let t=0;t<c;t++)n=i.atRowCol(t,o),w=i.atRowCol(t,e),i.setRowCol(t,o,n*r+w*y),i.setRowCol(t,e,w*r-n*y);w=b(a,l),s.set(o,w),w&&(w=1/w,r=a*w,y=l*w),a=r*f+y*x,n=r*x-y*f;for(let s=0;s<M;s++)x=t.atRowCol(s,o),w=t.atRowCol(s,e),t.setRowCol(s,o,x*r+w*y),t.setRowCol(s,e,w*r-x*y)}N.set(u,0),N.set(o,a),s.set(o,n)}const p=new Float64Array(this.N),P=new Float64Array(this.M),v=new h(p,this.N,1),T=new h(P,this.M,1);let I=1;do{I*=3,I++}while(I<=this.M);do{I/=3,I=Math.trunc(I);for(let o=I;o<this.M;o++){const e=s.at(o);for(let s=0;s<this.N;s++)v.set(s,t.atRowCol(s,o));for(let t=0;t<this.M;t++)T.set(t,i.atRowCol(t,o));let h=o;for(;s.at(h-I)<e;){s.set(h,s.at(h-I));for(let s=0;s<this.N;s++)t.setRowCol(s,h,t.atRowCol(s,h-I));for(let t=0;t<this.M;t++)i.setRowCol(t,h,i.atRowCol(t,h-I));if(h-=I,h<I)break}s.set(h,e);for(let s=0;s<this.N;s++)t.setRowCol(s,h,v.at(s));for(let t=0;t<this.M;t++)i.setRowCol(t,h,T.at(t))}}while(I>1);for(let s=0;s<this.M;s++){let o=0;for(let i=0;i<this.N;i++)t.atRowCol(i,s)<0&&o++;for(let t=0;t<this.M;t++)i.atRowCol(t,s)<0&&o++;if(o>Math.trunc((this.N+this.M)/2)){for(let i=0;i<this.N;i++)t.setRowCol(i,s,-t.atRowCol(i,s));for(let t=0;t<this.M;t++)i.setRowCol(t,s,-i.atRowCol(t,s))}}return!0}isSymmetric(){if(this.N!==this.M)return!1;for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++)if(this.atRowCol(t,s)!==this.atRowCol(s,t))return!1;return!0}isZero(){return(0,o.g)(0),!1}isIdentity(){return(0,o.g)(0),!1}equals(t,s){if(void 0!==s&&(0,o.g)(0),this.N!==t.N||this.M!==t.M)return!1;for(let s=0;s<this.N*this.M;s++)if(this.data[s]!==t.data[s])return!1;return!0}maxElement(){return(0,o.g)(0),0}minElement(){return(0,o.g)(0),0}determinant(){if((0,o.g)(this.N===this.M),1===this.N)return this.data[0];if(2===this.N)return this.data[0]*this.data[3]-this.data[1]*this.data[2];if(3===this.N){const t=this;return t.atRowCol(0,0)*(t.atRowCol(1,1)*t.atRowCol(2,2)-t.atRowCol(1,2)*t.atRowCol(2,1))-t.atRowCol(0,1)*(t.atRowCol(1,0)*t.atRowCol(2,2)-t.atRowCol(2,0)*t.atRowCol(1,2))+t.atRowCol(0,2)*(t.atRowCol(1,0)*t.atRowCol(2,1)-t.atRowCol(1,1)*t.atRowCol(2,0))}const t=new Float64Array(this.N*this.N),s=new h(t,this.N,this.N),i=new Float64Array(this.N);if(!this.luDecomposition(s,i))return 0;let e=1;for(let t=0;t<this.N;t++)e*=s.atRowCol(t,t),i[t]!==t&&(e=-e);return e}submatrix(t,s,i){(0,o.g)(0)}inverse(t){(0,o.g)(0)}pseudoInverse(t,s=!1,i=2220446049250313e-31){if(t.setZero(),1===this.N&&1===this.M)return 0!==this.atRowCol(0,0)?t.setRowCol(0,0,1/this.atRowCol(0,0)):t.setRowCol(0,0,0),!0;if(2===this.N&&2===this.M){const s=this.atRowCol(0,0)*this.atRowCol(1,1)-this.atRowCol(0,1)*this.atRowCol(1,0),i=1e-5*(Math.abs(this.atRowCol(0,0)*this.atRowCol(1,1))+Math.abs(this.atRowCol(0,1)*this.atRowCol(1,0)));if(Math.abs(s)>i)return t.setRowCol(0,0,this.atRowCol(1,1)/s),t.setRowCol(0,1,-this.atRowCol(0,1)/s),t.setRowCol(1,0,-this.atRowCol(1,0)/s),t.setRowCol(1,1,this.atRowCol(0,0)/s),!0}const o=new Float64Array(this.N*this.M),e=new h(o,this.N,this.M),r=new Float64Array(this.M),a=new h(r,this.M,1),l=new Float64Array(this.M*this.M),y=new h(l,this.M,this.M);if(!this.svd(e,a,y,s))return!1;const n=Math.max(this.N,this.M),x=i*Math.abs(a.at(0))*n;for(let t=0;t<this.M;t++)a.at(t)>x?a.set(t,1/a.at(t)):a.set(t,0);return y.mulDiag(a,t),t.mulTranspose(e,t),!0}luDecomposition(t,s){return(0,o.g)(0),!1}symmetricEigen(t,s){(0,o.g)(this.rows()===this.cols()),(0,o.g)(this.rows()===t.rows()),(0,o.g)(s.rows()===s.cols()&&s.rows()===this.rows()),(0,o.g)(this.isSymmetric());const i=new Float64Array(this.N*this.M),e=new h(i,this.N,this.M);e.assignCopy(this);const r=100/Number.EPSILON,a=this.rows(),l=new Float64Array(a),y=new Float64Array(a),n=new h(l,a,1),x=new h(y,a,1);for(let s=0;s<a;s++)n.set(s,e.atRowCol(s,s)),t.set(s,e.atRowCol(s,s)),x.set(s,0);s.setIdentity();const w=()=>{const i=n;s.transposeInPlace();let o=1;do{o*=3,o++}while(o<=a);do{o/=3,o=Math.trunc(o);for(let e=o;e<a;e++){const h=t.at(e),r=Math.abs(h);for(let t=0;t<this.M;t++)i.set(t,s.atRowCol(t,e));let a=e;for(;Math.abs(t.at(a-o))<r;){t.set(a,t.at(a-o));for(let t=0;t<this.M;t++)s.setRowCol(t,a,s.atRowCol(t,a-o));if(a-=o,a<o)break}if(a!==e){t.set(a,h);for(let t=0;t<this.M;t++)s.setRowCol(t,a,i.at(t))}}}while(o>1)};for(let i=1;;i++){let o=0;for(let t=1;t<a;t++)for(let s=0;s<t;s++)o+=Math.abs(e.atRowCol(t,s));if(0===o)return w(),!0;const h=i<4?.2*o/(a*a):0;for(let o=0;o<a;o++)for(let l=o+1;l<a;l++){let y=r*Math.abs(e.atRowCol(l,o));if(i>4&&y<=Math.abs(t.at(o))&&y<=Math.abs(t.at(l)))e.setRowCol(l,o,0);else if(Math.abs(e.atRowCol(l,o))>h){let i,h=t.at(l)-t.at(o);if(y<Math.abs(h))i=e.atRowCol(l,o)/h;else{const t=.5*h/e.atRowCol(l,o);i=1/(Math.abs(t)+Math.sqrt(1+t*t)),t<0&&(i=-i)}const r=1/Math.sqrt(1+i*i),n=i*r,w=n/(1+r);h=i*e.atRowCol(l,o),x.set(o,x.at(o)-h),x.set(l,x.at(l)+h),t.set(o,t.at(o)-h),t.set(l,t.at(l)+h),e.setRowCol(l,o,0);let u=0;for(;u<o;u++)y=e.atRowCol(o,u),h=e.atRowCol(l,u),e.setRowCol(o,u,y-n*(h+y*w)),e.setRowCol(l,u,h+n*(y-h*w));for(u++;u<l;u++)y=e.atRowCol(u,o),h=e.atRowCol(l,u),e.setRowCol(u,o,y-n*(h+y*w)),e.setRowCol(l,u,h+n*(y-h*w));for(u++;u<a;u++)y=e.atRowCol(u,o),h=e.atRowCol(u,l),e.setRowCol(u,o,y-n*(h+y*w)),e.setRowCol(u,l,h+n*(y-h*w));for(u=0;u<a;u++)y=s.atRowCol(o,u),h=s.atRowCol(l,u),s.setRowCol(o,u,y-n*(h+y*w)),s.setRowCol(l,u,h+n*(y-h*w))}}for(let s=0;s<a;s++)n.set(s,n.at(s)+x.at(s)),t.set(s,n.at(s)),x.set(s,0)}}static checkDims(t,s,i){(0,o.g)(t.rows()===s&&t.cols()===i)}}class r extends h{constructor(t){if(t.copy){const s=new Float64Array(t.copy.N*t.copy.M);return super(s,t.copy.N,t.copy.M),this.buffer=s,void this.assignCopy(t.copy)}const s=new Float64Array(t.NN*t.MM);super(s,t.NN,t.MM),this.buffer=s,t.initializerList&&(0,e.a)(this.buffer,t.initializerList,0,0,t.initializerList.length)}assignCopy(t){return this===t||super.assignCopy(t),this}}class a{constructor(t){this.m_TransformationType=1,void 0===t?this.setIdentity():t instanceof a?this.set(t):this.setScale(t)}set(t){return this.xx=t.xx,this.xy=t.xy,this.xd=t.xd,this.yx=t.yx,this.yy=t.yy,this.yd=t.yd,this}clone(){return(new a).set(this)}setZero(){this.xx=0,this.yy=0,this.xy=0,this.yx=0,this.xd=0,this.yd=0}isEqual(t){return this===t||this.xx===t.xx&&this.xy===t.xy&&this.xd===t.xd&&this.yx===t.yx&&this.yy===t.yy&&this.yd===t.yd}transformInPlace(t){const s=this.xx*t.x+this.xy*t.y+this.xd,i=this.yx*t.x+this.yy*t.y+this.yd;t.x=s,t.y=i}transform(t){const s=t.clone();return this.transformInPlace(s),s}queryTransform(t,s){const i=this.xx*t.x+this.xy*t.y+this.xd,o=this.yx*t.x+this.yy*t.y+this.yd;s.setCoords(i,o)}transformEnvInPlace(t){if(t.isEmpty())return;const s=(0,e.m)(e.P,4);t.queryCorners(s),this.transformPoints2D(s,4,s),t.setFromPoints(s,4)}queryTransformEnv(t,s){(0,o.g)(0)}transformPoints2D(t,s,i){for(let o=0;o<s;++o)this.queryTransform(t[o],i[o])}transformInterleavedPoints(t,s,i){s*=2;const o=e.P.getNAN();for(let e=0;e<s;e+=2)o.x=t[e],o.y=t[e+1],this.transformInPlace(o),i[e]=o.x,i[e+1]=o.y}multiply(t){return a.st_multiply(this,t,this),this}mulLeft(t){return(0,o.g)(0),this}static st_multiply(t,s,i){const o=t.xx*s.xx+t.yx*s.xy,e=t.xy*s.xx+t.yy*s.xy,h=t.xd*s.xx+t.yd*s.xy+s.xd,r=t.xx*s.yx+t.yx*s.yy,a=t.xy*s.yx+t.yy*s.yy,l=t.xd*s.yx+t.yd*s.yy+s.yd;i.xx=o,i.xy=e,i.xd=h,i.yx=r,i.yy=a,i.yd=l}getCoefficients(t){(0,o.g)(t.length>=6),t[0]=this.xx,t[1]=this.xy,t[2]=this.xd,t[3]=this.yx,t[4]=this.yy,t[5]=this.yd}setCoefficients(t){(0,o.g)(t.length>=6),this.xx=t[0],this.xy=t[1],this.xd=t[2],this.yx=t[3],this.yy=t[4],this.yd=t[5]}copyTo(t){(0,o.g)(0)}initializeFromRect(t,s){t.isEmpty()||s.isEmpty()||!t.width()||!t.height()?this.setZero():(this.xy=this.yx=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xd=s.xmin-t.xmin*this.xx,this.yd=s.ymin-t.ymin*this.yy)}initializeFromRectIsotropic(t,s){if(t.isEmpty()||!t.width()||!t.height()||s.isEmpty())this.setZero();else{this.yx=0,this.xy=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xx>this.yy?this.xx=this.yy:this.yy=this.xx;const i=s.getCenter(),o=t.getCenter();this.xd=i.x-o.x*this.xx,this.yd=i.y-o.y*this.yy}}initializeFromTwoPointsArray(t,s){if(t[0].equals(s[0])&&t[1].equals(s[1]))return void this.setIdentity();if(t[0].equals(t[1])){if(s[0].equals(s[1]))return void this.setShift(s[0].sub(t[0]));(0,o.t)("")}if(!t[0].equals(t[1])&&s[0].equals(s[1]))return this.setZero(),void this.shift(s[0]);this.setShiftCoords(-t[0].x,-t[0].y);const i=e.P.distance(t[0],t[1]),h=e.P.distance(s[0],s[1]),r=h/i;this.scale(r,r);const a=t[1].sub(t[0]);a.divThis(i);const l=s[1].sub(s[0]);l.divThis(h);const y=a.crossProduct(l),n=a.dotProduct(l);this.rotate(n,y),this.shiftCoords(s[0].x,s[0].y)}initializeFromTwoPoints(t,s,i,o){const e=[t,s],h=[i,o];this.initializeFromTwoPointsArray(e,h)}transformSizeInPlace(t){(0,o.g)(0)}transformSize(t,s){(0,o.g)(0)}transformTol(t){return(0,o.g)(0),0}transformWithoutTranslateArray(t,s,i){for(let o=0;o<s;++o)this.transformWithoutTranslate(t[o],i[o])}transformWithoutTranslateInPlace(t){const s=this.xx*t.x+this.xy*t.y,i=this.yx*t.x+this.yy*t.y;t.setCoords(s,i)}transformWithoutTranslate(t,s){const i=this.xx*t.x+this.xy*t.y,o=this.yx*t.x+this.yy*t.y;s.setCoords(i,o)}setIdentity(){this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=1,this.yd=0}isIdentity(){return!(1!==this.xx||1!==this.yy||this.xy||this.xd||this.yx||this.yd)}isIdentityTol(t){const s=t*t;return!((0,e.s)(this.xd)+(0,e.s)(this.yd)>s||(0,e.s)(this.xy+this.xd)+(0,e.s)(this.yy+this.yd-1)>s||(0,e.s)(this.xx+this.xd-1)+(0,e.s)(this.yx+this.yd)>s)}isReflective(){return this.xx*this.yy-this.yx*this.xy<0}isUniform(t){const s=this.xx*this.xx+this.yx*this.yx,i=this.xy*this.xy+this.yy*this.yy,o=(s+i)*t;return Math.abs(s-i)<=o&&Math.abs(this.xx*this.xy+this.yx*this.yy)<=o}isUniformNoRotation(){return 0!==this.xx&&Math.abs(this.xx)===Math.abs(this.yy)&&0===this.xy&&0===this.yx}isTranslate(){return 1===this.xx&&1===this.yy&&!this.xy&&!this.yx}isTranslateTol(t){const s=new e.P;return s.setCoords(0,1),this.transformWithoutTranslateInPlace(s),s.y-=1,!(s.sqrLength()>t*t)&&(s.setCoords(1,0),this.transformWithoutTranslateInPlace(s),s.x-=1,s.sqrLength()<=t*t)}isOrthonormal(t){const s=new a;return s.xx=this.xx*this.xx+this.xy*this.xy,s.xy=this.xx*this.yx+this.xy*this.yy,s.yx=this.yx*this.xx+this.yy*this.xy,s.yy=this.yx*this.yx+this.yy*this.yy,s.xd=0,s.yd=0,s.isIdentityTol(t)}isDegenerate(t){return Math.abs(this.xx*this.yy-this.yx*this.xy)<=2*t*(Math.abs(this.xx*this.yy)+Math.abs(this.yx*this.xy))}isZero(){return 0===this.xx&&0===this.yy&&0===this.xy&&0===this.yx&&0===this.xd&&0===this.yd}isScaleAndTranslateTol(t){return this.xy*this.xy+this.yx*this.yx<=(this.xx*this.xx+this.yy*this.yy)*t}setTranslate(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShiftCoords(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShift(t){return this.xx=1,this.xy=0,this.xd=t.x,this.yx=0,this.yy=1,this.yd=t.y,this}setScaleCoords(t,s){return this.xx=t,this.xy=0,this.xd=0,this.yx=0,this.yy=s,this.yd=0,this}setScale(t){return this.setScaleCoords(t,t),this}setFlipX(t,s){return this.xx=-1,this.xy=0,this.xd=t+s,this.yx=0,this.yy=1,this.yd=0,this}setFlipY(t,s){return this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=-1,this.yd=t+s,this}setShear(t,s){return this.xx=1,this.xy=t,this.xd=0,this.yx=s,this.yy=1,this.yd=0,this}scale(t,s){return this.xx*=t,this.xy*=t,this.xd*=t,this.yx*=s,this.yy*=s,this.yd*=s,this}setRotateAngle(t){return this.setRotate(Math.cos(t),Math.sin(t))}setRotate(t,s){return this.xx=t,this.xy=-s,this.xd=0,this.yx=s,this.yy=t,this.yd=0,this}setRotateAngleAbout(t,s){return this.setRotateAbout(Math.cos(t),Math.sin(t),s)}setRotateAbout(t,s,i){return this.setTranslate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}setSwapCoordinates(){return this.xx=0,this.xy=1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}setRotateCw90(){return this.xx=0,this.xy=1,this.xd=0,this.yx=-1,this.yy=0,this.yd=0,this}setRotateCcw90(){return this.xx=0,this.xy=-1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}shiftCoords(t,s){return this.xd+=t,this.yd+=s,this}shift(t){return this.xd+=t.x,this.yd+=t.y,this}translate(t,s){return this.xd+=t,this.yd+=s,this}flipX(t,s){return this.xx=-this.xx,this.xy=-this.xy,this.xd=t+s-this.xd,this}flipY(t,s){return this.yx=-this.yx,this.yy=-this.yy,this.yd=t+s-this.yd,this}shear(t,s){const i=new a;return i.setShear(t,s),this.multiply(i)}rotateAngle(t){const s=new a;return s.setRotateAngle(t),this.multiply(s)}rotate(t,s){const i=new a;return i.setRotate(t,s),this.multiply(i)}rotateAbout(t,s,i){return this.translate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}rotateAngleAbout(t,s){return this.rotateAbout(Math.cos(t),Math.sin(t),s)}setInvert(t){return this.set(t),this.invertThis()}invertThis(){let t=this.xx*this.yy-this.xy*this.yx;if(0===t)return this.setZero(),this;t=1/t;const s=(this.xy*this.yd-this.xd*this.yy)*t,i=(this.xd*this.yx-this.xx*this.yd)*t,o=this.yy*t,e=-this.xy*t,h=-this.yx*t,r=this.xx*t;return this.xd=s,this.yd=i,this.xx=o,this.yy=r,this.xy=e,this.yx=h,this}invertPrecise(t){return this.set(t),this.invertPreciseThis()}invertPreciseThis(){const t=e.M.constructDouble(this.xy),s=e.M.constructDouble(this.xx),i=s.mulDouble(this.yy).sub(t.mulDouble(this.yx));if(i.isZero())return this.setZero(),this;const o=i.clone();o.invertThis();const h=e.M.constructDouble(this.xd),r=t.mulDouble(this.yd).sub(h.mulDouble(this.yy)).mul(o).toDouble(),a=h.mulDouble(this.yx).sub(s.mulDouble(this.yd)).mul(o).toDouble(),l=o.mulDouble(this.yy).toDouble(),y=o.mulDouble(-this.xy).toDouble(),n=o.mulDouble(-this.yx).toDouble(),x=o.mulDouble(this.xx).toDouble();return this.xd=r,this.yd=a,this.xx=l,this.yy=x,this.xy=y,this.yx=n,this}extractScaleTransform(t,s){const i=Math.sqrt(this.xx*this.xx+this.xy*this.xy),o=Math.sqrt(this.yx*this.yx+this.yy*this.yy);s.setScaleCoords(1/i,1/o),s.multiply(this),t.setScaleCoords(i,o)}setFromTwoTriangles(t,s){let i=!0;for(let o=0;o<3;++o)i=i&&t[o].equals(s[o]);if(i)return this.setIdentity(),!0;const o=new e.P;o.setSub(t[0],t[1]);const h=new e.P;h.setSub(t[0],t[2]);const r=new e.P;r.setSub(s[0],s[1]);const a=new e.P;a.setSub(s[0],s[2]);const l=4*Number.EPSILON*(Math.abs(o.x*h.y)+Math.abs(h.x*o.y));let y=o.x*h.y-o.y*h.x;return Math.abs(y)>l?(y=1/y,this.xx=(r.x*h.y-o.y*a.x)*y,this.xy=(o.x*a.x-r.x*h.x)*y,this.yx=(r.y*h.y-o.y*a.y)*y,this.yy=(o.x*a.y-r.y*h.x)*y,this.xd=s[0].x-(this.xx*t[0].x+this.xy*t[0].y),this.yd=s[0].y-(this.yx*t[0].x+this.yy*t[0].y),!0):(this.setZero(),!1)}initializeFromControlPoints(t,s,i,h,n=null){return 0===s?(this.setIdentity(),void(n&&n.setIdentity())):1===s?(this.setShift(h[0].sub(i[0])),void(n&&n.setShift(i[0].sub(h[0])))):(s<3&&(t=1),void(4===t&&s>2?function(t,s,i,h,a){const l=e.P.average(i,s),n=e.P.average(h,s),x=new r({NN:2,MM:2});x.setZero();const w=new r({NN:2,MM:2});w.setZero();for(let t=0;t<s;++t)x.setRowCol(0,0,x.atRowCol(0,0)+(i[t].x-l.x)*(i[t].x-l.x)),x.setRowCol(0,1,x.atRowCol(0,1)+(i[t].x-l.x)*(i[t].y-l.y)),x.setRowCol(1,1,x.atRowCol(1,1)+(i[t].y-l.y)*(i[t].y-l.y)),w.setRowCol(0,0,w.atRowCol(0,0)+(h[t].x-n.x)*(i[t].x-l.x)),w.setRowCol(0,1,w.atRowCol(0,1)+(h[t].x-n.x)*(i[t].y-l.y)),w.setRowCol(1,0,w.atRowCol(1,0)+(h[t].y-n.y)*(i[t].x-l.x)),w.setRowCol(1,1,w.atRowCol(1,1)+(h[t].y-n.y)*(i[t].y-l.y));x.setRowCol(1,0,x.atRowCol(0,1));const u=new r({NN:2,MM:2});x.pseudoInverse(u,!0)||(0,o.a)("Failed to compute pseudo inverse"),w.mul(u,w),y(t,w);const C=l.clone();t.transformInPlace(C),t.xd=n.x-C.x,t.yd=n.y-C.y,a&&(w.pseudoInverse(u,!1)||(0,o.a)("Failed to compute pseudo inverse"),y(a,u),a.transformInPlace(n),a.xd=l.x-n.x,a.yd=l.y-n.y)}(this,s,i,h,n):function(t,s,i,h,n,x){(0,o.g)(1===t||0===t||2===t||3===t),s.setIdentity();const w=e.P.average(h,i),u=e.P.average(n,i);if((0,o.g)(t<l.length&&t>0),8&l[t]){const e=new r({NN:2,MM:2});e.setZero();for(let t=0;t<i;++t)e.setRowCol(0,0,e.atRowCol(0,0)+(n[t].x-u.x)*(h[t].x-w.x)),e.setRowCol(1,0,e.atRowCol(1,0)+(n[t].x-u.x)*(h[t].y-w.y)),e.setRowCol(0,1,e.atRowCol(0,1)+(n[t].y-u.y)*(h[t].x-w.x)),e.setRowCol(1,1,e.atRowCol(1,1)+(n[t].y-u.y)*(h[t].y-w.y));const x=new r({NN:2,MM:2}),C=new r({NN:2,MM:1}),f=new r({NN:2,MM:2});e.svd(x,C,f)||(0,o.a)("Failed to compute svd");const R=new r({NN:2,MM:2});x.transpose(R);const d=new r({NN:2,MM:2});f.mul(R,d),32&l[t]||d.determinant()<0&&(R.setRowCol(1,0,-R.atRowCol(1,0)),R.setRowCol(1,1,-R.atRowCol(1,1)),f.mul(R,d));const c=new a;y(c,d),s.set(c)}if(2&l[t]){let t=0,o=0;for(let e=0;e<i;++e){const i=h[e].sub(w);t+=i.sqrLength(),s.transformInPlace(i),o+=i.dotProduct(n[e].sub(u))}if(0===t)0===o?s.setIdentity():s.setZero();else{const i=o/t;s.scale(i,i)}}else(0,o.g)(!(4&l[t]));const C=w.clone();s.transformInPlace(C),s.xd=u.x-C.x,s.yd=u.y-C.y,x&&(x.set(s),x.invertThis(),x.isZero()&&(x.xd=w.x,x.yd=w.y))}(t,this,s,i,h,n)))}calculateErrors(t,s,i,h){(0,o.g)(t>0&&null!==s&&null!==i);let r=0;for(let o=0;o<t;++o){const t=this.transform(s[o]),a=e.P.sqrDistance(i[o],t);r+=a,h&&(h[o]=Math.sqrt(a))}return Math.sqrt(r/t)}}const l=[43,11,41,9,61];function y(t,s){(0,o.g)(!(2!==s.rows()&&3!==s.rows()||2!==s.cols()&&3!==s.rows())),t.xx=s.atRowCol(0,0),t.xy=s.atRowCol(0,1),t.yx=s.atRowCol(1,0),t.yy=s.atRowCol(1,1),3===s.cols()?(t.xd=s.atRowCol(0,2),t.yd=s.atRowCol(1,2)):(t.xd=0,t.yd=0)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1878],{11878:(t,s,i)=>{i.d(s,{T:()=>a});var o=i(55537),e=i(83661);class h{constructor(t,s,i){if(t instanceof h)return this.data=t.data,this.N=t.N,this.M=t.M,t.data=null,t.N=0,void(t.M=0);this.data=t,this.N=s,this.M=i}assignCopy(t){return this===t||((0,o.g)(this.N*this.M==t.N*t.M),this.data.set(t.data),this.N=t.N,this.M=t.M),this}setZero(){return this.data?.fill(0),this}setIdentity(){for(let t=0;t<this.N;t++)for(let s=0;s<this.M;s++)this.setRowCol(t,s,t===s?1:0);return this}rows(){return this.N}cols(){return this.M}row(t){return(0,o.g)(0),{}}set(t,s){return this.data[t]=s,this}setRowCol(t,s,i){return this.data[t*this.M+s]=i,this}at(t){return this.data[t]}atRowCol(t,s){return this.data[t*this.M+s]}mulScalar(t,s){(0,o.g)(0)}mul(t,s){if((0,o.g)(this.M===t.rows()),(0,o.g)(this.N===s.rows()),(0,o.g)(t.cols()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mul(t,o),void s.assignCopy(o)}if(s===t){const i=new Float64Array(t.N*t.M),o=new h(i,t.N,t.M);return this.mul(t,o),void s.assignCopy(o)}const i=t.cols();for(let o=0;o<this.N;o++)for(let e=0;e<i;e++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(o,s)*t.atRowCol(s,e);s.setRowCol(o,e,i)}}mulTranspose(t,s){if((0,o.g)(this.M===t.cols()),(0,o.g)(this.N===s.rows()),(0,o.g)(t.rows()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mulTranspose(t,o),void s.assignCopy(o)}if(s===t){const i=new Float64Array(t.N*t.M),o=new h(i,t.N,t.M);return this.mulTranspose(t,o),void s.assignCopy(o)}const i=t.rows();for(let o=0;o<this.N;o++)for(let e=0;e<i;e++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(o,s)*t.atRowCol(e,s);s.setRowCol(o,e,i)}}mulLeft(t,s){(0,o.g)(0)}mulLeftTranspose(t,s){(0,o.g)(0)}mulDiag(t,s){if((0,o.g)(this.M===t.N*t.M),(0,o.g)(this.N===s.rows()),(0,o.g)(this.M===s.cols()),s===this){const i=new Float64Array(this.N*this.M),o=new h(i,this.N,this.M);return this.mulDiag(t,o),void s.assignCopy(o)}const i=this.M;for(let o=0;o<this.N;o++)for(let e=0;e<i;e++)s.setRowCol(o,e,this.atRowCol(o,e)*t.at(e))}transposeInPlace(){if(this.N===this.M){for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++){const i=this.atRowCol(t,s);this.setRowCol(t,s,this.atRowCol(s,t)),this.setRowCol(s,t,i)}return this}const t=new Float64Array(this.N*this.M),s=new h(t,this.N,this.M);return s.assignCopy(this),this.M=(0,e.c)(this.N,this.N=this.M),s.transpose(this),this}transpose(t){if(this!==t){h.checkDims(t,this.M,this.N);for(let s=0;s<this.N;s++)for(let i=0;i<this.M;i++)t.setRowCol(i,s,this.atRowCol(s,i))}else t.transposeInPlace()}add(t,s){}svd(t,s,i,e=!1){if(h.checkDims(t,this.N,this.M),h.checkDims(s,this.M,1),h.checkDims(i,this.M,this.M),e){if((0,o.g)(this.N===this.M),!this.symmetricEigen(s,i))return!1;for(let t=0;t<this.M;++t)s.at(t)<0&&s.set(t,0);return t.assignCopy(i),!0}let r,a,l,y,n,x,w,u=0,C=0,f=0,R=0,d=0;const c=this.M,M=this.N;t.assignCopy(this);const m=new Float64Array(c),N=new h(m,c,1),b=(t,s)=>s>=0?Math.abs(t):-Math.abs(t),g=(t,s)=>{if((t=Math.abs(t))>(s=Math.abs(s))){const i=s/t;return t*Math.sqrt(i*i+1)}if(s>0){const i=t/s;return s*Math.sqrt(i*i+1)}return 0};for(let i=0;i<c;i++){if(u=i+1,N.set(i,R*f),f=y=R=0,i<M){for(let s=i;s<M;s++)R+=Math.abs(t.atRowCol(s,i));if(R){for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)/R),y+=t.atRowCol(s,i)*t.atRowCol(s,i);a=t.atRowCol(i,i),f=-b(Math.sqrt(y),a),l=a*f-y,t.setRowCol(i,i,a-f);for(let s=u;s<c;s++){y=0;for(let o=i;o<M;o++)y+=t.atRowCol(o,i)*t.atRowCol(o,s);a=y/l;for(let o=i;o<M;o++)t.setRowCol(o,s,t.atRowCol(o,s)+a*t.atRowCol(o,i))}for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)*R)}}if(s.set(i,R*f),f=y=R=0,i<M&&i!==c-1){for(let s=u;s<c;s++)R+=Math.abs(t.atRowCol(i,s));if(R){for(let s=u;s<c;s++)t.setRowCol(i,s,t.atRowCol(i,s)/R),y+=t.atRowCol(i,s)*t.atRowCol(i,s);a=t.atRowCol(i,u),f=-b(Math.sqrt(y),a),l=a*f-y,t.setRowCol(i,u,a-f);for(let s=u;s<c;s++)N.set(s,t.atRowCol(i,s)/l);for(let s=u;s<M;s++){y=0;for(let o=u;o<c;o++)y+=t.atRowCol(s,o)*t.atRowCol(i,o);for(let i=u;i<c;i++)t.setRowCol(s,i,t.atRowCol(s,i)+y*N.at(i))}for(let s=u;s<c;s++)t.setRowCol(i,s,t.atRowCol(i,s)*R)}}const o=Math.abs(s.at(i))+Math.abs(N.at(i));d=o>d?o:d}for(let s=c-1;s>=0;s--){if(s<c-1){if(f){for(let o=u;o<c;o++)i.setRowCol(o,s,t.atRowCol(s,o)/t.atRowCol(s,u)/f);for(let o=u;o<c;o++){y=0;for(let e=u;e<c;e++)y+=t.atRowCol(s,e)*i.atRowCol(e,o);for(let t=u;t<c;t++)i.setRowCol(t,o,i.atRowCol(t,o)+y*i.atRowCol(t,s))}}for(let t=u;t<c;t++)i.setRowCol(s,t,0),i.setRowCol(t,s,0)}i.setRowCol(s,s,1),f=N.at(s),u=s}for(let i=(M<c?M:c)-1;i>=0;i--){u=i+1,f=s.at(i);for(let s=u;s<c;s++)t.setRowCol(i,s,0);if(f){f=1/f;for(let s=u;s<c;s++){y=0;for(let o=u;o<M;o++)y+=t.atRowCol(o,i)*t.atRowCol(o,s);a=y/t.atRowCol(i,i)*f;for(let o=i;o<M;o++)t.setRowCol(o,s,t.atRowCol(o,s)+a*t.atRowCol(o,i))}for(let s=i;s<M;s++)t.setRowCol(s,i,t.atRowCol(s,i)*f)}else for(let s=i;s<M;s++)t.setRowCol(s,i,0);t.setRowCol(i,i,t.atRowCol(i,i)+1)}for(let o=c-1;o>=0;o--)for(let e=1;;e++){let h=1;for(u=o;u>=0;u--){if(C=u-1,Math.abs(N.at(u))+d===d){h=0;break}if(Math.abs(s.at(C))+d===d)break}if(h){r=0,y=1;for(let i=u;i<=o&&(a=y*N.at(i),N.set(i,N.at(i)*r),Math.abs(a)+d!==d);i++){f=s.at(i),l=g(a,f),s.set(i,l),l=1/l,r=f*l,y=-a*l;for(let s=0;s<M;s++)x=t.atRowCol(s,C),w=t.atRowCol(s,i),t.setRowCol(s,C,x*r+w*y),t.setRowCol(s,i,w*r-x*y)}}if(w=s.at(o),u===o){if(w<0){s.set(o,-w);for(let t=0;t<c;t++)i.setRowCol(t,o,-i.atRowCol(t,o))}break}if(100===e)return!1;n=s.at(u),C=o-1,x=s.at(C),f=N.at(C),l=N.at(o),a=((x-w)*(x+w)+(f-l)*(f+l))/(2*l*x),f=g(a,1),a=((n-w)*(n+w)+l*(x/(a+b(f,a))-l))/n,r=y=1;for(let o=u;o<=C;o++){const e=o+1;f=N.at(e),x=s.at(e),l=y*f,f*=r,w=g(a,l),N.set(o,w),r=a/w,y=l/w,a=n*r+f*y,f=f*r-n*y,l=x*y,x*=r;for(let t=0;t<c;t++)n=i.atRowCol(t,o),w=i.atRowCol(t,e),i.setRowCol(t,o,n*r+w*y),i.setRowCol(t,e,w*r-n*y);w=g(a,l),s.set(o,w),w&&(w=1/w,r=a*w,y=l*w),a=r*f+y*x,n=r*x-y*f;for(let s=0;s<M;s++)x=t.atRowCol(s,o),w=t.atRowCol(s,e),t.setRowCol(s,o,x*r+w*y),t.setRowCol(s,e,w*r-x*y)}N.set(u,0),N.set(o,a),s.set(o,n)}const p=new Float64Array(this.N),P=new Float64Array(this.M),v=new h(p,this.N,1),T=new h(P,this.M,1);let I=1;do{I*=3,I++}while(I<=this.M);do{I/=3,I=Math.trunc(I);for(let o=I;o<this.M;o++){const e=s.at(o);for(let s=0;s<this.N;s++)v.set(s,t.atRowCol(s,o));for(let t=0;t<this.M;t++)T.set(t,i.atRowCol(t,o));let h=o;for(;s.at(h-I)<e;){s.set(h,s.at(h-I));for(let s=0;s<this.N;s++)t.setRowCol(s,h,t.atRowCol(s,h-I));for(let t=0;t<this.M;t++)i.setRowCol(t,h,i.atRowCol(t,h-I));if(h-=I,h<I)break}s.set(h,e);for(let s=0;s<this.N;s++)t.setRowCol(s,h,v.at(s));for(let t=0;t<this.M;t++)i.setRowCol(t,h,T.at(t))}}while(I>1);for(let s=0;s<this.M;s++){let o=0;for(let i=0;i<this.N;i++)t.atRowCol(i,s)<0&&o++;for(let t=0;t<this.M;t++)i.atRowCol(t,s)<0&&o++;if(o>Math.trunc((this.N+this.M)/2)){for(let i=0;i<this.N;i++)t.setRowCol(i,s,-t.atRowCol(i,s));for(let t=0;t<this.M;t++)i.setRowCol(t,s,-i.atRowCol(t,s))}}return!0}isSymmetric(){if(this.N!==this.M)return!1;for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++)if(this.atRowCol(t,s)!==this.atRowCol(s,t))return!1;return!0}isZero(){return(0,o.g)(0),!1}isIdentity(){return(0,o.g)(0),!1}equals(t,s){if(void 0!==s&&(0,o.g)(0),this.N!==t.N||this.M!==t.M)return!1;for(let s=0;s<this.N*this.M;s++)if(this.data[s]!==t.data[s])return!1;return!0}maxElement(){return(0,o.g)(0),0}minElement(){return(0,o.g)(0),0}determinant(){if((0,o.g)(this.N===this.M),1===this.N)return this.data[0];if(2===this.N)return this.data[0]*this.data[3]-this.data[1]*this.data[2];if(3===this.N){const t=this;return t.atRowCol(0,0)*(t.atRowCol(1,1)*t.atRowCol(2,2)-t.atRowCol(1,2)*t.atRowCol(2,1))-t.atRowCol(0,1)*(t.atRowCol(1,0)*t.atRowCol(2,2)-t.atRowCol(2,0)*t.atRowCol(1,2))+t.atRowCol(0,2)*(t.atRowCol(1,0)*t.atRowCol(2,1)-t.atRowCol(1,1)*t.atRowCol(2,0))}const t=new Float64Array(this.N*this.N),s=new h(t,this.N,this.N),i=new Float64Array(this.N);if(!this.luDecomposition(s,i))return 0;let e=1;for(let t=0;t<this.N;t++)e*=s.atRowCol(t,t),i[t]!==t&&(e=-e);return e}submatrix(t,s,i){(0,o.g)(0)}inverse(t){(0,o.g)(0)}pseudoInverse(t,s=!1,i=2220446049250313e-31){if(t.setZero(),1===this.N&&1===this.M)return 0!==this.atRowCol(0,0)?t.setRowCol(0,0,1/this.atRowCol(0,0)):t.setRowCol(0,0,0),!0;if(2===this.N&&2===this.M){const s=this.atRowCol(0,0)*this.atRowCol(1,1)-this.atRowCol(0,1)*this.atRowCol(1,0),i=1e-5*(Math.abs(this.atRowCol(0,0)*this.atRowCol(1,1))+Math.abs(this.atRowCol(0,1)*this.atRowCol(1,0)));if(Math.abs(s)>i)return t.setRowCol(0,0,this.atRowCol(1,1)/s),t.setRowCol(0,1,-this.atRowCol(0,1)/s),t.setRowCol(1,0,-this.atRowCol(1,0)/s),t.setRowCol(1,1,this.atRowCol(0,0)/s),!0}const o=new Float64Array(this.N*this.M),e=new h(o,this.N,this.M),r=new Float64Array(this.M),a=new h(r,this.M,1),l=new Float64Array(this.M*this.M),y=new h(l,this.M,this.M);if(!this.svd(e,a,y,s))return!1;const n=Math.max(this.N,this.M),x=i*Math.abs(a.at(0))*n;for(let t=0;t<this.M;t++)a.at(t)>x?a.set(t,1/a.at(t)):a.set(t,0);return y.mulDiag(a,t),t.mulTranspose(e,t),!0}luDecomposition(t,s){return(0,o.g)(0),!1}symmetricEigen(t,s){(0,o.g)(this.rows()===this.cols()),(0,o.g)(this.rows()===t.rows()),(0,o.g)(s.rows()===s.cols()&&s.rows()===this.rows()),(0,o.g)(this.isSymmetric());const i=new Float64Array(this.N*this.M),e=new h(i,this.N,this.M);e.assignCopy(this);const r=100/Number.EPSILON,a=this.rows(),l=new Float64Array(a),y=new Float64Array(a),n=new h(l,a,1),x=new h(y,a,1);for(let s=0;s<a;s++)n.set(s,e.atRowCol(s,s)),t.set(s,e.atRowCol(s,s)),x.set(s,0);s.setIdentity();const w=()=>{const i=n;s.transposeInPlace();let o=1;do{o*=3,o++}while(o<=a);do{o/=3,o=Math.trunc(o);for(let e=o;e<a;e++){const h=t.at(e),r=Math.abs(h);for(let t=0;t<this.M;t++)i.set(t,s.atRowCol(t,e));let a=e;for(;Math.abs(t.at(a-o))<r;){t.set(a,t.at(a-o));for(let t=0;t<this.M;t++)s.setRowCol(t,a,s.atRowCol(t,a-o));if(a-=o,a<o)break}if(a!==e){t.set(a,h);for(let t=0;t<this.M;t++)s.setRowCol(t,a,i.at(t))}}}while(o>1)};for(let i=1;;i++){let o=0;for(let t=1;t<a;t++)for(let s=0;s<t;s++)o+=Math.abs(e.atRowCol(t,s));if(0===o)return w(),!0;const h=i<4?.2*o/(a*a):0;for(let o=0;o<a;o++)for(let l=o+1;l<a;l++){let y=r*Math.abs(e.atRowCol(l,o));if(i>4&&y<=Math.abs(t.at(o))&&y<=Math.abs(t.at(l)))e.setRowCol(l,o,0);else if(Math.abs(e.atRowCol(l,o))>h){let i,h=t.at(l)-t.at(o);if(y<Math.abs(h))i=e.atRowCol(l,o)/h;else{const t=.5*h/e.atRowCol(l,o);i=1/(Math.abs(t)+Math.sqrt(1+t*t)),t<0&&(i=-i)}const r=1/Math.sqrt(1+i*i),n=i*r,w=n/(1+r);h=i*e.atRowCol(l,o),x.set(o,x.at(o)-h),x.set(l,x.at(l)+h),t.set(o,t.at(o)-h),t.set(l,t.at(l)+h),e.setRowCol(l,o,0);let u=0;for(;u<o;u++)y=e.atRowCol(o,u),h=e.atRowCol(l,u),e.setRowCol(o,u,y-n*(h+y*w)),e.setRowCol(l,u,h+n*(y-h*w));for(u++;u<l;u++)y=e.atRowCol(u,o),h=e.atRowCol(l,u),e.setRowCol(u,o,y-n*(h+y*w)),e.setRowCol(l,u,h+n*(y-h*w));for(u++;u<a;u++)y=e.atRowCol(u,o),h=e.atRowCol(u,l),e.setRowCol(u,o,y-n*(h+y*w)),e.setRowCol(u,l,h+n*(y-h*w));for(u=0;u<a;u++)y=s.atRowCol(o,u),h=s.atRowCol(l,u),s.setRowCol(o,u,y-n*(h+y*w)),s.setRowCol(l,u,h+n*(y-h*w))}}for(let s=0;s<a;s++)n.set(s,n.at(s)+x.at(s)),t.set(s,n.at(s)),x.set(s,0)}}static checkDims(t,s,i){(0,o.g)(t.rows()===s&&t.cols()===i)}}class r extends h{constructor(t){if(t.copy){const s=new Float64Array(t.copy.N*t.copy.M);return super(s,t.copy.N,t.copy.M),this.buffer=s,void this.assignCopy(t.copy)}const s=new Float64Array(t.NN*t.MM);super(s,t.NN,t.MM),this.buffer=s,t.initializerList&&(0,e.b)(this.buffer,t.initializerList,0,0,t.initializerList.length)}assignCopy(t){return this===t||super.assignCopy(t),this}}class a{constructor(t){this.m_TransformationType=1,void 0===t?this.setIdentity():t instanceof a?this.set(t):this.setScale(t)}set(t){return this.xx=t.xx,this.xy=t.xy,this.xd=t.xd,this.yx=t.yx,this.yy=t.yy,this.yd=t.yd,this}clone(){return(new a).set(this)}setZero(){this.xx=0,this.yy=0,this.xy=0,this.yx=0,this.xd=0,this.yd=0}isEqual(t){return this===t||this.xx===t.xx&&this.xy===t.xy&&this.xd===t.xd&&this.yx===t.yx&&this.yy===t.yy&&this.yd===t.yd}transformInPlace(t){const s=this.xx*t.x+this.xy*t.y+this.xd,i=this.yx*t.x+this.yy*t.y+this.yd;t.x=s,t.y=i}transform(t){const s=t.clone();return this.transformInPlace(s),s}queryTransform(t,s){const i=this.xx*t.x+this.xy*t.y+this.xd,o=this.yx*t.x+this.yy*t.y+this.yd;s.setCoords(i,o)}transformEnvInPlace(t){if(t.isEmpty())return;const s=(0,e.m)(e.P,4);t.queryCorners(s),this.transformPoints2D(s,4,s),t.setFromPoints(s,4)}queryTransformEnv(t,s){(0,o.g)(0)}transformPoints2D(t,s,i){for(let o=0;o<s;++o)this.queryTransform(t[o],i[o])}transformInterleavedPoints(t,s,i){s*=2;const o=e.P.getNAN();for(let e=0;e<s;e+=2)o.x=t[e],o.y=t[e+1],this.transformInPlace(o),i[e]=o.x,i[e+1]=o.y}multiply(t){return a.st_multiply(this,t,this),this}mulLeft(t){return(0,o.g)(0),this}static st_multiply(t,s,i){const o=t.xx*s.xx+t.yx*s.xy,e=t.xy*s.xx+t.yy*s.xy,h=t.xd*s.xx+t.yd*s.xy+s.xd,r=t.xx*s.yx+t.yx*s.yy,a=t.xy*s.yx+t.yy*s.yy,l=t.xd*s.yx+t.yd*s.yy+s.yd;i.xx=o,i.xy=e,i.xd=h,i.yx=r,i.yy=a,i.yd=l}getCoefficients(t){(0,o.g)(t.length>=6),t[0]=this.xx,t[1]=this.xy,t[2]=this.xd,t[3]=this.yx,t[4]=this.yy,t[5]=this.yd}setCoefficients(t){(0,o.g)(t.length>=6),this.xx=t[0],this.xy=t[1],this.xd=t[2],this.yx=t[3],this.yy=t[4],this.yd=t[5]}copyTo(t){(0,o.g)(0)}initializeFromRect(t,s){t.isEmpty()||s.isEmpty()||!t.width()||!t.height()?this.setZero():(this.xy=this.yx=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xd=s.xmin-t.xmin*this.xx,this.yd=s.ymin-t.ymin*this.yy)}initializeFromRectIsotropic(t,s){if(t.isEmpty()||!t.width()||!t.height()||s.isEmpty())this.setZero();else{this.yx=0,this.xy=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xx>this.yy?this.xx=this.yy:this.yy=this.xx;const i=s.getCenter(),o=t.getCenter();this.xd=i.x-o.x*this.xx,this.yd=i.y-o.y*this.yy}}initializeFromTwoPointsArray(t,s){if(t[0].equals(s[0])&&t[1].equals(s[1]))return void this.setIdentity();if(t[0].equals(t[1])){if(s[0].equals(s[1]))return void this.setShift(s[0].sub(t[0]));(0,o.a)("")}if(!t[0].equals(t[1])&&s[0].equals(s[1]))return this.setZero(),void this.shift(s[0]);this.setShiftCoords(-t[0].x,-t[0].y);const i=e.P.distance(t[0],t[1]),h=e.P.distance(s[0],s[1]),r=h/i;this.scale(r,r);const a=t[1].sub(t[0]);a.divThis(i);const l=s[1].sub(s[0]);l.divThis(h);const y=a.crossProduct(l),n=a.dotProduct(l);this.rotate(n,y),this.shiftCoords(s[0].x,s[0].y)}initializeFromTwoPoints(t,s,i,o){const e=[t,s],h=[i,o];this.initializeFromTwoPointsArray(e,h)}transformSizeInPlace(t){(0,o.g)(0)}transformSize(t,s){(0,o.g)(0)}transformTol(t){return(0,o.g)(0),0}transformWithoutTranslateArray(t,s,i){for(let o=0;o<s;++o)this.transformWithoutTranslate(t[o],i[o])}transformWithoutTranslateInPlace(t){const s=this.xx*t.x+this.xy*t.y,i=this.yx*t.x+this.yy*t.y;t.setCoords(s,i)}transformWithoutTranslate(t,s){const i=this.xx*t.x+this.xy*t.y,o=this.yx*t.x+this.yy*t.y;s.setCoords(i,o)}setIdentity(){this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=1,this.yd=0}isIdentity(){return!(1!==this.xx||1!==this.yy||this.xy||this.xd||this.yx||this.yd)}isIdentityTol(t){const s=t*t;return!((0,e.a)(this.xd)+(0,e.a)(this.yd)>s||(0,e.a)(this.xy+this.xd)+(0,e.a)(this.yy+this.yd-1)>s||(0,e.a)(this.xx+this.xd-1)+(0,e.a)(this.yx+this.yd)>s)}isReflective(){return this.xx*this.yy-this.yx*this.xy<0}isUniform(t){const s=this.xx*this.xx+this.yx*this.yx,i=this.xy*this.xy+this.yy*this.yy,o=(s+i)*t;return Math.abs(s-i)<=o&&Math.abs(this.xx*this.xy+this.yx*this.yy)<=o}isUniformNoRotation(){return 0!==this.xx&&Math.abs(this.xx)===Math.abs(this.yy)&&0===this.xy&&0===this.yx}isTranslate(){return 1===this.xx&&1===this.yy&&!this.xy&&!this.yx}isTranslateTol(t){const s=new e.P;return s.setCoords(0,1),this.transformWithoutTranslateInPlace(s),s.y-=1,!(s.sqrLength()>t*t)&&(s.setCoords(1,0),this.transformWithoutTranslateInPlace(s),s.x-=1,s.sqrLength()<=t*t)}isOrthonormal(t){const s=new a;return s.xx=this.xx*this.xx+this.xy*this.xy,s.xy=this.xx*this.yx+this.xy*this.yy,s.yx=this.yx*this.xx+this.yy*this.xy,s.yy=this.yx*this.yx+this.yy*this.yy,s.xd=0,s.yd=0,s.isIdentityTol(t)}isDegenerate(t){return Math.abs(this.xx*this.yy-this.yx*this.xy)<=2*t*(Math.abs(this.xx*this.yy)+Math.abs(this.yx*this.xy))}isZero(){return 0===this.xx&&0===this.yy&&0===this.xy&&0===this.yx&&0===this.xd&&0===this.yd}isScaleAndTranslateTol(t){return this.xy*this.xy+this.yx*this.yx<=(this.xx*this.xx+this.yy*this.yy)*t}setTranslate(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShiftCoords(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShift(t){return this.xx=1,this.xy=0,this.xd=t.x,this.yx=0,this.yy=1,this.yd=t.y,this}setScaleCoords(t,s){return this.xx=t,this.xy=0,this.xd=0,this.yx=0,this.yy=s,this.yd=0,this}setScale(t){return this.setScaleCoords(t,t),this}setFlipX(t,s){return this.xx=-1,this.xy=0,this.xd=t+s,this.yx=0,this.yy=1,this.yd=0,this}setFlipY(t,s){return this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=-1,this.yd=t+s,this}setShear(t,s){return this.xx=1,this.xy=t,this.xd=0,this.yx=s,this.yy=1,this.yd=0,this}scale(t,s){return this.xx*=t,this.xy*=t,this.xd*=t,this.yx*=s,this.yy*=s,this.yd*=s,this}setRotateAngle(t){return this.setRotate(Math.cos(t),Math.sin(t))}setRotate(t,s){return this.xx=t,this.xy=-s,this.xd=0,this.yx=s,this.yy=t,this.yd=0,this}setRotateAngleAbout(t,s){return this.setRotateAbout(Math.cos(t),Math.sin(t),s)}setRotateAbout(t,s,i){return this.setTranslate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}setSwapCoordinates(){return this.xx=0,this.xy=1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}setRotateCw90(){return this.xx=0,this.xy=1,this.xd=0,this.yx=-1,this.yy=0,this.yd=0,this}setRotateCcw90(){return this.xx=0,this.xy=-1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}shiftCoords(t,s){return this.xd+=t,this.yd+=s,this}shift(t){return this.xd+=t.x,this.yd+=t.y,this}translate(t,s){return this.xd+=t,this.yd+=s,this}flipX(t,s){return this.xx=-this.xx,this.xy=-this.xy,this.xd=t+s-this.xd,this}flipY(t,s){return this.yx=-this.yx,this.yy=-this.yy,this.yd=t+s-this.yd,this}shear(t,s){const i=new a;return i.setShear(t,s),this.multiply(i)}rotateAngle(t){const s=new a;return s.setRotateAngle(t),this.multiply(s)}rotate(t,s){const i=new a;return i.setRotate(t,s),this.multiply(i)}rotateAbout(t,s,i){return this.translate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}rotateAngleAbout(t,s){return this.rotateAbout(Math.cos(t),Math.sin(t),s)}setInvert(t){return this.set(t),this.invertThis()}invertThis(){let t=this.xx*this.yy-this.xy*this.yx;if(0===t)return this.setZero(),this;t=1/t;const s=(this.xy*this.yd-this.xd*this.yy)*t,i=(this.xd*this.yx-this.xx*this.yd)*t,o=this.yy*t,e=-this.xy*t,h=-this.yx*t,r=this.xx*t;return this.xd=s,this.yd=i,this.xx=o,this.yy=r,this.xy=e,this.yx=h,this}invertPrecise(t){return this.set(t),this.invertPreciseThis()}invertPreciseThis(){const t=e.M.constructDouble(this.xy),s=e.M.constructDouble(this.xx),i=s.mulDouble(this.yy).sub(t.mulDouble(this.yx));if(i.isZero())return this.setZero(),this;const o=i.clone();o.invertThis();const h=e.M.constructDouble(this.xd),r=t.mulDouble(this.yd).sub(h.mulDouble(this.yy)).mul(o).toDouble(),a=h.mulDouble(this.yx).sub(s.mulDouble(this.yd)).mul(o).toDouble(),l=o.mulDouble(this.yy).toDouble(),y=o.mulDouble(-this.xy).toDouble(),n=o.mulDouble(-this.yx).toDouble(),x=o.mulDouble(this.xx).toDouble();return this.xd=r,this.yd=a,this.xx=l,this.yy=x,this.xy=y,this.yx=n,this}extractScaleTransform(t,s){const i=Math.sqrt(this.xx*this.xx+this.xy*this.xy),o=Math.sqrt(this.yx*this.yx+this.yy*this.yy);s.setScaleCoords(1/i,1/o),s.multiply(this),t.setScaleCoords(i,o)}setFromTwoTriangles(t,s){let i=!0;for(let o=0;o<3;++o)i=i&&t[o].equals(s[o]);if(i)return this.setIdentity(),!0;const o=new e.P;o.setSub(t[0],t[1]);const h=new e.P;h.setSub(t[0],t[2]);const r=new e.P;r.setSub(s[0],s[1]);const a=new e.P;a.setSub(s[0],s[2]);const l=4*Number.EPSILON*(Math.abs(o.x*h.y)+Math.abs(h.x*o.y));let y=o.x*h.y-o.y*h.x;return Math.abs(y)>l?(y=1/y,this.xx=(r.x*h.y-o.y*a.x)*y,this.xy=(o.x*a.x-r.x*h.x)*y,this.yx=(r.y*h.y-o.y*a.y)*y,this.yy=(o.x*a.y-r.y*h.x)*y,this.xd=s[0].x-(this.xx*t[0].x+this.xy*t[0].y),this.yd=s[0].y-(this.yx*t[0].x+this.yy*t[0].y),!0):(this.setZero(),!1)}initializeFromControlPoints(t,s,i,h,n=null){return 0===s?(this.setIdentity(),void(n&&n.setIdentity())):1===s?(this.setShift(h[0].sub(i[0])),void(n&&n.setShift(i[0].sub(h[0])))):(s<3&&(t=1),void(4===t&&s>2?function(t,s,i,h,a){const l=e.P.average(i,s),n=e.P.average(h,s),x=new r({NN:2,MM:2});x.setZero();const w=new r({NN:2,MM:2});w.setZero();for(let t=0;t<s;++t)x.setRowCol(0,0,x.atRowCol(0,0)+(i[t].x-l.x)*(i[t].x-l.x)),x.setRowCol(0,1,x.atRowCol(0,1)+(i[t].x-l.x)*(i[t].y-l.y)),x.setRowCol(1,1,x.atRowCol(1,1)+(i[t].y-l.y)*(i[t].y-l.y)),w.setRowCol(0,0,w.atRowCol(0,0)+(h[t].x-n.x)*(i[t].x-l.x)),w.setRowCol(0,1,w.atRowCol(0,1)+(h[t].x-n.x)*(i[t].y-l.y)),w.setRowCol(1,0,w.atRowCol(1,0)+(h[t].y-n.y)*(i[t].x-l.x)),w.setRowCol(1,1,w.atRowCol(1,1)+(h[t].y-n.y)*(i[t].y-l.y));x.setRowCol(1,0,x.atRowCol(0,1));const u=new r({NN:2,MM:2});x.pseudoInverse(u,!0)||(0,o.b)("Failed to compute pseudo inverse"),w.mul(u,w),y(t,w);const C=l.clone();t.transformInPlace(C),t.xd=n.x-C.x,t.yd=n.y-C.y,a&&(w.pseudoInverse(u,!1)||(0,o.b)("Failed to compute pseudo inverse"),y(a,u),a.transformInPlace(n),a.xd=l.x-n.x,a.yd=l.y-n.y)}(this,s,i,h,n):function(t,s,i,h,n,x){(0,o.g)(1===t||0===t||2===t||3===t),s.setIdentity();const w=e.P.average(h,i),u=e.P.average(n,i);if((0,o.g)(t<l.length&&t>0),8&l[t]){const e=new r({NN:2,MM:2});e.setZero();for(let t=0;t<i;++t)e.setRowCol(0,0,e.atRowCol(0,0)+(n[t].x-u.x)*(h[t].x-w.x)),e.setRowCol(1,0,e.atRowCol(1,0)+(n[t].x-u.x)*(h[t].y-w.y)),e.setRowCol(0,1,e.atRowCol(0,1)+(n[t].y-u.y)*(h[t].x-w.x)),e.setRowCol(1,1,e.atRowCol(1,1)+(n[t].y-u.y)*(h[t].y-w.y));const x=new r({NN:2,MM:2}),C=new r({NN:2,MM:1}),f=new r({NN:2,MM:2});e.svd(x,C,f)||(0,o.b)("Failed to compute svd");const R=new r({NN:2,MM:2});x.transpose(R);const d=new r({NN:2,MM:2});f.mul(R,d),32&l[t]||d.determinant()<0&&(R.setRowCol(1,0,-R.atRowCol(1,0)),R.setRowCol(1,1,-R.atRowCol(1,1)),f.mul(R,d));const c=new a;y(c,d),s.set(c)}if(2&l[t]){let t=0,o=0;for(let e=0;e<i;++e){const i=h[e].sub(w);t+=i.sqrLength(),s.transformInPlace(i),o+=i.dotProduct(n[e].sub(u))}if(0===t)0===o?s.setIdentity():s.setZero();else{const i=o/t;s.scale(i,i)}}else(0,o.g)(!(4&l[t]));const C=w.clone();s.transformInPlace(C),s.xd=u.x-C.x,s.yd=u.y-C.y,x&&(x.set(s),x.invertThis(),x.isZero()&&(x.xd=w.x,x.yd=w.y))}(t,this,s,i,h,n)))}calculateErrors(t,s,i,h){(0,o.g)(t>0&&null!==s&&null!==i);let r=0;for(let o=0;o<t;++o){const t=this.transform(s[o]),a=e.P.sqrDistance(i[o],t);r+=a,h&&(h[o]=Math.sqrt(a))}return Math.sqrt(r/t)}}const l=[43,11,41,9,61];function y(t,s){(0,o.g)(!(2!==s.rows()&&3!==s.rows()||2!==s.cols()&&3!==s.rows())),t.xx=s.atRowCol(0,0),t.xy=s.atRowCol(0,1),t.yx=s.atRowCol(1,0),t.yy=s.atRowCol(1,1),3===s.cols()?(t.xd=s.atRowCol(0,2),t.yd=s.atRowCol(1,2)):(t.xd=0,t.yd=0)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{55537:(t,s,e)=>{function i(t,s){try{if(!t)throw new Error(s)}catch(t){throw t}}e.d(s,{A:()=>f,B:()=>k,C:()=>G,D:()=>Z,G:()=>m,a:()=>w,b:()=>A,c:()=>z,d:()=>R,e:()=>_,f:()=>d,g:()=>i,h:()=>x,i:()=>p,j:()=>N,k:()=>b,l:()=>v,m:()=>g,n:()=>E,o:()=>B,p:()=>D,q:()=>q,r:()=>T,s:()=>C,t:()=>M,u:()=>P,v:()=>y,w:()=>F,x:()=>I,y:()=>S,z:()=>L});class n extends Error{constructor(t,s){super(s),this.m_AdditionalMessage=s,this.m_ErrorType=t,this.name="GeometryError"}what(){return function(t){switch(t){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 22:return"Operation is canceled by the user";case 21:return"The operation, such as projection or geodetic computation, cannot be performed without pe-wasm loaded";default:return"unknown error"}}(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends n{constructor(t){super(2,t),this.name="CorruptedGeometryError"}}class u extends n{constructor(t){super(3,t),this.name="EmptyGeometryError"}}class h extends n{constructor(t){super(4,t),this.name="MathSingularityError"}}class o extends n{constructor(t){super(21,t),this.name="ProjectionEngineNotLoadedError"}}class a extends n{constructor(t){super(8,t),this.name="NonSimpleGeometryError"}}var m,c;(c=m||(m={}))[c.enumUnknown=0]="enumUnknown",c[c.enumPoint=513]="enumPoint",c[c.enumLine=5122]="enumLine",c[c.enumBezier=5123]="enumBezier",c[c.enumEllipticArc=5124]="enumEllipticArc",c[c.enumEnvelope=3077]="enumEnvelope",c[c.enumMultiPoint=8710]="enumMultiPoint",c[c.enumPolyline=25607]="enumPolyline",c[c.enumPolygon=27656]="enumPolygon",c[c.enumMultipatch=40969]="enumMultipatch",c[c.enumGeometryCollection=3594]="enumGeometryCollection",c[c.enumRationalBezier2=5134]="enumRationalBezier2",c[c.enumBezier2=5135]="enumBezier2",c[c.enumRationalBezier23d=5392]="enumRationalBezier23d",c[c.enumGreatArc3d=5393]="enumGreatArc3d";const l=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function f(t){return l[15&t]}function _(t){return!!(512&t)}function v(t){return!!(1024&t)}function b(t){return!!(2048&t)}function d(t){return!!(4096&t)}function p(t){return!!(8192&t)}function x(t){return!!(16384&t)}function N(t){return!!(32768&t)}function y(t){const s=t.getGeometryType();return p(s)?t.getPointCount():t.isEmpty()?0:s===m.enumEnvelope?4:s===m.enumPoint?1:d(s)?2:void z("missing type")}function g(t){const s=t.getGeometryType();if(x(s))return t.hasNonLinearSegments();if(s===m.enumGeometryCollection){const s=t;for(let t=0,e=s.getGeometryCount();t<e;t++)if(g(s.getGeometry(t)))return!0;return!1}return!!d(s)&&s!==m.enumLine}function T(t){throw new o(t)}function E(t){throw new r(t)}function M(t){throw new Error(t)}function w(t){throw new h(t)}function I(){M("Geometry type is not supported for 3D operations.")}function D(t){throw new n(12,t)}function P(t){throw new u(t)}function A(t){throw new n(14,t)}function q(t){throw new Error(t)}function z(t){throw new n(13,t)}function C(t){throw new Error(t)}function Z(t){throw new a(t)}function B(t){t&&g(t)&&A("Operation does not support curves.")}function R(t){t&&N(t.getGeometryType())&&A("Unsupported geometry type.")}function G(t){t===m.enumGeometryCollection&&M("Geometry_collection instances are not supported in this operation")}function k(t){G(t.getGeometryType())}function S(t){M(`bad wkid: ${t}`)}function L(t){let s="bad wkt: ";s+=t,s+="...",M(s)}function F(t,s){t||M(s)}},83661:(t,s,e)=>{e.d(s,{$:()=>y,A:()=>fs,B:()=>at,C:()=>vt,D:()=>ps,E:()=>a,F:()=>c,G:()=>p,H:()=>d,I:()=>jt,J:()=>Ns,K:()=>n,L:()=>Mt,M:()=>qs,N:()=>xs,O:()=>Pt,P:()=>ks,Q:()=>Z,R:()=>B,S:()=>At,T:()=>ot,U:()=>_t,V:()=>D,W:()=>P,X:()=>bt,Y:()=>Yt,Z:()=>R,_:()=>N,a:()=>mt,a0:()=>A,a1:()=>q,a2:()=>z,a3:()=>Vt,a4:()=>zt,a5:()=>Es,a6:()=>Ds,a7:()=>ws,a8:()=>Ms,a9:()=>it,aA:()=>Bs,aB:()=>Gs,aC:()=>M,aD:()=>hs,aE:()=>Wt,aF:()=>Lt,aG:()=>as,aH:()=>os,aa:()=>nt,ab:()=>Bt,ac:()=>gt,ad:()=>x,ae:()=>Cs,af:()=>zs,ag:()=>S,ah:()=>Ts,ai:()=>et,aj:()=>V,ak:()=>L,al:()=>Ps,am:()=>dt,an:()=>ds,ao:()=>Jt,ap:()=>ct,aq:()=>us,ar:()=>ms,as:()=>wt,at:()=>ls,au:()=>Et,av:()=>I,aw:()=>rs,ax:()=>gs,ay:()=>xt,az:()=>Rs,b:()=>lt,c:()=>ys,d:()=>Dt,e:()=>F,f:()=>w,g:()=>bs,h:()=>Nt,i:()=>Xt,j:()=>Ht,k:()=>Ct,l:()=>Zt,m:()=>Tt,n:()=>qt,o:()=>st,p:()=>It,q:()=>C,r:()=>$t,s:()=>k,t:()=>O,u:()=>pt,v:()=>ft,w:()=>yt,x:()=>G,y:()=>g,z:()=>E});var i=e(55537);class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=tt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let e;if(Math.abs(this.sum)>=Math.abs(t)){const i=this.sum-s+t;e=this.compensation+i}else{const i=t-s+this.sum;e=this.compensation+i}this.sum=s,this.compensation=e}sub(t){this.add(-t)}addProduct(t,s){const e=[0],i=W(t,s,e);this.add(i),this.add(e[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],u=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function h(t){let s=0;return 65535n&t||(s+=16,t>>=16n),255n&t||(s+=8,t>>=8n),15n&t||(s+=4,t>>=4n),s+r[Number(BigInt.asUintN(4,t))]}function o(t){let s=0;return 4294967295n&t||(s=32,t>>=32n),s+h(BigInt.asUintN(32,t))}class a{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof a)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new a(t,s)}static constructEmpty(){return new a}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return Vt(this.vmin,t)&&Vt(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,e=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(e)}mergeNe(t){const s=t.vmin,e=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(e)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=lt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return ys(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?bs():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*bs()}static unit(){return m}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=lt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new a(this.vmin,this.vmax)}}const m=new a(0,1);class c{static getNAN(){return new c(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new c(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=c.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new c(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}addThis(t){const s=this.m_value+t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subThis(t){const s=this.m_value-t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=c.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=c.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+c.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+c.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const e=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+c.ulp(e),this.m_value=e,this}setMul(t,s){return this.m_value=t*s,this.m_eps=c.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new c(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),e=this.m_value/t.m_value;let i=(this.m_eps+Math.abs(e)*t.m_eps)/s;if(t.m_eps>.01*s){const e=t.m_eps/s;i*=1+(1+e)*e}return this.m_value=e,this.m_eps=i+c.ulp(e),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+c.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=c.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(p.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=c.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+c.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=s;const i=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(e)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static ulp(t){let s=Ft(t);const e=((0x7ff0000000000000n&s)>>52n)-1075n;return e>-1023n?(s=e+0x3ffn<<52n,function(t){return kt[0]=t,Gt[0]}(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=e;const i=Math.abs(e),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static st_cosAndSin(t,s,e){const i=Math.sin(t.m_value),n=Math.cos(t.m_value);e.m_value=i,s.m_value=n;const r=Math.abs(i),u=Math.abs(n),h=Math.abs(t.value());e.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+c.ulp(r+h),s.m_eps=(Math.abs(i)+.5*u*t.m_eps)*t.m_eps+c.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return a.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(b)}setEuler(){this.set(2.718281828459045,v())}static size(){return 1}}function l(t,s){const e=Ot(t),i=Ot(s),n=53-o(e),r=53-o(i);return(n>=0?n:0)+(r>=0?r:0)<=52}function f(t,s){const e=t+s;return e-t===s&&e-s===t}function _(t,s){const e=t-s;return t-e===s&&s+e===t}function v(){return xs()}c.dimensions=1;const b=new c(Math.PI,.5*v()),d=new c(0,0),p=new c(1,0),x=new c(4,0);function N(t,s,e){return t.addE(s.subE(t).mulE(e))}function y(t,s,e){return s.subE(s.subE(t).mulE(p.subE(e)))}function g(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=function(t){return Math.atanh(t)}(t)/t;else{let e;const i=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(i/Math.log(n)+2.5)-1;t>1;t-=2)e=1/t,s=(s+e)*n;s+=1}return s}function T(t){const s=Math.PI*Math.PI/6;let e;if(1===t)e=s;else if(t>1)e=s;else if(0===t)e=t;else if(t<0){const s=1+(t=Math.abs(t)),i=Math.log(s);e=i*i/-2-T(t/s)}else if(t>.5){const i=1-t,n=Math.log(t)*Math.log(i);e=s-T(i)-n}else{e=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let i=s;for(let n=s;n>0;n--,i-=1)e*=t,e+=1/(i*i);e*=t}return e}function E(t,s){const e=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=e,s+=1/t/t;return s*=t,s}return T(e)/s}function M(t,s){return t<s?qt(t,s):qt(s,t)}function w(t,s){const e=Math.abs(t);return s>=0?e:-e}function I(t){return Math.round(t)}function D(t,s,e,i,n){n[0]=s[0]+(e[0]-s[0])*i,n[1]=s[1]+(e[1]-s[1])*i,3===t&&(n[2]=s[2]+(e[2]-s[2])*i)}function P(t,s,e,i,n){n[0]=e[0]-(e[0]-s[0])*(1-i),n[1]=e[1]-(e[1]-s[1])*(1-i),3===t&&(n[2]=e[2]-(e[2]-s[2])*(1-i))}function A(t,s,e,i,n){i<=.5?D(t,s,e,i,n):P(t,s,e,i,n)}function q(t,s,e,i,n){n[0]=s[0].addE(e[0].subE(s[0]).mulE(i)),n[1]=s[1].addE(e[1].subE(s[1]).mulE(i))}function z(t,s,e,i,n){n[0]=e[0].subE(e[0].subE(s[0]).mulE(p.subE(i))),n[1]=e[1].subE(e[1].subE(s[1]).mulE(p.subE(i)))}function C(t,s,e){let i;return i=e<=.5?t+(s-t)*e:s-(s-t)*(1-e),i}function Z(t,s,e){return t+(s-t)*e}function B(t,s,e){return s-(s-t)*(1-e)}function R(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e))}function G(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e,i.z=t.z+(s.z-t.z)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e),i.z=s.z-(s.z-t.z)*(1-e))}function k(t){return t*t}function S(t){return t*t*t}function L(t){return 1/Math.sqrt(t)}function F(t){return t<0?-1:t>0?1:0}function O(t,s,e,i){const n=[0],r=[0],u=[0];return tt(W(t,e,n),W(s,i,r),u)+(n[0]+r[0]+u[0])}const Q=[0],U=[0];function V(t,s,e){return function(t,s,e,i){const n=tt(t,s,J),r=tt(n,e,K);return tt(r,J[0]+K[0],i)}(W(t,s,Q),e,Q[0],U)}const j=[0],Y=[0],$=[0],H=[0];function W(t,s,e){const i=t*s;return X(t,j,Y),X(s,$,H),e[0]=Y[0]*H[0]-(i-j[0]*$[0]-Y[0]*$[0]-j[0]*H[0]),i}function X(t,s,e){const i=134217729*t;s[0]=i-(i-t),e[0]=t-s[0]}const J=[0],K=[0];function tt(t,s,e){const i=t+s;return Math.abs(t)>Math.abs(s)?e[0]=t-i+s:e[0]=s-i+t,i}function st(t,s){return t%s}function et(t){const s=1-t;if(0===s)return 1;let e;if(s<=.01){const t=s,i=Math.log(t);e=1+t*(.4431471805599453-.25*i+t*(.05680519270997949-.09375*i+t*(.02183137044373718-.05859375*i+t*(.011544521417308362-.042724609375*i+t*(.00714200031339596-.0336456298828125*i+t*(.004854743337164948-.027757644653320312*i+t*(.003514687963781376-.023627042770385742*i)))))))}else{if(t<.016){const s=t,e=.25,i=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,o=.0033752918243408203,a=.0025710230693221092;return ws()*(1-s*(e+s*(i+s*(n+s*(r+s*(u+s*(h+s*(o+s*a))))))))}e=rt(0,s,1)-t*ut(0,s,1)/3}return ys(e,1,ws())}function it(t,s,e=Number.NaN){if((0,i.g)(s>=0&&s<=1),0===s)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===s){const t=Math.round(r/Es()),s=r-t*Es();return n*(2*t+Math.sin(s))}const u=ws(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const o=Math.sin(r),a=Number.isNaN(e)?et(s):e;let m;if(1===o)m=a+Math.sqrt(1-s)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*xs())m=r*(1+t*s*(-1/6+t*((4-3*s)/120-(16+(45*s-60)*s)/5040*t)));else if(s<=.01){const t=Math.sin(2*r),e=Math.sin(4*r),i=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+s*((2*-r+t)/8+s*((-3*r+2*t-.25*e)/64+s*((-20*r+15*t-3*e+i/3)/1024+s*(5*(-140*r+112*t-28*e+16/3*i-.5*n)/65536+7*s*((-63*r+52.5*t-15*e+3.75*i-.625*n+.05*u)/65536+s*(-693*r+594*t-185.625*e+1.375*i-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=o*o,e=Math.cos(r),i=e*e,n=ht(o,e,s);m=o*(rt(i,n,1)-s*t*ut(i,n,1)/3)}}return 1&h?m=a*(h+1)-m:m+=a*h,n*m}function nt(t,s,e=Number.NaN){if(0===t)return 0;let i=1,n=t;t<0&&(n=-n,i=-1);const r=Number.isNaN(e)?et(s):e,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?ws():function(t,s,e){if(0===s)return t;if(1===s)return Math.asin(t);let i=0,n=!0;if(t<.2){const e=t*t,r=t*(1+e*s*(1/6+e*((13*s-4)/120+(16-284*s+493*s*s)/5040*e))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*xs())return r;i=r,n=u>.1*r}if(n){const n=1-s,r=1-t/e,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+xs());i=ws()+Math.sqrt(u)*(h-ws())}let r=0;for(let n=0;n<7;n++){r=it(i,s,e);const u=ht(Math.sin(i),Math.cos(i),s);if(i-=(r-t)/Math.sqrt(u),n>0&&Math.abs(r-t)<=4*xs()*t)break}return i}(n,s,r);return 1&u?h=ws()*(u+1)-h:h+=ws()*u,i*h}function rt(t,s,e){(0,i.g)((0!==t?1:0)+(0!==s?1:0)+1>1);let n=t,r=s,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,e=(s-n)/s,i=(s-r)/s,h=(s-u)/s;if(Math.abs(e)<=.0024&&Math.abs(i)<=.0024&&Math.abs(h)<=.0024){const t=e*i-h*h,n=e*i*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function ut(t,s,e){(0,i.g)(0!==t||0!==s);let r=t,u=s,h=e;const o=new n(0);let a=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,e=(t-u)/t,i=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(e)<=.0015&&Math.abs(i)<=.0015){const n=s*e,r=i*i,u=n-r,h=n-6*r,m=h+u+u,c=3/26,l=h*(9/22*.25*h-.21428571428571427-1.5*c*i*m),f=i*(1/6*m+i*(-.4090909090909091*u+i*c*n));return 3*o.getResult()+a*(1+l+f)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),c=Math.sqrt(h),l=n*(m+c)+m*c;o.add(a/(c*(h+l))),a*=.25,r=.25*(r+l),u=.25*(u+l),h=.25*(h+l)}}function ht(t,s,e){return t<.999?1-e*k(t):1-e+e*k(s)}function ot(t,s,e,n,r){return 0===t?0===n?s:1===n?e:r:1===t?0===n?s:1===n?e:C(s,e,n):(2===t&&(0,i.b)("angular interpolation"),void(0,i.b)(""))}function at(t,s,e,n,r,u,h,o){if(0===t)for(let t=0;t<u;++t)n[t+r]=0===h?s[t]:1===h?e[t]:o;else if(1===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=C(s[t],e[t],h);else if(2===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else{let t=0;for(let i=0,o=r;i<u;++i,++o)n[o]=C(s[i],e[i],h),t+=n[o]*n[o];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else(0,i.b)("")}function mt(t,s,e,i,n){if(0===n)return;let r=0,u=e,h=i;for(;r++<n;)t[u++]=s[h++]}function ct(t,s,e){let i=0;for(let n=0;!i&&n<e;++n)i=t[n]-s[n];return i}function lt(t,s){return t}function ft(t){t.sort(((t,s)=>t<s?-1:t>s?1:0))}function _t(t,s){const e=t.slice(0,s);ft(e),mt(t,e,0,0,s)}function vt(t,s,e,i){const n=t.slice(s,s+e);n.sort(i),mt(t,n,s,0,e)}function bt(t,s){return t<s?-1:t>s?1:0}function dt(t,s,e,i){return t<e?-1:t>e?1:s<i?-1:s>i?1:0}function pt(t,s){if(t.length<2)return t.length;let e=0;for(let i=1;i<t.length;++i)s(t[i],t[e])||(e++,t[i]=lt(t[e],t[e]=t[i]));return 1+e}function xt(t,s){t[s]=t.at(-1),t.pop()}function Nt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function yt(t,s,e){t.length=s,t.fill(e)}function gt(t,s,e){t.length=e;for(let i=0;i<e;++i)t[i]=new s}function Tt(t,s){const e=new Array(s);for(let i=0;i<s;++i)e[i]=new t;return e}function Et(t,s,e){for(let i=0;i<e;++i)t[i].assign(s[i]);return e}function Mt(t,s){const e=t.slice(0,s);for(let t=0;t<s;++t)e[t]=e[t].clone();return e}function wt(t){return Array.from({length:t},(()=>null))}function It(t,s){return Array.from({length:s},(()=>t()))}function Dt(t,s){const e=new Array(t);return e.fill(s),e}function Pt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class At{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function qt(t,s){return{first:t,second:s}}const zt=Math.PI,Ct=2*Math.PI,Zt=.5*Math.PI;class Bt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Dt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,e){this.m_v[t*this.m_cc+s]=e}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const Rt=new ArrayBuffer(8),Gt=new Float64Array(Rt),kt=new BigUint64Array(Rt),St=0x0fffffffffffffn;function Lt(){return Number.EPSILON*vs}function Ft(t){return Gt[0]=t,kt[0]}function Ot(t){return Ft(t)&St}function Qt(t){return Number((9218868437227405312n&Ft(t))>>52n)}function Ut(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,e=512n,i=1n<<s+e;for(;t>=i;)s+=e,e<<=1n,i<<=e;let n=s;e>>=1n;let r=n+e;for(;e>0n;)t<1n<<r||(n=r),e>>=1n,r=n+e;return n}function Vt(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function jt(t,s,e){return t===s||Math.abs(t-s)<=e||Number.isNaN(t)&&Number.isNaN(s)}function Yt(t,s){return t<s?-1:t>s?1:0}function $t(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const e=Number.isNaN(t),i=Number.isNaN(s);return e<i?-1:e>i?1:0}}function Ht(){return 2147483647}function Wt(){return 32767}function Xt(){return 2147483647}function Jt(){return-2147483648}const Kt=2147483647,ts=BigInt(Kt),ss=2166136261,es=16777619,is=14695981039346656037n,ns=1099511628211n;function rs(t){let s=ss;for(let e=0,i=t.length;e<i;++e)s=(s^t.charCodeAt(e))*es;return s&Kt}function us(t,s){return s+2654435769+(t<<6)+(t>>2)&Kt}function hs(t,s){return us(t,cs(s))}function os(t){return us(3735928559,t)}function as(t,s){return us(t,os(s))}function ms(t){return function(t){let s=ss,e=t;return s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,s&Kt}(t)}function cs(t){return Number(function(t){let s=is,e=t;return s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,s&ts}(t))}function ls(t){return cs(Ft(function(t){return Ps(t)}(t)))}function fs(t){return function(t){return 1103515245*t+12345&2147483647}(t)}const _s=100,vs=100;function bs(){return Number.EPSILON*_s}function ds(){return.38196601125010515}function ps(){return 1.4142135623730951}function xs(){return Number.EPSILON}function Ns(t,s,e){return t===s||t===e}function ys(t,s,e){return t>=s?t<=e?t:e:s}function gs(t,s,e){const i=t[0];if(i>=s){if(i<=e)return!1;t[0]=e}else t[0]=s;return!0}function Ts(t,s){return t>=s?s:t<-s?-s:t}function Es(){return zt}function Ms(){return Ct}function ws(){return Zt}const Is=3*ws();function Ds(){return Is}function Ps(t){return t+0}function As(t){return{v:t}}class qs{constructor(){this.m_rn=As(0n),this.m_rd=As(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const e=t.clone();return void 0!==s&&e.limitPrecisionThis(s),e}static constructDouble(t){return(new qs).setDouble(t)}static constructInt64(t){return(new qs).setInt64(t)}static constructRational(t,s){return(new qs).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new qs).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(t){if(this.setZero(),0===t)return this;if(Number.isInteger(t)&&Math.abs(t)<2147483647)return this.setInt32(t);const s=Ft(t),e=(s&qs.s_em)>>52n,n=!!(s&qs.s_sm),r=s&qs.s_fm;if(e===qs.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&(0,i.b)("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,o=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+o,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&0n===this.m_rd.v&&1===this.m_sign}isNegativeInf(){return!this.isNAN()&&0n===this.m_rd.v&&-1===this.m_sign}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return(0,i.g)(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(qs.constructDouble(t))}thisMulInt64(t){return(0,i.g)(0),this}thisMulInt32(t){return(0,i.g)(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(qs.constructDouble(t))}addDoubleThis(t){return this.addThis(qs.constructDouble(t))}subDoubleThis(t){return this.subThis(qs.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(qs.constructInt64(t))}mulDouble(t){return this.clone().mulThis(qs.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(qs.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(qs.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=h(BigInt.asUintN(32,s))-1;let e=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,e+=32;return s&=this.m_rd.v,s>>=BigInt(e),e+=h(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(e),this.m_power+=t-e,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=lt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(Ut(this.m_rn.v));if(s>t){const e=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=e}if(s=Number(Ut(this.m_rd.v)),s>t){const e=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=e}return this}hiBitIndex(){return Math.max(Number(Ut(this.m_rn.v)),Number(Ut(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,s){if(t.m_sign<0n&&(0,i.q)("MP_value: sqrt(-1)"),t.isZero())return t.clone();let e=52,n=2220446049250313e-31;for(;e<s;)2*e<=s?(n*=n,e*=2):(n*=2220446049250313e-31,e+=52);e+=52;const r=Ut(t.m_rn.v),u=Ut(t.m_rd.v);let h,o=t.m_power+Number(r-u);const a=new qs;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),h=qs.constructAssign(t,53).ldexpThis(-o).value(),a.setThis(t).ldexpThis(-o),(0,i.g)(Number.isFinite(h))):(a.setThis(t),h=a.value(),(0,i.g)(Number.isFinite(h)),o=0),h=Math.sqrt(h);const m=qs.constructDouble(h),c=qs.constructDouble(n);c.mulThis(m).ldexpThis(1);const l=n*h*2,f=m.clone(),_=new qs;let v;for(let t=0;t<10;++t){f.mulThis(m),_.setThis(a).subThis(f).absThis();let t=_.value();if(v=1,t<.9)for(;t>l;)t*=t,++v;else v=4;if(_.lte(c))break;for(let t=0;t<v;t++)f.setThis(m).divThis(a).invertThis().addThis(m).ldexpThis(-1).limitPrecisionThis(e),m.setThis(f)}return m.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let e=52,i=2220446049250313e-31;for(;e<s;)2*e<=s?(i*=i,e*=2):(i*=2220446049250313e-31,e+=52);e+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=qs.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(i),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let s=0;s<10;++s){const s=r.clone();s.sqrThis().mulThis(r);const i=s.clone();if(i.subThis(t),i.absThis().limitPrecisionThis(32),i.lte(u))break;i.setThis(t),i.ldexpThis(1),i.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),i.divThis(n),r.mulThis(i),r.limitPrecisionThis(e)}return r}isInTheRangeOfDouble(){return(0,i.g)(0),!1}sign(){return this.m_sign}cosAndSin(t,s){(0,i.g)(0)}static nan(){return(0,i.g)(0),new qs}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let e=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const i=s/e;let n=Number(i);if(BigInt(n)!==i)return t?-n:n;let r=s-i*e;if(r){let t=Ut(e)-1023n;t>0n&&(e>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52)),n+=s/Number(e)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const e=Math.min(this.m_power,t.m_power);let i,n;this.m_power>e?(i=BigInt(this.m_power-e),n=0n):(i=0n,n=BigInt(t.m_power-e));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<i,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=e,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}qs.s_sm=0x8000000000000000n,qs.s_em=0x7ff0000000000000n,qs.s_fm=0x000fffffffffffffn,qs.s_emax=0x7ffn;const zs=qs.constructInt32(1),Cs=qs.constructInt32(0);function Zs(t,s){let e=Qt(t);const i=Qt(s);return e===i?(e-=53-function(t,s){return function(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+function(t){let s=0;return 4294901760n&t&&(s+=16,t>>=16n),65280n&t&&(s+=8,t>>=8n),240n&t&&(s+=4,t>>=4n),s+u[Number(BigInt.asUintN(4,t))]+1}(t)}(t^s)}(Ot(t),Ot(s)),e):e>i?e:i}function Bs(t,s){for(let e=0,i=0,n=t.length;e<n;e+=2,i++)s[i].x=t[e],s[i].y=t[e+1]}function Rs(t){const s=new Float64Array(2*t.length);for(let e=0,i=t.length;e<i;++e){const i=e<<1;s[i]=t[e].x,s[i+1]=t[e].y}return s}function Gs(t){const s=Tt(ks,t.length);for(let e=0,i=t.length;e<i;++e)s[e].setCoords(t[e][0],t[e][1]);return s}class ks{static construct(t,s){return new ks(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new ks(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,e){return void 0!==e?Math.abs(this.x-t)<=e&&Math.abs(this.y-s)<=e:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return(0,i.g)(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,s,e){(0,i.g)(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,e){this.x=s.x*t+e.x,this.y=s.y*t+e.y}scaleOther(t,s){(0,i.g)(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){(0,i.g)(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,s){return(0,i.g)(0),{}}static average(t,s){const e=new ks;if(0===s)return e.setNAN(),e;if(1===s)return e.assign(t[0]),e;const i=new n(t[0].x),r=new n(t[0].y);for(let e=1;e<s;e++)i.add(t[e].x),r.add(t[e].y),255&e||(i.normalize(),r.normalize());return e.x=i.getResult()/s,e.y=r.getResult()/s,e}static calculateLength(t,s){const e=new n(0);for(let i=1;i<s;i++)e.add(ks.distance(t[i],t[i-1]));return e.getResult()}offset(t,s){const e=ks.distance(t,s),i=ks.construct(this.x,this.y);if(0===e)return ks.distance(i,t);const n=s.clone();return n.subThis(t),i.subThis(t),i.crossProduct(n)/e}side(t,s){return t.equals(s)?this.equals(t)?0:1:ks.orientationRobust(s,t,this)}static sqrDistance(t,s){const e=t.x-s.x,i=t.y-s.y;return e*e+i*i}static sqrDistanceCoords(t,s,e,i){const n=e-t,r=i-s;return n*n+r*r}static distance(t,s){return Math.sqrt(ks.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return(0,i.g)(0),0}rotateDirect(t,s){const e=this.x*t-this.y*s,i=this.x*s+this.y*t;this.x=e,this.y=i}rotateReverse(t,s){const e=this.x*t+this.y*s,i=-this.x*s+this.y*t;this.x=e,this.y=i}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new ks(this.x+t.x,this.y+t.y)}sub(t){return new ks(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new ks(-this.x,-this.y)}mul(t){return new ks(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new ks(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new ks(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),e=t-s;return e>=0?t:e<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:(0,i.t)("norm")}}getQuarter(){return ks.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const e=t.getQuarter(),i=s.getQuarter();return i===e?ks.orientationRobustImpl(ks.construct(0,0),s,t,!0):e<i?-1:1}static compareVectorsOrigin(t,s,e){const i=s.sub(t),n=e.sub(t),r=i.getQuarter(),u=n.getQuarter();return u===r?ks.orientationRobustImpl(t,e,s,!0):r<u?-1:1}static orientationRobust(t,s,e){return ks.orientationRobustImpl(t,s,e,!1)}static orientationRobustEx(t,s,e,i){if(t.equals(s)||e.equals(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-e.x,h=i.y-e.y;{const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=n*h,a=r*u,m=4*xs()*(Math.abs(o)+Math.abs(a)),c=o-a;return Math.abs(c)>=m?c<0?-1:c>0?1:0:ks.orientationRobustExMp(t,s,e,i)}static orientationRobustExMp(t,s,e,i){const n=qs.constructDouble(s.x),r=qs.constructDouble(i.x);n.subThis(qs.constructDouble(t.x)),r.subThis(qs.constructDouble(e.x));const u=qs.constructDouble(s.y),h=qs.constructDouble(i.y);return u.subThis(qs.constructDouble(t.y)),h.subThis(qs.constructDouble(e.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,e){const i=s.sub(t).crossProduct(e.sub(t));return i<0?-1:i>0?1:0}static orientationRobustImpl(t,s,e,i){if(s.isEqualPoint2D(t)||e.isEqualPoint2D(t)||s.isEqualPoint2D(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-t.x,h=e.y-t.y;if(!i){const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(e.x)+Math.abs(e.y))*8*v(),a=n*h-r*u;if(Math.abs(a)>o)return a<0?-1:1;if(_(s.x,t.x)&&_(e.y,t.y)&&_(s.y,t.y)&&_(e.x,t.x)&&l(n,h)&&l(r,u)){const t=n*h,s=r*u;if(_(t,s)){const e=t-s;return e<0?-1:e>0?1:0}}return ks.orientationRobustMp(t,s,e)}static orientationRobustMp(t,s,e){const i=qs.constructDouble(s.x),n=qs.constructDouble(e.x);{const s=qs.constructDouble(t.x);i.subThis(s),n.subThis(s)}const r=qs.constructDouble(e.y),u=qs.constructDouble(s.y);{const s=qs.constructDouble(t.y);r.subThis(s),u.subThis(s)}return i.mulThis(r),u.mulThis(n),i.subThis(u),i.LZ()?-1:i.GZ()?1:0}static inCircleRobust(t,s,e,i){const n=new c,r=new c;n.set(t.x),n.subThis(i.x),r.set(t.y),r.subThis(i.y);const u=new c,h=new c;u.set(s.x),u.subThis(i.x),h.set(s.y),h.subThis(i.y);const o=new c,a=new c;o.set(e.x),o.subThis(i.x),a.set(e.y),a.subThis(i.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(a).subE(h.mulE(o)),f=n.mulE(a).subE(r.mulE(o)),_=n.mulE(n).addE(r.mulE(r)),v=u.mulE(u).addE(h.mulE(h)),b=o.mulE(o).addE(a.mulE(a)),d=_.mulE(l).subE(v.mulE(f)).addE(b.mulE(m));if(!d.isFuzzyZero()){const t=d.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp(t,s,e,i)}static inCircleRobustMp(t,s,e,i){do{if(!_(t.x,i.x)||!_(t.y,i.y))break;if(!_(s.x,i.x)||!_(s.y,i.y))break;if(!_(e.x,i.x)||!_(e.y,i.y))break;const n=t.x-i.x,r=t.y-i.y,u=s.x-i.x,h=s.y-i.y,o=e.x-i.x,a=e.y-i.y;if(!l(n,h)||!l(r,u))break;if(!l(u,a)||!l(h,o))break;if(!l(n,a)||!l(r,o))break;if(!l(n,n)||!l(r,r))break;if(!l(u,u)||!l(h,h))break;if(!l(o,o)||!l(a,a))break;const m=n*h,c=r*u,v=u*a,b=h*o,d=n*a,p=r*o,x=n*n,N=r*r,y=u*u,g=h*h,T=o*o,E=a*a;if(!_(m,c))break;if(!_(v,b))break;if(!_(d,p))break;if(!f(x,N))break;if(!f(y,g))break;if(!f(T,E))break;const M=m-c,w=v-b,I=d-p,D=x+N,P=y+g,A=T+E;if(!l(D,w))break;if(!l(P,I))break;if(!l(A,M))break;const q=D*w,z=P*I,C=A*M;if(!_(q,z))break;const Z=q-z;if(!f(Z,C))break;const B=Z+C;return B<0?-1:B>0?1:0}while(0);const n=qs.constructDouble(i.x),r=qs.constructDouble(i.y),u=qs.constructDouble(t.x),h=qs.constructDouble(t.y);u.subThis(n),h.subThis(r);const o=qs.constructDouble(s.x),a=qs.constructDouble(s.y);o.subThis(n),a.subThis(r);const m=qs.constructDouble(e.x),c=qs.constructDouble(e.y);m.subThis(n),c.subThis(r);const v=u.mul(a).sub(h.mul(o)),b=o.mul(c).sub(a.mul(m)),d=u.mul(c).sub(h.mul(m)),p=u.mul(u).add(h.mul(h)),x=o.mul(o).add(a.mul(a)),N=m.mul(m).add(c.mul(c)),y=p.mul(b).sub(x.mul(d)).add(N.mul(v));return y.LZ()?-1:y.GZ()?1:0}static inCircleRobustMp3Point(t,s,e){const i=qs.constructDouble(t.x),n=qs.constructDouble(t.y),r=qs.constructDouble(s.x),u=qs.constructDouble(s.y),h=qs.constructDouble(e.x),o=qs.constructDouble(e.y),a=h.mul(h).add(o.mul(o)).sub(h.mul(i).add(o.mul(n)).add(h.mul(r)).add(o.mul(u))).add(i.mul(r).add(n.mul(u)));return a.LZ()?-1:a.GZ()?1:0}static inCircleRobust3Point(t,s,e){const i=new c(t.x),n=new c(t.y),r=new c(s.x),u=new c(s.y),h=new c(e.x),o=new c(e.y),a=h.mulE(h).addE(o.mulE(o)).subE(h.mulE(i).addE(o.mulE(n)).addE(h.mulE(r)).addE(o.mulE(u))).addE(i.mulE(r).addE(n.mulE(u)));if(!a.isFuzzyZero()){const t=a.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp3Point(t,s,e)}static calculateCircleCenterFromThreePoints(t,s,e){if(t.equals(e)||t.equals(s)||e.equals(s))return ks.getNAN();const i=function(t,s,e){const i=new c(s.x);i.subThis(t.x);const n=new c(s.y);n.subThis(t.y);const r=new c(e.x);r.subThis(t.x);const u=new c(e.y);u.subThis(t.y);const h=i.clone();h.mulThisE(u);let o=n.clone();if(o.mulThisE(r),h.subThisE(o),0===h.value())return ks.getNAN();h.mulThis(2);const a=i.clone();a.mulThisE(i);const m=n.clone();m.mulThisE(n);const l=a.clone();l.addThisE(m);const f=r.clone();f.mulThisE(r);const _=u.clone();_.mulThisE(u);const v=f.clone();v.addThisE(_);const b=n.clone();b.mulThisE(v),o=u.clone(),o.mulThisE(l),b.subThisE(o),b.divThisE(h);const d=i.clone();d.mulThisE(v),o=r.clone(),o.mulThisE(l),d.subThisE(o),d.divThisE(h);const p=ks.construct(t.x-b.value(),t.y+d.value()),x=t.sub(p).length(),N=s.sub(p).length(),y=e.sub(p).length(),g=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(e.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(e.y));return Math.abs(x-N)<=g&&Math.abs(x-y)<=g&&b.eps()<g&&d.eps()<g?p:ks.getNAN()}(t,s,e);return i.isNAN()?function(t,s,e){const i=qs.constructDouble(s.x);i.subDoubleThis(t.x);const n=qs.constructDouble(s.y);n.subDoubleThis(t.y);const r=qs.constructDouble(e.x);r.subDoubleThis(t.x);const u=qs.constructDouble(e.y);u.subDoubleThis(t.y);const h=i.clone();h.mulThis(u);let o=n.clone();if(o.mulThis(r),h.subThis(o),h.isZero())return ks.getNAN();h.mulDoubleThis(2);const a=i.clone();a.mulThis(i);const m=n.clone();m.mulThis(n);const c=a.clone();c.addThis(m);const l=r.clone();l.mulThis(r);const f=u.clone();f.mulThis(u);const _=l.clone();_.addThis(f);const v=n.clone();v.mulThis(_),o=u.clone(),o.mulThis(c),v.subThis(o),v.divThis(h);const b=i.clone();return b.mulThis(_),o=r.clone(),o.mulThis(c),b.subThis(o),b.divThis(h),ks.construct(t.x-v.value(),t.y+b.value())}(t,s,e):i}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,s,e){return(0,i.g)(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const e=ks.c_compare_zorder_xx[t.x<0?1:0]|ks.c_compare_zorder_yy[t.y<0?1:0],i=ks.c_compare_zorder_xx[s.x<0?1:0]|ks.c_compare_zorder_yy[s.y<0?1:0];if(e===i){let e=0,i=0;for(let n=0;n<2;++n){const r=Zs(t[n],s[n]);r>e&&(e=r,i=n)}return t[i]<s[i]}return e<i}static lerp(t,s,e){const i=new ks;return R(t,s,e,i),i}static getClosestCoordinate(t,s,e,i=!1){const n=ks.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(e))return 1;const u=ks.getNAN();u.setSub(e,t);let h=u.dotProduct(n)/r;return i||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,e,i){if(t.equals(s)||e.equals(i))return ks.getNAN();const n=s.x-t.x,r=e.x-i.x,u=s.y-t.y,h=e.y-i.y,o=n*h-r*u;if(!o)return ks.getNAN();const a=o;if(0===a)return ks.getNAN();let m=(e.x-t.x)*h-(e.y-t.y)*r;m/=a;const c=new ks;return R(t,s,m,c),c.isFinite()?c:ks.getNAN()}toString(){return`[${this.x},${this.y}]`}}ks.dimensions=2,ks.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],ks.c_compare_zorder_xx=[2,0],ks.c_compare_zorder_yy=[1,0]}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{55537:(t,s,e)=>{function i(t,s){try{if(!t)throw new Error(s)}catch(t){throw t}}e.d(s,{A:()=>f,B:()=>k,C:()=>G,D:()=>Z,G:()=>m,a:()=>M,b:()=>w,c:()=>z,d:()=>R,e:()=>_,f:()=>d,g:()=>i,h:()=>x,i:()=>p,j:()=>N,k:()=>b,l:()=>v,m:()=>g,n:()=>E,o:()=>B,p:()=>D,q:()=>q,r:()=>T,s:()=>C,t:()=>A,u:()=>P,v:()=>y,w:()=>F,x:()=>I,y:()=>S,z:()=>L});class n extends Error{constructor(t,s){super(s),this.m_AdditionalMessage=s,this.m_ErrorType=t,this.name="GeometryError"}what(){return function(t){switch(t){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 22:return"Operation is canceled by the user";case 21:return"The operation, such as projection or geodetic computation, cannot be performed without pe-wasm loaded";default:return"unknown error"}}(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends n{constructor(t){super(2,t),this.name="CorruptedGeometryError"}}class u extends n{constructor(t){super(3,t),this.name="EmptyGeometryError"}}class h extends n{constructor(t){super(4,t),this.name="MathSingularityError"}}class o extends n{constructor(t){super(21,t),this.name="ProjectionEngineNotLoadedError"}}class a extends n{constructor(t){super(8,t),this.name="NonSimpleGeometryError"}}var m,c;(c=m||(m={}))[c.enumUnknown=0]="enumUnknown",c[c.enumPoint=513]="enumPoint",c[c.enumLine=5122]="enumLine",c[c.enumBezier=5123]="enumBezier",c[c.enumEllipticArc=5124]="enumEllipticArc",c[c.enumEnvelope=3077]="enumEnvelope",c[c.enumMultiPoint=8710]="enumMultiPoint",c[c.enumPolyline=25607]="enumPolyline",c[c.enumPolygon=27656]="enumPolygon",c[c.enumMultipatch=40969]="enumMultipatch",c[c.enumGeometryCollection=3594]="enumGeometryCollection",c[c.enumRationalBezier2=5134]="enumRationalBezier2",c[c.enumBezier2=5135]="enumBezier2",c[c.enumRationalBezier23d=5392]="enumRationalBezier23d",c[c.enumGreatArc3d=5393]="enumGreatArc3d";const l=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function f(t){return l[15&t]}function _(t){return!!(512&t)}function v(t){return!!(1024&t)}function b(t){return!!(2048&t)}function d(t){return!!(4096&t)}function p(t){return!!(8192&t)}function x(t){return!!(16384&t)}function N(t){return!!(32768&t)}function y(t){const s=t.getGeometryType();return p(s)?t.getPointCount():t.isEmpty()?0:s===m.enumEnvelope?4:s===m.enumPoint?1:d(s)?2:void z("missing type")}function g(t){const s=t.getGeometryType();if(x(s))return t.hasNonLinearSegments();if(s===m.enumGeometryCollection){const s=t;for(let t=0,e=s.getGeometryCount();t<e;t++)if(g(s.getGeometry(t)))return!0;return!1}return!!d(s)&&s!==m.enumLine}function T(t){throw new o(t)}function E(t){throw new r(t)}function M(t){throw new Error(t)}function w(t){throw new h(t)}function I(){M("Geometry type is not supported for 3D operations.")}function D(t){throw new n(12,t)}function P(t){throw new u(t)}function A(t){throw new n(14,t)}function q(t){throw new Error(t)}function z(t){throw new n(13,t)}function C(t){throw new Error(t)}function Z(t){throw new a(t)}function B(t){t&&g(t)&&A("Operation does not support curves.")}function R(t){t&&N(t.getGeometryType())&&A("Unsupported geometry type.")}function G(t){t===m.enumGeometryCollection&&M("Geometry_collection instances are not supported in this operation")}function k(t){G(t.getGeometryType())}function S(t){M(`bad wkid: ${t}`)}function L(t){let s="bad wkt: ";s+=t,s+="...",M(s)}function F(t,s){t||M(s)}},83661:(t,s,e)=>{e.d(s,{$:()=>y,A:()=>fs,B:()=>at,C:()=>vt,D:()=>ps,E:()=>a,F:()=>c,G:()=>p,H:()=>d,I:()=>jt,J:()=>Ns,K:()=>n,L:()=>Mt,M:()=>qs,N:()=>xs,O:()=>Pt,P:()=>ks,Q:()=>Z,R:()=>B,S:()=>At,T:()=>ot,U:()=>_t,V:()=>D,W:()=>P,X:()=>bt,Y:()=>Yt,Z:()=>R,_:()=>N,a:()=>k,a0:()=>A,a1:()=>q,a2:()=>z,a3:()=>Vt,a4:()=>zt,a5:()=>Es,a6:()=>Ds,a7:()=>ws,a8:()=>Ms,a9:()=>it,aA:()=>Bs,aB:()=>Gs,aC:()=>M,aD:()=>hs,aE:()=>Wt,aF:()=>Lt,aG:()=>as,aH:()=>os,aa:()=>nt,ab:()=>Bt,ac:()=>gt,ad:()=>x,ae:()=>Cs,af:()=>zs,ag:()=>S,ah:()=>Ts,ai:()=>et,aj:()=>V,ak:()=>L,al:()=>Ps,am:()=>dt,an:()=>ds,ao:()=>Jt,ap:()=>ct,aq:()=>us,ar:()=>ms,as:()=>wt,at:()=>ls,au:()=>Et,av:()=>I,aw:()=>rs,ax:()=>gs,ay:()=>xt,az:()=>Rs,b:()=>mt,c:()=>lt,d:()=>Dt,e:()=>F,f:()=>w,g:()=>bs,h:()=>Nt,i:()=>Xt,j:()=>Ht,k:()=>qt,l:()=>st,m:()=>Tt,n:()=>It,o:()=>Ct,p:()=>Zt,q:()=>C,r:()=>$t,s:()=>ys,t:()=>O,u:()=>pt,v:()=>ft,w:()=>yt,x:()=>G,y:()=>g,z:()=>E});var i=e(55537);class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=tt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let e;if(Math.abs(this.sum)>=Math.abs(t)){const i=this.sum-s+t;e=this.compensation+i}else{const i=t-s+this.sum;e=this.compensation+i}this.sum=s,this.compensation=e}sub(t){this.add(-t)}addProduct(t,s){const e=[0],i=W(t,s,e);this.add(i),this.add(e[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],u=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function h(t){let s=0;return 65535n&t||(s+=16,t>>=16n),255n&t||(s+=8,t>>=8n),15n&t||(s+=4,t>>=4n),s+r[Number(BigInt.asUintN(4,t))]}function o(t){let s=0;return 4294967295n&t||(s=32,t>>=32n),s+h(BigInt.asUintN(32,t))}class a{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof a)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new a(t,s)}static constructEmpty(){return new a}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return Vt(this.vmin,t)&&Vt(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,e=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(e)}mergeNe(t){const s=t.vmin,e=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(e)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=lt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return ys(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?bs():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*bs()}static unit(){return m}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=lt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new a(this.vmin,this.vmax)}}const m=new a(0,1);class c{static getNAN(){return new c(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new c(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=c.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new c(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}addThis(t){const s=this.m_value+t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subThis(t){const s=this.m_value-t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=c.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=c.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+c.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+c.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const e=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+c.ulp(e),this.m_value=e,this}setMul(t,s){return this.m_value=t*s,this.m_eps=c.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new c(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),e=this.m_value/t.m_value;let i=(this.m_eps+Math.abs(e)*t.m_eps)/s;if(t.m_eps>.01*s){const e=t.m_eps/s;i*=1+(1+e)*e}return this.m_value=e,this.m_eps=i+c.ulp(e),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+c.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=c.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(p.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=c.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+c.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=s;const i=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(e)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static ulp(t){let s=Ft(t);const e=((0x7ff0000000000000n&s)>>52n)-1075n;return e>-1023n?(s=e+0x3ffn<<52n,function(t){return kt[0]=t,Gt[0]}(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=e;const i=Math.abs(e),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static st_cosAndSin(t,s,e){const i=Math.sin(t.m_value),n=Math.cos(t.m_value);e.m_value=i,s.m_value=n;const r=Math.abs(i),u=Math.abs(n),h=Math.abs(t.value());e.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+c.ulp(r+h),s.m_eps=(Math.abs(i)+.5*u*t.m_eps)*t.m_eps+c.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return a.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(b)}setEuler(){this.set(2.718281828459045,v())}static size(){return 1}}function l(t,s){const e=Ot(t),i=Ot(s),n=53-o(e),r=53-o(i);return(n>=0?n:0)+(r>=0?r:0)<=52}function f(t,s){const e=t+s;return e-t===s&&e-s===t}function _(t,s){const e=t-s;return t-e===s&&s+e===t}function v(){return xs()}c.dimensions=1;const b=new c(Math.PI,.5*v()),d=new c(0,0),p=new c(1,0),x=new c(4,0);function N(t,s,e){return t.addE(s.subE(t).mulE(e))}function y(t,s,e){return s.subE(s.subE(t).mulE(p.subE(e)))}function g(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=function(t){return Math.atanh(t)}(t)/t;else{let e;const i=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(i/Math.log(n)+2.5)-1;t>1;t-=2)e=1/t,s=(s+e)*n;s+=1}return s}function T(t){const s=Math.PI*Math.PI/6;let e;if(1===t)e=s;else if(t>1)e=s;else if(0===t)e=t;else if(t<0){const s=1+(t=Math.abs(t)),i=Math.log(s);e=i*i/-2-T(t/s)}else if(t>.5){const i=1-t,n=Math.log(t)*Math.log(i);e=s-T(i)-n}else{e=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let i=s;for(let n=s;n>0;n--,i-=1)e*=t,e+=1/(i*i);e*=t}return e}function E(t,s){const e=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=e,s+=1/t/t;return s*=t,s}return T(e)/s}function M(t,s){return t<s?qt(t,s):qt(s,t)}function w(t,s){const e=Math.abs(t);return s>=0?e:-e}function I(t){return Math.round(t)}function D(t,s,e,i,n){n[0]=s[0]+(e[0]-s[0])*i,n[1]=s[1]+(e[1]-s[1])*i,3===t&&(n[2]=s[2]+(e[2]-s[2])*i)}function P(t,s,e,i,n){n[0]=e[0]-(e[0]-s[0])*(1-i),n[1]=e[1]-(e[1]-s[1])*(1-i),3===t&&(n[2]=e[2]-(e[2]-s[2])*(1-i))}function A(t,s,e,i,n){i<=.5?D(t,s,e,i,n):P(t,s,e,i,n)}function q(t,s,e,i,n){n[0]=s[0].addE(e[0].subE(s[0]).mulE(i)),n[1]=s[1].addE(e[1].subE(s[1]).mulE(i))}function z(t,s,e,i,n){n[0]=e[0].subE(e[0].subE(s[0]).mulE(p.subE(i))),n[1]=e[1].subE(e[1].subE(s[1]).mulE(p.subE(i)))}function C(t,s,e){let i;return i=e<=.5?t+(s-t)*e:s-(s-t)*(1-e),i}function Z(t,s,e){return t+(s-t)*e}function B(t,s,e){return s-(s-t)*(1-e)}function R(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e))}function G(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e,i.z=t.z+(s.z-t.z)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e),i.z=s.z-(s.z-t.z)*(1-e))}function k(t){return t*t}function S(t){return t*t*t}function L(t){return 1/Math.sqrt(t)}function F(t){return t<0?-1:t>0?1:0}function O(t,s,e,i){const n=[0],r=[0],u=[0];return tt(W(t,e,n),W(s,i,r),u)+(n[0]+r[0]+u[0])}const Q=[0],U=[0];function V(t,s,e){return function(t,s,e,i){const n=tt(t,s,J),r=tt(n,e,K);return tt(r,J[0]+K[0],i)}(W(t,s,Q),e,Q[0],U)}const j=[0],Y=[0],$=[0],H=[0];function W(t,s,e){const i=t*s;return X(t,j,Y),X(s,$,H),e[0]=Y[0]*H[0]-(i-j[0]*$[0]-Y[0]*$[0]-j[0]*H[0]),i}function X(t,s,e){const i=134217729*t;s[0]=i-(i-t),e[0]=t-s[0]}const J=[0],K=[0];function tt(t,s,e){const i=t+s;return Math.abs(t)>Math.abs(s)?e[0]=t-i+s:e[0]=s-i+t,i}function st(t,s){return t%s}function et(t){const s=1-t;if(0===s)return 1;let e;if(s<=.01){const t=s,i=Math.log(t);e=1+t*(.4431471805599453-.25*i+t*(.05680519270997949-.09375*i+t*(.02183137044373718-.05859375*i+t*(.011544521417308362-.042724609375*i+t*(.00714200031339596-.0336456298828125*i+t*(.004854743337164948-.027757644653320312*i+t*(.003514687963781376-.023627042770385742*i)))))))}else{if(t<.016){const s=t,e=.25,i=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,o=.0033752918243408203,a=.0025710230693221092;return ws()*(1-s*(e+s*(i+s*(n+s*(r+s*(u+s*(h+s*(o+s*a))))))))}e=rt(0,s,1)-t*ut(0,s,1)/3}return ys(e,1,ws())}function it(t,s,e=Number.NaN){if((0,i.g)(s>=0&&s<=1),0===s)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===s){const t=Math.round(r/Es()),s=r-t*Es();return n*(2*t+Math.sin(s))}const u=ws(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const o=Math.sin(r),a=Number.isNaN(e)?et(s):e;let m;if(1===o)m=a+Math.sqrt(1-s)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*xs())m=r*(1+t*s*(-1/6+t*((4-3*s)/120-(16+(45*s-60)*s)/5040*t)));else if(s<=.01){const t=Math.sin(2*r),e=Math.sin(4*r),i=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+s*((2*-r+t)/8+s*((-3*r+2*t-.25*e)/64+s*((-20*r+15*t-3*e+i/3)/1024+s*(5*(-140*r+112*t-28*e+16/3*i-.5*n)/65536+7*s*((-63*r+52.5*t-15*e+3.75*i-.625*n+.05*u)/65536+s*(-693*r+594*t-185.625*e+1.375*i-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=o*o,e=Math.cos(r),i=e*e,n=ht(o,e,s);m=o*(rt(i,n,1)-s*t*ut(i,n,1)/3)}}return 1&h?m=a*(h+1)-m:m+=a*h,n*m}function nt(t,s,e=Number.NaN){if(0===t)return 0;let i=1,n=t;t<0&&(n=-n,i=-1);const r=Number.isNaN(e)?et(s):e,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?ws():function(t,s,e){if(0===s)return t;if(1===s)return Math.asin(t);let i=0,n=!0;if(t<.2){const e=t*t,r=t*(1+e*s*(1/6+e*((13*s-4)/120+(16-284*s+493*s*s)/5040*e))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*xs())return r;i=r,n=u>.1*r}if(n){const n=1-s,r=1-t/e,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+xs());i=ws()+Math.sqrt(u)*(h-ws())}let r=0;for(let n=0;n<7;n++){r=it(i,s,e);const u=ht(Math.sin(i),Math.cos(i),s);if(i-=(r-t)/Math.sqrt(u),n>0&&Math.abs(r-t)<=4*xs()*t)break}return i}(n,s,r);return 1&u?h=ws()*(u+1)-h:h+=ws()*u,i*h}function rt(t,s,e){(0,i.g)((0!==t?1:0)+(0!==s?1:0)+1>1);let n=t,r=s,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,e=(s-n)/s,i=(s-r)/s,h=(s-u)/s;if(Math.abs(e)<=.0024&&Math.abs(i)<=.0024&&Math.abs(h)<=.0024){const t=e*i-h*h,n=e*i*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function ut(t,s,e){(0,i.g)(0!==t||0!==s);let r=t,u=s,h=e;const o=new n(0);let a=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,e=(t-u)/t,i=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(e)<=.0015&&Math.abs(i)<=.0015){const n=s*e,r=i*i,u=n-r,h=n-6*r,m=h+u+u,c=3/26,l=h*(9/22*.25*h-.21428571428571427-1.5*c*i*m),f=i*(1/6*m+i*(-.4090909090909091*u+i*c*n));return 3*o.getResult()+a*(1+l+f)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),c=Math.sqrt(h),l=n*(m+c)+m*c;o.add(a/(c*(h+l))),a*=.25,r=.25*(r+l),u=.25*(u+l),h=.25*(h+l)}}function ht(t,s,e){return t<.999?1-e*k(t):1-e+e*k(s)}function ot(t,s,e,n,r){return 0===t?0===n?s:1===n?e:r:1===t?0===n?s:1===n?e:C(s,e,n):(2===t&&(0,i.t)("angular interpolation"),void(0,i.t)(""))}function at(t,s,e,n,r,u,h,o){if(0===t)for(let t=0;t<u;++t)n[t+r]=0===h?s[t]:1===h?e[t]:o;else if(1===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=C(s[t],e[t],h);else if(2===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else{let t=0;for(let i=0,o=r;i<u;++i,++o)n[o]=C(s[i],e[i],h),t+=n[o]*n[o];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else(0,i.t)("")}function mt(t,s,e,i,n){if(0===n)return;let r=0,u=e,h=i;for(;r++<n;)t[u++]=s[h++]}function ct(t,s,e){let i=0;for(let n=0;!i&&n<e;++n)i=t[n]-s[n];return i}function lt(t,s){return t}function ft(t){t.sort(((t,s)=>t<s?-1:t>s?1:0))}function _t(t,s){const e=t.slice(0,s);ft(e),mt(t,e,0,0,s)}function vt(t,s,e,i){const n=t.slice(s,s+e);n.sort(i),mt(t,n,s,0,e)}function bt(t,s){return t<s?-1:t>s?1:0}function dt(t,s,e,i){return t<e?-1:t>e?1:s<i?-1:s>i?1:0}function pt(t,s){if(t.length<2)return t.length;let e=0;for(let i=1;i<t.length;++i)s(t[i],t[e])||(e++,t[i]=lt(t[e],t[e]=t[i]));return 1+e}function xt(t,s){t[s]=t.at(-1),t.pop()}function Nt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function yt(t,s,e){t.length=s,t.fill(e)}function gt(t,s,e){t.length=e;for(let i=0;i<e;++i)t[i]=new s}function Tt(t,s){const e=new Array(s);for(let i=0;i<s;++i)e[i]=new t;return e}function Et(t,s,e){for(let i=0;i<e;++i)t[i].assign(s[i]);return e}function Mt(t,s){const e=t.slice(0,s);for(let t=0;t<s;++t)e[t]=e[t].clone();return e}function wt(t){return Array.from({length:t},(()=>null))}function It(t,s){return Array.from({length:s},(()=>t()))}function Dt(t,s){const e=new Array(t);return e.fill(s),e}function Pt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class At{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function qt(t,s){return{first:t,second:s}}const zt=Math.PI,Ct=2*Math.PI,Zt=.5*Math.PI;class Bt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Dt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,e){this.m_v[t*this.m_cc+s]=e}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const Rt=new ArrayBuffer(8),Gt=new Float64Array(Rt),kt=new BigUint64Array(Rt),St=0x0fffffffffffffn;function Lt(){return Number.EPSILON*vs}function Ft(t){return Gt[0]=t,kt[0]}function Ot(t){return Ft(t)&St}function Qt(t){return Number((9218868437227405312n&Ft(t))>>52n)}function Ut(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,e=512n,i=1n<<s+e;for(;t>=i;)s+=e,e<<=1n,i<<=e;let n=s;e>>=1n;let r=n+e;for(;e>0n;)t<1n<<r||(n=r),e>>=1n,r=n+e;return n}function Vt(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function jt(t,s,e){return t===s||Math.abs(t-s)<=e||Number.isNaN(t)&&Number.isNaN(s)}function Yt(t,s){return t<s?-1:t>s?1:0}function $t(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const e=Number.isNaN(t),i=Number.isNaN(s);return e<i?-1:e>i?1:0}}function Ht(){return 2147483647}function Wt(){return 32767}function Xt(){return 2147483647}function Jt(){return-2147483648}const Kt=2147483647,ts=BigInt(Kt),ss=2166136261,es=16777619,is=14695981039346656037n,ns=1099511628211n;function rs(t){let s=ss;for(let e=0,i=t.length;e<i;++e)s=(s^t.charCodeAt(e))*es;return s&Kt}function us(t,s){return s+2654435769+(t<<6)+(t>>2)&Kt}function hs(t,s){return us(t,cs(s))}function os(t){return us(3735928559,t)}function as(t,s){return us(t,os(s))}function ms(t){return function(t){let s=ss,e=t;return s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,s&Kt}(t)}function cs(t){return Number(function(t){let s=is,e=t;return s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,s&ts}(t))}function ls(t){return cs(Ft(function(t){return Ps(t)}(t)))}function fs(t){return function(t){return 1103515245*t+12345&2147483647}(t)}const _s=100,vs=100;function bs(){return Number.EPSILON*_s}function ds(){return.38196601125010515}function ps(){return 1.4142135623730951}function xs(){return Number.EPSILON}function Ns(t,s,e){return t===s||t===e}function ys(t,s,e){return t>=s?t<=e?t:e:s}function gs(t,s,e){const i=t[0];if(i>=s){if(i<=e)return!1;t[0]=e}else t[0]=s;return!0}function Ts(t,s){return t>=s?s:t<-s?-s:t}function Es(){return zt}function Ms(){return Ct}function ws(){return Zt}const Is=3*ws();function Ds(){return Is}function Ps(t){return t+0}function As(t){return{v:t}}class qs{constructor(){this.m_rn=As(0n),this.m_rd=As(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const e=t.clone();return void 0!==s&&e.limitPrecisionThis(s),e}static constructDouble(t){return(new qs).setDouble(t)}static constructInt64(t){return(new qs).setInt64(t)}static constructRational(t,s){return(new qs).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new qs).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(t){if(this.setZero(),0===t)return this;if(Number.isInteger(t)&&Math.abs(t)<2147483647)return this.setInt32(t);const s=Ft(t),e=(s&qs.s_em)>>52n,n=!!(s&qs.s_sm),r=s&qs.s_fm;if(e===qs.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&(0,i.t)("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,o=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+o,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&0n===this.m_rd.v&&1===this.m_sign}isNegativeInf(){return!this.isNAN()&&0n===this.m_rd.v&&-1===this.m_sign}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return(0,i.g)(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(qs.constructDouble(t))}thisMulInt64(t){return(0,i.g)(0),this}thisMulInt32(t){return(0,i.g)(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(qs.constructDouble(t))}addDoubleThis(t){return this.addThis(qs.constructDouble(t))}subDoubleThis(t){return this.subThis(qs.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(qs.constructInt64(t))}mulDouble(t){return this.clone().mulThis(qs.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(qs.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(qs.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=h(BigInt.asUintN(32,s))-1;let e=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,e+=32;return s&=this.m_rd.v,s>>=BigInt(e),e+=h(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(e),this.m_power+=t-e,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=lt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(Ut(this.m_rn.v));if(s>t){const e=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=e}if(s=Number(Ut(this.m_rd.v)),s>t){const e=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=e}return this}hiBitIndex(){return Math.max(Number(Ut(this.m_rn.v)),Number(Ut(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,s){if(t.m_sign<0n&&(0,i.q)("MP_value: sqrt(-1)"),t.isZero())return t.clone();let e=52,n=2220446049250313e-31;for(;e<s;)2*e<=s?(n*=n,e*=2):(n*=2220446049250313e-31,e+=52);e+=52;const r=Ut(t.m_rn.v),u=Ut(t.m_rd.v);let h,o=t.m_power+Number(r-u);const a=new qs;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),h=qs.constructAssign(t,53).ldexpThis(-o).value(),a.setThis(t).ldexpThis(-o),(0,i.g)(Number.isFinite(h))):(a.setThis(t),h=a.value(),(0,i.g)(Number.isFinite(h)),o=0),h=Math.sqrt(h);const m=qs.constructDouble(h),c=qs.constructDouble(n);c.mulThis(m).ldexpThis(1);const l=n*h*2,f=m.clone(),_=new qs;let v;for(let t=0;t<10;++t){f.mulThis(m),_.setThis(a).subThis(f).absThis();let t=_.value();if(v=1,t<.9)for(;t>l;)t*=t,++v;else v=4;if(_.lte(c))break;for(let t=0;t<v;t++)f.setThis(m).divThis(a).invertThis().addThis(m).ldexpThis(-1).limitPrecisionThis(e),m.setThis(f)}return m.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let e=52,i=2220446049250313e-31;for(;e<s;)2*e<=s?(i*=i,e*=2):(i*=2220446049250313e-31,e+=52);e+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=qs.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(i),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let s=0;s<10;++s){const s=r.clone();s.sqrThis().mulThis(r);const i=s.clone();if(i.subThis(t),i.absThis().limitPrecisionThis(32),i.lte(u))break;i.setThis(t),i.ldexpThis(1),i.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),i.divThis(n),r.mulThis(i),r.limitPrecisionThis(e)}return r}isInTheRangeOfDouble(){return(0,i.g)(0),!1}sign(){return this.m_sign}cosAndSin(t,s){(0,i.g)(0)}static nan(){return(0,i.g)(0),new qs}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let e=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const i=s/e;let n=Number(i);if(BigInt(n)!==i)return t?-n:n;let r=s-i*e;if(r){let t=Ut(e)-1023n;t>0n&&(e>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52)),n+=s/Number(e)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const e=Math.min(this.m_power,t.m_power);let i,n;this.m_power>e?(i=BigInt(this.m_power-e),n=0n):(i=0n,n=BigInt(t.m_power-e));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<i,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=e,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}qs.s_sm=0x8000000000000000n,qs.s_em=0x7ff0000000000000n,qs.s_fm=0x000fffffffffffffn,qs.s_emax=0x7ffn;const zs=qs.constructInt32(1),Cs=qs.constructInt32(0);function Zs(t,s){let e=Qt(t);const i=Qt(s);return e===i?(e-=53-function(t,s){return function(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+function(t){let s=0;return 4294901760n&t&&(s+=16,t>>=16n),65280n&t&&(s+=8,t>>=8n),240n&t&&(s+=4,t>>=4n),s+u[Number(BigInt.asUintN(4,t))]+1}(t)}(t^s)}(Ot(t),Ot(s)),e):e>i?e:i}function Bs(t,s){for(let e=0,i=0,n=t.length;e<n;e+=2,i++)s[i].x=t[e],s[i].y=t[e+1]}function Rs(t){const s=new Float64Array(2*t.length);for(let e=0,i=t.length;e<i;++e){const i=e<<1;s[i]=t[e].x,s[i+1]=t[e].y}return s}function Gs(t){const s=Tt(ks,t.length);for(let e=0,i=t.length;e<i;++e)s[e].setCoords(t[e][0],t[e][1]);return s}class ks{static construct(t,s){return new ks(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new ks(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,e){return void 0!==e?Math.abs(this.x-t)<=e&&Math.abs(this.y-s)<=e:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return(0,i.g)(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,s,e){(0,i.g)(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,e){this.x=s.x*t+e.x,this.y=s.y*t+e.y}scaleOther(t,s){(0,i.g)(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){(0,i.g)(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,s){return(0,i.g)(0),{}}static average(t,s){const e=new ks;if(0===s)return e.setNAN(),e;if(1===s)return e.assign(t[0]),e;const i=new n(t[0].x),r=new n(t[0].y);for(let e=1;e<s;e++)i.add(t[e].x),r.add(t[e].y),255&e||(i.normalize(),r.normalize());return e.x=i.getResult()/s,e.y=r.getResult()/s,e}static calculateLength(t,s){const e=new n(0);for(let i=1;i<s;i++)e.add(ks.distance(t[i],t[i-1]));return e.getResult()}offset(t,s){const e=ks.distance(t,s),i=ks.construct(this.x,this.y);if(0===e)return ks.distance(i,t);const n=s.clone();return n.subThis(t),i.subThis(t),i.crossProduct(n)/e}side(t,s){return t.equals(s)?this.equals(t)?0:1:ks.orientationRobust(s,t,this)}static sqrDistance(t,s){const e=t.x-s.x,i=t.y-s.y;return e*e+i*i}static sqrDistanceCoords(t,s,e,i){const n=e-t,r=i-s;return n*n+r*r}static distance(t,s){return Math.sqrt(ks.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return(0,i.g)(0),0}rotateDirect(t,s){const e=this.x*t-this.y*s,i=this.x*s+this.y*t;this.x=e,this.y=i}rotateReverse(t,s){const e=this.x*t+this.y*s,i=-this.x*s+this.y*t;this.x=e,this.y=i}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new ks(this.x+t.x,this.y+t.y)}sub(t){return new ks(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new ks(-this.x,-this.y)}mul(t){return new ks(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new ks(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new ks(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),e=t-s;return e>=0?t:e<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:(0,i.a)("norm")}}getQuarter(){return ks.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const e=t.getQuarter(),i=s.getQuarter();return i===e?ks.orientationRobustImpl(ks.construct(0,0),s,t,!0):e<i?-1:1}static compareVectorsOrigin(t,s,e){const i=s.sub(t),n=e.sub(t),r=i.getQuarter(),u=n.getQuarter();return u===r?ks.orientationRobustImpl(t,e,s,!0):r<u?-1:1}static orientationRobust(t,s,e){return ks.orientationRobustImpl(t,s,e,!1)}static orientationRobustEx(t,s,e,i){if(t.equals(s)||e.equals(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-e.x,h=i.y-e.y;{const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=n*h,a=r*u,m=4*xs()*(Math.abs(o)+Math.abs(a)),c=o-a;return Math.abs(c)>=m?c<0?-1:c>0?1:0:ks.orientationRobustExMp(t,s,e,i)}static orientationRobustExMp(t,s,e,i){const n=qs.constructDouble(s.x),r=qs.constructDouble(i.x);n.subThis(qs.constructDouble(t.x)),r.subThis(qs.constructDouble(e.x));const u=qs.constructDouble(s.y),h=qs.constructDouble(i.y);return u.subThis(qs.constructDouble(t.y)),h.subThis(qs.constructDouble(e.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,e){const i=s.sub(t).crossProduct(e.sub(t));return i<0?-1:i>0?1:0}static orientationRobustImpl(t,s,e,i){if(s.isEqualPoint2D(t)||e.isEqualPoint2D(t)||s.isEqualPoint2D(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-t.x,h=e.y-t.y;if(!i){const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(e.x)+Math.abs(e.y))*8*v(),a=n*h-r*u;if(Math.abs(a)>o)return a<0?-1:1;if(_(s.x,t.x)&&_(e.y,t.y)&&_(s.y,t.y)&&_(e.x,t.x)&&l(n,h)&&l(r,u)){const t=n*h,s=r*u;if(_(t,s)){const e=t-s;return e<0?-1:e>0?1:0}}return ks.orientationRobustMp(t,s,e)}static orientationRobustMp(t,s,e){const i=qs.constructDouble(s.x),n=qs.constructDouble(e.x);{const s=qs.constructDouble(t.x);i.subThis(s),n.subThis(s)}const r=qs.constructDouble(e.y),u=qs.constructDouble(s.y);{const s=qs.constructDouble(t.y);r.subThis(s),u.subThis(s)}return i.mulThis(r),u.mulThis(n),i.subThis(u),i.LZ()?-1:i.GZ()?1:0}static inCircleRobust(t,s,e,i){const n=new c,r=new c;n.set(t.x),n.subThis(i.x),r.set(t.y),r.subThis(i.y);const u=new c,h=new c;u.set(s.x),u.subThis(i.x),h.set(s.y),h.subThis(i.y);const o=new c,a=new c;o.set(e.x),o.subThis(i.x),a.set(e.y),a.subThis(i.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(a).subE(h.mulE(o)),f=n.mulE(a).subE(r.mulE(o)),_=n.mulE(n).addE(r.mulE(r)),v=u.mulE(u).addE(h.mulE(h)),b=o.mulE(o).addE(a.mulE(a)),d=_.mulE(l).subE(v.mulE(f)).addE(b.mulE(m));if(!d.isFuzzyZero()){const t=d.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp(t,s,e,i)}static inCircleRobustMp(t,s,e,i){do{if(!_(t.x,i.x)||!_(t.y,i.y))break;if(!_(s.x,i.x)||!_(s.y,i.y))break;if(!_(e.x,i.x)||!_(e.y,i.y))break;const n=t.x-i.x,r=t.y-i.y,u=s.x-i.x,h=s.y-i.y,o=e.x-i.x,a=e.y-i.y;if(!l(n,h)||!l(r,u))break;if(!l(u,a)||!l(h,o))break;if(!l(n,a)||!l(r,o))break;if(!l(n,n)||!l(r,r))break;if(!l(u,u)||!l(h,h))break;if(!l(o,o)||!l(a,a))break;const m=n*h,c=r*u,v=u*a,b=h*o,d=n*a,p=r*o,x=n*n,N=r*r,y=u*u,g=h*h,T=o*o,E=a*a;if(!_(m,c))break;if(!_(v,b))break;if(!_(d,p))break;if(!f(x,N))break;if(!f(y,g))break;if(!f(T,E))break;const M=m-c,w=v-b,I=d-p,D=x+N,P=y+g,A=T+E;if(!l(D,w))break;if(!l(P,I))break;if(!l(A,M))break;const q=D*w,z=P*I,C=A*M;if(!_(q,z))break;const Z=q-z;if(!f(Z,C))break;const B=Z+C;return B<0?-1:B>0?1:0}while(0);const n=qs.constructDouble(i.x),r=qs.constructDouble(i.y),u=qs.constructDouble(t.x),h=qs.constructDouble(t.y);u.subThis(n),h.subThis(r);const o=qs.constructDouble(s.x),a=qs.constructDouble(s.y);o.subThis(n),a.subThis(r);const m=qs.constructDouble(e.x),c=qs.constructDouble(e.y);m.subThis(n),c.subThis(r);const v=u.mul(a).sub(h.mul(o)),b=o.mul(c).sub(a.mul(m)),d=u.mul(c).sub(h.mul(m)),p=u.mul(u).add(h.mul(h)),x=o.mul(o).add(a.mul(a)),N=m.mul(m).add(c.mul(c)),y=p.mul(b).sub(x.mul(d)).add(N.mul(v));return y.LZ()?-1:y.GZ()?1:0}static inCircleRobustMp3Point(t,s,e){const i=qs.constructDouble(t.x),n=qs.constructDouble(t.y),r=qs.constructDouble(s.x),u=qs.constructDouble(s.y),h=qs.constructDouble(e.x),o=qs.constructDouble(e.y),a=h.mul(h).add(o.mul(o)).sub(h.mul(i).add(o.mul(n)).add(h.mul(r)).add(o.mul(u))).add(i.mul(r).add(n.mul(u)));return a.LZ()?-1:a.GZ()?1:0}static inCircleRobust3Point(t,s,e){const i=new c(t.x),n=new c(t.y),r=new c(s.x),u=new c(s.y),h=new c(e.x),o=new c(e.y),a=h.mulE(h).addE(o.mulE(o)).subE(h.mulE(i).addE(o.mulE(n)).addE(h.mulE(r)).addE(o.mulE(u))).addE(i.mulE(r).addE(n.mulE(u)));if(!a.isFuzzyZero()){const t=a.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp3Point(t,s,e)}static calculateCircleCenterFromThreePoints(t,s,e){if(t.equals(e)||t.equals(s)||e.equals(s))return ks.getNAN();const i=function(t,s,e){const i=new c(s.x);i.subThis(t.x);const n=new c(s.y);n.subThis(t.y);const r=new c(e.x);r.subThis(t.x);const u=new c(e.y);u.subThis(t.y);const h=i.clone();h.mulThisE(u);let o=n.clone();if(o.mulThisE(r),h.subThisE(o),0===h.value())return ks.getNAN();h.mulThis(2);const a=i.clone();a.mulThisE(i);const m=n.clone();m.mulThisE(n);const l=a.clone();l.addThisE(m);const f=r.clone();f.mulThisE(r);const _=u.clone();_.mulThisE(u);const v=f.clone();v.addThisE(_);const b=n.clone();b.mulThisE(v),o=u.clone(),o.mulThisE(l),b.subThisE(o),b.divThisE(h);const d=i.clone();d.mulThisE(v),o=r.clone(),o.mulThisE(l),d.subThisE(o),d.divThisE(h);const p=ks.construct(t.x-b.value(),t.y+d.value()),x=t.sub(p).length(),N=s.sub(p).length(),y=e.sub(p).length(),g=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(e.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(e.y));return Math.abs(x-N)<=g&&Math.abs(x-y)<=g&&b.eps()<g&&d.eps()<g?p:ks.getNAN()}(t,s,e);return i.isNAN()?function(t,s,e){const i=qs.constructDouble(s.x);i.subDoubleThis(t.x);const n=qs.constructDouble(s.y);n.subDoubleThis(t.y);const r=qs.constructDouble(e.x);r.subDoubleThis(t.x);const u=qs.constructDouble(e.y);u.subDoubleThis(t.y);const h=i.clone();h.mulThis(u);let o=n.clone();if(o.mulThis(r),h.subThis(o),h.isZero())return ks.getNAN();h.mulDoubleThis(2);const a=i.clone();a.mulThis(i);const m=n.clone();m.mulThis(n);const c=a.clone();c.addThis(m);const l=r.clone();l.mulThis(r);const f=u.clone();f.mulThis(u);const _=l.clone();_.addThis(f);const v=n.clone();v.mulThis(_),o=u.clone(),o.mulThis(c),v.subThis(o),v.divThis(h);const b=i.clone();return b.mulThis(_),o=r.clone(),o.mulThis(c),b.subThis(o),b.divThis(h),ks.construct(t.x-v.value(),t.y+b.value())}(t,s,e):i}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,s,e){return(0,i.g)(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const e=ks.c_compare_zorder_xx[t.x<0?1:0]|ks.c_compare_zorder_yy[t.y<0?1:0],i=ks.c_compare_zorder_xx[s.x<0?1:0]|ks.c_compare_zorder_yy[s.y<0?1:0];if(e===i){let e=0,i=0;for(let n=0;n<2;++n){const r=Zs(t[n],s[n]);r>e&&(e=r,i=n)}return t[i]<s[i]}return e<i}static lerp(t,s,e){const i=new ks;return R(t,s,e,i),i}static getClosestCoordinate(t,s,e,i=!1){const n=ks.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(e))return 1;const u=ks.getNAN();u.setSub(e,t);let h=u.dotProduct(n)/r;return i||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,e,i){if(t.equals(s)||e.equals(i))return ks.getNAN();const n=s.x-t.x,r=e.x-i.x,u=s.y-t.y,h=e.y-i.y,o=n*h-r*u;if(!o)return ks.getNAN();const a=o;if(0===a)return ks.getNAN();let m=(e.x-t.x)*h-(e.y-t.y)*r;m/=a;const c=new ks;return R(t,s,m,c),c.isFinite()?c:ks.getNAN()}toString(){return`[${this.x},${this.y}]`}}ks.dimensions=2,ks.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],ks.c_compare_zorder_xx=[2,0],ks.c_compare_zorder_yy=[1,0]}}]);
|