ow-eengine-power 2.5.1 → 2.5.2

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.
@@ -1,13 +1,14 @@
1
- (function(gt,St){typeof exports=="object"&&typeof module<"u"?St(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],St):(gt=typeof globalThis<"u"?globalThis:gt||self,St(gt.OW_EEngine_Power={},gt.Cesium))})(this,function(gt,St){"use strict";var Eu=Object.defineProperty;var Pu=(gt,St,zr)=>St in gt?Eu(gt,St,{enumerable:!0,configurable:!0,writable:!0,value:zr}):gt[St]=zr;var I=(gt,St,zr)=>Pu(gt,typeof St!="symbol"?St+"":St,zr);function zr(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const g=zr(St);function za(s,t,e={}){const{color:i=St.Color.WHITE,width:r=3,clampToGround:n=!1,zIndex:o=0,dashed:f=!1,dashLength:u=10}=e,l=f?new g.PolylineDashMaterialProperty({color:i,dashLength:u}):new g.ColorMaterialProperty(i);return s.entities.add({polyline:{positions:t,width:r,material:l,clampToGround:n,zIndex:o}})}function y(s,t,e=10,i="#ba1919",r,n=!1){const o={show:!0,positions:s,clampToGround:n,width:e,material:g.Color.fromCssColorString(i),arcType:g.ArcType.NONE,shadows:g.ShadowMode.DISABLED,granularity:n?void 0:0};let f;return f=[0,1e5],o.distanceDisplayCondition=new g.DistanceDisplayCondition(f[0],f[1]),{name:t,label:{text:t,font:"18px sans-serif",distanceDisplayCondition:new g.DistanceDisplayCondition(f[0],Math.min(f[1],5e3))},polyline:o}}function Pn(s,t,e,i,r=new g.HeadingPitchRoll(0,0,0),n=1,o){const f={show:!0,uri:i,scale:n,transition:{distanceDisplayCondition:!0,scale:!0}};return o&&(Array.isArray(o)?f.distanceDisplayCondition=new g.DistanceDisplayCondition(o[0],o[1]):f.distanceDisplayCondition=o),{id:s,name:e,position:t,orientation:g.Transforms.headingPitchRollQuaternion(t,r),model:f}}function zs(s,t,e,i={}){const{pointColor:r=St.Color.YELLOW,pointSize:n=12,labelColor:o=St.Color.WHITE,fontSize:f=16,pixelOffset:u=[0,-20],heightReference:l=St.HeightReference.NONE}=i;return s.entities.add({position:t,point:{color:r,pixelSize:n,heightReference:l,distanceDisplayCondition:new g.DistanceDisplayCondition(0,100)},label:{text:e,font:`${f}px sans-serif`,fillColor:o,pixelOffset:new g.Cartesian2(...u),style:St.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:St.Color.BLACK,heightReference:l,distanceDisplayCondition:new g.DistanceDisplayCondition(0,100)}})}var ye=63710088e-1,go={centimeters:ye*100,centimetres:ye*100,degrees:ye/111325,feet:ye*3.28084,inches:ye*39.37,kilometers:ye/1e3,kilometres:ye/1e3,meters:ye,metres:ye,miles:ye/1609.344,millimeters:ye*1e3,millimetres:ye*1e3,nauticalmiles:ye/1852,radians:1,yards:ye*1.0936};function ar(s,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=s,i}function be(s,t,e){if(e===void 0&&(e={}),!s)throw new Error("coordinates is required");if(!Array.isArray(s))throw new Error("coordinates must be an Array");if(s.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!mo(s[0])||!mo(s[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:s};return ar(i,t,e)}function ue(s,t,e){if(e===void 0&&(e={}),s.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:s};return ar(i,t,e)}function Us(s,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=s,e}function Ua(s,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:s};return ar(i,t,e)}function Sn(s,t){t===void 0&&(t="kilometers");var e=go[t];if(!e)throw new Error(t+" units is invalid");return s*e}function qs(s,t){t===void 0&&(t="kilometers");var e=go[t];if(!e)throw new Error(t+" units is invalid");return s/e}function qa(s,t){return Zs(qs(s,t))}function Zs(s){var t=s%(2*Math.PI);return t*180/Math.PI}function vi(s){var t=s%360;return t*Math.PI/180}function yo(s,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(s>=0))throw new Error("length must be a positive number");return Sn(qs(s,t),e)}function mo(s){return!isNaN(s)&&s!==null&&!Array.isArray(s)}function vo(s){return!!s&&s.constructor===Object}function Nn(s,t,e){if(s!==null)for(var i,r,n,o,f,u,l,a=0,c=0,p,d=s.type,h=d==="FeatureCollection",v=d==="Feature",C=h?s.features.length:1,W=0;W<C;W++){l=h?s.features[W].geometry:v?s.geometry:s,p=l?l.type==="GeometryCollection":!1,f=p?l.geometries.length:1;for(var _=0;_<f;_++){var T=0,L=0;if(o=p?l.geometries[_]:l,o!==null){u=o.coordinates;var P=o.type;switch(a=0,P){case null:break;case"Point":if(t(u,c,W,T,L)===!1)return!1;c++,T++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(t(u[i],c,W,T,L)===!1)return!1;c++,P==="MultiPoint"&&T++}P==="LineString"&&T++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(r=0;r<u[i].length-a;r++){if(t(u[i][r],c,W,T,L)===!1)return!1;c++}P==="MultiLineString"&&T++,P==="Polygon"&&L++}P==="Polygon"&&T++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(L=0,r=0;r<u[i].length;r++){for(n=0;n<u[i][r].length-a;n++){if(t(u[i][r][n],c,W,T,L)===!1)return!1;c++}L++}T++}break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)if(Nn(o.geometries[i],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bn(s,t){if(s.type==="Feature")t(s,0);else if(s.type==="FeatureCollection")for(var e=0;e<s.features.length&&t(s.features[e],e)!==!1;e++);}function Dn(s,t){var e,i,r,n,o,f,u,l,a,c,p=0,d=s.type==="FeatureCollection",h=s.type==="Feature",v=d?s.features.length:1;for(e=0;e<v;e++){for(f=d?s.features[e].geometry:h?s.geometry:s,l=d?s.features[e].properties:h?s.properties:{},a=d?s.features[e].bbox:h?s.bbox:void 0,c=d?s.features[e].id:h?s.id:void 0,u=f?f.type==="GeometryCollection":!1,o=u?f.geometries.length:1,r=0;r<o;r++){if(n=u?f.geometries[r]:f,n===null){if(t(null,p,l,a,c)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,p,l,a,c)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],p,l,a,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}p++}}function _o(s,t){Dn(s,function(e,i,r,n,o){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(ar(e,r,{bbox:n,id:o}),i,0)===!1?!1:void 0}var u;switch(f){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<e.coordinates.length;l++){var a=e.coordinates[l],c={type:u,coordinates:a};if(t(ar(c,r),i,l)===!1)return!1}})}function Za(s,t){_o(s,function(e,i,r){var n=0;if(e.geometry){var o=e.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var f,u=0,l=0,a=0;if(Nn(e,function(c,p,d,h,v){if(f===void 0||i>u||h>l||v>a){f=c,u=i,l=h,a=v,n=0;return}var C=ue([f,c],e.properties);if(t(C,i,r,v,n)===!1)return!1;n++,f=c})===!1)return!1}}})}function Rn(s){var t=[1/0,1/0,-1/0,-1/0];return Nn(s,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Rn.default=Rn;function Lr(s){if(!s)throw new Error("coord is required");if(!Array.isArray(s)){if(s.type==="Feature"&&s.geometry!==null&&s.geometry.type==="Point")return s.geometry.coordinates;if(s.type==="Point")return s.coordinates}if(Array.isArray(s)&&s.length>=2&&!Array.isArray(s[0])&&!Array.isArray(s[1]))return s;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ha(s){if(Array.isArray(s))return s;if(s.type==="Feature"){if(s.geometry!==null)return s.geometry.coordinates}else if(s.coordinates)return s.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Co(s,t,e){if(!s)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+s.geometry.type)}function Ka(s,t){return s.type==="FeatureCollection"?"FeatureCollection":s.type==="GeometryCollection"?"GeometryCollection":s.type==="Feature"&&s.geometry!==null?s.geometry.type:s.type}var vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zi(s,t,e){e===void 0&&(e={});var i=Lr(s),r=Lr(t),n=vi(r[1]-i[1]),o=vi(r[0]-i[0]),f=vi(i[1]),u=vi(r[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(f)*Math.cos(u);return Sn(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),e.units)}function ja(s){if(!s)throw new Error("geojson is required");switch(s.type){case"Feature":return Wo(s);case"FeatureCollection":return Ja(s);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bn(s);default:throw new Error("unknown GeoJSON type")}}function Wo(s){var t={type:"Feature"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=s[e]}}),t.properties=To(s.properties),t.geometry=Bn(s.geometry),t}function To(s){var t={};return s&&Object.keys(s).forEach(function(e){var i=s[e];typeof i=="object"?i===null?t[e]=null:Array.isArray(i)?t[e]=i.map(function(r){return r}):t[e]=To(i):t[e]=i}),t}function Ja(s){var t={type:"FeatureCollection"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=s[e]}}),t.features=s.features.map(function(e){return Wo(e)}),t}function Bn(s){var t={type:s.type};return s.bbox&&(t.bbox=s.bbox),s.type==="GeometryCollection"?(t.geometries=s.geometries.map(function(e){return Bn(e)}),t):(t.coordinates=Io(s.coordinates),t)}function Io(s){var t=s;return typeof t[0]!="object"?t.slice():t.map(function(e){return Io(e)})}function Mn(s,t,e,i){i===void 0&&(i={});var r=Lr(s),n=vi(r[0]),o=vi(r[1]),f=vi(e),u=qs(t,i.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(f)),a=n+Math.atan2(Math.sin(f)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),c=Zs(a),p=Zs(l);return be([c,p],i.properties)}function Hs(s,t,e){if(e===void 0&&(e={}),e.final===!0)return Qa(s,t);var i=Lr(s),r=Lr(t),n=vi(i[0]),o=vi(r[0]),f=vi(i[1]),u=vi(r[1]),l=Math.sin(o-n)*Math.cos(u),a=Math.cos(f)*Math.sin(u)-Math.sin(f)*Math.cos(u)*Math.cos(o-n);return Zs(Math.atan2(l,a))}function Qa(s,t){var e=Hs(t,s);return e=(e+180)%360,e}function $a(s,t){var e=Zi(s,t),i=Hs(s,t),r=Mn(s,e/2,i);return r}function tf(s,t){t===void 0&&(t={});var e=Rn(s),i=(e[0]+e[2])/2,r=(e[1]+e[3])/2;return be([i,r],t.properties,t)}function ef(s,t){if(!s)throw new Error("targetPoint is required");if(!t)throw new Error("points is required");var e,i=1/0,r=0;return bn(t,function(n,o){var f=Zi(s,n);f<i&&(r=o,i=f)}),e=ja(t.features[r]),e.properties.featureIndex=r,e.properties.distanceToPoint=i,e}function rf(s,t,e){e===void 0&&(e={});var i=Lr(s),r=Lr(t);r[0]+=r[0]-i[0]>180?-360:i[0]-r[0]>180?360:0;var n=sf(i,r),o=yo(n,"meters",e.units);return o}function sf(s,t,e){e=e===void 0?ye:Number(e);var i=e,r=s[1]*Math.PI/180,n=t[1]*Math.PI/180,o=n-r,f=Math.abs(t[0]-s[0])*Math.PI/180;f>Math.PI&&(f-=2*Math.PI);var u=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(r),a=Math.sqrt(o*o+l*l*f*f),c=a*i;return c}function Ar(s,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!s)throw new Error("pt is required");if(Array.isArray(s)?s=be(s):s.type==="Point"?s=ar(s):Co(s,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=ue(t):t.type==="LineString"?t=ar(t):Co(t,"LineString","line");var i=1/0,r=s.geometry.coordinates;return Za(t,function(n){var o=n.geometry.coordinates[0],f=n.geometry.coordinates[1],u=nf(r,o,f,e);u<i&&(i=u)}),yo(i,"degrees",e.units)}function nf(s,t,e,i){var r=[e[0]-t[0],e[1]-t[1]],n=[s[0]-t[0],s[1]-t[1]],o=Lo(n,r);if(o<=0)return On(s,t,{method:i.method,units:"degrees"});var f=Lo(r,r);if(f<=o)return On(s,e,{method:i.method,units:"degrees"});var u=o/f,l=[t[0]+u*r[0],t[1]+u*r[1]];return On(s,l,{method:i.method,units:"degrees"})}function Lo(s,t){return s[0]*t[0]+s[1]*t[1]}function On(s,t,e){return e.method==="planar"?rf(s,t,e):Zi(s,t,e)}function Ao(s,t,e,i){if(i=i||{},!vo(i))throw new Error("options is invalid");var r,n=[];if(s.type==="Feature")r=s.geometry.coordinates;else if(s.type==="LineString")r=s.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(var o=r.length,f=0,u,l,a,c=0;c<r.length&&!(t>=f&&c===r.length-1);c++){if(f>t&&n.length===0){if(u=t-f,!u)return n.push(r[c]),ue(n);l=Hs(r[c],r[c-1])-180,a=Mn(r[c],u,l,i),n.push(a.geometry.coordinates)}if(f>=e)return u=e-f,u?(l=Hs(r[c],r[c-1])-180,a=Mn(r[c],u,l,i),n.push(a.geometry.coordinates),ue(n)):(n.push(r[c]),ue(n));if(f>=t&&n.push(r[c]),c===r.length-1)return ue(n);f+=Zi(r[c],r[c+1],i)}if(f<t&&r.length===o)throw new Error("Start position is beyond line");var p=r[r.length-1];return ue([p,p])}function Ks(s){var t=s[0],e=s[1];return[e[0]-t[0],e[1]-t[1]]}function Fn(s,t){return s[0]*t[1]-t[0]*s[1]}function of(s,t){return[s[0]+t[0],s[1]+t[1]]}function af(s,t){return[s[0]-t[0],s[1]-t[1]]}function ff(s,t){return[s*t[0],s*t[1]]}function uf(s,t){var e=s[0],i=Ks(s),r=t[0],n=Ks(t),o=Fn(i,n),f=af(r,e),u=Fn(f,n),l=u/o,a=of(e,ff(l,i));return a}function hf(s,t){var e=Ks(s),i=Ks(t);return Fn(e,i)===0}function lf(s,t){return hf(s,t)?!1:uf(s,t)}function cf(s,t,e){if(e=e||{},!vo(e))throw new Error("options is invalid");var i=e.units;if(!s)throw new Error("geojson is required");if(t==null||isNaN(t))throw new Error("distance is required");var r=Ka(s),n=s.properties;switch(r){case"LineString":return wo(s,t,i);case"MultiLineString":var o=[];return _o(s,function(f){o.push(wo(f,t,i).geometry.coordinates)}),Ua(o,n);default:throw new Error("geometry "+r+" is not supported")}}function wo(s,t,e){var i=[],r=qa(t,e),n=Ha(s),o=[];return n.forEach(function(f,u){if(u!==n.length-1){var l=pf(f,n[u+1],r);if(i.push(l),u>0){var a=i[u-1],c=lf(l,a);c!==!1&&(a[1]=c,l[0]=c),o.push(a[0]),u===n.length-2&&(o.push(l[0]),o.push(l[1]))}n.length===2&&(o.push(l[0]),o.push(l[1]))}}),ue(o,s.properties)}function pf(s,t,e){var i=Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1])),r=s[0]+e*(t[1]-s[1])/i,n=t[0]+e*(t[1]-s[1])/i,o=s[1]+e*(s[0]-t[0])/i,f=t[1]+e*(s[0]-t[0])/i;return[[r,o],[n,f]]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),i=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(i+r,0):Math.min(r,i);var n=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:i;for(n=n<0?Math.max(i+arguments[2],0):Math.min(n,i);r<n;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},Number.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(s){return s!==s},Math.trunc=Math.trunc||function(s){return s<0?Math.ceil(s):Math.floor(s)};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.prototype.equalsWithTolerance=function(t,e,i){return Math.abs(t-e)<=i};var vt=function(s){function t(e){s.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new s().stack}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(Error),Z=function(){},Eo={MAX_VALUE:{configurable:!0}};Z.isNaN=function(t){return Number.isNaN(t)},Z.doubleToLongBits=function(t){return t},Z.longBitsToDouble=function(t){return t},Z.isInfinite=function(t){return!Number.isFinite(t)},Eo.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Z,Eo);var De=function(){},js=function(){},Ur=function(){};function Re(){}var A=function s(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=s.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=s.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Er={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};A.prototype.setOrdinate=function(t,e){switch(t){case A.X:this.x=e;break;case A.Y:this.y=e;break;case A.Z:this.z=e;break;default:throw new vt("Invalid ordinate index: "+t)}},A.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return!(!wr.equalsWithTolerance(this.x,e.x,i)||!wr.equalsWithTolerance(this.y,e.y,i))}},A.prototype.getOrdinate=function(t){switch(t){case A.X:return this.x;case A.Y:return this.y;case A.Z:return this.z}throw new vt("Invalid ordinate index: "+t)},A.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Z.isNaN(this.z))&&Z.isNaN(t.z)},A.prototype.equals=function(t){return t instanceof A?this.equals2D(t):!1},A.prototype.equalInZ=function(t,e){return wr.equalsWithTolerance(this.z,t.z,e)},A.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},A.prototype.clone=function(){},A.prototype.copy=function(){return new A(this)},A.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},A.prototype.distance3D=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+i*i+r*r)},A.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},A.prototype.hashCode=function(){var t=17;return t=37*t+A.hashCode(this.x),t=37*t+A.hashCode(this.y),t},A.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},A.prototype.interfaces_=function(){return[De,js,Re]},A.prototype.getClass=function(){return A},A.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=Z.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Er.DimensionalComparator.get=function(){return Hi},Er.serialVersionUID.get=function(){return 6683108902428367e3},Er.NULL_ORDINATE.get=function(){return Z.NaN},Er.X.get=function(){return 0},Er.Y.get=function(){return 1},Er.Z.get=function(){return 2},Object.defineProperties(A,Er);var Hi=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new vt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};Hi.prototype.compare=function(t,e){var i=t,r=e,n=Hi.compare(i.x,r.x);if(n!==0)return n;var o=Hi.compare(i.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var f=Hi.compare(i.z,r.z);return f},Hi.prototype.interfaces_=function(){return[Ur]},Hi.prototype.getClass=function(){return Hi},Hi.compare=function(t,e){return t<e?-1:t>e?1:Z.isNaN(t)?Z.isNaN(e)?0:-1:Z.isNaN(e)?1:0};var qr=function(){};qr.prototype.create=function(){},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var E=function(){},_s={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.toLocationSymbol=function(t){switch(t){case E.EXTERIOR:return"e";case E.BOUNDARY:return"b";case E.INTERIOR:return"i";case E.NONE:return"-"}throw new vt("Unknown location value: "+t)},_s.INTERIOR.get=function(){return 0},_s.BOUNDARY.get=function(){return 1},_s.EXTERIOR.get=function(){return 2},_s.NONE.get=function(){return-1},Object.defineProperties(E,_s);var U=function(s,t){return s.interfaces_&&s.interfaces_().indexOf(t)>-1},Ie=function(){},Po={LOG_10:{configurable:!0}};Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.log10=function(t){var e=Math.log(t);return Z.isInfinite(e)||Z.isNaN(e)?e:e/Ie.LOG_10},Ie.min=function(t,e,i,r){var n=t;return e<n&&(n=e),i<n&&(n=i),r<n&&(n=r),n},Ie.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],n=arguments[1],o=arguments[2];return r<n?n:r>o?o:r}},Ie.wrap=function(t,e){return t<0?e- -t%e:t%e},Ie.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2],r=t;return e>r&&(r=e),i>r&&(r=i),r}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3],l=n;return o>l&&(l=o),f>l&&(l=f),u>l&&(l=u),l}},Ie.average=function(t,e){return(t+e)/2},Po.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ie,Po);var $e=function(t){this.str=t};$e.prototype.append=function(t){this.str+=t},$e.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},$e.prototype.toString=function(t){return this.str};var ti=function(t){this.value=t};ti.prototype.intValue=function(){return this.value},ti.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},ti.isNaN=function(t){return Number.isNaN(t)};var Cs=function(){};Cs.isWhitespace=function(t){return t<=32&&t>=0||t===127},Cs.toUpperCase=function(t){return t.toUpperCase()};var S=function s(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof s){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var i=arguments[0];s.call(this,s.parse(i))}}else if(arguments.length===2){var r=arguments[0],n=arguments[1];this.init(r,n)}},Ve={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};S.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},S.prototype.extractSignificantDigits=function(t,e){var i=this.abs(),r=S.magnitude(i._hi),n=S.TEN.pow(r);i=i.divide(n),i.gt(S.TEN)?(i=i.divide(S.TEN),r+=1):i.lt(S.ONE)&&(i=i.multiply(S.TEN),r-=1);for(var o=r+1,f=new $e,u=S.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&f.append(".");var a=Math.trunc(i._hi);if(a<0)break;var c=!1,p=0;a>9?(c=!0,p="9"):p="0"+a,f.append(p),i=i.subtract(S.valueOf(a)).multiply(S.TEN),c&&i.selfAdd(S.TEN);var d=!0,h=S.magnitude(i._hi);if(h<0&&Math.abs(h)>=u-l&&(d=!1),!d)break}return e[0]=r,f.toString()},S.prototype.sqr=function(){return this.multiply(this)},S.prototype.doubleValue=function(){return this._hi+this._lo},S.prototype.subtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},S.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},S.prototype.isZero=function(){return this._hi===0&&this._lo===0},S.prototype.selfSubtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},S.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},S.prototype.min=function(t){return this.le(t)?this:t},S.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1],n=null,o=null,f=null,u=null,l=null,a=null,c=null,p=null;return l=this._hi/i,a=S.SPLIT*l,n=a-l,p=S.SPLIT*i,n=a-n,o=l-n,f=p-i,c=l*i,f=p-f,u=i-f,p=n*f-c+n*u+o*f+o*u,a=(this._hi-c-p+this._lo-l*r)/i,p=l+a,this._hi=p,this._lo=l-p+a,this}},S.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},S.prototype.divide=function(){if(arguments[0]instanceof S){var t=arguments[0],e=null,i=null,r=null,n=null,o=null,f=null,u=null,l=null;o=this._hi/t._hi,f=S.SPLIT*o,e=f-o,l=S.SPLIT*t._hi,e=f-e,i=o-e,r=l-t._hi,u=o*t._hi,r=l-r,n=t._hi-r,l=e*r-u+e*n+i*r+i*n,f=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+f;var a=l,c=o-l+f;return new S(a,c)}else if(typeof arguments[0]=="number"){var p=arguments[0];return Z.isNaN(p)?S.createNaN():S.copy(this).selfDivide(p,0)}},S.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},S.prototype.pow=function(t){if(t===0)return S.valueOf(1);var e=new S(this),i=S.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&i.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else i=e;return t<0?i.reciprocal():i},S.prototype.ceil=function(){if(this.isNaN())return S.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new S(t,e)},S.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},S.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},S.prototype.setValue=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},S.prototype.max=function(t){return this.ge(t)?this:t},S.prototype.sqrt=function(){if(this.isZero())return S.valueOf(0);if(this.isNegative())return S.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,i=S.valueOf(e),r=this.subtract(i.sqr()),n=r._hi*(t*.5);return i.add(n)},S.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],i=null,r=null,n=null,o=null,f=null,u=null;return n=this._hi+e,f=n-this._hi,o=n-f,o=e-f+(this._hi-o),u=o+this._lo,i=n+u,r=u+(n-i),this._hi=i+r,this._lo=r+(i-this._hi),this}}else if(arguments.length===2){var l=arguments[0],a=arguments[1],c=null,p=null,d=null,h=null,v=null,C=null,W=null,_=null;v=this._hi+l,d=this._lo+a,W=v-this._hi,_=d-this._lo,C=v-W,h=d-_,C=l-W+(this._hi-C),h=a-_+(this._lo-h),W=C+d,c=v+W,p=W+(v-c),W=h+p;var T=c+W,L=W+(c-T);return this._hi=T,this._lo=L,this}},S.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1],n=null,o=null,f=null,u=null,l=null,a=null;l=S.SPLIT*this._hi,n=l-this._hi,a=S.SPLIT*i,n=l-n,o=this._hi-n,f=a-i,l=this._hi*i,f=a-f,u=i-f,a=n*f-l+n*u+o*f+o*u+(this._hi*r+this._lo*i);var c=l+a;n=l-c;var p=a+n;return this._hi=c,this._lo=p,this}},S.prototype.selfSqr=function(){return this.selfMultiply(this)},S.prototype.floor=function(){if(this.isNaN())return S.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new S(t,e)},S.prototype.negate=function(){return this.isNaN()?this:new S(-this._hi,-this._lo)},S.prototype.clone=function(){},S.prototype.multiply=function(){if(arguments[0]instanceof S){var t=arguments[0];return t.isNaN()?S.createNaN():S.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return Z.isNaN(e)?S.createNaN():S.copy(this).selfMultiply(e,0)}},S.prototype.isNaN=function(){return Z.isNaN(this._hi)},S.prototype.intValue=function(){return Math.trunc(this._hi)},S.prototype.toString=function(){var t=S.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},S.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!0,e),r=e[0]+1,n=i;if(i.charAt(0)===".")n="0"+i;else if(r<0)n="0."+S.stringOfChar("0",-r)+i;else if(i.indexOf(".")===-1){var o=r-i.length,f=S.stringOfChar("0",o);n=i+f+".0"}return this.isNegative()?"-"+n:n},S.prototype.reciprocal=function(){var t=null,e=null,i=null,r=null,n=null,o=null,f=null,u=null;n=1/this._hi,o=S.SPLIT*n,t=o-n,u=S.SPLIT*this._hi,t=o-t,e=n-t,i=u-this._hi,f=n*this._hi,i=u-i,r=this._hi-i,u=t*i-f+t*r+e*i+e*r,o=(1-f-u-n*this._lo)/this._hi;var l=n+o,a=n-l+o;return new S(l,a)},S.prototype.toSciNotation=function(){if(this.isZero())return S.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!1,e),r=S.SCI_NOT_EXPONENT_CHAR+e[0];if(i.charAt(0)==="0")throw new Error("Found leading zero: "+i);var n="";i.length>1&&(n=i.substring(1));var o=i.charAt(0)+"."+n;return this.isNegative()?"-"+o+r:o+r},S.prototype.abs=function(){return this.isNaN()?S.NaN:this.isNegative()?this.negate():new S(this)},S.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},S.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},S.prototype.add=function(){if(arguments[0]instanceof S){var t=arguments[0];return S.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return S.copy(this).selfAdd(e)}},S.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof S){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this._hi=i,this._lo=r}},S.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},S.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},S.prototype.trunc=function(){return this.isNaN()?S.NaN:this.isPositive()?this.floor():this.ceil()},S.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},S.prototype.interfaces_=function(){return[Re,De,js]},S.prototype.getClass=function(){return S},S.sqr=function(t){return S.valueOf(t).selfMultiply(t)},S.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return S.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new S(e)}},S.sqrt=function(t){return S.valueOf(t).sqrt()},S.parse=function(t){for(var e=0,i=t.length;Cs.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<i){var n=t.charAt(e);(n==="-"||n==="+")&&(e++,n==="-"&&(r=!0))}for(var o=new S,f=0,u=0,l=0;!(e>=i);){var a=t.charAt(e);if(e++,Cs.isDigit(a)){var c=a-"0";o.selfMultiply(S.TEN),o.selfAdd(c),f++;continue}if(a==="."){u=f;continue}if(a==="e"||a==="E"){var p=t.substring(e);try{l=ti.parseInt(p)}catch(W){throw W instanceof Error?new Error("Invalid exponent "+p+" in string "+t):W}finally{}break}throw new Error("Unexpected character '"+a+"' at position "+e+" in string "+t)}var d=o,h=f-u-l;if(h===0)d=o;else if(h>0){var v=S.TEN.pow(h);d=o.divide(v)}else if(h<0){var C=S.TEN.pow(-h);d=o.multiply(C)}return r?d.negate():d},S.createNaN=function(){return new S(Z.NaN,Z.NaN)},S.copy=function(t){return new S(t)},S.magnitude=function(t){var e=Math.abs(t),i=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(i)),n=Math.pow(10,r);return n*10<=e&&(r+=1),r},S.stringOfChar=function(t,e){for(var i=new $e,r=0;r<e;r++)i.append(t);return i.toString()},Ve.PI.get=function(){return new S(3.141592653589793,12246467991473532e-32)},Ve.TWO_PI.get=function(){return new S(6.283185307179586,24492935982947064e-32)},Ve.PI_2.get=function(){return new S(1.5707963267948966,6123233995736766e-32)},Ve.E.get=function(){return new S(2.718281828459045,14456468917292502e-32)},Ve.NaN.get=function(){return new S(Z.NaN,Z.NaN)},Ve.EPS.get=function(){return 123259516440783e-46},Ve.SPLIT.get=function(){return 134217729},Ve.MAX_PRINT_DIGITS.get=function(){return 32},Ve.TEN.get=function(){return S.valueOf(10)},Ve.ONE.get=function(){return S.valueOf(1)},Ve.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ve.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(S,Ve);var he=function(){},So={DP_SAFE_EPSILON:{configurable:!0}};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.orientationIndex=function(t,e,i){var r=he.orientationIndexFilter(t,e,i);if(r<=1)return r;var n=S.valueOf(e.x).selfAdd(-t.x),o=S.valueOf(e.y).selfAdd(-t.y),f=S.valueOf(i.x).selfAdd(-e.x),u=S.valueOf(i.y).selfAdd(-e.y);return n.selfMultiply(u).selfSubtract(o.selfMultiply(f)).signum()},he.signOfDet2x2=function(t,e,i,r){var n=t.multiply(r).selfSubtract(e.multiply(i));return n.signum()},he.intersection=function(t,e,i,r){var n=S.valueOf(r.y).selfSubtract(i.y).selfMultiply(S.valueOf(e.x).selfSubtract(t.x)),o=S.valueOf(r.x).selfSubtract(i.x).selfMultiply(S.valueOf(e.y).selfSubtract(t.y)),f=n.subtract(o),u=S.valueOf(r.x).selfSubtract(i.x).selfMultiply(S.valueOf(t.y).selfSubtract(i.y)),l=S.valueOf(r.y).selfSubtract(i.y).selfMultiply(S.valueOf(t.x).selfSubtract(i.x)),a=u.subtract(l),c=a.selfDivide(f).doubleValue(),p=S.valueOf(t.x).selfAdd(S.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),d=S.valueOf(e.x).selfSubtract(t.x).selfMultiply(S.valueOf(t.y).selfSubtract(i.y)),h=S.valueOf(e.y).selfSubtract(t.y).selfMultiply(S.valueOf(t.x).selfSubtract(i.x)),v=d.subtract(h),C=v.selfDivide(f).doubleValue(),W=S.valueOf(i.y).selfAdd(S.valueOf(r.y).selfSubtract(i.y).selfMultiply(C)).doubleValue();return new A(p,W)},he.orientationIndexFilter=function(t,e,i){var r=null,n=(t.x-i.x)*(e.y-i.y),o=(t.y-i.y)*(e.x-i.x),f=n-o;if(n>0){if(o<=0)return he.signum(f);r=n+o}else if(n<0){if(o>=0)return he.signum(f);r=-n-o}else return he.signum(f);var u=he.DP_SAFE_EPSILON*r;return f>=u||-f>=u?he.signum(f):2},he.signum=function(t){return t>0?1:t<0?-1:0},So.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(he,So);var it=function(){},Ws={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ws.X.get=function(){return 0},Ws.Y.get=function(){return 1},Ws.Z.get=function(){return 2},Ws.M.get=function(){return 3},it.prototype.setOrdinate=function(t,e,i){},it.prototype.size=function(){},it.prototype.getOrdinate=function(t,e){},it.prototype.getCoordinate=function(){},it.prototype.getCoordinateCopy=function(t){},it.prototype.getDimension=function(){},it.prototype.getX=function(t){},it.prototype.clone=function(){},it.prototype.expandEnvelope=function(t){},it.prototype.copy=function(){},it.prototype.getY=function(t){},it.prototype.toCoordinateArray=function(){},it.prototype.interfaces_=function(){return[js]},it.prototype.getClass=function(){return it},Object.defineProperties(it,Ws);var No=function(){},Zr=function(s){function t(){s.call(this,"Projective point not representable on the Cartesian plane.")}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(No),Xt=function(){};Xt.arraycopy=function(t,e,i,r,n){for(var o=0,f=e;f<e+n;f++)i[r+o]=t[f],o++},Xt.getProperty=function(t){return{"line.separator":`
2
- `}[t]};var Ge=function s(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],i=arguments[1];this.x=e,this.y=i,this.w=1}else if(arguments[0]instanceof s&&arguments[1]instanceof s){var r=arguments[0],n=arguments[1];this.x=r.y*n.w-n.y*r.w,this.y=n.x*r.w-r.x*n.w,this.w=r.x*n.y-n.x*r.y}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var o=arguments[0],f=arguments[1];this.x=o.y-f.y,this.y=f.x-o.x,this.w=o.x*f.y-f.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],a=arguments[2];this.x=u,this.y=l,this.w=a}else if(arguments.length===4){var c=arguments[0],p=arguments[1],d=arguments[2],h=arguments[3],v=c.y-p.y,C=p.x-c.x,W=c.x*p.y-p.x*c.y,_=d.y-h.y,T=h.x-d.x,L=d.x*h.y-h.x*d.y;this.x=C*L-T*W,this.y=_*W-v*L,this.w=v*T-_*C}};Ge.prototype.getY=function(){var t=this.y/this.w;if(Z.isNaN(t)||Z.isInfinite(t))throw new Zr;return t},Ge.prototype.getX=function(){var t=this.x/this.w;if(Z.isNaN(t)||Z.isInfinite(t))throw new Zr;return t},Ge.prototype.getCoordinate=function(){var t=new A;return t.x=this.getX(),t.y=this.getY(),t},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.intersection=function(t,e,i,r){var n=t.y-e.y,o=e.x-t.x,f=t.x*e.y-e.x*t.y,u=i.y-r.y,l=r.x-i.x,a=i.x*r.y-r.x*i.y,c=o*a-l*f,p=u*f-n*a,d=n*l-u*o,h=c/d,v=p/d;if(Z.isNaN(h)||Z.isInfinite(h)||Z.isNaN(v)||Z.isInfinite(v))throw new Zr;return new A(h,v)};var V=function s(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof s){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3];this.init(n,o,f,u)}},bo={serialVersionUID:{configurable:!0}};V.prototype.getArea=function(){return this.getWidth()*this.getHeight()},V.prototype.equals=function(t){if(!(t instanceof V))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},V.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new V;var e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,n=this._maxy<t._maxy?this._maxy:t._maxy;return new V(e,r,i,n)},V.prototype.isNull=function(){return this._maxx<this._minx},V.prototype.getMaxX=function(){return this._maxx},V.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof V){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.isNull()?!1:i>=this._minx&&i<=this._maxx&&r>=this._miny&&r<=this._maxy}},V.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof V){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof A){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.isNull()?!1:!(i>this._maxx||i<this._minx||r>this._maxy||r<this._miny)}},V.prototype.getMinY=function(){return this._miny},V.prototype.getMinX=function(){return this._minx},V.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof V){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=r,this._maxy=r):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},V.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},V.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},V.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},V.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},V.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},V.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},V.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},V.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},V.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},V.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof V){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof A){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},V.prototype.centre=function(){return this.isNull()?null:new A((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},V.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof V){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3];n<o?(this._minx=n,this._maxx=o):(this._minx=o,this._maxx=n),f<u?(this._miny=f,this._maxy=u):(this._miny=u,this._maxy=f)}},V.prototype.getMaxY=function(){return this._maxy},V.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),e===0?i:i===0?e:Math.sqrt(e*e+i*i)},V.prototype.hashCode=function(){var t=17;return t=37*t+A.hashCode(this._minx),t=37*t+A.hashCode(this._maxx),t=37*t+A.hashCode(this._miny),t=37*t+A.hashCode(this._maxy),t},V.prototype.interfaces_=function(){return[De,Re]},V.prototype.getClass=function(){return V},V.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3],u=Math.min(o.x,f.x),l=Math.max(o.x,f.x),a=Math.min(r.x,n.x),c=Math.max(r.x,n.x);return!(a>l||c<u||(u=Math.min(o.y,f.y),l=Math.max(o.y,f.y),a=Math.min(r.y,n.y),c=Math.max(r.y,n.y),a>l)||c<u)}},bo.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(V,bo);var ei={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Js=function(t){this.geometryFactory=t||new tt};Js.prototype.read=function(t){var e,i,r;t=t.replace(/[\n\r]/g," ");var n=ei.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(n=ei.emptyTypeStr.exec(t),n[2]=void 0),n&&(i=n[1].toLowerCase(),r=n[2],Hr[i]&&(e=Hr[i].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Js.prototype.write=function(t){return this.extractGeometry(t)},Js.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Ri[e])return null;var i=e.toUpperCase(),r;return t.isEmpty()?r=i+" EMPTY":r=i+"("+Ri[e].apply(this,[t])+")",r};var Ri={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ri.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,i=[],r=0,n=t._geometries.length;r<n;++r)i.push("("+Ri.point.apply(e,[t._geometries[r]])+")");return i.join(",")},linestring:function(t){for(var e=this,i=[],r=0,n=t._points._coordinates.length;r<n;++r)i.push(Ri.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},linearring:function(t){for(var e=this,i=[],r=0,n=t._points._coordinates.length;r<n;++r)i.push(Ri.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},multilinestring:function(t){for(var e=this,i=[],r=0,n=t._geometries.length;r<n;++r)i.push("("+Ri.linestring.apply(e,[t._geometries[r]])+")");return i.join(",")},polygon:function(t){var e=this,i=[];i.push("("+Ri.linestring.apply(this,[t._shell])+")");for(var r=0,n=t._holes.length;r<n;++r)i.push("("+Ri.linestring.apply(e,[t._holes[r]])+")");return i.join(",")},multipolygon:function(t){for(var e=this,i=[],r=0,n=t._geometries.length;r<n;++r)i.push("("+Ri.polygon.apply(e,[t._geometries[r]])+")");return i.join(",")},geometrycollection:function(t){for(var e=this,i=[],r=0,n=t._geometries.length;r<n;++r)i.push(e.extractGeometry(t._geometries[r]));return i.join(",")}},Hr={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(ei.spaces);return this.geometryFactory.createPoint(new A(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var i,r=t.trim().split(","),n=[],o=0,f=r.length;o<f;++o)i=r[o].replace(ei.trimParens,"$1"),n.push(Hr.point.apply(e,[i]));return this.geometryFactory.createMultiPoint(n)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),i=[],r,n=0,o=e.length;n<o;++n)r=e[n].trim().split(ei.spaces),i.push(new A(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),i=[],r,n=0,o=e.length;n<o;++n)r=e[n].trim().split(ei.spaces),i.push(new A(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var i,r=t.trim().split(ei.parenComma),n=[],o=0,f=r.length;o<f;++o)i=r[o].replace(ei.trimParens,"$1"),n.push(Hr.linestring.apply(e,[i]));return this.geometryFactory.createMultiLineString(n)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var i,r,n,o=t.trim().split(ei.parenComma),f,u=[],l=0,a=o.length;l<a;++l)i=o[l].replace(ei.trimParens,"$1"),r=Hr.linestring.apply(e,[i]),n=e.geometryFactory.createLinearRing(r._points),l===0?f=n:u.push(n);return this.geometryFactory.createPolygon(f,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var i,r=t.trim().split(ei.doubleParenComma),n=[],o=0,f=r.length;o<f;++o)i=r[o].replace(ei.trimParens,"$1"),n.push(Hr.polygon.apply(e,[i]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var i=t.trim().split("|"),r=[],n=0,o=i.length;n<o;++n)r.push(e.read(i[n]));return this.geometryFactory.createGeometryCollection(r)}},Xe=function(t){this.parser=new Js(t)};Xe.prototype.write=function(t){return this.parser.write(t)},Xe.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Bi=function(s){function t(e){s.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new s().stack}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(Error),Qs=function(s){function t(){if(s.call(this),arguments.length===0)s.call(this);else if(arguments.length===1){var e=arguments[0];s.call(this,e)}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Bi),j=function(){};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.shouldNeverReachHere=function(){if(arguments.length===0)j.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Qs("Should never reach here"+(t!==null?": "+t:""))}},j.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],j.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Qs:new Qs(e)},j.equals=function(){var t,e,i;if(arguments.length===2)t=arguments[0],e=arguments[1],j.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],i=arguments[2],!e.equals(t)))throw new Qs("Expected "+t+" but encountered "+e+(i!==null?": "+i:""))};var _t=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new A,this._intPt[1]=new A,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Pr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};_t.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},_t.prototype.getTopologySummary=function(){var t=new $e;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},_t.prototype.computeIntersection=function(t,e,i,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,i,r)},_t.prototype.getIntersectionNum=function(){return this._result},_t.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),i=this.getEdgeDistance(t,1);e>i?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},_t.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},_t.prototype.setPrecisionModel=function(t){this._precisionModel=t},_t.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],i=0;i<this._result;i++)if(!(t._intPt[i].equals2D(t._inputLines[e][0])||t._intPt[i].equals2D(t._inputLines[e][1])))return!0;return!1}},_t.prototype.getIntersection=function(t){return this._intPt[t]},_t.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},_t.prototype.hasIntersection=function(){return this._result!==_t.NO_INTERSECTION},_t.prototype.getEdgeDistance=function(t,e){var i=_t.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return i},_t.prototype.isCollinear=function(){return this._result===_t.COLLINEAR_INTERSECTION},_t.prototype.toString=function(){return Xe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Xe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},_t.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},_t.prototype.isIntersection=function(t){for(var e=this,i=0;i<this._result;i++)if(e._intPt[i].equals2D(t))return!0;return!1},_t.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.computeEdgeDistance=function(t,e,i){var r=Math.abs(i.x-e.x),n=Math.abs(i.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(i))r>n?o=r:o=n;else{var f=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);r>n?o=f:o=u,o===0&&!t.equals(e)&&(o=Math.max(f,u))}return j.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},_t.nonRobustComputeEdgeDistance=function(t,e,i){var r=t.x-e.x,n=t.y-e.y,o=Math.sqrt(r*r+n*n);return j.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},Pr.DONT_INTERSECT.get=function(){return 0},Pr.DO_INTERSECT.get=function(){return 1},Pr.COLLINEAR.get=function(){return 2},Pr.NO_INTERSECTION.get=function(){return 0},Pr.POINT_INTERSECTION.get=function(){return 1},Pr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(_t,Pr);var fr=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(i){var r=new V(this._inputLines[0][0],this._inputLines[0][1]),n=new V(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(i)&&n.contains(i)},t.prototype.computeIntersection=function(){if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,V.intersects(r,n,i)&&k.orientationIndex(r,n,i)===0&&k.orientationIndex(n,r,i)===0)return this._isProper=!0,(i.equals(r)||i.equals(n))&&(this._isProper=!1),this._result=s.POINT_INTERSECTION,null;this._result=s.NO_INTERSECTION}else return s.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(i,r,n,o,f){f.x=this.smallestInAbsValue(i.x,r.x,n.x,o.x),f.y=this.smallestInAbsValue(i.y,r.y,n.y,o.y),i.x-=f.x,i.y-=f.y,r.x-=f.x,r.y-=f.y,n.x-=f.x,n.y-=f.y,o.x-=f.x,o.y-=f.y},t.prototype.safeHCoordinateIntersection=function(i,r,n,o){var f=null;try{f=Ge.intersection(i,r,n,o)}catch(u){if(u instanceof Zr)f=t.nearestEndpoint(i,r,n,o);else throw u}finally{}return f},t.prototype.intersection=function(i,r,n,o){var f=this.intersectionWithNormalization(i,r,n,o);return this.isInSegmentEnvelopes(f)||(f=new A(t.nearestEndpoint(i,r,n,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(f),f},t.prototype.smallestInAbsValue=function(i,r,n,o){var f=i,u=Math.abs(f);return Math.abs(r)<u&&(f=r,u=Math.abs(r)),Math.abs(n)<u&&(f=n,u=Math.abs(n)),Math.abs(o)<u&&(f=o),f},t.prototype.checkDD=function(i,r,n,o,f){var u=he.intersection(i,r,n,o),l=this.isInSegmentEnvelopes(u);Xt.out.println("DD in env = "+l+" --------------------- "+u),f.distance(u)>1e-4&&Xt.out.println("Distance = "+f.distance(u))},t.prototype.intersectionWithNormalization=function(i,r,n,o){var f=new A(i),u=new A(r),l=new A(n),a=new A(o),c=new A;this.normalizeToEnvCentre(f,u,l,a,c);var p=this.safeHCoordinateIntersection(f,u,l,a);return p.x+=c.x,p.y+=c.y,p},t.prototype.computeCollinearIntersection=function(i,r,n,o){var f=V.intersects(i,r,n),u=V.intersects(i,r,o),l=V.intersects(n,o,i),a=V.intersects(n,o,r);return f&&u?(this._intPt[0]=n,this._intPt[1]=o,s.COLLINEAR_INTERSECTION):l&&a?(this._intPt[0]=i,this._intPt[1]=r,s.COLLINEAR_INTERSECTION):f&&l?(this._intPt[0]=n,this._intPt[1]=i,n.equals(i)&&!u&&!a?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):f&&a?(this._intPt[0]=n,this._intPt[1]=r,n.equals(r)&&!u&&!l?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!f&&!a?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):u&&a?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!f&&!l?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):s.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(i,r,n,o,f){var u=i.x<r.x?i.x:r.x,l=i.y<r.y?i.y:r.y,a=i.x>r.x?i.x:r.x,c=i.y>r.y?i.y:r.y,p=n.x<o.x?n.x:o.x,d=n.y<o.y?n.y:o.y,h=n.x>o.x?n.x:o.x,v=n.y>o.y?n.y:o.y,C=u>p?u:p,W=a<h?a:h,_=l>d?l:d,T=c<v?c:v,L=(C+W)/2,P=(_+T)/2;f.x=L,f.y=P,i.x-=f.x,i.y-=f.y,r.x-=f.x,r.y-=f.y,n.x-=f.x,n.y-=f.y,o.x-=f.x,o.y-=f.y},t.prototype.computeIntersect=function(i,r,n,o){if(this._isProper=!1,!V.intersects(i,r,n,o))return s.NO_INTERSECTION;var f=k.orientationIndex(i,r,n),u=k.orientationIndex(i,r,o);if(f>0&&u>0||f<0&&u<0)return s.NO_INTERSECTION;var l=k.orientationIndex(n,o,i),a=k.orientationIndex(n,o,r);if(l>0&&a>0||l<0&&a<0)return s.NO_INTERSECTION;var c=f===0&&u===0&&l===0&&a===0;return c?this.computeCollinearIntersection(i,r,n,o):(f===0||u===0||l===0||a===0?(this._isProper=!1,i.equals2D(n)||i.equals2D(o)?this._intPt[0]=i:r.equals2D(n)||r.equals2D(o)?this._intPt[0]=r:f===0?this._intPt[0]=new A(n):u===0?this._intPt[0]=new A(o):l===0?this._intPt[0]=new A(i):a===0&&(this._intPt[0]=new A(r))):(this._isProper=!0,this._intPt[0]=this.intersection(i,r,n,o)),s.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(i,r,n,o){var f=i,u=k.distancePointLine(i,n,o),l=k.distancePointLine(r,n,o);return l<u&&(u=l,f=r),l=k.distancePointLine(n,i,r),l<u&&(u=l,f=n),l=k.distancePointLine(o,i,r),l<u&&(u=l,f=o),f},t}(_t),Sr=function(){};Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Sr.orientationIndex=function(t,e,i){var r=e.x-t.x,n=e.y-t.y,o=i.x-e.x,f=i.y-e.y;return Sr.signOfDet2x2(r,n,o,f)},Sr.signOfDet2x2=function(t,e,i,r){var n=null,o=null,f=null;if(n=1,t===0||r===0)return e===0||i===0?0:e>0?i>0?-n:n:i>0?n:-n;if(e===0||i===0)return r>0?t>0?n:-n:t>0?-n:n;if(e>0?r>0?e<=r||(n=-n,o=t,t=i,i=o,o=e,e=r,r=o):e<=-r?(n=-n,i=-i,r=-r):(o=t,t=-i,i=o,o=e,e=-r,r=o):r>0?-e<=r?(n=-n,t=-t,e=-e):(o=-t,t=i,i=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,i=-i,r=-r):(n=-n,o=-t,t=-i,i=o,o=-e,e=-r,r=o),t>0)if(i>0){if(!(t<=i))return n}else return n;else{if(i>0)return-n;if(t>=i)n=-n,t=-t,i=-i;else return-n}for(;;){if(f=Math.floor(i/t),i=i-f*t,r=r-f*e,r<0)return-n;if(r>e)return n;if(t>i+i){if(e<r+r)return n}else{if(e>r+r)return-n;i=t-i,r=e-r,n=-n}if(r===0)return i===0?0:-n;if(i===0||(f=Math.floor(t/i),t=t-f*i,e=e-f*r,e<0))return n;if(e>r)return-n;if(i>t+t){if(r<e+e)return-n}else{if(r>e+e)return n;t=i-t,e=r-e,n=-n}if(e===0)return t===0?0:n;if(t===0)return-n}};var ii=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ii.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var i=t.x,r=e.x;return i>r&&(i=e.x,r=t.x),this._p.x>=i&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var n=t.x-this._p.x,o=t.y-this._p.y,f=e.x-this._p.x,u=e.y-this._p.y,l=Sr.signOfDet2x2(n,o,f,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},ii.prototype.isPointInPolygon=function(){return this.getLocation()!==E.EXTERIOR},ii.prototype.getLocation=function(){return this._isPointOnSegment?E.BOUNDARY:this._crossingCount%2===1?E.INTERIOR:E.EXTERIOR},ii.prototype.isOnSegment=function(){return this._isPointOnSegment},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.locatePointInRing=function(){if(arguments[0]instanceof A&&U(arguments[1],it)){for(var t=arguments[0],e=arguments[1],i=new ii(t),r=new A,n=new A,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,n),i.countSegment(r,n),i.isOnSegment())return i.getLocation();return i.getLocation()}else if(arguments[0]instanceof A&&arguments[1]instanceof Array){for(var f=arguments[0],u=arguments[1],l=new ii(f),a=1;a<u.length;a++){var c=u[a],p=u[a-1];if(l.countSegment(c,p),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var k=function(){},Nr={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.orientationIndex=function(t,e,i){return he.orientationIndex(t,e,i)},k.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,i=t[0].x,r=1;r<t.length-1;r++){var n=t[r].x-i,o=t[r+1].y,f=t[r-1].y;e+=n*(f-o)}return e/2}else if(U(arguments[0],it)){var u=arguments[0],l=u.size();if(l<3)return 0;var a=new A,c=new A,p=new A;u.getCoordinate(0,c),u.getCoordinate(1,p);var d=c.x;p.x-=d;for(var h=0,v=1;v<l-1;v++)a.y=c.y,c.x=p.x,c.y=p.y,u.getCoordinate(v+1,p),p.x-=d,h+=c.x*(a.y-p.y);return h/2}},k.distanceLineLine=function(t,e,i,r){if(t.equals(e))return k.distancePointLine(t,i,r);if(i.equals(r))return k.distancePointLine(r,t,e);var n=!1;if(!V.intersects(t,e,i,r))n=!0;else{var o=(e.x-t.x)*(r.y-i.y)-(e.y-t.y)*(r.x-i.x);if(o===0)n=!0;else{var f=(t.y-i.y)*(r.x-i.x)-(t.x-i.x)*(r.y-i.y),u=(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y),l=u/o,a=f/o;(a<0||a>1||l<0||l>1)&&(n=!0)}}return n?Ie.min(k.distancePointLine(t,i,r),k.distancePointLine(e,i,r),k.distancePointLine(i,t,e),k.distancePointLine(r,t,e)):0},k.isPointInRing=function(t,e){return k.locatePointInRing(t,e)!==E.EXTERIOR},k.computeLength=function(t){var e=t.size();if(e<=1)return 0;var i=0,r=new A;t.getCoordinate(0,r);for(var n=r.x,o=r.y,f=1;f<e;f++){t.getCoordinate(f,r);var u=r.x,l=r.y,a=u-n,c=l-o;i+=Math.sqrt(a*a+c*c),n=u,o=l}return i},k.isCCW=function(t){var e=t.length-1;if(e<3)throw new vt("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=t[0],r=0,n=1;n<=e;n++){var o=t[n];o.y>i.y&&(i=o,r=n)}var f=r;do f=f-1,f<0&&(f=e);while(t[f].equals2D(i)&&f!==r);var u=r;do u=(u+1)%e;while(t[u].equals2D(i)&&u!==r);var l=t[f],a=t[u];if(l.equals2D(i)||a.equals2D(i)||l.equals2D(a))return!1;var c=k.computeOrientation(l,i,a),p=!1;return c===0?p=l.x>a.x:p=c>0,p},k.locatePointInRing=function(t,e){return ii.locatePointInRing(t,e)},k.distancePointLinePerpendicular=function(t,e,i){var r=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),n=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/r;return Math.abs(n)*Math.sqrt(r)},k.computeOrientation=function(t,e,i){return k.orientationIndex(t,e,i)},k.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new vt("Line array must contain at least one vertex");for(var i=t.distance(e[0]),r=0;r<e.length-1;r++){var n=k.distancePointLine(t,e[r],e[r+1]);n<i&&(i=n)}return i}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];if(f.x===u.x&&f.y===u.y)return o.distance(f);var l=(u.x-f.x)*(u.x-f.x)+(u.y-f.y)*(u.y-f.y),a=((o.x-f.x)*(u.x-f.x)+(o.y-f.y)*(u.y-f.y))/l;if(a<=0)return o.distance(f);if(a>=1)return o.distance(u);var c=((f.y-o.y)*(u.x-f.x)-(f.x-o.x)*(u.y-f.y))/l;return Math.abs(c)*Math.sqrt(l)}},k.isOnLine=function(t,e){for(var i=new fr,r=1;r<e.length;r++){var n=e[r-1],o=e[r];if(i.computeIntersection(t,n,o),i.hasIntersection())return!0}return!1},Nr.CLOCKWISE.get=function(){return-1},Nr.RIGHT.get=function(){return k.CLOCKWISE},Nr.COUNTERCLOCKWISE.get=function(){return 1},Nr.LEFT.get=function(){return k.COUNTERCLOCKWISE},Nr.COLLINEAR.get=function(){return 0},Nr.STRAIGHT.get=function(){return k.COLLINEAR},Object.defineProperties(k,Nr);var Mi=function(){};Mi.prototype.filter=function(t){},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var z=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},_i={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};z.prototype.isGeometryCollection=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION},z.prototype.getFactory=function(){return this._factory},z.prototype.getGeometryN=function(t){return this},z.prototype.getArea=function(){return 0},z.prototype.isRectangle=function(){return!1},z.prototype.equals=function(){if(arguments[0]instanceof z){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof z))return!1;var i=e;return this.equalsExact(i)}},z.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},z.prototype.geometryChanged=function(){this.apply(z.geometryChangedFilter)},z.prototype.geometryChangedAction=function(){this._envelope=null},z.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},z.prototype.getLength=function(){return 0},z.prototype.getNumGeometries=function(){return 1},z.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,r)}},z.prototype.getUserData=function(){return this._userData},z.prototype.getSRID=function(){return this._SRID},z.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},z.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION)throw new vt("This method does not support GeometryCollection arguments")},z.prototype.equal=function(t,e,i){return i===0?t.equals(e):t.distance(e)<=i},z.prototype.norm=function(){var t=this.copy();return t.normalize(),t},z.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},z.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new V(this._envelope)},z.prototype.setSRID=function(t){this._SRID=t},z.prototype.setUserData=function(t){this._userData=t},z.prototype.compare=function(t,e){for(var i=t.iterator(),r=e.iterator();i.hasNext()&&r.hasNext();){var n=i.next(),o=r.next(),f=n.compareTo(o);if(f!==0)return f}return i.hasNext()?1:r.hasNext()?-1:0},z.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},z.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===z.SORTINDEX_MULTIPOINT||this.getSortIndex()===z.SORTINDEX_MULTILINESTRING||this.getSortIndex()===z.SORTINDEX_MULTIPOLYGON},z.prototype.interfaces_=function(){return[js,De,Re]},z.prototype.getClass=function(){return z},z.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},z.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},_i.serialVersionUID.get=function(){return 8763622679187377e3},_i.SORTINDEX_POINT.get=function(){return 0},_i.SORTINDEX_MULTIPOINT.get=function(){return 1},_i.SORTINDEX_LINESTRING.get=function(){return 2},_i.SORTINDEX_LINEARRING.get=function(){return 3},_i.SORTINDEX_MULTILINESTRING.get=function(){return 4},_i.SORTINDEX_POLYGON.get=function(){return 5},_i.SORTINDEX_MULTIPOLYGON.get=function(){return 6},_i.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},_i.geometryChangedFilter.get=function(){return xn},Object.defineProperties(z,_i);var xn=function(){};xn.interfaces_=function(){return[Mi]},xn.filter=function(t){t.geometryChangedAction()};var Ci=function(){};Ci.prototype.filter=function(t){},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Be=function(){},Oi={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Be.prototype.isInBoundary=function(t){},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Oi.Mod2BoundaryNodeRule.get=function(){return Kr},Oi.EndPointBoundaryNodeRule.get=function(){return jr},Oi.MultiValentEndPointBoundaryNodeRule.get=function(){return Jr},Oi.MonoValentEndPointBoundaryNodeRule.get=function(){return Qr},Oi.MOD2_BOUNDARY_RULE.get=function(){return new Kr},Oi.ENDPOINT_BOUNDARY_RULE.get=function(){return new jr},Oi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Jr},Oi.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Qr},Oi.OGC_SFS_BOUNDARY_RULE.get=function(){return Be.MOD2_BOUNDARY_RULE},Object.defineProperties(Be,Oi);var Kr=function(){};Kr.prototype.isInBoundary=function(t){return t%2===1},Kr.prototype.interfaces_=function(){return[Be]},Kr.prototype.getClass=function(){return Kr};var jr=function(){};jr.prototype.isInBoundary=function(t){return t>0},jr.prototype.interfaces_=function(){return[Be]},jr.prototype.getClass=function(){return jr};var Jr=function(){};Jr.prototype.isInBoundary=function(t){return t>1},Jr.prototype.interfaces_=function(){return[Be]},Jr.prototype.getClass=function(){return Jr};var Qr=function(){};Qr.prototype.isInBoundary=function(t){return t===1},Qr.prototype.interfaces_=function(){return[Be]},Qr.prototype.getClass=function(){return Qr};var Rt=function(){};Rt.prototype.add=function(){},Rt.prototype.addAll=function(){},Rt.prototype.isEmpty=function(){},Rt.prototype.iterator=function(){},Rt.prototype.size=function(){},Rt.prototype.toArray=function(){},Rt.prototype.remove=function(){};function kn(s){this.message=s||""}kn.prototype=new Error,kn.prototype.name="IndexOutOfBoundsException";var $r=function(){};$r.prototype.hasNext=function(){},$r.prototype.next=function(){},$r.prototype.remove=function(){};var Ye=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Rt);function ts(s){this.message=s||""}ts.prototype=new Error,ts.prototype.name="NoSuchElementException";var x=function(s){function t(){s.call(this),this.array_=[],arguments[0]instanceof Rt&&this.addAll(arguments[0])}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[s,Rt]},t.prototype.add=function(i){return arguments.length===1?this.array_.push(i):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(i){for(var r=this,n=i.iterator();n.hasNext();)r.add(n.next());return!0},t.prototype.set=function(i,r){var n=this.array_[i];return this.array_[i]=r,n},t.prototype.iterator=function(){return new gf(this)},t.prototype.get=function(i){if(i<0||i>=this.size())throw new kn;return this.array_[i]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var i=this,r=[],n=0,o=this.array_.length;n<o;n++)r.push(i.array_[n]);return r},t.prototype.remove=function(i){for(var r=this,n=!1,o=0,f=this.array_.length;o<f;o++)if(r.array_[o]===i){r.array_.splice(o,1),n=!0;break}return n},t}(Ye),gf=function(s){function t(e){s.call(this),this.arrayList_=e,this.position_=0}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new ts;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(i){return this.arrayList_.set(this.position_-1,i)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}($r),Ts=function(s){function t(){if(s.call(this),arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.ensureCapacity(i.length),this.add(i,!0)}else if(arguments.length===2){var r=arguments[0],n=arguments[1];this.ensureCapacity(r.length),this.add(r,n)}}}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(r){return this.get(r)},t.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var n=arguments[0],o=arguments[1],f=!1,u=n.iterator();u.hasNext();)r.add(u.next(),o),f=!0;return f}else return s.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var r=this,n=s.prototype.clone.call(this),o=0;o<this.size();o++)n.add(o,r.get(o).copy());return n},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var r=this;if(arguments.length===1){var n=arguments[0];s.prototype.add.call(this,n)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],f=arguments[1];return this.add(o,f,!0),!0}else if(arguments[0]instanceof A&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var a=this.get(this.size()-1);if(a.equals2D(u))return null}s.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],p=arguments[1];return this.add(c,p),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],h=arguments[1],v=arguments[2];if(v)for(var C=0;C<d.length;C++)r.add(d[C],h);else for(var W=d.length-1;W>=0;W--)r.add(d[W],h);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof A){var _=arguments[0],T=arguments[1],L=arguments[2];if(!L){var P=this.size();if(P>0){if(_>0){var b=this.get(_-1);if(b.equals2D(T))return null}if(_<P){var D=this.get(_);if(D.equals2D(T))return null}}}s.prototype.add.call(this,_,T)}}else if(arguments.length===4){var R=arguments[0],B=arguments[1],X=arguments[2],O=arguments[3],q=1;X>O&&(q=-1);for(var H=X;H!==O;H+=q)r.add(R[H],B);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new A(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(x),$=function(){},$s={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};$s.ForwardComparator.get=function(){return Is},$s.BidirectionalComparator.get=function(){return es},$s.coordArrayType.get=function(){return new Array(0).fill(null)},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},$.ptNotInList=function(t,e){for(var i=0;i<t.length;i++){var r=t[i];if($.indexOf(r,e)<0)return r}return null},$.scroll=function(t,e){var i=$.indexOf(e,t);if(i<0)return null;var r=new Array(t.length).fill(null);Xt.arraycopy(t,i,r,0,t.length-i),Xt.arraycopy(t,0,r,t.length-i,i),Xt.arraycopy(r,0,t,0,t.length)},$.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2];if(r===n)return!0;if(r===null||n===null||r.length!==n.length)return!1;for(var f=0;f<r.length;f++)if(o.compare(r[f],n[f])!==0)return!1;return!0}},$.intersection=function(t,e){for(var i=new Ts,r=0;r<t.length;r++)e.intersects(t[r])&&i.add(t[r],!0);return i.toCoordinateArray()},$.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},$.removeRepeatedPoints=function(t){if(!$.hasRepeatedPoints(t))return t;var e=new Ts(t,!1);return e.toCoordinateArray()},$.reverse=function(t){for(var e=t.length-1,i=Math.trunc(e/2),r=0;r<=i;r++){var n=t[r];t[r]=t[e-r],t[e-r]=n}},$.removeNull=function(t){for(var e=0,i=0;i<t.length;i++)t[i]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var n=0,o=0;o<t.length;o++)t[o]!==null&&(r[n++]=t[o]);return r},$.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),i=0;i<t.length;i++)e[i]=new A(t[i]);return e}else if(arguments.length===5)for(var r=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3],u=arguments[4],l=0;l<u;l++)o[f+l]=new A(r[n+l])},$.isEqualReversed=function(t,e){for(var i=0;i<t.length;i++){var r=t[i],n=e[t.length-i-1];if(r.compareTo(n)!==0)return!1}return!0},$.envelope=function(t){for(var e=new V,i=0;i<t.length;i++)e.expandToInclude(t[i]);return e},$.toCoordinateArray=function(t){return t.toArray($.coordArrayType)},$.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},$.indexOf=function(t,e){for(var i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1},$.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var i=t.length-1-e,r=t[e].compareTo(t[i]);if(r!==0)return r}return 1},$.compare=function(t,e){for(var i=0;i<t.length&&i<e.length;){var r=t[i].compareTo(e[i]);if(r!==0)return r;i++}return i<e.length?-1:i<t.length?1:0},$.minCoordinate=function(t){for(var e=null,i=0;i<t.length;i++)(e===null||e.compareTo(t[i])>0)&&(e=t[i]);return e},$.extract=function(t,e,i){e=Ie.clamp(e,0,t.length),i=Ie.clamp(i,-1,t.length);var r=i-e+1;i<0&&(r=0),e>=t.length&&(r=0),i<e&&(r=0);var n=new Array(r).fill(null);if(r===0)return n;for(var o=0,f=e;f<=i;f++)n[o++]=t[f];return n},Object.defineProperties($,$s);var Is=function(){};Is.prototype.compare=function(t,e){var i=t,r=e;return $.compare(i,r)},Is.prototype.interfaces_=function(){return[Ur]},Is.prototype.getClass=function(){return Is};var es=function(){};es.prototype.compare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;var n=$.compare(i,r),o=$.isEqualReversed(i,r);return o?0:n},es.prototype.OLDcompare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;for(var n=$.increasingDirection(i),o=$.increasingDirection(r),f=n>0?0:i.length-1,u=o>0?0:i.length-1,l=0;l<i.length;l++){var a=i[f].compareTo(r[u]);if(a!==0)return a;f+=n,u+=o}return 0},es.prototype.interfaces_=function(){return[Ur]},es.prototype.getClass=function(){return es};var br=function(){};br.prototype.get=function(){},br.prototype.put=function(){},br.prototype.size=function(){},br.prototype.values=function(){},br.prototype.entrySet=function(){};var df=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(br);function Ls(s){this.message=s||""}Ls.prototype=new Error,Ls.prototype.name="OperationNotSupported";function tn(){}tn.prototype=new Rt,tn.prototype.contains=function(){};var Vn=function(s){function t(){s.call(this),this.array_=[],arguments[0]instanceof Rt&&this.addAll(arguments[0])}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.contains=function(i){for(var r=this,n=0,o=this.array_.length;n<o;n++){var f=r.array_[n];if(f===i)return!0}return!1},t.prototype.add=function(i){return this.contains(i)?!1:(this.array_.push(i),!0)},t.prototype.addAll=function(i){for(var r=this,n=i.iterator();n.hasNext();)r.add(n.next());return!0},t.prototype.remove=function(i){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var i=this,r=[],n=0,o=this.array_.length;n<o;n++)r.push(i.array_[n]);return r},t.prototype.iterator=function(){return new yf(this)},t}(tn),yf=function(s){function t(e){s.call(this),this.hashSet_=e,this.position_=0}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new ts;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Ls},t}($r),Fi=0,ur=1;function Do(s){return s===null?Fi:s.color}function dt(s){return s===null?null:s.parent}function xi(s,t){s!==null&&(s.color=t)}function Gn(s){return s===null?null:s.left}function Ro(s){return s===null?null:s.right}function jt(){this.root_=null,this.size_=0}jt.prototype=new df,jt.prototype.get=function(s){for(var t=this.root_;t!==null;){var e=s.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},jt.prototype.put=function(s,t){if(this.root_===null)return this.root_={key:s,value:t,left:null,right:null,parent:null,color:Fi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,i,r;do if(i=e,r=s.compareTo(e.key),r<0)e=e.left;else if(r>0)e=e.right;else{var n=e.value;return e.value=t,n}while(e!==null);var o={key:s,left:null,right:null,value:t,parent:i,color:Fi,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?i.left=o:i.right=o,this.fixAfterInsertion(o),this.size_++,null},jt.prototype.fixAfterInsertion=function(s){var t=this;for(s.color=ur;s!=null&&s!==this.root_&&s.parent.color===ur;)if(dt(s)===Gn(dt(dt(s)))){var e=Ro(dt(dt(s)));Do(e)===ur?(xi(dt(s),Fi),xi(e,Fi),xi(dt(dt(s)),ur),s=dt(dt(s))):(s===Ro(dt(s))&&(s=dt(s),t.rotateLeft(s)),xi(dt(s),Fi),xi(dt(dt(s)),ur),t.rotateRight(dt(dt(s))))}else{var i=Gn(dt(dt(s)));Do(i)===ur?(xi(dt(s),Fi),xi(i,Fi),xi(dt(dt(s)),ur),s=dt(dt(s))):(s===Gn(dt(s))&&(s=dt(s),t.rotateRight(s)),xi(dt(s),Fi),xi(dt(dt(s)),ur),t.rotateLeft(dt(dt(s))))}this.root_.color=Fi},jt.prototype.values=function(){var s=new x,t=this.getFirstEntry();if(t!==null)for(s.add(t.value);(t=jt.successor(t))!==null;)s.add(t.value);return s},jt.prototype.entrySet=function(){var s=new Vn,t=this.getFirstEntry();if(t!==null)for(s.add(t);(t=jt.successor(t))!==null;)s.add(t);return s},jt.prototype.rotateLeft=function(s){if(s!=null){var t=s.right;s.right=t.left,t.left!=null&&(t.left.parent=s),t.parent=s.parent,s.parent===null?this.root_=t:s.parent.left===s?s.parent.left=t:s.parent.right=t,t.left=s,s.parent=t}},jt.prototype.rotateRight=function(s){if(s!=null){var t=s.left;s.left=t.right,t.right!=null&&(t.right.parent=s),t.parent=s.parent,s.parent===null?this.root_=t:s.parent.right===s?s.parent.right=t:s.parent.left=t,t.right=s,s.parent=t}},jt.prototype.getFirstEntry=function(){var s=this.root_;if(s!=null)for(;s.left!=null;)s=s.left;return s},jt.successor=function(s){if(s===null)return null;if(s.right!==null){for(var t=s.right;t.left!==null;)t=t.left;return t}else{for(var e=s.parent,i=s;e!==null&&i===e.right;)i=e,e=e.parent;return e}},jt.prototype.size=function(){return this.size_};var As=function(){};As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As};function Bo(){}Bo.prototype=new tn;function ri(){this.array_=[],arguments[0]instanceof Rt&&this.addAll(arguments[0])}ri.prototype=new Bo,ri.prototype.contains=function(s){for(var t=this,e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(s)===0)return!0}return!1},ri.prototype.add=function(s){var t=this;if(this.contains(s))return!1;for(var e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(s)===1)return t.array_.splice(e,0,s),!0}return this.array_.push(s),!0},ri.prototype.addAll=function(s){for(var t=this,e=s.iterator();e.hasNext();)t.add(e.next());return!0},ri.prototype.remove=function(s){throw new Ls},ri.prototype.size=function(){return this.array_.length},ri.prototype.isEmpty=function(){return this.array_.length===0},ri.prototype.toArray=function(){for(var s=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(s.array_[e]);return t},ri.prototype.iterator=function(){return new en(this)};var en=function(s){this.treeSet_=s,this.position_=0};en.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new ts;return this.treeSet_.array_[this.position_++]},en.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},en.prototype.remove=function(){throw new Ls};var hr=function(){};hr.sort=function(){var t=arguments[0],e,i,r,n;if(arguments.length===1)n=function(f,u){return f.compareTo(u)},t.sort(n);else if(arguments.length===2)r=arguments[1],n=function(f,u){return r.compare(f,u)},t.sort(n);else if(arguments.length===3){i=t.slice(arguments[1],arguments[2]),i.sort();var o=t.slice(0,arguments[1]).concat(i,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(i=t.slice(arguments[1],arguments[2]),r=arguments[3],n=function(f,u){return r.compare(f,u)},i.sort(n),o=t.slice(0,arguments[1]).concat(i,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},hr.asList=function(t){for(var e=new x,i=0,r=t.length;i<r;i++)e.add(t[i]);return e};var nt=function(){},ze={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};ze.P.get=function(){return 0},ze.L.get=function(){return 1},ze.A.get=function(){return 2},ze.FALSE.get=function(){return-1},ze.TRUE.get=function(){return-2},ze.DONTCARE.get=function(){return-3},ze.SYM_FALSE.get=function(){return"F"},ze.SYM_TRUE.get=function(){return"T"},ze.SYM_DONTCARE.get=function(){return"*"},ze.SYM_P.get=function(){return"0"},ze.SYM_L.get=function(){return"1"},ze.SYM_A.get=function(){return"2"},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.toDimensionSymbol=function(t){switch(t){case nt.FALSE:return nt.SYM_FALSE;case nt.TRUE:return nt.SYM_TRUE;case nt.DONTCARE:return nt.SYM_DONTCARE;case nt.P:return nt.SYM_P;case nt.L:return nt.SYM_L;case nt.A:return nt.SYM_A}throw new vt("Unknown dimension value: "+t)},nt.toDimensionValue=function(t){switch(Cs.toUpperCase(t)){case nt.SYM_FALSE:return nt.FALSE;case nt.SYM_TRUE:return nt.TRUE;case nt.SYM_DONTCARE:return nt.DONTCARE;case nt.SYM_P:return nt.P;case nt.SYM_L:return nt.L;case nt.SYM_A:return nt.A}throw new vt("Unknown dimension symbol: "+t)},Object.defineProperties(nt,ze);var si=function(){};si.prototype.filter=function(t){},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var Ue=function(){};Ue.prototype.filter=function(t,e){},Ue.prototype.isDone=function(){},Ue.prototype.isGeometryChanged=function(){},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue};var te=function(s){function t(i,r){if(s.call(this,r),this._geometries=i||[],s.hasNullElements(this._geometries))throw new vt("geometries must not contain null elements")}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var r=this,n=new V,o=0;o<this._geometries.length;o++)n.expandToInclude(r._geometries[o].getEnvelopeInternal());return n},t.prototype.getGeometryN=function(r){return this._geometries[r]},t.prototype.getSortIndex=function(){return s.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var r=this,n=new Array(this.getNumPoints()).fill(null),o=-1,f=0;f<this._geometries.length;f++)for(var u=r._geometries[f].getCoordinates(),l=0;l<u.length;l++)o++,n[o]=u[l];return n},t.prototype.getArea=function(){for(var r=this,n=0,o=0;o<this._geometries.length;o++)n+=r._geometries[o].getArea();return n},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n;if(this._geometries.length!==f._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!r._geometries[u].equalsExact(f._geometries[u],o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,n=0;n<this._geometries.length;n++)r._geometries[n].normalize();hr.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var r=this,n=nt.FALSE,o=0;o<this._geometries.length;o++)n=Math.max(n,r._geometries[o].getBoundaryDimension());return n},t.prototype.getDimension=function(){for(var r=this,n=nt.FALSE,o=0;o<this._geometries.length;o++)n=Math.max(n,r._geometries[o].getDimension());return n},t.prototype.getLength=function(){for(var r=this,n=0,o=0;o<this._geometries.length;o++)n+=r._geometries[o].getLength();return n},t.prototype.getNumPoints=function(){for(var r=this,n=0,o=0;o<this._geometries.length;o++)n+=r._geometries[o].getNumPoints();return n},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var r=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[f]=r._geometries[f].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var n=arguments[0],o=new ri(hr.asList(this._geometries)),f=new ri(hr.asList(n._geometries));return this.compare(o,f)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],a=u,c=this.getNumGeometries(),p=a.getNumGeometries(),d=0;d<c&&d<p;){var h=r.getGeometryN(d),v=a.getGeometryN(d),C=h.compareToSameClass(v,l);if(C!==0)return C;d++}return d<c?1:d<p?-1:0}},t.prototype.apply=function(){var r=this;if(U(arguments[0],Ci))for(var n=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(n);else if(U(arguments[0],Ue)){var f=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(r._geometries[u].apply(f),!f.isDone());u++);f.isGeometryChanged()&&this.geometryChanged()}else if(U(arguments[0],si)){var l=arguments[0];l.filter(this);for(var a=0;a<this._geometries.length;a++)r._geometries[a].apply(l)}else if(U(arguments[0],Mi)){var c=arguments[0];c.filter(this);for(var p=0;p<this._geometries.length;p++)r._geometries[p].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),j.shouldNeverReachHere(),null},t.prototype.clone=function(){var r=this,n=s.prototype.clone.call(this);n._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)n._geometries[o]=r._geometries[o].clone();return n},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var r=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=r._geometries[o].copy();return new t(n,this._factory)},t.prototype.isEmpty=function(){for(var r=this,n=0;n<this._geometries.length;n++)if(!r._geometries[n].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(z),lr=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];return this.isEquivalentClass(r)?s.prototype.equalsExact.call(this,r,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?nt.FALSE:0},t.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!r._geometries[n].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var r=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[n-1-f]=r._geometries[f].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new Me(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var r=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=r._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[As]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(te),Me=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Be.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=r}};Me.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Me.prototype.getBoundary=function(){return this._geom instanceof Wt?this.boundaryLineString(this._geom):this._geom instanceof lr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Me.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Me.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Me.prototype.computeBoundaryCoordinates=function(t){var e=this,i=new x;this._endpointMap=new jt;for(var r=0;r<t.getNumGeometries();r++){var n=t.getGeometryN(r);n.getNumPoints()!==0&&(e.addEndpoint(n.getCoordinateN(0)),e.addEndpoint(n.getCoordinateN(n.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var f=o.next(),u=f.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&i.add(f.getKey())}return $.toCoordinateArray(i)},Me.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new rn,this._endpointMap.put(t,e)),e.count++},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Me(t);return e.getBoundary()}else if(arguments.length===2){var i=arguments[0],r=arguments[1],n=new Me(i,r);return n.getBoundary()}};var rn=function(){this.count=null};rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn};function mf(){}function vf(){}var _f=function(){};function Cf(){}function Wf(){}function Tf(){}var Oe=function(){},Xn={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.chars=function(t,e){for(var i=new Array(e).fill(null),r=0;r<e;r++)i[r]=t;return String(i)},Oe.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Cf,i=new mf;return t.printStackTrace(i),e.toString()}else if(arguments.length===2){var r=arguments[0],n=arguments[1],o="";new vf(Oe.getStackTrace(r));for(var f=new Tf,u=0;u<n;u++)try{o+=f.readLine()+Oe.NEWLINE}catch(l){if(l instanceof Wf)j.shouldNeverReachHere();else throw l}finally{}return o}},Oe.split=function(t,e){for(var i=e.length,r=new x,n=""+t,o=n.indexOf(e);o>=0;){var f=n.substring(0,o);r.add(f),n=n.substring(o+i),o=n.indexOf(e)}n.length>0&&r.add(n);for(var u=new Array(r.size()).fill(null),l=0;l<u.length;l++)u[l]=r.get(l);return u},Oe.toString=function(){if(arguments.length===1){var t=arguments[0];return Oe.SIMPLE_ORDINATE_FORMAT.format(t)}},Oe.spaces=function(t){return Oe.chars(" ",t)},Xn.NEWLINE.get=function(){return Xt.getProperty("line.separator")},Xn.SIMPLE_ORDINATE_FORMAT.get=function(){return new _f},Object.defineProperties(Oe,Xn);var Lt=function(){};Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.copyCoord=function(t,e,i,r){for(var n=Math.min(t.getDimension(),i.getDimension()),o=0;o<n;o++)i.setOrdinate(r,o,t.getOrdinate(e,o))},Lt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,it.X)===t.getOrdinate(e-1,it.X)&&t.getOrdinate(0,it.Y)===t.getOrdinate(e-1,it.Y)},Lt.isEqual=function(t,e){var i=t.size(),r=e.size();if(i!==r)return!1;for(var n=Math.min(t.getDimension(),e.getDimension()),o=0;o<i;o++)for(var f=0;f<n;f++){var u=t.getOrdinate(o,f),l=e.getOrdinate(o,f);if(t.getOrdinate(o,f)!==e.getOrdinate(o,f)&&!(Z.isNaN(u)&&Z.isNaN(l)))return!1}return!0},Lt.extend=function(t,e,i){var r=t.create(i,e.getDimension()),n=e.size();if(Lt.copy(e,0,r,0,n),n>0)for(var o=n;o<i;o++)Lt.copy(e,n-1,r,o,1);return r},Lt.reverse=function(t){for(var e=t.size()-1,i=Math.trunc(e/2),r=0;r<=i;r++)Lt.swap(t,r,e-r)},Lt.swap=function(t,e,i){if(e===i)return null;for(var r=0;r<t.getDimension();r++){var n=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(i,r)),t.setOrdinate(i,r,n)}},Lt.copy=function(t,e,i,r,n){for(var o=0;o<n;o++)Lt.copyCoord(t,e+o,i,r+o)},Lt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var i=t.getDimension(),r=new $e;r.append("(");for(var n=0;n<e;n++){n>0&&r.append(" ");for(var o=0;o<i;o++)o>0&&r.append(","),r.append(Oe.toString(t.getOrdinate(n,o)))}return r.append(")"),r.toString()}},Lt.ensureValidRing=function(t,e){var i=e.size();if(i===0)return e;if(i<=3)return Lt.createClosedRing(t,e,4);var r=e.getOrdinate(0,it.X)===e.getOrdinate(i-1,it.X)&&e.getOrdinate(0,it.Y)===e.getOrdinate(i-1,it.Y);return r?e:Lt.createClosedRing(t,e,i+1)},Lt.createClosedRing=function(t,e,i){var r=t.create(i,e.getDimension()),n=e.size();Lt.copy(e,0,r,0,n);for(var o=n;o<i;o++)Lt.copy(e,0,r,o,1);return r};var Wt=function(s){function t(i,r){s.call(this,r),this._points=null,this.init(i)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new V:this._points.expandEnvelope(new V)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return s.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n;if(this._points.size()!==f._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!r.equal(r._points.getCoordinate(u),f._points.getCoordinate(u),o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,n=0;n<Math.trunc(this._points.size()/2);n++){var o=r._points.size()-1-n;if(!r._points.getCoordinate(n).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(n).compareTo(r._points.getCoordinate(o))>0&&Lt.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?nt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return k.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();Lt.reverse(r);var n=this.getFactory().createLineString(r);return n},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var n=arguments[0],o=n,f=0,u=0;f<this._points.size()&&u<o._points.size();){var l=r._points.getCoordinate(f).compareTo(o._points.getCoordinate(u));if(l!==0)return l;f++,u++}return f<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var a=arguments[0],c=arguments[1],p=a;return c.compare(this._points,p._points)}},t.prototype.apply=function(){var r=this;if(U(arguments[0],Ci))for(var n=arguments[0],o=0;o<this._points.size();o++)n.filter(r._points.getCoordinate(o));else if(U(arguments[0],Ue)){var f=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(f.filter(r._points,u),!f.isDone());u++);f.isGeometryChanged()&&this.geometryChanged()}else if(U(arguments[0],si)){var l=arguments[0];l.filter(this)}else if(U(arguments[0],Mi)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return new Me(this).getBoundary()},t.prototype.isEquivalentClass=function(r){return r instanceof t},t.prototype.clone=function(){var r=s.prototype.clone.call(this);return r._points=this._points.clone(),r},t.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new vt("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var n=this,o=0;o<this._points.size();o++)if(n._points.getCoordinate(o).equals(r))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},t.prototype.interfaces_=function(){return[As]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(z),ws=function(){};ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws};var me=function(s){function t(i,r){s.call(this,r),this._coordinates=i||null,this.init(this._coordinates)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new V;var r=new V;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},t.prototype.getSortIndex=function(){return s.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.getCoordinate(),this.getCoordinate(),n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var r=arguments[0],n=r;return this.getCoordinate().compareTo(n.getCoordinate())}else if(arguments.length===2){var o=arguments[0],f=arguments[1],u=o;return f.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(U(arguments[0],Ci)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(U(arguments[0],Ue)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this._coordinates,0),n.isGeometryChanged()&&this.geometryChanged()}else if(U(arguments[0],si)){var o=arguments[0];o.filter(this)}else if(U(arguments[0],Mi)){var f=arguments[0];f.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var r=s.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),j.isTrue(r.size()<=1),this._coordinates=r},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[ws]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(z),Ki=function(){};Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki};var Bt=function(s){function t(i,r,n){if(s.call(this,n),this._shell=null,this._holes=null,i===null&&(i=this.getFactory().createLinearRing()),r===null&&(r=[]),s.hasNullElements(r))throw new vt("holes must not contain null elements");if(i.isEmpty()&&s.hasNonEmptyElements(r))throw new vt("shell is empty but holes are not");this._shell=i,this._holes=r}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return s.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var n=new Array(this.getNumPoints()).fill(null),o=-1,f=this._shell.getCoordinates(),u=0;u<f.length;u++)o++,n[o]=f[u];for(var l=0;l<this._holes.length;l++)for(var a=r._holes[l].getCoordinates(),c=0;c<a.length;c++)o++,n[o]=a[c];return n},t.prototype.getArea=function(){var r=this,n=0;n+=Math.abs(k.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)n-=Math.abs(k.signedArea(r._holes[o].getCoordinateSequence()));return n},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),n=this.getEnvelopeInternal(),o=0;o<5;o++){var f=r.getX(o);if(!(f===n.getMinX()||f===n.getMaxX()))return!1;var u=r.getY(o);if(!(u===n.getMinY()||u===n.getMaxY()))return!1}for(var l=r.getX(0),a=r.getY(0),c=1;c<=4;c++){var p=r.getX(c),d=r.getY(c),h=p!==l,v=d!==a;if(h===v)return!1;l=p,a=d}return!0},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n,u=this._shell,l=f._shell;if(!u.equalsExact(l,o)||this._holes.length!==f._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!r._holes[a].equalsExact(f._holes[a],o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var n=0;n<this._holes.length;n++)r.normalize(r._holes[n],!1);hr.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],f=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Xt.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=$.minCoordinate(o.getCoordinates());$.scroll(u,l),Xt.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],k.isCCW(o.getCoordinates())===f&&$.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var r=this,n=0;n+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)n+=r._holes[o].getLength();return n},t.prototype.getNumPoints=function(){for(var r=this,n=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)n+=r._holes[o].getNumPoints();return n},t.prototype.reverse=function(){var r=this,n=this.copy();n._shell=this._shell.copy().reverse(),n._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)n._holes[o]=r._holes[o].copy().reverse();return n},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var n=arguments[0],o=this._shell,f=n._shell;return o.compareToSameClass(f)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],a=u,c=this._shell,p=a._shell,d=c.compareToSameClass(p,l);if(d!==0)return d;for(var h=this.getNumInteriorRing(),v=a.getNumInteriorRing(),C=0;C<h&&C<v;){var W=r.getInteriorRingN(C),_=a.getInteriorRingN(C),T=W.compareToSameClass(_,l);if(T!==0)return T;C++}return C<h?1:C<v?-1:0}},t.prototype.apply=function(r){var n=this;if(U(r,Ci)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)n._holes[o].apply(r)}else if(U(r,Ue)){if(this._shell.apply(r),!r.isDone())for(var f=0;f<this._holes.length&&(n._holes[f].apply(r),!r.isDone());f++);r.isGeometryChanged()&&this.geometryChanged()}else if(U(r,si))r.filter(this);else if(U(r,Mi)){r.filter(this),this._shell.apply(r);for(var u=0;u<this._holes.length;u++)n._holes[u].apply(r)}},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var n=new Array(this._holes.length+1).fill(null);n[0]=this._shell;for(var o=0;o<this._holes.length;o++)n[o+1]=r._holes[o];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)},t.prototype.clone=function(){var r=this,n=s.prototype.clone.call(this);n._shell=this._shell.clone(),n._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)n._holes[o]=r._holes[o].clone();return n},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this,n=this._shell.copy(),o=new Array(this._holes.length).fill(null),f=0;f<o.length;f++)o[f]=r._holes[f].copy();return new t(n,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(r){return this._holes[r]},t.prototype.interfaces_=function(){return[Ki]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(z),is=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];return this.isEquivalentClass(r)?s.prototype.equalsExact.call(this,r,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return s.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var r=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=r._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[ws]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(te),Wi=function(s){function t(i,r){i instanceof A&&r instanceof tt&&(i=r.getCoordinateSequenceFactory().create(i)),s.call(this,i,r),this.validateConstruction()}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:s.prototype.isClosed.call(this)},t.prototype.reverse=function(){var r=this._points.copy();Lt.reverse(r);var n=this.getFactory().createLinearRing(r);return n},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!s.prototype.isClosed.call(this))throw new vt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new vt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(Wt),Ti=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];return this.isEquivalentClass(r)?s.prototype.equalsExact.call(this,r,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[f]=r._geometries[f].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var n=new x,o=0;o<this._geometries.length;o++)for(var f=r._geometries[o],u=f.getBoundary(),l=0;l<u.getNumGeometries();l++)n.add(u.getGeometryN(l));var a=new Array(n.size()).fill(null);return this.getFactory().createMultiLineString(n.toArray(a))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var r=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=r._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[Ki]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(te),Fe=function(t){this._factory=t||null,this._isUserDataCopied=!1},sn={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Fe.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Fe.prototype.edit=function(t,e){if(t===null)return null;var i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i},Fe.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof te?this.editGeometryCollection(t,e):t instanceof Bt?this.editPolygon(t,e):t instanceof me?e.edit(t,this._factory):t instanceof Wt?e.edit(t,this._factory):(j.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Fe.prototype.editGeometryCollection=function(t,e){for(var i=this,r=e.edit(t,this._factory),n=new x,o=0;o<r.getNumGeometries();o++){var f=i.edit(r.getGeometryN(o),e);f===null||f.isEmpty()||n.add(f)}return r.getClass()===is?this._factory.createMultiPoint(n.toArray([])):r.getClass()===lr?this._factory.createMultiLineString(n.toArray([])):r.getClass()===Ti?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},Fe.prototype.editPolygon=function(t,e){var i=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var n=this.edit(r.getExteriorRing(),e);if(n===null||n.isEmpty())return this._factory.createPolygon();for(var o=new x,f=0;f<r.getNumInteriorRing();f++){var u=i.edit(r.getInteriorRingN(f),e);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(n,o.toArray([]))},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.GeometryEditorOperation=function(){},sn.NoOpGeometryOperation.get=function(){return Es},sn.CoordinateOperation.get=function(){return Ps},sn.CoordinateSequenceOperation.get=function(){return Ss},Object.defineProperties(Fe,sn);var Es=function(){};Es.prototype.edit=function(t,e){return t},Es.prototype.interfaces_=function(){return[Fe.GeometryEditorOperation]},Es.prototype.getClass=function(){return Es};var Ps=function(){};Ps.prototype.edit=function(t,e){var i=this.editCoordinates(t.getCoordinates(),t);return i===null?t:t instanceof Wi?e.createLinearRing(i):t instanceof Wt?e.createLineString(i):t instanceof me?i.length>0?e.createPoint(i[0]):e.createPoint():t},Ps.prototype.interfaces_=function(){return[Fe.GeometryEditorOperation]},Ps.prototype.getClass=function(){return Ps};var Ss=function(){};Ss.prototype.edit=function(t,e){return t instanceof Wi?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof me?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Ss.prototype.interfaces_=function(){return[Fe.GeometryEditorOperation]},Ss.prototype.getClass=function(){return Ss};var At=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var i=0;i<e;i++)t._coordinates[i]=new A}else if(U(arguments[0],it)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var n=0;n<this._coordinates.length;n++)t._coordinates[n]=r.getCoordinateCopy(n)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],f=arguments[1];this._coordinates=o,this._dimension=f,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var a=0;a<u;a++)t._coordinates[a]=new A}}},Mo={serialVersionUID:{configurable:!0}};At.prototype.setOrdinate=function(t,e,i){switch(e){case it.X:this._coordinates[t].x=i;break;case it.Y:this._coordinates[t].y=i;break;case it.Z:this._coordinates[t].z=i;break;default:throw new vt("invalid ordinateIndex")}},At.prototype.size=function(){return this._coordinates.length},At.prototype.getOrdinate=function(t,e){switch(e){case it.X:return this._coordinates[t].x;case it.Y:return this._coordinates[t].y;case it.Z:return this._coordinates[t].z}return Z.NaN},At.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],i=arguments[1];i.x=this._coordinates[e].x,i.y=this._coordinates[e].y,i.z=this._coordinates[e].z}},At.prototype.getCoordinateCopy=function(t){return new A(this._coordinates[t])},At.prototype.getDimension=function(){return this._dimension},At.prototype.getX=function(t){return this._coordinates[t].x},At.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].clone();return new At(e,this._dimension)},At.prototype.expandEnvelope=function(t){for(var e=this,i=0;i<this._coordinates.length;i++)t.expandToInclude(e._coordinates[i]);return t},At.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].copy();return new At(e,this._dimension)},At.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new $e(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)e.append(", "),e.append(t._coordinates[i]);return e.append(")"),e.toString()}else return"()"},At.prototype.getY=function(t){return this._coordinates[t].y},At.prototype.toCoordinateArray=function(){return this._coordinates},At.prototype.interfaces_=function(){return[it,Re]},At.prototype.getClass=function(){return At},Mo.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(At,Mo);var Ii=function(){},Yn={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ii.prototype.readResolve=function(){return Ii.instance()},Ii.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new At(t)}else if(U(arguments[0],it)){var e=arguments[0];return new At(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new At(i):new At(i,r)}},Ii.prototype.interfaces_=function(){return[qr,Re]},Ii.prototype.getClass=function(){return Ii},Ii.instance=function(){return Ii.instanceObject},Yn.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Yn.instanceObject.get=function(){return new Ii},Object.defineProperties(Ii,Yn);var Oo=function(s){function t(){s.call(this),this.map_=new Map}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.get=function(i){return this.map_.get(i)||null},t.prototype.put=function(i,r){return this.map_.set(i,r),r},t.prototype.values=function(){for(var i=new x,r=this.map_.values(),n=r.next();!n.done;)i.add(n.value),n=r.next();return i},t.prototype.entrySet=function(){var i=new Vn;return this.map_.entries().forEach(function(r){return i.add(r)}),i},t.prototype.size=function(){return this.map_.size()},t}(br),ot=function s(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=s.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ni){var t=arguments[0];this._modelType=t,t===s.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=s.FIXED,this.setScale(e)}else if(arguments[0]instanceof s){var i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}}},zn={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};ot.prototype.equals=function(t){if(!(t instanceof ot))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},ot.prototype.compareTo=function(t){var e=t,i=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new ti(i).compareTo(new ti(r))},ot.prototype.getScale=function(){return this._scale},ot.prototype.isFloating=function(){return this._modelType===ot.FLOATING||this._modelType===ot.FLOATING_SINGLE},ot.prototype.getType=function(){return this._modelType},ot.prototype.toString=function(){var t="UNKNOWN";return this._modelType===ot.FLOATING?t="Floating":this._modelType===ot.FLOATING_SINGLE?t="Floating-Single":this._modelType===ot.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},ot.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Z.isNaN(t))return t;if(this._modelType===ot.FLOATING_SINGLE){var e=t;return e}return this._modelType===ot.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof A){var i=arguments[0];if(this._modelType===ot.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},ot.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===ot.FLOATING?t=16:this._modelType===ot.FLOATING_SINGLE?t=6:this._modelType===ot.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},ot.prototype.setScale=function(t){this._scale=Math.abs(t)},ot.prototype.interfaces_=function(){return[Re,De]},ot.prototype.getClass=function(){return ot},ot.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},zn.serialVersionUID.get=function(){return 7777263578777804e3},zn.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ot,zn);var ni=function s(t){this._name=t||null,s.nameToTypeMap.put(t,this)},Un={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ni.prototype.readResolve=function(){return ni.nameToTypeMap.get(this._name)},ni.prototype.toString=function(){return this._name},ni.prototype.interfaces_=function(){return[Re]},ni.prototype.getClass=function(){return ni},Un.serialVersionUID.get=function(){return-552860263173159e4},Un.nameToTypeMap.get=function(){return new Oo},Object.defineProperties(ni,Un),ot.Type=ni,ot.FIXED=new ni("FIXED"),ot.FLOATING=new ni("FLOATING"),ot.FLOATING_SINGLE=new ni("FLOATING SINGLE");var tt=function s(){this._precisionModel=new ot,this._SRID=0,this._coordinateSequenceFactory=s.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?U(arguments[0],qr)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof ot&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Fo={serialVersionUID:{configurable:!0}};tt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new A(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new A(t.getMinX(),t.getMinY()),new A(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new A(t.getMinX(),t.getMinY()),new A(t.getMinX(),t.getMaxY()),new A(t.getMaxX(),t.getMaxY()),new A(t.getMaxX(),t.getMinY()),new A(t.getMinX(),t.getMinY())]),null)},tt.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Wt(this.getCoordinateSequenceFactory().create(t),this);if(U(t,it))return new Wt(t,this)}else return new Wt(this.getCoordinateSequenceFactory().create([]),this)},tt.prototype.createMultiLineString=function(){if(arguments.length===0)return new lr(null,this);if(arguments.length===1){var t=arguments[0];return new lr(t,this)}},tt.prototype.buildGeometry=function(t){for(var e=null,i=!1,r=!1,n=t.iterator();n.hasNext();){var o=n.next(),f=o.getClass();e===null&&(e=f),f!==e&&(i=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(i||r)return this.createGeometryCollection(tt.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Bt)return this.createMultiPolygon(tt.toPolygonArray(t));if(u instanceof Wt)return this.createMultiLineString(tt.toLineStringArray(t));if(u instanceof me)return this.createMultiPoint(tt.toPointArray(t));j.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},tt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},tt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(U(arguments[0],it)){var e=arguments[0];return new me(e,this)}}},tt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},tt.prototype.createPolygon=function(){if(arguments.length===0)return new Bt(null,null,this);if(arguments.length===1){if(U(arguments[0],it)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Wi){var i=arguments[0];return this.createPolygon(i,null)}}else if(arguments.length===2){var r=arguments[0],n=arguments[1];return new Bt(r,n,this)}},tt.prototype.getSRID=function(){return this._SRID},tt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new te(null,this);if(arguments.length===1){var t=arguments[0];return new te(t,this)}},tt.prototype.createGeometry=function(t){var e=new Fe(this);return e.edit(t,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},tt.prototype.getPrecisionModel=function(){return this._precisionModel},tt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(U(arguments[0],it)){var e=arguments[0];return new Wi(e,this)}}},tt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ti(null,this);if(arguments.length===1){var t=arguments[0];return new Ti(t,this)}},tt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new is(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new is(e,this)}else if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}else if(U(arguments[0],it)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(r.size()).fill(null),o=0;o<r.size();o++){var f=t.getCoordinateSequenceFactory().create(1,r.getDimension());Lt.copy(r,o,f,0,1),n[o]=t.createPoint(f)}return this.createMultiPoint(n)}}},tt.prototype.interfaces_=function(){return[Re]},tt.prototype.getClass=function(){return tt},tt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.getDefaultCoordinateSequenceFactory=function(){return Ii.instance()},tt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},tt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Fo.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(tt,Fo);var If=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],nn=function(t){this.geometryFactory=t||new tt};nn.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var i=e.type;if(!oi[i])throw new Error("Unknown GeoJSON type: "+e.type);return If.indexOf(i)!==-1?oi[i].apply(this,[e.coordinates]):i==="GeometryCollection"?oi[i].apply(this,[e.geometries]):oi[i].apply(this,[e])},nn.prototype.write=function(t){var e=t.getGeometryType();if(!ki[e])throw new Error("Geometry is not supported");return ki[e].apply(this,[t])};var oi={Feature:function(s){var t={};for(var e in s)t[e]=s[e];if(s.geometry){var i=s.geometry.type;if(!oi[i])throw new Error("Unknown GeoJSON type: "+s.type);t.geometry=this.read(s.geometry)}return s.bbox&&(t.bbox=oi.bbox.apply(this,[s.bbox])),t},FeatureCollection:function(s){var t=this,e={};if(s.features){e.features=[];for(var i=0;i<s.features.length;++i)e.features.push(t.read(s.features[i]))}return s.bbox&&(e.bbox=this.parse.bbox.apply(this,[s.bbox])),e},coordinates:function(s){for(var t=[],e=0;e<s.length;++e){var i=s[e];t.push(new A(i[0],i[1]))}return t},bbox:function(s){return this.geometryFactory.createLinearRing([new A(s[0],s[1]),new A(s[2],s[1]),new A(s[2],s[3]),new A(s[0],s[3]),new A(s[0],s[1])])},Point:function(s){var t=new A(s[0],s[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(s){for(var t=this,e=[],i=0;i<s.length;++i)e.push(oi.Point.apply(t,[s[i]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(s){var t=oi.coordinates.apply(this,[s]);return this.geometryFactory.createLineString(t)},MultiLineString:function(s){for(var t=this,e=[],i=0;i<s.length;++i)e.push(oi.LineString.apply(t,[s[i]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(s){for(var t=this,e=oi.coordinates.apply(this,[s[0]]),i=this.geometryFactory.createLinearRing(e),r=[],n=1;n<s.length;++n){var o=s[n],f=oi.coordinates.apply(t,[o]),u=t.geometryFactory.createLinearRing(f);r.push(u)}return this.geometryFactory.createPolygon(i,r)},MultiPolygon:function(s){for(var t=this,e=[],i=0;i<s.length;++i){var r=s[i];e.push(oi.Polygon.apply(t,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(s){for(var t=this,e=[],i=0;i<s.length;++i){var r=s[i];e.push(t.read(r))}return this.geometryFactory.createGeometryCollection(e)}},ki={coordinate:function(s){return[s.x,s.y]},Point:function(s){var t=ki.coordinate.apply(this,[s.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(s){for(var t=this,e=[],i=0;i<s._geometries.length;++i){var r=s._geometries[i],n=ki.Point.apply(t,[r]);e.push(n.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(s){for(var t=this,e=[],i=s.getCoordinates(),r=0;r<i.length;++r){var n=i[r];e.push(ki.coordinate.apply(t,[n]))}return{type:"LineString",coordinates:e}},MultiLineString:function(s){for(var t=this,e=[],i=0;i<s._geometries.length;++i){var r=s._geometries[i],n=ki.LineString.apply(t,[r]);e.push(n.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(s){var t=this,e=[],i=ki.LineString.apply(this,[s._shell]);e.push(i.coordinates);for(var r=0;r<s._holes.length;++r){var n=s._holes[r],o=ki.LineString.apply(t,[n]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(s){for(var t=this,e=[],i=0;i<s._geometries.length;++i){var r=s._geometries[i],n=ki.Polygon.apply(t,[r]);e.push(n.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(s){for(var t=this,e=[],i=0;i<s._geometries.length;++i){var r=s._geometries[i],n=r.getGeometryType();e.push(ki[n].apply(t,[r]))}return{type:"GeometryCollection",geometries:e}}},qn=function(t){this.geometryFactory=t||new tt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new nn(this.geometryFactory)};qn.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===ot.FIXED&&this.reducePrecision(e),e},qn.prototype.reducePrecision=function(t){var e=this,i,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(i=0,r=t.points.length;i<r;i++)e.precisionModel.makePrecise(t.points[i]);else if(t.geometries)for(i=0,r=t.geometries.length;i<r;i++)e.reducePrecision(t.geometries[i])};var xo=function(){this.parser=new nn(this.geometryFactory)};xo.prototype.write=function(t){return this.parser.write(t)};var M=function(){},on={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.opposite=function(t){return t===M.LEFT?M.RIGHT:t===M.RIGHT?M.LEFT:t},on.ON.get=function(){return 0},on.LEFT.get=function(){return 1},on.RIGHT.get=function(){return 2},Object.defineProperties(M,on);function an(s){this.message=s||""}an.prototype=new Error,an.prototype.name="EmptyStackException";function ai(){this.array_=[]}ai.prototype=new Ye,ai.prototype.add=function(s){return this.array_.push(s),!0},ai.prototype.get=function(s){if(s<0||s>=this.size())throw new Error;return this.array_[s]},ai.prototype.push=function(s){return this.array_.push(s),s},ai.prototype.pop=function(s){if(this.array_.length===0)throw new an;return this.array_.pop()},ai.prototype.peek=function(){if(this.array_.length===0)throw new an;return this.array_[this.array_.length-1]},ai.prototype.empty=function(){return this.array_.length===0},ai.prototype.isEmpty=function(){return this.empty()},ai.prototype.search=function(s){return this.array_.indexOf(s)},ai.prototype.size=function(){return this.array_.length},ai.prototype.toArray=function(){for(var s=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(s.array_[e]);return t};var fi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};fi.prototype.getCoordinate=function(){return this._minCoord},fi.prototype.getRightmostSide=function(t,e){var i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i},fi.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();j.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],i=t[this._minIndex+1],r=k.computeOrientation(this._minCoord,i,e),n=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&r===k.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&r===k.CLOCKWISE)&&(n=!0),n&&(this._minIndex=this._minIndex-1)},fi.prototype.getRightmostSideOfSegment=function(t,e){var i=t.getEdge(),r=i.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var n=M.LEFT;return r[e].y<r[e+1].y&&(n=M.RIGHT),n},fi.prototype.getEdge=function(){return this._orientedDe},fi.prototype.checkForRightmostCoordinate=function(t){for(var e=this,i=t.getEdge().getCoordinates(),r=0;r<i.length-1;r++)(e._minCoord===null||i[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=i[r])},fi.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},fi.prototype.findEdge=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();r.isForward()&&e.checkForRightmostCoordinate(r)}j.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var n=this.getRightmostSide(this._minDe,this._minIndex);n===M.LEFT&&(this._orientedDe=this._minDe.getSym())},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi};var Vi=function(s){function t(e,i){s.call(this,t.msgWithCoord(e,i)),this.pt=i?new A(i):null,this.name="TopologyException"}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(i,r){return r?i:i+" [ "+r+" ]"},t}(Bi),fn=function(){this.array_=[]};fn.prototype.addLast=function(t){this.array_.push(t)},fn.prototype.removeFirst=function(){return this.array_.shift()},fn.prototype.isEmpty=function(){return this.array_.length===0};var ee=function(){this._finder=null,this._dirEdgeList=new x,this._nodes=new x,this._rightMostCoord=null,this._env=null,this._finder=new fi};ee.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},ee.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ee.prototype.computeNodeDepth=function(t){for(var e=this,i=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){i=n;break}}if(i===null)throw new Vi("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(i);for(var o=t.getEdges().iterator();o.hasNext();){var f=o.next();f.setVisited(!0),e.copySymDepths(f)}},ee.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(M.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ee.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ee.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(M.RIGHT)>=1&&e.getDepth(M.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ee.prototype.computeDepths=function(t){var e=this,i=new Vn,r=new fn,n=t.getNode();for(r.addLast(n),i.add(n),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();i.add(o),e.computeNodeDepth(o);for(var f=o.getEdges().iterator();f.hasNext();){var u=f.next(),l=u.getSym();if(!l.isVisited()){var a=l.getNode();i.contains(a)||(r.addLast(a),i.add(a))}}}},ee.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ee.prototype.getEnvelope=function(){if(this._env===null){for(var t=new V,e=this._dirEdgeList.iterator();e.hasNext();)for(var i=e.next(),r=i.getEdge().getCoordinates(),n=0;n<r.length-1;n++)t.expandToInclude(r[n]);this._env=t}return this._env},ee.prototype.addReachable=function(t){var e=this,i=new ai;for(i.add(t);!i.empty();){var r=i.pop();e.add(r,i)}},ee.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(M.LEFT,t.getDepth(M.RIGHT)),e.setDepth(M.RIGHT,t.getDepth(M.LEFT))},ee.prototype.add=function(t,e){var i=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var n=r.next();i._dirEdgeList.add(n);var o=n.getSym(),f=o.getNode();f.isVisited()||e.push(f)}},ee.prototype.getNodes=function(){return this._nodes},ee.prototype.getDirectedEdges=function(){return this._dirEdgeList},ee.prototype.interfaces_=function(){return[De]},ee.prototype.getClass=function(){return ee};var yt=function s(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var i=arguments[0];this.init(1),this.location[M.ON]=i}else if(arguments[0]instanceof s){var r=arguments[0];if(this.init(r.location.length),r!==null)for(var n=0;n<this.location.length;n++)t.location[n]=r.location[n]}}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];this.init(3),this.location[M.ON]=o,this.location[M.LEFT]=f,this.location[M.RIGHT]=u}};yt.prototype.setAllLocations=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]=t},yt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==E.NONE)return!1;return!0},yt.prototype.setAllLocationsIfNull=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]===E.NONE&&(e.location[i]=t)},yt.prototype.isLine=function(){return this.location.length===1},yt.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var i=new Array(3).fill(null);i[M.ON]=this.location[M.ON],i[M.LEFT]=E.NONE,i[M.RIGHT]=E.NONE,this.location=i}for(var r=0;r<this.location.length;r++)e.location[r]===E.NONE&&r<t.location.length&&(e.location[r]=t.location[r])},yt.prototype.getLocations=function(){return this.location},yt.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[M.LEFT];this.location[M.LEFT]=this.location[M.RIGHT],this.location[M.RIGHT]=t},yt.prototype.toString=function(){var t=new $e;return this.location.length>1&&t.append(E.toLocationSymbol(this.location[M.LEFT])),t.append(E.toLocationSymbol(this.location[M.ON])),this.location.length>1&&t.append(E.toLocationSymbol(this.location[M.RIGHT])),t.toString()},yt.prototype.setLocations=function(t,e,i){this.location[M.ON]=t,this.location[M.LEFT]=e,this.location[M.RIGHT]=i},yt.prototype.get=function(t){return t<this.location.length?this.location[t]:E.NONE},yt.prototype.isArea=function(){return this.location.length>1},yt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===E.NONE)return!0;return!1},yt.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(M.ON,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.location[e]=i}},yt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(E.NONE)},yt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},yt.prototype.allPositionsEqual=function(t){for(var e=this,i=0;i<this.location.length;i++)if(e.location[i]!==t)return!1;return!0},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt};var ht=function s(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new yt(t),this.elt[1]=new yt(t)}else if(arguments[0]instanceof s){var e=arguments[0];this.elt[0]=new yt(e.elt[0]),this.elt[1]=new yt(e.elt[1])}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.elt[0]=new yt(E.NONE),this.elt[1]=new yt(E.NONE),this.elt[i].setLocation(r)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];this.elt[0]=new yt(n,o,f),this.elt[1]=new yt(n,o,f)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],a=arguments[2],c=arguments[3];this.elt[0]=new yt(E.NONE,E.NONE,E.NONE),this.elt[1]=new yt(E.NONE,E.NONE,E.NONE),this.elt[u].setLocations(l,a,c)}};ht.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ht.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ht.prototype.isNull=function(t){return this.elt[t].isNull()},ht.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.elt[e].setAllLocationsIfNull(i)}},ht.prototype.isLine=function(t){return this.elt[t].isLine()},ht.prototype.merge=function(t){for(var e=this,i=0;i<2;i++)e.elt[i]===null&&t.elt[i]!==null?e.elt[i]=new yt(t.elt[i]):e.elt[i].merge(t.elt[i])},ht.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ht.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(M.ON)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.elt[e].get(i)}},ht.prototype.toString=function(){var t=new $e;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},ht.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},ht.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ht.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(M.ON,e)}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this.elt[i].setLocation(r,n)}},ht.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ht.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ht.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new yt(this.elt[t].location[0]))},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.toLineLabel=function(t){for(var e=new ht(E.NONE),i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e};var Nt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new x,this._pts=new x,this._label=new ht(E.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new x,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Nt.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)e[i]=t._pts.get(i);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=k.isCCW(this._ring.getCoordinates())},Nt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Nt.prototype.computePoints=function(t){var e=this;this._startDe=t;var i=t,r=!0;do{if(i===null)throw new Vi("Found null DirectedEdge");if(i.getEdgeRing()===e)throw new Vi("Directed Edge visited twice during ring-building at "+i.getCoordinate());e._edges.add(i);var n=i.getLabel();j.isTrue(n.isArea()),e.mergeLabel(n),e.addPoints(i.getEdge(),i.isForward(),r),r=!1,e.setEdgeRing(i,e),i=e.getNext(i)}while(i!==this._startDe)},Nt.prototype.getLinearRing=function(){return this._ring},Nt.prototype.getCoordinate=function(t){return this._pts.get(t)},Nt.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var i=e.getNode(),r=i.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Nt.prototype.addPoints=function(t,e,i){var r=this,n=t.getCoordinates();if(e){var o=1;i&&(o=0);for(var f=o;f<n.length;f++)r._pts.add(n[f])}else{var u=n.length-2;i&&(u=n.length-1);for(var l=u;l>=0;l--)r._pts.add(n[l])}},Nt.prototype.isHole=function(){return this._isHole},Nt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Nt.prototype.containsPoint=function(t){var e=this.getLinearRing(),i=e.getEnvelopeInternal();if(!i.contains(t)||!k.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var n=r.next();if(n.containsPoint(t))return!1}return!0},Nt.prototype.addHole=function(t){this._holes.add(t)},Nt.prototype.isShell=function(){return this._shell===null},Nt.prototype.getLabel=function(){return this._label},Nt.prototype.getEdges=function(){return this._edges},Nt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Nt.prototype.getShell=function(){return this._shell},Nt.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=e.getLocation(i,M.RIGHT);if(r===E.NONE)return null;if(this._label.getLocation(i)===E.NONE)return this._label.setLocation(i,r),null}},Nt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Nt.prototype.toPolygon=function(t){for(var e=this,i=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)i[r]=e._holes.get(r).getLinearRing();var n=t.createPolygon(this.getLinearRing(),i);return n},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt};var Lf=function(s){function t(){var e=arguments[0],i=arguments[1];s.call(this,e,i)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(i,r){i.setMinEdgeRing(r)},t.prototype.getNext=function(i){return i.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Nt),Af=function(s){function t(){var e=arguments[0],i=arguments[1];s.call(this,e,i)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var i=this,r=new x,n=this._startDe;do{if(n.getMinEdgeRing()===null){var o=new Lf(n,i._geometryFactory);r.add(o)}n=n.getNext()}while(n!==this._startDe);return r},t.prototype.setEdgeRing=function(i,r){i.setEdgeRing(r)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var i=this,r=this._startDe;do{var n=r.getNode();n.getEdges().linkMinimalDirectedEdges(i),r=r.getNext()}while(r!==this._startDe)},t.prototype.getNext=function(i){return i.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Nt),Le=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};Le.prototype.setVisited=function(t){this._isVisited=t},Le.prototype.setInResult=function(t){this._isInResult=t},Le.prototype.isCovered=function(){return this._isCovered},Le.prototype.isCoveredSet=function(){return this._isCoveredSet},Le.prototype.setLabel=function(t){this._label=t},Le.prototype.getLabel=function(){return this._label},Le.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Le.prototype.updateIM=function(t){j.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Le.prototype.isInResult=function(){return this._isInResult},Le.prototype.isVisited=function(){return this._isVisited},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le};var un=function(s){function t(){s.call(this),this._coord=null,this._edges=null;var e=arguments[0],i=arguments[1];this._coord=e,this._edges=i,this._label=new ht(0,E.NONE)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var i=this.getEdges().getEdges().iterator();i.hasNext();){var r=i.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(i){i.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(i){},t.prototype.computeMergedLocation=function(i,r){var n=E.NONE;if(n=this._label.getLocation(r),!i.isNull(r)){var o=i.getLocation(r);n!==E.BOUNDARY&&(n=o)}return n},t.prototype.setLabel=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];this._label===null?this._label=new ht(i,r):this._label.setLocation(i,r)}else return s.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var i=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof ht)for(var n=arguments[0],o=0;o<2;o++){var f=i.computeMergedLocation(n,o),u=i._label.getLocation(o);u===E.NONE&&i._label.setLocation(o,f)}},t.prototype.add=function(i){this._edges.insert(i),i.setNode(this)},t.prototype.setLabelBoundary=function(i){if(this._label===null)return null;var r=E.NONE;this._label!==null&&(r=this._label.getLocation(i));var n=null;switch(r){case E.BOUNDARY:n=E.INTERIOR;break;case E.INTERIOR:n=E.BOUNDARY;break;default:n=E.BOUNDARY;break}this._label.setLocation(i,n)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Le),ui=function(){this.nodeMap=new jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};ui.prototype.find=function(t){return this.nodeMap.get(t)},ui.prototype.addNode=function(){if(arguments[0]instanceof A){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof un){var i=arguments[0],r=this.nodeMap.get(i.getCoordinate());return r===null?(this.nodeMap.put(i.getCoordinate(),i),i):(r.mergeLabel(i),r)}},ui.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ui.prototype.iterator=function(){return this.nodeMap.values().iterator()},ui.prototype.values=function(){return this.nodeMap.values()},ui.prototype.getBoundaryNodes=function(t){for(var e=new x,i=this.iterator();i.hasNext();){var r=i.next();r.getLabel().getLocation(t)===E.BOUNDARY&&e.add(r)}return e},ui.prototype.add=function(t){var e=t.getCoordinate(),i=this.addNode(e);i.add(t)},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var ct=function(){},Ns={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct},ct.isNorthern=function(t){return t===ct.NE||t===ct.NW},ct.isOpposite=function(t,e){if(t===e)return!1;var i=(t-e+4)%4;return i===2},ct.commonHalfPlane=function(t,e){if(t===e)return t;var i=(t-e+4)%4;if(i===2)return-1;var r=t<e?t:e,n=t>e?t:e;return r===0&&n===3?3:r},ct.isInHalfPlane=function(t,e){return e===ct.SE?t===ct.SE||t===ct.SW:t===e||t===e+1},ct.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new vt("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ct.NE:ct.SE:e>=0?ct.NW:ct.SW}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new vt("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?ct.NE:ct.SE:r.y>=i.y?ct.NW:ct.SW}},Ns.NE.get=function(){return 0},Ns.NW.get=function(){return 1},Ns.SW.get=function(){return 2},Ns.SE.get=function(){return 3},Object.defineProperties(ct,Ns);var Jt=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],i=arguments[1],r=arguments[2],n=null;this._edge=e,this.init(i,r),this._label=n}else if(arguments.length===4){var o=arguments[0],f=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(f,u),this._label=l}};Jt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:k.computeOrientation(t._p0,t._p1,this._p1)},Jt.prototype.getDy=function(){return this._dy},Jt.prototype.getCoordinate=function(){return this._p0},Jt.prototype.setNode=function(t){this._node=t},Jt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),r=i.lastIndexOf("."),n=i.substring(r+1);t.print(" "+n+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Jt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Jt.prototype.getDirectedCoordinate=function(){return this._p1},Jt.prototype.getDx=function(){return this._dx},Jt.prototype.getLabel=function(){return this._label},Jt.prototype.getEdge=function(){return this._edge},Jt.prototype.getQuadrant=function(){return this._quadrant},Jt.prototype.getNode=function(){return this._node},Jt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf("."),r=e.substring(i+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Jt.prototype.computeLabel=function(t){},Jt.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ct.quadrant(this._dx,this._dy),j.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Jt.prototype.interfaces_=function(){return[De]},Jt.prototype.getClass=function(){return Jt};var Zn=function(s){function t(){var e=arguments[0],i=arguments[1];if(s.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=i,i)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(i){return this._depth[i]},t.prototype.setVisited=function(i){this._isVisited=i},t.prototype.computeDirectedLabel=function(){this._label=new ht(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(i,r){if(this._depth[i]!==-999&&this._depth[i]!==r)throw new Vi("assigned depths do not match",this.getCoordinate());this._depth[i]=r},t.prototype.isInteriorAreaEdge=function(){for(var i=this,r=!0,n=0;n<2;n++)i._label.isArea(n)&&i._label.getLocation(n,M.LEFT)===E.INTERIOR&&i._label.getLocation(n,M.RIGHT)===E.INTERIOR||(r=!1);return r},t.prototype.setNextMin=function(i){this._nextMin=i},t.prototype.print=function(i){s.prototype.print.call(this,i),i.print(" "+this._depth[M.LEFT]+"/"+this._depth[M.RIGHT]),i.print(" ("+this.getDepthDelta()+")"),this._isInResult&&i.print(" inResult")},t.prototype.setMinEdgeRing=function(i){this._minEdgeRing=i},t.prototype.isLineEdge=function(){var i=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,E.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,E.EXTERIOR);return i&&r&&n},t.prototype.setEdgeRing=function(i){this._edgeRing=i},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var i=this._edge.getDepthDelta();return this._isForward||(i=-i),i},t.prototype.setInResult=function(i){this._isInResult=i},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(i){this.print(i),i.print(" "),this._isForward?this._edge.print(i):this._edge.printReverse(i)},t.prototype.setSym=function(i){this._sym=i},t.prototype.setVisitedEdge=function(i){this.setVisited(i),this._sym.setVisited(i)},t.prototype.setEdgeDepths=function(i,r){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var o=1;i===M.LEFT&&(o=-1);var f=M.opposite(i),u=n*o,l=r+u;this.setDepth(i,r),this.setDepth(f,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(i){this._next=i},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(i,r){return i===E.EXTERIOR&&r===E.INTERIOR?1:i===E.INTERIOR&&r===E.EXTERIOR?-1:0},t}(Jt),rs=function(){};rs.prototype.createNode=function(t){return new un(t,null)},rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs};var Ct=function(){if(this._edges=new x,this._nodes=null,this._edgeEndList=new x,arguments.length===0)this._nodes=new ui(new rs);else if(arguments.length===1){var t=arguments[0];this._nodes=new ui(t)}};Ct.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var i=0;i<this._edges.size();i++){t.println("edge "+i+":");var r=e._edges.get(i);r.print(t),r.eiList.print(t)}},Ct.prototype.find=function(t){return this._nodes.find(t)},Ct.prototype.addNode=function(){if(arguments[0]instanceof un){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof A){var e=arguments[0];return this._nodes.addNode(e)}},Ct.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ct.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},Ct.prototype.debugPrintln=function(t){Xt.out.println(t)},Ct.prototype.isBoundaryNode=function(t,e){var i=this._nodes.find(e);if(i===null)return!1;var r=i.getLabel();return r!==null&&r.getLocation(t)===E.BOUNDARY},Ct.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},Ct.prototype.matchInSameDirection=function(t,e,i,r){return t.equals(i)?k.computeOrientation(t,e,r)===k.COLLINEAR&&ct.quadrant(t,e)===ct.quadrant(i,r):!1},Ct.prototype.getEdgeEnds=function(){return this._edgeEndList},Ct.prototype.debugPrint=function(t){Xt.out.print(t)},Ct.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ct.prototype.findEdgeInSameDirection=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var n=i._edges.get(r),o=n.getCoordinates();if(i.matchInSameDirection(t,e,o[0],o[1])||i.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return n}return null},Ct.prototype.insertEdge=function(t){this._edges.add(t)},Ct.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var i=e.next();if(i.getEdge()===t)return i}return null},Ct.prototype.addEdges=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();e._edges.add(r);var n=new Zn(r,!0),o=new Zn(r,!1);n.setSym(o),o.setSym(n),e.add(n),e.add(o)}},Ct.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ct.prototype.getNodes=function(){return this._nodes.values()},Ct.prototype.findEdge=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var n=i._edges.get(r),o=n.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return n}return null},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();i.getEdges().linkResultDirectedEdges()}};var ve=function(){this._geometryFactory=null,this._shellList=new x;var t=arguments[0];this._geometryFactory=t};ve.prototype.sortShellsAndHoles=function(t,e,i){for(var r=t.iterator();r.hasNext();){var n=r.next();n.isHole()?i.add(n):e.add(n)}},ve.prototype.computePolygons=function(t){for(var e=this,i=new x,r=t.iterator();r.hasNext();){var n=r.next(),o=n.toPolygon(e._geometryFactory);i.add(o)}return i},ve.prototype.placeFreeHoles=function(t,e){for(var i=this,r=e.iterator();r.hasNext();){var n=r.next();if(n.getShell()===null){var o=i.findEdgeRingContaining(n,t);if(o===null)throw new Vi("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(o)}}},ve.prototype.buildMinimalEdgeRings=function(t,e,i){for(var r=this,n=new x,o=t.iterator();o.hasNext();){var f=o.next();if(f.getMaxNodeDegree()>2){f.linkDirectedEdgesForMinimalEdgeRings();var u=f.buildMinimalRings(),l=r.findShell(u);l!==null?(r.placePolygonHoles(l,u),e.add(l)):i.addAll(u)}else n.add(f)}return n},ve.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var i=e.next();if(i.containsPoint(t))return!0}return!1},ve.prototype.buildMaximalEdgeRings=function(t){for(var e=this,i=new x,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&n.getEdgeRing()===null){var o=new Af(n,e._geometryFactory);i.add(o),o.setInResult()}}return i},ve.prototype.placePolygonHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var r=i.next();r.isHole()&&r.setShell(t)}},ve.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ve.prototype.findEdgeRingContaining=function(t,e){for(var i=t.getLinearRing(),r=i.getEnvelopeInternal(),n=i.getCoordinateN(0),o=null,f=null,u=e.iterator();u.hasNext();){var l=u.next(),a=l.getLinearRing(),c=a.getEnvelopeInternal();o!==null&&(f=o.getLinearRing().getEnvelopeInternal());var p=!1;c.contains(r)&&k.isPointInRing(n,a.getCoordinates())&&(p=!0),p&&(o===null||f.contains(c))&&(o=l)}return o},ve.prototype.findShell=function(t){for(var e=0,i=null,r=t.iterator();r.hasNext();){var n=r.next();n.isHole()||(i=n,e++)}return j.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i},ve.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],i=arguments[1];Ct.linkResultDirectedEdges(i);var r=this.buildMaximalEdgeRings(e),n=new x,o=this.buildMinimalEdgeRings(r,this._shellList,n);this.sortShellsAndHoles(o,this._shellList,n),this.placeFreeHoles(this._shellList,n)}},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve};var ss=function(){};ss.prototype.getBounds=function(){},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss};var qe=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};qe.prototype.getItem=function(){return this._item},qe.prototype.getBounds=function(){return this._bounds},qe.prototype.interfaces_=function(){return[ss,Re]},qe.prototype.getClass=function(){return qe};var Gi=function(){this._size=null,this._items=null,this._size=0,this._items=new x,this._items.add(null)};Gi.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Gi.prototype.size=function(){return this._size},Gi.prototype.reorder=function(t){for(var e=this,i=null,r=this._items.get(t);t*2<=this._size&&(i=t*2,i!==e._size&&e._items.get(i+1).compareTo(e._items.get(i))<0&&i++,e._items.get(i).compareTo(r)<0);t=i)e._items.set(t,e._items.get(i));this._items.set(t,r)},Gi.prototype.clear=function(){this._size=0,this._items.clear()},Gi.prototype.isEmpty=function(){return this._size===0},Gi.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)e._items.set(i,e._items.get(Math.trunc(i/2)));this._items.set(i,t)},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi};var ji=function(){};ji.prototype.visitItem=function(t){},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};var Dr=function(){};Dr.prototype.insert=function(t,e){},Dr.prototype.remove=function(t,e){},Dr.prototype.query=function(){},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr};var Mt=function(){if(this._childBoundables=new x,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},ko={serialVersionUID:{configurable:!0}};Mt.prototype.getLevel=function(){return this._level},Mt.prototype.size=function(){return this._childBoundables.size()},Mt.prototype.getChildBoundables=function(){return this._childBoundables},Mt.prototype.addChildBoundable=function(t){j.isTrue(this._bounds===null),this._childBoundables.add(t)},Mt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Mt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Mt.prototype.interfaces_=function(){return[ss,Re]},Mt.prototype.getClass=function(){return Mt},ko.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Mt,ko);var Ze=function(){};Ze.reverseOrder=function(){return{compare:function(e,i){return i.compareTo(e)}}},Ze.min=function(t){return Ze.sort(t),t.get(0)},Ze.sort=function(t,e){var i=t.toArray();e?hr.sort(i,e):hr.sort(i);for(var r=t.iterator(),n=0,o=i.length;n<o;n++)r.next(),r.set(i[n])},Ze.singletonList=function(t){var e=new x;return e.add(t),e};var bt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()};bt.prototype.expandToQueue=function(t,e){var i=bt.isComposite(this._boundable1),r=bt.isComposite(this._boundable2);if(i&&r)return bt.area(this._boundable1)>bt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new vt("neither boundable is composite")},bt.prototype.isLeaves=function(){return!(bt.isComposite(this._boundable1)||bt.isComposite(this._boundable2))},bt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},bt.prototype.expand=function(t,e,i,r){for(var n=this,o=t.getChildBoundables(),f=o.iterator();f.hasNext();){var u=f.next(),l=new bt(u,e,n._itemDistance);l.getDistance()<r&&i.add(l)}},bt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},bt.prototype.getDistance=function(){return this._distance},bt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},bt.prototype.interfaces_=function(){return[De]},bt.prototype.getClass=function(){return bt},bt.area=function(t){return t.getBounds().getArea()},bt.isComposite=function(t){return t instanceof Mt};var kt=function s(){if(this._root=null,this._built=!1,this._itemBoundables=new x,this._nodeCapacity=null,arguments.length===0){var t=s.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];j.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},hn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};kt.prototype.getNodeCapacity=function(){return this._nodeCapacity},kt.prototype.lastNode=function(t){return t.get(t.size()-1)},kt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var n=r.next();n instanceof Mt?i+=t.size(n):n instanceof qe&&(i+=1)}return i}},kt.prototype.removeItem=function(t,e){for(var i=null,r=t.getChildBoundables().iterator();r.hasNext();){var n=r.next();n instanceof qe&&n.getItem()===e&&(i=n)}return i!==null?(t.getChildBoundables().remove(i),!0):!1},kt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new x:e}else if(arguments.length===1){for(var i=arguments[0],r=new x,n=i.getChildBoundables().iterator();n.hasNext();){var o=n.next();if(o instanceof Mt){var f=t.itemsTree(o);f!==null&&r.add(f)}else o instanceof qe?r.add(o.getItem()):j.shouldNeverReachHere()}return r.size()<=0?null:r}},kt.prototype.insert=function(t,e){j.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new qe(t,e))},kt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],i=new x;return this.boundablesAtLevel(e,this._root,i),i}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2];if(j.isTrue(r>-2),n.getLevel()===r)return o.add(n),null;for(var f=n.getChildBoundables().iterator();f.hasNext();){var u=f.next();u instanceof Mt?t.boundablesAtLevel(r,u,o):(j.isTrue(u instanceof qe),r===-1&&o.add(u))}return null}},kt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var i=new x;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,i),i}else if(arguments.length===2){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(arguments.length===3){if(U(arguments[2],ji)&&arguments[0]instanceof Object&&arguments[1]instanceof Mt)for(var o=arguments[0],f=arguments[1],u=arguments[2],l=f.getChildBoundables(),a=0;a<l.size();a++){var c=l.get(a);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Mt?t.query(o,c,u):c instanceof qe?u.visitItem(c.getItem()):j.shouldNeverReachHere())}else if(U(arguments[2],Ye)&&arguments[0]instanceof Object&&arguments[1]instanceof Mt)for(var p=arguments[0],d=arguments[1],h=arguments[2],v=d.getChildBoundables(),C=0;C<v.size();C++){var W=v.get(C);t.getIntersectsOp().intersects(W.getBounds(),p)&&(W instanceof Mt?t.query(p,W,h):W instanceof qe?h.add(W.getItem()):j.shouldNeverReachHere())}}},kt.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},kt.prototype.getRoot=function(){return this.build(),this._root},kt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,i):!1}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2],f=this.removeItem(n,o);if(f)return!0;for(var u=null,l=n.getChildBoundables().iterator();l.hasNext();){var a=l.next();if(t.getIntersectsOp().intersects(a.getBounds(),r)&&a instanceof Mt&&(f=t.remove(r,a,o),f)){u=a;break}}return u!==null&&u.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(u),f}},kt.prototype.createHigherLevels=function(t,e){j.isTrue(!t.isEmpty());var i=this.createParentBoundables(t,e+1);return i.size()===1?i.get(0):this.createHigherLevels(i,e+1)},kt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var n=r.next();if(n instanceof Mt){var o=t.depth(n);o>i&&(i=o)}}return i+1}},kt.prototype.createParentBoundables=function(t,e){var i=this;j.isTrue(!t.isEmpty());var r=new x;r.add(this.createNode(e));var n=new x(t);Ze.sort(n,this.getComparator());for(var o=n.iterator();o.hasNext();){var f=o.next();i.lastNode(r).getChildBoundables().size()===i.getNodeCapacity()&&r.add(i.createNode(e)),i.lastNode(r).addChildBoundable(f)}return r},kt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},kt.prototype.interfaces_=function(){return[Re]},kt.prototype.getClass=function(){return kt},kt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},hn.IntersectsOp.get=function(){return wf},hn.serialVersionUID.get=function(){return-3886435814360241e3},hn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(kt,hn);var wf=function(){},ns=function(){};ns.prototype.distance=function(t,e){},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns};var Vo=function(s){function t(i){i=i||t.DEFAULT_NODE_CAPACITY,s.call(this,i)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(r,n){var o=this;j.isTrue(r.length>0);for(var f=new x,u=0;u<r.length;u++)f.addAll(o.createParentBoundablesFromVerticalSlice(r[u],n));return f},t.prototype.createNode=function(r){return new Go(r)},t.prototype.size=function(){return arguments.length===0?s.prototype.size.call(this):s.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];if(r.isNull())return null;s.prototype.insert.call(this,r,n)}else return s.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(r,n){for(var o=Math.trunc(Math.ceil(r.size()/n)),f=new Array(n).fill(null),u=r.iterator(),l=0;l<n;l++){f[l]=new x;for(var a=0;u.hasNext()&&a<o;){var c=u.next();f[l].add(c),a++}}return f},t.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return s.prototype.query.call(this,r)}else if(arguments.length===2){var n=arguments[0],o=arguments[1];s.prototype.query.call(this,n,o)}else if(arguments.length===3){if(U(arguments[2],ji)&&arguments[0]instanceof Object&&arguments[1]instanceof Mt){var f=arguments[0],u=arguments[1],l=arguments[2];s.prototype.query.call(this,f,u,l)}else if(U(arguments[2],Ye)&&arguments[0]instanceof Object&&arguments[1]instanceof Mt){var a=arguments[0],c=arguments[1],p=arguments[2];s.prototype.query.call(this,a,c,p)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(r,n){return s.prototype.createParentBoundables.call(this,r,n)},t.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],n=arguments[1];return s.prototype.remove.call(this,r,n)}else return s.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?s.prototype.depth.call(this):s.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(r,n){j.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),f=new x(r);Ze.sort(f,t.xComparator);var u=this.verticalSlices(f,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,n)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(U(arguments[0],ns)){var r=arguments[0],n=new bt(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(n)}else if(arguments[0]instanceof bt){var o=arguments[0];return this.nearestNeighbour(o,Z.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&U(arguments[1],ns)){var f=arguments[0],u=arguments[1],l=new bt(this.getRoot(),f.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof bt&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=c,d=null,h=new Gi;for(h.add(a);!h.isEmpty()&&p>0;){var v=h.poll(),C=v.getDistance();if(C>=p)break;v.isLeaves()?(p=C,d=v):v.expandToQueue(h,p)}return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]}}else if(arguments.length===3){var W=arguments[0],_=arguments[1],T=arguments[2],L=new qe(W,_),P=new bt(this.getRoot(),L,T);return this.nearestNeighbour(P)[0]}},t.prototype.interfaces_=function(){return[Dr,Re]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,n){return(r+n)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},e.STRtreeNode.get=function(){return Go},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Ur]},compare:function(i,r){return s.compareDoubles(t.centreX(i.getBounds()),t.centreX(r.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Ur]},compare:function(i,r){return s.compareDoubles(t.centreY(i.getBounds()),t.centreY(r.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[s.IntersectsOp]},intersects:function(i,r){return i.intersects(r)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(kt),Go=function(s){function t(){var e=arguments[0];s.call(this,e)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var i=null,r=this.getChildBoundables().iterator();r.hasNext();){var n=r.next();i===null?i=new V(n.getBounds()):i.expandToInclude(n.getBounds())}return i},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mt),le=function(){};le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.relativeSign=function(t,e){return t<e?-1:t>e?1:0},le.compare=function(t,e,i){if(e.equals2D(i))return 0;var r=le.relativeSign(e.x,i.x),n=le.relativeSign(e.y,i.y);switch(t){case 0:return le.compareValue(r,n);case 1:return le.compareValue(n,r);case 2:return le.compareValue(n,-r);case 3:return le.compareValue(-r,n);case 4:return le.compareValue(-r,-n);case 5:return le.compareValue(-n,-r);case 6:return le.compareValue(-n,r);case 7:return le.compareValue(r,-n)}return j.shouldNeverReachHere("invalid octant value"),0},le.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Ji=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._segString=t,this.coord=new A(e),this.segmentIndex=i,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(i))};Ji.prototype.getCoordinate=function(){return this.coord},Ji.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Ji.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:le.compare(this._segmentOctant,this.coord,e.coord)},Ji.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},Ji.prototype.isInterior=function(){return this._isInterior},Ji.prototype.interfaces_=function(){return[De]},Ji.prototype.getClass=function(){return Ji};var ie=function(){this._nodeMap=new jt,this._edge=null;var t=arguments[0];this._edge=t};ie.prototype.getSplitCoordinates=function(){var t=this,e=new Ts;this.addEndpoints();for(var i=this.iterator(),r=i.next();i.hasNext();){var n=i.next();t.addEdgeCoordinates(r,n,e),r=n}return e.toCoordinateArray()},ie.prototype.addCollapsedNodes=function(){var t=this,e=new x;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var i=e.iterator();i.hasNext();){var r=i.next().intValue();t.add(t._edge.getCoordinate(r),r)}},ie.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ie.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,i=0;i<this._edge.size()-2;i++){var r=e._edge.getCoordinate(i),n=e._edge.getCoordinate(i+2);r.equals2D(n)&&t.add(new ti(i+1))}},ie.prototype.addEdgeCoordinates=function(t,e,i){var r=this,n=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(n);i.add(new A(t.coord),!1);for(var f=t.segmentIndex+1;f<=e.segmentIndex;f++)i.add(r._edge.getCoordinate(f));o&&i.add(new A(e.coord))},ie.prototype.iterator=function(){return this._nodeMap.values().iterator()},ie.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),r=i.next();i.hasNext();){var n=i.next(),o=e.createSplitEdge(r,n);t.add(o),r=n}},ie.prototype.findCollapseIndex=function(t,e,i){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(i[0]=t.segmentIndex+1,!0):!1},ie.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,i=new Array(1).fill(null),r=this.iterator(),n=r.next();r.hasNext();){var o=r.next(),f=e.findCollapseIndex(n,o,i);f&&t.add(new ti(i[0])),n=o}},ie.prototype.getEdge=function(){return this._edge},ie.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ie.prototype.createSplitEdge=function(t,e){var i=this,r=e.segmentIndex-t.segmentIndex+2,n=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(n);o||r--;var f=new Array(r).fill(null),u=0;f[u++]=new A(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)f[u++]=i._edge.getCoordinate(l);return o&&(f[u]=new A(e.coord)),new wt(f,this._edge.getData())},ie.prototype.add=function(t,e){var i=new Ji(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(i);return r!==null?(j.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(i,i),i)},ie.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),i=t.get(0),r=i.getCoordinate(0);if(!r.equals2D(e[0]))throw new Bi("bad split edge start point at "+r);var n=t.get(t.size()-1),o=n.getCoordinates(),f=o[o.length-1];if(!f.equals2D(e[e.length-1]))throw new Bi("bad split edge end point at "+f)},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var Rr=function(){};Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new vt("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?i>=r?0:1:i>=r?7:6:e>=0?i>=r?3:2:i>=r?4:5}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var n=arguments[0],o=arguments[1],f=o.x-n.x,u=o.y-n.y;if(f===0&&u===0)throw new vt("Cannot compute the octant for two identical points "+n);return Rr.octant(f,u)}};var Li=function(){};Li.prototype.getCoordinates=function(){},Li.prototype.size=function(){},Li.prototype.getCoordinate=function(t){},Li.prototype.isClosed=function(){},Li.prototype.setData=function(t){},Li.prototype.getData=function(){},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var bs=function(){};bs.prototype.addIntersection=function(t,e){},bs.prototype.interfaces_=function(){return[Li]},bs.prototype.getClass=function(){return bs};var wt=function(){this._nodeList=new ie(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};wt.prototype.getCoordinates=function(){return this._pts},wt.prototype.size=function(){return this._pts.length},wt.prototype.getCoordinate=function(t){return this._pts[t]},wt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},wt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},wt.prototype.setData=function(t){this._data=t},wt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Rr.octant(t,e)},wt.prototype.getData=function(){return this._data},wt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var i=arguments[0],r=arguments[1],n=arguments[3],o=new A(i.getIntersection(n));this.addIntersection(o,r)}},wt.prototype.toString=function(){return Xe.toLineString(new At(this._pts))},wt.prototype.getNodeList=function(){return this._nodeList},wt.prototype.addIntersectionNode=function(t,e){var i=e,r=i+1;if(r<this._pts.length){var n=this._pts[r];t.equals2D(n)&&(i=r)}var o=this._nodeList.add(t,i);return o},wt.prototype.addIntersections=function(t,e,i){for(var r=this,n=0;n<t.getIntersectionNum();n++)r.addIntersection(t,e,i,n)},wt.prototype.interfaces_=function(){return[bs]},wt.prototype.getClass=function(){return wt},wt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new x;return wt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var i=arguments[0],r=arguments[1],n=i.iterator();n.hasNext();){var o=n.next();o.getNodeList().addSplitEdges(r)}};var G=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new A,this.p1=new A;else if(arguments.length===1){var t=arguments[0];this.p0=new A(t.p0),this.p1=new A(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3];this.p0=new A(e,i),this.p1=new A(r,n)}},Xo={serialVersionUID:{configurable:!0}};G.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},G.prototype.orientationIndex=function(){if(arguments[0]instanceof G){var t=arguments[0],e=k.orientationIndex(this.p0,this.p1,t.p0),i=k.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}else if(arguments[0]instanceof A){var r=arguments[0];return k.orientationIndex(this.p0,this.p1,r)}},G.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},G.prototype.isVertical=function(){return this.p0.x===this.p1.x},G.prototype.equals=function(t){if(!(t instanceof G))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},G.prototype.intersection=function(t){var e=new fr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},G.prototype.project=function(){if(arguments[0]instanceof A){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new A(t);var e=this.projectionFactor(t),i=new A;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}else if(arguments[0]instanceof G){var r=arguments[0],n=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(n>=1&&o>=1||n<=0&&o<=0)return null;var f=this.project(r.p0);n<0&&(f=this.p0),n>1&&(f=this.p1);var u=this.project(r.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new G(f,u)}},G.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},G.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},G.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},G.prototype.distancePerpendicular=function(t){return k.distancePointLinePerpendicular(t,this.p0,this.p1)},G.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},G.prototype.midPoint=function(){return G.midPoint(this.p0,this.p1)},G.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=e*e+i*i;if(r<=0)return Z.NaN;var n=((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/r;return n},G.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var i=new Array(2).fill(null),r=Z.MAX_VALUE,n=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),i[0]=o,i[1]=t.p0;var f=this.closestPoint(t.p1);n=f.distance(t.p1),n<r&&(r=n,i[0]=f,i[1]=t.p1);var u=t.closestPoint(this.p0);n=u.distance(this.p0),n<r&&(r=n,i[0]=this.p0,i[1]=u);var l=t.closestPoint(this.p1);return n=l.distance(this.p1),n<r&&(r=n,i[0]=this.p1,i[1]=l),i},G.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var i=this.p0.distance(t),r=this.p1.distance(t);return i<r?this.p0:this.p1},G.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},G.prototype.getLength=function(){return this.p0.distance(this.p1)},G.prototype.compareTo=function(t){var e=t,i=this.p0.compareTo(e.p0);return i!==0?i:this.p1.compareTo(e.p1)},G.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},G.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},G.prototype.lineIntersection=function(t){try{var e=Ge.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(i){if(!(i instanceof Zr))throw i}finally{}return null},G.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},G.prototype.pointAlongOffset=function(t,e){var i=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),n=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,f=Math.sqrt(n*n+o*o),u=0,l=0;if(e!==0){if(f<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*n/f,l=e*o/f}var a=i-l,c=r+u,p=new A(a,c);return p},G.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=i.x,this.p1.y=i.y}},G.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Z.isNaN(e))&&(e=1),e},G.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},G.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},G.prototype.distance=function(){if(arguments[0]instanceof G){var t=arguments[0];return k.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof A){var e=arguments[0];return k.distancePointLine(e,this.p0,this.p1)}},G.prototype.pointAlong=function(t){var e=new A;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},G.prototype.hashCode=function(){var t=Z.doubleToLongBits(this.p0.x);t^=Z.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),i=Z.doubleToLongBits(this.p1.x);i^=Z.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(i)^Math.trunc(i>>32);return e^r},G.prototype.interfaces_=function(){return[De,Re]},G.prototype.getClass=function(){return G},G.midPoint=function(t,e){return new A((t.x+e.x)/2,(t.y+e.y)/2)},Xo.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(G,Xo);var Ds=function(){this.tempEnv1=new V,this.tempEnv2=new V,this._overlapSeg1=new G,this._overlapSeg2=new G};Ds.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),i.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds};var _e=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=r};_e.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_e.prototype.computeSelect=function(t,e,i,r){var n=this._pts[e],o=this._pts[i];if(r.tempEnv1.init(n,o),i-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var f=Math.trunc((e+i)/2);e<f&&this.computeSelect(t,e,f,r),f<i&&this.computeSelect(t,f,i,r)},_e.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),i=0,r=this._start;r<=this._end;r++)e[i++]=t._pts[r];return e},_e.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_e.prototype.setId=function(t){this._id=t},_e.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_e.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new V(t,e)}return this._env},_e.prototype.getEndIndex=function(){return this._end},_e.prototype.getStartIndex=function(){return this._start},_e.prototype.getContext=function(){return this._context},_e.prototype.getId=function(){return this._id},_e.prototype.computeOverlapsInternal=function(t,e,i,r,n,o){var f=this._pts[t],u=this._pts[e],l=i._pts[r],a=i._pts[n];if(e-t===1&&n-r===1)return o.overlap(this,t,i,r),null;if(o.tempEnv1.init(f,u),o.tempEnv2.init(l,a),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),p=Math.trunc((r+n)/2);t<c&&(r<p&&this.computeOverlapsInternal(t,c,i,r,p,o),p<n&&this.computeOverlapsInternal(t,c,i,p,n,o)),c<e&&(r<p&&this.computeOverlapsInternal(c,e,i,r,p,o),p<n&&this.computeOverlapsInternal(c,e,i,p,n,o))},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e};var hi=function(){};hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},hi.getChainStartIndices=function(t){var e=0,i=new x;i.add(new ti(e));do{var r=hi.findChainEnd(t,e);i.add(new ti(r)),e=r}while(e<t.length-1);var n=hi.toIntArray(i);return n},hi.findChainEnd=function(t,e){for(var i=e;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;for(var r=ct.quadrant(t[i],t[i+1]),n=e+1;n<t.length;){if(!t[n-1].equals2D(t[n])){var o=ct.quadrant(t[n-1],t[n]);if(o!==r)break}n++}return n-1},hi.getChains=function(){if(arguments.length===1){var t=arguments[0];return hi.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],i=arguments[1],r=new x,n=hi.getChainStartIndices(e),o=0;o<n.length-1;o++){var f=new _e(e,n[o],n[o+1],i);r.add(f)}return r}},hi.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var cr=function(){};cr.prototype.computeNodes=function(t){},cr.prototype.getNodedSubstrings=function(){},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var Rs=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Rs.prototype.setSegmentIntersector=function(t){this._segInt=t},Rs.prototype.interfaces_=function(){return[cr]},Rs.prototype.getClass=function(){return Rs};var Hn=function(s){function t(i){i?s.call(this,i):s.call(this),this._monoChains=new x,this._index=new Vo,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return wt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(r){for(var n=this,o=hi.getChains(r.getCoordinates(),r),f=o.iterator();f.hasNext();){var u=f.next();u.setId(n._idCounter++),n._index.insert(u.getEnvelope(),u),n._monoChains.add(u)}},t.prototype.computeNodes=function(r){var n=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)n.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var r=this,n=new Yo(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var f=o.next(),u=r._index.query(f.getEnvelope()),l=u.iterator();l.hasNext();){var a=l.next();if(a.getId()>f.getId()&&(f.computeOverlaps(a,n),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Yo},Object.defineProperties(t,e),t}(Rs),Yo=function(s){function t(){s.call(this),this._si=null;var e=arguments[0];this._si=e}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var i=arguments[0],r=arguments[1],n=arguments[2],o=arguments[3],f=i.getContext(),u=n.getContext();this._si.processIntersections(f,r,u,o)}else return s.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ds),at=function s(){if(this._quadrantSegments=s.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=s.CAP_ROUND,this._joinStyle=s.JOIN_ROUND,this._mitreLimit=s.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=s.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(i)}else if(arguments.length===4){var r=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(n),this.setJoinStyle(o),this.setMitreLimit(f)}}},Xi={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};at.prototype.getEndCapStyle=function(){return this._endCapStyle},at.prototype.isSingleSided=function(){return this._isSingleSided},at.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=at.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=at.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==at.JOIN_ROUND&&(this._quadrantSegments=at.DEFAULT_QUADRANT_SEGMENTS)},at.prototype.getJoinStyle=function(){return this._joinStyle},at.prototype.setJoinStyle=function(t){this._joinStyle=t},at.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},at.prototype.getSimplifyFactor=function(){return this._simplifyFactor},at.prototype.getQuadrantSegments=function(){return this._quadrantSegments},at.prototype.setEndCapStyle=function(t){this._endCapStyle=t},at.prototype.getMitreLimit=function(){return this._mitreLimit},at.prototype.setMitreLimit=function(t){this._mitreLimit=t},at.prototype.setSingleSided=function(t){this._isSingleSided=t},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Xi.CAP_ROUND.get=function(){return 1},Xi.CAP_FLAT.get=function(){return 2},Xi.CAP_SQUARE.get=function(){return 3},Xi.JOIN_ROUND.get=function(){return 1},Xi.JOIN_MITRE.get=function(){return 2},Xi.JOIN_BEVEL.get=function(){return 3},Xi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Xi.DEFAULT_MITRE_LIMIT.get=function(){return 5},Xi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(at,Xi);var Tt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=k.COUNTERCLOCKWISE,this._inputLine=t||null},Bs={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Tt.prototype.isDeletable=function(t,e,i,r){var n=this._inputLine[t],o=this._inputLine[e],f=this._inputLine[i];return!this.isConcave(n,o,f)||!this.isShallow(n,o,f,r)?!1:this.isShallowSampled(n,o,t,i,r)},Tt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,i=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(i),n=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,i,r,t._distanceTol)&&(t._isDeleted[i]=Tt.DELETE,o=!0,n=!0),o?e=r:e=i,i=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(i)}return n},Tt.prototype.isShallowConcavity=function(t,e,i,r){var n=k.computeOrientation(t,e,i),o=n===this._angleOrientation;if(!o)return!1;var f=k.distancePointLine(e,t,i);return f<r},Tt.prototype.isShallowSampled=function(t,e,i,r,n){var o=this,f=Math.trunc((r-i)/Tt.NUM_PTS_TO_CHECK);f<=0&&(f=1);for(var u=i;u<r;u+=f)if(!o.isShallow(t,e,o._inputLine[u],n))return!1;return!0},Tt.prototype.isConcave=function(t,e,i){var r=k.computeOrientation(t,e,i),n=r===this._angleOrientation;return n},Tt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=k.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=e.deleteShallowConcavities();while(i);return this.collapseLine()},Tt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Tt.DELETE;)e++;return e},Tt.prototype.isShallow=function(t,e,i,r){var n=k.distancePointLine(e,t,i);return n<r},Tt.prototype.collapseLine=function(){for(var t=this,e=new Ts,i=0;i<this._inputLine.length;i++)t._isDeleted[i]!==Tt.DELETE&&e.add(t._inputLine[i]);return e.toCoordinateArray()},Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.simplify=function(t,e){var i=new Tt(t);return i.simplify(e)},Bs.INIT.get=function(){return 0},Bs.DELETE.get=function(){return 1},Bs.KEEP.get=function(){return 1},Bs.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Tt,Bs);var Ae=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new x},zo={COORDINATE_ARRAY_TYPE:{configurable:!0}};Ae.prototype.getCoordinates=function(){var t=this._ptList.toArray(Ae.COORDINATE_ARRAY_TYPE);return t},Ae.prototype.setPrecisionModel=function(t){this._precisionModel=t},Ae.prototype.addPt=function(t){var e=new A(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Ae.prototype.revere=function(){},Ae.prototype.addPts=function(t,e){var i=this;if(e)for(var r=0;r<t.length;r++)i.addPt(t[r]);else for(var n=t.length-1;n>=0;n--)i.addPt(t[n])},Ae.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),i=t.distance(e);return i<this._minimimVertexDistance},Ae.prototype.toString=function(){var t=new tt,e=t.createLineString(this.getCoordinates());return e.toString()},Ae.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new A(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Ae.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},zo.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Ae,zo);var et=function(){},Br={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.toDegrees=function(t){return t*180/Math.PI},et.normalize=function(t){for(;t>Math.PI;)t-=et.PI_TIMES_2;for(;t<=-Math.PI;)t+=et.PI_TIMES_2;return t},et.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=i.x-e.x,n=i.y-e.y;return Math.atan2(n,r)}},et.isAcute=function(t,e,i){var r=t.x-e.x,n=t.y-e.y,o=i.x-e.x,f=i.y-e.y,u=r*o+n*f;return u>0},et.isObtuse=function(t,e,i){var r=t.x-e.x,n=t.y-e.y,o=i.x-e.x,f=i.y-e.y,u=r*o+n*f;return u<0},et.interiorAngle=function(t,e,i){var r=et.angle(e,t),n=et.angle(e,i);return Math.abs(n-r)},et.normalizePositive=function(t){if(t<0){for(;t<0;)t+=et.PI_TIMES_2;t>=et.PI_TIMES_2&&(t=0)}else{for(;t>=et.PI_TIMES_2;)t-=et.PI_TIMES_2;t<0&&(t=0)}return t},et.angleBetween=function(t,e,i){var r=et.angle(e,t),n=et.angle(e,i);return et.diff(r,n)},et.diff=function(t,e){var i=null;return t<e?i=e-t:i=t-e,i>Math.PI&&(i=2*Math.PI-i),i},et.toRadians=function(t){return t*Math.PI/180},et.getTurn=function(t,e){var i=Math.sin(e-t);return i>0?et.COUNTERCLOCKWISE:i<0?et.CLOCKWISE:et.NONE},et.angleBetweenOriented=function(t,e,i){var r=et.angle(e,t),n=et.angle(e,i),o=n-r;return o<=-Math.PI?o+et.PI_TIMES_2:o>Math.PI?o-et.PI_TIMES_2:o},Br.PI_TIMES_2.get=function(){return 2*Math.PI},Br.PI_OVER_2.get=function(){return Math.PI/2},Br.PI_OVER_4.get=function(){return Math.PI/4},Br.COUNTERCLOCKWISE.get=function(){return k.COUNTERCLOCKWISE},Br.CLOCKWISE.get=function(){return k.CLOCKWISE},Br.NONE.get=function(){return k.COLLINEAR},Object.defineProperties(et,Br);var mt=function s(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new G,this._seg1=new G,this._offset0=new G,this._offset1=new G,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new fr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===at.JOIN_ROUND&&(this._closingSegLengthFactor=s.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Ms={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};mt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=k.computeOrientation(this._s0,this._s1,this._s2),r=i===k.CLOCKWISE&&this._side===M.LEFT||i===k.COUNTERCLOCKWISE&&this._side===M.RIGHT;i===0?this.addCollinear(e):r?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)},mt.prototype.addLineEndCap=function(t,e){var i=new G(t,e),r=new G;this.computeOffsetSegment(i,M.LEFT,this._distance,r);var n=new G;this.computeOffsetSegment(i,M.RIGHT,this._distance,n);var o=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,o);switch(this._bufParams.getEndCapStyle()){case at.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,k.CLOCKWISE,this._distance),this._segList.addPt(n.p1);break;case at.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(n.p1);break;case at.CAP_SQUARE:var l=new A;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var a=new A(r.p1.x+l.x,r.p1.y+l.y),c=new A(n.p1.x+l.x,n.p1.y+l.y);this._segList.addPt(a),this._segList.addPt(c);break}},mt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},mt.prototype.addMitreJoin=function(t,e,i,r){var n=!0,o=null;try{o=Ge.intersection(e.p0,e.p1,i.p0,i.p1);var f=r<=0?1:o.distance(t)/Math.abs(r);f>this._bufParams.getMitreLimit()&&(n=!1)}catch(u){if(u instanceof Zr)o=new A(0,0),n=!1;else throw u}finally{}n?this._segList.addPt(o):this.addLimitedMitreJoin(e,i,r,this._bufParams.getMitreLimit())},mt.prototype.addFilletCorner=function(t,e,i,r,n){var o=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,o),l=i.x-t.x,a=i.y-t.y,c=Math.atan2(a,l);r===k.CLOCKWISE?u<=c&&(u+=2*Math.PI):u>=c&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,c,r,n),this._segList.addPt(i)},mt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*mt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===at.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===at.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},mt.prototype.createSquare=function(t){this._segList.addPt(new A(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new A(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new A(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new A(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},mt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},mt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},mt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},mt.prototype.initSideSegments=function(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},mt.prototype.addLimitedMitreJoin=function(t,e,i,r){var n=this._seg0.p1,o=et.angle(n,this._seg0.p0),f=et.angleBetweenOriented(this._seg0.p0,n,this._seg1.p1),u=f/2,l=et.normalize(o+u),a=et.normalize(l+Math.PI),c=r*i,p=c*Math.abs(Math.sin(u)),d=i-p,h=n.x+c*Math.cos(a),v=n.y+c*Math.sin(a),C=new A(h,v),W=new G(n,C),_=W.pointAlongOffset(1,d),T=W.pointAlongOffset(1,-d);this._side===M.LEFT?(this._segList.addPt(_),this._segList.addPt(T)):(this._segList.addPt(T),this._segList.addPt(_))},mt.prototype.computeOffsetSegment=function(t,e,i,r){var n=e===M.LEFT?1:-1,o=t.p1.x-t.p0.x,f=t.p1.y-t.p0.y,u=Math.sqrt(o*o+f*f),l=n*i*o/u,a=n*i*f/u;r.p0.x=t.p0.x-a,r.p0.y=t.p0.y+l,r.p1.x=t.p1.x-a,r.p1.y=t.p1.y+l},mt.prototype.addFilletArc=function(t,e,i,r,n){var o=this,f=r===k.CLOCKWISE?-1:1,u=Math.abs(e-i),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var a=0,c=u/l,p=a,d=new A;p<u;){var h=e+f*p;d.x=t.x+n*Math.cos(h),d.y=t.y+n*Math.sin(h),o._segList.addPt(d),p+=c}},mt.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*mt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new A((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var r=new A((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},mt.prototype.createCircle=function(t){var e=new A(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},mt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},mt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ae,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*mt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},mt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===at.JOIN_BEVEL||this._bufParams.getJoinStyle()===at.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,k.CLOCKWISE,this._distance))},mt.prototype.closeRing=function(){this._segList.closeRing()},mt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},Ms.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Ms.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Ms.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Ms.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(mt,Ms);var ce=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ce.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var i=e<0,r=Math.abs(e),n=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],n):this.computeOffsetCurve(t,i,n);var o=n.getCoordinates();return i&&$.reverse(o),o},ce.prototype.computeSingleSidedBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);var n=Tt.simplify(t,-r),o=n.length-1;i.initSideSegments(n[o],n[o-1],M.LEFT),i.addFirstSegment();for(var f=o-2;f>=0;f--)i.addNextSegment(n[f],!0)}else{i.addSegments(t,!1);var u=Tt.simplify(t,r),l=u.length-1;i.initSideSegments(u[0],u[1],M.LEFT),i.addFirstSegment();for(var a=2;a<=l;a++)i.addNextSegment(u[a],!0)}i.addLastSegment(),i.closeRing()},ce.prototype.computeRingBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);e===M.RIGHT&&(r=-r);var n=Tt.simplify(t,r),o=n.length-1;i.initSideSegments(n[o-1],n[0],e);for(var f=1;f<=o;f++){var u=f!==1;i.addNextSegment(n[f],u)}i.closeRing()},ce.prototype.computeLineBufferCurve=function(t,e){var i=this.simplifyTolerance(this._distance),r=Tt.simplify(t,i),n=r.length-1;e.initSideSegments(r[0],r[1],M.LEFT);for(var o=2;o<=n;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[n-1],r[n]);var f=Tt.simplify(t,-i),u=f.length-1;e.initSideSegments(f[u],f[u-1],M.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(f[l],!0);e.addLastSegment(),e.addLineEndCap(f[1],f[0]),e.closeRing()},ce.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case at.CAP_ROUND:e.createCircle(t);break;case at.CAP_SQUARE:e.createSquare(t);break}},ce.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var i=Math.abs(e),r=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var n=e<0;this.computeSingleSidedBufferCurve(t,n,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o},ce.prototype.getBufferParameters=function(){return this._bufParams},ce.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ce.prototype.getRingCurve=function(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(i===0)return ce.copyCoordinates(t);var r=this.getSegGen(i);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},ce.prototype.computeOffsetCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){var n=Tt.simplify(t,-r),o=n.length-1;i.initSideSegments(n[o],n[o-1],M.LEFT),i.addFirstSegment();for(var f=o-2;f>=0;f--)i.addNextSegment(n[f],!0)}else{var u=Tt.simplify(t,r),l=u.length-1;i.initSideSegments(u[0],u[1],M.LEFT),i.addFirstSegment();for(var a=2;a<=l;a++)i.addNextSegment(u[a],!0)}i.addLastSegment()},ce.prototype.getSegGen=function(t){return new mt(this._precisionModel,this._bufParams,t)},ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ce.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),i=0;i<e.length;i++)e[i]=new A(t[i]);return e};var Mr=function(){this._subgraphs=null,this._seg=new G,this._cga=new k;var t=arguments[0];this._subgraphs=t},Uo={DepthSegment:{configurable:!0}};Mr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=new x,r=this._subgraphs.iterator();r.hasNext();){var n=r.next(),o=n.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,n.getDirectedEdges(),i)}return i}else if(arguments.length===3){if(U(arguments[2],Ye)&&arguments[0]instanceof A&&arguments[1]instanceof Zn)for(var f=arguments[0],u=arguments[1],l=arguments[2],a=u.getEdge().getCoordinates(),c=0;c<a.length-1;c++){t._seg.p0=a[c],t._seg.p1=a[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var p=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(p<f.x)&&!t._seg.isHorizontal()&&!(f.y<t._seg.p0.y||f.y>t._seg.p1.y)&&k.computeOrientation(t._seg.p0,t._seg.p1,f)!==k.RIGHT){var d=u.getDepth(M.LEFT);t._seg.p0.equals(a[c])||(d=u.getDepth(M.RIGHT));var h=new pr(t._seg,d);l.add(h)}}else if(U(arguments[2],Ye)&&arguments[0]instanceof A&&U(arguments[1],Ye))for(var v=arguments[0],C=arguments[1],W=arguments[2],_=C.iterator();_.hasNext();){var T=_.next();T.isForward()&&t.findStabbedSegments(v,T,W)}}},Mr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var i=Ze.min(e);return i._leftDepth},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Uo.DepthSegment.get=function(){return pr},Object.defineProperties(Mr,Uo);var pr=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new G(t),this._leftDepth=e};pr.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var i=this._upwardSeg.orientationIndex(e._upwardSeg);return i!==0||(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg),i!==0)?i:this._upwardSeg.compareTo(e._upwardSeg)},pr.prototype.compareX=function(t,e){var i=t.p0.compareTo(e.p0);return i!==0?i:t.p1.compareTo(e.p1)},pr.prototype.toString=function(){return this._upwardSeg.toString()},pr.prototype.interfaces_=function(){return[De]},pr.prototype.getClass=function(){return pr};var ft=function(t,e,i){this.p0=t||null,this.p1=e||null,this.p2=i||null};ft.prototype.area=function(){return ft.area(this.p0,this.p1,this.p2)},ft.prototype.signedArea=function(){return ft.signedArea(this.p0,this.p1,this.p2)},ft.prototype.interpolateZ=function(t){if(t===null)throw new vt("Supplied point is null.");return ft.interpolateZ(t,this.p0,this.p1,this.p2)},ft.prototype.longestSideLength=function(){return ft.longestSideLength(this.p0,this.p1,this.p2)},ft.prototype.isAcute=function(){return ft.isAcute(this.p0,this.p1,this.p2)},ft.prototype.circumcentre=function(){return ft.circumcentre(this.p0,this.p1,this.p2)},ft.prototype.area3D=function(){return ft.area3D(this.p0,this.p1,this.p2)},ft.prototype.centroid=function(){return ft.centroid(this.p0,this.p1,this.p2)},ft.prototype.inCentre=function(){return ft.inCentre(this.p0,this.p1,this.p2)},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.area=function(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)},ft.signedArea=function(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2},ft.det=function(t,e,i,r){return t*r-e*i},ft.interpolateZ=function(t,e,i,r){var n=e.x,o=e.y,f=i.x-n,u=r.x-n,l=i.y-o,a=r.y-o,c=f*a-u*l,p=t.x-n,d=t.y-o,h=(a*p-u*d)/c,v=(-l*p+f*d)/c,C=e.z+h*(i.z-e.z)+v*(r.z-e.z);return C},ft.longestSideLength=function(t,e,i){var r=t.distance(e),n=e.distance(i),o=i.distance(t),f=r;return n>f&&(f=n),o>f&&(f=o),f},ft.isAcute=function(t,e,i){return!(!et.isAcute(t,e,i)||!et.isAcute(e,i,t)||!et.isAcute(i,t,e))},ft.circumcentre=function(t,e,i){var r=i.x,n=i.y,o=t.x-r,f=t.y-n,u=e.x-r,l=e.y-n,a=2*ft.det(o,f,u,l),c=ft.det(f,o*o+f*f,l,u*u+l*l),p=ft.det(o,o*o+f*f,u,u*u+l*l),d=r-c/a,h=n+p/a;return new A(d,h)},ft.perpendicularBisector=function(t,e){var i=e.x-t.x,r=e.y-t.y,n=new Ge(t.x+i/2,t.y+r/2,1),o=new Ge(t.x-r+i/2,t.y+i+r/2,1);return new Ge(n,o)},ft.angleBisector=function(t,e,i){var r=e.distance(t),n=e.distance(i),o=r/(r+n),f=i.x-t.x,u=i.y-t.y,l=new A(t.x+o*f,t.y+o*u);return l},ft.area3D=function(t,e,i){var r=e.x-t.x,n=e.y-t.y,o=e.z-t.z,f=i.x-t.x,u=i.y-t.y,l=i.z-t.z,a=n*l-o*u,c=o*f-r*l,p=r*u-n*f,d=a*a+c*c+p*p,h=Math.sqrt(d)/2;return h},ft.centroid=function(t,e,i){var r=(t.x+e.x+i.x)/3,n=(t.y+e.y+i.y)/3;return new A(r,n)},ft.inCentre=function(t,e,i){var r=e.distance(i),n=t.distance(i),o=t.distance(e),f=r+n+o,u=(r*t.x+n*e.x+o*i.x)/f,l=(r*t.y+n*e.y+o*i.y)/f;return new A(u,l)};var xe=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new x;var t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i};xe.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,E.EXTERIOR,E.INTERIOR)},xe.prototype.addPolygon=function(t){var e=this,i=this._distance,r=M.LEFT;this._distance<0&&(i=-this._distance,r=M.RIGHT);var n=t.getExteriorRing(),o=$.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,i,r,E.EXTERIOR,E.INTERIOR);for(var f=0;f<t.getNumInteriorRing();f++){var u=t.getInteriorRingN(f),l=$.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,i,M.opposite(r),E.INTERIOR,E.EXTERIOR)}},xe.prototype.isTriangleErodedCompletely=function(t,e){var i=new ft(t[0],t[1],t[2]),r=i.inCentre(),n=k.distancePointLine(r,i.p0,i.p1);return n<Math.abs(e)},xe.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=$.removeRepeatedPoints(t.getCoordinates()),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,E.EXTERIOR,E.INTERIOR)},xe.prototype.addCurve=function(t,e,i){if(t===null||t.length<2)return null;var r=new wt(t,new ht(0,E.BOUNDARY,e,i));this._curveList.add(r)},xe.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},xe.prototype.addPolygonRing=function(t,e,i,r,n){if(e===0&&t.length<Wi.MINIMUM_VALID_SIZE)return null;var o=r,f=n;t.length>=Wi.MINIMUM_VALID_SIZE&&k.isCCW(t)&&(o=n,f=r,i=M.opposite(i));var u=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(u,o,f)},xe.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Bt?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof me?this.addPoint(t):t instanceof is?this.addCollection(t):t instanceof lr?this.addCollection(t):t instanceof Ti?this.addCollection(t):t instanceof te&&this.addCollection(t)},xe.prototype.isErodedCompletely=function(t,e){var i=t.getCoordinates();if(i.length<4)return e<0;if(i.length===4)return this.isTriangleErodedCompletely(i,e);var r=t.getEnvelopeInternal(),n=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>n},xe.prototype.addCollection=function(t){for(var e=this,i=0;i<t.getNumGeometries();i++){var r=t.getGeometryN(i);e.add(r)}},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe};var os=function(){};os.prototype.locate=function(t){},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os};var Ai=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Ai.prototype.next=function(){if(this._atStart)return this._atStart=!1,Ai.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new ts;var t=this._parent.getGeometryN(this._index++);return t instanceof te?(this._subcollectionIterator=new Ai(t),this._subcollectionIterator.next()):t},Ai.prototype.remove=function(){throw new Error(this.getClass().getName())},Ai.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ai.prototype.interfaces_=function(){return[$r]},Ai.prototype.getClass=function(){return Ai},Ai.isAtomic=function(t){return!(t instanceof te)};var we=function(){this._geom=null;var t=arguments[0];this._geom=t};we.prototype.locate=function(t){return we.locate(t,this._geom)},we.prototype.interfaces_=function(){return[os]},we.prototype.getClass=function(){return we},we.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?k.isPointInRing(t,e.getCoordinates()):!1},we.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var i=e.getExteriorRing();if(!we.isPointInRing(t,i))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var n=e.getInteriorRingN(r);if(we.isPointInRing(t,n))return!1}return!0},we.containsPoint=function(t,e){if(e instanceof Bt)return we.containsPointInPolygon(t,e);if(e instanceof te)for(var i=new Ai(e);i.hasNext();){var r=i.next();if(r!==e&&we.containsPoint(t,r))return!0}return!1},we.locate=function(t,e){return e.isEmpty()?E.EXTERIOR:we.containsPoint(t,e)?E.INTERIOR:E.EXTERIOR};var Qt=function(){this._edgeMap=new jt,this._edgeList=null,this._ptInAreaLocation=[E.NONE,E.NONE]};Qt.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),i=e-1;return e===0&&(i=this._edgeList.size()-1),this._edgeList.get(i)},Qt.prototype.propagateSideLabels=function(t){for(var e=E.NONE,i=this.iterator();i.hasNext();){var r=i.next(),n=r.getLabel();n.isArea(t)&&n.getLocation(t,M.LEFT)!==E.NONE&&(e=n.getLocation(t,M.LEFT))}if(e===E.NONE)return null;for(var o=e,f=this.iterator();f.hasNext();){var u=f.next(),l=u.getLabel();if(l.getLocation(t,M.ON)===E.NONE&&l.setLocation(t,M.ON,o),l.isArea(t)){var a=l.getLocation(t,M.LEFT),c=l.getLocation(t,M.RIGHT);if(c!==E.NONE){if(c!==o)throw new Vi("side location conflict",u.getCoordinate());a===E.NONE&&j.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=a}else j.isTrue(l.getLocation(t,M.LEFT)===E.NONE,"found single null side"),l.setLocation(t,M.RIGHT,o),l.setLocation(t,M.LEFT,o)}}},Qt.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Qt.prototype.print=function(t){Xt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},Qt.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Qt.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var i=e.size()-1,r=e.get(i).getLabel(),n=r.getLocation(t,M.LEFT);j.isTrue(n!==E.NONE,"Found unlabelled area edge");for(var o=n,f=this.iterator();f.hasNext();){var u=f.next(),l=u.getLabel();j.isTrue(l.isArea(t),"Found non-area edge");var a=l.getLocation(t,M.LEFT),c=l.getLocation(t,M.RIGHT);if(a===c||c!==o)return!1;o=a}return!0},Qt.prototype.findIndex=function(t){var e=this;this.iterator();for(var i=0;i<this._edgeList.size();i++){var r=e._edgeList.get(i);if(r===t)return i}return-1},Qt.prototype.iterator=function(){return this.getEdges().iterator()},Qt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new x(this._edgeMap.values())),this._edgeList},Qt.prototype.getLocation=function(t,e,i){return this._ptInAreaLocation[t]===E.NONE&&(this._ptInAreaLocation[t]=we.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]},Qt.prototype.toString=function(){var t=new $e;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
3
- `);for(var e=this.iterator();e.hasNext();){var i=e.next();t.append(i),t.append(`
4
- `)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.computeLabel(t)}},Qt.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var i=[!1,!1],r=this.iterator();r.hasNext();)for(var n=r.next(),o=n.getLabel(),f=0;f<2;f++)o.isLine(f)&&o.getLocation(f)===E.BOUNDARY&&(i[f]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),a=l.getLabel(),c=0;c<2;c++)if(a.isAnyNull(c)){var p=E.NONE;if(i[c])p=E.EXTERIOR;else{var d=l.getCoordinate();p=e.getLocation(c,d,t)}a.setAllLocationsIfNull(c,p)}},Qt.prototype.getDegree=function(){return this._edgeMap.size()},Qt.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var Ef=function(s){function t(){s.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var i=this;this.getResultAreaEdges();for(var r=null,n=null,o=this._SCANNING_FOR_INCOMING,f=0;f<this._resultAreaEdgeList.size();f++){var u=i._resultAreaEdgeList.get(f),l=u.getSym();if(u.getLabel().isArea())switch(r===null&&u.isInResult()&&(r=u),o){case i._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;n=l,o=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(!u.isInResult())continue;n.setNext(u),o=i._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(r===null)throw new Vi("no outgoing dirEdge found",this.getCoordinate());j.isTrue(r.isInResult(),"unable to link last incoming dirEdge"),n.setNext(r)}},t.prototype.insert=function(i){var r=i;this.insertEdgeEnd(r,r)},t.prototype.getRightmostEdge=function(){var i=this.getEdges(),r=i.size();if(r<1)return null;var n=i.get(0);if(r===1)return n;var o=i.get(r-1),f=n.getQuadrant(),u=o.getQuadrant();return ct.isNorthern(f)&&ct.isNorthern(u)?n:!ct.isNorthern(f)&&!ct.isNorthern(u)?o:n.getDy()!==0?n:o.getDy()!==0?o:(j.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(i){Xt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var n=r.next();i.print("out "),n.print(i),i.println(),i.print("in "),n.getSym().print(i),i.println()}},t.prototype.getResultAreaEdges=function(){var i=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new x;for(var r=this.iterator();r.hasNext();){var n=r.next();(n.isInResult()||n.getSym().isInResult())&&i._resultAreaEdgeList.add(n)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(i){for(var r=this.iterator();r.hasNext();){var n=r.next(),o=n.getLabel();o.setAllLocationsIfNull(0,i.getLocation(0)),o.setAllLocationsIfNull(1,i.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var i=this;this.getEdges();for(var r=null,n=null,o=this._edgeList.size()-1;o>=0;o--){var f=i._edgeList.get(o),u=f.getSym();n===null&&(n=u),r!==null&&u.setNext(r),r=f}n.setNext(r)},t.prototype.computeDepths=function(){var i=this;if(arguments.length===1){var r=arguments[0],n=this.findIndex(r),o=r.getDepth(M.LEFT),f=r.getDepth(M.RIGHT),u=this.computeDepths(n+1,this._edgeList.size(),o),l=this.computeDepths(0,n,u);if(l!==f)throw new Vi("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var a=arguments[0],c=arguments[1],p=arguments[2],d=p,h=a;h<c;h++){var v=i._edgeList.get(h);v.setEdgeDepths(M.RIGHT,d),d=v.getDepth(M.LEFT)}return d}},t.prototype.mergeSymLabels=function(){for(var i=this.iterator();i.hasNext();){var r=i.next(),n=r.getLabel();n.merge(r.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(i){for(var r=this,n=null,o=null,f=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=r._resultAreaEdgeList.get(u),a=l.getSym();switch(n===null&&l.getEdgeRing()===i&&(n=l),f){case r._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==i)continue;o=a,f=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==i)continue;o.setNextMin(l),f=r._SCANNING_FOR_INCOMING;break}}f===this._LINKING_TO_OUTGOING&&(j.isTrue(n!==null,"found null for first outgoing dirEdge"),j.isTrue(n.getEdgeRing()===i,"unable to link last incoming dirEdge"),o.setNextMin(n))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var i=0,r=this.iterator();r.hasNext();){var n=r.next();n.isInResult()&&i++}return i}else if(arguments.length===1){for(var o=arguments[0],f=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&f++}return f}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var i=E.NONE,r=this.iterator();r.hasNext();){var n=r.next(),o=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){i=E.INTERIOR;break}if(o.isInResult()){i=E.EXTERIOR;break}}}if(i===E.NONE)return null;for(var f=i,u=this.iterator();u.hasNext();){var l=u.next(),a=l.getSym();l.isLineEdge()?l.getEdge().setCovered(f===E.INTERIOR):(l.isInResult()&&(f=E.EXTERIOR),a.isInResult()&&(f=E.INTERIOR))}},t.prototype.computeLabelling=function(i){var r=this;s.prototype.computeLabelling.call(this,i),this._label=new ht(E.NONE);for(var n=this.iterator();n.hasNext();)for(var o=n.next(),f=o.getEdge(),u=f.getLabel(),l=0;l<2;l++){var a=u.getLocation(l);(a===E.INTERIOR||a===E.BOUNDARY)&&r._label.setLocation(l,E.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qt),qo=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.createNode=function(i){return new un(i,new Ef)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(rs),Qi=function s(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=s.orientation(t)};Qi.prototype.compareTo=function(t){var e=t,i=Qi.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return i},Qi.prototype.interfaces_=function(){return[De]},Qi.prototype.getClass=function(){return Qi},Qi.orientation=function(t){return $.increasingDirection(t)===1},Qi.compareOriented=function(t,e,i,r){for(var n=e?1:-1,o=r?1:-1,f=e?t.length:-1,u=r?i.length:-1,l=e?0:t.length-1,a=r?0:i.length-1;;){var c=t[l].compareTo(i[a]);if(c!==0)return c;l+=n,a+=o;var p=l===f,d=a===u;if(p&&!d)return-1;if(!p&&d)return 1;if(p&&d)return 0}};var He=function(){this._edges=new x,this._ocaMap=new jt};He.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var i=0;i<this._edges.size();i++){var r=e._edges.get(i);i>0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),o=0;o<n.length;o++)o>0&&t.print(","),t.print(n[o].x+" "+n[o].y);t.println(")")}t.print(") ")},He.prototype.addAll=function(t){for(var e=this,i=t.iterator();i.hasNext();)e.add(i.next())},He.prototype.findEdgeIndex=function(t){for(var e=this,i=0;i<this._edges.size();i++)if(e._edges.get(i).equals(t))return i;return-1},He.prototype.iterator=function(){return this._edges.iterator()},He.prototype.getEdges=function(){return this._edges},He.prototype.get=function(t){return this._edges.get(t)},He.prototype.findEqualEdge=function(t){var e=new Qi(t.getCoordinates()),i=this._ocaMap.get(e);return i},He.prototype.add=function(t){this._edges.add(t);var e=new Qi(t.getCoordinates());this._ocaMap.put(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var gr=function(){};gr.prototype.processIntersections=function(t,e,i,r){},gr.prototype.isDone=function(){},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Ee=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Ee.prototype.isTrivialIntersection=function(t,e,i,r){if(t===i&&this._li.getIntersectionNum()===1){if(Ee.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var n=t.size()-1;if(e===0&&r===n||r===0&&e===n)return!0}}return!1},Ee.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ee.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ee.prototype.getLineIntersector=function(){return this._li},Ee.prototype.hasProperIntersection=function(){return this._hasProper},Ee.prototype.processIntersections=function(t,e,i,r){if(t===i&&e===r)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=i.getCoordinates()[r],u=i.getCoordinates()[r+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Ee.prototype.hasIntersection=function(){return this._hasIntersection},Ee.prototype.isDone=function(){return!1},Ee.prototype.hasInteriorIntersection=function(){return this._hasInterior},Ee.prototype.interfaces_=function(){return[gr]},Ee.prototype.getClass=function(){return Ee},Ee.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var li=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new A(t),this.segmentIndex=e,this.dist=i};li.prototype.getSegmentIndex=function(){return this.segmentIndex},li.prototype.getCoordinate=function(){return this.coord},li.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},li.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},li.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},li.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},li.prototype.getDistance=function(){return this.dist},li.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},li.prototype.interfaces_=function(){return[De]},li.prototype.getClass=function(){return li};var wi=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};wi.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},wi.prototype.iterator=function(){return this._nodeMap.values().iterator()},wi.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var i=this.iterator(),r=i.next();i.hasNext();){var n=i.next(),o=e.createSplitEdge(r,n);t.add(o),r=n}},wi.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},wi.prototype.createSplitEdge=function(t,e){var i=this,r=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(n);o||r--;var f=new Array(r).fill(null),u=0;f[u++]=new A(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)f[u++]=i.edge.pts[l];return o&&(f[u]=e.coord),new ln(f,new ht(this.edge._label))},wi.prototype.add=function(t,e,i){var r=new li(t,e,i),n=this._nodeMap.get(r);return n!==null?n:(this._nodeMap.put(r,r),r)},wi.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();if(i.coord.equals(t))return!0}return!1},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var dr=function(){};dr.prototype.getChainStartIndices=function(t){var e=this,i=0,r=new x;r.add(new ti(i));do{var n=e.findChainEnd(t,i);r.add(new ti(n)),i=n}while(i<t.length-1);var o=dr.toIntArray(r);return o},dr.prototype.findChainEnd=function(t,e){for(var i=ct.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){var n=ct.quadrant(t[r-1],t[r]);if(n!==i)break;r++}return r-1},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var Yi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new V,this.env2=new V;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new dr;this.startIndex=e.getChainStartIndices(this.pts)};Yi.prototype.getCoordinates=function(){return this.pts},Yi.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i},Yi.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i},Yi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],r)}else if(arguments.length===6){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3],l=arguments[4],a=arguments[5],c=this.pts[n],p=this.pts[o],d=f.pts[u],h=f.pts[l];if(o-n===1&&l-u===1)return a.addIntersections(this.e,n,f.e,u),null;if(this.env1.init(c,p),this.env2.init(d,h),!this.env1.intersects(this.env2))return null;var v=Math.trunc((n+o)/2),C=Math.trunc((u+l)/2);n<v&&(u<C&&this.computeIntersectsForChain(n,v,f,u,C,a),C<l&&this.computeIntersectsForChain(n,v,f,C,l,a)),v<o&&(u<C&&this.computeIntersectsForChain(v,o,f,u,C,a),C<l&&this.computeIntersectsForChain(v,o,f,C,l,a))}},Yi.prototype.getStartIndexes=function(){return this.startIndex},Yi.prototype.computeIntersects=function(t,e){for(var i=this,r=0;r<this.startIndex.length-1;r++)for(var n=0;n<t.startIndex.length-1;n++)i.computeIntersectsForChain(r,t,n,e)},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi};var Yt=function s(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var i=0;i<3;i++)t._depth[e][i]=s.NULL_VALUE},Zo={NULL_VALUE:{configurable:!0}};Yt.prototype.getDepth=function(t,e){return this._depth[t][e]},Yt.prototype.setDepth=function(t,e,i){this._depth[t][e]=i},Yt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var i=0;i<3;i++)if(t._depth[e][i]!==Yt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var r=arguments[0];return this._depth[r][1]===Yt.NULL_VALUE}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._depth[n][o]===Yt.NULL_VALUE}},Yt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var i=t._depth[e][1];t._depth[e][2]<i&&(i=t._depth[e][2]),i<0&&(i=0);for(var r=1;r<3;r++){var n=0;t._depth[e][r]>i&&(n=1),t._depth[e][r]=n}}},Yt.prototype.getDelta=function(t){return this._depth[t][M.RIGHT]-this._depth[t][M.LEFT]},Yt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?E.EXTERIOR:E.INTERIOR},Yt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Yt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],i=0;i<2;i++)for(var r=1;r<3;r++){var n=e.getLocation(i,r);(n===E.EXTERIOR||n===E.INTERIOR)&&(t.isNull(i,r)?t._depth[i][r]=Yt.depthAtLocation(n):t._depth[i][r]+=Yt.depthAtLocation(n))}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];u===E.INTERIOR&&this._depth[o][f]++}},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.depthAtLocation=function(t){return t===E.EXTERIOR?0:t===E.INTERIOR?1:Yt.NULL_VALUE},Zo.NULL_VALUE.get=function(){return-1},Object.defineProperties(Yt,Zo);var ln=function(s){function t(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new wi(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Yt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.pts=i,this._label=r}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var i=new Array(2).fill(null);i[0]=this.pts[0],i[1]=this.pts[1];var r=new t(i,ht.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(i){this._isIsolated=i},t.prototype.setName=function(i){this._name=i},t.prototype.equals=function(i){var r=this;if(!(i instanceof t))return!1;var n=i;if(this.pts.length!==n.pts.length)return!1;for(var o=!0,f=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(r.pts[l].equals2D(n.pts[l])||(o=!1),r.pts[l].equals2D(n.pts[--u])||(f=!1),!o&&!f)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var i=arguments[0];return this.pts[i]}},t.prototype.print=function(i){var r=this;i.print("edge "+this._name+": "),i.print("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&i.print(","),i.print(r.pts[n].x+" "+r.pts[n].y);i.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(i){t.updateIM(this._label,i)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(i){var r=this;i.print("edge "+this._name+": ");for(var n=this.pts.length-1;n>=0;n--)i.print(r.pts[n]+" ");i.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Yi(this)),this._mce},t.prototype.getEnvelope=function(){var i=this;if(this._env===null){this._env=new V;for(var r=0;r<this.pts.length;r++)i._env.expandToInclude(i.pts[r])}return this._env},t.prototype.addIntersection=function(i,r,n,o){var f=new A(i.getIntersection(o)),u=r,l=i.getEdgeDistance(n,o),a=u+1;if(a<this.pts.length){var c=this.pts[a];f.equals2D(c)&&(u=a,l=0)}this.eiList.add(f,u,l)},t.prototype.toString=function(){var i=this,r=new $e;r.append("edge "+this._name+": "),r.append("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&r.append(","),r.append(i.pts[n].x+" "+i.pts[n].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(i){var r=this;if(this.pts.length!==i.pts.length)return!1;for(var n=0;n<this.pts.length;n++)if(!r.pts[n].equals2D(i.pts[n]))return!1;return!0},t.prototype.setDepthDelta=function(i){this._depthDelta=i},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(i,r,n){for(var o=this,f=0;f<i.getIntersectionNum();f++)o.addIntersection(i,r,n,f)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];r.setAtLeastIfValid(i.getLocation(0,M.ON),i.getLocation(1,M.ON),1),i.isArea()&&(r.setAtLeastIfValid(i.getLocation(0,M.LEFT),i.getLocation(1,M.LEFT),2),r.setAtLeastIfValid(i.getLocation(0,M.RIGHT),i.getLocation(1,M.RIGHT),2))}else return s.prototype.updateIM.apply(this,arguments)},t}(Le),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new He,this._bufParams=t||null};re.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},re.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var i=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ht(t.getLabel()),r.flip()),i.merge(r);var n=re.depthDelta(r),o=e.getDepthDelta(),f=o+n;e.setDepthDelta(f)}else this._edgeList.add(t),t.setDepthDelta(re.depthDelta(t.getLabel()))},re.prototype.buildSubgraphs=function(t,e){for(var i=new x,r=t.iterator();r.hasNext();){var n=r.next(),o=n.getRightmostCoordinate(),f=new Mr(i),u=f.getDepth(o);n.computeDepth(u),n.findResultEdges(),i.add(n),e.add(n.getDirectedEdges(),n.getNodes())}},re.prototype.createSubgraphs=function(t){for(var e=new x,i=t.getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isVisited()){var n=new ee;n.create(r),e.add(n)}}return Ze.sort(e,Ze.reverseOrder()),e},re.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},re.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Hn,i=new fr;return i.setPrecisionModel(t),e.setSegmentIntersector(new Ee(i)),e},re.prototype.buffer=function(t,e){var i=this._workingPrecisionModel;i===null&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new ce(i,this._bufParams),n=new xe(t,e,r),o=n.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,i),this._graph=new Ct(new qo),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),u=new ve(this._geomFact);this.buildSubgraphs(f,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var a=this._geomFact.buildGeometry(l);return a},re.prototype.computeNodedEdges=function(t,e){var i=this,r=this.getNoder(e);r.computeNodes(t);for(var n=r.getNodedSubstrings(),o=n.iterator();o.hasNext();){var f=o.next(),u=f.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=f.getData(),a=new ln(f.getCoordinates(),new ht(l));i.insertUniqueEdge(a)}}},re.prototype.setNoder=function(t){this._workingNoder=t},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.depthDelta=function(t){var e=t.getLocation(0,M.LEFT),i=t.getLocation(0,M.RIGHT);return e===E.INTERIOR&&i===E.EXTERIOR?1:e===E.EXTERIOR&&i===E.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new tt,i=new x;t.hasNext();){var r=t.next(),n=e.createLineString(r.getCoordinates());i.add(n)}return e.buildGeometry(i)};var $i=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var i=arguments[0],r=arguments[1],n=arguments[2],o=arguments[3];this._noder=i,this._scaleFactor=r,this._offsetX=n,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};$i.prototype.rescale=function(){var t=this;if(U(arguments[0],Rt))for(var e=arguments[0],i=e.iterator();i.hasNext();){var r=i.next();t.rescale(r.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],o=0;o<n.length;o++)n[o].x=n[o].x/t._scaleFactor+t._offsetX,n[o].y=n[o].y/t._scaleFactor+t._offsetY;n.length===2&&n[0].equals2D(n[1])&&Xt.out.println(n)}},$i.prototype.scale=function(){var t=this;if(U(arguments[0],Rt)){for(var e=arguments[0],i=new x,r=e.iterator();r.hasNext();){var n=r.next();i.add(new wt(t.scale(n.getCoordinates()),n.getData()))}return i}else if(arguments[0]instanceof Array){for(var o=arguments[0],f=new Array(o.length).fill(null),u=0;u<o.length;u++)f[u]=new A(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=$.removeRepeatedPoints(f);return l}},$i.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},$i.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},$i.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},$i.prototype.interfaces_=function(){return[cr]},$i.prototype.getClass=function(){return $i};var ci=function(){this._li=new fr,this._segStrings=null;var t=arguments[0];this._segStrings=t},Ho={fact:{configurable:!0}};ci.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next(),r=i.getCoordinates();t.checkEndPtVertexIntersections(r[0],t._segStrings),t.checkEndPtVertexIntersections(r[r.length-1],t._segStrings)}else if(arguments.length===2){for(var n=arguments[0],o=arguments[1],f=o.iterator();f.hasNext();)for(var u=f.next(),l=u.getCoordinates(),a=1;a<l.length-1;a++)if(l[a].equals(n))throw new Bi("found endpt/interior pt intersection at index "+a+" :pt "+n)}},ci.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var i=e.next(),r=this._segStrings.iterator();r.hasNext();){var n=r.next();t.checkInteriorIntersections(i,n)}else if(arguments.length===2)for(var o=arguments[0],f=arguments[1],u=o.getCoordinates(),l=f.getCoordinates(),a=0;a<u.length-1;a++)for(var c=0;c<l.length-1;c++)t.checkInteriorIntersections(o,a,f,c);else if(arguments.length===4){var p=arguments[0],d=arguments[1],h=arguments[2],v=arguments[3];if(p===h&&d===v)return null;var C=p.getCoordinates()[d],W=p.getCoordinates()[d+1],_=h.getCoordinates()[v],T=h.getCoordinates()[v+1];if(this._li.computeIntersection(C,W,_,T),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,C,W)||this.hasInteriorIntersection(this._li,_,T)))throw new Bi("found non-noded intersection at "+C+"-"+W+" and "+_+"-"+T)}},ci.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},ci.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next();t.checkCollapses(i)}else if(arguments.length===1)for(var r=arguments[0],n=r.getCoordinates(),o=0;o<n.length-2;o++)t.checkCollapse(n[o],n[o+1],n[o+2])},ci.prototype.hasInteriorIntersection=function(t,e,i){for(var r=0;r<t.getIntersectionNum();r++){var n=t.getIntersection(r);if(!(n.equals(e)||n.equals(i)))return!0}return!1},ci.prototype.checkCollapse=function(t,e,i){if(t.equals(i))throw new Bi("found non-noded collapse at "+ci.fact.createLineString([t,e,i]))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},Ho.fact.get=function(){return new tt},Object.defineProperties(ci,Ho);var pe=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new vt("Scale factor must be non-zero");e!==1&&(this._pt=new A(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new A,this._p1Scaled=new A),this.initCorners(this._pt)},Ko={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pe.prototype.intersectsScaled=function(t,e){var i=Math.min(t.x,e.x),r=Math.max(t.x,e.x),n=Math.min(t.y,e.y),o=Math.max(t.y,e.y),f=this._maxx<i||this._minx>r||this._maxy<n||this._miny>o;if(f)return!1;var u=this.intersectsToleranceSquare(t,e);return j.isTrue(!(f&&u),"Found bad envelope test"),u},pe.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new A(this._maxx,this._maxy),this._corner[1]=new A(this._minx,this._maxy),this._corner[2]=new A(this._minx,this._miny),this._corner[3]=new A(this._maxx,this._miny)},pe.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},pe.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},pe.prototype.getCoordinate=function(){return this._originalPt},pe.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},pe.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=pe.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new V(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},pe.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},pe.prototype.intersectsToleranceSquare=function(t,e){var i=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||i&&r||t.equals(this._pt)||e.equals(this._pt))},pe.prototype.addSnappedNode=function(t,e){var i=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(i,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},Ko.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pe,Ko);var Os=function(){this.tempEnv1=new V,this.selectedSegment=new G};Os.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var as=function(){this._index=null;var t=arguments[0];this._index=t},jo={HotPixelSnapAction:{configurable:!0}};as.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],i=arguments[1],r=arguments[2],n=e.getSafeEnvelope(),o=new Jo(e,i,r);return this._index.query(n,{interfaces_:function(){return[ji]},visitItem:function(f){var u=f;u.select(n,o)}}),o.isNodeAdded()}},as.prototype.interfaces_=function(){return[]},as.prototype.getClass=function(){return as},jo.HotPixelSnapAction.get=function(){return Jo},Object.defineProperties(as,jo);var Jo=function(s){function t(){s.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],i=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=i,this._hotPixelVertexIndex=r}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1],n=i.getContext();if(this._parentEdge!==null&&n===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,r)}else return s.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Os),Or=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new x};Or.prototype.processIntersections=function(t,e,i,r){var n=this;if(t===i&&e===r)return null;var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=i.getCoordinates()[r],l=i.getCoordinates()[r+1];if(this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)n._interiorIntersections.add(n._li.getIntersection(a));t.addIntersections(this._li,e,0),i.addIntersections(this._li,r,1)}},Or.prototype.isDone=function(){return!1},Or.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Or.prototype.interfaces_=function(){return[gr]},Or.prototype.getClass=function(){return Or};var Ei=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new fr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Ei.prototype.checkCorrectness=function(t){var e=wt.getNodedSubstrings(t),i=new ci(e);try{i.checkValid()}catch(r){if(r instanceof No)r.printStackTrace();else throw r}finally{}},Ei.prototype.getNodedSubstrings=function(){return wt.getNodedSubstrings(this._nodedSegStrings)},Ei.prototype.snapRound=function(t,e){var i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)},Ei.prototype.findInteriorIntersections=function(t,e){var i=new Or(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()},Ei.prototype.computeVertexSnaps=function(){var t=this;if(U(arguments[0],Rt))for(var e=arguments[0],i=e.iterator();i.hasNext();){var r=i.next();t.computeVertexSnaps(r)}else if(arguments[0]instanceof wt)for(var n=arguments[0],o=n.getCoordinates(),f=0;f<o.length;f++){var u=new pe(o[f],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,n,f);l&&n.addIntersection(o[f],f)}},Ei.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Hn,this._pointSnapper=new as(this._noder.getIndex()),this.snapRound(t,this._li)},Ei.prototype.computeIntersectionSnaps=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next(),n=new pe(r,e._scaleFactor,e._li);e._pointSnapper.snap(n)}},Ei.prototype.interfaces_=function(){return[cr]},Ei.prototype.getClass=function(){return Ei};var zt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new at,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._argGeom=e,this._bufParams=i}},fs={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};zt.prototype.bufferFixedPrecision=function(t){var e=new $i(new Ei(new ot(1)),t.getScale()),i=new re(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)},zt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=zt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Vi)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var i=arguments[0],r=zt.precisionScaleFactor(this._argGeom,this._distance,i),n=new ot(r);this.bufferFixedPrecision(n)}},zt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ot.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},zt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},zt.prototype.bufferOriginalPrecision=function(){try{var t=new re(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Bi)this._saveException=e;else throw e}finally{}},zt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},zt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new zt(t),r=i.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var n=arguments[0],o=arguments[1],f=arguments[2],u=new zt(n);u.setQuadrantSegments(f);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof at&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=arguments[2],d=new zt(a,p),h=d.getResultGeometry(c);return h}}else if(arguments.length===4){var v=arguments[0],C=arguments[1],W=arguments[2],_=arguments[3],T=new zt(v);T.setQuadrantSegments(W),T.setEndCapStyle(_);var L=T.getResultGeometry(C);return L}},zt.precisionScaleFactor=function(t,e,i){var r=t.getEnvelopeInternal(),n=Ie.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,f=n+2*o,u=Math.trunc(Math.log(f)/Math.log(10)+1),l=i-u,a=Math.pow(10,l);return a},fs.CAP_ROUND.get=function(){return at.CAP_ROUND},fs.CAP_BUTT.get=function(){return at.CAP_FLAT},fs.CAP_FLAT.get=function(){return at.CAP_FLAT},fs.CAP_SQUARE.get=function(){return at.CAP_SQUARE},fs.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(zt,fs);var se=function(){this._pt=[new A,new A],this._distance=Z.NaN,this._isNull=!0};se.prototype.getCoordinates=function(){return this._pt},se.prototype.getCoordinate=function(t){return this._pt[t]},se.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r<this._distance&&this.initialize(e,i,r)}},se.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=n,this._isNull=!1}},se.prototype.getDistance=function(){return this._distance},se.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r>this._distance&&this.initialize(e,i,r)}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var Pi=function(){};Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},Pi.computeDistance=function(){if(arguments[2]instanceof se&&arguments[0]instanceof Wt&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],i=arguments[2],r=t.getCoordinates(),n=new G,o=0;o<r.length-1;o++){n.setCoordinates(r[o],r[o+1]);var f=n.closestPoint(e);i.setMinimum(f,e)}else if(arguments[2]instanceof se&&arguments[0]instanceof Bt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];Pi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)Pi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof se&&arguments[0]instanceof z&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)Pi.computeDistance(p,d,h);else if(p instanceof Bt)Pi.computeDistance(p,d,h);else if(p instanceof te)for(var v=p,C=0;C<v.getNumGeometries();C++){var W=v.getGeometryN(C);Pi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof se&&arguments[0]instanceof G&&arguments[1]instanceof A){var _=arguments[0],T=arguments[1],L=arguments[2],P=_.closestPoint(T);L.setMinimum(P,T)}};var yr=function(t){this._maxPtDist=new se,this._inputGeom=t||null},Kn={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};yr.prototype.computeMaxMidpointDistance=function(t){var e=new tr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yr.prototype.computeMaxVertexDistance=function(t){var e=new Fr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},yr.prototype.getDistancePoints=function(){return this._maxPtDist},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},Kn.MaxPointDistanceFilter.get=function(){return Fr},Kn.MaxMidpointDistanceFilter.get=function(){return tr},Object.defineProperties(yr,Kn);var Fr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};Fr.prototype.filter=function(t){this._minPtDist.initialize(),Pi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[Ci]},Fr.prototype.getClass=function(){return Fr};var tr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};tr.prototype.filter=function(t,e){if(e===0)return null;var i=t.getCoordinate(e-1),r=t.getCoordinate(e),n=new A((i.x+r.x)/2,(i.y+r.y)/2);this._minPtDist.initialize(),Pi.computeDistance(this._geom,n,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},tr.prototype.isDone=function(){return!1},tr.prototype.isGeometryChanged=function(){return!1},tr.prototype.getMaxPointDistance=function(){return this._maxPtDist},tr.prototype.interfaces_=function(){return[Ue]},tr.prototype.getClass=function(){return tr};var zi=function(t){this._comps=t||null};zi.prototype.filter=function(t){t instanceof Bt&&this._comps.add(t)},zi.prototype.interfaces_=function(){return[si]},zi.prototype.getClass=function(){return zi},zi.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return zi.getPolygons(t,new x)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof Bt?i.add(e):e instanceof te&&e.apply(new zi(i)),i}};var Ut=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._lines=e,this._isForcedToLineString=i}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Wi){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Wt&&this._lines.add(t)},Ut.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ut.prototype.interfaces_=function(){return[Mi]},Ut.prototype.getClass=function(){return Ut},Ut.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Ut.getLines(t))}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,i))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(U(arguments[0],Rt)&&U(arguments[1],Rt)){for(var e=arguments[0],i=arguments[1],r=e.iterator();r.hasNext();){var n=r.next();Ut.getLines(n,i)}return i}else if(arguments[0]instanceof z&&typeof arguments[1]=="boolean"){var o=arguments[0],f=arguments[1],u=new x;return o.apply(new Ut(u,f)),u}else if(arguments[0]instanceof z&&U(arguments[1],Rt)){var l=arguments[0],a=arguments[1];return l instanceof Wt?a.add(l):l.apply(new Ut(a)),a}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&U(arguments[0],Rt)&&U(arguments[1],Rt)){for(var c=arguments[0],p=arguments[1],d=arguments[2],h=c.iterator();h.hasNext();){var v=h.next();Ut.getLines(v,p,d)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof z&&U(arguments[1],Rt)){var C=arguments[0],W=arguments[1],_=arguments[2];return C.apply(new Ut(W,_)),W}}};var Ke=function(){if(this._boundaryRule=Be.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new vt("Rule must be non-null");this._boundaryRule=t}}};Ke.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof A&&arguments[1]instanceof Bt){var e=arguments[0],i=arguments[1];if(i.isEmpty())return E.EXTERIOR;var r=i.getExteriorRing(),n=this.locateInPolygonRing(e,r);if(n===E.EXTERIOR)return E.EXTERIOR;if(n===E.BOUNDARY)return E.BOUNDARY;for(var o=0;o<i.getNumInteriorRing();o++){var f=i.getInteriorRingN(o),u=t.locateInPolygonRing(e,f);if(u===E.INTERIOR)return E.EXTERIOR;if(u===E.BOUNDARY)return E.BOUNDARY}return E.INTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof Wt){var l=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(l))return E.EXTERIOR;var c=a.getCoordinates();return!a.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?E.BOUNDARY:k.isOnLine(l,c)?E.INTERIOR:E.EXTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof me){var p=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(p)?E.INTERIOR:E.EXTERIOR}},Ke.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?k.locatePointInRing(t,e.getCoordinates()):E.EXTERIOR},Ke.prototype.intersects=function(t,e){return this.locate(t,e)!==E.EXTERIOR},Ke.prototype.updateLocationInfo=function(t){t===E.INTERIOR&&(this._isIn=!0),t===E.BOUNDARY&&this._numBoundaries++},Ke.prototype.computeLocation=function(t,e){var i=this;if(e instanceof me&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Bt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof lr)for(var r=e,n=0;n<r.getNumGeometries();n++){var o=r.getGeometryN(n);i.updateLocationInfo(i.locateInternal(t,o))}else if(e instanceof Ti)for(var f=e,u=0;u<f.getNumGeometries();u++){var l=f.getGeometryN(u);i.updateLocationInfo(i.locateInternal(t,l))}else if(e instanceof te)for(var a=new Ai(e);a.hasNext();){var c=a.next();c!==e&&i.computeLocation(t,c)}},Ke.prototype.locate=function(t,e){return e.isEmpty()?E.EXTERIOR:e instanceof Wt?this.locateInternal(t,e):e instanceof Bt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?E.BOUNDARY:this._numBoundaries>0||this._isIn?E.INTERIOR:E.EXTERIOR)},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var ne=function s(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];s.call(this,t,s.INSIDE_AREA,e)}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this._component=i,this._segIndex=r,this._pt=n}},Qo={INSIDE_AREA:{configurable:!0}};ne.prototype.isInsideArea=function(){return this._segIndex===ne.INSIDE_AREA},ne.prototype.getCoordinate=function(){return this._pt},ne.prototype.getGeometryComponent=function(){return this._component},ne.prototype.getSegmentIndex=function(){return this._segIndex},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},Qo.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ne,Qo);var er=function(t){this._pts=t||null};er.prototype.filter=function(t){t instanceof me&&this._pts.add(t)},er.prototype.interfaces_=function(){return[si]},er.prototype.getClass=function(){return er},er.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof me?Ze.singletonList(t):er.getPoints(t,new x)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof me?i.add(e):e instanceof te&&e.apply(new er(i)),i}};var xr=function(){this._locations=null;var t=arguments[0];this._locations=t};xr.prototype.filter=function(t){(t instanceof me||t instanceof Wt||t instanceof Bt)&&this._locations.add(new ne(t,0,t.getCoordinate()))},xr.prototype.interfaces_=function(){return[si]},xr.prototype.getClass=function(){return xr},xr.getLocations=function(t){var e=new x;return t.apply(new xr(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ke,this._minDistanceLocation=null,this._minDistance=Z.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=r,this._terminateDistance=n}};qt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var i=arguments[0],r=arguments[1],n=1-i,o=zi.getPolygons(this._geom[i]);if(o.size()>0){var f=xr.getLocations(this._geom[n]);if(this.computeContainmentDistance(f,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[i]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&U(arguments[0],Ye)&&U(arguments[1],Ye)){for(var u=arguments[0],l=arguments[1],a=arguments[2],c=0;c<u.size();c++)for(var p=u.get(c),d=0;d<l.size();d++)if(t.computeContainmentDistance(p,l.get(d),a),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ne&&arguments[1]instanceof Bt){var h=arguments[0],v=arguments[1],C=arguments[2],W=h.getCoordinate();if(E.EXTERIOR!==this._ptLocator.locate(W,v))return this._minDistance=0,C[0]=h,C[1]=new ne(v,W),null}}},qt.prototype.computeMinDistanceLinesPoints=function(t,e,i){for(var r=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(r.computeMinDistance(o,u,i),r._minDistance<=r._terminateDistance)return null}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),i=Ut.getLines(this._geom[1]),r=er.getPoints(this._geom[0]),n=er.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(i,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(r,n,t),this.updateMinDistance(t,!1)},qt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},qt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},qt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},qt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof me){var e=arguments[0],i=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var n=e.getCoordinates(),o=i.getCoordinate(),f=0;f<n.length-1;f++){var u=k.distancePointLine(o,n[f],n[f+1]);if(u<t._minDistance){t._minDistance=u;var l=new G(n[f],n[f+1]),a=l.closestPoint(o);r[0]=new ne(e,f,a),r[1]=new ne(i,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Wt){var c=arguments[0],p=arguments[1],d=arguments[2];if(c.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var h=c.getCoordinates(),v=p.getCoordinates(),C=0;C<h.length-1;C++)for(var W=0;W<v.length-1;W++){var _=k.distanceLineLine(h[C],h[C+1],v[W],v[W+1]);if(_<t._minDistance){t._minDistance=_;var T=new G(h[C],h[C+1]),L=new G(v[W],v[W+1]),P=T.closestPoints(L);d[0]=new ne(c,C,P[0]),d[1]=new ne(p,W,P[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.prototype.computeMinDistancePoints=function(t,e,i){for(var r=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f),l=o.getCoordinate().distance(u.getCoordinate());if(l<r._minDistance&&(r._minDistance=l,i[0]=new ne(o,0,o.getCoordinate()),i[1]=new ne(u,0,u.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},qt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new vt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},qt.prototype.computeMinDistanceLines=function(t,e,i){for(var r=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(r.computeMinDistance(o,u,i),r._minDistance<=r._terminateDistance)return null}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var i=new qt(t,e);return i.distance()},qt.isWithinDistance=function(t,e,i){var r=new qt(t,e,i);return r.distance()<=i},qt.nearestPoints=function(t,e){var i=new qt(t,e);return i.nearestPoints()};var $t=function(){this._pt=[new A,new A],this._distance=Z.NaN,this._isNull=!0};$t.prototype.getCoordinates=function(){return this._pt},$t.prototype.getCoordinate=function(t){return this._pt[t]},$t.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r<this._distance&&this.initialize(e,i,r)}},$t.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=n,this._isNull=!1}},$t.prototype.toString=function(){return Xe.toLineString(this._pt[0],this._pt[1])},$t.prototype.getDistance=function(){return this._distance},$t.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r>this._distance&&this.initialize(e,i,r)}},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var pi=function(){};pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},pi.computeDistance=function(){if(arguments[2]instanceof $t&&arguments[0]instanceof Wt&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],i=arguments[2],r=new G,n=t.getCoordinates(),o=0;o<n.length-1;o++){r.setCoordinates(n[o],n[o+1]);var f=r.closestPoint(e);i.setMinimum(f,e)}else if(arguments[2]instanceof $t&&arguments[0]instanceof Bt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];pi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)pi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof $t&&arguments[0]instanceof z&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)pi.computeDistance(p,d,h);else if(p instanceof Bt)pi.computeDistance(p,d,h);else if(p instanceof te)for(var v=p,C=0;C<v.getNumGeometries();C++){var W=v.getGeometryN(C);pi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof $t&&arguments[0]instanceof G&&arguments[1]instanceof A){var _=arguments[0],T=arguments[1],L=arguments[2],P=_.closestPoint(T);L.setMinimum(P,T)}};var ke=function(){this._g0=null,this._g1=null,this._ptDist=new $t,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},jn={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ke.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ke.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new vt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},ke.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},ke.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ke.prototype.computeOrientedDistance=function(t,e,i){var r=new kr(e);if(t.apply(r),i.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var n=new ir(e,this._densifyFrac);t.apply(n),i.setMaximum(n.getMaxPointDistance())}},ke.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new ke(t,e);return i.distance()}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2],f=new ke(r,n);return f.setDensifyFraction(o),f.distance()}},jn.MaxPointDistanceFilter.get=function(){return kr},jn.MaxDensifiedByFractionDistanceFilter.get=function(){return ir},Object.defineProperties(ke,jn);var kr=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._euclideanDist=new pi,this._geom=null;var t=arguments[0];this._geom=t};kr.prototype.filter=function(t){this._minPtDist.initialize(),pi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Ci]},kr.prototype.getClass=function(){return kr};var ir=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};ir.prototype.filter=function(t,e){var i=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),o=(n.x-r.x)/this._numSubSegs,f=(n.y-r.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=r.x+u*o,a=r.y+u*f,c=new A(l,a);i._minPtDist.initialize(),pi.computeDistance(i._geom,c,i._minPtDist),i._maxPtDist.setMaximum(i._minPtDist)}},ir.prototype.isDone=function(){return!1},ir.prototype.isGeometryChanged=function(){return!1},ir.prototype.getMaxPointDistance=function(){return this._maxPtDist},ir.prototype.interfaces_=function(){return[Ue]},ir.prototype.getClass=function(){return ir};var Ce=function(t,e,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=i||null},Jn={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Ce.prototype.checkMaximumDistance=function(t,e,i){var r=new ke(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var n=r.getCoordinates();this._errorLocation=n[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Xe.toLineString(n[0],n[1])+")"}},Ce.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Ce.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Ce.VERBOSE&&Xt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Ce.prototype.checkNegativeValid=function(){if(!(this._input instanceof Bt||this._input instanceof Ti||this._input instanceof te))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Ce.prototype.getErrorIndicator=function(){return this._errorIndicator},Ce.prototype.checkMinimumDistance=function(t,e,i){var r=new qt(t,e,i);if(this._minDistanceFound=r.distance(),this._minDistanceFound<i){this._isValid=!1;var n=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Xe.toLineString(n[0],n[1])+" )"}},Ce.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Ce.prototype.getErrorLocation=function(){return this._errorLocation},Ce.prototype.getPolygonLines=function(t){for(var e=new x,i=new Ut(e),r=zi.getPolygons(t),n=r.iterator();n.hasNext();){var o=n.next();o.apply(i)}return t.getFactory().buildGeometry(e)},Ce.prototype.getErrorMessage=function(){return this._errMsg},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Jn.VERBOSE.get=function(){return!1},Jn.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ce,Jn);var Zt=function(t,e,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=i||null},Qn={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Zt.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Zt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Zt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new V(this._input.getEnvelopeInternal());e.expandBy(this._distance);var i=new V(this._result.getEnvelopeInternal());i.expandBy(t),i.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},Zt.prototype.checkDistance=function(){var t=new Ce(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Zt.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Zt.prototype.checkPolygonal=function(){this._result instanceof Bt||this._result instanceof Ti||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Zt.prototype.getErrorIndicator=function(){return this._errorIndicator},Zt.prototype.getErrorLocation=function(){return this._errorLocation},Zt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Zt.prototype.report=function(t){if(!Zt.VERBOSE)return null;Xt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Zt.prototype.getErrorMessage=function(){return this._errorMsg},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.isValidMsg=function(t,e,i){var r=new Zt(t,e,i);return r.isValid()?null:r.getErrorMessage()},Zt.isValid=function(t,e,i){var r=new Zt(t,e,i);return!!r.isValid()},Qn.VERBOSE.get=function(){return!1},Qn.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Zt,Qn);var gi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};gi.prototype.getCoordinates=function(){return this._pts},gi.prototype.size=function(){return this._pts.length},gi.prototype.getCoordinate=function(t){return this._pts[t]},gi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Rr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},gi.prototype.setData=function(t){this._data=t},gi.prototype.getData=function(){return this._data},gi.prototype.toString=function(){return Xe.toLineString(new At(this._pts))},gi.prototype.interfaces_=function(){return[Li]},gi.prototype.getClass=function(){return gi};var Vt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new x,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Vt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Vt.prototype.getIntersectionSegments=function(){return this._intSegments},Vt.prototype.count=function(){return this._intersectionCount},Vt.prototype.getIntersections=function(){return this._intersections},Vt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Vt.prototype.processIntersections=function(t,e,i,r){if(!this._findAllIntersections&&this.hasIntersection()||t===i&&e===r)return null;if(this._isCheckEndSegmentsOnly){var n=this.isEndSegment(t,e)||this.isEndSegment(i,r);if(!n)return null}var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=i.getCoordinates()[r],l=i.getCoordinates()[r+1];this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=f,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Vt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Vt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Vt.prototype.interfaces_=function(){return[gr]},Vt.prototype.getClass=function(){return Vt},Vt.createAllIntersectionsFinder=function(t){var e=new Vt(t);return e.setFindAllIntersections(!0),e},Vt.createAnyIntersectionFinder=function(t){return new Vt(t)},Vt.createIntersectionCounter=function(t){var e=new Vt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var je=function(){this._li=new fr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};je.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},je.prototype.getIntersections=function(){return this._segInt.getIntersections()},je.prototype.isValid=function(){return this.execute(),this._isValid},je.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},je.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Hn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},je.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Vi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},je.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Xe.toLineString(t[0],t[1])+" and "+Xe.toLineString(t[2],t[3])},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},je.computeIntersections=function(t){var e=new je(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var mr=function s(){this._nv=null;var t=arguments[0];this._nv=new je(s.toSegmentStrings(t))};mr.prototype.checkValid=function(){this._nv.checkValid()},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.toSegmentStrings=function(t){for(var e=new x,i=t.iterator();i.hasNext();){var r=i.next();e.add(new gi(r.getCoordinates(),r))}return e},mr.checkValid=function(t){var e=new mr(t);e.checkValid()};var Vr=function(t){this._mapOp=t};Vr.prototype.map=function(t){for(var e=this,i=new x,r=0;r<t.getNumGeometries();r++){var n=e._mapOp.map(t.getGeometryN(r));n.isEmpty()||i.add(n)}return t.getFactory().createGeometryCollection(tt.toGeometryArray(i))},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.map=function(t,e){var i=new Vr(e);return i.map(t)};var di=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new x,this._resultLineList=new x;var t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i};di.prototype.collectLines=function(t){for(var e=this,i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var r=i.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},di.prototype.labelIsolatedLine=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)},di.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},di.prototype.collectLineEdge=function(t,e,i){var r=t.getLabel(),n=t.getEdge();t.isLineEdge()&&!t.isVisited()&&K.isResultOfOp(r,e)&&!n.isCovered()&&(i.add(n),t.setVisitedEdge(!0))},di.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var i=e.next();i.getEdges().findCoveredLineEdges()}for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var n=r.next(),o=n.getEdge();if(n.isLineEdge()&&!o.isCoveredSet()){var f=t._op.isCoveredByA(n.getCoordinate());o.setCovered(f)}}},di.prototype.labelIsolatedLines=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next(),n=r.getLabel();r.isIsolated()&&(n.isNull(0)?e.labelIsolatedLine(r,0):e.labelIsolatedLine(r,1))}},di.prototype.buildLines=function(t){for(var e=this,i=this._lineEdgesList.iterator();i.hasNext();){var r=i.next(),n=e._geometryFactory.createLineString(r.getCoordinates());e._resultLineList.add(n),r.setInResult(!0)}},di.prototype.collectBoundaryTouchEdge=function(t,e,i){var r=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;j.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),K.isResultOfOp(r,e)&&e===K.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di};var Gr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new x;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Gr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var i=this._geometryFactory.createPoint(e);this._resultPointList.add(i)}},Gr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,i=this._op.getGraph().getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isInResult()&&!r.isIncidentEdgeInResult()&&(r.getEdges().getDegree()===0||t===K.INTERSECTION)){var n=r.getLabel();K.isResultOfOp(n,t)&&e.filterCoveredNodeToPoint(r)}}},Gr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr};var ge=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};ge.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},ge.prototype.transformPolygon=function(t,e){var i=this,r=!0,n=this.transformLinearRing(t.getExteriorRing(),t);(n===null||!(n instanceof Wi)||n.isEmpty())&&(r=!1);for(var o=new x,f=0;f<t.getNumInteriorRing();f++){var u=i.transformLinearRing(t.getInteriorRingN(f),t);u===null||u.isEmpty()||(u instanceof Wi||(r=!1),o.add(u))}if(r)return this._factory.createPolygon(n,o.toArray([]));var l=new x;return n!==null&&l.add(n),l.addAll(o),this._factory.buildGeometry(l)},ge.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},ge.prototype.getInputGeometry=function(){return this._inputGeom},ge.prototype.transformMultiLineString=function(t,e){for(var i=this,r=new x,n=0;n<t.getNumGeometries();n++){var o=i.transformLineString(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},ge.prototype.transformCoordinates=function(t,e){return this.copy(t)},ge.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},ge.prototype.transformMultiPoint=function(t,e){for(var i=this,r=new x,n=0;n<t.getNumGeometries();n++){var o=i.transformPoint(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},ge.prototype.transformMultiPolygon=function(t,e){for(var i=this,r=new x,n=0;n<t.getNumGeometries();n++){var o=i.transformPolygon(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},ge.prototype.copy=function(t){return t.copy()},ge.prototype.transformGeometryCollection=function(t,e){for(var i=this,r=new x,n=0;n<t.getNumGeometries();n++){var o=i.transform(t.getGeometryN(n));o!==null&&(i._pruneEmptyGeometry&&o.isEmpty()||r.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(tt.toGeometryArray(r)):this._factory.buildGeometry(r)},ge.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof me)return this.transformPoint(t,null);if(t instanceof is)return this.transformMultiPoint(t,null);if(t instanceof Wi)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof lr)return this.transformMultiLineString(t,null);if(t instanceof Bt)return this.transformPolygon(t,null);if(t instanceof Ti)return this.transformMultiPolygon(t,null);if(t instanceof te)return this.transformGeometryCollection(t,null);throw new vt("Unknown Geometry subtype: "+t.getClass().getName())},ge.prototype.transformLinearRing=function(t,e){var i=this.transformCoordinates(t.getCoordinateSequence(),t);if(i===null)return this._factory.createLinearRing(null);var r=i.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var Si=function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new G,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Wt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];s.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var i=arguments[0],r=arguments[1];this._srcPts=i,this._isClosed=s.isClosed(i),this._snapTolerance=r}};Si.prototype.snapVertices=function(t,e){for(var i=this,r=this._isClosed?t.size()-1:t.size(),n=0;n<r;n++){var o=t.get(n),f=i.findSnapForVertex(o,e);f!==null&&(t.set(n,new A(f)),n===0&&i._isClosed&&t.set(t.size()-1,new A(f)))}},Si.prototype.findSnapForVertex=function(t,e){for(var i=this,r=0;r<e.length;r++){if(t.equals2D(e[r]))return null;if(t.distance(e[r])<i._snapTolerance)return e[r]}return null},Si.prototype.snapTo=function(t){var e=new Ts(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var i=e.toCoordinateArray();return i},Si.prototype.snapSegments=function(t,e){var i=this;if(e.length===0)return null;var r=e.length;e[0].equals2D(e[e.length-1])&&(r=e.length-1);for(var n=0;n<r;n++){var o=e[n],f=i.findSegmentIndexToSnap(o,t);f>=0&&t.add(f+1,new A(o),!1)}},Si.prototype.findSegmentIndexToSnap=function(t,e){for(var i=this,r=Z.MAX_VALUE,n=-1,o=0;o<e.size()-1;o++){if(i._seg.p0=e.get(o),i._seg.p1=e.get(o+1),i._seg.p0.equals2D(t)||i._seg.p1.equals2D(t)){if(i._allowSnappingToSourceVertices)continue;return-1}var f=i._seg.distance(t);f<i._snapTolerance&&f<r&&(r=f,n=o)}return n},Si.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Et=function(t){this._srcGeom=t||null},$o={SNAP_PRECISION_FACTOR:{configurable:!0}};Et.prototype.snapTo=function(t,e){var i=this.extractTargetCoordinates(t),r=new ta(e,i);return r.transform(this._srcGeom)},Et.prototype.snapToSelf=function(t,e){var i=this.extractTargetCoordinates(this._srcGeom),r=new ta(t,i,!0),n=r.transform(this._srcGeom),o=n;return e&&U(o,Ki)&&(o=n.buffer(0)),o},Et.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),i=e/10;return i},Et.prototype.extractTargetCoordinates=function(t){for(var e=new ri,i=t.getCoordinates(),r=0;r<i.length;r++)e.add(i[r]);return e.toArray(new Array(0).fill(null))},Et.prototype.computeMinimumSegmentLength=function(t){for(var e=Z.MAX_VALUE,i=0;i<t.length-1;i++){var r=t[i].distance(t[i+1]);r<e&&(e=r)}return e},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.snap=function(t,e,i){var r=new Array(2).fill(null),n=new Et(t);r[0]=n.snapTo(e,i);var o=new Et(e);return r[1]=o.snapTo(r[0],i),r},Et.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Et.computeSizeBasedSnapTolerance(t),i=t.getPrecisionModel();if(i.getType()===ot.FIXED){var r=1/i.getScale()*2/1.415;r>e&&(e=r)}return e}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return Math.min(Et.computeOverlaySnapTolerance(n),Et.computeOverlaySnapTolerance(o))}},Et.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),i=Math.min(e.getHeight(),e.getWidth()),r=i*Et.SNAP_PRECISION_FACTOR;return r},Et.snapToSelf=function(t,e,i){var r=new Et(t);return r.snapToSelf(e,i)},$o.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Et,$o);var ta=function(s){function t(e,i,r){s.call(this),this._snapTolerance=e||null,this._snapPts=i||null,this._isSelfSnap=r!==void 0?r:!1}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(i,r){var n=new Si(i,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(r)},t.prototype.transformCoordinates=function(i,r){var n=i.toCoordinateArray(),o=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ge),oe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};oe.prototype.getCommon=function(){return Z.longBitsToDouble(this._commonBits)},oe.prototype.add=function(t){var e=Z.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=oe.signExpBits(this._commonBits),this._isFirst=!1,null;var i=oe.signExpBits(e);if(i!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=oe.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=oe.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},oe.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Z.longBitsToDouble(t),i=Z.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+i,n=r.substring(r.length-64),o=n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]";return o}},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.getBit=function(t,e){var i=1<<e;return t&i?1:0},oe.signExpBits=function(t){return t>>52},oe.zeroLowerBits=function(t,e){var i=(1<<e)-1,r=~i,n=t&r;return n},oe.numCommonMostSigMantissaBits=function(t,e){for(var i=0,r=52;r>=0;r--){if(oe.getBit(t,r)!==oe.getBit(e,r))return i;i++}return 52};var rr=function(){this._commonCoord=null,this._ccFilter=new Xr},$n={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};rr.prototype.addCommonBits=function(t){var e=new sr(this._commonCoord);t.apply(e),t.geometryChanged()},rr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new A(this._commonCoord);e.x=-e.x,e.y=-e.y;var i=new sr(e);return t.apply(i),t.geometryChanged(),t},rr.prototype.getCommonCoordinate=function(){return this._commonCoord},rr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},$n.CommonCoordinateFilter.get=function(){return Xr},$n.Translater.get=function(){return sr},Object.defineProperties(rr,$n);var Xr=function(){this._commonBitsX=new oe,this._commonBitsY=new oe};Xr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Xr.prototype.getCommonCoordinate=function(){return new A(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Xr.prototype.interfaces_=function(){return[Ci]},Xr.prototype.getClass=function(){return Xr};var sr=function(){this.trans=null;var t=arguments[0];this.trans=t};sr.prototype.filter=function(t,e){var i=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,r)},sr.prototype.isDone=function(){return!1},sr.prototype.isGeometryChanged=function(){return!0},sr.prototype.interfaces_=function(){return[Ue]},sr.prototype.getClass=function(){return sr};var Gt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Gt.prototype.selfSnap=function(t){var e=new Et(t),i=e.snapTo(t,this._snapTolerance);return i},Gt.prototype.removeCommonBits=function(t){this._cbr=new rr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Gt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Gt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),i=K.overlayOp(e[0],e[1],t);return this.prepareResult(i)},Gt.prototype.checkValid=function(t){t.isValid()||Xt.out.println("Snapped geometry is invalid")},Gt.prototype.computeSnapTolerance=function(){this._snapTolerance=Et.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Gt.prototype.snap=function(t){var e=this.removeCommonBits(t),i=Et.snap(e[0],e[1],this._snapTolerance);return i},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.overlayOp=function(t,e,i){var r=new Gt(t,e);return r.getResultGeometry(i)},Gt.union=function(t,e){return Gt.overlayOp(t,e,K.UNION)},Gt.intersection=function(t,e){return Gt.overlayOp(t,e,K.INTERSECTION)},Gt.symDifference=function(t,e){return Gt.overlayOp(t,e,K.SYMDIFFERENCE)},Gt.difference=function(t,e){return Gt.overlayOp(t,e,K.DIFFERENCE)};var ae=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ae.prototype.getResultGeometry=function(t){var e=null,i=!1,r=null;try{e=K.overlayOp(this._geom[0],this._geom[1],t);var n=!0;n&&(i=!0)}catch(o){if(o instanceof Bi)r=o;else throw o}finally{}if(!i)try{e=Gt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Bi?r:o}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,i){var r=new ae(t,e);return r.getResultGeometry(i)},ae.union=function(t,e){return ae.overlayOp(t,e,K.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,K.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,K.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,K.DIFFERENCE)};var Fs=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Fs.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Fs.prototype.interfaces_=function(){return[]},Fs.prototype.getClass=function(){return Fs};var We=function s(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=s.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var i=arguments[0],r=arguments[1],n=arguments[2];this._eventType=s.INSERT,this._label=i,this._xValue=r,this._obj=n}},to={INSERT:{configurable:!0},DELETE:{configurable:!0}};We.prototype.isDelete=function(){return this._eventType===We.DELETE},We.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},We.prototype.getObject=function(){return this._obj},We.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},We.prototype.getInsertEvent=function(){return this._insertEvent},We.prototype.isInsert=function(){return this._eventType===We.INSERT},We.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},We.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},We.prototype.interfaces_=function(){return[De]},We.prototype.getClass=function(){return We},to.INSERT.get=function(){return 1},to.DELETE.get=function(){return 2},Object.defineProperties(We,to);var cn=function(){};cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var Ht=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i};Ht.prototype.isTrivialIntersection=function(t,e,i,r){if(t===i&&this._li.getIntersectionNum()===1){if(Ht.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var n=t.getNumPoints()-1;if(e===0&&r===n||r===0&&e===n)return!0}}return!1},Ht.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ht.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Ht.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ht.prototype.isBoundaryPointInternal=function(t,e){for(var i=e.iterator();i.hasNext();){var r=i.next(),n=r.getCoordinate();if(t.isIntersection(n))return!0}return!1},Ht.prototype.hasProperIntersection=function(){return this._hasProper},Ht.prototype.hasIntersection=function(){return this._hasIntersection},Ht.prototype.isDone=function(){return this._isDone},Ht.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Ht.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Ht.prototype.addIntersections=function(t,e,i,r){if(t===i&&e===r)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=i.getCoordinates()[r],u=i.getCoordinates()[r+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),i.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Pf=function(s){function t(){s.call(this),this.events=new x,this.nOverlaps=null}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var i=this;Ze.sort(this.events);for(var r=0;r<this.events.size();r++){var n=i.events.get(r);n.isDelete()&&n.getInsertEvent().setDeleteEventIndex(r)}},t.prototype.computeIntersections=function(){var i=this;if(arguments.length===1){var r=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var n=0;n<this.events.size();n++){var o=i.events.get(n);if(o.isInsert()&&i.processOverlaps(n,o.getDeleteEventIndex(),o,r),r.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ht&&U(arguments[0],Ye)&&U(arguments[1],Ye)){var f=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(f,f),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&U(arguments[0],Ye)&&arguments[1]instanceof Ht){var a=arguments[0],c=arguments[1],p=arguments[2];p?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(c)}}},t.prototype.addEdge=function(i,r){for(var n=this,o=i.getMonotoneChainEdge(),f=o.getStartIndexes(),u=0;u<f.length-1;u++){var l=new Fs(o,u),a=new We(r,o.getMinX(u),l);n.events.add(a),n.events.add(new We(o.getMaxX(u),a))}},t.prototype.processOverlaps=function(i,r,n,o){for(var f=this,u=n.getObject(),l=i;l<r;l++){var a=f.events.get(l);if(a.isInsert()){var c=a.getObject();n.isSameLabel(a)||(u.computeIntersections(c,o),f.nOverlaps++)}}},t.prototype.addEdges=function(){var i=this;if(arguments.length===1)for(var r=arguments[0],n=r.iterator();n.hasNext();){var o=n.next();i.addEdge(o,o)}else if(arguments.length===2)for(var f=arguments[0],u=arguments[1],l=f.iterator();l.hasNext();){var a=l.next();i.addEdge(a,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(cn),Ni=function(){this._min=Z.POSITIVE_INFINITY,this._max=Z.NEGATIVE_INFINITY},ea={NodeComparator:{configurable:!0}};Ni.prototype.getMin=function(){return this._min},Ni.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Ni.prototype.getMax=function(){return this._max},Ni.prototype.toString=function(){return Xe.toLineString(new A(this._min,0),new A(this._max,0))},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},ea.NodeComparator.get=function(){return xs},Object.defineProperties(Ni,ea);var xs=function(){};xs.prototype.compare=function(t,e){var i=t,r=e,n=(i._min+i._max)/2,o=(r._min+r._max)/2;return n<o?-1:n>o?1:0},xs.prototype.interfaces_=function(){return[Ur]},xs.prototype.getClass=function(){return xs};var Sf=function(s){function t(){s.call(this),this._item=null;var e=arguments[0],i=arguments[1],r=arguments[2];this._min=e,this._max=i,this._item=r}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.query=function(i,r,n){if(!this.intersects(i,r))return null;n.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ni),Nf=function(s){function t(){s.call(this),this._node1=null,this._node2=null;var e=arguments[0],i=arguments[1];this._node1=e,this._node2=i,this.buildExtent(this._node1,this._node2)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(i,r){this._min=Math.min(i._min,r._min),this._max=Math.max(i._max,r._max)},t.prototype.query=function(i,r,n){if(!this.intersects(i,r))return null;this._node1!==null&&this._node1.query(i,r,n),this._node2!==null&&this._node2.query(i,r,n)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ni),bi=function(){this._leaves=new x,this._root=null,this._level=0};bi.prototype.buildTree=function(){var t=this;Ze.sort(this._leaves,new Ni.NodeComparator);for(var e=this._leaves,i=null,r=new x;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);i=e,e=r,r=i}},bi.prototype.insert=function(t,e,i){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Sf(t,e,i))},bi.prototype.query=function(t,e,i){this.init(),this._root.query(t,e,i)},bi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},bi.prototype.printNode=function(t){Xt.out.println(Xe.toLineString(new A(t._min,this._level),new A(t._max,this._level)))},bi.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},bi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var i=0;i<t.size();i+=2){var r=t.get(i),n=i+1<t.size()?t.get(i):null;if(n===null)e.add(r);else{var o=new Nf(t.get(i),t.get(i+1));e.add(o)}}},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var us=function(){this._items=new x};us.prototype.visitItem=function(t){this._items.add(t)},us.prototype.getItems=function(){return this._items},us.prototype.interfaces_=function(){return[ji]},us.prototype.getClass=function(){return us};var hs=function(){this._index=null;var t=arguments[0];if(!U(t,Ki))throw new vt("Argument must be Polygonal");this._index=new vr(t)},eo={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};hs.prototype.locate=function(t){var e=new ii(t),i=new ls(e);return this._index.query(t.y,t.y,i),e.getLocation()},hs.prototype.interfaces_=function(){return[os]},hs.prototype.getClass=function(){return hs},eo.SegmentVisitor.get=function(){return ls},eo.IntervalIndexedGeometry.get=function(){return vr},Object.defineProperties(hs,eo);var ls=function(){this._counter=null;var t=arguments[0];this._counter=t};ls.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},ls.prototype.interfaces_=function(){return[ji]},ls.prototype.getClass=function(){return ls};var vr=function(){this._index=new bi;var t=arguments[0];this.init(t)};vr.prototype.init=function(t){for(var e=this,i=Ut.getLines(t),r=i.iterator();r.hasNext();){var n=r.next(),o=n.getCoordinates();e.addLine(o)}},vr.prototype.addLine=function(t){for(var e=this,i=1;i<t.length;i++){var r=new G(t[i-1],t[i]),n=Math.min(r.p0.y,r.p1.y),o=Math.max(r.p0.y,r.p1.y);e._index.insert(n,o,r)}},vr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new us;return this._index.query(t,e,i),i.getItems()}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2];this._index.query(r,n,o)}},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var ks=function(s){function t(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new Oo,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ke,arguments.length===2){var e=arguments[0],i=arguments[1],r=Be.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=i,this._boundaryNodeRule=r,i!==null&&this.add(i)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];this._argIndex=n,this._parentGeom=o,this._boundaryNodeRule=f,o!==null&&this.add(o)}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(i,r){var n=this._nodes.addNode(r),o=n.getLabel(),f=1,u=E.NONE;u=o.getLocation(i,M.ON),u===E.BOUNDARY&&f++;var l=t.determineBoundary(this._boundaryNodeRule,f);o.setLocation(i,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.computeSelfNodes(i,r,!1)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2],u=new Ht(n,!0,!1);u.setIsDoneIfProperInt(f);var l=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Wi||this._parentGeom instanceof Bt||this._parentGeom instanceof Ti,c=o||!a;return l.computeIntersections(this._edges,u,c),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(i){for(var r=this._edges.iterator();r.hasNext();){var n=r.next();n.eiList.addSplitEdges(i)}},t.prototype.computeEdgeIntersections=function(i,r,n){var o=new Ht(r,n,!0);o.setBoundaryNodes(this.getBoundaryNodes(),i.getBoundaryNodes());var f=this.createEdgeSetIntersector();return f.computeIntersections(this._edges,i._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof me){var i=arguments[0],r=i.getCoordinate();this.insertPoint(this._argIndex,r,E.INTERIOR)}else if(arguments[0]instanceof A){var n=arguments[0];this.insertPoint(this._argIndex,n,E.INTERIOR)}},t.prototype.addPolygon=function(i){var r=this;this.addPolygonRing(i.getExteriorRing(),E.EXTERIOR,E.INTERIOR);for(var n=0;n<i.getNumInteriorRing();n++){var o=i.getInteriorRingN(n);r.addPolygonRing(o,E.INTERIOR,E.EXTERIOR)}},t.prototype.addEdge=function(i){this.insertEdge(i);var r=i.getCoordinates();this.insertPoint(this._argIndex,r[0],E.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],E.BOUNDARY)},t.prototype.addLineString=function(i){var r=$.removeRepeatedPoints(i.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var n=new ln(r,new ht(this._argIndex,E.INTERIOR));this._lineEdgeMap.put(i,n),this.insertEdge(n),j.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var i=this.getBoundaryNodes(),r=new Array(i.size()).fill(null),n=0,o=i.iterator();o.hasNext();){var f=o.next();r[n++]=f.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(i,r,n){if(this.isBoundaryNode(i,r))return null;n===E.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(i,r):this.insertPoint(i,r,n)},t.prototype.addPolygonRing=function(i,r,n){if(i.isEmpty())return null;var o=$.removeRepeatedPoints(i.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var f=r,u=n;k.isCCW(o)&&(f=n,u=r);var l=new ln(o,new ht(this._argIndex,E.BOUNDARY,f,u));this._lineEdgeMap.put(i,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],E.BOUNDARY)},t.prototype.insertPoint=function(i,r,n){var o=this._nodes.addNode(r),f=o.getLabel();f===null?o._label=new ht(i,n):f.setLocation(i,n)},t.prototype.createEdgeSetIntersector=function(){return new Pf},t.prototype.addSelfIntersectionNodes=function(i){for(var r=this,n=this._edges.iterator();n.hasNext();)for(var o=n.next(),f=o.getLabel().getLocation(i),u=o.eiList.iterator();u.hasNext();){var l=u.next();r.addSelfIntersectionNode(i,l.coord,f)}},t.prototype.add=function(){if(arguments.length===1){var i=arguments[0];if(i.isEmpty())return null;if(i instanceof Ti&&(this._useBoundaryDeterminationRule=!1),i instanceof Bt)this.addPolygon(i);else if(i instanceof Wt)this.addLineString(i);else if(i instanceof me)this.addPoint(i);else if(i instanceof is)this.addCollection(i);else if(i instanceof lr)this.addCollection(i);else if(i instanceof Ti)this.addCollection(i);else if(i instanceof te)this.addCollection(i);else throw new Error(i.getClass().getName())}else return s.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(i){for(var r=this,n=0;n<i.getNumGeometries();n++){var o=i.getGeometryN(n);r.add(o)}},t.prototype.locate=function(i){return U(this._parentGeom,Ki)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new hs(this._parentGeom)),this._areaPtLocator.locate(i)):this._ptLocator.locate(i,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var i=arguments[0];return this._lineEdgeMap.get(i)}else return s.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(i,r){return i.isInBoundary(r)?E.BOUNDARY:E.INTERIOR},t}(Ct),cs=function(){if(this._li=new fr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new ks(0,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=Be.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ks(0,e,r),this._arg[1]=new ks(1,i,r)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];n.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(n.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ks(0,n,f),this._arg[1]=new ks(1,o,f)}};cs.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},cs.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.map=function(){if(arguments[0]instanceof z&&U(arguments[1],_r.MapOp)){for(var t=arguments[0],e=arguments[1],i=new x,r=0;r<t.getNumGeometries();r++){var n=e.map(t.getGeometryN(r));n!==null&&i.add(n)}return t.getFactory().buildGeometry(i)}else if(U(arguments[0],Rt)&&U(arguments[1],_r.MapOp)){for(var o=arguments[0],f=arguments[1],u=new x,l=o.iterator();l.hasNext();){var a=l.next(),c=f.map(a);c!==null&&u.add(c)}return u}},_r.MapOp=function(){};var K=function(s){function t(){var e=arguments[0],i=arguments[1];s.call(this,e,i),this._ptLocator=new Ke,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new He,this._resultPolyList=new x,this._resultLineList=new x,this._resultPointList=new x,this._graph=new Ct(new qo),this._geomFact=e.getFactory()}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(i){var r=this._edgeList.findEqualEdge(i);if(r!==null){var n=r.getLabel(),o=i.getLabel();r.isPointwiseEqual(i)||(o=new ht(i.getLabel()),o.flip());var f=r.getDepth();f.isNull()&&f.add(n),f.add(o),n.merge(o)}else this._edgeList.add(i)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var r=i.next(),n=r.getSym();r.isInResult()&&n.isInResult()&&(r.setInResult(!1),n.setInResult(!1))}},t.prototype.isCoveredByLA=function(i){return!!(this.isCovered(i,this._resultLineList)||this.isCovered(i,this._resultPolyList))},t.prototype.computeGeometry=function(i,r,n,o){var f=new x;return f.addAll(i),f.addAll(r),f.addAll(n),f.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(f)},t.prototype.mergeSymLabels=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var r=i.next();r.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(i,r){for(var n=this,o=r.iterator();o.hasNext();){var f=o.next(),u=n._ptLocator.locate(i,f);if(u!==E.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var i=new x,r=this._edgeList.iterator();r.hasNext();){var n=r.next();n.isCollapsed()&&(r.remove(),i.add(n.getCollapsedEdge()))}this._edgeList.addAll(i)},t.prototype.updateNodeLabelling=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var r=i.next(),n=r.getEdges().getLabel();r.getLabel().merge(n)}},t.prototype.getResultGeometry=function(i){return this.computeOverlay(i),this._resultGeom},t.prototype.insertUniqueEdges=function(i){for(var r=this,n=i.iterator();n.hasNext();){var o=n.next();r.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(i){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var r=new x;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),mr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(i),this.cancelDuplicateResultEdges();var n=new ve(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var o=new di(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(i);var f=new Gr(this,this._geomFact,this._ptLocator);this._resultPointList=f.build(i),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,i)},t.prototype.labelIncompleteNode=function(i,r){var n=this._ptLocator.locate(i.getCoordinate(),this._arg[r].getGeometry());i.getLabel().setLocation(r,n)},t.prototype.copyPoints=function(i){for(var r=this,n=this._arg[i].getNodeIterator();n.hasNext();){var o=n.next(),f=r._graph.addNode(o.getCoordinate());f.setLabel(i,o.getLabel().getLocation(i))}},t.prototype.findResultAreaEdges=function(i){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var n=r.next(),o=n.getLabel();o.isArea()&&!n.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,M.RIGHT),o.getLocation(1,M.RIGHT),i)&&n.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var i=this._edgeList.iterator();i.hasNext();){var r=i.next(),n=r.getLabel(),o=r.getDepth();if(!o.isNull()){o.normalize();for(var f=0;f<2;f++)!n.isNull(f)&&n.isArea()&&!o.isNull(f)&&(o.getDelta(f)===0?n.toLine(f):(j.isTrue(!o.isNull(f,M.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(f,M.LEFT,o.getLocation(f,M.LEFT)),j.isTrue(!o.isNull(f,M.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(f,M.RIGHT,o.getLocation(f,M.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var i=this,r=this._graph.getNodes().iterator();r.hasNext();){var n=r.next();n.getEdges().computeLabelling(i._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var i=this,r=this._graph.getNodes().iterator();r.hasNext();){var n=r.next(),o=n.getLabel();n.isIsolated()&&(o.isNull(0)?i.labelIncompleteNode(n,0):i.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(i){return!!this.isCovered(i,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(cs);K.overlayOp=function(s,t,e){var i=new K(s,t),r=i.getResultGeometry(e);return r},K.intersection=function(s,t){if(s.isEmpty()||t.isEmpty())return K.createEmptyResult(K.INTERSECTION,s,t,s.getFactory());if(s.isGeometryCollection()){var e=t;return Vr.map(s,{interfaces_:function(){return[_r.MapOp]},map:function(i){return i.intersection(e)}})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,K.INTERSECTION)},K.symDifference=function(s,t){if(s.isEmpty()||t.isEmpty()){if(s.isEmpty()&&t.isEmpty())return K.createEmptyResult(K.SYMDIFFERENCE,s,t,s.getFactory());if(s.isEmpty())return t.copy();if(t.isEmpty())return s.copy()}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,K.SYMDIFFERENCE)},K.resultDimension=function(s,t,e){var i=t.getDimension(),r=e.getDimension(),n=-1;switch(s){case K.INTERSECTION:n=Math.min(i,r);break;case K.UNION:n=Math.max(i,r);break;case K.DIFFERENCE:n=i;break;case K.SYMDIFFERENCE:n=Math.max(i,r);break}return n},K.createEmptyResult=function(s,t,e,i){var r=null;switch(K.resultDimension(s,t,e)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon();break}return r},K.difference=function(s,t){return s.isEmpty()?K.createEmptyResult(K.DIFFERENCE,s,t,s.getFactory()):t.isEmpty()?s.copy():(s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,K.DIFFERENCE))},K.isResultOfOp=function(){if(arguments.length===2){var s=arguments[0],t=arguments[1],e=s.getLocation(0),i=s.getLocation(1);return K.isResultOfOp(e,i,t)}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2];switch(r===E.BOUNDARY&&(r=E.INTERIOR),n===E.BOUNDARY&&(n=E.INTERIOR),o){case K.INTERSECTION:return r===E.INTERIOR&&n===E.INTERIOR;case K.UNION:return r===E.INTERIOR||n===E.INTERIOR;case K.DIFFERENCE:return r===E.INTERIOR&&n!==E.INTERIOR;case K.SYMDIFFERENCE:return r===E.INTERIOR&&n!==E.INTERIOR||r!==E.INTERIOR&&n===E.INTERIOR}return!1}},K.INTERSECTION=1,K.UNION=2,K.DIFFERENCE=3,K.SYMDIFFERENCE=4;var nr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ke,this._seg=new G;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};nr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,i=0;i<this._linework.getNumGeometries();i++)for(var r=e._linework.getGeometryN(i),n=r.getCoordinateSequence(),o=0;o<n.size()-1;o++){n.getCoordinate(o,e._seg.p0),n.getCoordinate(o+1,e._seg.p1);var f=e._seg.distance(t);if(f<=e._boundaryDistanceTolerance)return!0}return!1},nr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?E.BOUNDARY:this._ptLocator.locate(t,this._g)},nr.prototype.extractLinework=function(t){var e=new ps;t.apply(e);var i=e.getLinework(),r=tt.toLineStringArray(i);return t.getFactory().createMultiLineString(r)},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr};var ps=function(){this._linework=null,this._linework=new x};ps.prototype.getLinework=function(){return this._linework},ps.prototype.filter=function(t){var e=this;if(t instanceof Bt){var i=t;this._linework.add(i.getExteriorRing());for(var r=0;r<i.getNumInteriorRing();r++)e._linework.add(i.getInteriorRingN(r))}},ps.prototype.interfaces_=function(){return[si]},ps.prototype.getClass=function(){return ps};var Cr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Cr.prototype.extractPoints=function(t,e,i){for(var r=this,n=t.getCoordinates(),o=0;o<n.length-1;o++)r.computeOffsetPoints(n[o],n[o+1],e,i)},Cr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Cr.prototype.getPoints=function(t){for(var e=this,i=new x,r=Ut.getLines(this._g),n=r.iterator();n.hasNext();){var o=n.next();e.extractPoints(o,t,i)}return i},Cr.prototype.computeOffsetPoints=function(t,e,i,r){var n=e.x-t.x,o=e.y-t.y,f=Math.sqrt(n*n+o*o),u=i*n/f,l=i*o/f,a=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var p=new A(a-l,c+u);r.add(p)}if(this._doRight){var d=new A(a+l,c-u);r.add(d)}},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var Pe=function s(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=s.TOLERANCE,this._testCoords=new x;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundaryDistanceTolerance=s.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,i],this._locFinder=[new nr(this._geom[0],this._boundaryDistanceTolerance),new nr(this._geom[1],this._boundaryDistanceTolerance),new nr(this._geom[2],this._boundaryDistanceTolerance)]},ia={TOLERANCE:{configurable:!0}};Pe.prototype.reportResult=function(t,e,i){Xt.out.println("Overlay result invalid - A:"+E.toLocationSymbol(e[0])+" B:"+E.toLocationSymbol(e[1])+" expected:"+(i?"i":"e")+" actual:"+E.toLocationSymbol(e[2]))},Pe.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Pe.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=0;i<this._testCoords.size();i++){var r=t._testCoords.get(i);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Pe.hasLocation(this._location,E.BOUNDARY)?!0:this.isValidResult(n,this._location)}},Pe.prototype.addTestPts=function(t){var e=new Cr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pe.prototype.isValidResult=function(t,e){var i=K.isResultOfOp(e[0],e[1],t),r=e[2]===E.INTERIOR,n=!(i^r);return n||this.reportResult(t,e,i),n},Pe.prototype.getInvalidLocation=function(){return this._invalidLocation},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.hasLocation=function(t,e){for(var i=0;i<3;i++)if(t[i]===e)return!0;return!1},Pe.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Et.computeSizeBasedSnapTolerance(t),Et.computeSizeBasedSnapTolerance(e))},Pe.isValid=function(t,e,i,r){var n=new Pe(t,e,r);return n.isValid(i)},ia.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pe,ia);var Se=function s(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(t),this._inputGeoms=t};Se.prototype.extractElements=function(t,e){var i=this;if(t===null)return null;for(var r=0;r<t.getNumGeometries();r++){var n=t.getGeometryN(r);i._skipEmpty&&n.isEmpty()||e.add(n)}},Se.prototype.combine=function(){for(var t=this,e=new x,i=this._inputGeoms.iterator();i.hasNext();){var r=i.next();t.extractElements(r,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Se(t);return e.combine()}else if(arguments.length===2){var i=arguments[0],r=arguments[1],n=new Se(Se.createList(i,r));return n.combine()}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2],l=new Se(Se.createList(o,f,u));return l.combine()}},Se.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Se.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new x;return i.add(t),i.add(e),i}else if(arguments.length===3){var r=arguments[0],n=arguments[1],o=arguments[2],f=new x;return f.add(r),f.add(n),f.add(o),f}};var Dt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new x)},ra={STRTREE_NODE_CAPACITY:{configurable:!0}};Dt.prototype.reduceToGeometries=function(t){for(var e=this,i=new x,r=t.iterator();r.hasNext();){var n=r.next(),o=null;U(n,Ye)?o=e.unionTree(n):n instanceof z&&(o=n),i.add(o)}return i},Dt.prototype.extractByEnvelope=function(t,e,i){for(var r=new x,n=0;n<e.getNumGeometries();n++){var o=e.getGeometryN(n);o.getEnvelopeInternal().intersects(t)?r.add(o):i.add(o)}return this._geomFactory.buildGeometry(r)},Dt.prototype.unionOptimized=function(t,e){var i=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!i.intersects(r)){var n=Se.combine(t,e);return n}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=i.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,o)},Dt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Vo(Dt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var r=t.itemsTree(),n=this.unionTree(r);return n},Dt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],i=arguments[1],r=arguments[2];if(r-i<=1){var n=Dt.getGeometry(e,i);return this.unionSafe(n,null)}else{if(r-i===2)return this.unionSafe(Dt.getGeometry(e,i),Dt.getGeometry(e,i+1));var o=Math.trunc((r+i)/2),f=this.binaryUnion(e,i,o),u=this.binaryUnion(e,o,r);return this.unionSafe(f,u)}}},Dt.prototype.repeatedUnion=function(t){for(var e=null,i=t.iterator();i.hasNext();){var r=i.next();e===null?e=r.copy():e=e.union(r)}return e},Dt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Dt.prototype.unionActual=function(t,e){return Dt.restrictToPolygons(t.union(e))},Dt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),i=this.binaryUnion(e);return i},Dt.prototype.unionUsingEnvelopeIntersection=function(t,e,i){var r=new x,n=this.extractByEnvelope(i,t,r),o=this.extractByEnvelope(i,e,r),f=this.unionActual(n,o);r.add(f);var u=Se.combine(r);return u},Dt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),i=e.buildGeometry(t),r=i.buffer(0);return r}else if(arguments.length===2){var n=arguments[0],o=arguments[1],f=n.getFactory(),u=f.createGeometryCollection([n,o]),l=u.buffer(0);return l}},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},Dt.restrictToPolygons=function(t){if(U(t,Ki))return t;var e=zi.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(tt.toPolygonArray(e))},Dt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Dt.union=function(t){var e=new Dt(t);return e.union()},ra.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Dt,ra);var pn=function(){};pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return K.createEmptyResult(K.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ae.overlayOp(t,e,K.UNION)};function Wr(){return new gn}function gn(){this.reset()}gn.prototype={constructor:gn,reset:function(){this.s=this.t=0},add:function(s){sa(dn,s,this.t),sa(this,dn.s,this.s),this.s?this.t+=dn.t:this.s=dn.t},valueOf:function(){return this.s}};var dn=new gn;function sa(s,t,e){var i=s.s=t+e,r=i-t,n=i-r;s.t=t-n+(e-r)}var It=1e-6,pt=Math.PI,Ui=pt/2,na=pt/4,qi=pt*2,Tr=180/pt,yi=pt/180,fe=Math.abs,bf=Math.atan,gs=Math.atan2,Ot=Math.cos,Ft=Math.sin,ds=Math.sqrt;function oa(s){return s>1?0:s<-1?pt:Math.acos(s)}function Yr(s){return s>1?Ui:s<-1?-Ui:Math.asin(s)}function Vs(){}function yn(s,t){s&&fa.hasOwnProperty(s.type)&&fa[s.type](s,t)}var aa={Feature:function(s,t){yn(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,i=-1,r=e.length;++i<r;)yn(e[i].geometry,t)}},fa={Sphere:function(s,t){t.sphere()},Point:function(s,t){s=s.coordinates,t.point(s[0],s[1],s[2])},MultiPoint:function(s,t){for(var e=s.coordinates,i=-1,r=e.length;++i<r;)s=e[i],t.point(s[0],s[1],s[2])},LineString:function(s,t){io(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,i=-1,r=e.length;++i<r;)io(e[i],t,0)},Polygon:function(s,t){ua(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,i=-1,r=e.length;++i<r;)ua(e[i],t)},GeometryCollection:function(s,t){for(var e=s.geometries,i=-1,r=e.length;++i<r;)yn(e[i],t)}};function io(s,t,e){var i=-1,r=s.length-e,n;for(t.lineStart();++i<r;)n=s[i],t.point(n[0],n[1],n[2]);t.lineEnd()}function ua(s,t){var e=-1,i=s.length;for(t.polygonStart();++e<i;)io(s[e],t,1);t.polygonEnd()}function Df(s,t){s&&aa.hasOwnProperty(s.type)?aa[s.type](s,t):yn(s,t)}Wr(),Wr();function ro(s){return[gs(s[1],s[0]),Yr(s[2])]}function ys(s){var t=s[0],e=s[1],i=Ot(e);return[i*Ot(t),i*Ft(t),Ft(e)]}function mn(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function vn(s,t){return[s[1]*t[2]-s[2]*t[1],s[2]*t[0]-s[0]*t[2],s[0]*t[1]-s[1]*t[0]]}function so(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function _n(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function no(s){var t=ds(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}Wr();function ha(s,t){function e(i,r){return i=s(i,r),t(i[0],i[1])}return s.invert&&t.invert&&(e.invert=function(i,r){return i=t.invert(i,r),i&&s.invert(i[0],i[1])}),e}function oo(s,t){return[s>pt?s-qi:s<-pt?s+qi:s,t]}oo.invert=oo;function Rf(s,t,e){return(s%=qi)?t||e?ha(ca(s),pa(t,e)):ca(s):t||e?pa(t,e):oo}function la(s){return function(t,e){return t+=s,[t>pt?t-qi:t<-pt?t+qi:t,e]}}function ca(s){var t=la(s);return t.invert=la(-s),t}function pa(s,t){var e=Ot(s),i=Ft(s),r=Ot(t),n=Ft(t);function o(f,u){var l=Ot(u),a=Ot(f)*l,c=Ft(f)*l,p=Ft(u),d=p*e+a*i;return[gs(c*r-d*n,a*e-p*i),Yr(d*r+c*n)]}return o.invert=function(f,u){var l=Ot(u),a=Ot(f)*l,c=Ft(f)*l,p=Ft(u),d=p*r-c*n;return[gs(c*r+p*n,a*e+d*i),Yr(d*e-a*i)]},o}function Bf(s,t,e,i,r,n){if(e){var o=Ot(t),f=Ft(t),u=i*e;r==null?(r=t+i*qi,n=t-u/2):(r=ga(o,r),n=ga(o,n),(i>0?r<n:r>n)&&(r+=i*qi));for(var l,a=r;i>0?a>n:a<n;a-=u)l=ro([o,-f*Ot(a),-f*Ft(a)]),s.point(l[0],l[1])}}function ga(s,t){t=ys(t),t[0]-=s,no(t);var e=oa(-t[1]);return((-t[2]<0?-e:e)+qi-It)%qi}function da(){var s=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){s.push(t=[])},lineEnd:Vs,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function Mf(s,t,e,i,r,n){var o=s[0],f=s[1],u=t[0],l=t[1],a=0,c=1,p=u-o,d=l-f,h;if(h=e-o,!(!p&&h>0)){if(h/=p,p<0){if(h<a)return;h<c&&(c=h)}else if(p>0){if(h>c)return;h>a&&(a=h)}if(h=r-o,!(!p&&h<0)){if(h/=p,p<0){if(h>c)return;h>a&&(a=h)}else if(p>0){if(h<a)return;h<c&&(c=h)}if(h=i-f,!(!d&&h>0)){if(h/=d,d<0){if(h<a)return;h<c&&(c=h)}else if(d>0){if(h>c)return;h>a&&(a=h)}if(h=n-f,!(!d&&h<0)){if(h/=d,d<0){if(h>c)return;h>a&&(a=h)}else if(d>0){if(h<a)return;h<c&&(c=h)}return a>0&&(s[0]=o+a*p,s[1]=f+a*d),c<1&&(t[0]=o+c*p,t[1]=f+c*d),!0}}}}}function Cn(s,t){return fe(s[0]-t[0])<It&&fe(s[1]-t[1])<It}function Wn(s,t,e,i){this.x=s,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function ya(s,t,e,i,r){var n=[],o=[],f,u;if(s.forEach(function(h){if(!((v=h.length-1)<=0)){var v,C=h[0],W=h[v],_;if(Cn(C,W)){for(r.lineStart(),f=0;f<v;++f)r.point((C=h[f])[0],C[1]);r.lineEnd();return}n.push(_=new Wn(C,h,null,!0)),o.push(_.o=new Wn(C,null,_,!1)),n.push(_=new Wn(W,h,null,!1)),o.push(_.o=new Wn(W,null,_,!0))}}),!!n.length){for(o.sort(t),ma(n),ma(o),f=0,u=o.length;f<u;++f)o[f].e=e=!e;for(var l=n[0],a,c;;){for(var p=l,d=!0;p.v;)if((p=p.n)===l)return;a=p.z,r.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(f=0,u=a.length;f<u;++f)r.point((c=a[f])[0],c[1]);else i(p.x,p.n.x,1,r);p=p.n}else{if(d)for(a=p.p.z,f=a.length-1;f>=0;--f)r.point((c=a[f])[0],c[1]);else i(p.x,p.p.x,-1,r);p=p.p}p=p.o,a=p.z,d=!d}while(!p.v);r.lineEnd()}}}function ma(s){if(t=s.length){for(var t,e=0,i=s[0],r;++e<t;)i.n=r=s[e],r.p=i,i=r;i.n=r=s[0],r.p=i}}function va(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function Of(s){return s.length===1&&(s=Ff(s)),{left:function(t,e,i,r){for(i==null&&(i=0),r==null&&(r=t.length);i<r;){var n=i+r>>>1;s(t[n],e)<0?i=n+1:r=n}return i},right:function(t,e,i,r){for(i==null&&(i=0),r==null&&(r=t.length);i<r;){var n=i+r>>>1;s(t[n],e)>0?r=n:i=n+1}return i}}}function Ff(s){return function(t,e){return va(s(t),e)}}Of(va);function _a(s){for(var t=s.length,e,i=-1,r=0,n,o;++i<t;)r+=s[i].length;for(n=new Array(r);--t>=0;)for(o=s[t],e=o.length;--e>=0;)n[--r]=o[e];return n}var Gs=1e9,Tn=-Gs;function xf(s,t,e,i){function r(l,a){return s<=l&&l<=e&&t<=a&&a<=i}function n(l,a,c,p){var d=0,h=0;if(l==null||(d=o(l,c))!==(h=o(a,c))||u(l,a)<0^c>0)do p.point(d===0||d===3?s:e,d>1?i:t);while((d=(d+c+4)%4)!==h);else p.point(a[0],a[1])}function o(l,a){return fe(l[0]-s)<It?a>0?0:3:fe(l[0]-e)<It?a>0?2:1:fe(l[1]-t)<It?a>0?1:0:a>0?3:2}function f(l,a){return u(l.x,a.x)}function u(l,a){var c=o(l,1),p=o(a,1);return c!==p?c-p:c===0?a[1]-l[1]:c===1?l[0]-a[0]:c===2?l[1]-a[1]:a[0]-l[0]}return function(l){var a=l,c=da(),p,d,h,v,C,W,_,T,L,P,b,D={point:R,lineStart:q,lineEnd:H,polygonStart:X,polygonEnd:O};function R(Y,J){r(Y,J)&&a.point(Y,J)}function B(){for(var Y=0,J=0,rt=d.length;J<rt;++J)for(var ut=d[J],st=1,Qe=ut.length,de=ut[0],Di,lt,Pt=de[0],xt=de[1];st<Qe;++st)Di=Pt,lt=xt,de=ut[st],Pt=de[0],xt=de[1],lt<=i?xt>i&&(Pt-Di)*(i-lt)>(xt-lt)*(s-Di)&&++Y:xt<=i&&(Pt-Di)*(i-lt)<(xt-lt)*(s-Di)&&--Y;return Y}function X(){a=c,p=[],d=[],b=!0}function O(){var Y=B(),J=b&&Y,rt=(p=_a(p)).length;(J||rt)&&(l.polygonStart(),J&&(l.lineStart(),n(null,null,1,l),l.lineEnd()),rt&&ya(p,f,Y,n,l),l.polygonEnd()),a=l,p=d=h=null}function q(){D.point=F,d&&d.push(h=[]),P=!0,L=!1,_=T=NaN}function H(){p&&(F(v,C),W&&L&&c.rejoin(),p.push(c.result())),D.point=R,L&&a.lineEnd()}function F(Y,J){var rt=r(Y,J);if(d&&h.push([Y,J]),P)v=Y,C=J,W=rt,P=!1,rt&&(a.lineStart(),a.point(Y,J));else if(rt&&L)a.point(Y,J);else{var ut=[_=Math.max(Tn,Math.min(Gs,_)),T=Math.max(Tn,Math.min(Gs,T))],st=[Y=Math.max(Tn,Math.min(Gs,Y)),J=Math.max(Tn,Math.min(Gs,J))];Mf(ut,st,s,t,e,i)?(L||(a.lineStart(),a.point(ut[0],ut[1])),a.point(st[0],st[1]),rt||a.lineEnd(),b=!1):rt&&(a.lineStart(),a.point(Y,J),b=!1)}_=Y,T=J,L=rt}return D}}var ao=Wr();function kf(s,t){var e=t[0],i=t[1],r=[Ft(e),-Ot(e),0],n=0,o=0;ao.reset();for(var f=0,u=s.length;f<u;++f)if(a=(l=s[f]).length)for(var l,a,c=l[a-1],p=c[0],d=c[1]/2+na,h=Ft(d),v=Ot(d),C=0;C<a;++C,p=_,h=L,v=P,c=W){var W=l[C],_=W[0],T=W[1]/2+na,L=Ft(T),P=Ot(T),b=_-p,D=b>=0?1:-1,R=D*b,B=R>pt,X=h*L;if(ao.add(gs(X*D*Ft(R),v*P+X*Ot(R))),n+=B?b+D*qi:b,B^p>=e^_>=e){var O=vn(ys(c),ys(W));no(O);var q=vn(r,O);no(q);var H=(B^b>=0?-1:1)*Yr(q[2]);(i>H||i===H&&(O[0]||O[1]))&&(o+=B^b>=0?1:-1)}}return(n<-It||n<It&&ao<-It)^o&1}Wr();function Ca(s){return s}Wr(),Wr();var ms=1/0,In=ms,Xs=-ms,Ln=Xs,Wa={point:Vf,lineStart:Vs,lineEnd:Vs,polygonStart:Vs,polygonEnd:Vs,result:function(){var s=[[ms,In],[Xs,Ln]];return Xs=Ln=-(In=ms=1/0),s}};function Vf(s,t){s<ms&&(ms=s),s>Xs&&(Xs=s),t<In&&(In=t),t>Ln&&(Ln=t)}Wr();function Ta(s,t,e,i){return function(r,n){var o=t(n),f=r.invert(i[0],i[1]),u=da(),l=t(u),a=!1,c,p,d,h={point:v,lineStart:W,lineEnd:_,polygonStart:function(){h.point=T,h.lineStart=L,h.lineEnd=P,p=[],c=[]},polygonEnd:function(){h.point=v,h.lineStart=W,h.lineEnd=_,p=_a(p);var b=kf(c,f);p.length?(a||(n.polygonStart(),a=!0),ya(p,Xf,b,e,n)):b&&(a||(n.polygonStart(),a=!0),n.lineStart(),e(null,null,1,n),n.lineEnd()),a&&(n.polygonEnd(),a=!1),p=c=null},sphere:function(){n.polygonStart(),n.lineStart(),e(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function v(b,D){var R=r(b,D);s(b=R[0],D=R[1])&&n.point(b,D)}function C(b,D){var R=r(b,D);o.point(R[0],R[1])}function W(){h.point=C,o.lineStart()}function _(){h.point=v,o.lineEnd()}function T(b,D){d.push([b,D]);var R=r(b,D);l.point(R[0],R[1])}function L(){l.lineStart(),d=[]}function P(){T(d[0][0],d[0][1]),l.lineEnd();var b=l.clean(),D=u.result(),R,B=D.length,X,O,q;if(d.pop(),c.push(d),d=null,!!B){if(b&1){if(O=D[0],(X=O.length-1)>0){for(a||(n.polygonStart(),a=!0),n.lineStart(),R=0;R<X;++R)n.point((q=O[R])[0],q[1]);n.lineEnd()}return}B>1&&b&2&&D.push(D.pop().concat(D.shift())),p.push(D.filter(Gf))}}return h}}function Gf(s){return s.length>1}function Xf(s,t){return((s=s.x)[0]<0?s[1]-Ui-It:Ui-s[1])-((t=t.x)[0]<0?t[1]-Ui-It:Ui-t[1])}const Ia=Ta(function(){return!0},Yf,Uf,[-pt,-Ui]);function Yf(s){var t=NaN,e=NaN,i=NaN,r;return{lineStart:function(){s.lineStart(),r=1},point:function(n,o){var f=n>0?pt:-pt,u=fe(n-t);fe(u-pt)<It?(s.point(t,e=(e+o)/2>0?Ui:-Ui),s.point(i,e),s.lineEnd(),s.lineStart(),s.point(f,e),s.point(n,e),r=0):i!==f&&u>=pt&&(fe(t-i)<It&&(t-=i*It),fe(n-f)<It&&(n-=f*It),e=zf(t,e,n,o),s.point(i,e),s.lineEnd(),s.lineStart(),s.point(f,e),r=0),s.point(t=n,e=o),i=f},lineEnd:function(){s.lineEnd(),t=e=NaN},clean:function(){return 2-r}}}function zf(s,t,e,i){var r,n,o=Ft(s-e);return fe(o)>It?bf((Ft(t)*(n=Ot(i))*Ft(e)-Ft(i)*(r=Ot(t))*Ft(s))/(r*n*o)):(t+i)/2}function Uf(s,t,e,i){var r;if(s==null)r=e*Ui,i.point(-pt,r),i.point(0,r),i.point(pt,r),i.point(pt,0),i.point(pt,-r),i.point(0,-r),i.point(-pt,-r),i.point(-pt,0),i.point(-pt,r);else if(fe(s[0]-t[0])>It){var n=s[0]<t[0]?pt:-pt;r=e*n/2,i.point(-n,r),i.point(0,r),i.point(n,r)}else i.point(t[0],t[1])}function qf(s,t){var e=Ot(s),i=e>0,r=fe(e)>It;function n(a,c,p,d){Bf(d,s,t,p,a,c)}function o(a,c){return Ot(a)*Ot(c)>e}function f(a){var c,p,d,h,v;return{lineStart:function(){h=d=!1,v=1},point:function(C,W){var _=[C,W],T,L=o(C,W),P=i?L?0:l(C,W):L?l(C+(C<0?pt:-pt),W):0;if(!c&&(h=d=L)&&a.lineStart(),L!==d&&(T=u(c,_),(!T||Cn(c,T)||Cn(_,T))&&(_[0]+=It,_[1]+=It,L=o(_[0],_[1]))),L!==d)v=0,L?(a.lineStart(),T=u(_,c),a.point(T[0],T[1])):(T=u(c,_),a.point(T[0],T[1]),a.lineEnd()),c=T;else if(r&&c&&i^L){var b;!(P&p)&&(b=u(_,c,!0))&&(v=0,i?(a.lineStart(),a.point(b[0][0],b[0][1]),a.point(b[1][0],b[1][1]),a.lineEnd()):(a.point(b[1][0],b[1][1]),a.lineEnd(),a.lineStart(),a.point(b[0][0],b[0][1])))}L&&(!c||!Cn(c,_))&&a.point(_[0],_[1]),c=_,d=L,p=P},lineEnd:function(){d&&a.lineEnd(),c=null},clean:function(){return v|(h&&d)<<1}}}function u(a,c,p){var d=ys(a),h=ys(c),v=[1,0,0],C=vn(d,h),W=mn(C,C),_=C[0],T=W-_*_;if(!T)return!p&&a;var L=e*W/T,P=-e*_/T,b=vn(v,C),D=_n(v,L),R=_n(C,P);so(D,R);var B=b,X=mn(D,B),O=mn(B,B),q=X*X-O*(mn(D,D)-1);if(!(q<0)){var H=ds(q),F=_n(B,(-X-H)/O);if(so(F,D),F=ro(F),!p)return F;var Y=a[0],J=c[0],rt=a[1],ut=c[1],st;J<Y&&(st=Y,Y=J,J=st);var Qe=J-Y,de=fe(Qe-pt)<It,Di=de||Qe<It;if(!de&&ut<rt&&(st=rt,rt=ut,ut=st),Di?de?rt+ut>0^F[1]<(fe(F[0]-Y)<It?rt:ut):rt<=F[1]&&F[1]<=ut:Qe>pt^(Y<=F[0]&&F[0]<=J)){var lt=_n(B,(-X+H)/O);return so(lt,D),[F,ro(lt)]}}}function l(a,c){var p=i?s:pt-s,d=0;return a<-p?d|=1:a>p&&(d|=2),c<-p?d|=4:c>p&&(d|=8),d}return Ta(o,f,n,i?[0,-s]:[-pt,s-pt])}function La(s){return function(t){var e=new fo;for(var i in s)e[i]=s[i];return e.stream=t,e}}function fo(){}fo.prototype={constructor:fo,point:function(s,t){this.stream.point(s,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Aa(s,t,e){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],n=s.clipExtent&&s.clipExtent();s.scale(150).translate([0,0]),n!=null&&s.clipExtent(null),Df(e,s.stream(Wa));var o=Wa.result(),f=Math.min(i/(o[1][0]-o[0][0]),r/(o[1][1]-o[0][1])),u=+t[0][0]+(i-f*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(r-f*(o[1][1]+o[0][1]))/2;return n!=null&&s.clipExtent(n),s.scale(f*150).translate([u,l])}function Zf(s,t,e){return Aa(s,[[0,0],t],e)}var wa=16,Hf=Ot(30*yi);function Ea(s,t){return+t?jf(s,t):Kf(s)}function Kf(s){return La({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function jf(s,t){function e(i,r,n,o,f,u,l,a,c,p,d,h,v,C){var W=l-i,_=a-r,T=W*W+_*_;if(T>4*t&&v--){var L=o+p,P=f+d,b=u+h,D=ds(L*L+P*P+b*b),R=Yr(b/=D),B=fe(fe(b)-1)<It||fe(n-c)<It?(n+c)/2:gs(P,L),X=s(B,R),O=X[0],q=X[1],H=O-i,F=q-r,Y=_*H-W*F;(Y*Y/T>t||fe((W*H+_*F)/T-.5)>.3||o*p+f*d+u*h<Hf)&&(e(i,r,n,o,f,u,O,q,B,L/=D,P/=D,b,v,C),C.point(O,q),e(O,q,B,L,P,b,l,a,c,p,d,h,v,C))}}return function(i){var r,n,o,f,u,l,a,c,p,d,h,v,C={point:W,lineStart:_,lineEnd:L,polygonStart:function(){i.polygonStart(),C.lineStart=P},polygonEnd:function(){i.polygonEnd(),C.lineStart=_}};function W(R,B){R=s(R,B),i.point(R[0],R[1])}function _(){c=NaN,C.point=T,i.lineStart()}function T(R,B){var X=ys([R,B]),O=s(R,B);e(c,p,a,d,h,v,c=O[0],p=O[1],a=R,d=X[0],h=X[1],v=X[2],wa,i),i.point(c,p)}function L(){C.point=W,i.lineEnd()}function P(){_(),C.point=b,C.lineEnd=D}function b(R,B){T(r=R,B),n=c,o=p,f=d,u=h,l=v,C.point=T}function D(){e(c,p,a,d,h,v,n,o,r,f,u,l,wa,i),C.lineEnd=L,L()}return C}}var Jf=La({point:function(s,t){this.stream.point(s*yi,t*yi)}});function Qf(s){return $f(function(){return s})()}function $f(s){var t,e=150,i=480,r=250,n,o,f=0,u=0,l=0,a=0,c=0,p,d,h=null,v=Ia,C=null,W,_,T,L=Ca,P=.5,b=Ea(O,P),D,R;function B(F){return F=d(F[0]*yi,F[1]*yi),[F[0]*e+n,o-F[1]*e]}function X(F){return F=d.invert((F[0]-n)/e,(o-F[1])/e),F&&[F[0]*Tr,F[1]*Tr]}function O(F,Y){return F=t(F,Y),[F[0]*e+n,o-F[1]*e]}B.stream=function(F){return D&&R===F?D:D=Jf(v(p,b(L(R=F))))},B.clipAngle=function(F){return arguments.length?(v=+F?qf(h=F*yi,6*yi):(h=null,Ia),H()):h*Tr},B.clipExtent=function(F){return arguments.length?(L=F==null?(C=W=_=T=null,Ca):xf(C=+F[0][0],W=+F[0][1],_=+F[1][0],T=+F[1][1]),H()):C==null?null:[[C,W],[_,T]]},B.scale=function(F){return arguments.length?(e=+F,q()):e},B.translate=function(F){return arguments.length?(i=+F[0],r=+F[1],q()):[i,r]},B.center=function(F){return arguments.length?(f=F[0]%360*yi,u=F[1]%360*yi,q()):[f*Tr,u*Tr]},B.rotate=function(F){return arguments.length?(l=F[0]%360*yi,a=F[1]%360*yi,c=F.length>2?F[2]%360*yi:0,q()):[l*Tr,a*Tr,c*Tr]},B.precision=function(F){return arguments.length?(b=Ea(O,P=F*F),H()):ds(P)},B.fitExtent=function(F,Y){return Aa(B,F,Y)},B.fitSize=function(F,Y){return Zf(B,F,Y)};function q(){d=ha(p=Rf(l,a,c),t);var F=t(f,u);return n=i-F[0]*e,o=r+F[1]*e,H()}function H(){return D=R=null,B}return function(){return t=s.apply(this,arguments),B.invert=t.invert&&X,q()}}function Pa(s){return function(t,e){var i=Ot(t),r=Ot(e),n=s(i*r);return[n*r*Ft(t),n*Ft(e)]}}function Sa(s){return function(t,e){var i=ds(t*t+e*e),r=s(i),n=Ft(r),o=Ot(r);return[gs(t*n,i*o),Yr(i&&e*n/i)]}}var tu=Pa(function(s){return ds(2/(1+s))});tu.invert=Sa(function(s){return 2*Yr(s/2)});var Na=Pa(function(s){return(s=oa(s))&&s/Ft(s)});Na.invert=Sa(function(s){return s});function eu(){return Qf(Na).scale(79.4188).clipAngle(180-.001)}function ba(s,t){return[s,t]}ba.invert=ba;function iu(s,t,e){e=e||{};var i=e.units||"kilometers",r=e.steps||8;if(!s)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof r!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var n=[];switch(s.type){case"GeometryCollection":return Dn(s,function(o){var f=An(o,t,i,r);f&&n.push(f)}),Us(n);case"FeatureCollection":return bn(s,function(o){var f=An(o,t,i,r);f&&bn(f,function(u){u&&n.push(u)})}),Us(n)}return An(s,t,i,r)}function An(s,t,e,i){var r=s.properties||{},n=s.type==="Feature"?s.geometry:s;if(n.type==="GeometryCollection"){var o=[];return Dn(s,function(v){var C=An(v,t,e,i);C&&o.push(C)}),Us(o)}var f=ru(n),u={type:n.type,coordinates:Ra(n.coordinates,f)},l=new qn,a=l.read(u),c=Sn(qs(t,e),"meters"),p=zt.bufferOp(a,c,i),d=new xo;if(p=d.write(p),!Da(p.coordinates)){var h={type:p.type,coordinates:Ba(p.coordinates,f)};return ar(h,r)}}function Da(s){return Array.isArray(s[0])?Da(s[0]):isNaN(s[0])}function Ra(s,t){return typeof s[0]!="object"?t(s):s.map(function(e){return Ra(e,t)})}function Ba(s,t){return typeof s[0]!="object"?t.invert(s):s.map(function(e){return Ba(e,t)})}function ru(s){var t=tf(s).geometry.coordinates,e=[-t[0],-t[1]];return eu().rotate(e).scale(ye)}class su{constructor(){I(this,"LineID","myEntity1");I(this,"Tag","");I(this,"towers",[]);I(this,"ISPhaseSequence",!1);I(this,"Wairnum",0);I(this,"Type",0);I(this,"Trees",[]);I(this,"wireAColor","#FFFFFF");I(this,"wireBColor","#FFFFFF");I(this,"wireCColor","#FFFFFF");I(this,"wireTColor","#FFFFFF");I(this,"wireD1Color","#FFFFFF");I(this,"wireD2Color","#FFFFFF");I(this,"wireWidth",1);I(this,"LineDistanceDisplaymin",0);I(this,"LineDistanceDisplaymax",5e3)}}class nu{constructor(){I(this,"id","");I(this,"modelid","");I(this,"lon",0);I(this,"lat",0);I(this,"alt",0);I(this,"treeH",0);I(this,"modelurl","");I(this,"treeScale",1)}}class ou{constructor(){I(this,"id","");I(this,"name","");I(this,"type",0);I(this,"Longitude",0);I(this,"Latitude",0);I(this,"Altitude",0);I(this,"RollX",0);I(this,"RollY",90);I(this,"RollZ",0);I(this,"towerScale",1);I(this,"towerHeight",0);I(this,"towerModelUri","");I(this,"towerPoint",[]);I(this,"Insulators",[]);I(this,"DistanceDisplaymin",0);I(this,"DistanceDisplaymax",1e3)}}class au{constructor(){I(this,"treeId",0);I(this,"treeCoordinates",[0,0,0]);I(this,"conductorCoordinates",[0,0,0]);I(this,"horizontalDistance",0);I(this,"verticalDistance",0);I(this,"straightLineDistance",0);I(this,"timestamp",0)}}class fu{constructor(){I(this,"id","");I(this,"name","");I(this,"type",0);I(this,"WairFX","进");I(this,"linenum",1);I(this,"Wairnum",0);I(this,"PhaseSequence",0);I(this,"RollX",0);I(this,"RollY",0);I(this,"RollZ",0);I(this,"InsulatorScale",1);I(this,"InsulatorLength",0);I(this,"InsulatorModelUri","");I(this,"InsulatorPoint",[]);I(this,"DistanceDisplaymin",0);I(this,"DistanceDisplaymax",500)}}class uu{constructor(){I(this,"name","");I(this,"X",-45);I(this,"Y",90);I(this,"Z",0)}}var Te=(s=>(s[s.A相=0]="A相",s[s.B相=1]="B相",s[s.C相=2]="C相",s[s.地线1=3]="地线1",s[s.地线2=4]="地线2",s))(Te||{}),mi=(s=>(s[s.直线塔=0]="直线塔",s[s.耐张塔=1]="耐张塔",s[s.门架塔=2]="门架塔",s[s.换位塔=3]="换位塔",s))(mi||{}),Ma=(s=>(s[s.交流单回路=0]="交流单回路",s[s.交流双回路=1]="交流双回路",s[s.直流单回路=2]="直流单回路",s[s.直流双回路=3]="直流双回路",s[s.交流四回路=4]="交流四回路",s))(Ma||{}),Ys=(s=>(s[s.地线=0]="地线",s[s.回路一=1]="回路一",s[s.回路二=2]="回路二",s[s.回路三=3]="回路三",s[s.回路四=4]="回路四",s))(Ys||{}),Kt=(s=>(s[s.悬垂串=0]="悬垂串",s[s.耐张串=1]="耐张串",s[s.跳线串=2]="跳线串",s[s.硬跳串=3]="硬跳串",s[s.V串=4]="V串",s[s.地线串=5]="地线串",s[s.绕跳临时=6]="绕跳临时",s))(Kt||{}),w=(s=>(s[s.单分裂=0]="单分裂",s[s.双分裂=1]="双分裂",s[s.四分裂=2]="四分裂",s[s.六分裂=3]="六分裂",s[s.八分裂=4]="八分裂",s))(w||{}),Q=(s=>(s[s.直线距离=0]="直线距离",s[s.水平距离=1]="水平距离",s[s.对地距离=2]="对地距离",s[s.净空距离=3]="净空距离",s[s.安全距离=4]="安全距离",s[s.全部测量=5]="全部测量",s))(Q||{});class Oa{constructor(){I(this,"horizontalLevels");I(this,"verticalLevels");I(this,"straightLineLevels");I(this,"clearanceLevels")}}const Je={units:"kilometers"};function wn(s,t,e,i){const r=uo(s,t),n=uo(s,e),o=uo(s,i),f=Math.min(r,n,o);return f===r?t:f===n?e:i}function uo(s,t){if(!t||t.length===0)return console.log("fastPointToLineDistance: line is empty or null"),1/0;let e=1/0;for(let r=0;r<t.length;r++){const n=t[r],o=s[0]-n[0],f=s[1]-n[1],u=o*o+f*f;u<e&&(e=u)}const i=Math.sqrt(e);return console.log(`fastPointToLineDistance result: ${i}`),i}const hu={horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}]},Ir=(s,t,e,i=hu,r=Q.全部测量)=>{const n=be(s.slice(0,2)),{nearestCoord:o}=xa(s,t),f=t.findIndex(lt=>lt[0]==o[0]&&lt[1]==o[1]);let u=[];if(f==0)u.push(t[0],t[1]);else if(f==t.length-1)u.push(t[t.length-2],t[t.length-1]);else{const lt=[t[f],t[f+1]],Pt=[t[f-1],t[f]];var l=Ar(n,ue(lt),Je),a=Ar(n,ue(Pt),Je);u=l>a?Pt:lt}console.log("附近的点",f,u);const c=ue([u[0].slice(0,2),u[1].slice(0,2)]),p=be(u[0].slice(0,2)),d=be(u[1].slice(0,2));var h=Ar(n,c,Je),v=Zi(n,p,Je)||0,C=Math.sqrt(v*v-h*h)||0;let W=u[0].slice(0,2);C>0&&(W=Ao(c,0,C,Je).geometry.coordinates[1]);const _=Zi(p,d,Je),T=Math.abs(u[0][2]-u[1][2]),L=Math.min(u[0][2],u[1][2]),P=Math.max(u[0][2],u[1][2]),b=u[0][2]>u[1][2]?P-C/_*T:C/_*T+L;console.log("高度差>>>>",T),console.log("最小高度>>>>",L),console.log("最大高度>>>>",P);const D=b-s[2],R=h*1e3,B=Math.sqrt(R*R+D*D);console.log("水平距离>>>>",R),console.log("竖直距离>>>>",D),console.log("直线距离>>>>",B);let X="#eff819",O=g.Color.RED;const q=g.Cartesian3.fromDegrees(s[0],s[1],s[2]),H=g.Cartesian3.fromDegrees(W[0],W[1],s[2]),F=g.Cartesian3.fromDegrees(W[0],W[1],b);console.log(`坐标详情: 树木=[${s[0]}, ${s[1]}, ${s[2]}], 导线点=[${W[0]}, ${W[1]}, ${b}]`);var Y=$a(be([s[0],s[1]]),be([W[0],W[1]])).geometry.coordinates;const J=g.Cartesian3.fromDegrees(Y[0],Y[1],s[2]),rt=g.Cartesian3.fromDegrees(Y[0],Y[1],b-D/2),ut=g.Cartesian3.fromDegrees(W[0],W[1],b-D/2);if(i!==null){let lt;if((r==Q.水平距离||r==Q.全部测量)&&(i.horizontalLevels&&(lt=i.horizontalLevels.find(Pt=>R>=Pt.minDistance&&R<=Pt.maxDistance)),lt)){X=lt.color,O=g.Color.fromCssColorString(lt.color);const Pt={position:J,name:"水平距离",label:{text:`水平距离${R.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(X),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},xt=[];xt.push(q),xt.push(H);var st={polyline:{show:!0,positions:xt,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(Pt),e.add(st),r==Q.水平距离)return}if((r==Q.对地距离||r==Q.全部测量)&&(i.verticalLevels&&(lt=i.verticalLevels.find(Pt=>D>=Pt.minDistance&&D<=Pt.maxDistance)),lt)){X=lt.color,O=g.Color.fromCssColorString(lt.color);const Pt={position:ut,name:"竖直距离",label:{text:`竖直距离${D.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(X),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},xt=[];xt.push(H),xt.push(F);var Qe={polyline:{show:!0,positions:xt,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(Pt),e.add(Qe),r==Q.对地距离)return}if(r==Q.净空距离||r==Q.全部测量){let Pt=!1;if(i.clearanceLevels&&(lt=i.clearanceLevels.find(xt=>D>=xt.minDistance&&D<=xt.maxDistance)),!lt&&r==Q.全部测量?(Pt=!0,X="#00ff00",O=g.Color.GREEN):lt&&(X=lt.color,O=g.Color.fromCssColorString(lt.color)),lt||Pt){const xt={position:ut,name:"净空距离",label:{text:`净空距离${D.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(X),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},po=[];po.push(H),po.push(F);var de={polyline:{show:!0,positions:po,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(de),r==Q.净空距离)return}}if((r==Q.直线距离||r==Q.全部测量)&&(i.straightLineLevels&&(lt=i.straightLineLevels.find(Pt=>B>=Pt.minDistance&&B<=Pt.maxDistance)),lt)){X=lt.color,O=g.Color.fromCssColorString(lt.color);const Pt={position:rt,name:"直线距离",label:{text:`直线距离${B.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(X),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},xt=[];xt.push(q),xt.push(F);var Di={polyline:{show:!0,positions:xt,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(Pt),e.add(Di),r==Q.直线距离)return}}console.log(`已添加测量结果: 距离=${B.toFixed(1)}m, 颜色=${X}, 实体数量=${e.values.length}`)},Fa=(s,t,e)=>{const i=be(s.slice(0,2)),{nearestCoord:r}=xa(s,t),n=t.findIndex(B=>B[0]==r[0]&&B[1]==r[1]);let o=[];if(n==0)o.push(t[0],t[1]);else if(n==t.length-1)o.push(t[t.length-2],t[t.length-1]);else{const B=[t[n],t[n+1]],X=[t[n-1],t[n]];var f=Ar(i,ue(B),Je),u=Ar(i,ue(X),Je);o=f>u?X:B}const l=ue([o[0].slice(0,2),o[1].slice(0,2)]),a=be(o[0].slice(0,2)),c=be(o[1].slice(0,2));var p=Ar(i,l,Je),d=Zi(i,a,Je)||0,h=Math.sqrt(d*d-p*p)||0;let v=o[0].slice(0,2);h>0&&(v=Ao(l,0,h,Je).geometry.coordinates[1]);const C=Zi(a,c,Je),W=Math.abs(o[0][2]-o[1][2]),_=Math.min(o[0][2],o[1][2]),T=Math.max(o[0][2],o[1][2]),L=o[0][2]>o[1][2]?T-h/C*W:h/C*W+_,P=L-s[2],b=p*1e3,D=Math.sqrt(b*b+P*P);return{treeId:e,treeCoordinates:[s[0],s[1],s[2]],conductorCoordinates:[v[0],v[1],L],horizontalDistance:parseFloat(b.toFixed(1)),verticalDistance:parseFloat(P.toFixed(1)),straightLineDistance:parseFloat(D.toFixed(1)),timestamp:Date.now()}};function xa(s,t){const e=be(s.slice(0,2)),i=[];t.forEach(f=>{i.push(be([f[0],f[1]]))});const r=Us(i),n=ef(e,r),o=Zi(e,n,Je);return{nearestCoord:n.geometry.coordinates,nearestDistance:o}}function N(s,t,e,i,r){e||(e=new g.HeadingPitchRoll);const n=g.Transforms.headingPitchRollQuaternion(s,e,i,r),o=g.Matrix4.fromRotationTranslation(g.Matrix3.fromQuaternion(n,new g.Matrix3),s,new g.Matrix4);return g.Matrix4.multiplyByPoint(o,t,new g.Cartesian3)}function Ne(s,t){var e=s.cartesianToCartographic(t),i=g.Math.toDegrees(e.latitude),r=g.Math.toDegrees(e.longitude),n=e.height;return[r,i,n]}function or(s,t,e,i){const r=t*Math.PI/180,n=s*Math.PI/180,o=i*Math.PI/180,f=e*Math.PI/180,u=Math.sin(f-n)*Math.cos(o),l=Math.cos(r)*Math.sin(o)-Math.sin(r)*Math.cos(o)*Math.cos(f-n);let a=Math.atan2(u,l)*180/Math.PI;return a=(a+360)%360,a}function m(s,t=6){const e=[];for(var i=0;i<s.length-1;i++)e.push(...lu(s[i],s[i+1],t*-1e3,100));return e}function lu(s,t,e,i){var r=[],n=g.Cartographic.fromCartesian(s),o=g.Cartographic.fromCartesian(t),f=n.longitude*180/Math.PI,u=n.latitude*180/Math.PI,l=o.longitude*180/Math.PI,a=o.latitude*180/Math.PI,c=Math.sqrt((f-l)*(f-l)+(u-a)*(u-a)),p=c*e,d=g.Cartesian3.clone(s),h=g.Cartesian3.clone(t),v=g.Cartesian3.distance(d,g.Cartesian3.ZERO),C=g.Cartesian3.distance(h,g.Cartesian3.ZERO);if(g.Cartesian3.normalize(d,d),g.Cartesian3.normalize(h,h),g.Cartesian3.distance(d,h)==0)return r;var W=g.Cartesian3.angleBetween(d,h);r.push(s);for(var _=1;_<i-1;_++){var T=_*1/(i-1),L=1-T,P=Math.sin(L*W)/Math.sin(W),b=Math.sin(T*W)/Math.sin(W),D=g.Cartesian3.multiplyByScalar(d,P,new g.Cartesian3),R=g.Cartesian3.multiplyByScalar(h,b,new g.Cartesian3),B=g.Cartesian3.add(D,R,new g.Cartesian3),X=T*Math.PI,O=v*L+C*T+Math.sin(X)*p;B=g.Cartesian3.multiplyByScalar(B,O,B),r.push(B)}return r.push(t),r}function cu(s,t,e=30){const i=s.length;if(i<=2||t===0||t===i-1)return!1;const r=or(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let o=or(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude)-r;return o>180&&(o-=360),o<-180&&(o+=360),Math.abs(o)>=e}function ho(s,t,e=2){const i=s.length;if(i<=1)return 0;if(cu(s,t,15))return t<i-1?or(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude):or(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let r=Math.max(0,t-e),n=Math.min(i-1,t+e);if(n-r<1)return t===i-1?or(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude):or(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude);const o=[];for(let a=r;a<n;a++){const c=or(s[a].Longitude,s[a].Latitude,s[a+1].Longitude,s[a+1].Latitude);o.push(c)}if(o.length===1)return o[0];let f=0,u=0;for(const a of o){const c=a*Math.PI/180;f+=Math.cos(c),u+=Math.sin(c)}return(Math.atan2(u,f)*180/Math.PI+360)%360}function pu(s,t){const e=s*Math.PI/180,i=t*Math.PI/180,r=Math.cos(e),n=Math.sin(e),o=Math.cos(i),f=Math.sin(i),u=r+o,l=n+f;if(Math.abs(u)<1e-10&&Math.abs(l)<1e-10)return(s+90)%360;let a=Math.atan2(l,u)*180/Math.PI;return a=(a+360)%360,a}function gu(s,t,e){if(!t||t.length<2)return!1;const i=be(s),r=ue(t),n=Ar(i,r,{units:"meters"});return console.log(`isPointInCorridor: point=[${s[0]}, ${s[1]}], distance=${n}, threshold=${e}`),n<=e}function du(s,t,e=2e3){if(!s||!t||t.length<2)return console.log("filterTreesInCorridor: invalid input parameters"),[];console.log(`filterTreesInCorridor: processing ${s.length} trees, ${t.length} towers, width=${e}`);const i=t.map(n=>[n.Longitude,n.Latitude]);console.log(`filterTreesInCorridor: line points extracted, first point: [${i[0][0]}, ${i[0][1]}]`);const r=s.filter(n=>{if(n.lon===void 0||n.lat===void 0)return console.warn("filterTreesInCorridor: tree missing lon/lat properties",n),!1;const o=[n.lon,n.lat],f=gu(o,i,e);return s.indexOf(n)<5&&console.log(`Tree ${s.indexOf(n)}: [${o[0]}, ${o[1]}], inCorridor: ${f}`),f});return console.log(`filterTreesInCorridor: found ${r.length} trees in corridor`),r}function yu(s,t=2e3){if(!s||s.length<2)return[];const e=s.map(r=>[r.Longitude,r.Latitude]),i=ue(e);try{const r=iu(i,t/1e3,{units:"kilometers"});if(r.geometry.type==="Polygon"){let n=r.geometry.coordinates[0].map(o=>[o[0],o[1]]);return n.length>=3&&ka(n)<0&&(n=n.reverse()),n}else if(r.geometry.type==="MultiPolygon"){let o=r.geometry.coordinates[0][0].map(f=>[f[0],f[1]]);return o.length>=3&&ka(o)<0&&(o=o.reverse()),o}return[]}catch{return[]}}function ka(s){if(s.length<3)return 0;let t=0;const e=s.length;for(let i=0;i<e;i++){const r=(i+1)%e;t+=s[i][0]*s[r][1],t-=s[r][0]*s[i][1]}return t/2}class mu{constructor(t,e,i){I(this,"viewer");I(this,"LineInfo");I(this,"Keym","");I(this,"dataSource2");I(this,"entityCollection2");I(this,"offsetTowers",[]);I(this,"autoCalculateRollX",!0);I(this,"towerWirePoints",new Map);I(this,"loadedWireSegments",new Set);I(this,"loadedTowerIndices",new Set);I(this,"isDynamicLoadingEnabled",!0);I(this,"isLineModelRemoved",!1);I(this,"cameraMoveHandler",null);I(this,"offsetWires11",[]);I(this,"offsetWires12",[]);I(this,"offsetWires13",[]);I(this,"offsetWires21",[]);I(this,"offsetWires22",[]);I(this,"offsetWires23",[]);I(this,"ToffsetArcWires1A",[]);I(this,"ToffsetArcWires2A",[]);I(this,"ToffsetWires1A1",[]);I(this,"ToffsetWires1A2",[]);I(this,"ToffsetArcWires1B",[]);I(this,"ToffsetArcWires2B",[]);I(this,"ToffsetWires1B1",[]);I(this,"ToffsetWires1B2",[]);I(this,"ToffsetArcWires1C",[]);I(this,"ToffsetArcWires2C",[]);I(this,"ToffsetWires1C1",[]);I(this,"ToffsetWires1C2",[]);I(this,"ToffsetArcWires1A2",[]);I(this,"ToffsetArcWires2A2",[]);I(this,"ToffsetWires2A1",[]);I(this,"ToffsetWires2A2",[]);I(this,"ToffsetArcWires1B2",[]);I(this,"ToffsetArcWires2B2",[]);I(this,"ToffsetWires2B1",[]);I(this,"ToffsetWires2B2",[]);I(this,"ToffsetArcWires1C2",[]);I(this,"ToffsetArcWires2C2",[]);I(this,"ToffsetWires2C1",[]);I(this,"ToffsetWires2C2",[]);I(this,"offsetArcWires1A",[]);I(this,"offsetArcWires1B",[]);I(this,"offsetArcWires1C",[]);I(this,"offsetArcWires2A",[]);I(this,"offsetArcWires2B",[]);I(this,"offsetArcWires2C",[]);I(this,"offsetGrouundWires1",[]);I(this,"offsetGrouundWires2",[]);I(this,"offsetGrouundWires11",[]);I(this,"offsetGrouundWires12",[]);I(this,"arcLine1A1",[]);I(this,"arcLine1B1",[]);I(this,"arcLine1C1",[]);I(this,"LinedataSource2");I(this,"LineentityCollection2");I(this,"modelCache",new Map);this.Keym=i,this.viewer=t,this.LineInfo=e,this.dataSource2=new g.CustomDataSource(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new g.CustomDataSource(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.LinedataSource2.entities}createModelCacheKey(t,e,i,r){return`${t}_${e}_${i}_${r}`}getCachedModelConfig(t,e,i,r){const n=Math.max(0,i),o=Math.min(r,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}addModelToCollection(t,e,i,r,n,o,f){const u=this.getCachedModelConfig(r,o,f[0],f[1]);this.entityCollection2.add(Pn(t,e,i,u.uri,n,u.scale,u.distanceDisplayCondition))}setAutoCalculateRollX(t){this.autoCalculateRollX=t}getAutoCalculateRollX(){return this.autoCalculateRollX}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}setupCameraMoveListener(){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleTowers()})}getVisibleTowerIndices(){var u;if(!this.viewer.camera||this.offsetTowers.length===0)return{start:0,end:0};const t=this.viewer.camera.position,e=((u=this.viewer.camera.positionCartographic)==null?void 0:u.height)||1e3;let i=5;e>5e4?i=2:e>1e4?i=3:e>5e3?i=5:i=10;let r=0,n=Number.MAX_VALUE;for(let l=0;l<this.offsetTowers.length;l++){const a=g.Cartesian3.distance(t,this.offsetTowers[l]);a<n&&(n=a,r=l)}const o=Math.max(0,r-i),f=Math.min(this.offsetTowers.length-1,r+i);return{start:o,end:f}}updateVisibleTowers(){const{start:t,end:e}=this.getVisibleTowerIndices();this.isLineModelRemoved||this.loadTowersInRange(t,e)}initializeLineData(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(g.Cartesian3.fromDegrees(t.Longitude,t.Latitude,t.Altitude))}),this.autoCalculateRollX&&this.calculateTowerOrientations())}calculateTowerOrientations(){const t=this.LineInfo.towers.length;if(t!==0){if(t===1){this.LineInfo.towers[0].RollX===void 0&&(this.LineInfo.towers[0].RollX=90);return}for(let e=0;e<t;e++){let i=0;if(this.LineInfo.towers[e].type===mi.耐张塔)if(e===0)i=(ho(this.LineInfo.towers,e,3)-90+360)%360;else if(e===t-1)i=(ho(this.LineInfo.towers,e,3)-90+360)%360;else{const r=this.LineInfo.towers[e-1],n=this.LineInfo.towers[e],o=this.LineInfo.towers[e+1],f=or(r.Longitude,r.Latitude,n.Longitude,n.Latitude),u=or(n.Longitude,n.Latitude,o.Longitude,o.Latitude);i=(pu(f,u)-90+360)%360}else i=(ho(this.LineInfo.towers,e,2)-90+360)%360;this.LineInfo.towers[e].RollX=i}}}loadTowersInRange(t,e){if(t<0||e>=this.LineInfo.towers.length)return;const i=Math.max(0,t-1),r=Math.min(this.LineInfo.towers.length-1,e+1);for(let n=i;n<=r;n++)this.loadedTowerIndices.has(n)||(this.loadTowerAndCollectWirePoints(n),this.loadedTowerIndices.add(n));for(let n=i;n<r;n++){const o=`${n}-${n+1}`;this.loadedWireSegments.has(o)||(this.loadWireSegmentBetweenTowers(n,n+1),this.loadedWireSegments.add(o))}}loadTowerAndCollectWirePoints(t){const e=this.offsetTowers[t],i=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),g.Math.toRadians(this.LineInfo.towers[t].RollY),g.Math.toRadians(this.LineInfo.towers[t].RollZ));this.addModelToCollection(this.LineInfo.towers[t].id,e,this.LineInfo.towers[t].name,this.LineInfo.towers[t].towerModelUri,i,this.LineInfo.towers[t].towerScale,[this.LineInfo.towers[t].DistanceDisplaymin,this.LineInfo.towers[t].DistanceDisplaymax]);const r=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0),n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0);let o=0;const f=[];this.LineInfo.towers[t].Insulators.forEach(u=>{const l=N(e,new g.Cartesian3(this.LineInfo.towers[t].towerPoint[o].X,this.LineInfo.towers[t].towerPoint[o].Y,this.LineInfo.towers[t].towerPoint[o].Z),this.LineInfo.towers[t].type===mi.耐张塔?n:r);let a,c;if(this.autoCalculateRollX?c=this.LineInfo.towers[t].RollX:c=u.RollX,this.LineInfo.towers[t].type===mi.耐张塔)switch(u.type){case Kt.耐张串:a=u.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(0),g.Math.toRadians(0));break;case Kt.跳线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;case Kt.地线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;default:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ))}else a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));this.addModelToCollection(u.id,l,u.name,u.InsulatorModelUri,a,u.InsulatorScale,[u.DistanceDisplaymin,u.DistanceDisplaymax]);const p={insulator:u,insulatorIndex:o,position:e,lineroll:r,WairPoint:[]};u.InsulatorPoint.forEach(d=>{d.Y=d.Y+this.LineInfo.towers[t].towerPoint[o].Y,d.Z=d.Z+this.LineInfo.towers[t].towerPoint[o].Z,p.WairPoint.push(N(e,new g.Cartesian3(d.X,d.Y,d.Z),r))}),f.push(p),o++}),this.towerWirePoints.set(t,f)}loadWireSegmentBetweenTowers(t,e){const i=this.towerWirePoints.get(t),r=this.towerWirePoints.get(e);!i||!r||(this.resetWireArraysForTwoTowers(),console.log(`加载导线段: ${t}-${e}`))}resetWireArraysForTwoTowers(){this.offsetWires11=[],this.offsetWires12=[],this.offsetWires13=[],this.offsetWires21=[],this.offsetWires22=[],this.offsetWires23=[],this.ToffsetWires1A1=[],this.ToffsetWires1A2=[]}getLineDataSources(){return[this.dataSource2,this.LinedataSource2]}removeLineModels(){this.isLineModelRemoved=!0,this.entityCollection2.removeAll(),this.LineentityCollection2.removeAll(),this.loadedTowerIndices.clear(),this.loadedWireSegments.clear()}restoreLineModels(){this.isLineModelRemoved=!1,this.isDynamicLoadingEnabled?(this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllTowersAtOnce(){let t=0,e=0;this.offsetTowers.forEach((i,r)=>{const n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[r].RollX),g.Math.toRadians(this.LineInfo.towers[r].RollY),g.Math.toRadians(this.LineInfo.towers[r].RollZ));this.addModelToCollection(this.LineInfo.towers[r].id,i,this.LineInfo.towers[r].name,this.LineInfo.towers[r].towerModelUri,n,this.LineInfo.towers[r].towerScale,[this.LineInfo.towers[r].DistanceDisplaymin,this.LineInfo.towers[r].DistanceDisplaymax]);const o=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[r].RollX),0,0),f=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[r].RollX),0,0);let u=0;if(this.LineInfo.towers[r].Insulators.forEach(a=>{const c=N(i,new g.Cartesian3(this.LineInfo.towers[r].towerPoint[u].X,this.LineInfo.towers[r].towerPoint[u].Y,this.LineInfo.towers[r].towerPoint[u].Z),this.LineInfo.towers[r].type===mi.耐张塔?f:o);let p,d;if(this.autoCalculateRollX?d=this.LineInfo.towers[r].RollX:d=a.RollX,this.LineInfo.towers[r].type===mi.耐张塔)switch(a.type){case Kt.耐张串:p=a.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(0),g.Math.toRadians(0));break;case Kt.跳线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;case Kt.地线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;default:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ))}else p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));this.addModelToCollection(a.id,c,a.name,a.InsulatorModelUri,p,a.InsulatorScale,[a.DistanceDisplaymin,a.DistanceDisplaymax]);const h=[];switch(a.InsulatorPoint.forEach(v=>{v.Y=v.Y+this.LineInfo.towers[r].towerPoint[u].Y,v.Z=v.Z+this.LineInfo.towers[r].towerPoint[u].Z,h.push(N(i,new g.Cartesian3(v.X,v.Y,v.Z),o))}),a.linenum){case Ys.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[r].type==mi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case w.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break;case w.四分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]);break;case w.六分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]);break;case w.八分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.offsetWires11.push(h[6]),this.offsetWires11.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]),this.ToffsetWires1A1.push(h[12]),this.ToffsetWires1A1.push(h[13]),this.ToffsetWires1A1.push(h[14]),this.ToffsetWires1A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(v),this.ToffsetWires1A2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(C),this.offsetWires11.push(W),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires11.push(_),this.offsetWires11.push(T),this.offsetWires11.push(L),this.offsetWires11.push(P),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(L),this.ToffsetWires1A2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires11.push(b),this.offsetWires11.push(D),this.offsetWires11.push(R),this.offsetWires11.push(B),this.offsetWires11.push(X),this.offsetWires11.push(O),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(D),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires11.push(q),this.offsetWires11.push(H),this.offsetWires11.push(F),this.offsetWires11.push(Y),this.offsetWires11.push(J),this.offsetWires11.push(rt),this.offsetWires11.push(ut),this.offsetWires11.push(st),this.ToffsetWires1A2.push(q),this.ToffsetWires1A2.push(H),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(Y),this.ToffsetWires1A2.push(J),this.ToffsetWires1A2.push(rt),this.ToffsetWires1A2.push(ut),this.ToffsetWires1A2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[1]);break;case w.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break;case w.四分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A2.push(h[4]),this.ToffsetWires1A2.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]);break;case w.六分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]);break;case w.八分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]),this.ToffsetWires1A2.push(h[12]),this.ToffsetWires1A2.push(h[13]),this.ToffsetWires1A2.push(h[14]),this.ToffsetWires1A2.push(h[15]);break}break;case Te.B相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires12.push(h[0]),this.ToffsetWires1B1.push(h[1]);break;case w.双分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]);break;case w.四分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]);break;case w.六分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]);break;case w.八分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.offsetWires12.push(h[6]),this.offsetWires12.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]),this.ToffsetWires1B1.push(h[12]),this.ToffsetWires1B1.push(h[13]),this.ToffsetWires1B1.push(h[14]),this.ToffsetWires1B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires12.push(v),this.ToffsetWires1B2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires12.push(C),this.offsetWires12.push(W),this.ToffsetWires1B2.push(C),this.ToffsetWires1B2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires12.push(_),this.offsetWires12.push(T),this.offsetWires12.push(L),this.offsetWires12.push(P),this.ToffsetWires1B2.push(_),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(L),this.ToffsetWires1B2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires12.push(b),this.offsetWires12.push(D),this.offsetWires12.push(R),this.offsetWires12.push(B),this.offsetWires12.push(X),this.offsetWires12.push(O),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(D),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires12.push(q),this.offsetWires12.push(H),this.offsetWires12.push(F),this.offsetWires12.push(Y),this.offsetWires12.push(J),this.offsetWires12.push(rt),this.offsetWires12.push(ut),this.offsetWires12.push(st),this.ToffsetWires1B2.push(q),this.ToffsetWires1B2.push(H),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(Y),this.ToffsetWires1B2.push(J),this.ToffsetWires1B2.push(rt),this.ToffsetWires1B2.push(ut),this.ToffsetWires1B2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B2.push(h[0]);break;case w.双分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B2.push(h[2]),this.ToffsetWires1B2.push(h[3]);break;case w.四分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B2.push(h[4]),this.ToffsetWires1B2.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]);break;case w.六分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]);break;case w.八分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]),this.ToffsetWires1B2.push(h[12]),this.ToffsetWires1B2.push(h[13]),this.ToffsetWires1B2.push(h[14]),this.ToffsetWires1B2.push(h[15]);break}break;case Te.C相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires13.push(h[0]),this.ToffsetWires1C1.push(h[1]);break;case w.双分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]);break;case w.四分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]);break;case w.六分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]);break;case w.八分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.offsetWires13.push(h[6]),this.offsetWires13.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]),this.ToffsetWires1C1.push(h[12]),this.ToffsetWires1C1.push(h[13]),this.ToffsetWires1C1.push(h[14]),this.ToffsetWires1C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires13.push(v),this.ToffsetWires1C2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires13.push(C),this.offsetWires13.push(W),this.ToffsetWires1C2.push(C),this.ToffsetWires1C2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires13.push(_),this.offsetWires13.push(T),this.offsetWires13.push(L),this.offsetWires13.push(P),this.ToffsetWires1C2.push(_),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(L),this.ToffsetWires1C2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires13.push(b),this.offsetWires13.push(D),this.offsetWires13.push(R),this.offsetWires13.push(B),this.offsetWires13.push(X),this.offsetWires13.push(O),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(D),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires13.push(q),this.offsetWires13.push(H),this.offsetWires13.push(F),this.offsetWires13.push(Y),this.offsetWires13.push(J),this.offsetWires13.push(rt),this.offsetWires13.push(ut),this.offsetWires13.push(st),this.ToffsetWires1C2.push(q),this.ToffsetWires1C2.push(H),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(Y),this.ToffsetWires1C2.push(J),this.ToffsetWires1C2.push(rt),this.ToffsetWires1C2.push(ut),this.ToffsetWires1C2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C2.push(h[0]);break;case w.双分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C2.push(h[2]),this.ToffsetWires1C2.push(h[3]);break;case w.四分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C2.push(h[4]),this.ToffsetWires1C2.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]);break;case w.六分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]);break;case w.八分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]),this.ToffsetWires1C2.push(h[12]),this.ToffsetWires1C2.push(h[13]),this.ToffsetWires1C2.push(h[14]),this.ToffsetWires1C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Te.A相:h.forEach(v=>{this.offsetWires11.push(v)});break;case Te.B相:h.forEach(v=>{this.offsetWires12.push(v)});break;case Te.C相:h.forEach(v=>{this.offsetWires13.push(v)});break}else if(this.LineInfo.towers[r].type==mi.耐张塔)switch(u){case 2:switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case w.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case w.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(v),this.ToffsetWires1A2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(C),this.offsetWires11.push(W),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(W);break}break;case 5:h.forEach(v=>{this.offsetWires12.push(v),this.ToffsetWires1B1.push(v)});break;case 6:h.forEach(v=>{this.ToffsetWires1B1.push(v),this.ToffsetWires1B2.push(v)});break;case 7:a.InsulatorPoint.forEach(v=>{const C=N(i,new g.Cartesian3(v.X*-1,v.Y,v.Z),o);this.offsetWires12.push(C),this.ToffsetWires1B2.push(C)});break;case 8:h.forEach(v=>{this.offsetWires13.push(v),this.ToffsetWires1C1.push(v)});break;case 9:h.forEach(v=>{this.ToffsetWires1C1.push(v),this.ToffsetWires1C2.push(v)});break;case 10:a.InsulatorPoint.forEach(v=>{const C=N(i,new g.Cartesian3(v.X*-1,v.Y,v.Z),o);this.offsetWires13.push(C),this.ToffsetWires1C2.push(C)});break}else switch(u){case 2:h.forEach(v=>{this.offsetWires11.push(v)});break;case 3:h.forEach(v=>{this.offsetWires12.push(v)});break;case 4:h.forEach(v=>{this.offsetWires13.push(v)});break}break;case Ys.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[r].type==mi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case w.双分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]);break;case w.四分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]);break;case w.六分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]);break;case w.八分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.offsetWires21.push(h[6]),this.offsetWires21.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]),this.ToffsetWires2A1.push(h[12]),this.ToffsetWires2A1.push(h[13]),this.ToffsetWires2A1.push(h[14]),this.ToffsetWires2A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(v),this.ToffsetWires2A2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires21.push(C),this.offsetWires21.push(W),this.ToffsetWires2A2.push(C),this.ToffsetWires2A2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires21.push(_),this.offsetWires21.push(T),this.offsetWires21.push(L),this.offsetWires21.push(P),this.ToffsetWires2A2.push(_),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(L),this.ToffsetWires2A2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires21.push(b),this.offsetWires21.push(D),this.offsetWires21.push(R),this.offsetWires21.push(B),this.offsetWires21.push(X),this.offsetWires21.push(O),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(D),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires21.push(q),this.offsetWires21.push(H),this.offsetWires21.push(F),this.offsetWires21.push(Y),this.offsetWires21.push(J),this.offsetWires21.push(rt),this.offsetWires21.push(ut),this.offsetWires21.push(st),this.ToffsetWires2A2.push(q),this.ToffsetWires2A2.push(H),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(Y),this.ToffsetWires2A2.push(J),this.ToffsetWires2A2.push(rt),this.ToffsetWires2A2.push(ut),this.ToffsetWires2A2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case w.双分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A2.push(h[2]),this.ToffsetWires2A2.push(h[3]);break;case w.四分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A2.push(h[4]),this.ToffsetWires2A2.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]);break;case w.六分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]);break;case w.八分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]),this.ToffsetWires2A2.push(h[12]),this.ToffsetWires2A2.push(h[13]),this.ToffsetWires2A2.push(h[14]),this.ToffsetWires2A2.push(h[15]);break}break;case Te.B相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case w.双分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]);break;case w.四分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]);break;case w.六分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]);break;case w.八分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.offsetWires22.push(h[6]),this.offsetWires22.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]),this.ToffsetWires2B1.push(h[12]),this.ToffsetWires2B1.push(h[13]),this.ToffsetWires2B1.push(h[14]),this.ToffsetWires2B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(v),this.ToffsetWires2B2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires22.push(C),this.offsetWires22.push(W),this.ToffsetWires2B2.push(C),this.ToffsetWires2B2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires22.push(_),this.offsetWires22.push(T),this.offsetWires22.push(L),this.offsetWires22.push(P),this.ToffsetWires2B2.push(_),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(L),this.ToffsetWires2B2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires22.push(b),this.offsetWires22.push(D),this.offsetWires22.push(R),this.offsetWires22.push(B),this.offsetWires22.push(X),this.offsetWires22.push(O),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(D),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires22.push(q),this.offsetWires22.push(H),this.offsetWires22.push(F),this.offsetWires22.push(Y),this.offsetWires22.push(J),this.offsetWires22.push(rt),this.offsetWires22.push(ut),this.offsetWires22.push(st),this.ToffsetWires2B2.push(q),this.ToffsetWires2B2.push(H),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(Y),this.ToffsetWires2B2.push(J),this.ToffsetWires2B2.push(rt),this.ToffsetWires2B2.push(ut),this.ToffsetWires2B2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case w.双分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B2.push(h[2]),this.ToffsetWires2B2.push(h[3]);break;case w.四分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B2.push(h[4]),this.ToffsetWires2B2.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]);break;case w.六分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]);break;case w.八分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]),this.ToffsetWires2B2.push(h[12]),this.ToffsetWires2B2.push(h[13]),this.ToffsetWires2B2.push(h[14]),this.ToffsetWires2B2.push(h[15]);break}break;case Te.C相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case w.双分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]);break;case w.四分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]);break;case w.六分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]);break;case w.八分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.offsetWires23.push(h[6]),this.offsetWires23.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]),this.ToffsetWires2C1.push(h[12]),this.ToffsetWires2C1.push(h[13]),this.ToffsetWires2C1.push(h[14]),this.ToffsetWires2C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case w.单分裂:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(v),this.ToffsetWires2C2.push(v);break;case w.双分裂:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires23.push(C),this.offsetWires23.push(W),this.ToffsetWires2C2.push(C),this.ToffsetWires2C2.push(W);break;case w.四分裂:const _=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),P=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires23.push(_),this.offsetWires23.push(T),this.offsetWires23.push(L),this.offsetWires23.push(P),this.ToffsetWires2C2.push(_),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(L),this.ToffsetWires2C2.push(P);break;case w.六分裂:const b=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),R=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),B=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),X=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),O=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires23.push(b),this.offsetWires23.push(D),this.offsetWires23.push(R),this.offsetWires23.push(B),this.offsetWires23.push(X),this.offsetWires23.push(O),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(D),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(O);break;case w.八分裂:const q=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),H=N(i,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=N(i,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),Y=N(i,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),J=N(i,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),rt=N(i,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=N(i,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),st=N(i,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires23.push(q),this.offsetWires23.push(H),this.offsetWires23.push(F),this.offsetWires23.push(Y),this.offsetWires23.push(J),this.offsetWires23.push(rt),this.offsetWires23.push(ut),this.offsetWires23.push(st),this.ToffsetWires2C2.push(q),this.ToffsetWires2C2.push(H),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(Y),this.ToffsetWires2C2.push(J),this.ToffsetWires2C2.push(rt),this.ToffsetWires2C2.push(ut),this.ToffsetWires2C2.push(st);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case w.双分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C2.push(h[2]),this.ToffsetWires2C2.push(h[3]);break;case w.四分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C2.push(h[4]),this.ToffsetWires2C2.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]);break;case w.六分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]);break;case w.八分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]),this.ToffsetWires2C2.push(h[12]),this.ToffsetWires2C2.push(h[13]),this.ToffsetWires2C2.push(h[14]),this.ToffsetWires2C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Te.A相:h.forEach(v=>{this.offsetWires21.push(v)});break;case Te.B相:h.forEach(v=>{this.offsetWires22.push(v)});break;case Te.C相:h.forEach(v=>{this.offsetWires23.push(v)});break}else if(this.LineInfo.towers[r].type==mi.耐张塔)switch(u){case 11:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case 12:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case 13:const v=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(v),this.ToffsetWires2A2.push(v);break;case 14:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case 15:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case 16:const C=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(C),this.ToffsetWires2B2.push(C);break;case 17:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case 18:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case 19:const W=N(i,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(W),this.ToffsetWires2C2.push(W);break}else switch(u){case 5:h.forEach(v=>{this.offsetWires21.push(v)});break;case 6:h.forEach(v=>{this.offsetWires22.push(v)});break;case 7:h.forEach(v=>{this.offsetWires23.push(v)});break}break;case Ys.地线:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case Te.地线1:this.offsetGrouundWires11.push(h[0]);break;case Te.地线2:this.offsetGrouundWires12.push(h[0]);break}else switch(u){case 0:this.offsetGrouundWires11.push(h[0]);break;case 1:this.offsetGrouundWires12.push(h[0]);break}break}u=u+1}),this.offsetWires11.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.offsetWires11.length>=2&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-1]),this.offsetArcWires1A=m(a),this.offsetArcWires1A.forEach(_=>{const T=Ne(this.viewer.scene.globe.ellipsoid,_);this.arcLine1A1.push(T)}),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case w.双分裂:this.offsetWires11.length>=4&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-2]),this.offsetArcWires1A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(_=>{this.arcLine1A1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-1]),this.offsetArcWires1A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case w.四分裂:this.offsetWires11.length>=8&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-4]),this.offsetArcWires1A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(_=>{this.arcLine1A1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-3]),this.offsetArcWires1A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-2]),this.offsetArcWires1A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-1]),this.offsetArcWires1A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case w.六分裂:this.offsetWires11.length>=12&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-6]),this.offsetArcWires1A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(_=>{this.arcLine1A1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-5]),this.offsetArcWires1A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-4]),this.offsetArcWires1A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-3]),this.offsetArcWires1A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-2]),this.offsetArcWires1A=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires11[t+5]),v.push(this.offsetWires11[t-1]),this.offsetArcWires1A=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case w.八分裂:this.offsetWires11.length>=16&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-8]),this.offsetArcWires1A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(_=>{this.arcLine1A1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-7]),this.offsetArcWires1A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-6]),this.offsetArcWires1A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-5]),this.offsetArcWires1A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-4]),this.offsetArcWires1A=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires11[t+5]),v.push(this.offsetWires11[t-3]),this.offsetArcWires1A=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires11[t+6]),C.push(this.offsetWires11[t-2]),this.offsetArcWires1A=m(C),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires11[t+7]),W.push(this.offsetWires11[t-1]),this.offsetArcWires1A=m(W),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-1]),this.offsetArcWires1B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(_=>{this.arcLine1B1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break;case w.双分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-2]),this.offsetArcWires1B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(_=>{this.arcLine1B1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-1]),this.offsetArcWires1B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.四分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-4]),this.offsetArcWires1B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(_=>{this.arcLine1B1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-3]),this.offsetArcWires1B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-2]),this.offsetArcWires1B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-1]),this.offsetArcWires1B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.六分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-6]),this.offsetArcWires1B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(_=>{this.arcLine1B1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-5]),this.offsetArcWires1B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-4]),this.offsetArcWires1B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-3]),this.offsetArcWires1B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-2]),this.offsetArcWires1B=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires12[t+5]),v.push(this.offsetWires12[t-1]),this.offsetArcWires1B=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.八分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-8]),this.offsetArcWires1B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(_=>{this.arcLine1B1.push(Ne(this.viewer.scene.globe.ellipsoid,_))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-7]),this.offsetArcWires1B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-6]),this.offsetArcWires1B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-5]),this.offsetArcWires1B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-4]),this.offsetArcWires1B=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires12[t+5]),v.push(this.offsetWires12[t-3]),this.offsetArcWires1B=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires12[t+6]),C.push(this.offsetWires12[t-2]),this.offsetArcWires1B=m(C),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires12[t+7]),W.push(this.offsetWires12[t-1]),this.offsetArcWires1B=m(W),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-1]),this.offsetArcWires1C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(_=>{this.arcLine1C1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break;case w.双分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-2]),this.offsetArcWires1C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-1]),this.offsetArcWires1C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(_=>{this.arcLine1C1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break;case w.四分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-4]),this.offsetArcWires1C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-3]),this.offsetArcWires1C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-2]),this.offsetArcWires1C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-1]),this.offsetArcWires1C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(_=>{this.arcLine1C1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break;case w.六分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-6]),this.offsetArcWires1C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-5]),this.offsetArcWires1C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-4]),this.offsetArcWires1C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-3]),this.offsetArcWires1C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-2]),this.offsetArcWires1C=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires13[t+5]),v.push(this.offsetWires13[t-1]),this.offsetArcWires1C=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(_=>{this.arcLine1C1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break;case w.八分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-8]),this.offsetArcWires1C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-7]),this.offsetArcWires1C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-6]),this.offsetArcWires1C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-5]),this.offsetArcWires1C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-4]),this.offsetArcWires1C=m(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires13[t+5]),v.push(this.offsetWires13[t-3]),this.offsetArcWires1C=m(v),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires13[t+6]),C.push(this.offsetWires13[t-2]),this.offsetArcWires1C=m(C),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires13[t+7]),W.push(this.offsetWires13[t-1]),this.offsetArcWires1C=m(W),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(_=>{this.arcLine1C1.push(Ne(this.viewer.scene.globe.ellipsoid,_))});break}}if(this.offsetWires21.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-1]),this.offsetArcWires2A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.双分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-2]),this.offsetArcWires2A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-1]),this.offsetArcWires2A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.四分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-4]),this.offsetArcWires2A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-3]),this.offsetArcWires2A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-2]),this.offsetArcWires2A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-1]),this.offsetArcWires2A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.六分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-6]),this.offsetArcWires2A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-5]),this.offsetArcWires2A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-4]),this.offsetArcWires2A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-3]),this.offsetArcWires2A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-2]),this.offsetArcWires2A=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires21[t+5]),v.push(this.offsetWires21[t-1]),this.offsetArcWires2A=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.八分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-8]),this.offsetArcWires2A=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-7]),this.offsetArcWires2A=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-6]),this.offsetArcWires2A=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-5]),this.offsetArcWires2A=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-4]),this.offsetArcWires2A=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires21[t+5]),v.push(this.offsetWires21[t-3]),this.offsetArcWires2A=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires21[t+6]),C.push(this.offsetWires21[t-2]),this.offsetArcWires2A=m(C),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires21[t+7]),W.push(this.offsetWires21[t-1]),this.offsetArcWires2A=m(W),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-1]),this.offsetArcWires2B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.双分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-2]),this.offsetArcWires2B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-1]),this.offsetArcWires2B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.四分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-4]),this.offsetArcWires2B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-3]),this.offsetArcWires2B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-2]),this.offsetArcWires2B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-1]),this.offsetArcWires2B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.六分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-6]),this.offsetArcWires2B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-5]),this.offsetArcWires2B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-4]),this.offsetArcWires2B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-3]),this.offsetArcWires2B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-2]),this.offsetArcWires2B=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires22[t+5]),v.push(this.offsetWires22[t-1]),this.offsetArcWires2B=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.八分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-8]),this.offsetArcWires2B=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-7]),this.offsetArcWires2B=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-6]),this.offsetArcWires2B=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-5]),this.offsetArcWires2B=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-4]),this.offsetArcWires2B=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires22[t+5]),v.push(this.offsetWires22[t-3]),this.offsetArcWires2B=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires22[t+6]),C.push(this.offsetWires22[t-2]),this.offsetArcWires2B=m(C),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires22[t+7]),W.push(this.offsetWires22[t-1]),this.offsetArcWires2B=m(W),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&r>0){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[];switch(this.LineInfo.Wairnum){case w.单分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-1]),this.offsetArcWires2C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.双分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-2]),this.offsetArcWires2C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-1]),this.offsetArcWires2C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.四分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-4]),this.offsetArcWires2C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-3]),this.offsetArcWires2C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-2]),this.offsetArcWires2C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-1]),this.offsetArcWires2C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.六分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-6]),this.offsetArcWires2C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-5]),this.offsetArcWires2C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-4]),this.offsetArcWires2C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-3]),this.offsetArcWires2C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-2]),this.offsetArcWires2C=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires23[t+5]),v.push(this.offsetWires23[t-1]),this.offsetArcWires2C=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case w.八分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-8]),this.offsetArcWires2C=m(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-7]),this.offsetArcWires2C=m(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-6]),this.offsetArcWires2C=m(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-5]),this.offsetArcWires2C=m(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-4]),this.offsetArcWires2C=m(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),v.push(this.offsetWires23[t+5]),v.push(this.offsetWires23[t-3]),this.offsetArcWires2C=m(v),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),C.push(this.offsetWires23[t+6]),C.push(this.offsetWires23[t-2]),this.offsetArcWires2C=m(C),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires23[t+7]),W.push(this.offsetWires23[t-1]),this.offsetArcWires2C=m(W),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const a=[];a.push(this.offsetGrouundWires11[r]),a.push(this.offsetGrouundWires11[r-1]);const c=[];c.push(this.offsetGrouundWires12[r]),c.push(this.offsetGrouundWires12[r-1]),this.offsetGrouundWires1=m(a,2),this.offsetGrouundWires2=m(c,2),this.LineentityCollection2.add(y(this.offsetGrouundWires1,"地线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.LineentityCollection2.add(y(this.offsetGrouundWires2,"地线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}let l=2;if(this.LineInfo.towers[r].type==mi.耐张塔){switch(this.LineInfo.Wairnum){case w.单分裂:t=t+l,e=e+l;break;case w.双分裂:t=t+l*2,e=e+l*2;break;case w.四分裂:t=t+l*4,e=e+l*4;break;case w.六分裂:t=t+l*6,e=e+l*6;break;case w.八分裂:t=t+l*8,e=e+l*8;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1A1.length>=2&&(a.push(this.ToffsetWires1A1[e-2]),a.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(_.push(this.ToffsetWires1A2[e-2]),_.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires1A1.length>=4&&(a.push(this.ToffsetWires1A1[e-4]),a.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-3]),c.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(_.push(this.ToffsetWires1A2[e-4]),_.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-3]),T.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires1A1.length>=8&&(a.push(this.ToffsetWires1A1[e-8]),a.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-7]),c.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-6]),p.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-5]),d.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(_.push(this.ToffsetWires1A2[e-8]),_.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-7]),T.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-6]),L.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1A2[e-5]),P.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires1A1.length>=12&&(a.push(this.ToffsetWires1A1[e-12]),a.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-11]),c.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-10]),p.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-9]),d.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-8]),h.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A1[e-7]),v.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(_.push(this.ToffsetWires1A2[e-12]),_.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-11]),T.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-10]),L.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1A2[e-9]),P.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[e-8]),b.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-7]),D.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires1A1.length>=16&&(a.push(this.ToffsetWires1A1[e-16]),a.push(this.ToffsetWires1A1[e-8]),this.ToffsetArcWires1A=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-15]),c.push(this.ToffsetWires1A1[e-7]),this.ToffsetArcWires1A=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-14]),p.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-13]),d.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-12]),h.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A1[e-11]),v.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires1A1[e-10]),C.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1A1[e-9]),W.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(_.push(this.ToffsetWires1A2[e-16]),_.push(this.ToffsetWires1A2[e-8]),this.ToffsetArcWires2A=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-15]),T.push(this.ToffsetWires1A2[e-7]),this.ToffsetArcWires2A=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-14]),L.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1A2[e-13]),P.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[e-12]),b.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-11]),D.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1A2[e-10]),R.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[e-9]),B.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1B1.length>=2&&(a.push(this.ToffsetWires1B1[e-2]),a.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(_.push(this.ToffsetWires1B2[e-2]),_.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires1B1.length>=4&&(a.push(this.ToffsetWires1B1[e-4]),a.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-3]),c.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(_.push(this.ToffsetWires1B2[e-4]),_.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-3]),T.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires1B1.length>=8&&(a.push(this.ToffsetWires1B1[e-8]),a.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-7]),c.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-6]),p.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-5]),d.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(_.push(this.ToffsetWires1B2[e-8]),_.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-7]),T.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-6]),L.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1B2[e-5]),P.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires1B1.length>=12&&(a.push(this.ToffsetWires1B1[e-12]),a.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-11]),c.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-10]),p.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-9]),d.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-8]),h.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B1[e-7]),v.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(_.push(this.ToffsetWires1B2[e-12]),_.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-11]),T.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-10]),L.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1B2[e-9]),P.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[e-8]),b.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-7]),D.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires1B1.length>=16&&(a.push(this.ToffsetWires1B1[e-16]),a.push(this.ToffsetWires1B1[e-8]),this.ToffsetArcWires1B=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-15]),c.push(this.ToffsetWires1B1[e-7]),this.ToffsetArcWires1B=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-14]),p.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-13]),d.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-12]),h.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B1[e-11]),v.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires1B1[e-10]),C.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1B1[e-9]),W.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(_.push(this.ToffsetWires1B2[e-16]),_.push(this.ToffsetWires1B2[e-8]),this.ToffsetArcWires2B=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-15]),T.push(this.ToffsetWires1B2[e-7]),this.ToffsetArcWires2B=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-14]),L.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1B2[e-13]),P.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[e-12]),b.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-11]),D.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1B2[e-10]),R.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[e-9]),B.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires1C1.length>=2&&(a.push(this.ToffsetWires1C1[e-2]),a.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(_.push(this.ToffsetWires1C2[e-2]),_.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires1C1.length>=4&&(a.push(this.ToffsetWires1C1[e-4]),a.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-3]),c.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(_.push(this.ToffsetWires1C2[e-4]),_.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-3]),T.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires1C1.length>=8&&(a.push(this.ToffsetWires1C1[e-8]),a.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-7]),c.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-6]),p.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-5]),d.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(_.push(this.ToffsetWires1C2[e-8]),_.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-7]),T.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-6]),L.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1C2[e-5]),P.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires1C1.length>=12&&(a.push(this.ToffsetWires1C1[e-12]),a.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-11]),c.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-10]),p.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-9]),d.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-8]),h.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C1[e-7]),v.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(_.push(this.ToffsetWires1C2[e-12]),_.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-11]),T.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-10]),L.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1C2[e-9]),P.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[e-8]),b.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-7]),D.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires1C1.length>=16&&(a.push(this.ToffsetWires1C1[e-16]),a.push(this.ToffsetWires1C1[e-8]),this.ToffsetArcWires1C=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-15]),c.push(this.ToffsetWires1C1[e-7]),this.ToffsetArcWires1C=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-14]),p.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-13]),d.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-12]),h.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C1[e-11]),v.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires1C1[e-10]),C.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1C1[e-9]),W.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(_.push(this.ToffsetWires1C2[e-16]),_.push(this.ToffsetWires1C2[e-8]),this.ToffsetArcWires2C=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-15]),T.push(this.ToffsetWires1C2[e-7]),this.ToffsetArcWires2C=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-14]),L.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires1C2[e-13]),P.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[e-12]),b.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-11]),D.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1C2[e-10]),R.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[e-9]),B.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2A1.length>=2&&(a.push(this.ToffsetWires2A1[e-2]),a.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(_.push(this.ToffsetWires2A2[e-2]),_.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires2A1.length>=4&&(a.push(this.ToffsetWires2A1[e-4]),a.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-3]),c.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(_.push(this.ToffsetWires2A2[e-4]),_.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-3]),T.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires2A1.length>=8&&(a.push(this.ToffsetWires2A1[e-8]),a.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-7]),c.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-6]),p.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-5]),d.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(_.push(this.ToffsetWires2A2[e-8]),_.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-7]),T.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-6]),L.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2A2[e-5]),P.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires2A1.length>=12&&(a.push(this.ToffsetWires2A1[e-12]),a.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-11]),c.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-10]),p.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-9]),d.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-8]),h.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A1[e-7]),v.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(_.push(this.ToffsetWires2A2[e-12]),_.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-11]),T.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-10]),L.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2A2[e-9]),P.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[e-8]),b.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-7]),D.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires2A1.length>=16&&(a.push(this.ToffsetWires2A1[e-16]),a.push(this.ToffsetWires2A1[e-8]),this.ToffsetArcWires1A2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-15]),c.push(this.ToffsetWires2A1[e-7]),this.ToffsetArcWires1A2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-14]),p.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-13]),d.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-12]),h.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A1[e-11]),v.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires2A1[e-10]),C.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2A1[e-9]),W.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(_.push(this.ToffsetWires2A2[e-16]),_.push(this.ToffsetWires2A2[e-8]),this.ToffsetArcWires2A2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-15]),T.push(this.ToffsetWires2A2[e-7]),this.ToffsetArcWires2A2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-14]),L.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2A2[e-13]),P.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[e-12]),b.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-11]),D.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2A2[e-10]),R.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[e-9]),B.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2B1.length>=2&&(a.push(this.ToffsetWires2B1[e-2]),a.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(_.push(this.ToffsetWires2B2[e-2]),_.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires2B1.length>=4&&(a.push(this.ToffsetWires2B1[e-4]),a.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-3]),c.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(_.push(this.ToffsetWires2B2[e-4]),_.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-3]),T.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires2B1.length>=8&&(a.push(this.ToffsetWires2B1[e-8]),a.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-7]),c.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-6]),p.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-5]),d.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(_.push(this.ToffsetWires2B2[e-8]),_.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-7]),T.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-6]),L.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2B2[e-5]),P.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires2B1.length>=12&&(a.push(this.ToffsetWires2B1[e-12]),a.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-11]),c.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-10]),p.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-9]),d.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-8]),h.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B1[e-7]),v.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(_.push(this.ToffsetWires2B2[e-12]),_.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-11]),T.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-10]),L.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2B2[e-9]),P.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[e-8]),b.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-7]),D.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires2B1.length>=16&&(a.push(this.ToffsetWires2B1[e-16]),a.push(this.ToffsetWires2B1[e-8]),this.ToffsetArcWires1B2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-15]),c.push(this.ToffsetWires2B1[e-7]),this.ToffsetArcWires1B2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-14]),p.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-13]),d.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-12]),h.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B1[e-11]),v.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires2B1[e-10]),C.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2B1[e-9]),W.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(_.push(this.ToffsetWires2B2[e-16]),_.push(this.ToffsetWires2B2[e-8]),this.ToffsetArcWires2B2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-15]),T.push(this.ToffsetWires2B2[e-7]),this.ToffsetArcWires2B2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-14]),L.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2B2[e-13]),P.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[e-12]),b.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-11]),D.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2B2[e-10]),R.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[e-9]),B.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const a=[],c=[],p=[],d=[],h=[],v=[],C=[],W=[],_=[],T=[],L=[],P=[],b=[],D=[],R=[],B=[];switch(this.LineInfo.Wairnum){case w.单分裂:this.ToffsetWires2C1.length>=2&&(a.push(this.ToffsetWires2C1[e-2]),a.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(_.push(this.ToffsetWires2C2[e-2]),_.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.双分裂:this.ToffsetWires2C1.length>=4&&(a.push(this.ToffsetWires2C1[e-4]),a.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-3]),c.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(_.push(this.ToffsetWires2C2[e-4]),_.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-3]),T.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.四分裂:this.ToffsetWires2C1.length>=8&&(a.push(this.ToffsetWires2C1[e-8]),a.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-7]),c.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-6]),p.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-5]),d.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(_.push(this.ToffsetWires2C2[e-8]),_.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-7]),T.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-6]),L.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2C2[e-5]),P.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.六分裂:this.ToffsetWires2C1.length>=12&&(a.push(this.ToffsetWires2C1[e-12]),a.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-11]),c.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-10]),p.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-9]),d.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-8]),h.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C1[e-7]),v.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(_.push(this.ToffsetWires2C2[e-12]),_.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-11]),T.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-10]),L.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2C2[e-9]),P.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[e-8]),b.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-7]),D.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case w.八分裂:this.ToffsetWires2C1.length>=16&&(a.push(this.ToffsetWires2C1[e-16]),a.push(this.ToffsetWires2C1[e-8]),this.ToffsetArcWires1C2=m(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-15]),c.push(this.ToffsetWires2C1[e-7]),this.ToffsetArcWires1C2=m(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-14]),p.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=m(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-13]),d.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=m(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-12]),h.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=m(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C1[e-11]),v.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=m(v,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),C.push(this.ToffsetWires2C1[e-10]),C.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=m(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2C1[e-9]),W.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=m(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(_.push(this.ToffsetWires2C2[e-16]),_.push(this.ToffsetWires2C2[e-8]),this.ToffsetArcWires2C2=m(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-15]),T.push(this.ToffsetWires2C2[e-7]),this.ToffsetArcWires2C2=m(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-14]),L.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=m(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),P.push(this.ToffsetWires2C2[e-13]),P.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=m(P,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[e-12]),b.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=m(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-11]),D.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=m(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2C2[e-10]),R.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=m(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线7"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[e-9]),B.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=m(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线8"+(r-1)+"-"+r,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case w.单分裂:t=t+1;break;case w.双分裂:t=t+2;break;case w.四分裂:t=t+4;break;case w.六分裂:t=t+6;break;case w.八分裂:t=t+8;break}})}getWireDataForChannelCalculation(){return{arcLine1A1:this.arcLine1A1,arcLine1B1:this.arcLine1B1,arcLine1C1:this.arcLine1C1}}getWireDataForChannelCalculationByTowerRange(t,e){if(t<0||e>=this.LineInfo.towers.length||t>e)return console.warn(`无效的杆塔索引范围: ${t} - ${e}`),{arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};const i=[],r=[],n=[],o=this.LineInfo.towers,f={minLon:Math.min(...o.slice(t,e+1).map(l=>l.Longitude)),maxLon:Math.max(...o.slice(t,e+1).map(l=>l.Longitude)),minLat:Math.min(...o.slice(t,e+1).map(l=>l.Latitude)),maxLat:Math.max(...o.slice(t,e+1).map(l=>l.Latitude))},u=.005;return f.minLon-=u,f.maxLon+=u,f.minLat-=u,f.maxLat+=u,this.arcLine1A1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&i.push(l)}),this.arcLine1B1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&r.push(l)}),this.arcLine1C1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&n.push(l)}),{arcLine1A1:i,arcLine1B1:r,arcLine1C1:n}}parseWireEntityName(t){const e=t.match(/^导线(\d+)_([ABC])\d*(\d+)-(\d+)$/);return e?{circuit:parseInt(e[1]),phase:e[2],startTowerIndex:parseInt(e[3]),endTowerIndex:parseInt(e[4])}:null}getWireSegmentByTowerRange(t,e){const i={arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};return this.LineentityCollection2.values.forEach(r=>{if(r.name&&r.polyline&&r.polyline.positions){const n=this.parseWireEntityName(r.name);if(n&&n.circuit===1&&n.startTowerIndex===t&&n.endTowerIndex===e){const o=r.polyline.positions.getValue(g.JulianDate.now());if(o&&o.length>0){const f=[];for(let u=0;u<o.length;u++){const l=g.Cartographic.fromCartesian(o[u]);f.push([g.Math.toDegrees(l.longitude),g.Math.toDegrees(l.latitude),l.height])}switch(n.phase){case"A":i.arcLine1A1=f;break;case"B":i.arcLine1B1=f;break;case"C":i.arcLine1C1=f;break}}}}}),i}getAllWireSegments(){const t=[],e=[],i=[],r=new Map;return this.LineInfo&&this.LineInfo.towers&&this.LineInfo.towers.forEach((n,o)=>{r.set(n.id,o),n.name&&r.set(n.name,o)}),this.LineentityCollection2.values.forEach(n=>{if(n.name&&n.polyline&&n.polyline.positions){const o=this.parseWireEntityName(n.name);if(o&&o.circuit===1){const f=n.polyline.positions.getValue(g.JulianDate.now());if(f&&f.length>0){const u=[];for(let c=0;c<f.length;c++){const p=g.Cartographic.fromCartesian(f[c]);u.push([g.Math.toDegrees(p.longitude),g.Math.toDegrees(p.latitude),p.height])}const l=o.startTowerIndex,a=r.get(l)??l;switch(o.phase){case"A":t[a]=u;break;case"B":e[a]=u;break;case"C":i[a]=u;break}}}}}),console.log(`从LineentityCollection2提取导线数据完成: A相${t.length}段, B相${e.length}段, C相${i.length}段`),{wireSegments1A1:t,wireSegments1B1:e,wireSegments1C1:i}}getOffsetTowers(){return this.offsetTowers}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}flyToTower(t){if(t<0||t>=this.offsetTowers.length){console.warn(`Invalid tower index: ${t}. Valid range: 0-${this.offsetTowers.length-1}`);return}const e=this.offsetTowers[t];console.log(e),this.viewer.camera.flyTo({destination:e,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}loadLineTower(){this.initializeLineData(),this.isDynamicLoadingEnabled?(this.loadAllWiresOnly(),this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllWiresOnly(){const t=new g.EntityCollection,e=this.entityCollection2;this.entityCollection2=t,this.loadAllTowersAtOnce();const i=[];t.values.forEach(r=>{var n;r.name&&(r.name.includes("导线")||r.name.includes("daoxian")||(n=r.id)!=null&&n.toString().includes("daoxian"))&&i.push(r)}),this.entityCollection2=e,i.forEach(r=>{this.entityCollection2.add(r)}),t.removeAll()}getArcLine1A1(){return this.arcLine1A1}getArcLine1B1(){return this.arcLine1B1}getArcLine1C1(){return this.arcLine1C1}}const En=class En{constructor(t,e,i){I(this,"viewer");I(this,"LineInfo");I(this,"Keym","");I(this,"offsetTrees",[]);I(this,"dataSourcetree");I(this,"entityCollectiontree");I(this,"isDynamicLoadingEnabled",!0);I(this,"loadedTreeIndices",new Set);I(this,"isTreeModelRemoved",!1);I(this,"modelCache",new Map);this.Keym=i,this.viewer=t,this.LineInfo=e,this.dataSourcetree=new g.CustomDataSource(this.LineInfo.LineID+"tree"),this.entityCollectiontree=this.dataSourcetree.entities}createModelCacheKey(t,e,i,r){return`${t}_${e}_${i}_${r}`}getCachedModelConfig(t,e,i,r){const n=Math.max(0,i),o=Math.min(r,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}getVisibleTreeIndices(){var n;if(!this.viewer.camera||this.offsetTrees.length===0)return[];const t=this.viewer.camera.position,e=((n=this.viewer.camera.positionCartographic)==null?void 0:n.height)||1e3;let i=Math.max(5e3,e*2);console.log(`相机高度: ${e}, 加载距离: ${i}`),e>5e4&&(i=1e5);const r=[];for(let o=0;o<this.offsetTrees.length;o++){const f=this.offsetTrees[o];g.Cartesian3.distance(t,f)<=i&&r.push(o)}if(r.length===0&&this.offsetTrees.length>0){const o=Math.min(20,this.offsetTrees.length);for(let f=0;f<o;f++)r.push(f)}return r}updateVisibleTrees(){if(this.isTreeModelRemoved)return;const t=this.getVisibleTreeIndices(),e=[];this.loadedTreeIndices.forEach(i=>{t.includes(i)||e.push(i)}),e.forEach(i=>{const r="tree-"+this.LineInfo.Trees[i].id;this.entityCollectiontree.removeById(r),this.loadedTreeIndices.delete(i)}),t.forEach(i=>{if(!this.loadedTreeIndices.has(i))if(i>=0&&i<this.offsetTrees.length&&i<this.LineInfo.Trees.length){const r=this.offsetTrees[i],n=this.LineInfo.Trees[i];r&&n?(this.loadTreeAtIndex(i,r),this.loadedTreeIndices.add(i)):console.warn(`跳过无效的动态加载树木数据,索引: ${i}`)}else console.warn(`动态加载树木索引超出范围: ${i}`)})}loadTree(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.Trees.forEach(t=>{this.offsetTrees.push(g.Cartesian3.fromDegrees(t.lon,t.lat,t.alt))}),this.entityCollectiontree.show=!0,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce())}loadAllTreesAtOnce(){this.LineInfo.Trees.length!==this.offsetTrees.length&&console.warn(`树木数据长度 (${this.LineInfo.Trees.length}) 与位置数据长度 (${this.offsetTrees.length}) 不匹配`);const t=Math.min(this.LineInfo.Trees.length,this.offsetTrees.length);for(let e=0;e<t;e++){const i=this.LineInfo.Trees[e],r=this.offsetTrees[e];i&&r?this.loadTreeAtIndex(e,r):console.warn(`跳过无效的树木数据,索引: ${e}`)}}loadTreeAtIndex(t,e){const i=this.LineInfo.Trees[t];if(!i.modelurl||i.modelurl.trim()===""){console.warn(`Tree ${t} has invalid model URL: ${i.modelurl}. Skipping...`);return}let r=1;i.treeScale>0&&i.treeH>0?(r=i.treeH/i.treeScale,r<=0&&(r=1)):i.treeH>0&&(r=i.treeH);const n=this.getCachedModelConfig(i.modelurl,r,0,2e4);this.entityCollectiontree.add(Pn("tree-"+i.id,e,"tree-"+i.id,n.uri,new g.HeadingPitchRoll(0,0,0),n.scale,n.distanceDisplayCondition))}flyToTree(t){if(t<0||t>=this.LineInfo.Trees.length){console.warn(`Invalid tree index: ${t}. Valid range: 0-${this.LineInfo.Trees.length-1}`);return}const e=this.LineInfo.Trees[t],i=g.Cartesian3.fromDegrees(e.lon,e.lat,e.alt+(e.treeH||0));this.viewer.camera.flyTo({destination:i,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}removeTreeModels(){this.isTreeModelRemoved=!0,this.entityCollectiontree.removeAll(),this.loadedTreeIndices.clear()}restoreTreeModels(){this.isTreeModelRemoved=!1,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce()}addTreeData(t){this.LineInfo.Trees.push(t)}getTreeCoordinates(){return this.LineInfo.Trees.map(t=>[t.lon,t.lat,Number(t.alt||0)+Number(t.treeH||0)])}getOffsetTrees(){return this.offsetTrees}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getTerrainDataSources(){return[this.dataSourcetree]}static getTreeEntityPrefix(){return En.TREE_ENTITY_PREFIX}};I(En,"TREE_ENTITY_PREFIX","tree-");let lo=En;class vu{constructor(t){I(this,"viewer");I(this,"dataSourceplotting");I(this,"entityCollectionplotting");I(this,"terrainVerificationCache",new Map);I(this,"terrainVerificationResultCache",new Map);I(this,"maxVisibleResults",200);I(this,"terrainVerificationBatchIndex",0);I(this,"terrainVerificationTotalBatches",0);I(this,"terrainVerificationIsRunning",!1);I(this,"terrainVerificationBatchSize",100);I(this,"cameraMoveHandler",null);I(this,"isDynamicTerrainVerificationEnabled",!1);I(this,"wireClickHandler",null);I(this,"distanceRuleConfig",new Oa);this.viewer=t,this.dataSourceplotting=new g.CustomDataSource("plotting"),this.entityCollectionplotting=this.dataSourceplotting.entities}ensurePlottingDataSourceAdded(){this.viewer.dataSources.contains(this.dataSourceplotting)||this.viewer.dataSources.add(this.dataSourceplotting),this.entityCollectionplotting.show=!0}calcResultByType(t,e,i,r,n,o=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const f=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(f)){const u=this.terrainVerificationCache.get(f);Ir(t,u,this.entityCollectionplotting,o,n);return}else{const u=wn(t,e,i,r);this.terrainVerificationCache.set(f,u),Ir(t,u,this.entityCollectionplotting,o||this.distanceRuleConfig,n)}}performTerrainVerification(t,e,i,r,n=null,o,f=Q.全部测量){const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`,l=wn(t,e,i,r);this.terrainVerificationCache.set(u,l);const a=Fa(t,l,o??"unknown");return Ir(t,l,this.entityCollectionplotting,n||this.distanceRuleConfig,f),a}setMaxVisibleTerrainResults(t=200){this.maxVisibleResults=Math.max(10,t)}setDistanceRuleConfig(t){this.distanceRuleConfig={...this.distanceRuleConfig,...t}}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}drawCorridorPolygon(t,e="corridor-polygon"){if(!t||t.length<3)return;this.ensurePlottingDataSourceAdded();const i=t.map(n=>g.Cartesian3.fromDegrees(n[0],n[1])),r=this.entityCollectionplotting.add({name:e,polygon:{hierarchy:new g.PolygonHierarchy(i),material:g.Color.GREEN.withAlpha(.3),outline:!0,outlineColor:g.Color.GREEN,outlineWidth:2,heightReference:g.HeightReference.CLAMP_TO_GROUND,perPositionHeight:!1}});this.terrainVerificationResultCache.has("corridor-polygon")||this.terrainVerificationResultCache.set("corridor-polygon",[]),this.terrainVerificationResultCache.get("corridor-polygon").push(r)}drawCorridorDistanceMarkers(t,e,i="corridor-markers",r=!0){!t||t.length<2||(this.ensurePlottingDataSourceAdded(),this.addPerpendicularWidthMarkers(t,e,i),r&&this.addParallelIntervalMarkers(t,e,10,i))}addPerpendicularWidthMarkers(t,e,i){const r=t[0],n=t.length>1?t[1]:t[t.length-1],o=g.Cartesian3.fromDegrees(r[0],r[1]),f=g.Cartesian3.fromDegrees(n[0],n[1]),u=g.Cartesian3.subtract(f,o,new g.Cartesian3);g.Cartesian3.normalize(u,u);const l=g.Cartesian3.clone(o);g.Cartesian3.normalize(l,l);const a=g.Cartesian3.cross(l,u,new g.Cartesian3);g.Cartesian3.normalize(a,a);const c=e,p=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,c,new g.Cartesian3),new g.Cartesian3),d=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,-c,new g.Cartesian3),new g.Cartesian3),h=g.Cartographic.fromCartesian(p),v=g.Cartographic.fromCartesian(d),C=g.Math.toDegrees(h.longitude),W=g.Math.toDegrees(h.latitude),_=g.Math.toDegrees(v.longitude),T=g.Math.toDegrees(v.latitude),L=this.entityCollectionplotting.add({name:`${i}-left-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(r[0],r[1]),g.Cartesian3.fromDegrees(C,W)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}}),P=this.entityCollectionplotting.add({name:`${i}-right-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(r[0],r[1]),g.Cartesian3.fromDegrees(_,T)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(L),this.terrainVerificationResultCache.get("corridor-markers").push(P)}addParallelIntervalMarkers(t,e,i,r){if(t.length<2||e<=0||i<=0)return;let n=i,o=1;for(;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!0);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${r}-parallel-left-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=i,o++}for(n=i,o=1;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!1);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${r}-parallel-right-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=i,o++}}createOffsetLine(t,e,i){if(t.length<2)return[];const r=ue(t),n=e/1e3;try{const o=i?-n:n,f=cf(r,o,{units:"kilometers"});if(f.geometry.type==="LineString")return f.geometry.coordinates.map(u=>g.Cartesian3.fromDegrees(u[0],u[1]))}catch(o){console.warn("Failed to create offset line:",o)}return[]}clearCorridorDistanceMarkers(){try{if(this.terrainVerificationResultCache&&this.terrainVerificationResultCache.has("corridor-markers")){const t=this.terrainVerificationResultCache.get("corridor-markers");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const i=t[e];try{i&&this.entityCollectionplotting.remove(i)}catch{}}this.terrainVerificationResultCache.delete("corridor-markers")}}catch(t){console.warn("Error clearing corridor distance markers:",t)}}clearCorridorPolygon(){try{if(this.terrainVerificationResultCache){const t=this.terrainVerificationResultCache.get("corridor-polygon");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const i=t[e];try{i&&this.entityCollectionplotting.remove(i)}catch{}}this.terrainVerificationResultCache.delete("corridor-polygon")}}catch(t){console.warn("Error clearing corridor polygon:",t)}}getClickDistanceRuleConfig(){return{...this.distanceRuleConfig}}clearTreeDistanceResultsExceptCorridor(){const t=[];this.entityCollectionplotting&&this.entityCollectionplotting.values.forEach(e=>{(!e.name||!e.name.startsWith("corridor-"))&&t.push(e)});for(let e=t.length-1;e>=0;e--){const i=t[e];try{this.entityCollectionplotting.remove(i)}catch{}}this.terrainVerificationCache.clear(),this.terrainVerificationResultCache.forEach((e,i)=>{i.startsWith("corridor-")||this.terrainVerificationResultCache.delete(i)})}clearTreeDistanceResults(){try{if(this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll()}catch(t){console.warn("Failed to removeAll entities:",t)}}catch(t){console.warn("Error clearing tree distance results:",t)}try{this.terrainVerificationCache.clear()}catch(t){console.warn("Failed to clear terrain verification cache:",t)}try{this.terrainVerificationResultCache.clear()}catch(t){console.warn("Failed to clear terrain verification result cache:",t)}}LineChannelTerrainVerification(t,e,i,r,n,o=100,f){if(this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResults(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始地物校验:共${t.length}棵树,分${this.terrainVerificationTotalBatches}批处理`),this.processTerrainVerificationBatch(t,e,i,r,n,Q.全部测量,f)}processTerrainVerificationBatch(t,e,i,r,n,o=Q.全部测量,f,u=[]){if(!this.terrainVerificationIsRunning||this.terrainVerificationBatchIndex>=this.terrainVerificationTotalBatches){this.terrainVerificationIsRunning=!1,console.log("地物校验完成"),f&&f(u);return}const l=this.terrainVerificationBatchIndex*this.terrainVerificationBatchSize,a=Math.min(l+this.terrainVerificationBatchSize,t.length);console.log(`处理第${this.terrainVerificationBatchIndex+1}/${this.terrainVerificationTotalBatches}批:${l}-${a}`);const c=[];for(let p=l;p<a;p++){const d=t[p];if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],v=this.performTerrainVerification(h,i,r,n,null,d.id,o);v&&c.push(v)}}u.push(...c),this.terrainVerificationBatchIndex++,setTimeout(()=>{this.processTerrainVerificationBatch(t,e,i,r,n,o,f,u)},0)}stopLineChannelTerrainVerification(){this.terrainVerificationIsRunning=!1,console.log("地物校验已停止")}enableVisibleAreaTerrainVerification(t,e,i,r,n){this.isDynamicTerrainVerificationEnabled=!0,this.setupCameraMoveListenerForTerrainVerification(t,e,i,r,n)}disableVisibleAreaTerrainVerification(){this.isDynamicTerrainVerificationEnabled=!1,this.cameraMoveHandler&&(this.cameraMoveHandler(),this.cameraMoveHandler=null)}setupCameraMoveListenerForTerrainVerification(t,e,i,r,n){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleAreaTerrainVerification(t,e,i,r,n)})}updateVisibleAreaTerrainVerification(t,e,i,r,n){if(!this.isDynamicTerrainVerificationEnabled)return;this.getVisibleTreeIndices(e).forEach(f=>{const u=t[f];if(u){const l=[u.lon,u.lat,Number(u.alt||0)+Number(u.treeH||0)];this.performTerrainVerification(l,i,r,n)}})}getVisibleTreeIndices(t){var o;if(!this.viewer.camera||t.length===0)return[];const e=this.viewer.camera.position,i=((o=this.viewer.camera.positionCartographic)==null?void 0:o.height)||1e3;let r=Math.max(5e3,i*2);i>5e4&&(r=1e5);const n=[];for(let f=0;f<t.length;f++){const u=t[f];g.Cartesian3.distance(e,u)<=r&&n.push(f)}return n}loadTreeListen(t,e,i,r,n,o=Q.全部测量){this.cameraMoveHandler&&this.removeTreeListen();const f=(l,a)=>{const c=l.scene.pick(a);if(g.defined(c)){let p=c.id;if(p===void 0&&c.primitive&&(p=c.primitive.id),p instanceof g.Entity)return p}};this.ensurePlottingDataSourceAdded(),new g.ScreenSpaceEventHandler(this.viewer.canvas).setInputAction(l=>{const a=f(this.viewer,l.position);if(a&&a.id){const c=String(a.id);if(c.startsWith("tree-")){const p=c.substring(5),d=t.find(h=>h&&h.id&&String(h.id)===p);if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],v=wn(h,e,i,r),C=Fa(h,v,d.id);n&&C&&n(C),Ir(h,v,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),o)}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeTreeListen(){if(this.cameraMoveHandler){try{this.cameraMoveHandler()}catch{}this.cameraMoveHandler=null}if(this.dataSourceplotting&&this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll(),this.entityCollectionplotting.show=!1}catch(t){console.warn("Error clearing tree listen entities:",t)}}loadWireListen(t,e,i,r,n,o){this.wireClickHandler&&this.removeWireListen();const f=(u,l)=>{const a=u.scene.pick(l);if(g.defined(a)){let c=a.id;if(c===void 0&&a.primitive&&(c=a.primitive.id),c instanceof g.Entity)return c}};this.ensurePlottingDataSourceAdded(),this.wireClickHandler=new g.ScreenSpaceEventHandler(this.viewer.canvas),this.wireClickHandler.setInputAction(u=>{const l=f(this.viewer,u.position);if(l&&l.id){const a=String(l.id),c=l.name||"";if(a.includes("daoxian")||c.includes("导线")||c.includes("daoxian")){n&&l&&n(l);const d=this.viewer.scene.pickPosition(u.position);if(g.defined(d)){let h=null;if(l&&l.polyline&&l.polyline.positions){const v=l.polyline.positions.getValue(this.viewer.clock.currentTime);v&&Array.isArray(v)&&(h=v.map(C=>{const W=g.Cartographic.fromCartesian(C);return[g.Math.toDegrees(W.longitude),g.Math.toDegrees(W.latitude),W.height]}))}if((!h||h.length===0)&&(c.match(/(\d+)-(\d+)$/)&&(c.includes("A")||c.includes("_A")?h=e:c.includes("B")||c.includes("_B")?h=i:(c.includes("C")||c.includes("_C"))&&(h=r)),(!h||h.length===0)&&(h=[...e,...i,...r])),h&&h.length>1){const v=(o==null?void 0:o.measurementType)||Q.全部测量,C=[Q.对地距离,Q.净空距离,Q.安全距离].includes(v),W=C||v===Q.全部测量,_=!C||v===Q.全部测量,T=W?1:10,L=this.interpolateWire(h,T);if(W&&this.calculateAndDrawWireToGroundDistanceByType(L,v).catch(P=>{console.error("Error in wire to ground distance calculation:",P)}),_){const P=(o==null?void 0:o.width)||10,b=(o==null?void 0:o.show)!==!1,D=t.filter(R=>{const B=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)];return this.isPointInWireCorridor(B,L,P)});b&&this.drawWireCorridor(L,P,`wire-corridor-${Date.now()}`),this.terrainVerificationCache.clear(),D.forEach(R=>{const B=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)];this.calcResultSingleWire(B,L,v,this.getClickDistanceRuleConfig())})}}}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeWireListen(){this.wireClickHandler&&(this.wireClickHandler.destroy(),this.wireClickHandler=null),this.clearWireCorridors()}getGroundElevation(t,e){return 0}calculateWireToGroundDistance(t){let e=1/0,i=[],r=[];for(const n of t){const[o,f,u]=n,l=this.getGroundElevation(o,f),a=Math.abs(u-l);a<e&&(e=a,i=n,r=[o,f,l])}return{distance:e,wirePoint:i,groundPoint:r}}async calculateAndDrawWireToGroundDistanceByType(t,e){if(!(!t||t.length===0))try{const i=t.map(a=>new g.Cartographic(g.Math.toRadians(a[0]),g.Math.toRadians(a[1]))),r=this.viewer.terrainProvider;let n=[];if(r&&g.defined(r))try{n=(await g.sampleTerrainMostDetailed(r,i)).map(c=>c.height||0)}catch(a){console.warn("Terrain sampling failed, using default ground height:",a),n=new Array(t.length).fill(0)}else n=new Array(t.length).fill(0);let o=1/0,f=0;for(let a=0;a<t.length;a++){const c=t[a][2],p=n[a],d=c-p;d>0&&d<o&&(o=d,f=a)}if(o===1/0){o=1/0;for(let a=0;a<t.length;a++){const c=t[a][2],p=n[a],d=Math.abs(c-p);d<o&&(o=d,f=a)}}const u=t[f],l=[u[0],u[1],n[f]];this.drawWireToGroundDistanceByType(u,l,o,e)}catch(i){console.warn("Failed to calculate wire to ground distance:",i);const r=this.calculateWireToGroundDistance(t);this.drawWireToGroundDistanceByType(r.wirePoint,r.groundPoint,r.distance,e)}}async calculateAndDrawWireToGroundDistanceBySegments(t,e,i,r){console.log("Calculating wire to ground distance by segments..."),console.log("A相导线数据点数:",(t==null?void 0:t.length)||0),console.log("B相导线数据点数:",(e==null?void 0:e.length)||0),console.log("C相导线数据点数:",(i==null?void 0:i.length)||0);const n=[];if(t&&t.length>=2&&n.push({name:"A",data:t}),e&&e.length>=2&&n.push({name:"B",data:e}),i&&i.length>=2&&n.push({name:"C",data:i}),console.log("有效相数:",n.length),n.length===0){console.warn("No valid wire data found for ground distance calculation");return}for(const o of n){const f=o.data;console.log(`处理${o.name}相导线,数据点数:`,f.length);const u=this.interpolateWire(f,1);console.log(`${o.name}相插值后点数:`,u.length);try{const l=u.map(C=>new g.Cartographic(g.Math.toRadians(C[0]),g.Math.toRadians(C[1]))),a=this.viewer.terrainProvider;let c=[];if(a&&g.defined(a))try{c=(await g.sampleTerrainMostDetailed(a,l)).map(W=>W.height||0)}catch(C){console.warn(`Terrain sampling failed for phase ${o.name}, using default ground height:`,C),c=new Array(u.length).fill(0)}else c=new Array(u.length).fill(0);let p=1/0,d=0;for(let C=0;C<u.length;C++){const W=u[C][2],_=c[C],T=W-_;T>0&&T<p&&(p=T,d=C)}if(p===1/0)for(let C=0;C<u.length;C++){const W=u[C][2],_=c[C],T=Math.abs(W-_);T<p&&(p=T,d=C)}console.log(`${o.name}相最低净空距离:`,p,"在索引:",d);const h=u[d],v=[h[0],h[1],c[d]];this.drawWireToGroundDistanceByType(h,v,p,r)}catch(l){console.warn(`Failed to calculate wire to ground distance for phase ${o.name}:`,l)}}console.log("Wire to ground distance calculation by segments completed.")}getDistanceTypeLabel(t,e){const i=`${e.toFixed(1)}米`;switch(t){case Q.对地距离:return`对地距离${i}`;case Q.净空距离:return`净空距离${i}`;case Q.安全距离:return`安全距离${i}`;case Q.全部测量:return`净空距离${i}`;default:return`距离${i}`}}drawWireToGroundDistanceByType(t,e,i,r){const n=[g.Cartesian3.fromDegrees(t[0],t[1],t[2]),g.Cartesian3.fromDegrees(e[0],e[1],e[2])];let o="#eff819",f=g.Color.RED;const u=this.distanceRuleConfig;let l,a=!1;if(r===Q.净空距离&&u.clearanceLevels?l=u.clearanceLevels.find(c=>i>=c.minDistance&&i<=c.maxDistance):r===Q.对地距离&&u.verticalLevels?l=u.verticalLevels.find(c=>i>=c.minDistance&&i<=c.maxDistance):r===Q.安全距离&&u.clearanceLevels?l=u.clearanceLevels.find(c=>i>=c.minDistance&&i<=c.maxDistance):r===Q.全部测量&&u.clearanceLevels&&(l=u.clearanceLevels.find(c=>i>=c.minDistance&&i<=c.maxDistance)),l?(o=l.color,f=g.Color.fromCssColorString(l.color)):(a=!0,o="#00ff00",f=g.Color.GREEN),l||a){this.entityCollectionplotting.add({polyline:{positions:n,width:2,material:f,clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const c=g.Cartesian3.midpoint(n[0],n[1],new g.Cartesian3);this.entityCollectionplotting.add({position:c,name:"净空距离",label:{text:this.getDistanceTypeLabel(r,i),fillColor:g.Color.fromCssColorString(o),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE}})}}clearWireCorridors(){if(!this.entityCollectionplotting)return;const t=[];this.entityCollectionplotting.values.forEach(e=>{e.name==="wire-corridor"&&t.push(e)}),t.forEach(e=>{try{this.entityCollectionplotting.remove(e)}catch{}})}interpolateWire(t,e=1){if(t.length<2)return t;const i=[];for(let r=0;r<t.length-1;r++){const n=t[r],o=t[r+1],f=g.Cartesian3.fromDegrees(n[0],n[1],n[2]),u=g.Cartesian3.fromDegrees(o[0],o[1],o[2]),l=g.Cartesian3.distance(f,u);if(l<=e){r===0&&i.push(n),i.push(o);continue}const a=Math.ceil(l/e),c=1/a;r===0&&i.push(n);for(let p=1;p<a;p++){const d=p*c,h=g.Cartesian3.lerp(f,u,d,new g.Cartesian3),v=g.Cartographic.fromCartesian(h),C=g.Math.toDegrees(v.longitude),W=g.Math.toDegrees(v.latitude),_=v.height;i.push([C,W,_])}i.push(o)}return i}isPointInWireCorridor(t,e,i){if(e.length<2)return!1;const r=g.Cartesian3.fromDegrees(t[0],t[1],t[2]);let n=1/0;for(let o=0;o<e.length-1;o++){const f=e[o],u=e[o+1],l=g.Cartesian3.fromDegrees(f[0],f[1],f[2]),a=g.Cartesian3.fromDegrees(u[0],u[1],u[2]),c=this.calculatePointToSegmentDistance(r,l,a);c<n&&(n=c)}return n<=i/2}calculatePointToSegmentDistance(t,e,i){const r=g.Cartesian3.subtract(i,e,new g.Cartesian3),n=g.Cartesian3.subtract(t,e,new g.Cartesian3),o=g.Cartesian3.magnitudeSquared(r);if(o===0)return g.Cartesian3.distance(t,e);const f=g.Cartesian3.dot(n,r)/o;let u;return f<0?u=e:f>1?u=i:u=g.Cartesian3.add(e,g.Cartesian3.multiplyByScalar(r,f,new g.Cartesian3),new g.Cartesian3),g.Cartesian3.distance(t,u)}drawWireCorridor(t,e,i){if(t.length<2)return;const r=[],n=[];for(let f=0;f<t.length;f++){const u=t[f],l=g.Cartesian3.fromDegrees(u[0],u[1],u[2]);let a,c;if(f===0){const L=t[f+1];c=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),a=l}else if(f===t.length-1){const L=t[f-1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=l}else{const L=t[f-1],P=t[f+1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=g.Cartesian3.fromDegrees(P[0],P[1],P[2])}const p=g.Cartesian3.subtract(c,a,new g.Cartesian3);g.Cartesian3.normalize(p,p);const d=g.Cartesian3.clone(l);g.Cartesian3.normalize(d,d);const h=g.Cartesian3.cross(p,d,new g.Cartesian3);g.Cartesian3.normalize(h,h);const v=e/2,C=g.Cartesian3.multiplyByScalar(h,v,new g.Cartesian3),W=g.Cartesian3.multiplyByScalar(h,-v,new g.Cartesian3),_=g.Cartesian3.add(l,C,new g.Cartesian3),T=g.Cartesian3.add(l,W,new g.Cartesian3);r.push(_),n.push(T)}const o=[];o.push(...r),o.push(...n.reverse()),o.push(r[0]),this.entityCollectionplotting.add({id:i,name:"wire-corridor",polygon:{hierarchy:new g.PolygonHierarchy(o),material:g.Color.YELLOW.withAlpha(.3),outline:!0,outlineColor:g.Color.YELLOW,outlineWidth:2}})}calcResult(t,e,i,r,n=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const o=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(o)){const f=this.terrainVerificationCache.get(o);Ir(t,f,this.entityCollectionplotting,n,Q.全部测量);return}else{const f=wn(t,e,i,r);this.terrainVerificationCache.set(o,f),Ir(t,f,this.entityCollectionplotting,n||this.distanceRuleConfig,Q.全部测量)}}calcResultSingleWire(t,e,i,r=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const n=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(n)){const o=this.terrainVerificationCache.get(n);Ir(t,o,this.entityCollectionplotting,r,i);return}else{const o=e;this.terrainVerificationCache.set(n,o),Ir(t,o,this.entityCollectionplotting,r||this.distanceRuleConfig,i)}}LineChannelTerrainVerificationForFilteredTrees(t,e,i,r,n,o=100,f=Q.全部测量,u){if(console.log(`LineChannelTerrainVerificationForFilteredTrees called with ${t.length} trees`),this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResultsExceptCorridor(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始对${t.length}棵树进行地物校验`),this.processTerrainVerificationBatch(t,e,i,r,n,f,u)}getChannelCalculationDataSources(){return[this.dataSourceplotting]}}class _u{constructor(t,e,i){I(this,"viewer");I(this,"LineInfo");I(this,"lineConstruction");I(this,"terrainConstruction");I(this,"channelCalculation");I(this,"selectedWireEntity",null);I(this,"originalWireColor",null);I(this,"wireCorridorWidth",10);I(this,"showWireCorridor",!0);I(this,"wireMeasurementType",Q.全部测量);I(this,"isDynamicLoadingEnabled",!0);this.viewer=t,this.LineInfo=e,this.lineConstruction=new mu(t,e,i),this.terrainConstruction=new lo(t,e,i),this.channelCalculation=new vu(t),this.enableWireMeasurement=this.enableWireMeasurement.bind(this),this.removeWireListen=this.removeWireListen.bind(this)}setAutoCalculateRollX(t){this.lineConstruction.setAutoCalculateRollX(t)}getAutoCalculateRollX(){return this.lineConstruction.getAutoCalculateRollX()}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t,this.lineConstruction.setDynamicLoadingEnabled(t),this.terrainConstruction.setDynamicLoadingEnabled(t)}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}initializeLineData(){this.lineConstruction.initializeLineData()}loadLineTower(){this.lineConstruction.loadLineTower()}loadLineModel(){this.lineConstruction.getLineDataSources().forEach(e=>{this.viewer.dataSources.contains(e)||this.viewer.dataSources.add(e)})}loadTree(){this.terrainConstruction.loadTree()}loadtreeModel(){this.terrainConstruction.getTerrainDataSources().forEach(t=>{this.viewer.dataSources.contains(t)||this.viewer.dataSources.add(t)})}addTreeData(t){this.terrainConstruction.addTreeData(t)}flyToTower(t){this.lineConstruction.flyToTower(t)}flyToTree(t){this.terrainConstruction.flyToTree(t)}loadTreeListen(t,e=Q.全部测量){const i=this.terrainConstruction.getLineInfo().Trees,r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadTreeListen(i,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1,t,e)}removeTreeListen(){this.channelCalculation.removeTreeListen()}loadWireListen(){const t=this.terrainConstruction.getLineInfo().Trees,e=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadWireListen(t,e.arcLine1A1,e.arcLine1B1,e.arcLine1C1)}removeWireListen(){if(this.channelCalculation.removeWireListen(),this.selectedWireEntity&&this.originalWireColor){try{this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor))}catch(t){console.warn("Error restoring wire color:",t)}this.selectedWireEntity=null,this.originalWireColor=null}}clearWireMeasurementResults(){this.channelCalculation.clearTreeDistanceResults()}enableWireMeasurement(){const t=this.terrainConstruction.getLineInfo().Trees,e=this.lineConstruction.getWireDataForChannelCalculation(),i=n=>{if(this.selectedWireEntity&&this.originalWireColor&&this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor)),n.polyline&&n.polyline.material){const o=n.polyline.material;o instanceof g.Color?this.originalWireColor=o.toCssColorString():this.originalWireColor="#ffffff",n.polyline.material=g.Color.YELLOW,this.selectedWireEntity=n}},r={width:this.wireCorridorWidth,show:this.showWireCorridor,measurementType:this.wireMeasurementType};this.channelCalculation.loadWireListen(t,e.arcLine1A1,e.arcLine1B1,e.arcLine1C1,i,r)}setWireCorridorWidth(t){this.wireCorridorWidth=t}setShowWireCorridor(t){this.showWireCorridor=t}setWireMeasurementType(t){this.wireMeasurementType=t}async LineChannelTerrainVerification(t,e=100){const i=this.terrainConstruction.getLineInfo().Trees,r=this.terrainConstruction.getOffsetTrees(),n=this.lineConstruction.getAllWireSegments();let o=[],f=[],u=[];if(n.wireSegments1A1.length>0)n.wireSegments1A1.forEach(l=>{l&&l.length>0&&o.push(...l)}),n.wireSegments1B1.forEach(l=>{l&&l.length>0&&f.push(...l)}),n.wireSegments1C1.forEach(l=>{l&&l.length>0&&u.push(...l)}),console.log(`使用按塔段存储的导线数据: A相=${o.length}点, B相=${f.length}点, C相=${u.length}点`),await this.calculateClearanceBySegments(n);else{const l=this.lineConstruction.getWireDataForChannelCalculation();o=l.arcLine1A1,f=l.arcLine1B1,u=l.arcLine1C1,console.log(`使用整体导线数据: A相=${o.length}点, B相=${f.length}点, C相=${u.length}点`)}this.channelCalculation.LineChannelTerrainVerification(i,r,o,f,u,e,t)}async calculateClearanceBySegments(t){var r,n,o;console.log("========== 开始按塔段计算净空距离 ==========");const e=Math.max(t.wireSegments1A1.length,t.wireSegments1B1.length,t.wireSegments1C1.length);console.log(`塔段总数: ${e}`),console.log(`A相塔段数: ${t.wireSegments1A1.length}`),console.log(`B相塔段数: ${t.wireSegments1B1.length}`),console.log(`C相塔段数: ${t.wireSegments1C1.length}`);const i=[];if(t.wireSegments1A1.length>0&&((r=t.wireSegments1A1[0])==null?void 0:r.length)>0?(i.push({key:"A",data:t.wireSegments1A1}),console.log("A相数据有效,加入计算")):console.log("A相数据无效或为空"),t.wireSegments1B1.length>0&&((n=t.wireSegments1B1[0])==null?void 0:n.length)>0?(i.push({key:"B",data:t.wireSegments1B1}),console.log("B相数据有效,加入计算")):console.log("B相数据无效或为空"),t.wireSegments1C1.length>0&&((o=t.wireSegments1C1[0])==null?void 0:o.length)>0?(i.push({key:"C",data:t.wireSegments1C1}),console.log("C相数据有效,加入计算")):console.log("C相数据无效或为空"),console.log(`有效相数: ${i.length} (${i.map(f=>f.key).join(", ")})`),i.length===0){console.log("没有有效相数据,跳过净空距离计算");return}for(let f=0;f<e;f++){console.log(`
5
- --- 处理塔段 ${f} ---`);for(const u of i){const l=u.data[f];if(!l){console.log(`${u.key} 塔段${f} 数据为空,跳过`);continue}if(l.length<2){console.log(`${u.key} 塔段${f} 点数不足(${l.length}),跳过`);continue}console.log(`${u.key} 塔段${f}: ${l.length}个点,开始计算净空距离`);try{await this.channelCalculation.calculateAndDrawWireToGroundDistanceByType(l,Q.净空距离),console.log(`${u.key} 塔段${f} 净空距离计算完成`)}catch(a){console.error(`${u.key} 塔段${f} 净空距离计算失败:`,a)}}}console.log(`
6
- ========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(t,e,i,r=100,n=2e3,o=!1,f=!0,u=Q.全部测量,l=1,a="ABC"){const c=this.LineInfo.towers;let p=-1,d=-1;for(let O=0;O<c.length;O++)(c[O].id==t||c[O].name==t)&&(p=O),(c[O].id==e||c[O].name==e)&&(d=O);if(p===-1||d===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验"),this.LineChannelTerrainVerification(i,r);return}p>d&&([p,d]=[d,p]);const h=this.lineConstruction.getAllWireSegments();console.log(`获取到的导线数据: A相${h.wireSegments1A1.length}段, B相${h.wireSegments1B1.length}段, C相${h.wireSegments1C1.length}段`),console.log(`杆塔索引范围: ${p} - ${d}`),console.log(`A相导线数据索引检查: 索引${p}存在=${!!h.wireSegments1A1[p]}, 索引${d-1}存在=${!!h.wireSegments1A1[d-1]}`);const v=[],C=[],W=[];for(let O=p;O<d;O++)console.log(`检查塔段索引${O}: A相存在=${!!h.wireSegments1A1[O]}, B相存在=${!!h.wireSegments1B1[O]}, C相存在=${!!h.wireSegments1C1[O]}`),h.wireSegments1A1[O]&&v.push(h.wireSegments1A1[O]),h.wireSegments1B1[O]&&C.push(h.wireSegments1B1[O]),h.wireSegments1C1[O]&&W.push(h.wireSegments1C1[O]);console.log(`塔段范围 ${p}-${d}: A相${v.length}段, B相${C.length}段, C相${W.length}段`);const _=[],T=[],L=[];for(let O=0;O<v.length;O++)_.push(...v[O]);for(let O=0;O<C.length;O++)T.push(...C[O]);for(let O=0;O<W.length;O++)L.push(...W[O]);a==="A"?(T.splice(0),L.splice(0)):a==="B"?(_.splice(0),L.splice(0)):a==="C"?(_.splice(0),T.splice(0)):a==="AB"?L.splice(0):a==="AC"?T.splice(0):a==="BC"&&_.splice(0),console.log(`导线数据状态(回路${l},相序${a}): A相=${_.length}, B相=${T.length}, C相=${L.length}`);const P=this.terrainConstruction.getLineInfo().Trees,b=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${P.length}`);const D=c.slice(p,d+1),R=du(P,D,n);console.log(`通道内树木数量: ${R.length}`);const B=[],X=new Map;if(P.forEach((O,q)=>{X.set(O,q)}),R.forEach(O=>{const q=X.get(O);q!==void 0&&B.push(b[q])}),o){const O=yu(D,n);if(O.length>0){this.channelCalculation.drawCorridorPolygon(O,`corridor-${t}-${e}`);const q=D.map(H=>[H.Longitude,H.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(q,n,`corridor-${t}-${e}`,f)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();if(R.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),i&&i([]);return}if(_.length===0&&T.length===0&&L.length===0){console.error("过滤后的导线数据为空,无法进行测量"),i&&i([]);return}console.log(`开始对${R.length}棵树进行测量...`),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(R,B,_,T,L,r,u,O=>{if(u===Q.全部测量||u===Q.净空距离||u===Q.对地距离||u===Q.安全距离)for(let H=0;H<v.length;H++){const F=p+H,Y=F+1,J=v[H]||[],rt=C[H]||[],ut=W[H]||[];let st=[...J],Qe=[...rt],de=[...ut];a==="A"?(Qe=[],de=[]):a==="B"?(st=[],de=[]):a==="C"?(st=[],Qe=[]):a==="AB"?de=[]:a==="AC"?Qe=[]:a==="BC"&&(st=[]),console.log(`计算塔段 ${F}-${Y} 的净空距离: A相=${st.length}, B相=${Qe.length}, C相=${de.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(st,Qe,de,u).catch(Di=>{console.error(`Error calculating wire to ground distance for segment ${F}-${Y}:`,Di)})}i&&i(O)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const t=this.terrainConstruction.getLineInfo().Trees,e=this.terrainConstruction.getOffsetTrees(),i=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(t,e,i.arcLine1A1,i.arcLine1B1,i.arcLine1C1)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(t=200){this.channelCalculation.setMaxVisibleTerrainResults(t)}setDistanceRuleConfig(t){this.channelCalculation.setDistanceRuleConfig(t)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(t){console.warn("Error clearing corridor display:",t)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}}class Cu{constructor(){I(this,"id","");I(this,"name","");I(this,"towerFZinfo","");I(this,"towerDisFile","");I(this,"stressFileContent","");I(this,"streesistrue",0);I(this,"TowerMemberColor","#FFFFFF");I(this,"TowerMembersWidth",2);I(this,"Longitude",0);I(this,"Latitude",0);I(this,"Altitude",0);I(this,"RollX",0);I(this,"RollY",90);I(this,"RollZ",0)}}function Wu(s){debugger;const t=s.split(`
7
- `),e=[],i=[],r=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,n=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const o of t){const f=o.trim();if(!f)continue;const u=f.match(r);if(u){e.push({id:parseInt(u[1]),x:parseFloat(u[2]),y:parseFloat(u[3]),z:parseFloat(u[4]),flag:parseInt(u[5])});continue}const l=f.match(n);l&&i.push({from:parseInt(l[1]),to:parseInt(l[2]),type:parseInt(l[3])})}return{TowerNodes:e,connections:i}}function Tu(s){const t=s.split(`
8
- `),e=[];for(const i of t){if(!i.trim())continue;const r=i.trim().split(/\s+/).filter(f=>f!==""),n=parseInt(r[0]);if(isNaN(n))continue;const o=[];for(let f=1;f<r.length;f+=3){const u=parseFloat(r[f]),l=parseFloat(r[f+1]),a=parseFloat(r[f+2]);if(!isNaN(u)&&!isNaN(l)&&!isNaN(a)){const c=Math.floor((f-1)/3)+1;o.push({timeStep:c,x:u,y:l,z:a})}}e.push({nodeId:n,displacements:o})}return e}function Va(s){const t={};return s.forEach(e=>{e.displacements.forEach(i=>{t[i.timeStep]||(t[i.timeStep]=[]),t[i.timeStep].push({nodeId:e.nodeId,...i})})}),t}function Iu(s){const t=s.split(`
9
- `),e=[];for(const r of t){if(!r.trim())continue;const n=r.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(n){const o=n[1].replace(/\s+/g,""),f=n[2].trim().split(/\s+/).map(Number);e.push({elementId:o,stressRatios:f})}}const i=[];if(e.length>0){const r=e[0].stressRatios.length;for(let n=0;n<r;n++){const o={timeIndex:n,elements:[]};for(const f of e){let u;const l=f.stressRatios[n];l>1?u=St.Color.RED:l>.95&&l<=1?u=St.Color.PINK:l>.85&&l<=.95?u=St.Color.YELLOW:l>.7&&l<=.85?u=St.Color.GREEN:u=St.Color.BLUE,o.elements.push({elementId:f.elementId,stressRatio:l,ylbColor:u})}i.push(o)}}return{byElement:e,byTime:i}}class Ga{constructor(t){I(this,"viewer");I(this,"lines",[]);this.viewer=t}addLine(t,e){const i=za(this.viewer,t,e);return this.lines.push(i),i}removeAll(){this.lines.forEach(t=>this.viewer.entities.remove(t)),this.lines=[]}}var Xa={exports:{}};(function(s,t){(function(e,i){i()})(vs,function(){function e(l,a){return typeof a>"u"?a={autoBom:!1}:typeof a!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function i(l,a,c){var p=new XMLHttpRequest;p.open("GET",l),p.responseType="blob",p.onload=function(){u(p.response,a,c)},p.onerror=function(){console.error("could not download file")},p.send()}function r(l){var a=new XMLHttpRequest;a.open("HEAD",l,!1);try{a.send()}catch{}return 200<=a.status&&299>=a.status}function n(l){try{l.dispatchEvent(new MouseEvent("click"))}catch{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),l.dispatchEvent(a)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof vs=="object"&&vs.global===vs?vs:void 0,f=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(l,a,c){var p=o.URL||o.webkitURL,d=document.createElement("a");a=a||l.name||"download",d.download=a,d.rel="noopener",typeof l=="string"?(d.href=l,d.origin===location.origin?n(d):r(d.href)?i(l,a,c):n(d,d.target="_blank")):(d.href=p.createObjectURL(l),setTimeout(function(){p.revokeObjectURL(d.href)},4e4),setTimeout(function(){n(d)},0))}:"msSaveOrOpenBlob"in navigator?function(l,a,c){if(a=a||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(e(l,c),a);else if(r(l))i(l,a,c);else{var p=document.createElement("a");p.href=l,p.target="_blank",setTimeout(function(){n(p)})}}:function(l,a,c,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof l=="string")return i(l,a,c);var d=l.type==="application/octet-stream",h=/constructor/i.test(o.HTMLElement)||o.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||d&&h||f)&&typeof FileReader<"u"){var C=new FileReader;C.onloadend=function(){var T=C.result;T=v?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=T:location=T,p=null},C.readAsDataURL(l)}else{var W=o.URL||o.webkitURL,_=W.createObjectURL(l);p?p.location=_:location.href=_,p=null,setTimeout(function(){W.revokeObjectURL(_)},4e4)}});o.saveAs=u.saveAs=u,s.exports=u})})(Xa);var co=Xa.exports;const Ya=require("shp-write");class Lu{constructor(t,e,i){I(this,"towerNodes",[]);I(this,"connections",[]);I(this,"towerFZS");this.towerNodes=t,this.connections=e,this.towerFZS=i}async exportTowerToSHP(){try{const t=await this.generatePointFeatures(),e=await this.generateLineFeatures();await this.generateSHPFiles(t,e),console.log("SHP文件导出成功")}catch(t){console.error("导出SHP文件失败:",t)}}async generatePointFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),i=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const r of this.towerNodes){const n=new g.Cartesian3(r.x,r.y,r.z),o=this.getPositionByHprAndOffset(i,n,e),f=g.Ellipsoid.WGS84.cartesianToCartographic(o),u=g.Math.toDegrees(f.longitude),l=g.Math.toDegrees(f.latitude),a=f.height,c={type:"Feature",geometry:{type:"Point",coordinates:[u,l]},properties:{id:r.id,node_id:r.id,x:r.x,y:r.y,z:r.z,longitude:u,latitude:l,height:a,elevation:a,type:"tower_node"}};t.push(c)}return t}async generateLineFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),i=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const r of this.connections){const n=this.towerNodes.find(L=>L.id===r.from),o=this.towerNodes.find(L=>L.id===r.to);if(!n||!o)continue;const f=new g.Cartesian3(n.x,n.y,n.z),u=new g.Cartesian3(o.x,o.y,o.z),l=this.getPositionByHprAndOffset(i,f,e),a=this.getPositionByHprAndOffset(i,u,e),c=g.Ellipsoid.WGS84.cartesianToCartographic(l),p=g.Ellipsoid.WGS84.cartesianToCartographic(a),d=g.Math.toDegrees(c.longitude),h=g.Math.toDegrees(c.latitude),v=c.height,C=g.Math.toDegrees(p.longitude),W=g.Math.toDegrees(p.latitude),_=p.height,T={type:"Feature",geometry:{type:"LineString",coordinates:[[d,h],[C,W]]},properties:{id:`${r.from}-${r.to}`,from_node:r.from,to_node:r.to,from_height:v,to_height:_,avg_height:(v+_)/2,length:this.calculateDistance(l,a),type:"tower_member",width:this.towerFZS.TowerMembersWidth,from_longitude:d,from_latitude:h,to_longitude:C,to_latitude:W}};t.push(T)}return t}async generateSHPFiles(t,e){try{if(t.length>0){const i={type:"FeatureCollection",features:t},r=Ya.point(i);this.downloadSHPFiles(r,"tower_nodes")}if(e.length>0){const i={type:"FeatureCollection",features:e},r=Ya.line(i);this.downloadSHPFiles(r,"tower_members")}}catch(i){console.error("生成SHP文件时出错:",i),await this.alternativeExport(t,e)}}downloadSHPFiles(t,e){const i=new Blob([t],{type:"application/zip"});co.saveAs(i,`${e}.zip`)}async alternativeExport(t,e){if(console.log("使用备用方案导出为GeoJSON格式"),t.length>0){const i={type:"FeatureCollection",features:t};this.downloadJSON(i,"tower_nodes.geojson")}if(e.length>0){const i={type:"FeatureCollection",features:e};this.downloadJSON(i,"tower_members.geojson")}}downloadJSON(t,e){const i=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});co.saveAs(i,e)}calculateDistance(t,e){return g.Cartesian3.distance(t,e)}getPositionByHprAndOffset(t,e,i){const r=g.Transforms.headingPitchRollToFixedFrame(t,i);return g.Matrix4.multiplyByPoint(r,e,new g.Cartesian3)}}class Au{static async exportToCSV(t,e,i){const r=this.exportNodesToCSV(t,i);this.downloadCSV(r,"tower_nodes.csv");const n=this.exportConnectionsToCSV(e,t,i);this.downloadCSV(n,"tower_connections.csv")}static exportNodesToCSV(t,e){let i=`ID,X,Y,Z,Longitude,Latitude,Height
10
- `;const r=new g.HeadingPitchRoll(g.Math.toRadians(e.RollX),e.RollY,e.RollZ),n=g.Cartesian3.fromDegrees(e.Longitude,e.Latitude,e.Altitude);return t.forEach(o=>{const f=new g.Cartesian3(o.x,o.y,o.z),u=this.getPositionByHprAndOffset(n,f,r),l=g.Ellipsoid.WGS84.cartesianToCartographic(u),a=g.Math.toDegrees(l.longitude),c=g.Math.toDegrees(l.latitude),p=l.height;i+=`${o.id},${o.x},${o.y},${o.z},${a},${c},${p}
11
- `}),i}static exportConnectionsToCSV(t,e,i){let r=`FromNode,ToNode,FromX,FromY,FromZ,ToX,ToY,ToZ,Length
12
- `;const n=new g.HeadingPitchRoll(g.Math.toRadians(i.RollX),i.RollY,i.RollZ),o=g.Cartesian3.fromDegrees(i.Longitude,i.Latitude,i.Altitude);return t.forEach(f=>{const u=e.find(v=>v.id===f.from),l=e.find(v=>v.id===f.to);if(!u||!l)return;const a=new g.Cartesian3(u.x,u.y,u.z),c=new g.Cartesian3(l.x,l.y,l.z),p=this.getPositionByHprAndOffset(o,a,n),d=this.getPositionByHprAndOffset(o,c,n),h=g.Cartesian3.distance(p,d);r+=`${f.from},${f.to},${u.x},${u.y},${u.z},${l.x},${l.y},${l.z},${h}
13
- `}),r}static downloadCSV(t,e){const i=new Blob([t],{type:"text/csv;charset=utf-8;"});co.saveAs(i,e)}static getPositionByHprAndOffset(t,e,i){const r=g.Transforms.headingPitchRollToFixedFrame(t,i);return g.Matrix4.multiplyByPoint(r,e,new g.Cartesian3)}}class wu{constructor(t,e,i){I(this,"viewer");I(this,"TowerFZS");I(this,"Keym","");I(this,"dataSource2");I(this,"entityCollection2");I(this,"pointEntities",[]);I(this,"TowerLineManager");I(this,"TowerNodes",[]);I(this,"connections",[]);I(this,"displacementData",[]);I(this,"byTimes",[]);I(this,"_animationInterval",null);this.Keym=i,this.viewer=t,this.TowerFZS=e,this.dataSource2=new g.CustomDataSource(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities,this.TowerLineManager=new Ga(this.viewer)}initSHPExporter(){}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:t,connections:e}=Wu(this.TowerFZS.towerFZinfo);this.TowerNodes=t,this.connections=e,this.displacementData=Tu(this.TowerFZS.towerDisFile);const{byTime:i}=Iu(this.TowerFZS.stressFileContent);this.byTimes=i;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let t=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const e=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(i=>{const r=this.TowerNodes.find(c=>c.id===i.from),n=this.TowerNodes.find(c=>c.id===i.to),o=[],f=new g.Cartesian3(r==null?void 0:r.x,r==null?void 0:r.y,r==null?void 0:r.z);o.push(N(e,f,t));const u=zs(this.viewer,o[0],(r==null?void 0:r.id)+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(u);const l=new g.Cartesian3(n==null?void 0:n.x,n==null?void 0:n.y,n==null?void 0:n.z);o.push(N(e,l,t));const a=zs(this.viewer,o[1],(r==null?void 0:r.id)+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(a),this.TowerLineManager.addLine(o)}),this.initSHPExporter()}async exportToSHP(){await new Lu(this.TowerNodes,this.connections,this.TowerFZS).exportTowerToSHP()}async exportToCSV(){await Au.exportToCSV(this.TowerNodes,this.connections,this.TowerFZS)}loadFZDISTower(t){if(this.Keym!=="OW_JPS_EEngin_001")return;const i=Va(this.displacementData)[t],r=this.byTimes.find(f=>f.timeIndex===t);debugger;if(!i){console.warn(`未找到时间步 ${t} 的位移数据`);return}const n=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),o=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(f=>{const u=this.TowerNodes.find(P=>P.id===f.from),l=this.TowerNodes.find(P=>P.id===f.to);if(!u||!l){console.warn(`找不到连接 ${f.from}->${f.to} 的节点`);return}debugger;const a=i.find(P=>P.nodeId===f.from),c=i.find(P=>P.nodeId===f.to);if(!a||!c){console.warn(`找不到连接 ${f.from}->${f.to} 的位移数据`);return}const p=new g.Cartesian3(u.x-a.x,u.y-a.y,u.z-a.z),d=new g.Cartesian3(l.x-c.x,l.y-c.y,l.z-c.z),h=N(o,p,n),v=zs(this.viewer,h,f.from+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(v);const C=N(o,d,n),W=zs(this.viewer,C,f.to+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(W);const _=[h,C],T=f.from+"-"+f.to,L=r==null?void 0:r.elements.find(P=>P.elementId===T);debugger;this.TowerLineManager.addLine(_,{color:L==null?void 0:L.ylbColor,width:3,clampToGround:!1,zIndex:0,dashed:!1,dashLength:10})})}loadFZDISTower1(t){if(this.Keym!="OW_JPS_EEngin_001")return;const e=Va(this.displacementData);let i=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const r=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(n=>{const o=this.TowerNodes.find(d=>d.id===n.from),f=e[t].find(d=>d.nodeId===n.from),u=this.TowerNodes.find(d=>d.id===n.to),l=e[t].find(d=>d.nodeId===n.to),a=[],c=new g.Cartesian3(o.x-f.x,o.y-f.y,o.z-f.z);a.push(N(r,c,i));const p=new g.Cartesian3(u.x-l.x,u.y-l.y,u.z-l.z);a.push(N(r,p,i));debugger;this.entityCollection2.add(y(a,n.from+""+n.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadAllFZDisTower(){if(this.Keym!=="OW_JPS_EEngin_001")return;if(!this.displacementData||this.displacementData.length===0){console.warn("没有可用的位移数据");return}let t=1;const e=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const i=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),t>e){t=1;return}this.dataSource2=new g.CustomDataSource("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(t),this.loadFZModel(),console.log(`正在显示位移帧: ${t}/${e}`),t++}catch(r){console.error("加载位移帧时出错:",r),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};i(),this._animationInterval=setInterval(i,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(t){t?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.TowerLineManager.removeAll(),this.pointEntities.forEach(t=>this.viewer.entities.remove(t)),this.pointEntities.length=0)}}gt.DistanceRuleConfig=Oa,gt.GUAPoint=uu,gt.InsulatorInfo=fu,gt.InsulatorType=Kt,gt.LineManager=Ga,gt.LineNum=Ys,gt.LineType=Ma,gt.MeasurementResult=au,gt.OWEEgineFZManager=wu,gt.OWEEgineManager=_u,gt.PhaseSType=Te,gt.TowerFZInfo=Cu,gt.TowerInfo=ou,gt.TowerLineInfo=su,gt.TowerType=mi,gt.TreeType=nu,gt.WairnumType=w,gt.drawModel=Pn,gt.primaryDistanceType=Q,Object.defineProperty(gt,Symbol.toStringTag,{value:"Module"})});
1
+ (function(dt,bt){typeof exports=="object"&&typeof module<"u"?bt(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],bt):(dt=typeof globalThis<"u"?globalThis:dt||self,bt(dt.OW_EEngine_Power={},dt.Cesium))})(this,function(dt,bt){"use strict";var mh=Object.defineProperty;var yh=(dt,bt,$r)=>bt in dt?mh(dt,bt,{enumerable:!0,configurable:!0,writable:!0,value:$r}):dt[bt]=$r;var T=(dt,bt,$r)=>yh(dt,typeof bt!="symbol"?bt+"":bt,$r);function $r(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const g=$r(bt);function lf(s,t,e={}){const{color:r=bt.Color.WHITE,width:i=3,clampToGround:n=!1,zIndex:o=0,dashed:f=!1,dashLength:u=10}=e,l=f?new g.PolylineDashMaterialProperty({color:r,dashLength:u}):new g.ColorMaterialProperty(r);return s.entities.add({polyline:{positions:t,width:i,material:l,clampToGround:n,zIndex:o}})}function y(s,t,e=10,r="#ba1919",i,n=!1){const o={show:!0,positions:s,clampToGround:n,width:e,material:g.Color.fromCssColorString(r),arcType:g.ArcType.NONE,shadows:g.ShadowMode.DISABLED,granularity:n?void 0:0};let f;return f=[0,1e5],o.distanceDisplayCondition=new g.DistanceDisplayCondition(f[0],f[1]),{name:t,label:{text:t,font:"18px sans-serif",distanceDisplayCondition:new g.DistanceDisplayCondition(f[0],Math.min(f[1],5e3))},polyline:o}}function Gn(s,t,e,r,i=new g.HeadingPitchRoll(0,0,0),n=1,o){const f={show:!0,uri:r,scale:n,transition:{distanceDisplayCondition:!0,scale:!0}};return o&&(Array.isArray(o)?f.distanceDisplayCondition=new g.DistanceDisplayCondition(o[0],o[1]):f.distanceDisplayCondition=o),{id:s,name:e,position:t,orientation:g.Transforms.headingPitchRollQuaternion(t,i),model:f}}function en(s,t,e,r={}){const{pointColor:i=bt.Color.YELLOW,pointSize:n=12,labelColor:o=bt.Color.WHITE,fontSize:f=16,pixelOffset:u=[0,-20],heightReference:l=bt.HeightReference.NONE}=r;return s.entities.add({position:t,point:{color:i,pixelSize:n,heightReference:l,distanceDisplayCondition:new g.DistanceDisplayCondition(0,100)},label:{text:e,font:`${f}px sans-serif`,fillColor:o,pixelOffset:new g.Cartesian2(...u),style:bt.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:bt.Color.BLACK,heightReference:l,distanceDisplayCondition:new g.DistanceDisplayCondition(0,100)}})}var me=63710088e-1,Do={centimeters:me*100,centimetres:me*100,degrees:me/111325,feet:me*3.28084,inches:me*39.37,kilometers:me/1e3,kilometres:me/1e3,meters:me,metres:me,miles:me/1609.344,millimeters:me*1e3,millimetres:me*1e3,nauticalmiles:me/1852,radians:1,yards:me*1.0936};function pr(s,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=s,r}function De(s,t,e){if(e===void 0&&(e={}),!s)throw new Error("coordinates is required");if(!Array.isArray(s))throw new Error("coordinates must be an Array");if(s.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ro(s[0])||!Ro(s[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:s};return pr(r,t,e)}function he(s,t,e){if(e===void 0&&(e={}),s.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:s};return pr(r,t,e)}function rn(s,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=s,e}function cf(s,t,e){e===void 0&&(e={});var r={type:"MultiLineString",coordinates:s};return pr(r,t,e)}function Xn(s,t){t===void 0&&(t="kilometers");var e=Do[t];if(!e)throw new Error(t+" units is invalid");return s*e}function sn(s,t){t===void 0&&(t="kilometers");var e=Do[t];if(!e)throw new Error(t+" units is invalid");return s/e}function pf(s,t){return nn(sn(s,t))}function nn(s){var t=s%(2*Math.PI);return t*180/Math.PI}function Wi(s){var t=s%360;return t*Math.PI/180}function Mo(s,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(s>=0))throw new Error("length must be a positive number");return Xn(sn(s,t),e)}function Ro(s){return!isNaN(s)&&s!==null&&!Array.isArray(s)}function Bo(s){return!!s&&s.constructor===Object}function Yn(s,t,e){if(s!==null)for(var r,i,n,o,f,u,l,a=0,c=0,p,d=s.type,h=d==="FeatureCollection",m=d==="Feature",_=h?s.features.length:1,W=0;W<_;W++){l=h?s.features[W].geometry:m?s.geometry:s,p=l?l.type==="GeometryCollection":!1,f=p?l.geometries.length:1;for(var C=0;C<f;C++){var I=0,L=0;if(o=p?l.geometries[C]:l,o!==null){u=o.coordinates;var w=o.type;switch(a=0,w){case null:break;case"Point":if(t(u,c,W,I,L)===!1)return!1;c++,I++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(t(u[r],c,W,I,L)===!1)return!1;c++,w==="MultiPoint"&&I++}w==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-a;i++){if(t(u[r][i],c,W,I,L)===!1)return!1;c++}w==="MultiLineString"&&I++,w==="Polygon"&&L++}w==="Polygon"&&I++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(L=0,i=0;i<u[r].length;i++){for(n=0;n<u[r][i].length-a;n++){if(t(u[r][i][n],c,W,I,L)===!1)return!1;c++}L++}I++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(Yn(o.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function zn(s,t){if(s.type==="Feature")t(s,0);else if(s.type==="FeatureCollection")for(var e=0;e<s.features.length&&t(s.features[e],e)!==!1;e++);}function Un(s,t){var e,r,i,n,o,f,u,l,a,c,p=0,d=s.type==="FeatureCollection",h=s.type==="Feature",m=d?s.features.length:1;for(e=0;e<m;e++){for(f=d?s.features[e].geometry:h?s.geometry:s,l=d?s.features[e].properties:h?s.properties:{},a=d?s.features[e].bbox:h?s.bbox:void 0,c=d?s.features[e].id:h?s.id:void 0,u=f?f.type==="GeometryCollection":!1,o=u?f.geometries.length:1,i=0;i<o;i++){if(n=u?f.geometries[i]:f,n===null){if(t(null,p,l,a,c)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,p,l,a,c)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<n.geometries.length;r++)if(t(n.geometries[r],p,l,a,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}p++}}function Oo(s,t){Un(s,function(e,r,i,n,o){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(pr(e,i,{bbox:n,id:o}),r,0)===!1?!1:void 0}var u;switch(f){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<e.coordinates.length;l++){var a=e.coordinates[l],c={type:u,coordinates:a};if(t(pr(c,i),r,l)===!1)return!1}})}function gf(s,t){Oo(s,function(e,r,i){var n=0;if(e.geometry){var o=e.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var f,u=0,l=0,a=0;if(Yn(e,function(c,p,d,h,m){if(f===void 0||r>u||h>l||m>a){f=c,u=r,l=h,a=m,n=0;return}var _=he([f,c],e.properties);if(t(_,r,i,m,n)===!1)return!1;n++,f=c})===!1)return!1}}})}function qn(s){var t=[1/0,1/0,-1/0,-1/0];return Yn(s,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}qn.default=qn;function Nr(s){if(!s)throw new Error("coord is required");if(!Array.isArray(s)){if(s.type==="Feature"&&s.geometry!==null&&s.geometry.type==="Point")return s.geometry.coordinates;if(s.type==="Point")return s.coordinates}if(Array.isArray(s)&&s.length>=2&&!Array.isArray(s[0])&&!Array.isArray(s[1]))return s;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function df(s){if(Array.isArray(s))return s;if(s.type==="Feature"){if(s.geometry!==null)return s.geometry.coordinates}else if(s.coordinates)return s.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Fo(s,t,e){if(!s)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+s.geometry.type)}function mf(s,t){return s.type==="FeatureCollection"?"FeatureCollection":s.type==="GeometryCollection"?"GeometryCollection":s.type==="Feature"&&s.geometry!==null?s.geometry.type:s.type}var Ps=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qi(s,t,e){e===void 0&&(e={});var r=Nr(s),i=Nr(t),n=Wi(i[1]-r[1]),o=Wi(i[0]-r[0]),f=Wi(r[1]),u=Wi(i[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(f)*Math.cos(u);return Xn(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),e.units)}function yf(s){if(!s)throw new Error("geojson is required");switch(s.type){case"Feature":return xo(s);case"FeatureCollection":return vf(s);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Hn(s);default:throw new Error("unknown GeoJSON type")}}function xo(s){var t={type:"Feature"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=s[e]}}),t.properties=ko(s.properties),t.geometry=Hn(s.geometry),t}function ko(s){var t={};return s&&Object.keys(s).forEach(function(e){var r=s[e];typeof r=="object"?r===null?t[e]=null:Array.isArray(r)?t[e]=r.map(function(i){return i}):t[e]=ko(r):t[e]=r}),t}function vf(s){var t={type:"FeatureCollection"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=s[e]}}),t.features=s.features.map(function(e){return xo(e)}),t}function Hn(s){var t={type:s.type};return s.bbox&&(t.bbox=s.bbox),s.type==="GeometryCollection"?(t.geometries=s.geometries.map(function(e){return Hn(e)}),t):(t.coordinates=Vo(s.coordinates),t)}function Vo(s){var t=s;return typeof t[0]!="object"?t.slice():t.map(function(e){return Vo(e)})}function Zn(s,t,e,r){r===void 0&&(r={});var i=Nr(s),n=Wi(i[0]),o=Wi(i[1]),f=Wi(e),u=sn(t,r.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(f)),a=n+Math.atan2(Math.sin(f)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),c=nn(a),p=nn(l);return De([c,p],r.properties)}function on(s,t,e){if(e===void 0&&(e={}),e.final===!0)return _f(s,t);var r=Nr(s),i=Nr(t),n=Wi(r[0]),o=Wi(i[0]),f=Wi(r[1]),u=Wi(i[1]),l=Math.sin(o-n)*Math.cos(u),a=Math.cos(f)*Math.sin(u)-Math.sin(f)*Math.cos(u)*Math.cos(o-n);return nn(Math.atan2(l,a))}function _f(s,t){var e=on(t,s);return e=(e+180)%360,e}function Cf(s,t){var e=Qi(s,t),r=on(s,t),i=Zn(s,e/2,r);return i}function Wf(s,t){t===void 0&&(t={});var e=qn(s),r=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return De([r,i],t.properties,t)}function If(s,t){if(!s)throw new Error("targetPoint is required");if(!t)throw new Error("points is required");var e,r=1/0,i=0;return zn(t,function(n,o){var f=Qi(s,n);f<r&&(i=o,r=f)}),e=yf(t.features[i]),e.properties.featureIndex=i,e.properties.distanceToPoint=r,e}function Tf(s,t,e){e===void 0&&(e={});var r=Nr(s),i=Nr(t);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var n=Lf(r,i),o=Mo(n,"meters",e.units);return o}function Lf(s,t,e){e=e===void 0?me:Number(e);var r=e,i=s[1]*Math.PI/180,n=t[1]*Math.PI/180,o=n-i,f=Math.abs(t[0]-s[0])*Math.PI/180;f>Math.PI&&(f-=2*Math.PI);var u=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),a=Math.sqrt(o*o+l*l*f*f),c=a*r;return c}function br(s,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!s)throw new Error("pt is required");if(Array.isArray(s)?s=De(s):s.type==="Point"?s=pr(s):Fo(s,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=he(t):t.type==="LineString"?t=pr(t):Fo(t,"LineString","line");var r=1/0,i=s.geometry.coordinates;return gf(t,function(n){var o=n.geometry.coordinates[0],f=n.geometry.coordinates[1],u=Af(i,o,f,e);u<r&&(r=u)}),Mo(r,"degrees",e.units)}function Af(s,t,e,r){var i=[e[0]-t[0],e[1]-t[1]],n=[s[0]-t[0],s[1]-t[1]],o=Go(n,i);if(o<=0)return Kn(s,t,{method:r.method,units:"degrees"});var f=Go(i,i);if(f<=o)return Kn(s,e,{method:r.method,units:"degrees"});var u=o/f,l=[t[0]+u*i[0],t[1]+u*i[1]];return Kn(s,l,{method:r.method,units:"degrees"})}function Go(s,t){return s[0]*t[0]+s[1]*t[1]}function Kn(s,t,e){return e.method==="planar"?Tf(s,t,e):Qi(s,t,e)}function Xo(s,t,e,r){if(r=r||{},!Bo(r))throw new Error("options is invalid");var i,n=[];if(s.type==="Feature")i=s.geometry.coordinates;else if(s.type==="LineString")i=s.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(var o=i.length,f=0,u,l,a,c=0;c<i.length&&!(t>=f&&c===i.length-1);c++){if(f>t&&n.length===0){if(u=t-f,!u)return n.push(i[c]),he(n);l=on(i[c],i[c-1])-180,a=Zn(i[c],u,l,r),n.push(a.geometry.coordinates)}if(f>=e)return u=e-f,u?(l=on(i[c],i[c-1])-180,a=Zn(i[c],u,l,r),n.push(a.geometry.coordinates),he(n)):(n.push(i[c]),he(n));if(f>=t&&n.push(i[c]),c===i.length-1)return he(n);f+=Qi(i[c],i[c+1],r)}if(f<t&&i.length===o)throw new Error("Start position is beyond line");var p=i[i.length-1];return he([p,p])}function an(s){var t=s[0],e=s[1];return[e[0]-t[0],e[1]-t[1]]}function jn(s,t){return s[0]*t[1]-t[0]*s[1]}function wf(s,t){return[s[0]+t[0],s[1]+t[1]]}function Ef(s,t){return[s[0]-t[0],s[1]-t[1]]}function Pf(s,t){return[s*t[0],s*t[1]]}function Sf(s,t){var e=s[0],r=an(s),i=t[0],n=an(t),o=jn(r,n),f=Ef(i,e),u=jn(f,n),l=u/o,a=wf(e,Pf(l,r));return a}function Nf(s,t){var e=an(s),r=an(t);return jn(e,r)===0}function bf(s,t){return Nf(s,t)?!1:Sf(s,t)}function Df(s,t,e){if(e=e||{},!Bo(e))throw new Error("options is invalid");var r=e.units;if(!s)throw new Error("geojson is required");if(t==null||isNaN(t))throw new Error("distance is required");var i=mf(s),n=s.properties;switch(i){case"LineString":return Yo(s,t,r);case"MultiLineString":var o=[];return Oo(s,function(f){o.push(Yo(f,t,r).geometry.coordinates)}),cf(o,n);default:throw new Error("geometry "+i+" is not supported")}}function Yo(s,t,e){var r=[],i=pf(t,e),n=df(s),o=[];return n.forEach(function(f,u){if(u!==n.length-1){var l=Mf(f,n[u+1],i);if(r.push(l),u>0){var a=r[u-1],c=bf(l,a);c!==!1&&(a[1]=c,l[0]=c),o.push(a[0]),u===n.length-2&&(o.push(l[0]),o.push(l[1]))}n.length===2&&(o.push(l[0]),o.push(l[1]))}}),he(o,s.properties)}function Mf(s,t,e){var r=Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1])),i=s[0]+e*(t[1]-s[1])/r,n=t[0]+e*(t[1]-s[1])/r,o=s[1]+e*(s[0]-t[0])/r,f=t[1]+e*(s[0]-t[0])/r;return[[i,o],[n,f]]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var n=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(n=n<0?Math.max(r+arguments[2],0):Math.min(n,r);i<n;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},Number.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(s){return s!==s},Math.trunc=Math.trunc||function(s){return s<0?Math.ceil(s):Math.floor(s)};var Dr=function(){};Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};var Ct=function(s){function t(e){s.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new s().stack}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(Error),K=function(){},zo={MAX_VALUE:{configurable:!0}};K.isNaN=function(t){return Number.isNaN(t)},K.doubleToLongBits=function(t){return t},K.longBitsToDouble=function(t){return t},K.isInfinite=function(t){return!Number.isFinite(t)},zo.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(K,zo);var Me=function(){},fn=function(){},ts=function(){};function Re(){}var A=function s(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=s.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=s.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Mr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};A.prototype.setOrdinate=function(t,e){switch(t){case A.X:this.x=e;break;case A.Y:this.y=e;break;case A.Z:this.z=e;break;default:throw new Ct("Invalid ordinate index: "+t)}},A.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return!(!Dr.equalsWithTolerance(this.x,e.x,r)||!Dr.equalsWithTolerance(this.y,e.y,r))}},A.prototype.getOrdinate=function(t){switch(t){case A.X:return this.x;case A.Y:return this.y;case A.Z:return this.z}throw new Ct("Invalid ordinate index: "+t)},A.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||K.isNaN(this.z))&&K.isNaN(t.z)},A.prototype.equals=function(t){return t instanceof A?this.equals2D(t):!1},A.prototype.equalInZ=function(t,e){return Dr.equalsWithTolerance(this.z,t.z,e)},A.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},A.prototype.clone=function(){},A.prototype.copy=function(){return new A(this)},A.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},A.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)},A.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},A.prototype.hashCode=function(){var t=17;return t=37*t+A.hashCode(this.x),t=37*t+A.hashCode(this.y),t},A.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},A.prototype.interfaces_=function(){return[Me,fn,Re]},A.prototype.getClass=function(){return A},A.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=K.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Mr.DimensionalComparator.get=function(){return $i},Mr.serialVersionUID.get=function(){return 6683108902428367e3},Mr.NULL_ORDINATE.get=function(){return K.NaN},Mr.X.get=function(){return 0},Mr.Y.get=function(){return 1},Mr.Z.get=function(){return 2},Object.defineProperties(A,Mr);var $i=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new Ct("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};$i.prototype.compare=function(t,e){var r=t,i=e,n=$i.compare(r.x,i.x);if(n!==0)return n;var o=$i.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var f=$i.compare(r.z,i.z);return f},$i.prototype.interfaces_=function(){return[ts]},$i.prototype.getClass=function(){return $i},$i.compare=function(t,e){return t<e?-1:t>e?1:K.isNaN(t)?K.isNaN(e)?0:-1:K.isNaN(e)?1:0};var es=function(){};es.prototype.create=function(){},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var P=function(){},Ss={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.toLocationSymbol=function(t){switch(t){case P.EXTERIOR:return"e";case P.BOUNDARY:return"b";case P.INTERIOR:return"i";case P.NONE:return"-"}throw new Ct("Unknown location value: "+t)},Ss.INTERIOR.get=function(){return 0},Ss.BOUNDARY.get=function(){return 1},Ss.EXTERIOR.get=function(){return 2},Ss.NONE.get=function(){return-1},Object.defineProperties(P,Ss);var q=function(s,t){return s.interfaces_&&s.interfaces_().indexOf(t)>-1},Le=function(){},Uo={LOG_10:{configurable:!0}};Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.log10=function(t){var e=Math.log(t);return K.isInfinite(e)||K.isNaN(e)?e:e/Le.LOG_10},Le.min=function(t,e,r,i){var n=t;return e<n&&(n=e),r<n&&(n=r),i<n&&(n=i),n},Le.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],r=arguments[2];return t<e?e:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],n=arguments[1],o=arguments[2];return i<n?n:i>o?o:i}},Le.wrap=function(t,e){return t<0?e- -t%e:t%e},Le.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2],i=t;return e>i&&(i=e),r>i&&(i=r),i}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3],l=n;return o>l&&(l=o),f>l&&(l=f),u>l&&(l=u),l}},Le.average=function(t,e){return(t+e)/2},Uo.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Le,Uo);var ei=function(t){this.str=t};ei.prototype.append=function(t){this.str+=t},ei.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ei.prototype.toString=function(t){return this.str};var ii=function(t){this.value=t};ii.prototype.intValue=function(){return this.value},ii.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},ii.isNaN=function(t){return Number.isNaN(t)};var Ns=function(){};Ns.isWhitespace=function(t){return t<=32&&t>=0||t===127},Ns.toUpperCase=function(t){return t.toUpperCase()};var S=function s(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof s){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var r=arguments[0];s.call(this,s.parse(r))}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.init(i,n)}},Xe={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};S.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},S.prototype.extractSignificantDigits=function(t,e){var r=this.abs(),i=S.magnitude(r._hi),n=S.TEN.pow(i);r=r.divide(n),r.gt(S.TEN)?(r=r.divide(S.TEN),i+=1):r.lt(S.ONE)&&(r=r.multiply(S.TEN),i-=1);for(var o=i+1,f=new ei,u=S.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&f.append(".");var a=Math.trunc(r._hi);if(a<0)break;var c=!1,p=0;a>9?(c=!0,p="9"):p="0"+a,f.append(p),r=r.subtract(S.valueOf(a)).multiply(S.TEN),c&&r.selfAdd(S.TEN);var d=!0,h=S.magnitude(r._hi);if(h<0&&Math.abs(h)>=u-l&&(d=!1),!d)break}return e[0]=i,f.toString()},S.prototype.sqr=function(){return this.multiply(this)},S.prototype.doubleValue=function(){return this._hi+this._lo},S.prototype.subtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},S.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},S.prototype.isZero=function(){return this._hi===0&&this._lo===0},S.prototype.selfSubtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},S.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},S.prototype.min=function(t){return this.le(t)?this:t},S.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=null,o=null,f=null,u=null,l=null,a=null,c=null,p=null;return l=this._hi/r,a=S.SPLIT*l,n=a-l,p=S.SPLIT*r,n=a-n,o=l-n,f=p-r,c=l*r,f=p-f,u=r-f,p=n*f-c+n*u+o*f+o*u,a=(this._hi-c-p+this._lo-l*i)/r,p=l+a,this._hi=p,this._lo=l-p+a,this}},S.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},S.prototype.divide=function(){if(arguments[0]instanceof S){var t=arguments[0],e=null,r=null,i=null,n=null,o=null,f=null,u=null,l=null;o=this._hi/t._hi,f=S.SPLIT*o,e=f-o,l=S.SPLIT*t._hi,e=f-e,r=o-e,i=l-t._hi,u=o*t._hi,i=l-i,n=t._hi-i,l=e*i-u+e*n+r*i+r*n,f=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+f;var a=l,c=o-l+f;return new S(a,c)}else if(typeof arguments[0]=="number"){var p=arguments[0];return K.isNaN(p)?S.createNaN():S.copy(this).selfDivide(p,0)}},S.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},S.prototype.pow=function(t){if(t===0)return S.valueOf(1);var e=new S(this),r=S.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},S.prototype.ceil=function(){if(this.isNaN())return S.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new S(t,e)},S.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},S.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},S.prototype.setValue=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},S.prototype.max=function(t){return this.ge(t)?this:t},S.prototype.sqrt=function(){if(this.isZero())return S.valueOf(0);if(this.isNegative())return S.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=S.valueOf(e),i=this.subtract(r.sqr()),n=i._hi*(t*.5);return r.add(n)},S.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],r=null,i=null,n=null,o=null,f=null,u=null;return n=this._hi+e,f=n-this._hi,o=n-f,o=e-f+(this._hi-o),u=o+this._lo,r=n+u,i=u+(n-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var l=arguments[0],a=arguments[1],c=null,p=null,d=null,h=null,m=null,_=null,W=null,C=null;m=this._hi+l,d=this._lo+a,W=m-this._hi,C=d-this._lo,_=m-W,h=d-C,_=l-W+(this._hi-_),h=a-C+(this._lo-h),W=_+d,c=m+W,p=W+(m-c),W=h+p;var I=c+W,L=W+(c-I);return this._hi=I,this._lo=L,this}},S.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=null,o=null,f=null,u=null,l=null,a=null;l=S.SPLIT*this._hi,n=l-this._hi,a=S.SPLIT*r,n=l-n,o=this._hi-n,f=a-r,l=this._hi*r,f=a-f,u=r-f,a=n*f-l+n*u+o*f+o*u+(this._hi*i+this._lo*r);var c=l+a;n=l-c;var p=a+n;return this._hi=c,this._lo=p,this}},S.prototype.selfSqr=function(){return this.selfMultiply(this)},S.prototype.floor=function(){if(this.isNaN())return S.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new S(t,e)},S.prototype.negate=function(){return this.isNaN()?this:new S(-this._hi,-this._lo)},S.prototype.clone=function(){},S.prototype.multiply=function(){if(arguments[0]instanceof S){var t=arguments[0];return t.isNaN()?S.createNaN():S.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return K.isNaN(e)?S.createNaN():S.copy(this).selfMultiply(e,0)}},S.prototype.isNaN=function(){return K.isNaN(this._hi)},S.prototype.intValue=function(){return Math.trunc(this._hi)},S.prototype.toString=function(){var t=S.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},S.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),i=e[0]+1,n=r;if(r.charAt(0)===".")n="0"+r;else if(i<0)n="0."+S.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,f=S.stringOfChar("0",o);n=r+f+".0"}return this.isNegative()?"-"+n:n},S.prototype.reciprocal=function(){var t=null,e=null,r=null,i=null,n=null,o=null,f=null,u=null;n=1/this._hi,o=S.SPLIT*n,t=o-n,u=S.SPLIT*this._hi,t=o-t,e=n-t,r=u-this._hi,f=n*this._hi,r=u-r,i=this._hi-r,u=t*r-f+t*i+e*r+e*i,o=(1-f-u-n*this._lo)/this._hi;var l=n+o,a=n-l+o;return new S(l,a)},S.prototype.toSciNotation=function(){if(this.isZero())return S.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),i=S.SCI_NOT_EXPONENT_CHAR+e[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var n="";r.length>1&&(n=r.substring(1));var o=r.charAt(0)+"."+n;return this.isNegative()?"-"+o+i:o+i},S.prototype.abs=function(){return this.isNaN()?S.NaN:this.isNegative()?this.negate():new S(this)},S.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},S.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},S.prototype.add=function(){if(arguments[0]instanceof S){var t=arguments[0];return S.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return S.copy(this).selfAdd(e)}},S.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof S){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},S.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},S.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},S.prototype.trunc=function(){return this.isNaN()?S.NaN:this.isPositive()?this.floor():this.ceil()},S.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},S.prototype.interfaces_=function(){return[Re,Me,fn]},S.prototype.getClass=function(){return S},S.sqr=function(t){return S.valueOf(t).selfMultiply(t)},S.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return S.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new S(e)}},S.sqrt=function(t){return S.valueOf(t).sqrt()},S.parse=function(t){for(var e=0,r=t.length;Ns.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<r){var n=t.charAt(e);(n==="-"||n==="+")&&(e++,n==="-"&&(i=!0))}for(var o=new S,f=0,u=0,l=0;!(e>=r);){var a=t.charAt(e);if(e++,Ns.isDigit(a)){var c=a-"0";o.selfMultiply(S.TEN),o.selfAdd(c),f++;continue}if(a==="."){u=f;continue}if(a==="e"||a==="E"){var p=t.substring(e);try{l=ii.parseInt(p)}catch(W){throw W instanceof Error?new Error("Invalid exponent "+p+" in string "+t):W}finally{}break}throw new Error("Unexpected character '"+a+"' at position "+e+" in string "+t)}var d=o,h=f-u-l;if(h===0)d=o;else if(h>0){var m=S.TEN.pow(h);d=o.divide(m)}else if(h<0){var _=S.TEN.pow(-h);d=o.multiply(_)}return i?d.negate():d},S.createNaN=function(){return new S(K.NaN,K.NaN)},S.copy=function(t){return new S(t)},S.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(r)),n=Math.pow(10,i);return n*10<=e&&(i+=1),i},S.stringOfChar=function(t,e){for(var r=new ei,i=0;i<e;i++)r.append(t);return r.toString()},Xe.PI.get=function(){return new S(3.141592653589793,12246467991473532e-32)},Xe.TWO_PI.get=function(){return new S(6.283185307179586,24492935982947064e-32)},Xe.PI_2.get=function(){return new S(1.5707963267948966,6123233995736766e-32)},Xe.E.get=function(){return new S(2.718281828459045,14456468917292502e-32)},Xe.NaN.get=function(){return new S(K.NaN,K.NaN)},Xe.EPS.get=function(){return 123259516440783e-46},Xe.SPLIT.get=function(){return 134217729},Xe.MAX_PRINT_DIGITS.get=function(){return 32},Xe.TEN.get=function(){return S.valueOf(10)},Xe.ONE.get=function(){return S.valueOf(1)},Xe.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Xe.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(S,Xe);var le=function(){},qo={DP_SAFE_EPSILON:{configurable:!0}};le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.orientationIndex=function(t,e,r){var i=le.orientationIndexFilter(t,e,r);if(i<=1)return i;var n=S.valueOf(e.x).selfAdd(-t.x),o=S.valueOf(e.y).selfAdd(-t.y),f=S.valueOf(r.x).selfAdd(-e.x),u=S.valueOf(r.y).selfAdd(-e.y);return n.selfMultiply(u).selfSubtract(o.selfMultiply(f)).signum()},le.signOfDet2x2=function(t,e,r,i){var n=t.multiply(i).selfSubtract(e.multiply(r));return n.signum()},le.intersection=function(t,e,r,i){var n=S.valueOf(i.y).selfSubtract(r.y).selfMultiply(S.valueOf(e.x).selfSubtract(t.x)),o=S.valueOf(i.x).selfSubtract(r.x).selfMultiply(S.valueOf(e.y).selfSubtract(t.y)),f=n.subtract(o),u=S.valueOf(i.x).selfSubtract(r.x).selfMultiply(S.valueOf(t.y).selfSubtract(r.y)),l=S.valueOf(i.y).selfSubtract(r.y).selfMultiply(S.valueOf(t.x).selfSubtract(r.x)),a=u.subtract(l),c=a.selfDivide(f).doubleValue(),p=S.valueOf(t.x).selfAdd(S.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),d=S.valueOf(e.x).selfSubtract(t.x).selfMultiply(S.valueOf(t.y).selfSubtract(r.y)),h=S.valueOf(e.y).selfSubtract(t.y).selfMultiply(S.valueOf(t.x).selfSubtract(r.x)),m=d.subtract(h),_=m.selfDivide(f).doubleValue(),W=S.valueOf(r.y).selfAdd(S.valueOf(i.y).selfSubtract(r.y).selfMultiply(_)).doubleValue();return new A(p,W)},le.orientationIndexFilter=function(t,e,r){var i=null,n=(t.x-r.x)*(e.y-r.y),o=(t.y-r.y)*(e.x-r.x),f=n-o;if(n>0){if(o<=0)return le.signum(f);i=n+o}else if(n<0){if(o>=0)return le.signum(f);i=-n-o}else return le.signum(f);var u=le.DP_SAFE_EPSILON*i;return f>=u||-f>=u?le.signum(f):2},le.signum=function(t){return t>0?1:t<0?-1:0},qo.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(le,qo);var st=function(){},bs={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bs.X.get=function(){return 0},bs.Y.get=function(){return 1},bs.Z.get=function(){return 2},bs.M.get=function(){return 3},st.prototype.setOrdinate=function(t,e,r){},st.prototype.size=function(){},st.prototype.getOrdinate=function(t,e){},st.prototype.getCoordinate=function(){},st.prototype.getCoordinateCopy=function(t){},st.prototype.getDimension=function(){},st.prototype.getX=function(t){},st.prototype.clone=function(){},st.prototype.expandEnvelope=function(t){},st.prototype.copy=function(){},st.prototype.getY=function(t){},st.prototype.toCoordinateArray=function(){},st.prototype.interfaces_=function(){return[fn]},st.prototype.getClass=function(){return st},Object.defineProperties(st,bs);var Ho=function(){},is=function(s){function t(){s.call(this,"Projective point not representable on the Cartesian plane.")}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ho),Yt=function(){};Yt.arraycopy=function(t,e,r,i,n){for(var o=0,f=e;f<e+n;f++)r[i+o]=t[f],o++},Yt.getProperty=function(t){return{"line.separator":`
2
+ `}[t]};var Ye=function s(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],r=arguments[1];this.x=e,this.y=r,this.w=1}else if(arguments[0]instanceof s&&arguments[1]instanceof s){var i=arguments[0],n=arguments[1];this.x=i.y*n.w-n.y*i.w,this.y=n.x*i.w-i.x*n.w,this.w=i.x*n.y-n.x*i.y}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var o=arguments[0],f=arguments[1];this.x=o.y-f.y,this.y=f.x-o.x,this.w=o.x*f.y-f.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],a=arguments[2];this.x=u,this.y=l,this.w=a}else if(arguments.length===4){var c=arguments[0],p=arguments[1],d=arguments[2],h=arguments[3],m=c.y-p.y,_=p.x-c.x,W=c.x*p.y-p.x*c.y,C=d.y-h.y,I=h.x-d.x,L=d.x*h.y-h.x*d.y;this.x=_*L-I*W,this.y=C*W-m*L,this.w=m*I-C*_}};Ye.prototype.getY=function(){var t=this.y/this.w;if(K.isNaN(t)||K.isInfinite(t))throw new is;return t},Ye.prototype.getX=function(){var t=this.x/this.w;if(K.isNaN(t)||K.isInfinite(t))throw new is;return t},Ye.prototype.getCoordinate=function(){var t=new A;return t.x=this.getX(),t.y=this.getY(),t},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.intersection=function(t,e,r,i){var n=t.y-e.y,o=e.x-t.x,f=t.x*e.y-e.x*t.y,u=r.y-i.y,l=i.x-r.x,a=r.x*i.y-i.x*r.y,c=o*a-l*f,p=u*f-n*a,d=n*l-u*o,h=c/d,m=p/d;if(K.isNaN(h)||K.isInfinite(h)||K.isNaN(m)||K.isInfinite(m))throw new is;return new A(h,m)};var X=function s(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof s){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3];this.init(n,o,f,u)}},Zo={serialVersionUID:{configurable:!0}};X.prototype.getArea=function(){return this.getWidth()*this.getHeight()},X.prototype.equals=function(t){if(!(t instanceof X))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},X.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new X;var e=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,n=this._maxy<t._maxy?this._maxy:t._maxy;return new X(e,i,r,n)},X.prototype.isNull=function(){return this._maxx<this._minx},X.prototype.getMaxX=function(){return this._maxx},X.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof X){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}},X.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof A){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}},X.prototype.getMinY=function(){return this._miny},X.prototype.getMinX=function(){return this._minx},X.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof X){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},X.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},X.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},X.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},X.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},X.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},X.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},X.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},X.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},X.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},X.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof A){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}},X.prototype.centre=function(){return this.isNull()?null:new A((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},X.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof X){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3];n<o?(this._minx=n,this._maxx=o):(this._minx=o,this._maxx=n),f<u?(this._miny=f,this._maxy=u):(this._miny=u,this._maxy=f)}},X.prototype.getMaxY=function(){return this._maxy},X.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),e===0?r:r===0?e:Math.sqrt(e*e+r*r)},X.prototype.hashCode=function(){var t=17;return t=37*t+A.hashCode(this._minx),t=37*t+A.hashCode(this._maxx),t=37*t+A.hashCode(this._miny),t=37*t+A.hashCode(this._maxy),t},X.prototype.interfaces_=function(){return[Me,Re]},X.prototype.getClass=function(){return X},X.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.x<e.x?t.x:e.x)&&r.x<=(t.x>e.x?t.x:e.x)&&r.y>=(t.y<e.y?t.y:e.y)&&r.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3],u=Math.min(o.x,f.x),l=Math.max(o.x,f.x),a=Math.min(i.x,n.x),c=Math.max(i.x,n.x);return!(a>l||c<u||(u=Math.min(o.y,f.y),l=Math.max(o.y,f.y),a=Math.min(i.y,n.y),c=Math.max(i.y,n.y),a>l)||c<u)}},Zo.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(X,Zo);var ri={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},un=function(t){this.geometryFactory=t||new et};un.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var n=ri.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(n=ri.emptyTypeStr.exec(t),n[2]=void 0),n&&(r=n[1].toLowerCase(),i=n[2],rs[r]&&(e=rs[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},un.prototype.write=function(t){return this.extractGeometry(t)},un.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!xi[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+xi[e].apply(this,[t])+")",i};var xi={coordinate:function(t){return t.x+" "+t.y},point:function(t){return xi.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,r=[],i=0,n=t._geometries.length;i<n;++i)r.push("("+xi.point.apply(e,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var e=this,r=[],i=0,n=t._points._coordinates.length;i<n;++i)r.push(xi.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var e=this,r=[],i=0,n=t._points._coordinates.length;i<n;++i)r.push(xi.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var e=this,r=[],i=0,n=t._geometries.length;i<n;++i)r.push("("+xi.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+xi.linestring.apply(this,[t._shell])+")");for(var i=0,n=t._holes.length;i<n;++i)r.push("("+xi.linestring.apply(e,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var e=this,r=[],i=0,n=t._geometries.length;i<n;++i)r.push("("+xi.polygon.apply(e,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var e=this,r=[],i=0,n=t._geometries.length;i<n;++i)r.push(e.extractGeometry(t._geometries[i]));return r.join(",")}},rs={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(ri.spaces);return this.geometryFactory.createPoint(new A(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),n=[],o=0,f=i.length;o<f;++o)r=i[o].replace(ri.trimParens,"$1"),n.push(rs.point.apply(e,[r]));return this.geometryFactory.createMultiPoint(n)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),r=[],i,n=0,o=e.length;n<o;++n)i=e[n].trim().split(ri.spaces),r.push(new A(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),r=[],i,n=0,o=e.length;n<o;++n)i=e[n].trim().split(ri.spaces),r.push(new A(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(ri.parenComma),n=[],o=0,f=i.length;o<f;++o)r=i[o].replace(ri.trimParens,"$1"),n.push(rs.linestring.apply(e,[r]));return this.geometryFactory.createMultiLineString(n)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,n,o=t.trim().split(ri.parenComma),f,u=[],l=0,a=o.length;l<a;++l)r=o[l].replace(ri.trimParens,"$1"),i=rs.linestring.apply(e,[r]),n=e.geometryFactory.createLinearRing(i._points),l===0?f=n:u.push(n);return this.geometryFactory.createPolygon(f,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(ri.doubleParenComma),n=[],o=0,f=i.length;o<f;++o)r=i[o].replace(ri.trimParens,"$1"),n.push(rs.polygon.apply(e,[r]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=t.trim().split("|"),i=[],n=0,o=r.length;n<o;++n)i.push(e.read(r[n]));return this.geometryFactory.createGeometryCollection(i)}},ze=function(t){this.parser=new un(t)};ze.prototype.write=function(t){return this.parser.write(t)},ze.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var ki=function(s){function t(e){s.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new s().stack}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(Error),hn=function(s){function t(){if(s.call(this),arguments.length===0)s.call(this);else if(arguments.length===1){var e=arguments[0];s.call(this,e)}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ki),Q=function(){};Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.shouldNeverReachHere=function(){if(arguments.length===0)Q.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new hn("Should never reach here"+(t!==null?": "+t:""))}},Q.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Q.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new hn:new hn(e)},Q.equals=function(){var t,e,r;if(arguments.length===2)t=arguments[0],e=arguments[1],Q.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],r=arguments[2],!e.equals(t)))throw new hn("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};var Wt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new A,this._intPt[1]=new A,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Rr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Wt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},Wt.prototype.getTopologySummary=function(){var t=new ei;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},Wt.prototype.computeIntersection=function(t,e,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,r,i)},Wt.prototype.getIntersectionNum=function(){return this._result},Wt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),r=this.getEdgeDistance(t,1);e>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},Wt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Wt.prototype.setPrecisionModel=function(t){this._precisionModel=t},Wt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[e][0])||t._intPt[r].equals2D(t._inputLines[e][1])))return!0;return!1}},Wt.prototype.getIntersection=function(t){return this._intPt[t]},Wt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Wt.prototype.hasIntersection=function(){return this._result!==Wt.NO_INTERSECTION},Wt.prototype.getEdgeDistance=function(t,e){var r=Wt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r},Wt.prototype.isCollinear=function(){return this._result===Wt.COLLINEAR_INTERSECTION},Wt.prototype.toString=function(){return ze.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+ze.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Wt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},Wt.prototype.isIntersection=function(t){for(var e=this,r=0;r<this._result;r++)if(e._intPt[r].equals2D(t))return!0;return!1},Wt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.computeEdgeDistance=function(t,e,r){var i=Math.abs(r.x-e.x),n=Math.abs(r.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(r))i>n?o=i:o=n;else{var f=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>n?o=f:o=u,o===0&&!t.equals(e)&&(o=Math.max(f,u))}return Q.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},Wt.nonRobustComputeEdgeDistance=function(t,e,r){var i=t.x-e.x,n=t.y-e.y,o=Math.sqrt(i*i+n*n);return Q.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},Rr.DONT_INTERSECT.get=function(){return 0},Rr.DO_INTERSECT.get=function(){return 1},Rr.COLLINEAR.get=function(){return 2},Rr.NO_INTERSECTION.get=function(){return 0},Rr.POINT_INTERSECTION.get=function(){return 1},Rr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Wt,Rr);var gr=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new X(this._inputLines[0][0],this._inputLines[0][1]),n=new X(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&n.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];if(this._isProper=!1,X.intersects(i,n,r)&&V.orientationIndex(i,n,r)===0&&V.orientationIndex(n,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(n))&&(this._isProper=!1),this._result=s.POINT_INTERSECTION,null;this._result=s.NO_INTERSECTION}else return s.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,n,o,f){f.x=this.smallestInAbsValue(r.x,i.x,n.x,o.x),f.y=this.smallestInAbsValue(r.y,i.y,n.y,o.y),r.x-=f.x,r.y-=f.y,i.x-=f.x,i.y-=f.y,n.x-=f.x,n.y-=f.y,o.x-=f.x,o.y-=f.y},t.prototype.safeHCoordinateIntersection=function(r,i,n,o){var f=null;try{f=Ye.intersection(r,i,n,o)}catch(u){if(u instanceof is)f=t.nearestEndpoint(r,i,n,o);else throw u}finally{}return f},t.prototype.intersection=function(r,i,n,o){var f=this.intersectionWithNormalization(r,i,n,o);return this.isInSegmentEnvelopes(f)||(f=new A(t.nearestEndpoint(r,i,n,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(f),f},t.prototype.smallestInAbsValue=function(r,i,n,o){var f=r,u=Math.abs(f);return Math.abs(i)<u&&(f=i,u=Math.abs(i)),Math.abs(n)<u&&(f=n,u=Math.abs(n)),Math.abs(o)<u&&(f=o),f},t.prototype.checkDD=function(r,i,n,o,f){var u=le.intersection(r,i,n,o),l=this.isInSegmentEnvelopes(u);Yt.out.println("DD in env = "+l+" --------------------- "+u),f.distance(u)>1e-4&&Yt.out.println("Distance = "+f.distance(u))},t.prototype.intersectionWithNormalization=function(r,i,n,o){var f=new A(r),u=new A(i),l=new A(n),a=new A(o),c=new A;this.normalizeToEnvCentre(f,u,l,a,c);var p=this.safeHCoordinateIntersection(f,u,l,a);return p.x+=c.x,p.y+=c.y,p},t.prototype.computeCollinearIntersection=function(r,i,n,o){var f=X.intersects(r,i,n),u=X.intersects(r,i,o),l=X.intersects(n,o,r),a=X.intersects(n,o,i);return f&&u?(this._intPt[0]=n,this._intPt[1]=o,s.COLLINEAR_INTERSECTION):l&&a?(this._intPt[0]=r,this._intPt[1]=i,s.COLLINEAR_INTERSECTION):f&&l?(this._intPt[0]=n,this._intPt[1]=r,n.equals(r)&&!u&&!a?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):f&&a?(this._intPt[0]=n,this._intPt[1]=i,n.equals(i)&&!u&&!l?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!f&&!a?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):u&&a?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!f&&!l?s.POINT_INTERSECTION:s.COLLINEAR_INTERSECTION):s.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,n,o,f){var u=r.x<i.x?r.x:i.x,l=r.y<i.y?r.y:i.y,a=r.x>i.x?r.x:i.x,c=r.y>i.y?r.y:i.y,p=n.x<o.x?n.x:o.x,d=n.y<o.y?n.y:o.y,h=n.x>o.x?n.x:o.x,m=n.y>o.y?n.y:o.y,_=u>p?u:p,W=a<h?a:h,C=l>d?l:d,I=c<m?c:m,L=(_+W)/2,w=(C+I)/2;f.x=L,f.y=w,r.x-=f.x,r.y-=f.y,i.x-=f.x,i.y-=f.y,n.x-=f.x,n.y-=f.y,o.x-=f.x,o.y-=f.y},t.prototype.computeIntersect=function(r,i,n,o){if(this._isProper=!1,!X.intersects(r,i,n,o))return s.NO_INTERSECTION;var f=V.orientationIndex(r,i,n),u=V.orientationIndex(r,i,o);if(f>0&&u>0||f<0&&u<0)return s.NO_INTERSECTION;var l=V.orientationIndex(n,o,r),a=V.orientationIndex(n,o,i);if(l>0&&a>0||l<0&&a<0)return s.NO_INTERSECTION;var c=f===0&&u===0&&l===0&&a===0;return c?this.computeCollinearIntersection(r,i,n,o):(f===0||u===0||l===0||a===0?(this._isProper=!1,r.equals2D(n)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(n)||i.equals2D(o)?this._intPt[0]=i:f===0?this._intPt[0]=new A(n):u===0?this._intPt[0]=new A(o):l===0?this._intPt[0]=new A(r):a===0&&(this._intPt[0]=new A(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,n,o)),s.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,n,o){var f=r,u=V.distancePointLine(r,n,o),l=V.distancePointLine(i,n,o);return l<u&&(u=l,f=i),l=V.distancePointLine(n,r,i),l<u&&(u=l,f=n),l=V.distancePointLine(o,r,i),l<u&&(u=l,f=o),f},t}(Wt),Br=function(){};Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.orientationIndex=function(t,e,r){var i=e.x-t.x,n=e.y-t.y,o=r.x-e.x,f=r.y-e.y;return Br.signOfDet2x2(i,n,o,f)},Br.signOfDet2x2=function(t,e,r,i){var n=null,o=null,f=null;if(n=1,t===0||i===0)return e===0||r===0?0:e>0?r>0?-n:n:r>0?n:-n;if(e===0||r===0)return i>0?t>0?n:-n:t>0?-n:n;if(e>0?i>0?e<=i||(n=-n,o=t,t=r,r=o,o=e,e=i,i=o):e<=-i?(n=-n,r=-r,i=-i):(o=t,t=-r,r=o,o=e,e=-i,i=o):i>0?-e<=i?(n=-n,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,r=-r,i=-i):(n=-n,o=-t,t=-r,r=o,o=-e,e=-i,i=o),t>0)if(r>0){if(!(t<=r))return n}else return n;else{if(r>0)return-n;if(t>=r)n=-n,t=-t,r=-r;else return-n}for(;;){if(f=Math.floor(r/t),r=r-f*t,i=i-f*e,i<0)return-n;if(i>e)return n;if(t>r+r){if(e<i+i)return n}else{if(e>i+i)return-n;r=t-r,i=e-i,n=-n}if(i===0)return r===0?0:-n;if(r===0||(f=Math.floor(t/r),t=t-f*r,e=e-f*i,e<0))return n;if(e>i)return-n;if(r>t+t){if(i<e+e)return-n}else{if(i>e+e)return n;t=r-t,e=i-e,n=-n}if(e===0)return t===0?0:n;if(t===0)return-n}};var si=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};si.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var r=t.x,i=e.x;return r>i&&(r=e.x,i=t.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var n=t.x-this._p.x,o=t.y-this._p.y,f=e.x-this._p.x,u=e.y-this._p.y,l=Br.signOfDet2x2(n,o,f,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},si.prototype.isPointInPolygon=function(){return this.getLocation()!==P.EXTERIOR},si.prototype.getLocation=function(){return this._isPointOnSegment?P.BOUNDARY:this._crossingCount%2===1?P.INTERIOR:P.EXTERIOR},si.prototype.isOnSegment=function(){return this._isPointOnSegment},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.locatePointInRing=function(){if(arguments[0]instanceof A&&q(arguments[1],st)){for(var t=arguments[0],e=arguments[1],r=new si(t),i=new A,n=new A,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,n),r.countSegment(i,n),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof A&&arguments[1]instanceof Array){for(var f=arguments[0],u=arguments[1],l=new si(f),a=1;a<u.length;a++){var c=u[a],p=u[a-1];if(l.countSegment(c,p),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var V=function(){},Or={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.orientationIndex=function(t,e,r){return le.orientationIndex(t,e,r)},V.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,r=t[0].x,i=1;i<t.length-1;i++){var n=t[i].x-r,o=t[i+1].y,f=t[i-1].y;e+=n*(f-o)}return e/2}else if(q(arguments[0],st)){var u=arguments[0],l=u.size();if(l<3)return 0;var a=new A,c=new A,p=new A;u.getCoordinate(0,c),u.getCoordinate(1,p);var d=c.x;p.x-=d;for(var h=0,m=1;m<l-1;m++)a.y=c.y,c.x=p.x,c.y=p.y,u.getCoordinate(m+1,p),p.x-=d,h+=c.x*(a.y-p.y);return h/2}},V.distanceLineLine=function(t,e,r,i){if(t.equals(e))return V.distancePointLine(t,r,i);if(r.equals(i))return V.distancePointLine(i,t,e);var n=!1;if(!X.intersects(t,e,r,i))n=!0;else{var o=(e.x-t.x)*(i.y-r.y)-(e.y-t.y)*(i.x-r.x);if(o===0)n=!0;else{var f=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y),l=u/o,a=f/o;(a<0||a>1||l<0||l>1)&&(n=!0)}}return n?Le.min(V.distancePointLine(t,r,i),V.distancePointLine(e,r,i),V.distancePointLine(r,t,e),V.distancePointLine(i,t,e)):0},V.isPointInRing=function(t,e){return V.locatePointInRing(t,e)!==P.EXTERIOR},V.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,i=new A;t.getCoordinate(0,i);for(var n=i.x,o=i.y,f=1;f<e;f++){t.getCoordinate(f,i);var u=i.x,l=i.y,a=u-n,c=l-o;r+=Math.sqrt(a*a+c*c),n=u,o=l}return r},V.isCCW=function(t){var e=t.length-1;if(e<3)throw new Ct("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,n=1;n<=e;n++){var o=t[n];o.y>r.y&&(r=o,i=n)}var f=i;do f=f-1,f<0&&(f=e);while(t[f].equals2D(r)&&f!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(r)&&u!==i);var l=t[f],a=t[u];if(l.equals2D(r)||a.equals2D(r)||l.equals2D(a))return!1;var c=V.computeOrientation(l,r,a),p=!1;return c===0?p=l.x>a.x:p=c>0,p},V.locatePointInRing=function(t,e){return si.locatePointInRing(t,e)},V.distancePointLinePerpendicular=function(t,e,r){var i=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),n=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/i;return Math.abs(n)*Math.sqrt(i)},V.computeOrientation=function(t,e,r){return V.orientationIndex(t,e,r)},V.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new Ct("Line array must contain at least one vertex");for(var r=t.distance(e[0]),i=0;i<e.length-1;i++){var n=V.distancePointLine(t,e[i],e[i+1]);n<r&&(r=n)}return r}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];if(f.x===u.x&&f.y===u.y)return o.distance(f);var l=(u.x-f.x)*(u.x-f.x)+(u.y-f.y)*(u.y-f.y),a=((o.x-f.x)*(u.x-f.x)+(o.y-f.y)*(u.y-f.y))/l;if(a<=0)return o.distance(f);if(a>=1)return o.distance(u);var c=((f.y-o.y)*(u.x-f.x)-(f.x-o.x)*(u.y-f.y))/l;return Math.abs(c)*Math.sqrt(l)}},V.isOnLine=function(t,e){for(var r=new gr,i=1;i<e.length;i++){var n=e[i-1],o=e[i];if(r.computeIntersection(t,n,o),r.hasIntersection())return!0}return!1},Or.CLOCKWISE.get=function(){return-1},Or.RIGHT.get=function(){return V.CLOCKWISE},Or.COUNTERCLOCKWISE.get=function(){return 1},Or.LEFT.get=function(){return V.COUNTERCLOCKWISE},Or.COLLINEAR.get=function(){return 0},Or.STRAIGHT.get=function(){return V.COLLINEAR},Object.defineProperties(V,Or);var Vi=function(){};Vi.prototype.filter=function(t){},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi};var U=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Ii={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};U.prototype.isGeometryCollection=function(){return this.getSortIndex()===U.SORTINDEX_GEOMETRYCOLLECTION},U.prototype.getFactory=function(){return this._factory},U.prototype.getGeometryN=function(t){return this},U.prototype.getArea=function(){return 0},U.prototype.isRectangle=function(){return!1},U.prototype.equals=function(){if(arguments[0]instanceof U){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof U))return!1;var r=e;return this.equalsExact(r)}},U.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},U.prototype.geometryChanged=function(){this.apply(U.geometryChangedFilter)},U.prototype.geometryChangedAction=function(){this._envelope=null},U.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},U.prototype.getLength=function(){return 0},U.prototype.getNumGeometries=function(){return 1},U.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},U.prototype.getUserData=function(){return this._userData},U.prototype.getSRID=function(){return this._SRID},U.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},U.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===U.SORTINDEX_GEOMETRYCOLLECTION)throw new Ct("This method does not support GeometryCollection arguments")},U.prototype.equal=function(t,e,r){return r===0?t.equals(e):t.distance(e)<=r},U.prototype.norm=function(){var t=this.copy();return t.normalize(),t},U.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},U.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new X(this._envelope)},U.prototype.setSRID=function(t){this._SRID=t},U.prototype.setUserData=function(t){this._userData=t},U.prototype.compare=function(t,e){for(var r=t.iterator(),i=e.iterator();r.hasNext()&&i.hasNext();){var n=r.next(),o=i.next(),f=n.compareTo(o);if(f!==0)return f}return r.hasNext()?1:i.hasNext()?-1:0},U.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},U.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===U.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===U.SORTINDEX_MULTIPOINT||this.getSortIndex()===U.SORTINDEX_MULTILINESTRING||this.getSortIndex()===U.SORTINDEX_MULTIPOLYGON},U.prototype.interfaces_=function(){return[fn,Me,Re]},U.prototype.getClass=function(){return U},U.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},U.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Ii.serialVersionUID.get=function(){return 8763622679187377e3},Ii.SORTINDEX_POINT.get=function(){return 0},Ii.SORTINDEX_MULTIPOINT.get=function(){return 1},Ii.SORTINDEX_LINESTRING.get=function(){return 2},Ii.SORTINDEX_LINEARRING.get=function(){return 3},Ii.SORTINDEX_MULTILINESTRING.get=function(){return 4},Ii.SORTINDEX_POLYGON.get=function(){return 5},Ii.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Ii.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Ii.geometryChangedFilter.get=function(){return Jn},Object.defineProperties(U,Ii);var Jn=function(){};Jn.interfaces_=function(){return[Vi]},Jn.filter=function(t){t.geometryChangedAction()};var Ti=function(){};Ti.prototype.filter=function(t){},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var Be=function(){},Gi={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Be.prototype.isInBoundary=function(t){},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Gi.Mod2BoundaryNodeRule.get=function(){return ss},Gi.EndPointBoundaryNodeRule.get=function(){return ns},Gi.MultiValentEndPointBoundaryNodeRule.get=function(){return os},Gi.MonoValentEndPointBoundaryNodeRule.get=function(){return as},Gi.MOD2_BOUNDARY_RULE.get=function(){return new ss},Gi.ENDPOINT_BOUNDARY_RULE.get=function(){return new ns},Gi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new os},Gi.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new as},Gi.OGC_SFS_BOUNDARY_RULE.get=function(){return Be.MOD2_BOUNDARY_RULE},Object.defineProperties(Be,Gi);var ss=function(){};ss.prototype.isInBoundary=function(t){return t%2===1},ss.prototype.interfaces_=function(){return[Be]},ss.prototype.getClass=function(){return ss};var ns=function(){};ns.prototype.isInBoundary=function(t){return t>0},ns.prototype.interfaces_=function(){return[Be]},ns.prototype.getClass=function(){return ns};var os=function(){};os.prototype.isInBoundary=function(t){return t>1},os.prototype.interfaces_=function(){return[Be]},os.prototype.getClass=function(){return os};var as=function(){};as.prototype.isInBoundary=function(t){return t===1},as.prototype.interfaces_=function(){return[Be]},as.prototype.getClass=function(){return as};var Bt=function(){};Bt.prototype.add=function(){},Bt.prototype.addAll=function(){},Bt.prototype.isEmpty=function(){},Bt.prototype.iterator=function(){},Bt.prototype.size=function(){},Bt.prototype.toArray=function(){},Bt.prototype.remove=function(){};function Qn(s){this.message=s||""}Qn.prototype=new Error,Qn.prototype.name="IndexOutOfBoundsException";var fs=function(){};fs.prototype.hasNext=function(){},fs.prototype.next=function(){},fs.prototype.remove=function(){};var Ue=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Bt);function us(s){this.message=s||""}us.prototype=new Error,us.prototype.name="NoSuchElementException";var k=function(s){function t(){s.call(this),this.array_=[],arguments[0]instanceof Bt&&this.addAll(arguments[0])}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[s,Bt]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,n=r.iterator();n.hasNext();)i.add(n.next());return!0},t.prototype.set=function(r,i){var n=this.array_[r];return this.array_[r]=i,n},t.prototype.iterator=function(){return new Rf(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new Qn;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],n=0,o=this.array_.length;n<o;n++)i.push(r.array_[n]);return i},t.prototype.remove=function(r){for(var i=this,n=!1,o=0,f=this.array_.length;o<f;o++)if(i.array_[o]===r){i.array_.splice(o,1),n=!0;break}return n},t}(Ue),Rf=function(s){function t(e){s.call(this),this.arrayList_=e,this.position_=0}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new us;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(fs),Ds=function(s){function t(){if(s.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.ensureCapacity(i.length),this.add(i,n)}}}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var n=arguments[0],o=arguments[1],f=!1,u=n.iterator();u.hasNext();)i.add(u.next(),o),f=!0;return f}else return s.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,n=s.prototype.clone.call(this),o=0;o<this.size();o++)n.add(o,i.get(o).copy());return n},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var n=arguments[0];s.prototype.add.call(this,n)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],f=arguments[1];return this.add(o,f,!0),!0}else if(arguments[0]instanceof A&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var a=this.get(this.size()-1);if(a.equals2D(u))return null}s.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],p=arguments[1];return this.add(c,p),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],h=arguments[1],m=arguments[2];if(m)for(var _=0;_<d.length;_++)i.add(d[_],h);else for(var W=d.length-1;W>=0;W--)i.add(d[W],h);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],L=arguments[2];if(!L){var w=this.size();if(w>0){if(C>0){var N=this.get(C-1);if(N.equals2D(I))return null}if(C<w){var D=this.get(C);if(D.equals2D(I))return null}}}s.prototype.add.call(this,C,I)}}else if(arguments.length===4){var B=arguments[0],M=arguments[1],O=arguments[2],R=arguments[3],H=1;O>R&&(H=-1);for(var j=O;j!==R;j+=H)i.add(B[j],M);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new A(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(k),tt=function(){},ln={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ln.ForwardComparator.get=function(){return Ms},ln.BidirectionalComparator.get=function(){return hs},ln.coordArrayType.get=function(){return new Array(0).fill(null)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},tt.ptNotInList=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(tt.indexOf(i,e)<0)return i}return null},tt.scroll=function(t,e){var r=tt.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);Yt.arraycopy(t,r,i,0,t.length-r),Yt.arraycopy(t,0,i,t.length-r,r),Yt.arraycopy(i,0,t,0,t.length)},tt.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(e[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];if(i===n)return!0;if(i===null||n===null||i.length!==n.length)return!1;for(var f=0;f<i.length;f++)if(o.compare(i[f],n[f])!==0)return!1;return!0}},tt.intersection=function(t,e){for(var r=new Ds,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()},tt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},tt.removeRepeatedPoints=function(t){if(!tt.hasRepeatedPoints(t))return t;var e=new Ds(t,!1);return e.toCoordinateArray()},tt.reverse=function(t){for(var e=t.length-1,r=Math.trunc(e/2),i=0;i<=r;i++){var n=t[i];t[i]=t[e-i],t[e-i]=n}},tt.removeNull=function(t){for(var e=0,r=0;r<t.length;r++)t[r]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var n=0,o=0;o<t.length;o++)t[o]!==null&&(i[n++]=t[o]);return i},tt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),r=0;r<t.length;r++)e[r]=new A(t[r]);return e}else if(arguments.length===5)for(var i=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3],u=arguments[4],l=0;l<u;l++)o[f+l]=new A(i[n+l])},tt.isEqualReversed=function(t,e){for(var r=0;r<t.length;r++){var i=t[r],n=e[t.length-r-1];if(i.compareTo(n)!==0)return!1}return!0},tt.envelope=function(t){for(var e=new X,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e},tt.toCoordinateArray=function(t){return t.toArray(tt.coordArrayType)},tt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},tt.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1},tt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var r=t.length-1-e,i=t[e].compareTo(t[r]);if(i!==0)return i}return 1},tt.compare=function(t,e){for(var r=0;r<t.length&&r<e.length;){var i=t[r].compareTo(e[r]);if(i!==0)return i;r++}return r<e.length?-1:r<t.length?1:0},tt.minCoordinate=function(t){for(var e=null,r=0;r<t.length;r++)(e===null||e.compareTo(t[r])>0)&&(e=t[r]);return e},tt.extract=function(t,e,r){e=Le.clamp(e,0,t.length),r=Le.clamp(r,-1,t.length);var i=r-e+1;r<0&&(i=0),e>=t.length&&(i=0),r<e&&(i=0);var n=new Array(i).fill(null);if(i===0)return n;for(var o=0,f=e;f<=r;f++)n[o++]=t[f];return n},Object.defineProperties(tt,ln);var Ms=function(){};Ms.prototype.compare=function(t,e){var r=t,i=e;return tt.compare(r,i)},Ms.prototype.interfaces_=function(){return[ts]},Ms.prototype.getClass=function(){return Ms};var hs=function(){};hs.prototype.compare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var n=tt.compare(r,i),o=tt.isEqualReversed(r,i);return o?0:n},hs.prototype.OLDcompare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var n=tt.increasingDirection(r),o=tt.increasingDirection(i),f=n>0?0:r.length-1,u=o>0?0:r.length-1,l=0;l<r.length;l++){var a=r[f].compareTo(i[u]);if(a!==0)return a;f+=n,u+=o}return 0},hs.prototype.interfaces_=function(){return[ts]},hs.prototype.getClass=function(){return hs};var Fr=function(){};Fr.prototype.get=function(){},Fr.prototype.put=function(){},Fr.prototype.size=function(){},Fr.prototype.values=function(){},Fr.prototype.entrySet=function(){};var Bf=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t}(Fr);function Rs(s){this.message=s||""}Rs.prototype=new Error,Rs.prototype.name="OperationNotSupported";function cn(){}cn.prototype=new Bt,cn.prototype.contains=function(){};var $n=function(s){function t(){s.call(this),this.array_=[],arguments[0]instanceof Bt&&this.addAll(arguments[0])}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,n=0,o=this.array_.length;n<o;n++){var f=i.array_[n];if(f===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,n=r.iterator();n.hasNext();)i.add(n.next());return!0},t.prototype.remove=function(r){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var r=this,i=[],n=0,o=this.array_.length;n<o;n++)i.push(r.array_[n]);return i},t.prototype.iterator=function(){return new Of(this)},t}(cn),Of=function(s){function t(e){s.call(this),this.hashSet_=e,this.position_=0}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new us;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Rs},t}(fs),Xi=0,dr=1;function Ko(s){return s===null?Xi:s.color}function mt(s){return s===null?null:s.parent}function Yi(s,t){s!==null&&(s.color=t)}function to(s){return s===null?null:s.left}function jo(s){return s===null?null:s.right}function Jt(){this.root_=null,this.size_=0}Jt.prototype=new Bf,Jt.prototype.get=function(s){for(var t=this.root_;t!==null;){var e=s.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Jt.prototype.put=function(s,t){if(this.root_===null)return this.root_={key:s,value:t,left:null,right:null,parent:null,color:Xi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,r,i;do if(r=e,i=s.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var n=e.value;return e.value=t,n}while(e!==null);var o={key:s,left:null,right:null,value:t,parent:r,color:Xi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=o:r.right=o,this.fixAfterInsertion(o),this.size_++,null},Jt.prototype.fixAfterInsertion=function(s){var t=this;for(s.color=dr;s!=null&&s!==this.root_&&s.parent.color===dr;)if(mt(s)===to(mt(mt(s)))){var e=jo(mt(mt(s)));Ko(e)===dr?(Yi(mt(s),Xi),Yi(e,Xi),Yi(mt(mt(s)),dr),s=mt(mt(s))):(s===jo(mt(s))&&(s=mt(s),t.rotateLeft(s)),Yi(mt(s),Xi),Yi(mt(mt(s)),dr),t.rotateRight(mt(mt(s))))}else{var r=to(mt(mt(s)));Ko(r)===dr?(Yi(mt(s),Xi),Yi(r,Xi),Yi(mt(mt(s)),dr),s=mt(mt(s))):(s===to(mt(s))&&(s=mt(s),t.rotateRight(s)),Yi(mt(s),Xi),Yi(mt(mt(s)),dr),t.rotateLeft(mt(mt(s))))}this.root_.color=Xi},Jt.prototype.values=function(){var s=new k,t=this.getFirstEntry();if(t!==null)for(s.add(t.value);(t=Jt.successor(t))!==null;)s.add(t.value);return s},Jt.prototype.entrySet=function(){var s=new $n,t=this.getFirstEntry();if(t!==null)for(s.add(t);(t=Jt.successor(t))!==null;)s.add(t);return s},Jt.prototype.rotateLeft=function(s){if(s!=null){var t=s.right;s.right=t.left,t.left!=null&&(t.left.parent=s),t.parent=s.parent,s.parent===null?this.root_=t:s.parent.left===s?s.parent.left=t:s.parent.right=t,t.left=s,s.parent=t}},Jt.prototype.rotateRight=function(s){if(s!=null){var t=s.left;s.left=t.right,t.right!=null&&(t.right.parent=s),t.parent=s.parent,s.parent===null?this.root_=t:s.parent.right===s?s.parent.right=t:s.parent.left=t,t.right=s,s.parent=t}},Jt.prototype.getFirstEntry=function(){var s=this.root_;if(s!=null)for(;s.left!=null;)s=s.left;return s},Jt.successor=function(s){if(s===null)return null;if(s.right!==null){for(var t=s.right;t.left!==null;)t=t.left;return t}else{for(var e=s.parent,r=s;e!==null&&r===e.right;)r=e,e=e.parent;return e}},Jt.prototype.size=function(){return this.size_};var Bs=function(){};Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs};function Jo(){}Jo.prototype=new cn;function ni(){this.array_=[],arguments[0]instanceof Bt&&this.addAll(arguments[0])}ni.prototype=new Jo,ni.prototype.contains=function(s){for(var t=this,e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(s)===0)return!0}return!1},ni.prototype.add=function(s){var t=this;if(this.contains(s))return!1;for(var e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(s)===1)return t.array_.splice(e,0,s),!0}return this.array_.push(s),!0},ni.prototype.addAll=function(s){for(var t=this,e=s.iterator();e.hasNext();)t.add(e.next());return!0},ni.prototype.remove=function(s){throw new Rs},ni.prototype.size=function(){return this.array_.length},ni.prototype.isEmpty=function(){return this.array_.length===0},ni.prototype.toArray=function(){for(var s=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(s.array_[e]);return t},ni.prototype.iterator=function(){return new pn(this)};var pn=function(s){this.treeSet_=s,this.position_=0};pn.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new us;return this.treeSet_.array_[this.position_++]},pn.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},pn.prototype.remove=function(){throw new Rs};var mr=function(){};mr.sort=function(){var t=arguments[0],e,r,i,n;if(arguments.length===1)n=function(f,u){return f.compareTo(u)},t.sort(n);else if(arguments.length===2)i=arguments[1],n=function(f,u){return i.compare(f,u)},t.sort(n);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var o=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],n=function(f,u){return i.compare(f,u)},r.sort(n),o=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},mr.asList=function(t){for(var e=new k,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var nt=function(){},qe={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};qe.P.get=function(){return 0},qe.L.get=function(){return 1},qe.A.get=function(){return 2},qe.FALSE.get=function(){return-1},qe.TRUE.get=function(){return-2},qe.DONTCARE.get=function(){return-3},qe.SYM_FALSE.get=function(){return"F"},qe.SYM_TRUE.get=function(){return"T"},qe.SYM_DONTCARE.get=function(){return"*"},qe.SYM_P.get=function(){return"0"},qe.SYM_L.get=function(){return"1"},qe.SYM_A.get=function(){return"2"},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.toDimensionSymbol=function(t){switch(t){case nt.FALSE:return nt.SYM_FALSE;case nt.TRUE:return nt.SYM_TRUE;case nt.DONTCARE:return nt.SYM_DONTCARE;case nt.P:return nt.SYM_P;case nt.L:return nt.SYM_L;case nt.A:return nt.SYM_A}throw new Ct("Unknown dimension value: "+t)},nt.toDimensionValue=function(t){switch(Ns.toUpperCase(t)){case nt.SYM_FALSE:return nt.FALSE;case nt.SYM_TRUE:return nt.TRUE;case nt.SYM_DONTCARE:return nt.DONTCARE;case nt.SYM_P:return nt.P;case nt.SYM_L:return nt.L;case nt.SYM_A:return nt.A}throw new Ct("Unknown dimension symbol: "+t)},Object.defineProperties(nt,qe);var oi=function(){};oi.prototype.filter=function(t){},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi};var He=function(){};He.prototype.filter=function(t,e){},He.prototype.isDone=function(){},He.prototype.isGeometryChanged=function(){},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var ee=function(s){function t(r,i){if(s.call(this,i),this._geometries=r||[],s.hasNullElements(this._geometries))throw new Ct("geometries must not contain null elements")}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,n=new X,o=0;o<this._geometries.length;o++)n.expandToInclude(i._geometries[o].getEnvelopeInternal());return n},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return s.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,n=new Array(this.getNumPoints()).fill(null),o=-1,f=0;f<this._geometries.length;f++)for(var u=i._geometries[f].getCoordinates(),l=0;l<u.length;l++)o++,n[o]=u[l];return n},t.prototype.getArea=function(){for(var i=this,n=0,o=0;o<this._geometries.length;o++)n+=i._geometries[o].getArea();return n},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n;if(this._geometries.length!==f._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(f._geometries[u],o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,n=0;n<this._geometries.length;n++)i._geometries[n].normalize();mr.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,n=nt.FALSE,o=0;o<this._geometries.length;o++)n=Math.max(n,i._geometries[o].getBoundaryDimension());return n},t.prototype.getDimension=function(){for(var i=this,n=nt.FALSE,o=0;o<this._geometries.length;o++)n=Math.max(n,i._geometries[o].getDimension());return n},t.prototype.getLength=function(){for(var i=this,n=0,o=0;o<this._geometries.length;o++)n+=i._geometries[o].getLength();return n},t.prototype.getNumPoints=function(){for(var i=this,n=0,o=0;o<this._geometries.length;o++)n+=i._geometries[o].getNumPoints();return n},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[f]=i._geometries[f].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var n=arguments[0],o=new ni(mr.asList(this._geometries)),f=new ni(mr.asList(n._geometries));return this.compare(o,f)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],a=u,c=this.getNumGeometries(),p=a.getNumGeometries(),d=0;d<c&&d<p;){var h=i.getGeometryN(d),m=a.getGeometryN(d),_=h.compareToSameClass(m,l);if(_!==0)return _;d++}return d<c?1:d<p?-1:0}},t.prototype.apply=function(){var i=this;if(q(arguments[0],Ti))for(var n=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(n);else if(q(arguments[0],He)){var f=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(f),!f.isDone());u++);f.isGeometryChanged()&&this.geometryChanged()}else if(q(arguments[0],oi)){var l=arguments[0];l.filter(this);for(var a=0;a<this._geometries.length;a++)i._geometries[a].apply(l)}else if(q(arguments[0],Vi)){var c=arguments[0];c.filter(this);for(var p=0;p<this._geometries.length;p++)i._geometries[p].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Q.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,n=s.prototype.clone.call(this);n._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)n._geometries[o]=i._geometries[o].clone();return n},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=i._geometries[o].copy();return new t(n,this._factory)},t.prototype.isEmpty=function(){for(var i=this,n=0;n<this._geometries.length;n++)if(!i._geometries[n].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(U),yr=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return U.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.isEquivalentClass(i)?s.prototype.equalsExact.call(this,i,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?nt.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!i._geometries[n].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[n-1-f]=i._geometries[f].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new Oe(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=i._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[Bs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(ee),Oe=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Be.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Oe.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Oe.prototype.getBoundary=function(){return this._geom instanceof Tt?this.boundaryLineString(this._geom):this._geom instanceof yr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Oe.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Oe.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Oe.prototype.computeBoundaryCoordinates=function(t){var e=this,r=new k;this._endpointMap=new Jt;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);n.getNumPoints()!==0&&(e.addEndpoint(n.getCoordinateN(0)),e.addEndpoint(n.getCoordinateN(n.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var f=o.next(),u=f.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&r.add(f.getKey())}return tt.toCoordinateArray(r)},Oe.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new gn,this._endpointMap.put(t,e)),e.count++},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Oe(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new Oe(r,i);return n.getBoundary()}};var gn=function(){this.count=null};gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};function Ff(){}function xf(){}var kf=function(){};function Vf(){}function Gf(){}function Xf(){}var Fe=function(){},eo={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)},Fe.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Vf,r=new Ff;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],n=arguments[1],o="";new xf(Fe.getStackTrace(i));for(var f=new Xf,u=0;u<n;u++)try{o+=f.readLine()+Fe.NEWLINE}catch(l){if(l instanceof Gf)Q.shouldNeverReachHere();else throw l}finally{}return o}},Fe.split=function(t,e){for(var r=e.length,i=new k,n=""+t,o=n.indexOf(e);o>=0;){var f=n.substring(0,o);i.add(f),n=n.substring(o+r),o=n.indexOf(e)}n.length>0&&i.add(n);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Fe.toString=function(){if(arguments.length===1){var t=arguments[0];return Fe.SIMPLE_ORDINATE_FORMAT.format(t)}},Fe.spaces=function(t){return Fe.chars(" ",t)},eo.NEWLINE.get=function(){return Yt.getProperty("line.separator")},eo.SIMPLE_ORDINATE_FORMAT.get=function(){return new kf},Object.defineProperties(Fe,eo);var Et=function(){};Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.copyCoord=function(t,e,r,i){for(var n=Math.min(t.getDimension(),r.getDimension()),o=0;o<n;o++)r.setOrdinate(i,o,t.getOrdinate(e,o))},Et.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,st.X)===t.getOrdinate(e-1,st.X)&&t.getOrdinate(0,st.Y)===t.getOrdinate(e-1,st.Y)},Et.isEqual=function(t,e){var r=t.size(),i=e.size();if(r!==i)return!1;for(var n=Math.min(t.getDimension(),e.getDimension()),o=0;o<r;o++)for(var f=0;f<n;f++){var u=t.getOrdinate(o,f),l=e.getOrdinate(o,f);if(t.getOrdinate(o,f)!==e.getOrdinate(o,f)&&!(K.isNaN(u)&&K.isNaN(l)))return!1}return!0},Et.extend=function(t,e,r){var i=t.create(r,e.getDimension()),n=e.size();if(Et.copy(e,0,i,0,n),n>0)for(var o=n;o<r;o++)Et.copy(e,n-1,i,o,1);return i},Et.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)Et.swap(t,i,e-i)},Et.swap=function(t,e,r){if(e===r)return null;for(var i=0;i<t.getDimension();i++){var n=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,n)}},Et.copy=function(t,e,r,i,n){for(var o=0;o<n;o++)Et.copyCoord(t,e+o,r,i+o)},Et.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new ei;i.append("(");for(var n=0;n<e;n++){n>0&&i.append(" ");for(var o=0;o<r;o++)o>0&&i.append(","),i.append(Fe.toString(t.getOrdinate(n,o)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return Et.createClosedRing(t,e,4);var i=e.getOrdinate(0,st.X)===e.getOrdinate(r-1,st.X)&&e.getOrdinate(0,st.Y)===e.getOrdinate(r-1,st.Y);return i?e:Et.createClosedRing(t,e,r+1)},Et.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),n=e.size();Et.copy(e,0,i,0,n);for(var o=n;o<r;o++)Et.copy(e,0,i,o,1);return i};var Tt=function(s){function t(r,i){s.call(this,i),this._points=null,this.init(r)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new X:this._points.expandEnvelope(new X)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return s.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n;if(this._points.size()!==f._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),f._points.getCoordinate(u),o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,n=0;n<Math.trunc(this._points.size()/2);n++){var o=i._points.size()-1-n;if(!i._points.getCoordinate(n).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(n).compareTo(i._points.getCoordinate(o))>0&&Et.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?nt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return V.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var n=this.getFactory().createLineString(i);return n},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var n=arguments[0],o=n,f=0,u=0;f<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(f).compareTo(o._points.getCoordinate(u));if(l!==0)return l;f++,u++}return f<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var a=arguments[0],c=arguments[1],p=a;return c.compare(this._points,p._points)}},t.prototype.apply=function(){var i=this;if(q(arguments[0],Ti))for(var n=arguments[0],o=0;o<this._points.size();o++)n.filter(i._points.getCoordinate(o));else if(q(arguments[0],He)){var f=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(f.filter(i._points,u),!f.isDone());u++);f.isGeometryChanged()&&this.geometryChanged()}else if(q(arguments[0],oi)){var l=arguments[0];l.filter(this)}else if(q(arguments[0],Vi)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return new Oe(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=s.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Ct("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var n=this,o=0;o<this._points.size();o++)if(n._points.getCoordinate(o).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[Bs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(U),Os=function(){};Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var ye=function(s){function t(r,i){s.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new X;var i=new X;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return s.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],n=i;return this.getCoordinate().compareTo(n.getCoordinate())}else if(arguments.length===2){var o=arguments[0],f=arguments[1],u=o;return f.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(q(arguments[0],Ti)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(q(arguments[0],He)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this._coordinates,0),n.isGeometryChanged()&&this.geometryChanged()}else if(q(arguments[0],oi)){var o=arguments[0];o.filter(this)}else if(q(arguments[0],Vi)){var f=arguments[0];f.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=s.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),Q.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[Os]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(U),tr=function(){};tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var Ot=function(s){function t(r,i,n){if(s.call(this,n),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),s.hasNullElements(i))throw new Ct("holes must not contain null elements");if(r.isEmpty()&&s.hasNonEmptyElements(i))throw new Ct("shell is empty but holes are not");this._shell=r,this._holes=i}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return s.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var n=new Array(this.getNumPoints()).fill(null),o=-1,f=this._shell.getCoordinates(),u=0;u<f.length;u++)o++,n[o]=f[u];for(var l=0;l<this._holes.length;l++)for(var a=i._holes[l].getCoordinates(),c=0;c<a.length;c++)o++,n[o]=a[c];return n},t.prototype.getArea=function(){var i=this,n=0;n+=Math.abs(V.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)n-=Math.abs(V.signedArea(i._holes[o].getCoordinateSequence()));return n},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),n=this.getEnvelopeInternal(),o=0;o<5;o++){var f=i.getX(o);if(!(f===n.getMinX()||f===n.getMaxX()))return!1;var u=i.getY(o);if(!(u===n.getMinY()||u===n.getMaxY()))return!1}for(var l=i.getX(0),a=i.getY(0),c=1;c<=4;c++){var p=i.getX(c),d=i.getY(c),h=p!==l,m=d!==a;if(h===m)return!1;l=p,a=d}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var n=arguments[0],o=arguments[1];if(!this.isEquivalentClass(n))return!1;var f=n,u=this._shell,l=f._shell;if(!u.equalsExact(l,o)||this._holes.length!==f._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!i._holes[a].equalsExact(f._holes[a],o))return!1;return!0}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var n=0;n<this._holes.length;n++)i.normalize(i._holes[n],!1);mr.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],f=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Yt.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=tt.minCoordinate(o.getCoordinates());tt.scroll(u,l),Yt.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],V.isCCW(o.getCoordinates())===f&&tt.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,n=0;n+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)n+=i._holes[o].getLength();return n},t.prototype.getNumPoints=function(){for(var i=this,n=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)n+=i._holes[o].getNumPoints();return n},t.prototype.reverse=function(){var i=this,n=this.copy();n._shell=this._shell.copy().reverse(),n._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)n._holes[o]=i._holes[o].copy().reverse();return n},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var n=arguments[0],o=this._shell,f=n._shell;return o.compareToSameClass(f)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],a=u,c=this._shell,p=a._shell,d=c.compareToSameClass(p,l);if(d!==0)return d;for(var h=this.getNumInteriorRing(),m=a.getNumInteriorRing(),_=0;_<h&&_<m;){var W=i.getInteriorRingN(_),C=a.getInteriorRingN(_),I=W.compareToSameClass(C,l);if(I!==0)return I;_++}return _<h?1:_<m?-1:0}},t.prototype.apply=function(i){var n=this;if(q(i,Ti)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)n._holes[o].apply(i)}else if(q(i,He)){if(this._shell.apply(i),!i.isDone())for(var f=0;f<this._holes.length&&(n._holes[f].apply(i),!i.isDone());f++);i.isGeometryChanged()&&this.geometryChanged()}else if(q(i,oi))i.filter(this);else if(q(i,Vi)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)n._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var n=new Array(this._holes.length+1).fill(null);n[0]=this._shell;for(var o=0;o<this._holes.length;o++)n[o+1]=i._holes[o];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)},t.prototype.clone=function(){var i=this,n=s.prototype.clone.call(this);n._shell=this._shell.clone(),n._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)n._holes[o]=i._holes[o].clone();return n},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,n=this._shell.copy(),o=new Array(this._holes.length).fill(null),f=0;f<o.length;f++)o[f]=i._holes[f].copy();return new t(n,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[tr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(U),ls=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return U.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.isEquivalentClass(i)?s.prototype.equalsExact.call(this,i,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return s.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=i._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[Os]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(ee),Li=function(s){function t(r,i){r instanceof A&&i instanceof et&&(r=i.getCoordinateSequenceFactory().create(r)),s.call(this,r,i),this.validateConstruction()}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return U.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return nt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:s.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var n=this.getFactory().createLinearRing(i);return n},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!s.prototype.isClosed.call(this))throw new Ct("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new Ct("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(Tt),Ai=function(s){function t(){s.apply(this,arguments)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return U.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.isEquivalentClass(i)?s.prototype.equalsExact.call(this,i,n):!1}else return s.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,n=this._geometries.length,o=new Array(n).fill(null),f=0;f<this._geometries.length;f++)o[f]=i._geometries[f].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var n=new k,o=0;o<this._geometries.length;o++)for(var f=i._geometries[o],u=f.getBoundary(),l=0;l<u.getNumGeometries();l++)n.add(u.getGeometryN(l));var a=new Array(n.size()).fill(null);return this.getFactory().createMultiLineString(n.toArray(a))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,n=new Array(this._geometries.length).fill(null),o=0;o<n.length;o++)n[o]=i._geometries[o].copy();return new t(n,this._factory)},t.prototype.interfaces_=function(){return[tr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(ee),xe=function(t){this._factory=t||null,this._isUserDataCopied=!1},dn={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};xe.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},xe.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r},xe.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof ee?this.editGeometryCollection(t,e):t instanceof Ot?this.editPolygon(t,e):t instanceof ye?e.edit(t,this._factory):t instanceof Tt?e.edit(t,this._factory):(Q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},xe.prototype.editGeometryCollection=function(t,e){for(var r=this,i=e.edit(t,this._factory),n=new k,o=0;o<i.getNumGeometries();o++){var f=r.edit(i.getGeometryN(o),e);f===null||f.isEmpty()||n.add(f)}return i.getClass()===ls?this._factory.createMultiPoint(n.toArray([])):i.getClass()===yr?this._factory.createMultiLineString(n.toArray([])):i.getClass()===Ai?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},xe.prototype.editPolygon=function(t,e){var r=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var n=this.edit(i.getExteriorRing(),e);if(n===null||n.isEmpty())return this._factory.createPolygon();for(var o=new k,f=0;f<i.getNumInteriorRing();f++){var u=r.edit(i.getInteriorRingN(f),e);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(n,o.toArray([]))},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.GeometryEditorOperation=function(){},dn.NoOpGeometryOperation.get=function(){return Fs},dn.CoordinateOperation.get=function(){return xs},dn.CoordinateSequenceOperation.get=function(){return ks},Object.defineProperties(xe,dn);var Fs=function(){};Fs.prototype.edit=function(t,e){return t},Fs.prototype.interfaces_=function(){return[xe.GeometryEditorOperation]},Fs.prototype.getClass=function(){return Fs};var xs=function(){};xs.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof Li?e.createLinearRing(r):t instanceof Tt?e.createLineString(r):t instanceof ye?r.length>0?e.createPoint(r[0]):e.createPoint():t},xs.prototype.interfaces_=function(){return[xe.GeometryEditorOperation]},xs.prototype.getClass=function(){return xs};var ks=function(){};ks.prototype.edit=function(t,e){return t instanceof Li?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Tt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ye?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ks.prototype.interfaces_=function(){return[xe.GeometryEditorOperation]},ks.prototype.getClass=function(){return ks};var Pt=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var r=0;r<e;r++)t._coordinates[r]=new A}else if(q(arguments[0],st)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var n=0;n<this._coordinates.length;n++)t._coordinates[n]=i.getCoordinateCopy(n)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],f=arguments[1];this._coordinates=o,this._dimension=f,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var a=0;a<u;a++)t._coordinates[a]=new A}}},Qo={serialVersionUID:{configurable:!0}};Pt.prototype.setOrdinate=function(t,e,r){switch(e){case st.X:this._coordinates[t].x=r;break;case st.Y:this._coordinates[t].y=r;break;case st.Z:this._coordinates[t].z=r;break;default:throw new Ct("invalid ordinateIndex")}},Pt.prototype.size=function(){return this._coordinates.length},Pt.prototype.getOrdinate=function(t,e){switch(e){case st.X:return this._coordinates[t].x;case st.Y:return this._coordinates[t].y;case st.Z:return this._coordinates[t].z}return K.NaN},Pt.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.z=this._coordinates[e].z}},Pt.prototype.getCoordinateCopy=function(t){return new A(this._coordinates[t])},Pt.prototype.getDimension=function(){return this._dimension},Pt.prototype.getX=function(t){return this._coordinates[t].x},Pt.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new Pt(e,this._dimension)},Pt.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t},Pt.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].copy();return new Pt(e,this._dimension)},Pt.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new ei(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(t._coordinates[r]);return e.append(")"),e.toString()}else return"()"},Pt.prototype.getY=function(t){return this._coordinates[t].y},Pt.prototype.toCoordinateArray=function(){return this._coordinates},Pt.prototype.interfaces_=function(){return[st,Re]},Pt.prototype.getClass=function(){return Pt},Qo.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Pt,Qo);var wi=function(){},io={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};wi.prototype.readResolve=function(){return wi.instance()},wi.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Pt(t)}else if(q(arguments[0],st)){var e=arguments[0];return new Pt(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new Pt(r):new Pt(r,i)}},wi.prototype.interfaces_=function(){return[es,Re]},wi.prototype.getClass=function(){return wi},wi.instance=function(){return wi.instanceObject},io.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},io.instanceObject.get=function(){return new wi},Object.defineProperties(wi,io);var $o=function(s){function t(){s.call(this),this.map_=new Map}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new k,i=this.map_.values(),n=i.next();!n.done;)r.add(n.value),n=i.next();return r},t.prototype.entrySet=function(){var r=new $n;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(Fr),ot=function s(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=s.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ai){var t=arguments[0];this._modelType=t,t===s.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=s.FIXED,this.setScale(e)}else if(arguments[0]instanceof s){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},ro={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};ot.prototype.equals=function(t){if(!(t instanceof ot))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},ot.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new ii(r).compareTo(new ii(i))},ot.prototype.getScale=function(){return this._scale},ot.prototype.isFloating=function(){return this._modelType===ot.FLOATING||this._modelType===ot.FLOATING_SINGLE},ot.prototype.getType=function(){return this._modelType},ot.prototype.toString=function(){var t="UNKNOWN";return this._modelType===ot.FLOATING?t="Floating":this._modelType===ot.FLOATING_SINGLE?t="Floating-Single":this._modelType===ot.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},ot.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(K.isNaN(t))return t;if(this._modelType===ot.FLOATING_SINGLE){var e=t;return e}return this._modelType===ot.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof A){var r=arguments[0];if(this._modelType===ot.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},ot.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===ot.FLOATING?t=16:this._modelType===ot.FLOATING_SINGLE?t=6:this._modelType===ot.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},ot.prototype.setScale=function(t){this._scale=Math.abs(t)},ot.prototype.interfaces_=function(){return[Re,Me]},ot.prototype.getClass=function(){return ot},ot.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ro.serialVersionUID.get=function(){return 7777263578777804e3},ro.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ot,ro);var ai=function s(t){this._name=t||null,s.nameToTypeMap.put(t,this)},so={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ai.prototype.readResolve=function(){return ai.nameToTypeMap.get(this._name)},ai.prototype.toString=function(){return this._name},ai.prototype.interfaces_=function(){return[Re]},ai.prototype.getClass=function(){return ai},so.serialVersionUID.get=function(){return-552860263173159e4},so.nameToTypeMap.get=function(){return new $o},Object.defineProperties(ai,so),ot.Type=ai,ot.FIXED=new ai("FIXED"),ot.FLOATING=new ai("FLOATING"),ot.FLOATING_SINGLE=new ai("FLOATING SINGLE");var et=function s(){this._precisionModel=new ot,this._SRID=0,this._coordinateSequenceFactory=s.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?q(arguments[0],es)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof ot&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ta={serialVersionUID:{configurable:!0}};et.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new A(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new A(t.getMinX(),t.getMinY()),new A(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new A(t.getMinX(),t.getMinY()),new A(t.getMinX(),t.getMaxY()),new A(t.getMaxX(),t.getMaxY()),new A(t.getMaxX(),t.getMinY()),new A(t.getMinX(),t.getMinY())]),null)},et.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Tt(this.getCoordinateSequenceFactory().create(t),this);if(q(t,st))return new Tt(t,this)}else return new Tt(this.getCoordinateSequenceFactory().create([]),this)},et.prototype.createMultiLineString=function(){if(arguments.length===0)return new yr(null,this);if(arguments.length===1){var t=arguments[0];return new yr(t,this)}},et.prototype.buildGeometry=function(t){for(var e=null,r=!1,i=!1,n=t.iterator();n.hasNext();){var o=n.next(),f=o.getClass();e===null&&(e=f),f!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(et.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Ot)return this.createMultiPolygon(et.toPolygonArray(t));if(u instanceof Tt)return this.createMultiLineString(et.toLineStringArray(t));if(u instanceof ye)return this.createMultiPoint(et.toPointArray(t));Q.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},et.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},et.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(q(arguments[0],st)){var e=arguments[0];return new ye(e,this)}}},et.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},et.prototype.createPolygon=function(){if(arguments.length===0)return new Ot(null,null,this);if(arguments.length===1){if(q(arguments[0],st)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Li){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return new Ot(i,n,this)}},et.prototype.getSRID=function(){return this._SRID},et.prototype.createGeometryCollection=function(){if(arguments.length===0)return new ee(null,this);if(arguments.length===1){var t=arguments[0];return new ee(t,this)}},et.prototype.createGeometry=function(t){var e=new xe(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},et.prototype.getPrecisionModel=function(){return this._precisionModel},et.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(q(arguments[0],st)){var e=arguments[0];return new Li(e,this)}}},et.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ai(null,this);if(arguments.length===1){var t=arguments[0];return new Ai(t,this)}},et.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new ls(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new ls(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(q(arguments[0],st)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(i.size()).fill(null),o=0;o<i.size();o++){var f=t.getCoordinateSequenceFactory().create(1,i.getDimension());Et.copy(i,o,f,0,1),n[o]=t.createPoint(f)}return this.createMultiPoint(n)}}},et.prototype.interfaces_=function(){return[Re]},et.prototype.getClass=function(){return et},et.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},et.getDefaultCoordinateSequenceFactory=function(){return wi.instance()},et.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},et.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ta.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(et,ta);var Yf=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],mn=function(t){this.geometryFactory=t||new et};mn.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!fi[r])throw new Error("Unknown GeoJSON type: "+e.type);return Yf.indexOf(r)!==-1?fi[r].apply(this,[e.coordinates]):r==="GeometryCollection"?fi[r].apply(this,[e.geometries]):fi[r].apply(this,[e])},mn.prototype.write=function(t){var e=t.getGeometryType();if(!zi[e])throw new Error("Geometry is not supported");return zi[e].apply(this,[t])};var fi={Feature:function(s){var t={};for(var e in s)t[e]=s[e];if(s.geometry){var r=s.geometry.type;if(!fi[r])throw new Error("Unknown GeoJSON type: "+s.type);t.geometry=this.read(s.geometry)}return s.bbox&&(t.bbox=fi.bbox.apply(this,[s.bbox])),t},FeatureCollection:function(s){var t=this,e={};if(s.features){e.features=[];for(var r=0;r<s.features.length;++r)e.features.push(t.read(s.features[r]))}return s.bbox&&(e.bbox=this.parse.bbox.apply(this,[s.bbox])),e},coordinates:function(s){for(var t=[],e=0;e<s.length;++e){var r=s[e];t.push(new A(r[0],r[1]))}return t},bbox:function(s){return this.geometryFactory.createLinearRing([new A(s[0],s[1]),new A(s[2],s[1]),new A(s[2],s[3]),new A(s[0],s[3]),new A(s[0],s[1])])},Point:function(s){var t=new A(s[0],s[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(s){for(var t=this,e=[],r=0;r<s.length;++r)e.push(fi.Point.apply(t,[s[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(s){var t=fi.coordinates.apply(this,[s]);return this.geometryFactory.createLineString(t)},MultiLineString:function(s){for(var t=this,e=[],r=0;r<s.length;++r)e.push(fi.LineString.apply(t,[s[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(s){for(var t=this,e=fi.coordinates.apply(this,[s[0]]),r=this.geometryFactory.createLinearRing(e),i=[],n=1;n<s.length;++n){var o=s[n],f=fi.coordinates.apply(t,[o]),u=t.geometryFactory.createLinearRing(f);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(s){for(var t=this,e=[],r=0;r<s.length;++r){var i=s[r];e.push(fi.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(s){for(var t=this,e=[],r=0;r<s.length;++r){var i=s[r];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},zi={coordinate:function(s){return[s.x,s.y]},Point:function(s){var t=zi.coordinate.apply(this,[s.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(s){for(var t=this,e=[],r=0;r<s._geometries.length;++r){var i=s._geometries[r],n=zi.Point.apply(t,[i]);e.push(n.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(s){for(var t=this,e=[],r=s.getCoordinates(),i=0;i<r.length;++i){var n=r[i];e.push(zi.coordinate.apply(t,[n]))}return{type:"LineString",coordinates:e}},MultiLineString:function(s){for(var t=this,e=[],r=0;r<s._geometries.length;++r){var i=s._geometries[r],n=zi.LineString.apply(t,[i]);e.push(n.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(s){var t=this,e=[],r=zi.LineString.apply(this,[s._shell]);e.push(r.coordinates);for(var i=0;i<s._holes.length;++i){var n=s._holes[i],o=zi.LineString.apply(t,[n]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(s){for(var t=this,e=[],r=0;r<s._geometries.length;++r){var i=s._geometries[r],n=zi.Polygon.apply(t,[i]);e.push(n.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(s){for(var t=this,e=[],r=0;r<s._geometries.length;++r){var i=s._geometries[r],n=i.getGeometryType();e.push(zi[n].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},no=function(t){this.geometryFactory=t||new et,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new mn(this.geometryFactory)};no.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===ot.FIXED&&this.reducePrecision(e),e},no.prototype.reducePrecision=function(t){var e=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)e.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)e.reducePrecision(t.geometries[r])};var ea=function(){this.parser=new mn(this.geometryFactory)};ea.prototype.write=function(t){return this.parser.write(t)};var x=function(){},yn={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.opposite=function(t){return t===x.LEFT?x.RIGHT:t===x.RIGHT?x.LEFT:t},yn.ON.get=function(){return 0},yn.LEFT.get=function(){return 1},yn.RIGHT.get=function(){return 2},Object.defineProperties(x,yn);function vn(s){this.message=s||""}vn.prototype=new Error,vn.prototype.name="EmptyStackException";function ui(){this.array_=[]}ui.prototype=new Ue,ui.prototype.add=function(s){return this.array_.push(s),!0},ui.prototype.get=function(s){if(s<0||s>=this.size())throw new Error;return this.array_[s]},ui.prototype.push=function(s){return this.array_.push(s),s},ui.prototype.pop=function(s){if(this.array_.length===0)throw new vn;return this.array_.pop()},ui.prototype.peek=function(){if(this.array_.length===0)throw new vn;return this.array_[this.array_.length-1]},ui.prototype.empty=function(){return this.array_.length===0},ui.prototype.isEmpty=function(){return this.empty()},ui.prototype.search=function(s){return this.array_.indexOf(s)},ui.prototype.size=function(){return this.array_.length},ui.prototype.toArray=function(){for(var s=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(s.array_[e]);return t};var hi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};hi.prototype.getCoordinate=function(){return this._minCoord},hi.prototype.getRightmostSide=function(t,e){var r=this.getRightmostSideOfSegment(t,e);return r<0&&(r=this.getRightmostSideOfSegment(t,e-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r},hi.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Q.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],r=t[this._minIndex+1],i=V.computeOrientation(this._minCoord,r,e),n=!1;(e.y<this._minCoord.y&&r.y<this._minCoord.y&&i===V.COUNTERCLOCKWISE||e.y>this._minCoord.y&&r.y>this._minCoord.y&&i===V.CLOCKWISE)&&(n=!0),n&&(this._minIndex=this._minIndex-1)},hi.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge(),i=r.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var n=x.LEFT;return i[e].y<i[e+1].y&&(n=x.RIGHT),n},hi.prototype.getEdge=function(){return this._orientedDe},hi.prototype.checkForRightmostCoordinate=function(t){for(var e=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(e._minCoord===null||r[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=r[i])},hi.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},hi.prototype.findEdge=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&e.checkForRightmostCoordinate(i)}Q.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var n=this.getRightmostSide(this._minDe,this._minIndex);n===x.LEFT&&(this._orientedDe=this._minDe.getSym())},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var Ui=function(s){function t(e,r){s.call(this,t.msgWithCoord(e,r)),this.pt=r?new A(r):null,this.name="TopologyException"}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},t}(ki),_n=function(){this.array_=[]};_n.prototype.addLast=function(t){this.array_.push(t)},_n.prototype.removeFirst=function(){return this.array_.shift()},_n.prototype.isEmpty=function(){return this.array_.length===0};var ie=function(){this._finder=null,this._dirEdgeList=new k,this._nodes=new k,this._rightMostCoord=null,this._env=null,this._finder=new hi};ie.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},ie.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ie.prototype.computeNodeDepth=function(t){for(var e=this,r=null,i=t.getEdges().iterator();i.hasNext();){var n=i.next();if(n.isVisited()||n.getSym().isVisited()){r=n;break}}if(r===null)throw new Ui("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var o=t.getEdges().iterator();o.hasNext();){var f=o.next();f.setVisited(!0),e.copySymDepths(f)}},ie.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(x.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ie.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ie.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(x.RIGHT)>=1&&e.getDepth(x.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ie.prototype.computeDepths=function(t){var e=this,r=new $n,i=new _n,n=t.getNode();for(i.addLast(n),r.add(n),t.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),e.computeNodeDepth(o);for(var f=o.getEdges().iterator();f.hasNext();){var u=f.next(),l=u.getSym();if(!l.isVisited()){var a=l.getNode();r.contains(a)||(i.addLast(a),r.add(a))}}}},ie.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ie.prototype.getEnvelope=function(){if(this._env===null){for(var t=new X,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next(),i=r.getEdge().getCoordinates(),n=0;n<i.length-1;n++)t.expandToInclude(i[n]);this._env=t}return this._env},ie.prototype.addReachable=function(t){var e=this,r=new ui;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}},ie.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(x.LEFT,t.getDepth(x.RIGHT)),e.setDepth(x.RIGHT,t.getDepth(x.LEFT))},ie.prototype.add=function(t,e){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var n=i.next();r._dirEdgeList.add(n);var o=n.getSym(),f=o.getNode();f.isVisited()||e.push(f)}},ie.prototype.getNodes=function(){return this._nodes},ie.prototype.getDirectedEdges=function(){return this._dirEdgeList},ie.prototype.interfaces_=function(){return[Me]},ie.prototype.getClass=function(){return ie};var yt=function s(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[x.ON]=r}else if(arguments[0]instanceof s){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var n=0;n<this.location.length;n++)t.location[n]=i.location[n]}}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];this.init(3),this.location[x.ON]=o,this.location[x.LEFT]=f,this.location[x.RIGHT]=u}};yt.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t},yt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==P.NONE)return!1;return!0},yt.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===P.NONE&&(e.location[r]=t)},yt.prototype.isLine=function(){return this.location.length===1},yt.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[x.ON]=this.location[x.ON],r[x.LEFT]=P.NONE,r[x.RIGHT]=P.NONE,this.location=r}for(var i=0;i<this.location.length;i++)e.location[i]===P.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},yt.prototype.getLocations=function(){return this.location},yt.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[x.LEFT];this.location[x.LEFT]=this.location[x.RIGHT],this.location[x.RIGHT]=t},yt.prototype.toString=function(){var t=new ei;return this.location.length>1&&t.append(P.toLocationSymbol(this.location[x.LEFT])),t.append(P.toLocationSymbol(this.location[x.ON])),this.location.length>1&&t.append(P.toLocationSymbol(this.location[x.RIGHT])),t.toString()},yt.prototype.setLocations=function(t,e,r){this.location[x.ON]=t,this.location[x.LEFT]=e,this.location[x.RIGHT]=r},yt.prototype.get=function(t){return t<this.location.length?this.location[t]:P.NONE},yt.prototype.isArea=function(){return this.location.length>1},yt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===P.NONE)return!0;return!1},yt.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(x.ON,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.location[e]=r}},yt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(P.NONE)},yt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},yt.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt};var ct=function s(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new yt(t),this.elt[1]=new yt(t)}else if(arguments[0]instanceof s){var e=arguments[0];this.elt[0]=new yt(e.elt[0]),this.elt[1]=new yt(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new yt(P.NONE),this.elt[1]=new yt(P.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];this.elt[0]=new yt(n,o,f),this.elt[1]=new yt(n,o,f)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],a=arguments[2],c=arguments[3];this.elt[0]=new yt(P.NONE,P.NONE,P.NONE),this.elt[1]=new yt(P.NONE,P.NONE,P.NONE),this.elt[u].setLocations(l,a,c)}};ct.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ct.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ct.prototype.isNull=function(t){return this.elt[t].isNull()},ct.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.elt[e].setAllLocationsIfNull(r)}},ct.prototype.isLine=function(t){return this.elt[t].isLine()},ct.prototype.merge=function(t){for(var e=this,r=0;r<2;r++)e.elt[r]===null&&t.elt[r]!==null?e.elt[r]=new yt(t.elt[r]):e.elt[r].merge(t.elt[r])},ct.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ct.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(x.ON)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.elt[e].get(r)}},ct.prototype.toString=function(){var t=new ei;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},ct.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},ct.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ct.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(x.ON,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this.elt[r].setLocation(i,n)}},ct.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ct.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ct.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new yt(this.elt[t].location[0]))},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct},ct.toLineLabel=function(t){for(var e=new ct(P.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var Dt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new k,this._pts=new k,this._label=new ct(P.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new k,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Dt.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=V.isCCW(this._ring.getCoordinates())},Dt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Dt.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Ui("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Ui("Directed Edge visited twice during ring-building at "+r.getCoordinate());e._edges.add(r);var n=r.getLabel();Q.isTrue(n.isArea()),e.mergeLabel(n),e.addPoints(r.getEdge(),r.isForward(),i),i=!1,e.setEdgeRing(r,e),r=e.getNext(r)}while(r!==this._startDe)},Dt.prototype.getLinearRing=function(){return this._ring},Dt.prototype.getCoordinate=function(t){return this._pts.get(t)},Dt.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Dt.prototype.addPoints=function(t,e,r){var i=this,n=t.getCoordinates();if(e){var o=1;r&&(o=0);for(var f=o;f<n.length;f++)i._pts.add(n[f])}else{var u=n.length-2;r&&(u=n.length-1);for(var l=u;l>=0;l--)i._pts.add(n[l])}},Dt.prototype.isHole=function(){return this._isHole},Dt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Dt.prototype.containsPoint=function(t){var e=this.getLinearRing(),r=e.getEnvelopeInternal();if(!r.contains(t)||!V.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var n=i.next();if(n.containsPoint(t))return!1}return!0},Dt.prototype.addHole=function(t){this._holes.add(t)},Dt.prototype.isShell=function(){return this._shell===null},Dt.prototype.getLabel=function(){return this._label},Dt.prototype.getEdges=function(){return this._edges},Dt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Dt.prototype.getShell=function(){return this._shell},Dt.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=e.getLocation(r,x.RIGHT);if(i===P.NONE)return null;if(this._label.getLocation(r)===P.NONE)return this._label.setLocation(r,i),null}},Dt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Dt.prototype.toPolygon=function(t){for(var e=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=e._holes.get(i).getLinearRing();var n=t.createPolygon(this.getLinearRing(),r);return n},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt};var zf=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Dt),Uf=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new k,n=this._startDe;do{if(n.getMinEdgeRing()===null){var o=new zf(n,r._geometryFactory);i.add(o)}n=n.getNext()}while(n!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var n=i.getNode();n.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Dt),Ae=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};Ae.prototype.setVisited=function(t){this._isVisited=t},Ae.prototype.setInResult=function(t){this._isInResult=t},Ae.prototype.isCovered=function(){return this._isCovered},Ae.prototype.isCoveredSet=function(){return this._isCoveredSet},Ae.prototype.setLabel=function(t){this._label=t},Ae.prototype.getLabel=function(){return this._label},Ae.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ae.prototype.updateIM=function(t){Q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ae.prototype.isInResult=function(){return this._isInResult},Ae.prototype.isVisited=function(){return this._isVisited},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};var Cn=function(s){function t(){s.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new ct(0,P.NONE)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var n=P.NONE;if(n=this._label.getLocation(i),!r.isNull(i)){var o=r.getLocation(i);n!==P.BOUNDARY&&(n=o)}return n},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new ct(r,i):this._label.setLocation(r,i)}else return s.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof ct)for(var n=arguments[0],o=0;o<2;o++){var f=r.computeMergedLocation(n,o),u=r._label.getLocation(o);u===P.NONE&&r._label.setLocation(o,f)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=P.NONE;this._label!==null&&(i=this._label.getLocation(r));var n=null;switch(i){case P.BOUNDARY:n=P.INTERIOR;break;case P.INTERIOR:n=P.BOUNDARY;break;default:n=P.BOUNDARY;break}this._label.setLocation(r,n)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ae),li=function(){this.nodeMap=new Jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};li.prototype.find=function(t){return this.nodeMap.get(t)},li.prototype.addNode=function(){if(arguments[0]instanceof A){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Cn){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},li.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},li.prototype.iterator=function(){return this.nodeMap.values().iterator()},li.prototype.values=function(){return this.nodeMap.values()},li.prototype.getBoundaryNodes=function(t){for(var e=new k,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===P.BOUNDARY&&e.add(i)}return e},li.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var pt=function(){},Vs={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.isNorthern=function(t){return t===pt.NE||t===pt.NW},pt.isOpposite=function(t,e){if(t===e)return!1;var r=(t-e+4)%4;return r===2},pt.commonHalfPlane=function(t,e){if(t===e)return t;var r=(t-e+4)%4;if(r===2)return-1;var i=t<e?t:e,n=t>e?t:e;return i===0&&n===3?3:i},pt.isInHalfPlane=function(t,e){return e===pt.SE?t===pt.SE||t===pt.SW:t===e||t===e+1},pt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new Ct("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?pt.NE:pt.SE:e>=0?pt.NW:pt.SW}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new Ct("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?pt.NE:pt.SE:i.y>=r.y?pt.NW:pt.SW}},Vs.NE.get=function(){return 0},Vs.NW.get=function(){return 1},Vs.SW.get=function(){return 2},Vs.SE.get=function(){return 3},Object.defineProperties(pt,Vs);var Qt=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],n=null;this._edge=e,this.init(r,i),this._label=n}else if(arguments.length===4){var o=arguments[0],f=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(f,u),this._label=l}};Qt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:V.computeOrientation(t._p0,t._p1,this._p1)},Qt.prototype.getDy=function(){return this._dy},Qt.prototype.getCoordinate=function(){return this._p0},Qt.prototype.setNode=function(t){this._node=t},Qt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),n=r.substring(i+1);t.print(" "+n+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Qt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Qt.prototype.getDirectedCoordinate=function(){return this._p1},Qt.prototype.getDx=function(){return this._dx},Qt.prototype.getLabel=function(){return this._label},Qt.prototype.getEdge=function(){return this._edge},Qt.prototype.getQuadrant=function(){return this._quadrant},Qt.prototype.getNode=function(){return this._node},Qt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Qt.prototype.computeLabel=function(t){},Qt.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=pt.quadrant(this._dx,this._dy),Q.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Qt.prototype.interfaces_=function(){return[Me]},Qt.prototype.getClass=function(){return Qt};var oo=function(s){function t(){var e=arguments[0],r=arguments[1];if(s.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new ct(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Ui("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,n=0;n<2;n++)r._label.isArea(n)&&r._label.getLocation(n,x.LEFT)===P.INTERIOR&&r._label.getLocation(n,x.RIGHT)===P.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){s.prototype.print.call(this,r),r.print(" "+this._depth[x.LEFT]+"/"+this._depth[x.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,P.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,P.EXTERIOR);return r&&i&&n},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var o=1;r===x.LEFT&&(o=-1);var f=x.opposite(r),u=n*o,l=i+u;this.setDepth(r,i),this.setDepth(f,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===P.EXTERIOR&&i===P.INTERIOR?1:r===P.INTERIOR&&i===P.EXTERIOR?-1:0},t}(Qt),cs=function(){};cs.prototype.createNode=function(t){return new Cn(t,null)},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs};var It=function(){if(this._edges=new k,this._nodes=null,this._edgeEndList=new k,arguments.length===0)this._nodes=new li(new cs);else if(arguments.length===1){var t=arguments[0];this._nodes=new li(t)}};It.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=e._edges.get(r);i.print(t),i.eiList.print(t)}},It.prototype.find=function(t){return this._nodes.find(t)},It.prototype.addNode=function(){if(arguments[0]instanceof Cn){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof A){var e=arguments[0];return this._nodes.addNode(e)}},It.prototype.getNodeIterator=function(){return this._nodes.iterator()},It.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},It.prototype.debugPrintln=function(t){Yt.out.println(t)},It.prototype.isBoundaryNode=function(t,e){var r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===P.BOUNDARY},It.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},It.prototype.matchInSameDirection=function(t,e,r,i){return t.equals(r)?V.computeOrientation(t,e,i)===V.COLLINEAR&&pt.quadrant(t,e)===pt.quadrant(r,i):!1},It.prototype.getEdgeEnds=function(){return this._edgeEndList},It.prototype.debugPrint=function(t){Yt.out.print(t)},It.prototype.getEdgeIterator=function(){return this._edges.iterator()},It.prototype.findEdgeInSameDirection=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var n=r._edges.get(i),o=n.getCoordinates();if(r.matchInSameDirection(t,e,o[0],o[1])||r.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return n}return null},It.prototype.insertEdge=function(t){this._edges.add(t)},It.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null},It.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var n=new oo(i,!0),o=new oo(i,!1);n.setSym(o),o.setSym(n),e.add(n),e.add(o)}},It.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},It.prototype.getNodes=function(){return this._nodes.values()},It.prototype.findEdge=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var n=r._edges.get(i),o=n.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return n}return null},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var ve=function(){this._geometryFactory=null,this._shellList=new k;var t=arguments[0];this._geometryFactory=t};ve.prototype.sortShellsAndHoles=function(t,e,r){for(var i=t.iterator();i.hasNext();){var n=i.next();n.isHole()?r.add(n):e.add(n)}},ve.prototype.computePolygons=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=n.toPolygon(e._geometryFactory);r.add(o)}return r},ve.prototype.placeFreeHoles=function(t,e){for(var r=this,i=e.iterator();i.hasNext();){var n=i.next();if(n.getShell()===null){var o=r.findEdgeRingContaining(n,t);if(o===null)throw new Ui("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(o)}}},ve.prototype.buildMinimalEdgeRings=function(t,e,r){for(var i=this,n=new k,o=t.iterator();o.hasNext();){var f=o.next();if(f.getMaxNodeDegree()>2){f.linkDirectedEdgesForMinimalEdgeRings();var u=f.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):r.addAll(u)}else n.add(f)}return n},ve.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1},ve.prototype.buildMaximalEdgeRings=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next();if(n.isInResult()&&n.getLabel().isArea()&&n.getEdgeRing()===null){var o=new Uf(n,e._geometryFactory);r.add(o),o.setInResult()}}return r},ve.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}},ve.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ve.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),n=r.getCoordinateN(0),o=null,f=null,u=e.iterator();u.hasNext();){var l=u.next(),a=l.getLinearRing(),c=a.getEnvelopeInternal();o!==null&&(f=o.getLinearRing().getEnvelopeInternal());var p=!1;c.contains(i)&&V.isPointInRing(n,a.getCoordinates())&&(p=!0),p&&(o===null||f.contains(c))&&(o=l)}return o},ve.prototype.findShell=function(t){for(var e=0,r=null,i=t.iterator();i.hasNext();){var n=i.next();n.isHole()||(r=n,e++)}return Q.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},ve.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],r=arguments[1];It.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(e),n=new k,o=this.buildMinimalEdgeRings(i,this._shellList,n);this.sortShellsAndHoles(o,this._shellList,n),this.placeFreeHoles(this._shellList,n)}},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve};var ps=function(){};ps.prototype.getBounds=function(){},ps.prototype.interfaces_=function(){return[]},ps.prototype.getClass=function(){return ps};var Ze=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ze.prototype.getItem=function(){return this._item},Ze.prototype.getBounds=function(){return this._bounds},Ze.prototype.interfaces_=function(){return[ps,Re]},Ze.prototype.getClass=function(){return Ze};var qi=function(){this._size=null,this._items=null,this._size=0,this._items=new k,this._items.add(null)};qi.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},qi.prototype.size=function(){return this._size},qi.prototype.reorder=function(t){for(var e=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==e._size&&e._items.get(r+1).compareTo(e._items.get(r))<0&&r++,e._items.get(r).compareTo(i)<0);t=r)e._items.set(t,e._items.get(r));this._items.set(t,i)},qi.prototype.clear=function(){this._size=0,this._items.clear()},qi.prototype.isEmpty=function(){return this._size===0},qi.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)e._items.set(r,e._items.get(Math.trunc(r/2)));this._items.set(r,t)},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi};var er=function(){};er.prototype.visitItem=function(t){},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var xr=function(){};xr.prototype.insert=function(t,e){},xr.prototype.remove=function(t,e){},xr.prototype.query=function(){},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr};var Ft=function(){if(this._childBoundables=new k,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},ia={serialVersionUID:{configurable:!0}};Ft.prototype.getLevel=function(){return this._level},Ft.prototype.size=function(){return this._childBoundables.size()},Ft.prototype.getChildBoundables=function(){return this._childBoundables},Ft.prototype.addChildBoundable=function(t){Q.isTrue(this._bounds===null),this._childBoundables.add(t)},Ft.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ft.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ft.prototype.interfaces_=function(){return[ps,Re]},Ft.prototype.getClass=function(){return Ft},ia.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ft,ia);var Ke=function(){};Ke.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},Ke.min=function(t){return Ke.sort(t),t.get(0)},Ke.sort=function(t,e){var r=t.toArray();e?mr.sort(r,e):mr.sort(r);for(var i=t.iterator(),n=0,o=r.length;n<o;n++)i.next(),i.set(r[n])},Ke.singletonList=function(t){var e=new k;return e.add(t),e};var Mt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=r,this._distance=this.distance()};Mt.prototype.expandToQueue=function(t,e){var r=Mt.isComposite(this._boundable1),i=Mt.isComposite(this._boundable2);if(r&&i)return Mt.area(this._boundable1)>Mt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new Ct("neither boundable is composite")},Mt.prototype.isLeaves=function(){return!(Mt.isComposite(this._boundable1)||Mt.isComposite(this._boundable2))},Mt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Mt.prototype.expand=function(t,e,r,i){for(var n=this,o=t.getChildBoundables(),f=o.iterator();f.hasNext();){var u=f.next(),l=new Mt(u,e,n._itemDistance);l.getDistance()<i&&r.add(l)}},Mt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Mt.prototype.getDistance=function(){return this._distance},Mt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Mt.prototype.interfaces_=function(){return[Me]},Mt.prototype.getClass=function(){return Mt},Mt.area=function(t){return t.getBounds().getArea()},Mt.isComposite=function(t){return t instanceof Ft};var Vt=function s(){if(this._root=null,this._built=!1,this._itemBoundables=new k,this._nodeCapacity=null,arguments.length===0){var t=s.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Q.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Wn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Vt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Vt.prototype.lastNode=function(t){return t.get(t.size()-1)},Vt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var n=i.next();n instanceof Ft?r+=t.size(n):n instanceof Ze&&(r+=1)}return r}},Vt.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var n=i.next();n instanceof Ze&&n.getItem()===e&&(r=n)}return r!==null?(t.getChildBoundables().remove(r),!0):!1},Vt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new k:e}else if(arguments.length===1){for(var r=arguments[0],i=new k,n=r.getChildBoundables().iterator();n.hasNext();){var o=n.next();if(o instanceof Ft){var f=t.itemsTree(o);f!==null&&i.add(f)}else o instanceof Ze?i.add(o.getItem()):Q.shouldNeverReachHere()}return i.size()<=0?null:i}},Vt.prototype.insert=function(t,e){Q.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ze(t,e))},Vt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],r=new k;return this.boundablesAtLevel(e,this._root,r),r}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];if(Q.isTrue(i>-2),n.getLevel()===i)return o.add(n),null;for(var f=n.getChildBoundables().iterator();f.hasNext();){var u=f.next();u instanceof Ft?t.boundablesAtLevel(i,u,o):(Q.isTrue(u instanceof Ze),i===-1&&o.add(u))}return null}},Vt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var r=new k;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}else if(arguments.length===2){var i=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,n)}else if(arguments.length===3){if(q(arguments[2],er)&&arguments[0]instanceof Object&&arguments[1]instanceof Ft)for(var o=arguments[0],f=arguments[1],u=arguments[2],l=f.getChildBoundables(),a=0;a<l.size();a++){var c=l.get(a);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Ft?t.query(o,c,u):c instanceof Ze?u.visitItem(c.getItem()):Q.shouldNeverReachHere())}else if(q(arguments[2],Ue)&&arguments[0]instanceof Object&&arguments[1]instanceof Ft)for(var p=arguments[0],d=arguments[1],h=arguments[2],m=d.getChildBoundables(),_=0;_<m.size();_++){var W=m.get(_);t.getIntersectsOp().intersects(W.getBounds(),p)&&(W instanceof Ft?t.query(p,W,h):W instanceof Ze?h.add(W.getItem()):Q.shouldNeverReachHere())}}},Vt.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Vt.prototype.getRoot=function(){return this.build(),this._root},Vt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=this.removeItem(n,o);if(f)return!0;for(var u=null,l=n.getChildBoundables().iterator();l.hasNext();){var a=l.next();if(t.getIntersectsOp().intersects(a.getBounds(),i)&&a instanceof Ft&&(f=t.remove(i,a,o),f)){u=a;break}}return u!==null&&u.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(u),f}},Vt.prototype.createHigherLevels=function(t,e){Q.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,e+1);return r.size()===1?r.get(0):this.createHigherLevels(r,e+1)},Vt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var n=i.next();if(n instanceof Ft){var o=t.depth(n);o>r&&(r=o)}}return r+1}},Vt.prototype.createParentBoundables=function(t,e){var r=this;Q.isTrue(!t.isEmpty());var i=new k;i.add(this.createNode(e));var n=new k(t);Ke.sort(n,this.getComparator());for(var o=n.iterator();o.hasNext();){var f=o.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(e)),r.lastNode(i).addChildBoundable(f)}return i},Vt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Vt.prototype.interfaces_=function(){return[Re]},Vt.prototype.getClass=function(){return Vt},Vt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Wn.IntersectsOp.get=function(){return qf},Wn.serialVersionUID.get=function(){return-3886435814360241e3},Wn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Vt,Wn);var qf=function(){},gs=function(){};gs.prototype.distance=function(t,e){},gs.prototype.interfaces_=function(){return[]},gs.prototype.getClass=function(){return gs};var ra=function(s){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,s.call(this,r)}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,n){var o=this;Q.isTrue(i.length>0);for(var f=new k,u=0;u<i.length;u++)f.addAll(o.createParentBoundablesFromVerticalSlice(i[u],n));return f},t.prototype.createNode=function(i){return new sa(i)},t.prototype.size=function(){return arguments.length===0?s.prototype.size.call(this):s.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];if(i.isNull())return null;s.prototype.insert.call(this,i,n)}else return s.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,n){for(var o=Math.trunc(Math.ceil(i.size()/n)),f=new Array(n).fill(null),u=i.iterator(),l=0;l<n;l++){f[l]=new k;for(var a=0;u.hasNext()&&a<o;){var c=u.next();f[l].add(c),a++}}return f},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return s.prototype.query.call(this,i)}else if(arguments.length===2){var n=arguments[0],o=arguments[1];s.prototype.query.call(this,n,o)}else if(arguments.length===3){if(q(arguments[2],er)&&arguments[0]instanceof Object&&arguments[1]instanceof Ft){var f=arguments[0],u=arguments[1],l=arguments[2];s.prototype.query.call(this,f,u,l)}else if(q(arguments[2],Ue)&&arguments[0]instanceof Object&&arguments[1]instanceof Ft){var a=arguments[0],c=arguments[1],p=arguments[2];s.prototype.query.call(this,a,c,p)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,n){return s.prototype.createParentBoundables.call(this,i,n)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return s.prototype.remove.call(this,i,n)}else return s.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?s.prototype.depth.call(this):s.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,n){Q.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),f=new k(i);Ke.sort(f,t.xComparator);var u=this.verticalSlices(f,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,n)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(q(arguments[0],gs)){var i=arguments[0],n=new Mt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(n)}else if(arguments[0]instanceof Mt){var o=arguments[0];return this.nearestNeighbour(o,K.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&q(arguments[1],gs)){var f=arguments[0],u=arguments[1],l=new Mt(this.getRoot(),f.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Mt&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=c,d=null,h=new qi;for(h.add(a);!h.isEmpty()&&p>0;){var m=h.poll(),_=m.getDistance();if(_>=p)break;m.isLeaves()?(p=_,d=m):m.expandToQueue(h,p)}return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]}}else if(arguments.length===3){var W=arguments[0],C=arguments[1],I=arguments[2],L=new Ze(W,C),w=new Mt(this.getRoot(),L,I);return this.nearestNeighbour(w)[0]}},t.prototype.interfaces_=function(){return[xr,Re]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,n){return(i+n)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return sa},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[ts]},compare:function(r,i){return s.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[ts]},compare:function(r,i){return s.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[s.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Vt),sa=function(s){function t(){var e=arguments[0];s.call(this,e)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var n=i.next();r===null?r=new X(n.getBounds()):r.expandToInclude(n.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ft),ce=function(){};ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ce.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ce.compare=function(t,e,r){if(e.equals2D(r))return 0;var i=ce.relativeSign(e.x,r.x),n=ce.relativeSign(e.y,r.y);switch(t){case 0:return ce.compareValue(i,n);case 1:return ce.compareValue(n,i);case 2:return ce.compareValue(n,-i);case 3:return ce.compareValue(-i,n);case 4:return ce.compareValue(-i,-n);case 5:return ce.compareValue(-n,-i);case 6:return ce.compareValue(-n,i);case 7:return ce.compareValue(i,-n)}return Q.shouldNeverReachHere("invalid octant value"),0},ce.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ir=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new A(e),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(r))};ir.prototype.getCoordinate=function(){return this.coord},ir.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ir.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ce.compare(this._segmentOctant,this.coord,e.coord)},ir.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},ir.prototype.isInterior=function(){return this._isInterior},ir.prototype.interfaces_=function(){return[Me]},ir.prototype.getClass=function(){return ir};var re=function(){this._nodeMap=new Jt,this._edge=null;var t=arguments[0];this._edge=t};re.prototype.getSplitCoordinates=function(){var t=this,e=new Ds;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next();t.addEdgeCoordinates(i,n,e),i=n}return e.toCoordinateArray()},re.prototype.addCollapsedNodes=function(){var t=this,e=new k;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}},re.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},re.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,r=0;r<this._edge.size()-2;r++){var i=e._edge.getCoordinate(r),n=e._edge.getCoordinate(r+2);i.equals2D(n)&&t.add(new ii(r+1))}},re.prototype.addEdgeCoordinates=function(t,e,r){var i=this,n=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(n);r.add(new A(t.coord),!1);for(var f=t.segmentIndex+1;f<=e.segmentIndex;f++)r.add(i._edge.getCoordinate(f));o&&r.add(new A(e.coord))},re.prototype.iterator=function(){return this._nodeMap.values().iterator()},re.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next(),o=e.createSplitEdge(i,n);t.add(o),i=n}},re.prototype.findCollapseIndex=function(t,e,r){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1},re.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,r=new Array(1).fill(null),i=this.iterator(),n=i.next();i.hasNext();){var o=i.next(),f=e.findCollapseIndex(n,o,r);f&&t.add(new ii(r[0])),n=o}},re.prototype.getEdge=function(){return this._edge},re.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},re.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,n=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(n);o||i--;var f=new Array(i).fill(null),u=0;f[u++]=new A(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)f[u++]=r._edge.getCoordinate(l);return o&&(f[u]=new A(e.coord)),new St(f,this._edge.getData())},re.prototype.add=function(t,e){var r=new ir(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(r);return i!==null?(Q.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)},re.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new ki("bad split edge start point at "+i);var n=t.get(t.size()-1),o=n.getCoordinates(),f=o[o.length-1];if(!f.equals2D(e[e.length-1]))throw new ki("bad split edge end point at "+f)},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var kr=function(){};kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new Ct("Cannot compute the octant for point ( "+t+", "+e+" )");var r=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?r>=i?0:1:r>=i?7:6:e>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof A&&arguments[1]instanceof A){var n=arguments[0],o=arguments[1],f=o.x-n.x,u=o.y-n.y;if(f===0&&u===0)throw new Ct("Cannot compute the octant for two identical points "+n);return kr.octant(f,u)}};var Ei=function(){};Ei.prototype.getCoordinates=function(){},Ei.prototype.size=function(){},Ei.prototype.getCoordinate=function(t){},Ei.prototype.isClosed=function(){},Ei.prototype.setData=function(t){},Ei.prototype.getData=function(){},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var Gs=function(){};Gs.prototype.addIntersection=function(t,e){},Gs.prototype.interfaces_=function(){return[Ei]},Gs.prototype.getClass=function(){return Gs};var St=function(){this._nodeList=new re(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};St.prototype.getCoordinates=function(){return this._pts},St.prototype.size=function(){return this._pts.length},St.prototype.getCoordinate=function(t){return this._pts[t]},St.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},St.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},St.prototype.setData=function(t){this._data=t},St.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:kr.octant(t,e)},St.prototype.getData=function(){return this._data},St.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],n=arguments[3],o=new A(r.getIntersection(n));this.addIntersection(o,i)}},St.prototype.toString=function(){return ze.toLineString(new Pt(this._pts))},St.prototype.getNodeList=function(){return this._nodeList},St.prototype.addIntersectionNode=function(t,e){var r=e,i=r+1;if(i<this._pts.length){var n=this._pts[i];t.equals2D(n)&&(r=i)}var o=this._nodeList.add(t,r);return o},St.prototype.addIntersections=function(t,e,r){for(var i=this,n=0;n<t.getIntersectionNum();n++)i.addIntersection(t,e,r,n)},St.prototype.interfaces_=function(){return[Gs]},St.prototype.getClass=function(){return St},St.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new k;return St.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],n=r.iterator();n.hasNext();){var o=n.next();o.getNodeList().addSplitEdges(i)}};var Y=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new A,this.p1=new A;else if(arguments.length===1){var t=arguments[0];this.p0=new A(t.p0),this.p1=new A(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],r=arguments[1],i=arguments[2],n=arguments[3];this.p0=new A(e,r),this.p1=new A(i,n)}},na={serialVersionUID:{configurable:!0}};Y.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Y.prototype.orientationIndex=function(){if(arguments[0]instanceof Y){var t=arguments[0],e=V.orientationIndex(this.p0,this.p1,t.p0),r=V.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}else if(arguments[0]instanceof A){var i=arguments[0];return V.orientationIndex(this.p0,this.p1,i)}},Y.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},Y.prototype.isVertical=function(){return this.p0.x===this.p1.x},Y.prototype.equals=function(t){if(!(t instanceof Y))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},Y.prototype.intersection=function(t){var e=new gr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},Y.prototype.project=function(){if(arguments[0]instanceof A){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new A(t);var e=this.projectionFactor(t),r=new A;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof Y){var i=arguments[0],n=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(n>=1&&o>=1||n<=0&&o<=0)return null;var f=this.project(i.p0);n<0&&(f=this.p0),n>1&&(f=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new Y(f,u)}},Y.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Y.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Y.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},Y.prototype.distancePerpendicular=function(t){return V.distancePointLinePerpendicular(t,this.p0,this.p1)},Y.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Y.prototype.midPoint=function(){return Y.midPoint(this.p0,this.p1)},Y.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=e*e+r*r;if(i<=0)return K.NaN;var n=((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/i;return n},Y.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var r=new Array(2).fill(null),i=K.MAX_VALUE,n=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),r[0]=o,r[1]=t.p0;var f=this.closestPoint(t.p1);n=f.distance(t.p1),n<i&&(i=n,r[0]=f,r[1]=t.p1);var u=t.closestPoint(this.p0);n=u.distance(this.p0),n<i&&(i=n,r[0]=this.p0,r[1]=u);var l=t.closestPoint(this.p1);return n=l.distance(this.p1),n<i&&(i=n,r[0]=this.p1,r[1]=l),r},Y.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1},Y.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Y.prototype.getLength=function(){return this.p0.distance(this.p1)},Y.prototype.compareTo=function(t){var e=t,r=this.p0.compareTo(e.p0);return r!==0?r:this.p1.compareTo(e.p1)},Y.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},Y.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},Y.prototype.lineIntersection=function(t){try{var e=Ye.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof is))throw r}finally{}return null},Y.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Y.prototype.pointAlongOffset=function(t,e){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),n=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,f=Math.sqrt(n*n+o*o),u=0,l=0;if(e!==0){if(f<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*n/f,l=e*o/f}var a=r-l,c=i+u,p=new A(a,c);return p},Y.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=r.x,this.p1.y=r.y}},Y.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||K.isNaN(e))&&(e=1),e},Y.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Y.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Y.prototype.distance=function(){if(arguments[0]instanceof Y){var t=arguments[0];return V.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof A){var e=arguments[0];return V.distancePointLine(e,this.p0,this.p1)}},Y.prototype.pointAlong=function(t){var e=new A;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},Y.prototype.hashCode=function(){var t=K.doubleToLongBits(this.p0.x);t^=K.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=K.doubleToLongBits(this.p1.x);r^=K.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i},Y.prototype.interfaces_=function(){return[Me,Re]},Y.prototype.getClass=function(){return Y},Y.midPoint=function(t,e){return new A((t.x+e.x)/2,(t.y+e.y)/2)},na.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Y,na);var Xs=function(){this.tempEnv1=new X,this.tempEnv2=new X,this._overlapSeg1=new Y,this._overlapSeg2=new Y};Xs.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Xs.prototype.interfaces_=function(){return[]},Xs.prototype.getClass=function(){return Xs};var _e=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=i};_e.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_e.prototype.computeSelect=function(t,e,r,i){var n=this._pts[e],o=this._pts[r];if(i.tempEnv1.init(n,o),r-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var f=Math.trunc((e+r)/2);e<f&&this.computeSelect(t,e,f,i),f<r&&this.computeSelect(t,f,r,i)},_e.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=t._pts[i];return e},_e.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_e.prototype.setId=function(t){this._id=t},_e.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_e.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new X(t,e)}return this._env},_e.prototype.getEndIndex=function(){return this._end},_e.prototype.getStartIndex=function(){return this._start},_e.prototype.getContext=function(){return this._context},_e.prototype.getId=function(){return this._id},_e.prototype.computeOverlapsInternal=function(t,e,r,i,n,o){var f=this._pts[t],u=this._pts[e],l=r._pts[i],a=r._pts[n];if(e-t===1&&n-i===1)return o.overlap(this,t,r,i),null;if(o.tempEnv1.init(f,u),o.tempEnv2.init(l,a),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),p=Math.trunc((i+n)/2);t<c&&(i<p&&this.computeOverlapsInternal(t,c,r,i,p,o),p<n&&this.computeOverlapsInternal(t,c,r,p,n,o)),c<e&&(i<p&&this.computeOverlapsInternal(c,e,r,i,p,o),p<n&&this.computeOverlapsInternal(c,e,r,p,n,o))},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e};var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.getChainStartIndices=function(t){var e=0,r=new k;r.add(new ii(e));do{var i=ci.findChainEnd(t,e);r.add(new ii(i)),e=i}while(e<t.length-1);var n=ci.toIntArray(r);return n},ci.findChainEnd=function(t,e){for(var r=e;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=pt.quadrant(t[r],t[r+1]),n=e+1;n<t.length;){if(!t[n-1].equals2D(t[n])){var o=pt.quadrant(t[n-1],t[n]);if(o!==i)break}n++}return n-1},ci.getChains=function(){if(arguments.length===1){var t=arguments[0];return ci.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new k,n=ci.getChainStartIndices(e),o=0;o<n.length-1;o++){var f=new _e(e,n[o],n[o+1],r);i.add(f)}return i}},ci.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var vr=function(){};vr.prototype.computeNodes=function(t){},vr.prototype.getNodedSubstrings=function(){},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var Ys=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Ys.prototype.setSegmentIntersector=function(t){this._segInt=t},Ys.prototype.interfaces_=function(){return[vr]},Ys.prototype.getClass=function(){return Ys};var ao=function(s){function t(r){r?s.call(this,r):s.call(this),this._monoChains=new k,this._index=new ra,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return St.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var n=this,o=ci.getChains(i.getCoordinates(),i),f=o.iterator();f.hasNext();){var u=f.next();u.setId(n._idCounter++),n._index.insert(u.getEnvelope(),u),n._monoChains.add(u)}},t.prototype.computeNodes=function(i){var n=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)n.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,n=new oa(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var f=o.next(),u=i._index.query(f.getEnvelope()),l=u.iterator();l.hasNext();){var a=l.next();if(a.getId()>f.getId()&&(f.computeOverlaps(a,n),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return oa},Object.defineProperties(t,e),t}(Ys),oa=function(s){function t(){s.call(this),this._si=null;var e=arguments[0];this._si=e}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],n=arguments[2],o=arguments[3],f=r.getContext(),u=n.getContext();this._si.processIntersections(f,i,u,o)}else return s.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Xs),at=function s(){if(this._quadrantSegments=s.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=s.CAP_ROUND,this._joinStyle=s.JOIN_ROUND,this._mitreLimit=s.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=s.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],n=arguments[1],o=arguments[2],f=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(n),this.setJoinStyle(o),this.setMitreLimit(f)}}},Hi={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};at.prototype.getEndCapStyle=function(){return this._endCapStyle},at.prototype.isSingleSided=function(){return this._isSingleSided},at.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=at.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=at.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==at.JOIN_ROUND&&(this._quadrantSegments=at.DEFAULT_QUADRANT_SEGMENTS)},at.prototype.getJoinStyle=function(){return this._joinStyle},at.prototype.setJoinStyle=function(t){this._joinStyle=t},at.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},at.prototype.getSimplifyFactor=function(){return this._simplifyFactor},at.prototype.getQuadrantSegments=function(){return this._quadrantSegments},at.prototype.setEndCapStyle=function(t){this._endCapStyle=t},at.prototype.getMitreLimit=function(){return this._mitreLimit},at.prototype.setMitreLimit=function(t){this._mitreLimit=t},at.prototype.setSingleSided=function(t){this._isSingleSided=t},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Hi.CAP_ROUND.get=function(){return 1},Hi.CAP_FLAT.get=function(){return 2},Hi.CAP_SQUARE.get=function(){return 3},Hi.JOIN_ROUND.get=function(){return 1},Hi.JOIN_MITRE.get=function(){return 2},Hi.JOIN_BEVEL.get=function(){return 3},Hi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Hi.DEFAULT_MITRE_LIMIT.get=function(){return 5},Hi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(at,Hi);var Lt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=V.COUNTERCLOCKWISE,this._inputLine=t||null},zs={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Lt.prototype.isDeletable=function(t,e,r,i){var n=this._inputLine[t],o=this._inputLine[e],f=this._inputLine[r];return!this.isConcave(n,o,f)||!this.isShallow(n,o,f,i)?!1:this.isShallowSampled(n,o,t,r,i)},Lt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),n=!1;i<this._inputLine.length;){var o=!1;t.isDeletable(e,r,i,t._distanceTol)&&(t._isDeleted[r]=Lt.DELETE,o=!0,n=!0),o?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return n},Lt.prototype.isShallowConcavity=function(t,e,r,i){var n=V.computeOrientation(t,e,r),o=n===this._angleOrientation;if(!o)return!1;var f=V.distancePointLine(e,t,r);return f<i},Lt.prototype.isShallowSampled=function(t,e,r,i,n){var o=this,f=Math.trunc((i-r)/Lt.NUM_PTS_TO_CHECK);f<=0&&(f=1);for(var u=r;u<i;u+=f)if(!o.isShallow(t,e,o._inputLine[u],n))return!1;return!0},Lt.prototype.isConcave=function(t,e,r){var i=V.computeOrientation(t,e,r),n=i===this._angleOrientation;return n},Lt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=V.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=e.deleteShallowConcavities();while(r);return this.collapseLine()},Lt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Lt.DELETE;)e++;return e},Lt.prototype.isShallow=function(t,e,r,i){var n=V.distancePointLine(e,t,r);return n<i},Lt.prototype.collapseLine=function(){for(var t=this,e=new Ds,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==Lt.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.simplify=function(t,e){var r=new Lt(t);return r.simplify(e)},zs.INIT.get=function(){return 0},zs.DELETE.get=function(){return 1},zs.KEEP.get=function(){return 1},zs.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Lt,zs);var we=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new k},aa={COORDINATE_ARRAY_TYPE:{configurable:!0}};we.prototype.getCoordinates=function(){var t=this._ptList.toArray(we.COORDINATE_ARRAY_TYPE);return t},we.prototype.setPrecisionModel=function(t){this._precisionModel=t},we.prototype.addPt=function(t){var e=new A(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},we.prototype.revere=function(){},we.prototype.addPts=function(t,e){var r=this;if(e)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var n=t.length-1;n>=0;n--)r.addPt(t[n])},we.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),r=t.distance(e);return r<this._minimimVertexDistance},we.prototype.toString=function(){var t=new et,e=t.createLineString(this.getCoordinates());return e.toString()},we.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new A(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},we.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},aa.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(we,aa);var rt=function(){},Vr={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.toDegrees=function(t){return t*180/Math.PI},rt.normalize=function(t){for(;t>Math.PI;)t-=rt.PI_TIMES_2;for(;t<=-Math.PI;)t+=rt.PI_TIMES_2;return t},rt.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=r.x-e.x,n=r.y-e.y;return Math.atan2(n,i)}},rt.isAcute=function(t,e,r){var i=t.x-e.x,n=t.y-e.y,o=r.x-e.x,f=r.y-e.y,u=i*o+n*f;return u>0},rt.isObtuse=function(t,e,r){var i=t.x-e.x,n=t.y-e.y,o=r.x-e.x,f=r.y-e.y,u=i*o+n*f;return u<0},rt.interiorAngle=function(t,e,r){var i=rt.angle(e,t),n=rt.angle(e,r);return Math.abs(n-i)},rt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=rt.PI_TIMES_2;t>=rt.PI_TIMES_2&&(t=0)}else{for(;t>=rt.PI_TIMES_2;)t-=rt.PI_TIMES_2;t<0&&(t=0)}return t},rt.angleBetween=function(t,e,r){var i=rt.angle(e,t),n=rt.angle(e,r);return rt.diff(i,n)},rt.diff=function(t,e){var r=null;return t<e?r=e-t:r=t-e,r>Math.PI&&(r=2*Math.PI-r),r},rt.toRadians=function(t){return t*Math.PI/180},rt.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?rt.COUNTERCLOCKWISE:r<0?rt.CLOCKWISE:rt.NONE},rt.angleBetweenOriented=function(t,e,r){var i=rt.angle(e,t),n=rt.angle(e,r),o=n-i;return o<=-Math.PI?o+rt.PI_TIMES_2:o>Math.PI?o-rt.PI_TIMES_2:o},Vr.PI_TIMES_2.get=function(){return 2*Math.PI},Vr.PI_OVER_2.get=function(){return Math.PI/2},Vr.PI_OVER_4.get=function(){return Math.PI/4},Vr.COUNTERCLOCKWISE.get=function(){return V.COUNTERCLOCKWISE},Vr.CLOCKWISE.get=function(){return V.CLOCKWISE},Vr.NONE.get=function(){return V.COLLINEAR},Object.defineProperties(rt,Vr);var vt=function s(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Y,this._seg1=new Y,this._offset0=new Y,this._offset1=new Y,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new gr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===at.JOIN_ROUND&&(this._closingSegLengthFactor=s.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Us={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};vt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=V.computeOrientation(this._s0,this._s1,this._s2),i=r===V.CLOCKWISE&&this._side===x.LEFT||r===V.COUNTERCLOCKWISE&&this._side===x.RIGHT;r===0?this.addCollinear(e):i?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},vt.prototype.addLineEndCap=function(t,e){var r=new Y(t,e),i=new Y;this.computeOffsetSegment(r,x.LEFT,this._distance,i);var n=new Y;this.computeOffsetSegment(r,x.RIGHT,this._distance,n);var o=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,o);switch(this._bufParams.getEndCapStyle()){case at.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,V.CLOCKWISE,this._distance),this._segList.addPt(n.p1);break;case at.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(n.p1);break;case at.CAP_SQUARE:var l=new A;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var a=new A(i.p1.x+l.x,i.p1.y+l.y),c=new A(n.p1.x+l.x,n.p1.y+l.y);this._segList.addPt(a),this._segList.addPt(c);break}},vt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},vt.prototype.addMitreJoin=function(t,e,r,i){var n=!0,o=null;try{o=Ye.intersection(e.p0,e.p1,r.p0,r.p1);var f=i<=0?1:o.distance(t)/Math.abs(i);f>this._bufParams.getMitreLimit()&&(n=!1)}catch(u){if(u instanceof is)o=new A(0,0),n=!1;else throw u}finally{}n?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())},vt.prototype.addFilletCorner=function(t,e,r,i,n){var o=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,o),l=r.x-t.x,a=r.y-t.y,c=Math.atan2(a,l);i===V.CLOCKWISE?u<=c&&(u+=2*Math.PI):u>=c&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,c,i,n),this._segList.addPt(r)},vt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*vt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===at.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===at.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},vt.prototype.createSquare=function(t){this._segList.addPt(new A(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new A(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new A(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new A(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},vt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},vt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},vt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},vt.prototype.initSideSegments=function(t,e,r){this._s1=t,this._s2=e,this._side=r,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)},vt.prototype.addLimitedMitreJoin=function(t,e,r,i){var n=this._seg0.p1,o=rt.angle(n,this._seg0.p0),f=rt.angleBetweenOriented(this._seg0.p0,n,this._seg1.p1),u=f/2,l=rt.normalize(o+u),a=rt.normalize(l+Math.PI),c=i*r,p=c*Math.abs(Math.sin(u)),d=r-p,h=n.x+c*Math.cos(a),m=n.y+c*Math.sin(a),_=new A(h,m),W=new Y(n,_),C=W.pointAlongOffset(1,d),I=W.pointAlongOffset(1,-d);this._side===x.LEFT?(this._segList.addPt(C),this._segList.addPt(I)):(this._segList.addPt(I),this._segList.addPt(C))},vt.prototype.computeOffsetSegment=function(t,e,r,i){var n=e===x.LEFT?1:-1,o=t.p1.x-t.p0.x,f=t.p1.y-t.p0.y,u=Math.sqrt(o*o+f*f),l=n*r*o/u,a=n*r*f/u;i.p0.x=t.p0.x-a,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-a,i.p1.y=t.p1.y+l},vt.prototype.addFilletArc=function(t,e,r,i,n){var o=this,f=i===V.CLOCKWISE?-1:1,u=Math.abs(e-r),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var a=0,c=u/l,p=a,d=new A;p<u;){var h=e+f*p;d.x=t.x+n*Math.cos(h),d.y=t.y+n*Math.sin(h),o._segList.addPt(d),p+=c}},vt.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*vt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new A((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var i=new A((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},vt.prototype.createCircle=function(t){var e=new A(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},vt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},vt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new we,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*vt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},vt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===at.JOIN_BEVEL||this._bufParams.getJoinStyle()===at.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,V.CLOCKWISE,this._distance))},vt.prototype.closeRing=function(){this._segList.closeRing()},vt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},Us.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Us.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Us.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Us.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(vt,Us);var pe=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};pe.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var r=e<0,i=Math.abs(e),n=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],n):this.computeOffsetCurve(t,r,n);var o=n.getCoordinates();return r&&tt.reverse(o),o},pe.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var n=Lt.simplify(t,-i),o=n.length-1;r.initSideSegments(n[o],n[o-1],x.LEFT),r.addFirstSegment();for(var f=o-2;f>=0;f--)r.addNextSegment(n[f],!0)}else{r.addSegments(t,!1);var u=Lt.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],x.LEFT),r.addFirstSegment();for(var a=2;a<=l;a++)r.addNextSegment(u[a],!0)}r.addLastSegment(),r.closeRing()},pe.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===x.RIGHT&&(i=-i);var n=Lt.simplify(t,i),o=n.length-1;r.initSideSegments(n[o-1],n[0],e);for(var f=1;f<=o;f++){var u=f!==1;r.addNextSegment(n[f],u)}r.closeRing()},pe.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=Lt.simplify(t,r),n=i.length-1;e.initSideSegments(i[0],i[1],x.LEFT);for(var o=2;o<=n;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[n-1],i[n]);var f=Lt.simplify(t,-r),u=f.length-1;e.initSideSegments(f[u],f[u-1],x.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(f[l],!0);e.addLastSegment(),e.addLineEndCap(f[1],f[0]),e.closeRing()},pe.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case at.CAP_ROUND:e.createCircle(t);break;case at.CAP_SQUARE:e.createSquare(t);break}},pe.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var r=Math.abs(e),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var n=e<0;this.computeSingleSidedBufferCurve(t,n,i)}else this.computeLineBufferCurve(t,i);var o=i.getCoordinates();return o},pe.prototype.getBufferParameters=function(){return this._bufParams},pe.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},pe.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return pe.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},pe.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var n=Lt.simplify(t,-i),o=n.length-1;r.initSideSegments(n[o],n[o-1],x.LEFT),r.addFirstSegment();for(var f=o-2;f>=0;f--)r.addNextSegment(n[f],!0)}else{var u=Lt.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],x.LEFT),r.addFirstSegment();for(var a=2;a<=l;a++)r.addNextSegment(u[a],!0)}r.addLastSegment()},pe.prototype.getSegGen=function(t){return new vt(this._precisionModel,this._bufParams,t)},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;r<e.length;r++)e[r]=new A(t[r]);return e};var Gr=function(){this._subgraphs=null,this._seg=new Y,this._cga=new V;var t=arguments[0];this._subgraphs=t},fa={DepthSegment:{configurable:!0}};Gr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=new k,i=this._subgraphs.iterator();i.hasNext();){var n=i.next(),o=n.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,n.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(q(arguments[2],Ue)&&arguments[0]instanceof A&&arguments[1]instanceof oo)for(var f=arguments[0],u=arguments[1],l=arguments[2],a=u.getEdge().getCoordinates(),c=0;c<a.length-1;c++){t._seg.p0=a[c],t._seg.p1=a[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var p=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(p<f.x)&&!t._seg.isHorizontal()&&!(f.y<t._seg.p0.y||f.y>t._seg.p1.y)&&V.computeOrientation(t._seg.p0,t._seg.p1,f)!==V.RIGHT){var d=u.getDepth(x.LEFT);t._seg.p0.equals(a[c])||(d=u.getDepth(x.RIGHT));var h=new _r(t._seg,d);l.add(h)}}else if(q(arguments[2],Ue)&&arguments[0]instanceof A&&q(arguments[1],Ue))for(var m=arguments[0],_=arguments[1],W=arguments[2],C=_.iterator();C.hasNext();){var I=C.next();I.isForward()&&t.findStabbedSegments(m,I,W)}}},Gr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=Ke.min(e);return r._leftDepth},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},fa.DepthSegment.get=function(){return _r},Object.defineProperties(Gr,fa);var _r=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Y(t),this._leftDepth=e};_r.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return r!==0||(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(e._upwardSeg)},_r.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)},_r.prototype.toString=function(){return this._upwardSeg.toString()},_r.prototype.interfaces_=function(){return[Me]},_r.prototype.getClass=function(){return _r};var ft=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};ft.prototype.area=function(){return ft.area(this.p0,this.p1,this.p2)},ft.prototype.signedArea=function(){return ft.signedArea(this.p0,this.p1,this.p2)},ft.prototype.interpolateZ=function(t){if(t===null)throw new Ct("Supplied point is null.");return ft.interpolateZ(t,this.p0,this.p1,this.p2)},ft.prototype.longestSideLength=function(){return ft.longestSideLength(this.p0,this.p1,this.p2)},ft.prototype.isAcute=function(){return ft.isAcute(this.p0,this.p1,this.p2)},ft.prototype.circumcentre=function(){return ft.circumcentre(this.p0,this.p1,this.p2)},ft.prototype.area3D=function(){return ft.area3D(this.p0,this.p1,this.p2)},ft.prototype.centroid=function(){return ft.centroid(this.p0,this.p1,this.p2)},ft.prototype.inCentre=function(){return ft.inCentre(this.p0,this.p1,this.p2)},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},ft.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},ft.det=function(t,e,r,i){return t*i-e*r},ft.interpolateZ=function(t,e,r,i){var n=e.x,o=e.y,f=r.x-n,u=i.x-n,l=r.y-o,a=i.y-o,c=f*a-u*l,p=t.x-n,d=t.y-o,h=(a*p-u*d)/c,m=(-l*p+f*d)/c,_=e.z+h*(r.z-e.z)+m*(i.z-e.z);return _},ft.longestSideLength=function(t,e,r){var i=t.distance(e),n=e.distance(r),o=r.distance(t),f=i;return n>f&&(f=n),o>f&&(f=o),f},ft.isAcute=function(t,e,r){return!(!rt.isAcute(t,e,r)||!rt.isAcute(e,r,t)||!rt.isAcute(r,t,e))},ft.circumcentre=function(t,e,r){var i=r.x,n=r.y,o=t.x-i,f=t.y-n,u=e.x-i,l=e.y-n,a=2*ft.det(o,f,u,l),c=ft.det(f,o*o+f*f,l,u*u+l*l),p=ft.det(o,o*o+f*f,u,u*u+l*l),d=i-c/a,h=n+p/a;return new A(d,h)},ft.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,n=new Ye(t.x+r/2,t.y+i/2,1),o=new Ye(t.x-i+r/2,t.y+r+i/2,1);return new Ye(n,o)},ft.angleBisector=function(t,e,r){var i=e.distance(t),n=e.distance(r),o=i/(i+n),f=r.x-t.x,u=r.y-t.y,l=new A(t.x+o*f,t.y+o*u);return l},ft.area3D=function(t,e,r){var i=e.x-t.x,n=e.y-t.y,o=e.z-t.z,f=r.x-t.x,u=r.y-t.y,l=r.z-t.z,a=n*l-o*u,c=o*f-i*l,p=i*u-n*f,d=a*a+c*c+p*p,h=Math.sqrt(d)/2;return h},ft.centroid=function(t,e,r){var i=(t.x+e.x+r.x)/3,n=(t.y+e.y+r.y)/3;return new A(i,n)},ft.inCentre=function(t,e,r){var i=e.distance(r),n=t.distance(r),o=t.distance(e),f=i+n+o,u=(i*t.x+n*e.x+o*r.x)/f,l=(i*t.y+n*e.y+o*r.y)/f;return new A(u,l)};var ke=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new k;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};ke.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,P.EXTERIOR,P.INTERIOR)},ke.prototype.addPolygon=function(t){var e=this,r=this._distance,i=x.LEFT;this._distance<0&&(r=-this._distance,i=x.RIGHT);var n=t.getExteriorRing(),o=tt.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,P.EXTERIOR,P.INTERIOR);for(var f=0;f<t.getNumInteriorRing();f++){var u=t.getInteriorRingN(f),l=tt.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,x.opposite(i),P.INTERIOR,P.EXTERIOR)}},ke.prototype.isTriangleErodedCompletely=function(t,e){var r=new ft(t[0],t[1],t[2]),i=r.inCentre(),n=V.distancePointLine(i,r.p0,r.p1);return n<Math.abs(e)},ke.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=tt.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,P.EXTERIOR,P.INTERIOR)},ke.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new St(t,new ct(0,P.BOUNDARY,e,r));this._curveList.add(i)},ke.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ke.prototype.addPolygonRing=function(t,e,r,i,n){if(e===0&&t.length<Li.MINIMUM_VALID_SIZE)return null;var o=i,f=n;t.length>=Li.MINIMUM_VALID_SIZE&&V.isCCW(t)&&(o=n,f=i,r=x.opposite(r));var u=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(u,o,f)},ke.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ot?this.addPolygon(t):t instanceof Tt?this.addLineString(t):t instanceof ye?this.addPoint(t):t instanceof ls?this.addCollection(t):t instanceof yr?this.addCollection(t):t instanceof Ai?this.addCollection(t):t instanceof ee&&this.addCollection(t)},ke.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(r.length===4)return this.isTriangleErodedCompletely(r,e);var i=t.getEnvelopeInternal(),n=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>n},ke.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var ds=function(){};ds.prototype.locate=function(t){},ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds};var Pi=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Pi.prototype.next=function(){if(this._atStart)return this._atStart=!1,Pi.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new us;var t=this._parent.getGeometryN(this._index++);return t instanceof ee?(this._subcollectionIterator=new Pi(t),this._subcollectionIterator.next()):t},Pi.prototype.remove=function(){throw new Error(this.getClass().getName())},Pi.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Pi.prototype.interfaces_=function(){return[fs]},Pi.prototype.getClass=function(){return Pi},Pi.isAtomic=function(t){return!(t instanceof ee)};var Ee=function(){this._geom=null;var t=arguments[0];this._geom=t};Ee.prototype.locate=function(t){return Ee.locate(t,this._geom)},Ee.prototype.interfaces_=function(){return[ds]},Ee.prototype.getClass=function(){return Ee},Ee.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.isPointInRing(t,e.getCoordinates()):!1},Ee.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Ee.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var n=e.getInteriorRingN(i);if(Ee.isPointInRing(t,n))return!1}return!0},Ee.containsPoint=function(t,e){if(e instanceof Ot)return Ee.containsPointInPolygon(t,e);if(e instanceof ee)for(var r=new Pi(e);r.hasNext();){var i=r.next();if(i!==e&&Ee.containsPoint(t,i))return!0}return!1},Ee.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:Ee.containsPoint(t,e)?P.INTERIOR:P.EXTERIOR};var $t=function(){this._edgeMap=new Jt,this._edgeList=null,this._ptInAreaLocation=[P.NONE,P.NONE]};$t.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),r=e-1;return e===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)},$t.prototype.propagateSideLabels=function(t){for(var e=P.NONE,r=this.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();n.isArea(t)&&n.getLocation(t,x.LEFT)!==P.NONE&&(e=n.getLocation(t,x.LEFT))}if(e===P.NONE)return null;for(var o=e,f=this.iterator();f.hasNext();){var u=f.next(),l=u.getLabel();if(l.getLocation(t,x.ON)===P.NONE&&l.setLocation(t,x.ON,o),l.isArea(t)){var a=l.getLocation(t,x.LEFT),c=l.getLocation(t,x.RIGHT);if(c!==P.NONE){if(c!==o)throw new Ui("side location conflict",u.getCoordinate());a===P.NONE&&Q.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=a}else Q.isTrue(l.getLocation(t,x.LEFT)===P.NONE,"found single null side"),l.setLocation(t,x.RIGHT,o),l.setLocation(t,x.LEFT,o)}}},$t.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},$t.prototype.print=function(t){Yt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},$t.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},$t.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var r=e.size()-1,i=e.get(r).getLabel(),n=i.getLocation(t,x.LEFT);Q.isTrue(n!==P.NONE,"Found unlabelled area edge");for(var o=n,f=this.iterator();f.hasNext();){var u=f.next(),l=u.getLabel();Q.isTrue(l.isArea(t),"Found non-area edge");var a=l.getLocation(t,x.LEFT),c=l.getLocation(t,x.RIGHT);if(a===c||c!==o)return!1;o=a}return!0},$t.prototype.findIndex=function(t){var e=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=e._edgeList.get(r);if(i===t)return r}return-1},$t.prototype.iterator=function(){return this.getEdges().iterator()},$t.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new k(this._edgeMap.values())),this._edgeList},$t.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===P.NONE&&(this._ptInAreaLocation[t]=Ee.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]},$t.prototype.toString=function(){var t=new ei;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
3
+ `);for(var e=this.iterator();e.hasNext();){var r=e.next();t.append(r),t.append(`
4
+ `)}return t.toString()},$t.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},$t.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var n=i.next(),o=n.getLabel(),f=0;f<2;f++)o.isLine(f)&&o.getLocation(f)===P.BOUNDARY&&(r[f]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),a=l.getLabel(),c=0;c<2;c++)if(a.isAnyNull(c)){var p=P.NONE;if(r[c])p=P.EXTERIOR;else{var d=l.getCoordinate();p=e.getLocation(c,d,t)}a.setAllLocationsIfNull(c,p)}},$t.prototype.getDegree=function(){return this._edgeMap.size()},$t.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Hf=function(s){function t(){s.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,n=null,o=this._SCANNING_FOR_INCOMING,f=0;f<this._resultAreaEdgeList.size();f++){var u=r._resultAreaEdgeList.get(f),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;n=l,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;n.setNext(u),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Ui("no outgoing dirEdge found",this.getCoordinate());Q.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),n.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var n=r.get(0);if(i===1)return n;var o=r.get(i-1),f=n.getQuadrant(),u=o.getQuadrant();return pt.isNorthern(f)&&pt.isNorthern(u)?n:!pt.isNorthern(f)&&!pt.isNorthern(u)?o:n.getDy()!==0?n:o.getDy()!==0?o:(Q.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Yt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var n=i.next();r.print("out "),n.print(r),r.println(),r.print("in "),n.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new k;for(var i=this.iterator();i.hasNext();){var n=i.next();(n.isInResult()||n.getSym().isInResult())&&r._resultAreaEdgeList.add(n)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var n=i.next(),o=n.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,n=null,o=this._edgeList.size()-1;o>=0;o--){var f=r._edgeList.get(o),u=f.getSym();n===null&&(n=u),i!==null&&u.setNext(i),i=f}n.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],n=this.findIndex(i),o=i.getDepth(x.LEFT),f=i.getDepth(x.RIGHT),u=this.computeDepths(n+1,this._edgeList.size(),o),l=this.computeDepths(0,n,u);if(l!==f)throw new Ui("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var a=arguments[0],c=arguments[1],p=arguments[2],d=p,h=a;h<c;h++){var m=r._edgeList.get(h);m.setEdgeDepths(x.RIGHT,d),d=m.getDepth(x.LEFT)}return d}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();n.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,n=null,o=null,f=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),a=l.getSym();switch(n===null&&l.getEdgeRing()===r&&(n=l),f){case i._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==r)continue;o=a,f=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;o.setNextMin(l),f=i._SCANNING_FOR_INCOMING;break}}f===this._LINKING_TO_OUTGOING&&(Q.isTrue(n!==null,"found null for first outgoing dirEdge"),Q.isTrue(n.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(n))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var n=i.next();n.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],f=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&f++}return f}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=P.NONE,i=this.iterator();i.hasNext();){var n=i.next(),o=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){r=P.INTERIOR;break}if(o.isInResult()){r=P.EXTERIOR;break}}}if(r===P.NONE)return null;for(var f=r,u=this.iterator();u.hasNext();){var l=u.next(),a=l.getSym();l.isLineEdge()?l.getEdge().setCovered(f===P.INTERIOR):(l.isInResult()&&(f=P.EXTERIOR),a.isInResult()&&(f=P.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;s.prototype.computeLabelling.call(this,r),this._label=new ct(P.NONE);for(var n=this.iterator();n.hasNext();)for(var o=n.next(),f=o.getEdge(),u=f.getLabel(),l=0;l<2;l++){var a=u.getLocation(l);(a===P.INTERIOR||a===P.BOUNDARY)&&i._label.setLocation(l,P.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}($t),ua=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Cn(r,new Hf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(cs),rr=function s(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=s.orientation(t)};rr.prototype.compareTo=function(t){var e=t,r=rr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},rr.prototype.interfaces_=function(){return[Me]},rr.prototype.getClass=function(){return rr},rr.orientation=function(t){return tt.increasingDirection(t)===1},rr.compareOriented=function(t,e,r,i){for(var n=e?1:-1,o=i?1:-1,f=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,a=i?0:r.length-1;;){var c=t[l].compareTo(r[a]);if(c!==0)return c;l+=n,a+=o;var p=l===f,d=a===u;if(p&&!d)return-1;if(!p&&d)return 1;if(p&&d)return 0}};var je=function(){this._edges=new k,this._ocaMap=new Jt};je.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var n=i.getCoordinates(),o=0;o<n.length;o++)o>0&&t.print(","),t.print(n[o].x+" "+n[o].y);t.println(")")}t.print(") ")},je.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},je.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},je.prototype.iterator=function(){return this._edges.iterator()},je.prototype.getEdges=function(){return this._edges},je.prototype.get=function(t){return this._edges.get(t)},je.prototype.findEqualEdge=function(t){var e=new rr(t.getCoordinates()),r=this._ocaMap.get(e);return r},je.prototype.add=function(t){this._edges.add(t);var e=new rr(t.getCoordinates());this._ocaMap.put(e,t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Cr=function(){};Cr.prototype.processIntersections=function(t,e,r,i){},Cr.prototype.isDone=function(){},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var Pe=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Pe.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Pe.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var n=t.size()-1;if(e===0&&i===n||i===0&&e===n)return!0}}return!1},Pe.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Pe.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Pe.prototype.getLineIntersector=function(){return this._li},Pe.prototype.hasProperIntersection=function(){return this._hasProper},Pe.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Pe.prototype.hasIntersection=function(){return this._hasIntersection},Pe.prototype.isDone=function(){return!1},Pe.prototype.hasInteriorIntersection=function(){return this._hasInterior},Pe.prototype.interfaces_=function(){return[Cr]},Pe.prototype.getClass=function(){return Pe},Pe.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var pi=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new A(t),this.segmentIndex=e,this.dist=r};pi.prototype.getSegmentIndex=function(){return this.segmentIndex},pi.prototype.getCoordinate=function(){return this.coord},pi.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},pi.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},pi.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},pi.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},pi.prototype.getDistance=function(){return this.dist},pi.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},pi.prototype.interfaces_=function(){return[Me]},pi.prototype.getClass=function(){return pi};var Si=function(){this._nodeMap=new Jt,this.edge=null;var t=arguments[0];this.edge=t};Si.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Si.prototype.iterator=function(){return this._nodeMap.values().iterator()},Si.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next(),o=e.createSplitEdge(i,n);t.add(o),i=n}},Si.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Si.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(n);o||i--;var f=new Array(i).fill(null),u=0;f[u++]=new A(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)f[u++]=r.edge.pts[l];return o&&(f[u]=e.coord),new In(f,new ct(this.edge._label))},Si.prototype.add=function(t,e,r){var i=new pi(t,e,r),n=this._nodeMap.get(i);return n!==null?n:(this._nodeMap.put(i,i),i)},Si.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Wr=function(){};Wr.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new k;i.add(new ii(r));do{var n=e.findChainEnd(t,r);i.add(new ii(n)),r=n}while(r<t.length-1);var o=Wr.toIntArray(i);return o},Wr.prototype.findChainEnd=function(t,e){for(var r=pt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var n=pt.quadrant(t[i-1],t[i]);if(n!==r)break;i++}return i-1},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var Zi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new X,this.env2=new X;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Wr;this.startIndex=e.getChainStartIndices(this.pts)};Zi.prototype.getCoordinates=function(){return this.pts},Zi.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},Zi.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},Zi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3],l=arguments[4],a=arguments[5],c=this.pts[n],p=this.pts[o],d=f.pts[u],h=f.pts[l];if(o-n===1&&l-u===1)return a.addIntersections(this.e,n,f.e,u),null;if(this.env1.init(c,p),this.env2.init(d,h),!this.env1.intersects(this.env2))return null;var m=Math.trunc((n+o)/2),_=Math.trunc((u+l)/2);n<m&&(u<_&&this.computeIntersectsForChain(n,m,f,u,_,a),_<l&&this.computeIntersectsForChain(n,m,f,_,l,a)),m<o&&(u<_&&this.computeIntersectsForChain(m,o,f,u,_,a),_<l&&this.computeIntersectsForChain(m,o,f,_,l,a))}},Zi.prototype.getStartIndexes=function(){return this.startIndex},Zi.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var n=0;n<t.startIndex.length-1;n++)r.computeIntersectsForChain(i,t,n,e)},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi};var zt=function s(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=s.NULL_VALUE},ha={NULL_VALUE:{configurable:!0}};zt.prototype.getDepth=function(t,e){return this._depth[t][e]},zt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},zt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==zt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===zt.NULL_VALUE}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._depth[n][o]===zt.NULL_VALUE}},zt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var n=0;t._depth[e][i]>r&&(n=1),t._depth[e][i]=n}}},zt.prototype.getDelta=function(t){return this._depth[t][x.RIGHT]-this._depth[t][x.LEFT]},zt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?P.EXTERIOR:P.INTERIOR},zt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},zt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var n=e.getLocation(r,i);(n===P.EXTERIOR||n===P.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=zt.depthAtLocation(n):t._depth[r][i]+=zt.depthAtLocation(n))}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];u===P.INTERIOR&&this._depth[o][f]++}},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.depthAtLocation=function(t){return t===P.EXTERIOR?0:t===P.INTERIOR?1:zt.NULL_VALUE},ha.NULL_VALUE.get=function(){return-1},Object.defineProperties(zt,ha);var In=function(s){function t(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new Si(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,ct.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var n=r;if(this.pts.length!==n.pts.length)return!1;for(var o=!0,f=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(n.pts[l])||(o=!1),i.pts[l].equals2D(n.pts[--u])||(f=!1),!o&&!f)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&r.print(","),r.print(i.pts[n].x+" "+i.pts[n].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var n=this.pts.length-1;n>=0;n--)r.print(i.pts[n]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Zi(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new X;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,n,o){var f=new A(r.getIntersection(o)),u=i,l=r.getEdgeDistance(n,o),a=u+1;if(a<this.pts.length){var c=this.pts[a];f.equals2D(c)&&(u=a,l=0)}this.eiList.add(f,u,l)},t.prototype.toString=function(){var r=this,i=new ei;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&i.append(","),i.append(r.pts[n].x+" "+r.pts[n].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var n=0;n<this.pts.length;n++)if(!i.pts[n].equals2D(r.pts[n]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,n){for(var o=this,f=0;f<r.getIntersectionNum();f++)o.addIntersection(r,i,n,f)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,x.ON),r.getLocation(1,x.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,x.LEFT),r.getLocation(1,x.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,x.RIGHT),r.getLocation(1,x.RIGHT),2))}else return s.prototype.updateIM.apply(this,arguments)},t}(Ae),se=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new je,this._bufParams=t||null};se.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},se.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new ct(t.getLabel()),i.flip()),r.merge(i);var n=se.depthDelta(i),o=e.getDepthDelta(),f=o+n;e.setDepthDelta(f)}else this._edgeList.add(t),t.setDepthDelta(se.depthDelta(t.getLabel()))},se.prototype.buildSubgraphs=function(t,e){for(var r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=n.getRightmostCoordinate(),f=new Gr(r),u=f.getDepth(o);n.computeDepth(u),n.findResultEdges(),r.add(n),e.add(n.getDirectedEdges(),n.getNodes())}},se.prototype.createSubgraphs=function(t){for(var e=new k,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var n=new ie;n.create(i),e.add(n)}}return Ke.sort(e,Ke.reverseOrder()),e},se.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},se.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new ao,r=new gr;return r.setPrecisionModel(t),e.setSegmentIntersector(new Pe(r)),e},se.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new pe(r,this._bufParams),n=new ke(t,e,i),o=n.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new It(new ua),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),u=new ve(this._geomFact);this.buildSubgraphs(f,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var a=this._geomFact.buildGeometry(l);return a},se.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var n=i.getNodedSubstrings(),o=n.iterator();o.hasNext();){var f=o.next(),u=f.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=f.getData(),a=new In(f.getCoordinates(),new ct(l));r.insertUniqueEdge(a)}}},se.prototype.setNoder=function(t){this._workingNoder=t},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},se.depthDelta=function(t){var e=t.getLocation(0,x.LEFT),r=t.getLocation(0,x.RIGHT);return e===P.INTERIOR&&r===P.EXTERIOR?1:e===P.EXTERIOR&&r===P.INTERIOR?-1:0},se.convertSegStrings=function(t){for(var e=new et,r=new k;t.hasNext();){var i=t.next(),n=e.createLineString(i.getCoordinates());r.add(n)}return e.buildGeometry(r)};var sr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],n=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=n,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};sr.prototype.rescale=function(){var t=this;if(q(arguments[0],Bt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],o=0;o<n.length;o++)n[o].x=n[o].x/t._scaleFactor+t._offsetX,n[o].y=n[o].y/t._scaleFactor+t._offsetY;n.length===2&&n[0].equals2D(n[1])&&Yt.out.println(n)}},sr.prototype.scale=function(){var t=this;if(q(arguments[0],Bt)){for(var e=arguments[0],r=new k,i=e.iterator();i.hasNext();){var n=i.next();r.add(new St(t.scale(n.getCoordinates()),n.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],f=new Array(o.length).fill(null),u=0;u<o.length;u++)f[u]=new A(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=tt.removeRepeatedPoints(f);return l}},sr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},sr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},sr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},sr.prototype.interfaces_=function(){return[vr]},sr.prototype.getClass=function(){return sr};var gi=function(){this._li=new gr,this._segStrings=null;var t=arguments[0];this._segStrings=t},la={fact:{configurable:!0}};gi.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var n=arguments[0],o=arguments[1],f=o.iterator();f.hasNext();)for(var u=f.next(),l=u.getCoordinates(),a=1;a<l.length-1;a++)if(l[a].equals(n))throw new ki("found endpt/interior pt intersection at index "+a+" :pt "+n)}},gi.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var n=i.next();t.checkInteriorIntersections(r,n)}else if(arguments.length===2)for(var o=arguments[0],f=arguments[1],u=o.getCoordinates(),l=f.getCoordinates(),a=0;a<u.length-1;a++)for(var c=0;c<l.length-1;c++)t.checkInteriorIntersections(o,a,f,c);else if(arguments.length===4){var p=arguments[0],d=arguments[1],h=arguments[2],m=arguments[3];if(p===h&&d===m)return null;var _=p.getCoordinates()[d],W=p.getCoordinates()[d+1],C=h.getCoordinates()[m],I=h.getCoordinates()[m+1];if(this._li.computeIntersection(_,W,C,I),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,_,W)||this.hasInteriorIntersection(this._li,C,I)))throw new ki("found non-noded intersection at "+_+"-"+W+" and "+C+"-"+I)}},gi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},gi.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],n=i.getCoordinates(),o=0;o<n.length-2;o++)t.checkCollapse(n[o],n[o+1],n[o+2])},gi.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var n=t.getIntersection(i);if(!(n.equals(e)||n.equals(r)))return!0}return!1},gi.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new ki("found non-noded collapse at "+gi.fact.createLineString([t,e,r]))},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},la.fact.get=function(){return new et},Object.defineProperties(gi,la);var ge=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new Ct("Scale factor must be non-zero");e!==1&&(this._pt=new A(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new A,this._p1Scaled=new A),this.initCorners(this._pt)},ca={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ge.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),o=Math.max(t.y,e.y),f=this._maxx<r||this._minx>i||this._maxy<n||this._miny>o;if(f)return!1;var u=this.intersectsToleranceSquare(t,e);return Q.isTrue(!(f&&u),"Found bad envelope test"),u},ge.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new A(this._maxx,this._maxy),this._corner[1]=new A(this._minx,this._maxy),this._corner[2]=new A(this._minx,this._miny),this._corner[3]=new A(this._maxx,this._miny)},ge.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ge.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ge.prototype.getCoordinate=function(){return this._originalPt},ge.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ge.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=ge.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new X(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ge.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},ge.prototype.intersectsToleranceSquare=function(t,e){var r=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||t.equals(this._pt)||e.equals(this._pt))},ge.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ca.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ge,ca);var qs=function(){this.tempEnv1=new X,this.selectedSegment=new Y};qs.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},qs.prototype.interfaces_=function(){return[]},qs.prototype.getClass=function(){return qs};var ms=function(){this._index=null;var t=arguments[0];this._index=t},pa={HotPixelSnapAction:{configurable:!0}};ms.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],n=e.getSafeEnvelope(),o=new ga(e,r,i);return this._index.query(n,{interfaces_:function(){return[er]},visitItem:function(f){var u=f;u.select(n,o)}}),o.isNodeAdded()}},ms.prototype.interfaces_=function(){return[]},ms.prototype.getClass=function(){return ms},pa.HotPixelSnapAction.get=function(){return ga},Object.defineProperties(ms,pa);var ga=function(s){function t(){s.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],n=r.getContext();if(this._parentEdge!==null&&n===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,i)}else return s.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(qs),Xr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new k};Xr.prototype.processIntersections=function(t,e,r,i){var n=this;if(t===r&&e===i)return null;var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)n._interiorIntersections.add(n._li.getIntersection(a));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},Xr.prototype.isDone=function(){return!1},Xr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Xr.prototype.interfaces_=function(){return[Cr]},Xr.prototype.getClass=function(){return Xr};var Ni=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new gr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Ni.prototype.checkCorrectness=function(t){var e=St.getNodedSubstrings(t),r=new gi(e);try{r.checkValid()}catch(i){if(i instanceof Ho)i.printStackTrace();else throw i}finally{}},Ni.prototype.getNodedSubstrings=function(){return St.getNodedSubstrings(this._nodedSegStrings)},Ni.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},Ni.prototype.findInteriorIntersections=function(t,e){var r=new Xr(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},Ni.prototype.computeVertexSnaps=function(){var t=this;if(q(arguments[0],Bt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof St)for(var n=arguments[0],o=n.getCoordinates(),f=0;f<o.length;f++){var u=new ge(o[f],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,n,f);l&&n.addIntersection(o[f],f)}},Ni.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ao,this._pointSnapper=new ms(this._noder.getIndex()),this.snapRound(t,this._li)},Ni.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=new ge(i,e._scaleFactor,e._li);e._pointSnapper.snap(n)}},Ni.prototype.interfaces_=function(){return[vr]},Ni.prototype.getClass=function(){return Ni};var Ut=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new at,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._argGeom=e,this._bufParams=r}},ys={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ut.prototype.bufferFixedPrecision=function(t){var e=new sr(new Ni(new ot(1)),t.getScale()),r=new se(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Ut.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Ut.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ui)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Ut.precisionScaleFactor(this._argGeom,this._distance,r),n=new ot(i);this.bufferFixedPrecision(n)}},Ut.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ot.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Ut.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Ut.prototype.bufferOriginalPrecision=function(){try{var t=new se(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof ki)this._saveException=e;else throw e}finally{}},Ut.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Ut.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},Ut.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ut(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof U&&typeof arguments[1]=="number"){var n=arguments[0],o=arguments[1],f=arguments[2],u=new Ut(n);u.setQuadrantSegments(f);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof at&&arguments[0]instanceof U&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=arguments[2],d=new Ut(a,p),h=d.getResultGeometry(c);return h}}else if(arguments.length===4){var m=arguments[0],_=arguments[1],W=arguments[2],C=arguments[3],I=new Ut(m);I.setQuadrantSegments(W),I.setEndCapStyle(C);var L=I.getResultGeometry(_);return L}},Ut.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),n=Le.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,f=n+2*o,u=Math.trunc(Math.log(f)/Math.log(10)+1),l=r-u,a=Math.pow(10,l);return a},ys.CAP_ROUND.get=function(){return at.CAP_ROUND},ys.CAP_BUTT.get=function(){return at.CAP_FLAT},ys.CAP_FLAT.get=function(){return at.CAP_FLAT},ys.CAP_SQUARE.get=function(){return at.CAP_SQUARE},ys.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ut,ys);var ne=function(){this._pt=[new A,new A],this._distance=K.NaN,this._isNull=!0};ne.prototype.getCoordinates=function(){return this._pt},ne.prototype.getCoordinate=function(t){return this._pt[t]},ne.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},ne.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=n,this._isNull=!1}},ne.prototype.getDistance=function(){return this._distance},ne.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne};var bi=function(){};bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.computeDistance=function(){if(arguments[2]instanceof ne&&arguments[0]instanceof Tt&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),n=new Y,o=0;o<i.length-1;o++){n.setCoordinates(i[o],i[o+1]);var f=n.closestPoint(e);r.setMinimum(f,e)}else if(arguments[2]instanceof ne&&arguments[0]instanceof Ot&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];bi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)bi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof ne&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Tt)bi.computeDistance(p,d,h);else if(p instanceof Ot)bi.computeDistance(p,d,h);else if(p instanceof ee)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);bi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof ne&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],L=arguments[2],w=C.closestPoint(I);L.setMinimum(w,I)}};var Ir=function(t){this._maxPtDist=new ne,this._inputGeom=t||null},fo={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ir.prototype.computeMaxMidpointDistance=function(t){var e=new nr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ir.prototype.computeMaxVertexDistance=function(t){var e=new Yr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ir.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Ir.prototype.getDistancePoints=function(){return this._maxPtDist},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},fo.MaxPointDistanceFilter.get=function(){return Yr},fo.MaxMidpointDistanceFilter.get=function(){return nr},Object.defineProperties(Ir,fo);var Yr=function(t){this._maxPtDist=new ne,this._minPtDist=new ne,this._geom=t||null};Yr.prototype.filter=function(t){this._minPtDist.initialize(),bi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Yr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Yr.prototype.interfaces_=function(){return[Ti]},Yr.prototype.getClass=function(){return Yr};var nr=function(t){this._maxPtDist=new ne,this._minPtDist=new ne,this._geom=t||null};nr.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),n=new A((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),bi.computeDistance(this._geom,n,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},nr.prototype.isDone=function(){return!1},nr.prototype.isGeometryChanged=function(){return!1},nr.prototype.getMaxPointDistance=function(){return this._maxPtDist},nr.prototype.interfaces_=function(){return[He]},nr.prototype.getClass=function(){return nr};var Ki=function(t){this._comps=t||null};Ki.prototype.filter=function(t){t instanceof Ot&&this._comps.add(t)},Ki.prototype.interfaces_=function(){return[oi]},Ki.prototype.getClass=function(){return Ki},Ki.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Ki.getPolygons(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ot?r.add(e):e instanceof ee&&e.apply(new Ki(r)),r}};var qt=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};qt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Li){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Tt&&this._lines.add(t)},qt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},qt.prototype.interfaces_=function(){return[Vi]},qt.prototype.getClass=function(){return qt},qt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(qt.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(qt.getLines(e,r))}},qt.getLines=function(){if(arguments.length===1){var t=arguments[0];return qt.getLines(t,!1)}else if(arguments.length===2){if(q(arguments[0],Bt)&&q(arguments[1],Bt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var n=i.next();qt.getLines(n,r)}return r}else if(arguments[0]instanceof U&&typeof arguments[1]=="boolean"){var o=arguments[0],f=arguments[1],u=new k;return o.apply(new qt(u,f)),u}else if(arguments[0]instanceof U&&q(arguments[1],Bt)){var l=arguments[0],a=arguments[1];return l instanceof Tt?a.add(l):l.apply(new qt(a)),a}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&q(arguments[0],Bt)&&q(arguments[1],Bt)){for(var c=arguments[0],p=arguments[1],d=arguments[2],h=c.iterator();h.hasNext();){var m=h.next();qt.getLines(m,p,d)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof U&&q(arguments[1],Bt)){var _=arguments[0],W=arguments[1],C=arguments[2];return _.apply(new qt(W,C)),W}}};var Je=function(){if(this._boundaryRule=Be.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new Ct("Rule must be non-null");this._boundaryRule=t}}};Je.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof A&&arguments[1]instanceof Ot){var e=arguments[0],r=arguments[1];if(r.isEmpty())return P.EXTERIOR;var i=r.getExteriorRing(),n=this.locateInPolygonRing(e,i);if(n===P.EXTERIOR)return P.EXTERIOR;if(n===P.BOUNDARY)return P.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var f=r.getInteriorRingN(o),u=t.locateInPolygonRing(e,f);if(u===P.INTERIOR)return P.EXTERIOR;if(u===P.BOUNDARY)return P.BOUNDARY}return P.INTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof Tt){var l=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(l))return P.EXTERIOR;var c=a.getCoordinates();return!a.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?P.BOUNDARY:V.isOnLine(l,c)?P.INTERIOR:P.EXTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof ye){var p=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(p)?P.INTERIOR:P.EXTERIOR}},Je.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.locatePointInRing(t,e.getCoordinates()):P.EXTERIOR},Je.prototype.intersects=function(t,e){return this.locate(t,e)!==P.EXTERIOR},Je.prototype.updateLocationInfo=function(t){t===P.INTERIOR&&(this._isIn=!0),t===P.BOUNDARY&&this._numBoundaries++},Je.prototype.computeLocation=function(t,e){var r=this;if(e instanceof ye&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Tt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ot)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof yr)for(var i=e,n=0;n<i.getNumGeometries();n++){var o=i.getGeometryN(n);r.updateLocationInfo(r.locateInternal(t,o))}else if(e instanceof Ai)for(var f=e,u=0;u<f.getNumGeometries();u++){var l=f.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof ee)for(var a=new Pi(e);a.hasNext();){var c=a.next();c!==e&&r.computeLocation(t,c)}},Je.prototype.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:e instanceof Tt?this.locateInternal(t,e):e instanceof Ot?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?P.BOUNDARY:this._numBoundaries>0||this._isIn?P.INTERIOR:P.EXTERIOR)},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var oe=function s(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];s.call(this,t,s.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._component=r,this._segIndex=i,this._pt=n}},da={INSIDE_AREA:{configurable:!0}};oe.prototype.isInsideArea=function(){return this._segIndex===oe.INSIDE_AREA},oe.prototype.getCoordinate=function(){return this._pt},oe.prototype.getGeometryComponent=function(){return this._component},oe.prototype.getSegmentIndex=function(){return this._segIndex},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},da.INSIDE_AREA.get=function(){return-1},Object.defineProperties(oe,da);var or=function(t){this._pts=t||null};or.prototype.filter=function(t){t instanceof ye&&this._pts.add(t)},or.prototype.interfaces_=function(){return[oi]},or.prototype.getClass=function(){return or},or.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof ye?Ke.singletonList(t):or.getPoints(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof ye?r.add(e):e instanceof ee&&e.apply(new or(r)),r}};var zr=function(){this._locations=null;var t=arguments[0];this._locations=t};zr.prototype.filter=function(t){(t instanceof ye||t instanceof Tt||t instanceof Ot)&&this._locations.add(new oe(t,0,t.getCoordinate()))},zr.prototype.interfaces_=function(){return[oi]},zr.prototype.getClass=function(){return zr},zr.getLocations=function(t){var e=new k;return t.apply(new zr(e)),e};var Ht=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Je,this._minDistanceLocation=null,this._minDistance=K.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=n}};Ht.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=1-r,o=Ki.getPolygons(this._geom[r]);if(o.size()>0){var f=zr.getLocations(this._geom[n]);if(this.computeContainmentDistance(f,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&q(arguments[0],Ue)&&q(arguments[1],Ue)){for(var u=arguments[0],l=arguments[1],a=arguments[2],c=0;c<u.size();c++)for(var p=u.get(c),d=0;d<l.size();d++)if(t.computeContainmentDistance(p,l.get(d),a),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof oe&&arguments[1]instanceof Ot){var h=arguments[0],m=arguments[1],_=arguments[2],W=h.getCoordinate();if(P.EXTERIOR!==this._ptLocator.locate(W,m))return this._minDistance=0,_[0]=h,_[1]=new oe(m,W),null}}},Ht.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ht.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=qt.getLines(this._geom[0]),r=qt.getLines(this._geom[1]),i=or.getPoints(this._geom[0]),n=or.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,n,t),this.updateMinDistance(t,!1)},Ht.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ht.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Ht.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Ht.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Tt&&arguments[1]instanceof ye){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var n=e.getCoordinates(),o=r.getCoordinate(),f=0;f<n.length-1;f++){var u=V.distancePointLine(o,n[f],n[f+1]);if(u<t._minDistance){t._minDistance=u;var l=new Y(n[f],n[f+1]),a=l.closestPoint(o);i[0]=new oe(e,f,a),i[1]=new oe(r,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Tt&&arguments[1]instanceof Tt){var c=arguments[0],p=arguments[1],d=arguments[2];if(c.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var h=c.getCoordinates(),m=p.getCoordinates(),_=0;_<h.length-1;_++)for(var W=0;W<m.length-1;W++){var C=V.distanceLineLine(h[_],h[_+1],m[W],m[W+1]);if(C<t._minDistance){t._minDistance=C;var I=new Y(h[_],h[_+1]),L=new Y(m[W],m[W+1]),w=I.closestPoints(L);d[0]=new oe(c,_,w[0]),d[1]=new oe(p,W,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Ht.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new oe(o,0,o.getCoordinate()),r[1]=new oe(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Ht.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Ct("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Ht.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.distance=function(t,e){var r=new Ht(t,e);return r.distance()},Ht.isWithinDistance=function(t,e,r){var i=new Ht(t,e,r);return i.distance()<=r},Ht.nearestPoints=function(t,e){var r=new Ht(t,e);return r.nearestPoints()};var te=function(){this._pt=[new A,new A],this._distance=K.NaN,this._isNull=!0};te.prototype.getCoordinates=function(){return this._pt},te.prototype.getCoordinate=function(t){return this._pt[t]},te.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},te.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=n,this._isNull=!1}},te.prototype.toString=function(){return ze.toLineString(this._pt[0],this._pt[1])},te.prototype.getDistance=function(){return this._distance},te.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te};var di=function(){};di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.computeDistance=function(){if(arguments[2]instanceof te&&arguments[0]instanceof Tt&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new Y,n=t.getCoordinates(),o=0;o<n.length-1;o++){i.setCoordinates(n[o],n[o+1]);var f=i.closestPoint(e);r.setMinimum(f,e)}else if(arguments[2]instanceof te&&arguments[0]instanceof Ot&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];di.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)di.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof te&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Tt)di.computeDistance(p,d,h);else if(p instanceof Ot)di.computeDistance(p,d,h);else if(p instanceof ee)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);di.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof te&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],L=arguments[2],w=C.closestPoint(I);L.setMinimum(w,I)}};var Ve=function(){this._g0=null,this._g1=null,this._ptDist=new te,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},uo={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ve.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ve.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new Ct("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ve.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ve.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ve.prototype.computeOrientedDistance=function(t,e,r){var i=new Ur(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var n=new ar(e,this._densifyFrac);t.apply(n),r.setMaximum(n.getMaxPointDistance())}},Ve.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ve(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new Ve(i,n);return f.setDensifyFraction(o),f.distance()}},uo.MaxPointDistanceFilter.get=function(){return Ur},uo.MaxDensifiedByFractionDistanceFilter.get=function(){return ar},Object.defineProperties(Ve,uo);var Ur=function(){this._maxPtDist=new te,this._minPtDist=new te,this._euclideanDist=new di,this._geom=null;var t=arguments[0];this._geom=t};Ur.prototype.filter=function(t){this._minPtDist.initialize(),di.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ur.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ur.prototype.interfaces_=function(){return[Ti]},Ur.prototype.getClass=function(){return Ur};var ar=function(){this._maxPtDist=new te,this._minPtDist=new te,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};ar.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),n=t.getCoordinate(e),o=(n.x-i.x)/this._numSubSegs,f=(n.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,a=i.y+u*f,c=new A(l,a);r._minPtDist.initialize(),di.computeDistance(r._geom,c,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},ar.prototype.isDone=function(){return!1},ar.prototype.isGeometryChanged=function(){return!1},ar.prototype.getMaxPointDistance=function(){return this._maxPtDist},ar.prototype.interfaces_=function(){return[He]},ar.prototype.getClass=function(){return ar};var Ce=function(t,e,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=r||null},ho={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Ce.prototype.checkMaximumDistance=function(t,e,r){var i=new Ve(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var n=i.getCoordinates();this._errorLocation=n[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ze.toLineString(n[0],n[1])+")"}},Ce.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Ce.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Ce.VERBOSE&&Yt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Ce.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ot||this._input instanceof Ai||this._input instanceof ee))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Ce.prototype.getErrorIndicator=function(){return this._errorIndicator},Ce.prototype.checkMinimumDistance=function(t,e,r){var i=new Ht(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var n=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ze.toLineString(n[0],n[1])+" )"}},Ce.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Ce.prototype.getErrorLocation=function(){return this._errorLocation},Ce.prototype.getPolygonLines=function(t){for(var e=new k,r=new qt(e),i=Ki.getPolygons(t),n=i.iterator();n.hasNext();){var o=n.next();o.apply(r)}return t.getFactory().buildGeometry(e)},Ce.prototype.getErrorMessage=function(){return this._errMsg},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},ho.VERBOSE.get=function(){return!1},ho.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ce,ho);var Zt=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},lo={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Zt.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Zt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Zt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new X(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new X(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Zt.prototype.checkDistance=function(){var t=new Ce(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Zt.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Zt.prototype.checkPolygonal=function(){this._result instanceof Ot||this._result instanceof Ai||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Zt.prototype.getErrorIndicator=function(){return this._errorIndicator},Zt.prototype.getErrorLocation=function(){return this._errorLocation},Zt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Zt.prototype.report=function(t){if(!Zt.VERBOSE)return null;Yt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Zt.prototype.getErrorMessage=function(){return this._errorMsg},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.isValidMsg=function(t,e,r){var i=new Zt(t,e,r);return i.isValid()?null:i.getErrorMessage()},Zt.isValid=function(t,e,r){var i=new Zt(t,e,r);return!!i.isValid()},lo.VERBOSE.get=function(){return!1},lo.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Zt,lo);var mi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};mi.prototype.getCoordinates=function(){return this._pts},mi.prototype.size=function(){return this._pts.length},mi.prototype.getCoordinate=function(t){return this._pts[t]},mi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},mi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:kr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},mi.prototype.setData=function(t){this._data=t},mi.prototype.getData=function(){return this._data},mi.prototype.toString=function(){return ze.toLineString(new Pt(this._pts))},mi.prototype.interfaces_=function(){return[Ei]},mi.prototype.getClass=function(){return mi};var Gt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new k,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Gt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Gt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Gt.prototype.getIntersectionSegments=function(){return this._intSegments},Gt.prototype.count=function(){return this._intersectionCount},Gt.prototype.getIntersections=function(){return this._intersections},Gt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Gt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Gt.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var n=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!n)return null}var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=f,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Gt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Gt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Gt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Gt.prototype.interfaces_=function(){return[Cr]},Gt.prototype.getClass=function(){return Gt},Gt.createAllIntersectionsFinder=function(t){var e=new Gt(t);return e.setFindAllIntersections(!0),e},Gt.createAnyIntersectionFinder=function(t){return new Gt(t)},Gt.createIntersectionCounter=function(t){var e=new Gt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Qe=function(){this._li=new gr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Qe.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Qe.prototype.getIntersections=function(){return this._segInt.getIntersections()},Qe.prototype.isValid=function(){return this.execute(),this._isValid},Qe.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Qe.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Gt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ao;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Qe.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ui(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Qe.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ze.toLineString(t[0],t[1])+" and "+ze.toLineString(t[2],t[3])},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe},Qe.computeIntersections=function(t){var e=new Qe(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Tr=function s(){this._nv=null;var t=arguments[0];this._nv=new Qe(s.toSegmentStrings(t))};Tr.prototype.checkValid=function(){this._nv.checkValid()},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.toSegmentStrings=function(t){for(var e=new k,r=t.iterator();r.hasNext();){var i=r.next();e.add(new mi(i.getCoordinates(),i))}return e},Tr.checkValid=function(t){var e=new Tr(t);e.checkValid()};var qr=function(t){this._mapOp=t};qr.prototype.map=function(t){for(var e=this,r=new k,i=0;i<t.getNumGeometries();i++){var n=e._mapOp.map(t.getGeometryN(i));n.isEmpty()||r.add(n)}return t.getFactory().createGeometryCollection(et.toGeometryArray(r))},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.map=function(t,e){var r=new qr(e);return r.map(t)};var yi=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new k,this._resultLineList=new k;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};yi.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},yi.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},yi.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},yi.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),n=t.getEdge();t.isLineEdge()&&!t.isVisited()&&J.isResultOfOp(i,e)&&!n.isCovered()&&(r.add(n),t.setVisitedEdge(!0))},yi.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var n=i.next(),o=n.getEdge();if(n.isLineEdge()&&!o.isCoveredSet()){var f=t._op.isCoveredByA(n.getCoordinate());o.setCovered(f)}}},yi.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();i.isIsolated()&&(n.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},yi.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),n=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(n),i.setInResult(!0)}},yi.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Q.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),J.isResultOfOp(i,e)&&e===J.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new k;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===J.INTERSECTION)){var n=i.getLabel();J.isResultOfOp(n,t)&&e.filterCoveredNodeToPoint(i)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var de=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};de.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformPolygon=function(t,e){var r=this,i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);(n===null||!(n instanceof Li)||n.isEmpty())&&(i=!1);for(var o=new k,f=0;f<t.getNumInteriorRing();f++){var u=r.transformLinearRing(t.getInteriorRingN(f),t);u===null||u.isEmpty()||(u instanceof Li||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(n,o.toArray([]));var l=new k;return n!==null&&l.add(n),l.addAll(o),this._factory.buildGeometry(l)},de.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},de.prototype.getInputGeometry=function(){return this._inputGeom},de.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformLineString(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.transformCoordinates=function(t,e){return this.copy(t)},de.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformPoint(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformPolygon(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.copy=function(t){return t.copy()},de.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transform(t.getGeometryN(n));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(et.toGeometryArray(i)):this._factory.buildGeometry(i)},de.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ye)return this.transformPoint(t,null);if(t instanceof ls)return this.transformMultiPoint(t,null);if(t instanceof Li)return this.transformLinearRing(t,null);if(t instanceof Tt)return this.transformLineString(t,null);if(t instanceof yr)return this.transformMultiLineString(t,null);if(t instanceof Ot)return this.transformPolygon(t,null);if(t instanceof Ai)return this.transformMultiPolygon(t,null);if(t instanceof ee)return this.transformGeometryCollection(t,null);throw new Ct("Unknown Geometry subtype: "+t.getClass().getName())},de.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de};var Di=function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Y,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Tt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];s.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=s.isClosed(r),this._snapTolerance=i}};Di.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),n=0;n<i;n++){var o=t.get(n),f=r.findSnapForVertex(o,e);f!==null&&(t.set(n,new A(f)),n===0&&r._isClosed&&t.set(t.size()-1,new A(f)))}},Di.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},Di.prototype.snapTo=function(t){var e=new Ds(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Di.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var n=0;n<i;n++){var o=e[n],f=r.findSegmentIndexToSnap(o,t);f>=0&&t.add(f+1,new A(o),!1)}},Di.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=K.MAX_VALUE,n=-1,o=0;o<e.size()-1;o++){if(r._seg.p0=e.get(o),r._seg.p1=e.get(o+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var f=r._seg.distance(t);f<r._snapTolerance&&f<i&&(i=f,n=o)}return n},Di.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Nt=function(t){this._srcGeom=t||null},ma={SNAP_PRECISION_FACTOR:{configurable:!0}};Nt.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new ya(e,r);return i.transform(this._srcGeom)},Nt.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new ya(t,r,!0),n=i.transform(this._srcGeom),o=n;return e&&q(o,tr)&&(o=n.buffer(0)),o},Nt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},Nt.prototype.extractTargetCoordinates=function(t){for(var e=new ni,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},Nt.prototype.computeMinimumSegmentLength=function(t){for(var e=K.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.snap=function(t,e,r){var i=new Array(2).fill(null),n=new Nt(t);i[0]=n.snapTo(e,r);var o=new Nt(e);return i[1]=o.snapTo(i[0],r),i},Nt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Nt.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===ot.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return Math.min(Nt.computeOverlaySnapTolerance(n),Nt.computeOverlaySnapTolerance(o))}},Nt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Nt.SNAP_PRECISION_FACTOR;return i},Nt.snapToSelf=function(t,e,r){var i=new Nt(t);return i.snapToSelf(e,r)},ma.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Nt,ma);var ya=function(s){function t(e,r,i){s.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var n=new Di(r,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var n=r.toCoordinateArray(),o=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(de),ae=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};ae.prototype.getCommon=function(){return K.longBitsToDouble(this._commonBits)},ae.prototype.add=function(t){var e=K.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=ae.signExpBits(this._commonBits),this._isFirst=!1,null;var r=ae.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=ae.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=ae.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},ae.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=K.longBitsToDouble(t),r=K.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,n=i.substring(i.length-64),o=n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]";return o}},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.getBit=function(t,e){var r=1<<e;return t&r?1:0},ae.signExpBits=function(t){return t>>52},ae.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,n=t&i;return n},ae.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(ae.getBit(t,i)!==ae.getBit(e,i))return r;r++}return 52};var fr=function(){this._commonCoord=null,this._ccFilter=new Zr},co={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};fr.prototype.addCommonBits=function(t){var e=new ur(this._commonCoord);t.apply(e),t.geometryChanged()},fr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new A(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new ur(e);return t.apply(r),t.geometryChanged(),t},fr.prototype.getCommonCoordinate=function(){return this._commonCoord},fr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr},co.CommonCoordinateFilter.get=function(){return Zr},co.Translater.get=function(){return ur},Object.defineProperties(fr,co);var Zr=function(){this._commonBitsX=new ae,this._commonBitsY=new ae};Zr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Zr.prototype.getCommonCoordinate=function(){return new A(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Zr.prototype.interfaces_=function(){return[Ti]},Zr.prototype.getClass=function(){return Zr};var ur=function(){this.trans=null;var t=arguments[0];this.trans=t};ur.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},ur.prototype.isDone=function(){return!1},ur.prototype.isGeometryChanged=function(){return!0},ur.prototype.interfaces_=function(){return[He]},ur.prototype.getClass=function(){return ur};var Xt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Xt.prototype.selfSnap=function(t){var e=new Nt(t),r=e.snapTo(t,this._snapTolerance);return r},Xt.prototype.removeCommonBits=function(t){this._cbr=new fr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Xt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Xt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=J.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Xt.prototype.checkValid=function(t){t.isValid()||Yt.out.println("Snapped geometry is invalid")},Xt.prototype.computeSnapTolerance=function(){this._snapTolerance=Nt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Xt.prototype.snap=function(t){var e=this.removeCommonBits(t),r=Nt.snap(e[0],e[1],this._snapTolerance);return r},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.overlayOp=function(t,e,r){var i=new Xt(t,e);return i.getResultGeometry(r)},Xt.union=function(t,e){return Xt.overlayOp(t,e,J.UNION)},Xt.intersection=function(t,e){return Xt.overlayOp(t,e,J.INTERSECTION)},Xt.symDifference=function(t,e){return Xt.overlayOp(t,e,J.SYMDIFFERENCE)},Xt.difference=function(t,e){return Xt.overlayOp(t,e,J.DIFFERENCE)};var fe=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};fe.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=J.overlayOp(this._geom[0],this._geom[1],t);var n=!0;n&&(r=!0)}catch(o){if(o instanceof ki)i=o;else throw o}finally{}if(!r)try{e=Xt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof ki?i:o}finally{}return e},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.overlayOp=function(t,e,r){var i=new fe(t,e);return i.getResultGeometry(r)},fe.union=function(t,e){return fe.overlayOp(t,e,J.UNION)},fe.intersection=function(t,e){return fe.overlayOp(t,e,J.INTERSECTION)},fe.symDifference=function(t,e){return fe.overlayOp(t,e,J.SYMDIFFERENCE)},fe.difference=function(t,e){return fe.overlayOp(t,e,J.DIFFERENCE)};var Hs=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Hs.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Hs.prototype.interfaces_=function(){return[]},Hs.prototype.getClass=function(){return Hs};var We=function s(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=s.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._eventType=s.INSERT,this._label=r,this._xValue=i,this._obj=n}},po={INSERT:{configurable:!0},DELETE:{configurable:!0}};We.prototype.isDelete=function(){return this._eventType===We.DELETE},We.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},We.prototype.getObject=function(){return this._obj},We.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},We.prototype.getInsertEvent=function(){return this._insertEvent},We.prototype.isInsert=function(){return this._eventType===We.INSERT},We.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},We.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},We.prototype.interfaces_=function(){return[Me]},We.prototype.getClass=function(){return We},po.INSERT.get=function(){return 1},po.DELETE.get=function(){return 2},Object.defineProperties(We,po);var Tn=function(){};Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var Kt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};Kt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Kt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var n=t.getNumPoints()-1;if(e===0&&i===n||i===0&&e===n)return!0}}return!1},Kt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Kt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Kt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Kt.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),n=i.getCoordinate();if(t.isIntersection(n))return!0}return!1},Kt.prototype.hasProperIntersection=function(){return this._hasProper},Kt.prototype.hasIntersection=function(){return this._hasIntersection},Kt.prototype.isDone=function(){return this._isDone},Kt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Kt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Kt.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Zf=function(s){function t(){s.call(this),this.events=new k,this.nOverlaps=null}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;Ke.sort(this.events);for(var i=0;i<this.events.size();i++){var n=r.events.get(i);n.isDelete()&&n.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var n=0;n<this.events.size();n++){var o=r.events.get(n);if(o.isInsert()&&r.processOverlaps(n,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Kt&&q(arguments[0],Ue)&&q(arguments[1],Ue)){var f=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(f,f),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&q(arguments[0],Ue)&&arguments[1]instanceof Kt){var a=arguments[0],c=arguments[1],p=arguments[2];p?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(c)}}},t.prototype.addEdge=function(r,i){for(var n=this,o=r.getMonotoneChainEdge(),f=o.getStartIndexes(),u=0;u<f.length-1;u++){var l=new Hs(o,u),a=new We(i,o.getMinX(u),l);n.events.add(a),n.events.add(new We(o.getMaxX(u),a))}},t.prototype.processOverlaps=function(r,i,n,o){for(var f=this,u=n.getObject(),l=r;l<i;l++){var a=f.events.get(l);if(a.isInsert()){var c=a.getObject();n.isSameLabel(a)||(u.computeIntersections(c,o),f.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],n=i.iterator();n.hasNext();){var o=n.next();r.addEdge(o,o)}else if(arguments.length===2)for(var f=arguments[0],u=arguments[1],l=f.iterator();l.hasNext();){var a=l.next();r.addEdge(a,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Tn),Mi=function(){this._min=K.POSITIVE_INFINITY,this._max=K.NEGATIVE_INFINITY},va={NodeComparator:{configurable:!0}};Mi.prototype.getMin=function(){return this._min},Mi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Mi.prototype.getMax=function(){return this._max},Mi.prototype.toString=function(){return ze.toLineString(new A(this._min,0),new A(this._max,0))},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},va.NodeComparator.get=function(){return Zs},Object.defineProperties(Mi,va);var Zs=function(){};Zs.prototype.compare=function(t,e){var r=t,i=e,n=(r._min+r._max)/2,o=(i._min+i._max)/2;return n<o?-1:n>o?1:0},Zs.prototype.interfaces_=function(){return[ts]},Zs.prototype.getClass=function(){return Zs};var Kf=function(s){function t(){s.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,n){if(!this.intersects(r,i))return null;n.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mi),jf=function(s){function t(){s.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,n){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,n),this._node2!==null&&this._node2.query(r,i,n)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mi),Ri=function(){this._leaves=new k,this._root=null,this._level=0};Ri.prototype.buildTree=function(){var t=this;Ke.sort(this._leaves,new Mi.NodeComparator);for(var e=this._leaves,r=null,i=new k;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},Ri.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Kf(t,e,r))},Ri.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},Ri.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Ri.prototype.printNode=function(t){Yt.out.println(ze.toLineString(new A(t._min,this._level),new A(t._max,this._level)))},Ri.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Ri.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),n=r+1<t.size()?t.get(r):null;if(n===null)e.add(i);else{var o=new jf(t.get(r),t.get(r+1));e.add(o)}}},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var vs=function(){this._items=new k};vs.prototype.visitItem=function(t){this._items.add(t)},vs.prototype.getItems=function(){return this._items},vs.prototype.interfaces_=function(){return[er]},vs.prototype.getClass=function(){return vs};var _s=function(){this._index=null;var t=arguments[0];if(!q(t,tr))throw new Ct("Argument must be Polygonal");this._index=new Lr(t)},go={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};_s.prototype.locate=function(t){var e=new si(t),r=new Cs(e);return this._index.query(t.y,t.y,r),e.getLocation()},_s.prototype.interfaces_=function(){return[ds]},_s.prototype.getClass=function(){return _s},go.SegmentVisitor.get=function(){return Cs},go.IntervalIndexedGeometry.get=function(){return Lr},Object.defineProperties(_s,go);var Cs=function(){this._counter=null;var t=arguments[0];this._counter=t};Cs.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Cs.prototype.interfaces_=function(){return[er]},Cs.prototype.getClass=function(){return Cs};var Lr=function(){this._index=new Ri;var t=arguments[0];this.init(t)};Lr.prototype.init=function(t){for(var e=this,r=qt.getLines(t),i=r.iterator();i.hasNext();){var n=i.next(),o=n.getCoordinates();e.addLine(o)}},Lr.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new Y(t[r-1],t[r]),n=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(n,o,i)}},Lr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new vs;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];this._index.query(i,n,o)}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr};var Ks=function(s){function t(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new $o,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Je,arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];this._argIndex=n,this._parentGeom=o,this._boundaryNodeRule=f,o!==null&&this.add(o)}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var n=this._nodes.addNode(i),o=n.getLabel(),f=1,u=P.NONE;u=o.getLocation(r,x.ON),u===P.BOUNDARY&&f++;var l=t.determineBoundary(this._boundaryNodeRule,f);o.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2],u=new Kt(n,!0,!1);u.setIsDoneIfProperInt(f);var l=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Li||this._parentGeom instanceof Ot||this._parentGeom instanceof Ai,c=o||!a;return l.computeIntersections(this._edges,u,c),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var n=i.next();n.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,n){var o=new Kt(i,n,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var f=this.createEdgeSetIntersector();return f.computeIntersections(this._edges,r._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof ye){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,P.INTERIOR)}else if(arguments[0]instanceof A){var n=arguments[0];this.insertPoint(this._argIndex,n,P.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),P.EXTERIOR,P.INTERIOR);for(var n=0;n<r.getNumInteriorRing();n++){var o=r.getInteriorRingN(n);i.addPolygonRing(o,P.INTERIOR,P.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],P.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],P.BOUNDARY)},t.prototype.addLineString=function(r){var i=tt.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var n=new In(i,new ct(this._argIndex,P.INTERIOR));this._lineEdgeMap.put(r,n),this.insertEdge(n),Q.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),n=0,o=r.iterator();o.hasNext();){var f=o.next();i[n++]=f.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,n){if(this.isBoundaryNode(r,i))return null;n===P.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,n)},t.prototype.addPolygonRing=function(r,i,n){if(r.isEmpty())return null;var o=tt.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var f=i,u=n;V.isCCW(o)&&(f=n,u=i);var l=new In(o,new ct(this._argIndex,P.BOUNDARY,f,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],P.BOUNDARY)},t.prototype.insertPoint=function(r,i,n){var o=this._nodes.addNode(i),f=o.getLabel();f===null?o._label=new ct(r,n):f.setLocation(r,n)},t.prototype.createEdgeSetIntersector=function(){return new Zf},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,n=this._edges.iterator();n.hasNext();)for(var o=n.next(),f=o.getLabel().getLocation(r),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,f)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Ai&&(this._useBoundaryDeterminationRule=!1),r instanceof Ot)this.addPolygon(r);else if(r instanceof Tt)this.addLineString(r);else if(r instanceof ye)this.addPoint(r);else if(r instanceof ls)this.addCollection(r);else if(r instanceof yr)this.addCollection(r);else if(r instanceof Ai)this.addCollection(r);else if(r instanceof ee)this.addCollection(r);else throw new Error(r.getClass().getName())}else return s.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,n=0;n<r.getNumGeometries();n++){var o=r.getGeometryN(n);i.add(o)}},t.prototype.locate=function(r){return q(this._parentGeom,tr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new _s(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return s.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?P.BOUNDARY:P.INTERIOR},t}(It),Ws=function(){if(this._li=new gr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ks(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ks(0,e,i),this._arg[1]=new Ks(1,r,i)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];n.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(n.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ks(0,n,f),this._arg[1]=new Ks(1,o,f)}};Ws.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ws.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws};var Ar=function(){};Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.map=function(){if(arguments[0]instanceof U&&q(arguments[1],Ar.MapOp)){for(var t=arguments[0],e=arguments[1],r=new k,i=0;i<t.getNumGeometries();i++){var n=e.map(t.getGeometryN(i));n!==null&&r.add(n)}return t.getFactory().buildGeometry(r)}else if(q(arguments[0],Bt)&&q(arguments[1],Ar.MapOp)){for(var o=arguments[0],f=arguments[1],u=new k,l=o.iterator();l.hasNext();){var a=l.next(),c=f.map(a);c!==null&&u.add(c)}return u}},Ar.MapOp=function(){};var J=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r),this._ptLocator=new Je,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new je,this._resultPolyList=new k,this._resultLineList=new k,this._resultPointList=new k,this._graph=new It(new ua),this._geomFact=e.getFactory()}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var n=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new ct(r.getLabel()),o.flip());var f=i.getDepth();f.isNull()&&f.add(n),f.add(o),n.merge(o)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),n=i.getSym();i.isInResult()&&n.isInResult()&&(i.setInResult(!1),n.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,n,o){var f=new k;return f.addAll(r),f.addAll(i),f.addAll(n),f.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(f)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var n=this,o=i.iterator();o.hasNext();){var f=o.next(),u=n._ptLocator.locate(r,f);if(u!==P.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new k,i=this._edgeList.iterator();i.hasNext();){var n=i.next();n.isCollapsed()&&(i.remove(),r.add(n.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),n=i.getEdges().getLabel();i.getLabel().merge(n)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,n=r.iterator();n.hasNext();){var o=n.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new k;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Tr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var n=new ve(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var o=new yi(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var f=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=f.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var n=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,n)},t.prototype.copyPoints=function(r){for(var i=this,n=this._arg[r].getNodeIterator();n.hasNext();){var o=n.next(),f=i._graph.addNode(o.getCoordinate());f.setLabel(r,o.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),o=n.getLabel();o.isArea()&&!n.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,x.RIGHT),o.getLocation(1,x.RIGHT),r)&&n.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),n=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var f=0;f<2;f++)!n.isNull(f)&&n.isArea()&&!o.isNull(f)&&(o.getDelta(f)===0?n.toLine(f):(Q.isTrue(!o.isNull(f,x.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(f,x.LEFT,o.getLocation(f,x.LEFT)),Q.isTrue(!o.isNull(f,x.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(f,x.RIGHT,o.getLocation(f,x.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next();n.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next(),o=n.getLabel();n.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(n,0):r.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ws);J.overlayOp=function(s,t,e){var r=new J(s,t),i=r.getResultGeometry(e);return i},J.intersection=function(s,t){if(s.isEmpty()||t.isEmpty())return J.createEmptyResult(J.INTERSECTION,s,t,s.getFactory());if(s.isGeometryCollection()){var e=t;return qr.map(s,{interfaces_:function(){return[Ar.MapOp]},map:function(r){return r.intersection(e)}})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),fe.overlayOp(s,t,J.INTERSECTION)},J.symDifference=function(s,t){if(s.isEmpty()||t.isEmpty()){if(s.isEmpty()&&t.isEmpty())return J.createEmptyResult(J.SYMDIFFERENCE,s,t,s.getFactory());if(s.isEmpty())return t.copy();if(t.isEmpty())return s.copy()}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),fe.overlayOp(s,t,J.SYMDIFFERENCE)},J.resultDimension=function(s,t,e){var r=t.getDimension(),i=e.getDimension(),n=-1;switch(s){case J.INTERSECTION:n=Math.min(r,i);break;case J.UNION:n=Math.max(r,i);break;case J.DIFFERENCE:n=r;break;case J.SYMDIFFERENCE:n=Math.max(r,i);break}return n},J.createEmptyResult=function(s,t,e,r){var i=null;switch(J.resultDimension(s,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},J.difference=function(s,t){return s.isEmpty()?J.createEmptyResult(J.DIFFERENCE,s,t,s.getFactory()):t.isEmpty()?s.copy():(s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),fe.overlayOp(s,t,J.DIFFERENCE))},J.isResultOfOp=function(){if(arguments.length===2){var s=arguments[0],t=arguments[1],e=s.getLocation(0),r=s.getLocation(1);return J.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];switch(i===P.BOUNDARY&&(i=P.INTERIOR),n===P.BOUNDARY&&(n=P.INTERIOR),o){case J.INTERSECTION:return i===P.INTERIOR&&n===P.INTERIOR;case J.UNION:return i===P.INTERIOR||n===P.INTERIOR;case J.DIFFERENCE:return i===P.INTERIOR&&n!==P.INTERIOR;case J.SYMDIFFERENCE:return i===P.INTERIOR&&n!==P.INTERIOR||i!==P.INTERIOR&&n===P.INTERIOR}return!1}},J.INTERSECTION=1,J.UNION=2,J.DIFFERENCE=3,J.SYMDIFFERENCE=4;var hr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Je,this._seg=new Y;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};hr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),n=i.getCoordinateSequence(),o=0;o<n.size()-1;o++){n.getCoordinate(o,e._seg.p0),n.getCoordinate(o+1,e._seg.p1);var f=e._seg.distance(t);if(f<=e._boundaryDistanceTolerance)return!0}return!1},hr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?P.BOUNDARY:this._ptLocator.locate(t,this._g)},hr.prototype.extractLinework=function(t){var e=new Is;t.apply(e);var r=e.getLinework(),i=et.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var Is=function(){this._linework=null,this._linework=new k};Is.prototype.getLinework=function(){return this._linework},Is.prototype.filter=function(t){var e=this;if(t instanceof Ot){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},Is.prototype.interfaces_=function(){return[oi]},Is.prototype.getClass=function(){return Is};var wr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};wr.prototype.extractPoints=function(t,e,r){for(var i=this,n=t.getCoordinates(),o=0;o<n.length-1;o++)i.computeOffsetPoints(n[o],n[o+1],e,r)},wr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},wr.prototype.getPoints=function(t){for(var e=this,r=new k,i=qt.getLines(this._g),n=i.iterator();n.hasNext();){var o=n.next();e.extractPoints(o,t,r)}return r},wr.prototype.computeOffsetPoints=function(t,e,r,i){var n=e.x-t.x,o=e.y-t.y,f=Math.sqrt(n*n+o*o),u=r*n/f,l=r*o/f,a=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var p=new A(a-l,c+u);i.add(p)}if(this._doRight){var d=new A(a+l,c-u);i.add(d)}},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr};var Se=function s(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=s.TOLERANCE,this._testCoords=new k;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=s.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new hr(this._geom[0],this._boundaryDistanceTolerance),new hr(this._geom[1],this._boundaryDistanceTolerance),new hr(this._geom[2],this._boundaryDistanceTolerance)]},_a={TOLERANCE:{configurable:!0}};Se.prototype.reportResult=function(t,e,r){Yt.out.println("Overlay result invalid - A:"+P.toLocationSymbol(e[0])+" B:"+P.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+P.toLocationSymbol(e[2]))},Se.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Se.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Se.hasLocation(this._location,P.BOUNDARY)?!0:this.isValidResult(n,this._location)}},Se.prototype.addTestPts=function(t){var e=new wr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Se.prototype.isValidResult=function(t,e){var r=J.isResultOfOp(e[0],e[1],t),i=e[2]===P.INTERIOR,n=!(r^i);return n||this.reportResult(t,e,r),n},Se.prototype.getInvalidLocation=function(){return this._invalidLocation},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},Se.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Nt.computeSizeBasedSnapTolerance(t),Nt.computeSizeBasedSnapTolerance(e))},Se.isValid=function(t,e,r,i){var n=new Se(t,e,i);return n.isValid(r)},_a.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Se,_a);var Ne=function s(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(t),this._inputGeoms=t};Ne.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);r._skipEmpty&&n.isEmpty()||e.add(n)}},Ne.prototype.combine=function(){for(var t=this,e=new k,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Ne(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new Ne(Ne.createList(r,i));return n.combine()}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2],l=new Ne(Ne.createList(o,f,u));return l.combine()}},Ne.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ne.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new k;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new k;return f.add(i),f.add(n),f.add(o),f}};var Rt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new k)},Ca={STRTREE_NODE_CAPACITY:{configurable:!0}};Rt.prototype.reduceToGeometries=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=null;q(n,Ue)?o=e.unionTree(n):n instanceof U&&(o=n),r.add(o)}return r},Rt.prototype.extractByEnvelope=function(t,e,r){for(var i=new k,n=0;n<e.getNumGeometries();n++){var o=e.getGeometryN(n);o.getEnvelopeInternal().intersects(t)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},Rt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var n=Ne.combine(t,e);return n}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},Rt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new ra(Rt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),n=this.unionTree(i);return n},Rt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var n=Rt.getGeometry(e,r);return this.unionSafe(n,null)}else{if(i-r===2)return this.unionSafe(Rt.getGeometry(e,r),Rt.getGeometry(e,r+1));var o=Math.trunc((i+r)/2),f=this.binaryUnion(e,r,o),u=this.binaryUnion(e,o,i);return this.unionSafe(f,u)}}},Rt.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Rt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Rt.prototype.unionActual=function(t,e){return Rt.restrictToPolygons(t.union(e))},Rt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Rt.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new k,n=this.extractByEnvelope(r,t,i),o=this.extractByEnvelope(r,e,i),f=this.unionActual(n,o);i.add(f);var u=Ne.combine(i);return u},Rt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var n=arguments[0],o=arguments[1],f=n.getFactory(),u=f.createGeometryCollection([n,o]),l=u.buffer(0);return l}},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.restrictToPolygons=function(t){if(q(t,tr))return t;var e=Ki.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(et.toPolygonArray(e))},Rt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Rt.union=function(t){var e=new Rt(t);return e.union()},Ca.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Rt,Ca);var Ln=function(){};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return J.createEmptyResult(J.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),fe.overlayOp(t,e,J.UNION)};function Er(){return new An}function An(){this.reset()}An.prototype={constructor:An,reset:function(){this.s=this.t=0},add:function(s){Wa(wn,s,this.t),Wa(this,wn.s,this.s),this.s?this.t+=wn.t:this.s=wn.t},valueOf:function(){return this.s}};var wn=new An;function Wa(s,t,e){var r=s.s=t+e,i=r-t,n=r-i;s.t=t-n+(e-i)}var At=1e-6,gt=Math.PI,ji=gt/2,Ia=gt/4,Ji=gt*2,Pr=180/gt,vi=gt/180,ue=Math.abs,Jf=Math.atan,Ts=Math.atan2,xt=Math.cos,kt=Math.sin,Ls=Math.sqrt;function Ta(s){return s>1?0:s<-1?gt:Math.acos(s)}function Kr(s){return s>1?ji:s<-1?-ji:Math.asin(s)}function js(){}function En(s,t){s&&Aa.hasOwnProperty(s.type)&&Aa[s.type](s,t)}var La={Feature:function(s,t){En(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,r=-1,i=e.length;++r<i;)En(e[r].geometry,t)}},Aa={Sphere:function(s,t){t.sphere()},Point:function(s,t){s=s.coordinates,t.point(s[0],s[1],s[2])},MultiPoint:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)s=e[r],t.point(s[0],s[1],s[2])},LineString:function(s,t){mo(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)mo(e[r],t,0)},Polygon:function(s,t){wa(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)wa(e[r],t)},GeometryCollection:function(s,t){for(var e=s.geometries,r=-1,i=e.length;++r<i;)En(e[r],t)}};function mo(s,t,e){var r=-1,i=s.length-e,n;for(t.lineStart();++r<i;)n=s[r],t.point(n[0],n[1],n[2]);t.lineEnd()}function wa(s,t){var e=-1,r=s.length;for(t.polygonStart();++e<r;)mo(s[e],t,1);t.polygonEnd()}function Qf(s,t){s&&La.hasOwnProperty(s.type)?La[s.type](s,t):En(s,t)}Er(),Er();function yo(s){return[Ts(s[1],s[0]),Kr(s[2])]}function As(s){var t=s[0],e=s[1],r=xt(e);return[r*xt(t),r*kt(t),kt(e)]}function Pn(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function Sn(s,t){return[s[1]*t[2]-s[2]*t[1],s[2]*t[0]-s[0]*t[2],s[0]*t[1]-s[1]*t[0]]}function vo(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function Nn(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function _o(s){var t=Ls(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}Er();function Ea(s,t){function e(r,i){return r=s(r,i),t(r[0],r[1])}return s.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&s.invert(r[0],r[1])}),e}function Co(s,t){return[s>gt?s-Ji:s<-gt?s+Ji:s,t]}Co.invert=Co;function $f(s,t,e){return(s%=Ji)?t||e?Ea(Sa(s),Na(t,e)):Sa(s):t||e?Na(t,e):Co}function Pa(s){return function(t,e){return t+=s,[t>gt?t-Ji:t<-gt?t+Ji:t,e]}}function Sa(s){var t=Pa(s);return t.invert=Pa(-s),t}function Na(s,t){var e=xt(s),r=kt(s),i=xt(t),n=kt(t);function o(f,u){var l=xt(u),a=xt(f)*l,c=kt(f)*l,p=kt(u),d=p*e+a*r;return[Ts(c*i-d*n,a*e-p*r),Kr(d*i+c*n)]}return o.invert=function(f,u){var l=xt(u),a=xt(f)*l,c=kt(f)*l,p=kt(u),d=p*i-c*n;return[Ts(c*i+p*n,a*e+d*r),Kr(d*e-a*r)]},o}function tu(s,t,e,r,i,n){if(e){var o=xt(t),f=kt(t),u=r*e;i==null?(i=t+r*Ji,n=t-u/2):(i=ba(o,i),n=ba(o,n),(r>0?i<n:i>n)&&(i+=r*Ji));for(var l,a=i;r>0?a>n:a<n;a-=u)l=yo([o,-f*xt(a),-f*kt(a)]),s.point(l[0],l[1])}}function ba(s,t){t=As(t),t[0]-=s,_o(t);var e=Ta(-t[1]);return((-t[2]<0?-e:e)+Ji-At)%Ji}function Da(){var s=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){s.push(t=[])},lineEnd:js,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function eu(s,t,e,r,i,n){var o=s[0],f=s[1],u=t[0],l=t[1],a=0,c=1,p=u-o,d=l-f,h;if(h=e-o,!(!p&&h>0)){if(h/=p,p<0){if(h<a)return;h<c&&(c=h)}else if(p>0){if(h>c)return;h>a&&(a=h)}if(h=i-o,!(!p&&h<0)){if(h/=p,p<0){if(h>c)return;h>a&&(a=h)}else if(p>0){if(h<a)return;h<c&&(c=h)}if(h=r-f,!(!d&&h>0)){if(h/=d,d<0){if(h<a)return;h<c&&(c=h)}else if(d>0){if(h>c)return;h>a&&(a=h)}if(h=n-f,!(!d&&h<0)){if(h/=d,d<0){if(h>c)return;h>a&&(a=h)}else if(d>0){if(h<a)return;h<c&&(c=h)}return a>0&&(s[0]=o+a*p,s[1]=f+a*d),c<1&&(t[0]=o+c*p,t[1]=f+c*d),!0}}}}}function bn(s,t){return ue(s[0]-t[0])<At&&ue(s[1]-t[1])<At}function Dn(s,t,e,r){this.x=s,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Ma(s,t,e,r,i){var n=[],o=[],f,u;if(s.forEach(function(h){if(!((m=h.length-1)<=0)){var m,_=h[0],W=h[m],C;if(bn(_,W)){for(i.lineStart(),f=0;f<m;++f)i.point((_=h[f])[0],_[1]);i.lineEnd();return}n.push(C=new Dn(_,h,null,!0)),o.push(C.o=new Dn(_,null,C,!1)),n.push(C=new Dn(W,h,null,!1)),o.push(C.o=new Dn(W,null,C,!0))}}),!!n.length){for(o.sort(t),Ra(n),Ra(o),f=0,u=o.length;f<u;++f)o[f].e=e=!e;for(var l=n[0],a,c;;){for(var p=l,d=!0;p.v;)if((p=p.n)===l)return;a=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(f=0,u=a.length;f<u;++f)i.point((c=a[f])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d)for(a=p.p.z,f=a.length-1;f>=0;--f)i.point((c=a[f])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,a=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Ra(s){if(t=s.length){for(var t,e=0,r=s[0],i;++e<t;)r.n=i=s[e],i.p=r,r=i;r.n=i=s[0],i.p=r}}function Ba(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function iu(s){return s.length===1&&(s=ru(s)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var n=r+i>>>1;s(t[n],e)<0?r=n+1:i=n}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var n=r+i>>>1;s(t[n],e)>0?i=n:r=n+1}return r}}}function ru(s){return function(t,e){return Ba(s(t),e)}}iu(Ba);function Oa(s){for(var t=s.length,e,r=-1,i=0,n,o;++r<t;)i+=s[r].length;for(n=new Array(i);--t>=0;)for(o=s[t],e=o.length;--e>=0;)n[--i]=o[e];return n}var Js=1e9,Mn=-Js;function su(s,t,e,r){function i(l,a){return s<=l&&l<=e&&t<=a&&a<=r}function n(l,a,c,p){var d=0,h=0;if(l==null||(d=o(l,c))!==(h=o(a,c))||u(l,a)<0^c>0)do p.point(d===0||d===3?s:e,d>1?r:t);while((d=(d+c+4)%4)!==h);else p.point(a[0],a[1])}function o(l,a){return ue(l[0]-s)<At?a>0?0:3:ue(l[0]-e)<At?a>0?2:1:ue(l[1]-t)<At?a>0?1:0:a>0?3:2}function f(l,a){return u(l.x,a.x)}function u(l,a){var c=o(l,1),p=o(a,1);return c!==p?c-p:c===0?a[1]-l[1]:c===1?l[0]-a[0]:c===2?l[1]-a[1]:a[0]-l[0]}return function(l){var a=l,c=Da(),p,d,h,m,_,W,C,I,L,w,N,D={point:B,lineStart:H,lineEnd:j,polygonStart:O,polygonEnd:R};function B(G,Z){i(G,Z)&&a.point(G,Z)}function M(){for(var G=0,Z=0,it=d.length;Z<it;++Z)for(var ut=d[Z],ht=1,ti=ut.length,Ge=ut[0],Ci,lt,_t=Ge[0],wt=Ge[1];ht<ti;++ht)Ci=_t,lt=wt,Ge=ut[ht],_t=Ge[0],wt=Ge[1],lt<=r?wt>r&&(_t-Ci)*(r-lt)>(wt-lt)*(s-Ci)&&++G:wt<=r&&(_t-Ci)*(r-lt)<(wt-lt)*(s-Ci)&&--G;return G}function O(){a=c,p=[],d=[],N=!0}function R(){var G=M(),Z=N&&G,it=(p=Oa(p)).length;(Z||it)&&(l.polygonStart(),Z&&(l.lineStart(),n(null,null,1,l),l.lineEnd()),it&&Ma(p,f,G,n,l),l.polygonEnd()),a=l,p=d=h=null}function H(){D.point=F,d&&d.push(h=[]),w=!0,L=!1,C=I=NaN}function j(){p&&(F(m,_),W&&L&&c.rejoin(),p.push(c.result())),D.point=B,L&&a.lineEnd()}function F(G,Z){var it=i(G,Z);if(d&&h.push([G,Z]),w)m=G,_=Z,W=it,w=!1,it&&(a.lineStart(),a.point(G,Z));else if(it&&L)a.point(G,Z);else{var ut=[C=Math.max(Mn,Math.min(Js,C)),I=Math.max(Mn,Math.min(Js,I))],ht=[G=Math.max(Mn,Math.min(Js,G)),Z=Math.max(Mn,Math.min(Js,Z))];eu(ut,ht,s,t,e,r)?(L||(a.lineStart(),a.point(ut[0],ut[1])),a.point(ht[0],ht[1]),it||a.lineEnd(),N=!1):it&&(a.lineStart(),a.point(G,Z),N=!1)}C=G,I=Z,L=it}return D}}var Wo=Er();function nu(s,t){var e=t[0],r=t[1],i=[kt(e),-xt(e),0],n=0,o=0;Wo.reset();for(var f=0,u=s.length;f<u;++f)if(a=(l=s[f]).length)for(var l,a,c=l[a-1],p=c[0],d=c[1]/2+Ia,h=kt(d),m=xt(d),_=0;_<a;++_,p=C,h=L,m=w,c=W){var W=l[_],C=W[0],I=W[1]/2+Ia,L=kt(I),w=xt(I),N=C-p,D=N>=0?1:-1,B=D*N,M=B>gt,O=h*L;if(Wo.add(Ts(O*D*kt(B),m*w+O*xt(B))),n+=M?N+D*Ji:N,M^p>=e^C>=e){var R=Sn(As(c),As(W));_o(R);var H=Sn(i,R);_o(H);var j=(M^N>=0?-1:1)*Kr(H[2]);(r>j||r===j&&(R[0]||R[1]))&&(o+=M^N>=0?1:-1)}}return(n<-At||n<At&&Wo<-At)^o&1}Er();function Fa(s){return s}Er(),Er();var ws=1/0,Rn=ws,Qs=-ws,Bn=Qs,xa={point:ou,lineStart:js,lineEnd:js,polygonStart:js,polygonEnd:js,result:function(){var s=[[ws,Rn],[Qs,Bn]];return Qs=Bn=-(Rn=ws=1/0),s}};function ou(s,t){s<ws&&(ws=s),s>Qs&&(Qs=s),t<Rn&&(Rn=t),t>Bn&&(Bn=t)}Er();function ka(s,t,e,r){return function(i,n){var o=t(n),f=i.invert(r[0],r[1]),u=Da(),l=t(u),a=!1,c,p,d,h={point:m,lineStart:W,lineEnd:C,polygonStart:function(){h.point=I,h.lineStart=L,h.lineEnd=w,p=[],c=[]},polygonEnd:function(){h.point=m,h.lineStart=W,h.lineEnd=C,p=Oa(p);var N=nu(c,f);p.length?(a||(n.polygonStart(),a=!0),Ma(p,fu,N,e,n)):N&&(a||(n.polygonStart(),a=!0),n.lineStart(),e(null,null,1,n),n.lineEnd()),a&&(n.polygonEnd(),a=!1),p=c=null},sphere:function(){n.polygonStart(),n.lineStart(),e(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function m(N,D){var B=i(N,D);s(N=B[0],D=B[1])&&n.point(N,D)}function _(N,D){var B=i(N,D);o.point(B[0],B[1])}function W(){h.point=_,o.lineStart()}function C(){h.point=m,o.lineEnd()}function I(N,D){d.push([N,D]);var B=i(N,D);l.point(B[0],B[1])}function L(){l.lineStart(),d=[]}function w(){I(d[0][0],d[0][1]),l.lineEnd();var N=l.clean(),D=u.result(),B,M=D.length,O,R,H;if(d.pop(),c.push(d),d=null,!!M){if(N&1){if(R=D[0],(O=R.length-1)>0){for(a||(n.polygonStart(),a=!0),n.lineStart(),B=0;B<O;++B)n.point((H=R[B])[0],H[1]);n.lineEnd()}return}M>1&&N&2&&D.push(D.pop().concat(D.shift())),p.push(D.filter(au))}}return h}}function au(s){return s.length>1}function fu(s,t){return((s=s.x)[0]<0?s[1]-ji-At:ji-s[1])-((t=t.x)[0]<0?t[1]-ji-At:ji-t[1])}const Va=ka(function(){return!0},uu,lu,[-gt,-ji]);function uu(s){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){s.lineStart(),i=1},point:function(n,o){var f=n>0?gt:-gt,u=ue(n-t);ue(u-gt)<At?(s.point(t,e=(e+o)/2>0?ji:-ji),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),s.point(n,e),i=0):r!==f&&u>=gt&&(ue(t-r)<At&&(t-=r*At),ue(n-f)<At&&(n-=f*At),e=hu(t,e,n,o),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),i=0),s.point(t=n,e=o),r=f},lineEnd:function(){s.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function hu(s,t,e,r){var i,n,o=kt(s-e);return ue(o)>At?Jf((kt(t)*(n=xt(r))*kt(e)-kt(r)*(i=xt(t))*kt(s))/(i*n*o)):(t+r)/2}function lu(s,t,e,r){var i;if(s==null)i=e*ji,r.point(-gt,i),r.point(0,i),r.point(gt,i),r.point(gt,0),r.point(gt,-i),r.point(0,-i),r.point(-gt,-i),r.point(-gt,0),r.point(-gt,i);else if(ue(s[0]-t[0])>At){var n=s[0]<t[0]?gt:-gt;i=e*n/2,r.point(-n,i),r.point(0,i),r.point(n,i)}else r.point(t[0],t[1])}function cu(s,t){var e=xt(s),r=e>0,i=ue(e)>At;function n(a,c,p,d){tu(d,s,t,p,a,c)}function o(a,c){return xt(a)*xt(c)>e}function f(a){var c,p,d,h,m;return{lineStart:function(){h=d=!1,m=1},point:function(_,W){var C=[_,W],I,L=o(_,W),w=r?L?0:l(_,W):L?l(_+(_<0?gt:-gt),W):0;if(!c&&(h=d=L)&&a.lineStart(),L!==d&&(I=u(c,C),(!I||bn(c,I)||bn(C,I))&&(C[0]+=At,C[1]+=At,L=o(C[0],C[1]))),L!==d)m=0,L?(a.lineStart(),I=u(C,c),a.point(I[0],I[1])):(I=u(c,C),a.point(I[0],I[1]),a.lineEnd()),c=I;else if(i&&c&&r^L){var N;!(w&p)&&(N=u(C,c,!0))&&(m=0,r?(a.lineStart(),a.point(N[0][0],N[0][1]),a.point(N[1][0],N[1][1]),a.lineEnd()):(a.point(N[1][0],N[1][1]),a.lineEnd(),a.lineStart(),a.point(N[0][0],N[0][1])))}L&&(!c||!bn(c,C))&&a.point(C[0],C[1]),c=C,d=L,p=w},lineEnd:function(){d&&a.lineEnd(),c=null},clean:function(){return m|(h&&d)<<1}}}function u(a,c,p){var d=As(a),h=As(c),m=[1,0,0],_=Sn(d,h),W=Pn(_,_),C=_[0],I=W-C*C;if(!I)return!p&&a;var L=e*W/I,w=-e*C/I,N=Sn(m,_),D=Nn(m,L),B=Nn(_,w);vo(D,B);var M=N,O=Pn(D,M),R=Pn(M,M),H=O*O-R*(Pn(D,D)-1);if(!(H<0)){var j=Ls(H),F=Nn(M,(-O-j)/R);if(vo(F,D),F=yo(F),!p)return F;var G=a[0],Z=c[0],it=a[1],ut=c[1],ht;Z<G&&(ht=G,G=Z,Z=ht);var ti=Z-G,Ge=ue(ti-gt)<At,Ci=Ge||ti<At;if(!Ge&&ut<it&&(ht=it,it=ut,ut=ht),Ci?Ge?it+ut>0^F[1]<(ue(F[0]-G)<At?it:ut):it<=F[1]&&F[1]<=ut:ti>gt^(G<=F[0]&&F[0]<=Z)){var lt=Nn(M,(-O+j)/R);return vo(lt,D),[F,yo(lt)]}}}function l(a,c){var p=r?s:gt-s,d=0;return a<-p?d|=1:a>p&&(d|=2),c<-p?d|=4:c>p&&(d|=8),d}return ka(o,f,n,r?[0,-s]:[-gt,s-gt])}function Ga(s){return function(t){var e=new Io;for(var r in s)e[r]=s[r];return e.stream=t,e}}function Io(){}Io.prototype={constructor:Io,point:function(s,t){this.stream.point(s,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Xa(s,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],n=s.clipExtent&&s.clipExtent();s.scale(150).translate([0,0]),n!=null&&s.clipExtent(null),Qf(e,s.stream(xa));var o=xa.result(),f=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(r-f*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-f*(o[1][1]+o[0][1]))/2;return n!=null&&s.clipExtent(n),s.scale(f*150).translate([u,l])}function pu(s,t,e){return Xa(s,[[0,0],t],e)}var Ya=16,gu=xt(30*vi);function za(s,t){return+t?mu(s,t):du(s)}function du(s){return Ga({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function mu(s,t){function e(r,i,n,o,f,u,l,a,c,p,d,h,m,_){var W=l-r,C=a-i,I=W*W+C*C;if(I>4*t&&m--){var L=o+p,w=f+d,N=u+h,D=Ls(L*L+w*w+N*N),B=Kr(N/=D),M=ue(ue(N)-1)<At||ue(n-c)<At?(n+c)/2:Ts(w,L),O=s(M,B),R=O[0],H=O[1],j=R-r,F=H-i,G=C*j-W*F;(G*G/I>t||ue((W*j+C*F)/I-.5)>.3||o*p+f*d+u*h<gu)&&(e(r,i,n,o,f,u,R,H,M,L/=D,w/=D,N,m,_),_.point(R,H),e(R,H,M,L,w,N,l,a,c,p,d,h,m,_))}}return function(r){var i,n,o,f,u,l,a,c,p,d,h,m,_={point:W,lineStart:C,lineEnd:L,polygonStart:function(){r.polygonStart(),_.lineStart=w},polygonEnd:function(){r.polygonEnd(),_.lineStart=C}};function W(B,M){B=s(B,M),r.point(B[0],B[1])}function C(){c=NaN,_.point=I,r.lineStart()}function I(B,M){var O=As([B,M]),R=s(B,M);e(c,p,a,d,h,m,c=R[0],p=R[1],a=B,d=O[0],h=O[1],m=O[2],Ya,r),r.point(c,p)}function L(){_.point=W,r.lineEnd()}function w(){C(),_.point=N,_.lineEnd=D}function N(B,M){I(i=B,M),n=c,o=p,f=d,u=h,l=m,_.point=I}function D(){e(c,p,a,d,h,m,n,o,i,f,u,l,Ya,r),_.lineEnd=L,L()}return _}}var yu=Ga({point:function(s,t){this.stream.point(s*vi,t*vi)}});function vu(s){return _u(function(){return s})()}function _u(s){var t,e=150,r=480,i=250,n,o,f=0,u=0,l=0,a=0,c=0,p,d,h=null,m=Va,_=null,W,C,I,L=Fa,w=.5,N=za(R,w),D,B;function M(F){return F=d(F[0]*vi,F[1]*vi),[F[0]*e+n,o-F[1]*e]}function O(F){return F=d.invert((F[0]-n)/e,(o-F[1])/e),F&&[F[0]*Pr,F[1]*Pr]}function R(F,G){return F=t(F,G),[F[0]*e+n,o-F[1]*e]}M.stream=function(F){return D&&B===F?D:D=yu(m(p,N(L(B=F))))},M.clipAngle=function(F){return arguments.length?(m=+F?cu(h=F*vi,6*vi):(h=null,Va),j()):h*Pr},M.clipExtent=function(F){return arguments.length?(L=F==null?(_=W=C=I=null,Fa):su(_=+F[0][0],W=+F[0][1],C=+F[1][0],I=+F[1][1]),j()):_==null?null:[[_,W],[C,I]]},M.scale=function(F){return arguments.length?(e=+F,H()):e},M.translate=function(F){return arguments.length?(r=+F[0],i=+F[1],H()):[r,i]},M.center=function(F){return arguments.length?(f=F[0]%360*vi,u=F[1]%360*vi,H()):[f*Pr,u*Pr]},M.rotate=function(F){return arguments.length?(l=F[0]%360*vi,a=F[1]%360*vi,c=F.length>2?F[2]%360*vi:0,H()):[l*Pr,a*Pr,c*Pr]},M.precision=function(F){return arguments.length?(N=za(R,w=F*F),j()):Ls(w)},M.fitExtent=function(F,G){return Xa(M,F,G)},M.fitSize=function(F,G){return pu(M,F,G)};function H(){d=Ea(p=$f(l,a,c),t);var F=t(f,u);return n=r-F[0]*e,o=i+F[1]*e,j()}function j(){return D=B=null,M}return function(){return t=s.apply(this,arguments),M.invert=t.invert&&O,H()}}function Ua(s){return function(t,e){var r=xt(t),i=xt(e),n=s(r*i);return[n*i*kt(t),n*kt(e)]}}function qa(s){return function(t,e){var r=Ls(t*t+e*e),i=s(r),n=kt(i),o=xt(i);return[Ts(t*n,r*o),Kr(r&&e*n/r)]}}var Cu=Ua(function(s){return Ls(2/(1+s))});Cu.invert=qa(function(s){return 2*Kr(s/2)});var Ha=Ua(function(s){return(s=Ta(s))&&s/kt(s)});Ha.invert=qa(function(s){return s});function Wu(){return vu(Ha).scale(79.4188).clipAngle(180-.001)}function Za(s,t){return[s,t]}Za.invert=Za;function Iu(s,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!s)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var n=[];switch(s.type){case"GeometryCollection":return Un(s,function(o){var f=On(o,t,r,i);f&&n.push(f)}),rn(n);case"FeatureCollection":return zn(s,function(o){var f=On(o,t,r,i);f&&zn(f,function(u){u&&n.push(u)})}),rn(n)}return On(s,t,r,i)}function On(s,t,e,r){var i=s.properties||{},n=s.type==="Feature"?s.geometry:s;if(n.type==="GeometryCollection"){var o=[];return Un(s,function(m){var _=On(m,t,e,r);_&&o.push(_)}),rn(o)}var f=Tu(n),u={type:n.type,coordinates:ja(n.coordinates,f)},l=new no,a=l.read(u),c=Xn(sn(t,e),"meters"),p=Ut.bufferOp(a,c,r),d=new ea;if(p=d.write(p),!Ka(p.coordinates)){var h={type:p.type,coordinates:Ja(p.coordinates,f)};return pr(h,i)}}function Ka(s){return Array.isArray(s[0])?Ka(s[0]):isNaN(s[0])}function ja(s,t){return typeof s[0]!="object"?t(s):s.map(function(e){return ja(e,t)})}function Ja(s,t){return typeof s[0]!="object"?t.invert(s):s.map(function(e){return Ja(e,t)})}function Tu(s){var t=Wf(s).geometry.coordinates,e=[-t[0],-t[1]];return Wu().rotate(e).scale(me)}class Lu{constructor(){T(this,"LineID","myEntity1");T(this,"Tag","");T(this,"towers",[]);T(this,"ISPhaseSequence",!1);T(this,"Wairnum",0);T(this,"Type",0);T(this,"corridor_features",[]);T(this,"wireAColor","#FFFFFF");T(this,"wireBColor","#FFFFFF");T(this,"wireCColor","#FFFFFF");T(this,"wireTColor","#FFFFFF");T(this,"wireD1Color","#FFFFFF");T(this,"wireD2Color","#FFFFFF");T(this,"wireWidth",1);T(this,"LineDistanceDisplaymin",0);T(this,"LineDistanceDisplaymax",5e3)}}class Au{constructor(){T(this,"id","");T(this,"type",0);T(this,"modelid","");T(this,"lon",0);T(this,"lat",0);T(this,"alt",0);T(this,"modelH",0);T(this,"modelurl","");T(this,"modelScale",1);T(this,"modelbox","")}}var Qa=(s=>(s[s.树木=0]="树木",s[s.房屋=1]="房屋",s[s.高速公路=2]="高速公路",s[s.电力线=3]="电力线",s))(Qa||{});class wu{constructor(){T(this,"id","");T(this,"name","");T(this,"type",0);T(this,"Longitude",0);T(this,"Latitude",0);T(this,"Altitude",0);T(this,"RollX",0);T(this,"RollY",90);T(this,"RollZ",0);T(this,"towerScale",1);T(this,"towerHeight",0);T(this,"towerModelUri","");T(this,"towerPoint",[]);T(this,"Insulators",[]);T(this,"DistanceDisplaymin",0);T(this,"DistanceDisplaymax",1e3)}}class Eu{constructor(){T(this,"treeId",0);T(this,"treeCoordinates",[0,0,0]);T(this,"conductorCoordinates",[0,0,0]);T(this,"horizontalDistance",0);T(this,"verticalDistance",0);T(this,"straightLineDistance",0);T(this,"clearanceDistance",0);T(this,"timestamp",0)}}class Pu{constructor(){T(this,"id","");T(this,"name","");T(this,"type",0);T(this,"WairFX","进");T(this,"linenum",1);T(this,"Wairnum",0);T(this,"PhaseSequence",0);T(this,"RollX",0);T(this,"RollY",0);T(this,"RollZ",0);T(this,"InsulatorScale",1);T(this,"InsulatorLength",0);T(this,"InsulatorModelUri","");T(this,"InsulatorPoint",[]);T(this,"DistanceDisplaymin",0);T(this,"DistanceDisplaymax",500)}}class Su{constructor(){T(this,"name","");T(this,"X",-45);T(this,"Y",90);T(this,"Z",0)}}var Ie=(s=>(s[s.A相=0]="A相",s[s.B相=1]="B相",s[s.C相=2]="C相",s[s.地线1=3]="地线1",s[s.地线2=4]="地线2",s))(Ie||{}),_i=(s=>(s[s.直线塔=0]="直线塔",s[s.耐张塔=1]="耐张塔",s[s.门架塔=2]="门架塔",s[s.换位塔=3]="换位塔",s))(_i||{}),$a=(s=>(s[s.交流单回路=0]="交流单回路",s[s.交流双回路=1]="交流双回路",s[s.直流单回路=2]="直流单回路",s[s.直流双回路=3]="直流双回路",s[s.交流四回路=4]="交流四回路",s))($a||{}),$s=(s=>(s[s.地线=0]="地线",s[s.回路一=1]="回路一",s[s.回路二=2]="回路二",s[s.回路三=3]="回路三",s[s.回路四=4]="回路四",s))($s||{}),jt=(s=>(s[s.悬垂串=0]="悬垂串",s[s.耐张串=1]="耐张串",s[s.跳线串=2]="跳线串",s[s.硬跳串=3]="硬跳串",s[s.V串=4]="V串",s[s.地线串=5]="地线串",s[s.绕跳临时=6]="绕跳临时",s))(jt||{}),E=(s=>(s[s.单分裂=0]="单分裂",s[s.双分裂=1]="双分裂",s[s.四分裂=2]="四分裂",s[s.六分裂=3]="六分裂",s[s.八分裂=4]="八分裂",s))(E||{}),$=(s=>(s[s.直线距离=0]="直线距离",s[s.水平距离=1]="水平距离",s[s.垂直距离=2]="垂直距离",s[s.净空距离=3]="净空距离",s[s.安全距离=4]="安全距离",s[s.全部测量=5]="全部测量",s))($||{});class tf{constructor(){T(this,"horizontalLevels");T(this,"verticalLevels");T(this,"straightLineLevels");T(this,"clearanceLevels")}}const $e={units:"kilometers"};function Fn(s,t,e,r){const i=To(s,t),n=To(s,e),o=To(s,r),f=Math.min(i,n,o);return f===i?t:f===n?e:r}function To(s,t){if(!t||t.length===0)return console.log("fastPointToLineDistance: line is empty or null"),1/0;let e=1/0;for(let i=0;i<t.length;i++){const n=t[i],o=s[0]-n[0],f=s[1]-n[1],u=o*o+f*f;u<e&&(e=u)}const r=Math.sqrt(e);return console.log(`fastPointToLineDistance result: ${r}`),r}const Nu={horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}]},Sr=(s,t,e,r=Nu,i=$.全部测量)=>{const n=De(s.slice(0,2)),{nearestCoord:o}=ef(s,t),f=t.findIndex(lt=>lt[0]==o[0]&&lt[1]==o[1]);let u=[];if(f==0)u.push(t[0],t[1]);else if(f==t.length-1)u.push(t[t.length-2],t[t.length-1]);else{const lt=[t[f],t[f+1]],_t=[t[f-1],t[f]];var l=br(n,he(lt),$e),a=br(n,he(_t),$e);u=l>a?_t:lt}console.log("附近的点",f,u);const c=he([u[0].slice(0,2),u[1].slice(0,2)]),p=De(u[0].slice(0,2)),d=De(u[1].slice(0,2));var h=br(n,c,$e),m=Qi(n,p,$e)||0,_=Math.sqrt(m*m-h*h)||0;let W=u[0].slice(0,2);_>0&&(W=Xo(c,0,_,$e).geometry.coordinates[1]);const C=Qi(p,d,$e),I=Math.abs(u[0][2]-u[1][2]),L=Math.min(u[0][2],u[1][2]),w=Math.max(u[0][2],u[1][2]),N=u[0][2]>u[1][2]?w-_/C*I:_/C*I+L;console.log("高度差>>>>",I),console.log("最小高度>>>>",L),console.log("最大高度>>>>",w);const D=N-s[2],B=h*1e3,M=Math.sqrt(B*B+D*D);console.log("水平距离>>>>",B),console.log("竖直距离>>>>",D),console.log("直线距离>>>>",M);let O="#eff819",R=g.Color.RED;const H=g.Cartesian3.fromDegrees(s[0],s[1],s[2]),j=g.Cartesian3.fromDegrees(W[0],W[1],s[2]),F=g.Cartesian3.fromDegrees(W[0],W[1],N);console.log(`坐标详情: 树木=[${s[0]}, ${s[1]}, ${s[2]}], 导线点=[${W[0]}, ${W[1]}, ${N}]`);var G=Cf(De([s[0],s[1]]),De([W[0],W[1]])).geometry.coordinates;const Z=g.Cartesian3.fromDegrees(G[0],G[1],s[2]),it=g.Cartesian3.fromDegrees(G[0],G[1],N-D/2),ut=g.Cartesian3.fromDegrees(W[0],W[1],N-D/2);if(r!==null){let lt;if((i==$.水平距离||i==$.全部测量)&&(r.horizontalLevels&&(lt=r.horizontalLevels.find(_t=>B>=_t.minDistance&&B<=_t.maxDistance)),lt)){O=lt.color,R=g.Color.fromCssColorString(lt.color);const _t={position:Z,name:"水平距离",label:{text:`水平距离${B.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(O),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},wt=[];wt.push(H),wt.push(j);var ht={polyline:{show:!0,positions:wt,clampToGround:!1,width:2,material:R,shadows:g.ShadowMode.DISABLED}};if(e.add(_t),e.add(ht),i==$.水平距离)return}if((i==$.垂直距离||i==$.全部测量)&&(r.verticalLevels&&(lt=r.verticalLevels.find(_t=>D>=_t.minDistance&&D<=_t.maxDistance)),lt)){O=lt.color,R=g.Color.fromCssColorString(lt.color);const _t={position:ut,name:"垂直距离",label:{text:`垂直距离${D.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(O),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},wt=[];wt.push(j),wt.push(F);var ti={polyline:{show:!0,positions:wt,clampToGround:!1,width:2,material:R,shadows:g.ShadowMode.DISABLED}};if(e.add(_t),e.add(ti),i==$.垂直距离)return}if(i==$.净空距离||i==$.全部测量){let _t=!1;if(r.clearanceLevels&&(lt=r.clearanceLevels.find(wt=>D>=wt.minDistance&&D<=wt.maxDistance)),!lt&&i==$.全部测量?(_t=!0,O="#00ff00",R=g.Color.GREEN):lt&&(O=lt.color,R=g.Color.fromCssColorString(lt.color)),lt||_t){const wt={position:ut,name:"净空距离",label:{text:`净空距离${D.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(O),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},Es=[];Es.push(j),Es.push(F);var Ge={polyline:{show:!0,positions:Es,clampToGround:!1,width:2,material:R,shadows:g.ShadowMode.DISABLED}};if(e.add(wt),e.add(Ge),i==$.净空距离)return}}if((i==$.直线距离||i==$.全部测量)&&(r.straightLineLevels&&(lt=r.straightLineLevels.find(_t=>M>=_t.minDistance&&M<=_t.maxDistance)),lt)){O=lt.color,R=g.Color.fromCssColorString(lt.color);const _t={position:it,name:"直线距离",label:{text:`直线距离${M.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(O),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},wt=[];wt.push(H),wt.push(F);var Ci={polyline:{show:!0,positions:wt,clampToGround:!1,width:2,material:R,shadows:g.ShadowMode.DISABLED}};if(e.add(_t),e.add(Ci),i==$.直线距离)return}}console.log(`已添加测量结果: 距离=${M.toFixed(1)}m, 颜色=${O}, 实体数量=${e.values.length}`)},xn=(s,t,e)=>{const r=De(s.slice(0,2)),{nearestCoord:i}=ef(s,t),n=t.findIndex(O=>O[0]==i[0]&&O[1]==i[1]);let o=[];if(n==0)o.push(t[0],t[1]);else if(n==t.length-1)o.push(t[t.length-2],t[t.length-1]);else{const O=[t[n],t[n+1]],R=[t[n-1],t[n]];var f=br(r,he(O),$e),u=br(r,he(R),$e);o=f>u?R:O}const l=he([o[0].slice(0,2),o[1].slice(0,2)]),a=De(o[0].slice(0,2)),c=De(o[1].slice(0,2));var p=br(r,l,$e),d=Qi(r,a,$e)||0,h=Math.sqrt(d*d-p*p)||0;let m=o[0].slice(0,2);h>0&&(m=Xo(l,0,h,$e).geometry.coordinates[1]);const _=Qi(a,c,$e),W=Math.abs(o[0][2]-o[1][2]),C=Math.min(o[0][2],o[1][2]),I=Math.max(o[0][2],o[1][2]),L=o[0][2]>o[1][2]?I-h/_*W:h/_*W+C,w=L-s[2],N=p*1e3,D=Math.sqrt(N*N+w*w),B=parseFloat(L.toFixed(1));return{treeId:e,treeCoordinates:[s[0],s[1],s[2]],conductorCoordinates:[m[0],m[1],L],horizontalDistance:parseFloat(N.toFixed(1)),verticalDistance:parseFloat(w.toFixed(1)),straightLineDistance:parseFloat(D.toFixed(1)),clearanceDistance:B,timestamp:Date.now()}};function ef(s,t){const e=De(s.slice(0,2)),r=[];t.forEach(f=>{r.push(De([f[0],f[1]]))});const i=rn(r),n=If(e,i),o=Qi(e,n,$e);return{nearestCoord:n.geometry.coordinates,nearestDistance:o}}function b(s,t,e,r,i){e||(e=new g.HeadingPitchRoll);const n=g.Transforms.headingPitchRollQuaternion(s,e,r,i),o=g.Matrix4.fromRotationTranslation(g.Matrix3.fromQuaternion(n,new g.Matrix3),s,new g.Matrix4);return g.Matrix4.multiplyByPoint(o,t,new g.Cartesian3)}function be(s,t){var e=s.cartesianToCartographic(t),r=g.Math.toDegrees(e.latitude),i=g.Math.toDegrees(e.longitude),n=e.height;return[i,r,n]}function lr(s,t,e,r){const i=t*Math.PI/180,n=s*Math.PI/180,o=r*Math.PI/180,f=e*Math.PI/180,u=Math.sin(f-n)*Math.cos(o),l=Math.cos(i)*Math.sin(o)-Math.sin(i)*Math.cos(o)*Math.cos(f-n);let a=Math.atan2(u,l)*180/Math.PI;return a=(a+360)%360,a}function v(s,t=6){const e=[];for(var r=0;r<s.length-1;r++)e.push(...bu(s[r],s[r+1],t*-1e3,100));return e}function bu(s,t,e,r){var i=[],n=g.Cartographic.fromCartesian(s),o=g.Cartographic.fromCartesian(t),f=n.longitude*180/Math.PI,u=n.latitude*180/Math.PI,l=o.longitude*180/Math.PI,a=o.latitude*180/Math.PI,c=Math.sqrt((f-l)*(f-l)+(u-a)*(u-a)),p=c*e,d=g.Cartesian3.clone(s),h=g.Cartesian3.clone(t),m=g.Cartesian3.distance(d,g.Cartesian3.ZERO),_=g.Cartesian3.distance(h,g.Cartesian3.ZERO);if(g.Cartesian3.normalize(d,d),g.Cartesian3.normalize(h,h),g.Cartesian3.distance(d,h)==0)return i;var W=g.Cartesian3.angleBetween(d,h);i.push(s);for(var C=1;C<r-1;C++){var I=C*1/(r-1),L=1-I,w=Math.sin(L*W)/Math.sin(W),N=Math.sin(I*W)/Math.sin(W),D=g.Cartesian3.multiplyByScalar(d,w,new g.Cartesian3),B=g.Cartesian3.multiplyByScalar(h,N,new g.Cartesian3),M=g.Cartesian3.add(D,B,new g.Cartesian3),O=I*Math.PI,R=m*L+_*I+Math.sin(O)*p;M=g.Cartesian3.multiplyByScalar(M,R,M),i.push(M)}return i.push(t),i}function Du(s,t,e=30){const r=s.length;if(r<=2||t===0||t===r-1)return!1;const i=lr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let o=lr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude)-i;return o>180&&(o-=360),o<-180&&(o+=360),Math.abs(o)>=e}function Lo(s,t,e=2){const r=s.length;if(r<=1)return 0;if(Du(s,t,15))return t<r-1?lr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude):lr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let i=Math.max(0,t-e),n=Math.min(r-1,t+e);if(n-i<1)return t===r-1?lr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude):lr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude);const o=[];for(let a=i;a<n;a++){const c=lr(s[a].Longitude,s[a].Latitude,s[a+1].Longitude,s[a+1].Latitude);o.push(c)}if(o.length===1)return o[0];let f=0,u=0;for(const a of o){const c=a*Math.PI/180;f+=Math.cos(c),u+=Math.sin(c)}return(Math.atan2(u,f)*180/Math.PI+360)%360}function Mu(s,t){const e=s*Math.PI/180,r=t*Math.PI/180,i=Math.cos(e),n=Math.sin(e),o=Math.cos(r),f=Math.sin(r),u=i+o,l=n+f;if(Math.abs(u)<1e-10&&Math.abs(l)<1e-10)return(s+90)%360;let a=Math.atan2(l,u)*180/Math.PI;return a=(a+360)%360,a}function Ru(s,t,e){if(!t||t.length<2)return!1;const r=De(s),i=he(t),n=br(r,i,{units:"meters"});return console.log(`isPointInCorridor: point=[${s[0]}, ${s[1]}], distance=${n}, threshold=${e}`),n<=e}function Bu(s,t,e=2e3){if(!s||!t||t.length<2)return console.log("filterTreesInCorridor: invalid input parameters"),[];console.log(`filterTreesInCorridor: processing ${s.length} trees, ${t.length} towers, width=${e}`);const r=t.map(n=>[n.Longitude,n.Latitude]);console.log(`filterTreesInCorridor: line points extracted, first point: [${r[0][0]}, ${r[0][1]}]`);const i=s.filter(n=>{if(n.lon===void 0||n.lat===void 0)return console.warn("filterTreesInCorridor: tree missing lon/lat properties",n),!1;const o=[n.lon,n.lat],f=Ru(o,r,e);return s.indexOf(n)<5&&console.log(`Tree ${s.indexOf(n)}: [${o[0]}, ${o[1]}], inCorridor: ${f}`),f});return console.log(`filterTreesInCorridor: found ${i.length} trees in corridor`),i}function Ou(s,t=2e3){if(!s||s.length<2)return[];const e=s.map(i=>[i.Longitude,i.Latitude]),r=he(e);try{const i=Iu(r,t/1e3,{units:"kilometers"});if(i.geometry.type==="Polygon"){let n=i.geometry.coordinates[0].map(o=>[o[0],o[1]]);return n.length>=3&&rf(n)<0&&(n=n.reverse()),n}else if(i.geometry.type==="MultiPolygon"){let n=i.geometry.coordinates[0][0].map(o=>[o[0],o[1]]);return n.length>=3&&rf(n)<0&&(n=n.reverse()),n}return[]}catch{return[]}}function rf(s){if(s.length<3)return 0;let t=0;const e=s.length;for(let r=0;r<e;r++){const i=(r+1)%e;t+=s[r][0]*s[i][1],t-=s[i][0]*s[r][1]}return t/2}class Fu{constructor(t,e,r){T(this,"viewer");T(this,"LineInfo");T(this,"Keym","");T(this,"dataSource2");T(this,"entityCollection2");T(this,"offsetTowers",[]);T(this,"autoCalculateRollX",!0);T(this,"towerWirePoints",new Map);T(this,"loadedWireSegments",new Set);T(this,"loadedTowerIndices",new Set);T(this,"isDynamicLoadingEnabled",!0);T(this,"isLineModelRemoved",!1);T(this,"cameraMoveHandler",null);T(this,"offsetWires11",[]);T(this,"offsetWires12",[]);T(this,"offsetWires13",[]);T(this,"offsetWires21",[]);T(this,"offsetWires22",[]);T(this,"offsetWires23",[]);T(this,"ToffsetArcWires1A",[]);T(this,"ToffsetArcWires2A",[]);T(this,"ToffsetWires1A1",[]);T(this,"ToffsetWires1A2",[]);T(this,"ToffsetArcWires1B",[]);T(this,"ToffsetArcWires2B",[]);T(this,"ToffsetWires1B1",[]);T(this,"ToffsetWires1B2",[]);T(this,"ToffsetArcWires1C",[]);T(this,"ToffsetArcWires2C",[]);T(this,"ToffsetWires1C1",[]);T(this,"ToffsetWires1C2",[]);T(this,"ToffsetArcWires1A2",[]);T(this,"ToffsetArcWires2A2",[]);T(this,"ToffsetWires2A1",[]);T(this,"ToffsetWires2A2",[]);T(this,"ToffsetArcWires1B2",[]);T(this,"ToffsetArcWires2B2",[]);T(this,"ToffsetWires2B1",[]);T(this,"ToffsetWires2B2",[]);T(this,"ToffsetArcWires1C2",[]);T(this,"ToffsetArcWires2C2",[]);T(this,"ToffsetWires2C1",[]);T(this,"ToffsetWires2C2",[]);T(this,"offsetArcWires1A",[]);T(this,"offsetArcWires1B",[]);T(this,"offsetArcWires1C",[]);T(this,"offsetArcWires2A",[]);T(this,"offsetArcWires2B",[]);T(this,"offsetArcWires2C",[]);T(this,"offsetGrouundWires1",[]);T(this,"offsetGrouundWires2",[]);T(this,"offsetGrouundWires11",[]);T(this,"offsetGrouundWires12",[]);T(this,"arcLine1A1",[]);T(this,"arcLine1B1",[]);T(this,"arcLine1C1",[]);T(this,"LinedataSource2");T(this,"LineentityCollection2");T(this,"modelCache",new Map);this.Keym=r,this.viewer=t,this.LineInfo=e,this.dataSource2=new g.CustomDataSource(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new g.CustomDataSource(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.LinedataSource2.entities}createModelCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i}`}getCachedModelConfig(t,e,r,i){const n=Math.max(0,r),o=Math.min(i,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}addModelToCollection(t,e,r,i,n,o,f){const u=this.getCachedModelConfig(i,o,f[0],f[1]);this.entityCollection2.add(Gn(t,e,r,u.uri,n,u.scale,u.distanceDisplayCondition))}setAutoCalculateRollX(t){this.autoCalculateRollX=t}getAutoCalculateRollX(){return this.autoCalculateRollX}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}setupCameraMoveListener(){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleTowers()})}getVisibleTowerIndices(){var u;if(!this.viewer.camera||this.offsetTowers.length===0)return{start:0,end:0};const t=this.viewer.camera.position,e=((u=this.viewer.camera.positionCartographic)==null?void 0:u.height)||1e3;let r=5;e>5e4?r=2:e>1e4?r=3:e>5e3?r=5:r=10;let i=0,n=Number.MAX_VALUE;for(let l=0;l<this.offsetTowers.length;l++){const a=g.Cartesian3.distance(t,this.offsetTowers[l]);a<n&&(n=a,i=l)}const o=Math.max(0,i-r),f=Math.min(this.offsetTowers.length-1,i+r);return{start:o,end:f}}updateVisibleTowers(){const{start:t,end:e}=this.getVisibleTowerIndices();this.isLineModelRemoved||this.loadTowersInRange(t,e)}initializeLineData(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(g.Cartesian3.fromDegrees(t.Longitude,t.Latitude,t.Altitude))}),this.autoCalculateRollX&&this.calculateTowerOrientations())}calculateTowerOrientations(){const t=this.LineInfo.towers.length;if(t!==0){if(t===1){this.LineInfo.towers[0].RollX===void 0&&(this.LineInfo.towers[0].RollX=90);return}for(let e=0;e<t;e++){let r=0;if(this.LineInfo.towers[e].type===_i.耐张塔)if(e===0)r=(Lo(this.LineInfo.towers,e,3)-90+360)%360;else if(e===t-1)r=(Lo(this.LineInfo.towers,e,3)-90+360)%360;else{const i=this.LineInfo.towers[e-1],n=this.LineInfo.towers[e],o=this.LineInfo.towers[e+1],f=lr(i.Longitude,i.Latitude,n.Longitude,n.Latitude),u=lr(n.Longitude,n.Latitude,o.Longitude,o.Latitude);r=(Mu(f,u)-90+360)%360}else r=(Lo(this.LineInfo.towers,e,2)-90+360)%360;this.LineInfo.towers[e].RollX=r}}}loadTowersInRange(t,e){if(t<0||e>=this.LineInfo.towers.length)return;const r=Math.max(0,t-1),i=Math.min(this.LineInfo.towers.length-1,e+1);for(let n=r;n<=i;n++)this.loadedTowerIndices.has(n)||(this.loadTowerAndCollectWirePoints(n),this.loadedTowerIndices.add(n));for(let n=r;n<i;n++){const o=`${n}-${n+1}`;this.loadedWireSegments.has(o)||(this.loadWireSegmentBetweenTowers(n,n+1),this.loadedWireSegments.add(o))}}loadTowerAndCollectWirePoints(t){const e=this.offsetTowers[t],r=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),g.Math.toRadians(this.LineInfo.towers[t].RollY),g.Math.toRadians(this.LineInfo.towers[t].RollZ));this.addModelToCollection(this.LineInfo.towers[t].id,e,this.LineInfo.towers[t].name,this.LineInfo.towers[t].towerModelUri,r,this.LineInfo.towers[t].towerScale,[this.LineInfo.towers[t].DistanceDisplaymin,this.LineInfo.towers[t].DistanceDisplaymax]);const i=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0),n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0);let o=0;const f=[];this.LineInfo.towers[t].Insulators.forEach(u=>{const l=b(e,new g.Cartesian3(this.LineInfo.towers[t].towerPoint[o].X,this.LineInfo.towers[t].towerPoint[o].Y,this.LineInfo.towers[t].towerPoint[o].Z),this.LineInfo.towers[t].type===_i.耐张塔?n:i);let a,c;if(this.autoCalculateRollX?c=this.LineInfo.towers[t].RollX:c=u.RollX,this.LineInfo.towers[t].type===_i.耐张塔)switch(u.type){case jt.耐张串:a=u.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(0),g.Math.toRadians(0));break;case jt.跳线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;case jt.地线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;default:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ))}else a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));this.addModelToCollection(u.id,l,u.name,u.InsulatorModelUri,a,u.InsulatorScale,[u.DistanceDisplaymin,u.DistanceDisplaymax]);const p={insulator:u,insulatorIndex:o,position:e,lineroll:i,WairPoint:[]};u.InsulatorPoint.forEach(d=>{d.Y=d.Y+this.LineInfo.towers[t].towerPoint[o].Y,d.Z=d.Z+this.LineInfo.towers[t].towerPoint[o].Z,p.WairPoint.push(b(e,new g.Cartesian3(d.X,d.Y,d.Z),i))}),f.push(p),o++}),this.towerWirePoints.set(t,f)}loadWireSegmentBetweenTowers(t,e){const r=this.towerWirePoints.get(t),i=this.towerWirePoints.get(e);!r||!i||(this.resetWireArraysForTwoTowers(),console.log(`加载导线段: ${t}-${e}`))}resetWireArraysForTwoTowers(){this.offsetWires11=[],this.offsetWires12=[],this.offsetWires13=[],this.offsetWires21=[],this.offsetWires22=[],this.offsetWires23=[],this.ToffsetWires1A1=[],this.ToffsetWires1A2=[]}getLineDataSources(){return[this.dataSource2,this.LinedataSource2]}removeLineModels(){this.isLineModelRemoved=!0,this.entityCollection2.removeAll(),this.LineentityCollection2.removeAll(),this.loadedTowerIndices.clear(),this.loadedWireSegments.clear()}restoreLineModels(){this.isLineModelRemoved=!1,this.isDynamicLoadingEnabled?(this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllTowersAtOnce(){let t=0,e=0;this.offsetTowers.forEach((r,i)=>{const n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),g.Math.toRadians(this.LineInfo.towers[i].RollY),g.Math.toRadians(this.LineInfo.towers[i].RollZ));this.addModelToCollection(this.LineInfo.towers[i].id,r,this.LineInfo.towers[i].name,this.LineInfo.towers[i].towerModelUri,n,this.LineInfo.towers[i].towerScale,[this.LineInfo.towers[i].DistanceDisplaymin,this.LineInfo.towers[i].DistanceDisplaymax]);const o=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),0,0),f=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),0,0);let u=0;if(this.LineInfo.towers[i].Insulators.forEach(a=>{const c=b(r,new g.Cartesian3(this.LineInfo.towers[i].towerPoint[u].X,this.LineInfo.towers[i].towerPoint[u].Y,this.LineInfo.towers[i].towerPoint[u].Z),this.LineInfo.towers[i].type===_i.耐张塔?f:o);let p,d;if(this.autoCalculateRollX?d=this.LineInfo.towers[i].RollX:d=a.RollX,this.LineInfo.towers[i].type===_i.耐张塔)switch(a.type){case jt.耐张串:p=a.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(0),g.Math.toRadians(0));break;case jt.跳线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;case jt.地线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;default:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ))}else p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));this.addModelToCollection(a.id,c,a.name,a.InsulatorModelUri,p,a.InsulatorScale,[a.DistanceDisplaymin,a.DistanceDisplaymax]);const h=[];switch(a.InsulatorPoint.forEach(m=>{m.Y=m.Y+this.LineInfo.towers[i].towerPoint[u].Y,m.Z=m.Z+this.LineInfo.towers[i].towerPoint[u].Z,h.push(b(r,new g.Cartesian3(m.X,m.Y,m.Z),o))}),a.linenum){case $s.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==_i.耐张塔)switch(a.PhaseSequence){case Ie.A相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case E.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break;case E.四分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]);break;case E.六分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]);break;case E.八分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.offsetWires11.push(h[6]),this.offsetWires11.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]),this.ToffsetWires1A1.push(h[12]),this.ToffsetWires1A1.push(h[13]),this.ToffsetWires1A1.push(h[14]),this.ToffsetWires1A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(m),this.ToffsetWires1A2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(_),this.offsetWires11.push(W),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires11.push(C),this.offsetWires11.push(I),this.offsetWires11.push(L),this.offsetWires11.push(w),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(I),this.ToffsetWires1A2.push(L),this.ToffsetWires1A2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires11.push(N),this.offsetWires11.push(D),this.offsetWires11.push(B),this.offsetWires11.push(M),this.offsetWires11.push(O),this.offsetWires11.push(R),this.ToffsetWires1A2.push(N),this.ToffsetWires1A2.push(D),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(M),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires11.push(H),this.offsetWires11.push(j),this.offsetWires11.push(F),this.offsetWires11.push(G),this.offsetWires11.push(Z),this.offsetWires11.push(it),this.offsetWires11.push(ut),this.offsetWires11.push(ht),this.ToffsetWires1A2.push(H),this.ToffsetWires1A2.push(j),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(G),this.ToffsetWires1A2.push(Z),this.ToffsetWires1A2.push(it),this.ToffsetWires1A2.push(ut),this.ToffsetWires1A2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[1]);break;case E.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break;case E.四分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A2.push(h[4]),this.ToffsetWires1A2.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]);break;case E.六分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]);break;case E.八分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]),this.ToffsetWires1A2.push(h[12]),this.ToffsetWires1A2.push(h[13]),this.ToffsetWires1A2.push(h[14]),this.ToffsetWires1A2.push(h[15]);break}break;case Ie.B相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires12.push(h[0]),this.ToffsetWires1B1.push(h[1]);break;case E.双分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]);break;case E.四分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]);break;case E.六分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]);break;case E.八分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.offsetWires12.push(h[6]),this.offsetWires12.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]),this.ToffsetWires1B1.push(h[12]),this.ToffsetWires1B1.push(h[13]),this.ToffsetWires1B1.push(h[14]),this.ToffsetWires1B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires12.push(m),this.ToffsetWires1B2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires12.push(_),this.offsetWires12.push(W),this.ToffsetWires1B2.push(_),this.ToffsetWires1B2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires12.push(C),this.offsetWires12.push(I),this.offsetWires12.push(L),this.offsetWires12.push(w),this.ToffsetWires1B2.push(C),this.ToffsetWires1B2.push(I),this.ToffsetWires1B2.push(L),this.ToffsetWires1B2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires12.push(N),this.offsetWires12.push(D),this.offsetWires12.push(B),this.offsetWires12.push(M),this.offsetWires12.push(O),this.offsetWires12.push(R),this.ToffsetWires1B2.push(N),this.ToffsetWires1B2.push(D),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(M),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires12.push(H),this.offsetWires12.push(j),this.offsetWires12.push(F),this.offsetWires12.push(G),this.offsetWires12.push(Z),this.offsetWires12.push(it),this.offsetWires12.push(ut),this.offsetWires12.push(ht),this.ToffsetWires1B2.push(H),this.ToffsetWires1B2.push(j),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(G),this.ToffsetWires1B2.push(Z),this.ToffsetWires1B2.push(it),this.ToffsetWires1B2.push(ut),this.ToffsetWires1B2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B2.push(h[0]);break;case E.双分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B2.push(h[2]),this.ToffsetWires1B2.push(h[3]);break;case E.四分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B2.push(h[4]),this.ToffsetWires1B2.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]);break;case E.六分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]);break;case E.八分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]),this.ToffsetWires1B2.push(h[12]),this.ToffsetWires1B2.push(h[13]),this.ToffsetWires1B2.push(h[14]),this.ToffsetWires1B2.push(h[15]);break}break;case Ie.C相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires13.push(h[0]),this.ToffsetWires1C1.push(h[1]);break;case E.双分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]);break;case E.四分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]);break;case E.六分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]);break;case E.八分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.offsetWires13.push(h[6]),this.offsetWires13.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]),this.ToffsetWires1C1.push(h[12]),this.ToffsetWires1C1.push(h[13]),this.ToffsetWires1C1.push(h[14]),this.ToffsetWires1C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires13.push(m),this.ToffsetWires1C2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires13.push(_),this.offsetWires13.push(W),this.ToffsetWires1C2.push(_),this.ToffsetWires1C2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires13.push(C),this.offsetWires13.push(I),this.offsetWires13.push(L),this.offsetWires13.push(w),this.ToffsetWires1C2.push(C),this.ToffsetWires1C2.push(I),this.ToffsetWires1C2.push(L),this.ToffsetWires1C2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires13.push(N),this.offsetWires13.push(D),this.offsetWires13.push(B),this.offsetWires13.push(M),this.offsetWires13.push(O),this.offsetWires13.push(R),this.ToffsetWires1C2.push(N),this.ToffsetWires1C2.push(D),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(M),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires13.push(H),this.offsetWires13.push(j),this.offsetWires13.push(F),this.offsetWires13.push(G),this.offsetWires13.push(Z),this.offsetWires13.push(it),this.offsetWires13.push(ut),this.offsetWires13.push(ht),this.ToffsetWires1C2.push(H),this.ToffsetWires1C2.push(j),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(G),this.ToffsetWires1C2.push(Z),this.ToffsetWires1C2.push(it),this.ToffsetWires1C2.push(ut),this.ToffsetWires1C2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C2.push(h[0]);break;case E.双分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C2.push(h[2]),this.ToffsetWires1C2.push(h[3]);break;case E.四分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C2.push(h[4]),this.ToffsetWires1C2.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]);break;case E.六分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]);break;case E.八分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]),this.ToffsetWires1C2.push(h[12]),this.ToffsetWires1C2.push(h[13]),this.ToffsetWires1C2.push(h[14]),this.ToffsetWires1C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Ie.A相:h.forEach(m=>{this.offsetWires11.push(m)});break;case Ie.B相:h.forEach(m=>{this.offsetWires12.push(m)});break;case Ie.C相:h.forEach(m=>{this.offsetWires13.push(m)});break}else if(this.LineInfo.towers[i].type==_i.耐张塔)switch(u){case 2:switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case E.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case E.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(m),this.ToffsetWires1A2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(_),this.offsetWires11.push(W),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(W);break}break;case 5:h.forEach(m=>{this.offsetWires12.push(m),this.ToffsetWires1B1.push(m)});break;case 6:h.forEach(m=>{this.ToffsetWires1B1.push(m),this.ToffsetWires1B2.push(m)});break;case 7:a.InsulatorPoint.forEach(m=>{const _=b(r,new g.Cartesian3(m.X*-1,m.Y,m.Z),o);this.offsetWires12.push(_),this.ToffsetWires1B2.push(_)});break;case 8:h.forEach(m=>{this.offsetWires13.push(m),this.ToffsetWires1C1.push(m)});break;case 9:h.forEach(m=>{this.ToffsetWires1C1.push(m),this.ToffsetWires1C2.push(m)});break;case 10:a.InsulatorPoint.forEach(m=>{const _=b(r,new g.Cartesian3(m.X*-1,m.Y,m.Z),o);this.offsetWires13.push(_),this.ToffsetWires1C2.push(_)});break}else switch(u){case 2:h.forEach(m=>{this.offsetWires11.push(m)});break;case 3:h.forEach(m=>{this.offsetWires12.push(m)});break;case 4:h.forEach(m=>{this.offsetWires13.push(m)});break}break;case $s.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==_i.耐张塔)switch(a.PhaseSequence){case Ie.A相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case E.双分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]);break;case E.四分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]);break;case E.六分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]);break;case E.八分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.offsetWires21.push(h[6]),this.offsetWires21.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]),this.ToffsetWires2A1.push(h[12]),this.ToffsetWires2A1.push(h[13]),this.ToffsetWires2A1.push(h[14]),this.ToffsetWires2A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(m),this.ToffsetWires2A2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires21.push(_),this.offsetWires21.push(W),this.ToffsetWires2A2.push(_),this.ToffsetWires2A2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires21.push(C),this.offsetWires21.push(I),this.offsetWires21.push(L),this.offsetWires21.push(w),this.ToffsetWires2A2.push(C),this.ToffsetWires2A2.push(I),this.ToffsetWires2A2.push(L),this.ToffsetWires2A2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires21.push(N),this.offsetWires21.push(D),this.offsetWires21.push(B),this.offsetWires21.push(M),this.offsetWires21.push(O),this.offsetWires21.push(R),this.ToffsetWires2A2.push(N),this.ToffsetWires2A2.push(D),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(M),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires21.push(H),this.offsetWires21.push(j),this.offsetWires21.push(F),this.offsetWires21.push(G),this.offsetWires21.push(Z),this.offsetWires21.push(it),this.offsetWires21.push(ut),this.offsetWires21.push(ht),this.ToffsetWires2A2.push(H),this.ToffsetWires2A2.push(j),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(G),this.ToffsetWires2A2.push(Z),this.ToffsetWires2A2.push(it),this.ToffsetWires2A2.push(ut),this.ToffsetWires2A2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case E.双分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A2.push(h[2]),this.ToffsetWires2A2.push(h[3]);break;case E.四分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A2.push(h[4]),this.ToffsetWires2A2.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]);break;case E.六分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]);break;case E.八分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]),this.ToffsetWires2A2.push(h[12]),this.ToffsetWires2A2.push(h[13]),this.ToffsetWires2A2.push(h[14]),this.ToffsetWires2A2.push(h[15]);break}break;case Ie.B相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case E.双分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]);break;case E.四分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]);break;case E.六分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]);break;case E.八分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.offsetWires22.push(h[6]),this.offsetWires22.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]),this.ToffsetWires2B1.push(h[12]),this.ToffsetWires2B1.push(h[13]),this.ToffsetWires2B1.push(h[14]),this.ToffsetWires2B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(m),this.ToffsetWires2B2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires22.push(_),this.offsetWires22.push(W),this.ToffsetWires2B2.push(_),this.ToffsetWires2B2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires22.push(C),this.offsetWires22.push(I),this.offsetWires22.push(L),this.offsetWires22.push(w),this.ToffsetWires2B2.push(C),this.ToffsetWires2B2.push(I),this.ToffsetWires2B2.push(L),this.ToffsetWires2B2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires22.push(N),this.offsetWires22.push(D),this.offsetWires22.push(B),this.offsetWires22.push(M),this.offsetWires22.push(O),this.offsetWires22.push(R),this.ToffsetWires2B2.push(N),this.ToffsetWires2B2.push(D),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(M),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires22.push(H),this.offsetWires22.push(j),this.offsetWires22.push(F),this.offsetWires22.push(G),this.offsetWires22.push(Z),this.offsetWires22.push(it),this.offsetWires22.push(ut),this.offsetWires22.push(ht),this.ToffsetWires2B2.push(H),this.ToffsetWires2B2.push(j),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(G),this.ToffsetWires2B2.push(Z),this.ToffsetWires2B2.push(it),this.ToffsetWires2B2.push(ut),this.ToffsetWires2B2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case E.双分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B2.push(h[2]),this.ToffsetWires2B2.push(h[3]);break;case E.四分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B2.push(h[4]),this.ToffsetWires2B2.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]);break;case E.六分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]);break;case E.八分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]),this.ToffsetWires2B2.push(h[12]),this.ToffsetWires2B2.push(h[13]),this.ToffsetWires2B2.push(h[14]),this.ToffsetWires2B2.push(h[15]);break}break;case Ie.C相:if(a.type==jt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case E.双分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]);break;case E.四分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]);break;case E.六分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]);break;case E.八分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.offsetWires23.push(h[6]),this.offsetWires23.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]),this.ToffsetWires2C1.push(h[12]),this.ToffsetWires2C1.push(h[13]),this.ToffsetWires2C1.push(h[14]),this.ToffsetWires2C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(m),this.ToffsetWires2C2.push(m);break;case E.双分裂:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires23.push(_),this.offsetWires23.push(W),this.ToffsetWires2C2.push(_),this.ToffsetWires2C2.push(W);break;case E.四分裂:const C=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires23.push(C),this.offsetWires23.push(I),this.offsetWires23.push(L),this.offsetWires23.push(w),this.ToffsetWires2C2.push(C),this.ToffsetWires2C2.push(I),this.ToffsetWires2C2.push(L),this.ToffsetWires2C2.push(w);break;case E.六分裂:const N=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),D=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),M=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),O=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),R=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires23.push(N),this.offsetWires23.push(D),this.offsetWires23.push(B),this.offsetWires23.push(M),this.offsetWires23.push(O),this.offsetWires23.push(R),this.ToffsetWires2C2.push(N),this.ToffsetWires2C2.push(D),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(M),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(R);break;case E.八分裂:const H=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),j=b(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),F=b(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),G=b(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),Z=b(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),it=b(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),ut=b(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=b(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires23.push(H),this.offsetWires23.push(j),this.offsetWires23.push(F),this.offsetWires23.push(G),this.offsetWires23.push(Z),this.offsetWires23.push(it),this.offsetWires23.push(ut),this.offsetWires23.push(ht),this.ToffsetWires2C2.push(H),this.ToffsetWires2C2.push(j),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(G),this.ToffsetWires2C2.push(Z),this.ToffsetWires2C2.push(it),this.ToffsetWires2C2.push(ut),this.ToffsetWires2C2.push(ht);break}else if(a.type==jt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case E.双分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C2.push(h[2]),this.ToffsetWires2C2.push(h[3]);break;case E.四分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C2.push(h[4]),this.ToffsetWires2C2.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]);break;case E.六分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]);break;case E.八分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]),this.ToffsetWires2C2.push(h[12]),this.ToffsetWires2C2.push(h[13]),this.ToffsetWires2C2.push(h[14]),this.ToffsetWires2C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Ie.A相:h.forEach(m=>{this.offsetWires21.push(m)});break;case Ie.B相:h.forEach(m=>{this.offsetWires22.push(m)});break;case Ie.C相:h.forEach(m=>{this.offsetWires23.push(m)});break}else if(this.LineInfo.towers[i].type==_i.耐张塔)switch(u){case 11:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case 12:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case 13:const m=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(m),this.ToffsetWires2A2.push(m);break;case 14:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case 15:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case 16:const _=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(_),this.ToffsetWires2B2.push(_);break;case 17:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case 18:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case 19:const W=b(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(W),this.ToffsetWires2C2.push(W);break}else switch(u){case 5:h.forEach(m=>{this.offsetWires21.push(m)});break;case 6:h.forEach(m=>{this.offsetWires22.push(m)});break;case 7:h.forEach(m=>{this.offsetWires23.push(m)});break}break;case $s.地线:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case Ie.地线1:this.offsetGrouundWires11.push(h[0]);break;case Ie.地线2:this.offsetGrouundWires12.push(h[0]);break}else switch(u){case 0:this.offsetGrouundWires11.push(h[0]);break;case 1:this.offsetGrouundWires12.push(h[0]);break}break}u=u+1}),this.offsetWires11.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.length>=2&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(a),this.offsetArcWires1A.forEach(C=>{const I=be(this.viewer.scene.globe.ellipsoid,C);this.arcLine1A1.push(I)}),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.双分裂:this.offsetWires11.length>=4&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.四分裂:this.offsetWires11.length>=8&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.六分裂:this.offsetWires11.length>=12&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-6]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-5]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+5]),m.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.八分裂:this.offsetWires11.length>=16&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-8]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-7]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-6]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-5]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+5]),m.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires11[t+6]),_.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires11[t+7]),W.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(be(this.viewer.scene.globe.ellipsoid,C))});break;case E.双分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-6]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-5]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+5]),m.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-8]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(be(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-7]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-6]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-5]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+5]),m.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires12[t+6]),_.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires12[t+7]),W.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(be(this.viewer.scene.globe.ellipsoid,C))});break;case E.双分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(be(this.viewer.scene.globe.ellipsoid,C))});break;case E.四分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(be(this.viewer.scene.globe.ellipsoid,C))});break;case E.六分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-6]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-5]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+5]),m.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(be(this.viewer.scene.globe.ellipsoid,C))});break;case E.八分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-8]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-7]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-6]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-5]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+5]),m.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires13[t+6]),_.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires13[t+7]),W.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(be(this.viewer.scene.globe.ellipsoid,C))});break}}if(this.offsetWires21.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-6]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-5]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+5]),m.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-8]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-7]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-6]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-5]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+5]),m.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires21[t+6]),_.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires21[t+7]),W.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-6]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-5]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+5]),m.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-8]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-7]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-6]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-5]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+5]),m.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires22[t+6]),_.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires22[t+7]),W.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-6]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-5]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+5]),m.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-8]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-7]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-6]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-5]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+5]),m.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires23[t+6]),_.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires23[t+7]),W.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const a=[];a.push(this.offsetGrouundWires11[i]),a.push(this.offsetGrouundWires11[i-1]);const c=[];c.push(this.offsetGrouundWires12[i]),c.push(this.offsetGrouundWires12[i-1]),this.offsetGrouundWires1=v(a,2),this.offsetGrouundWires2=v(c,2),this.LineentityCollection2.add(y(this.offsetGrouundWires1,"地线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.LineentityCollection2.add(y(this.offsetGrouundWires2,"地线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}let l=2;if(this.LineInfo.towers[i].type==_i.耐张塔){switch(this.LineInfo.Wairnum){case E.单分裂:t=t+l,e=e+l;break;case E.双分裂:t=t+l*2,e=e+l*2;break;case E.四分裂:t=t+l*4,e=e+l*4;break;case E.六分裂:t=t+l*6,e=e+l*6;break;case E.八分裂:t=t+l*8,e=e+l*8;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.length>=2&&(a.push(this.ToffsetWires1A1[e-2]),a.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(C.push(this.ToffsetWires1A2[e-2]),C.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1A1.length>=4&&(a.push(this.ToffsetWires1A1[e-4]),a.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-3]),c.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(C.push(this.ToffsetWires1A2[e-4]),C.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[e-3]),I.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1A1.length>=8&&(a.push(this.ToffsetWires1A1[e-8]),a.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-7]),c.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-6]),p.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-5]),d.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(C.push(this.ToffsetWires1A2[e-8]),C.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[e-7]),I.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-6]),L.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-5]),w.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1A1.length>=12&&(a.push(this.ToffsetWires1A1[e-12]),a.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-11]),c.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-10]),p.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-9]),d.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-8]),h.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[e-7]),m.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(C.push(this.ToffsetWires1A2[e-12]),C.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[e-11]),I.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-10]),L.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-9]),w.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1A2[e-8]),N.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-7]),D.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1A1.length>=16&&(a.push(this.ToffsetWires1A1[e-16]),a.push(this.ToffsetWires1A1[e-8]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-15]),c.push(this.ToffsetWires1A1[e-7]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-14]),p.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-13]),d.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-12]),h.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[e-11]),m.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1A1[e-10]),_.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1A1[e-9]),W.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(C.push(this.ToffsetWires1A2[e-16]),C.push(this.ToffsetWires1A2[e-8]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[e-15]),I.push(this.ToffsetWires1A2[e-7]),this.ToffsetArcWires2A=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-14]),L.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-13]),w.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1A2[e-12]),N.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-11]),D.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[e-10]),B.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1A2[e-9]),M.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1B1.length>=2&&(a.push(this.ToffsetWires1B1[e-2]),a.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(C.push(this.ToffsetWires1B2[e-2]),C.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1B1.length>=4&&(a.push(this.ToffsetWires1B1[e-4]),a.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-3]),c.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(C.push(this.ToffsetWires1B2[e-4]),C.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[e-3]),I.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1B1.length>=8&&(a.push(this.ToffsetWires1B1[e-8]),a.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-7]),c.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-6]),p.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-5]),d.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(C.push(this.ToffsetWires1B2[e-8]),C.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[e-7]),I.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-6]),L.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-5]),w.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1B1.length>=12&&(a.push(this.ToffsetWires1B1[e-12]),a.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-11]),c.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-10]),p.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-9]),d.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-8]),h.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[e-7]),m.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(C.push(this.ToffsetWires1B2[e-12]),C.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[e-11]),I.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-10]),L.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-9]),w.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1B2[e-8]),N.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-7]),D.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1B1.length>=16&&(a.push(this.ToffsetWires1B1[e-16]),a.push(this.ToffsetWires1B1[e-8]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-15]),c.push(this.ToffsetWires1B1[e-7]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-14]),p.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-13]),d.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-12]),h.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[e-11]),m.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1B1[e-10]),_.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1B1[e-9]),W.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(C.push(this.ToffsetWires1B2[e-16]),C.push(this.ToffsetWires1B2[e-8]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[e-15]),I.push(this.ToffsetWires1B2[e-7]),this.ToffsetArcWires2B=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-14]),L.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-13]),w.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1B2[e-12]),N.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-11]),D.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[e-10]),B.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1B2[e-9]),M.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1C1.length>=2&&(a.push(this.ToffsetWires1C1[e-2]),a.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(C.push(this.ToffsetWires1C2[e-2]),C.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1C1.length>=4&&(a.push(this.ToffsetWires1C1[e-4]),a.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-3]),c.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(C.push(this.ToffsetWires1C2[e-4]),C.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[e-3]),I.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1C1.length>=8&&(a.push(this.ToffsetWires1C1[e-8]),a.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-7]),c.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-6]),p.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-5]),d.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(C.push(this.ToffsetWires1C2[e-8]),C.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[e-7]),I.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-6]),L.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-5]),w.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1C1.length>=12&&(a.push(this.ToffsetWires1C1[e-12]),a.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-11]),c.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-10]),p.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-9]),d.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-8]),h.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[e-7]),m.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(C.push(this.ToffsetWires1C2[e-12]),C.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[e-11]),I.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-10]),L.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-9]),w.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1C2[e-8]),N.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-7]),D.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1C1.length>=16&&(a.push(this.ToffsetWires1C1[e-16]),a.push(this.ToffsetWires1C1[e-8]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-15]),c.push(this.ToffsetWires1C1[e-7]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-14]),p.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-13]),d.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-12]),h.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[e-11]),m.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1C1[e-10]),_.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1C1[e-9]),W.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(C.push(this.ToffsetWires1C2[e-16]),C.push(this.ToffsetWires1C2[e-8]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[e-15]),I.push(this.ToffsetWires1C2[e-7]),this.ToffsetArcWires2C=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-14]),L.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-13]),w.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires1C2[e-12]),N.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-11]),D.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[e-10]),B.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1C2[e-9]),M.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2A1.length>=2&&(a.push(this.ToffsetWires2A1[e-2]),a.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(C.push(this.ToffsetWires2A2[e-2]),C.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2A1.length>=4&&(a.push(this.ToffsetWires2A1[e-4]),a.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-3]),c.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(C.push(this.ToffsetWires2A2[e-4]),C.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[e-3]),I.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2A1.length>=8&&(a.push(this.ToffsetWires2A1[e-8]),a.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-7]),c.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-6]),p.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-5]),d.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(C.push(this.ToffsetWires2A2[e-8]),C.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[e-7]),I.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-6]),L.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-5]),w.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2A1.length>=12&&(a.push(this.ToffsetWires2A1[e-12]),a.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-11]),c.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-10]),p.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-9]),d.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-8]),h.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[e-7]),m.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(C.push(this.ToffsetWires2A2[e-12]),C.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[e-11]),I.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-10]),L.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-9]),w.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2A2[e-8]),N.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-7]),D.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2A1.length>=16&&(a.push(this.ToffsetWires2A1[e-16]),a.push(this.ToffsetWires2A1[e-8]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-15]),c.push(this.ToffsetWires2A1[e-7]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-14]),p.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-13]),d.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-12]),h.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[e-11]),m.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2A1[e-10]),_.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2A1[e-9]),W.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(C.push(this.ToffsetWires2A2[e-16]),C.push(this.ToffsetWires2A2[e-8]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[e-15]),I.push(this.ToffsetWires2A2[e-7]),this.ToffsetArcWires2A2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-14]),L.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-13]),w.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2A2[e-12]),N.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-11]),D.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[e-10]),B.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2A2[e-9]),M.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2B1.length>=2&&(a.push(this.ToffsetWires2B1[e-2]),a.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(C.push(this.ToffsetWires2B2[e-2]),C.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2B1.length>=4&&(a.push(this.ToffsetWires2B1[e-4]),a.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-3]),c.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(C.push(this.ToffsetWires2B2[e-4]),C.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[e-3]),I.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2B1.length>=8&&(a.push(this.ToffsetWires2B1[e-8]),a.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-7]),c.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-6]),p.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-5]),d.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(C.push(this.ToffsetWires2B2[e-8]),C.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[e-7]),I.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-6]),L.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-5]),w.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2B1.length>=12&&(a.push(this.ToffsetWires2B1[e-12]),a.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-11]),c.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-10]),p.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-9]),d.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-8]),h.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[e-7]),m.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(C.push(this.ToffsetWires2B2[e-12]),C.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[e-11]),I.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-10]),L.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-9]),w.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2B2[e-8]),N.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-7]),D.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2B1.length>=16&&(a.push(this.ToffsetWires2B1[e-16]),a.push(this.ToffsetWires2B1[e-8]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-15]),c.push(this.ToffsetWires2B1[e-7]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-14]),p.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-13]),d.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-12]),h.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[e-11]),m.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2B1[e-10]),_.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2B1[e-9]),W.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(C.push(this.ToffsetWires2B2[e-16]),C.push(this.ToffsetWires2B2[e-8]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[e-15]),I.push(this.ToffsetWires2B2[e-7]),this.ToffsetArcWires2B2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-14]),L.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-13]),w.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2B2[e-12]),N.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-11]),D.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[e-10]),B.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2B2[e-9]),M.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],I=[],L=[],w=[],N=[],D=[],B=[],M=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2C1.length>=2&&(a.push(this.ToffsetWires2C1[e-2]),a.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(C.push(this.ToffsetWires2C2[e-2]),C.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2C1.length>=4&&(a.push(this.ToffsetWires2C1[e-4]),a.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-3]),c.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(C.push(this.ToffsetWires2C2[e-4]),C.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[e-3]),I.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2C1.length>=8&&(a.push(this.ToffsetWires2C1[e-8]),a.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-7]),c.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-6]),p.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-5]),d.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(C.push(this.ToffsetWires2C2[e-8]),C.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[e-7]),I.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-6]),L.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-5]),w.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2C1.length>=12&&(a.push(this.ToffsetWires2C1[e-12]),a.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-11]),c.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-10]),p.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-9]),d.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-8]),h.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[e-7]),m.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(C.push(this.ToffsetWires2C2[e-12]),C.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[e-11]),I.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-10]),L.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-9]),w.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2C2[e-8]),N.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-7]),D.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2C1.length>=16&&(a.push(this.ToffsetWires2C1[e-16]),a.push(this.ToffsetWires2C1[e-8]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-15]),c.push(this.ToffsetWires2C1[e-7]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-14]),p.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-13]),d.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-12]),h.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[e-11]),m.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2C1[e-10]),_.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2C1[e-9]),W.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(C.push(this.ToffsetWires2C2[e-16]),C.push(this.ToffsetWires2C2[e-8]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[e-15]),I.push(this.ToffsetWires2C2[e-7]),this.ToffsetArcWires2C2=v(I,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-14]),L.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-13]),w.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),N.push(this.ToffsetWires2C2[e-12]),N.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(N,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-11]),D.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[e-10]),B.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2C2[e-9]),M.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(M,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case E.单分裂:t=t+1;break;case E.双分裂:t=t+2;break;case E.四分裂:t=t+4;break;case E.六分裂:t=t+6;break;case E.八分裂:t=t+8;break}})}getWireDataForChannelCalculation(){return{arcLine1A1:this.arcLine1A1,arcLine1B1:this.arcLine1B1,arcLine1C1:this.arcLine1C1}}getWireDataForChannelCalculationByTowerRange(t,e){if(t<0||e>=this.LineInfo.towers.length||t>e)return console.warn(`无效的杆塔索引范围: ${t} - ${e}`),{arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};const r=[],i=[],n=[],o=this.LineInfo.towers,f={minLon:Math.min(...o.slice(t,e+1).map(l=>l.Longitude)),maxLon:Math.max(...o.slice(t,e+1).map(l=>l.Longitude)),minLat:Math.min(...o.slice(t,e+1).map(l=>l.Latitude)),maxLat:Math.max(...o.slice(t,e+1).map(l=>l.Latitude))},u=.005;return f.minLon-=u,f.maxLon+=u,f.minLat-=u,f.maxLat+=u,this.arcLine1A1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&r.push(l)}),this.arcLine1B1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&i.push(l)}),this.arcLine1C1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&n.push(l)}),{arcLine1A1:r,arcLine1B1:i,arcLine1C1:n}}parseWireEntityName(t){const e=t.match(/^导线(\d+)_([ABC])\d*(\d+)-(\d+)$/);return e?{circuit:parseInt(e[1]),phase:e[2],startTowerIndex:parseInt(e[3]),endTowerIndex:parseInt(e[4])}:null}getWireSegmentByTowerRange(t,e){const r={arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};return this.LineentityCollection2.values.forEach(i=>{if(i.name&&i.polyline&&i.polyline.positions){const n=this.parseWireEntityName(i.name);if(n&&n.circuit===1&&n.startTowerIndex===t&&n.endTowerIndex===e){const o=i.polyline.positions.getValue(g.JulianDate.now());if(o&&o.length>0){const f=[];for(let u=0;u<o.length;u++){const l=g.Cartographic.fromCartesian(o[u]);f.push([g.Math.toDegrees(l.longitude),g.Math.toDegrees(l.latitude),l.height])}switch(n.phase){case"A":r.arcLine1A1=f;break;case"B":r.arcLine1B1=f;break;case"C":r.arcLine1C1=f;break}}}}}),r}getAllWireSegments(){const t=[],e=[],r=[],i=[],n=[],o=[],f=new Map;return this.LineInfo&&this.LineInfo.towers&&this.LineInfo.towers.forEach((u,l)=>{f.set(u.id,l),u.name&&f.set(u.name,l)}),this.LineentityCollection2.values.forEach(u=>{if(u.name&&u.polyline&&u.polyline.positions){const l=this.parseWireEntityName(u.name);if(l){const a=u.polyline.positions.getValue(g.JulianDate.now());if(a&&a.length>0){const c=[];for(let h=0;h<a.length;h++){const m=g.Cartographic.fromCartesian(a[h]);c.push([g.Math.toDegrees(m.longitude),g.Math.toDegrees(m.latitude),m.height])}const p=l.startTowerIndex,d=f.get(p)??p;if(l.circuit===1)switch(l.phase){case"A":t[d]=c;break;case"B":e[d]=c;break;case"C":r[d]=c;break}else if(l.circuit===2)switch(l.phase){case"A":i[d]=c;break;case"B":n[d]=c;break;case"C":o[d]=c;break}}}}}),console.log(`从LineentityCollection2提取导线数据完成: 回路1-A相${t.length}段, B相${e.length}段, C相${r.length}段; 回路2-A相${i.length}段, B相${n.length}段, C相${o.length}段`),{wireSegments1A1:t,wireSegments1B1:e,wireSegments1C1:r,wireSegments2A1:i,wireSegments2B1:n,wireSegments2C1:o}}getOffsetTowers(){return this.offsetTowers}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}flyToTower(t){if(t<0||t>=this.offsetTowers.length){console.warn(`Invalid tower index: ${t}. Valid range: 0-${this.offsetTowers.length-1}`);return}const e=this.offsetTowers[t];console.log(e),this.viewer.camera.flyTo({destination:e,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}loadLineTower(){this.initializeLineData(),this.isDynamicLoadingEnabled?(this.loadAllWiresOnly(),this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllWiresOnly(){const t=new g.EntityCollection,e=this.entityCollection2;this.entityCollection2=t,this.loadAllTowersAtOnce();const r=[];t.values.forEach(i=>{var n;i.name&&(i.name.includes("导线")||i.name.includes("daoxian")||(n=i.id)!=null&&n.toString().includes("daoxian"))&&r.push(i)}),this.entityCollection2=e,r.forEach(i=>{this.entityCollection2.add(i)}),t.removeAll()}getArcLine1A1(){return this.arcLine1A1}getArcLine1B1(){return this.arcLine1B1}getArcLine1C1(){return this.arcLine1C1}}const Vn=class Vn{constructor(t,e,r){T(this,"viewer");T(this,"LineInfo");T(this,"Keym","");T(this,"offsetTrees",[]);T(this,"dataSourcetree");T(this,"entityCollectiontree");T(this,"isDynamicLoadingEnabled",!0);T(this,"loadedTreeIndices",new Set);T(this,"isTreeModelRemoved",!1);T(this,"modelCache",new Map);this.Keym=r,this.viewer=t,this.LineInfo=e,this.dataSourcetree=new g.CustomDataSource(this.LineInfo.LineID+"tree"),this.entityCollectiontree=this.dataSourcetree.entities}createModelCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i}`}getCachedModelConfig(t,e,r,i){const n=Math.max(0,r),o=Math.min(i,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}getVisibleTreeIndices(){var n;if(!this.viewer.camera||this.offsetTrees.length===0)return[];const t=this.viewer.camera.position,e=((n=this.viewer.camera.positionCartographic)==null?void 0:n.height)||1e3;let r=Math.max(5e3,e*2);console.log(`相机高度: ${e}, 加载距离: ${r}`),e>5e4&&(r=1e5);const i=[];for(let o=0;o<this.offsetTrees.length;o++){const f=this.offsetTrees[o];g.Cartesian3.distance(t,f)<=r&&i.push(o)}if(i.length===0&&this.offsetTrees.length>0){const o=Math.min(20,this.offsetTrees.length);for(let f=0;f<o;f++)i.push(f)}return i}updateVisibleTrees(){if(this.isTreeModelRemoved)return;const t=this.getVisibleTreeIndices(),e=[];this.loadedTreeIndices.forEach(r=>{t.includes(r)||e.push(r)}),e.forEach(r=>{const i="tree-"+this.LineInfo.corridor_features[r].id;this.entityCollectiontree.removeById(i),this.loadedTreeIndices.delete(r)}),t.forEach(r=>{if(!this.loadedTreeIndices.has(r))if(r>=0&&r<this.offsetTrees.length&&r<this.LineInfo.corridor_features.length){const i=this.offsetTrees[r],n=this.LineInfo.corridor_features[r];i&&n?(this.loadTreeAtIndex(r,i),this.loadedTreeIndices.add(r)):console.warn(`跳过无效的动态加载树木数据,索引: ${r}`)}else console.warn(`动态加载树木索引超出范围: ${r}`)})}loadTree(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.corridor_features.forEach(t=>{this.offsetTrees.push(g.Cartesian3.fromDegrees(t.lon,t.lat,t.alt))}),this.entityCollectiontree.show=!0,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce())}loadAllTreesAtOnce(){this.LineInfo.corridor_features.length!==this.offsetTrees.length&&console.warn(`树木数据长度 (${this.LineInfo.corridor_features.length}) 与位置数据长度 (${this.offsetTrees.length}) 不匹配`);const t=Math.min(this.LineInfo.corridor_features.length,this.offsetTrees.length);for(let e=0;e<t;e++){const r=this.LineInfo.corridor_features[e],i=this.offsetTrees[e];r&&i?this.loadTreeAtIndex(e,i):console.warn(`跳过无效的树木数据,索引: ${e}`)}}loadTreeAtIndex(t,e){const r=this.LineInfo.corridor_features[t];if(!r.modelurl||r.modelurl.trim()===""){console.warn(`Tree ${t} has invalid model URL: ${r.modelurl}. Skipping...`);return}let i=1;r.modelScale>0&&r.modelH>0?(i=r.modelH/r.modelScale,i<=0&&(i=1)):r.modelH>0&&(i=r.modelH);const n=this.getCachedModelConfig(r.modelurl,i,0,2e4);this.entityCollectiontree.add(Gn("tree-"+r.id,e,"tree-"+r.id,n.uri,new g.HeadingPitchRoll(0,0,0),n.scale,n.distanceDisplayCondition))}flyToTree(t){if(t<0||t>=this.LineInfo.corridor_features.length){console.warn(`Invalid tree index: ${t}. Valid range: 0-${this.LineInfo.corridor_features.length-1}`);return}const e=this.LineInfo.corridor_features[t],r=g.Cartesian3.fromDegrees(e.lon,e.lat,e.alt+(e.modelH||0));this.viewer.camera.flyTo({destination:r,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}removeTreeModels(){this.isTreeModelRemoved=!0,this.entityCollectiontree.removeAll(),this.loadedTreeIndices.clear()}restoreTreeModels(){this.isTreeModelRemoved=!1,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce()}addTreeData(t){if(t.type==Qa.树木){console.warn(`Tree ${t.id} is not a tree. Skipping...`);return}this.LineInfo.corridor_features.push(t)}getTreeCoordinates(){return this.LineInfo.corridor_features.map(t=>[t.lon,t.lat,Number(t.alt||0)+Number(t.treeH||0)])}getOffsetTrees(){return this.offsetTrees}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getTerrainDataSources(){return[this.dataSourcetree]}static getTreeEntityPrefix(){return Vn.TREE_ENTITY_PREFIX}};T(Vn,"TREE_ENTITY_PREFIX","tree-");let Ao=Vn;class xu{constructor(t){T(this,"viewer");T(this,"dataSourceplotting");T(this,"entityCollectionplotting");T(this,"terrainVerificationCache",new Map);T(this,"terrainVerificationResultCache",new Map);T(this,"maxVisibleResults",200);T(this,"terrainVerificationBatchIndex",0);T(this,"terrainVerificationTotalBatches",0);T(this,"terrainVerificationIsRunning",!1);T(this,"terrainVerificationBatchSize",100);T(this,"cameraMoveHandler",null);T(this,"isDynamicTerrainVerificationEnabled",!1);T(this,"wireClickHandler",null);T(this,"distanceRuleConfig",new tf);this.viewer=t,this.dataSourceplotting=new g.CustomDataSource("plotting"),this.entityCollectionplotting=this.dataSourceplotting.entities}ensurePlottingDataSourceAdded(){this.viewer.dataSources.contains(this.dataSourceplotting)||this.viewer.dataSources.add(this.dataSourceplotting),this.entityCollectionplotting.show=!0}calcResultByType(t,e,r,i,n,o=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const f=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(f)){const u=this.terrainVerificationCache.get(f);Sr(t,u,this.entityCollectionplotting,o,n);return}else{const u=Fn(t,e,r,i);this.terrainVerificationCache.set(f,u),Sr(t,u,this.entityCollectionplotting,o||this.distanceRuleConfig,n)}}performTerrainVerification(t,e,r,i,n=null,o,f=$.全部测量){const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`,l=Fn(t,e,r,i);this.terrainVerificationCache.set(u,l);const a=xn(t,l,o??"unknown");return Sr(t,l,this.entityCollectionplotting,n||this.distanceRuleConfig,f),a}setMaxVisibleTerrainResults(t=200){this.maxVisibleResults=Math.max(10,t)}setDistanceRuleConfig(t){this.distanceRuleConfig={...this.distanceRuleConfig,...t}}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}drawCorridorPolygon(t,e="corridor-polygon"){if(!t||t.length<3)return;this.ensurePlottingDataSourceAdded();const r=t.map(n=>g.Cartesian3.fromDegrees(n[0],n[1])),i=this.entityCollectionplotting.add({name:e,polygon:{hierarchy:new g.PolygonHierarchy(r),material:g.Color.GREEN.withAlpha(.3),outline:!0,outlineColor:g.Color.GREEN,outlineWidth:2,heightReference:g.HeightReference.CLAMP_TO_GROUND,perPositionHeight:!1}});this.terrainVerificationResultCache.has("corridor-polygon")||this.terrainVerificationResultCache.set("corridor-polygon",[]),this.terrainVerificationResultCache.get("corridor-polygon").push(i)}drawCorridorDistanceMarkers(t,e,r="corridor-markers",i=!0){!t||t.length<2||(this.ensurePlottingDataSourceAdded(),this.addPerpendicularWidthMarkers(t,e,r),i&&this.addParallelIntervalMarkers(t,e,10,r))}addPerpendicularWidthMarkers(t,e,r){const i=t[0],n=t.length>1?t[1]:t[t.length-1],o=g.Cartesian3.fromDegrees(i[0],i[1]),f=g.Cartesian3.fromDegrees(n[0],n[1]),u=g.Cartesian3.subtract(f,o,new g.Cartesian3);g.Cartesian3.normalize(u,u);const l=g.Cartesian3.clone(o);g.Cartesian3.normalize(l,l);const a=g.Cartesian3.cross(l,u,new g.Cartesian3);g.Cartesian3.normalize(a,a);const c=e,p=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,c,new g.Cartesian3),new g.Cartesian3),d=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,-c,new g.Cartesian3),new g.Cartesian3),h=g.Cartographic.fromCartesian(p),m=g.Cartographic.fromCartesian(d),_=g.Math.toDegrees(h.longitude),W=g.Math.toDegrees(h.latitude),C=g.Math.toDegrees(m.longitude),I=g.Math.toDegrees(m.latitude),L=this.entityCollectionplotting.add({name:`${r}-left-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(i[0],i[1]),g.Cartesian3.fromDegrees(_,W)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}}),w=this.entityCollectionplotting.add({name:`${r}-right-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(i[0],i[1]),g.Cartesian3.fromDegrees(C,I)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(L),this.terrainVerificationResultCache.get("corridor-markers").push(w)}addParallelIntervalMarkers(t,e,r,i){if(t.length<2||e<=0||r<=0)return;let n=r,o=1;for(;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!0);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${i}-parallel-left-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=r,o++}for(n=r,o=1;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!1);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${i}-parallel-right-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=r,o++}}createOffsetLine(t,e,r){if(t.length<2)return[];const i=he(t),n=e/1e3;try{const o=r?-n:n,f=Df(i,o,{units:"kilometers"});if(f.geometry.type==="LineString")return f.geometry.coordinates.map(u=>g.Cartesian3.fromDegrees(u[0],u[1]))}catch(o){console.warn("Failed to create offset line:",o)}return[]}clearCorridorDistanceMarkers(){try{if(this.terrainVerificationResultCache&&this.terrainVerificationResultCache.has("corridor-markers")){const t=this.terrainVerificationResultCache.get("corridor-markers");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const r=t[e];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-markers")}}catch(t){console.warn("Error clearing corridor distance markers:",t)}}clearCorridorPolygon(){try{if(this.terrainVerificationResultCache){const t=this.terrainVerificationResultCache.get("corridor-polygon");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const r=t[e];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-polygon")}}catch(t){console.warn("Error clearing corridor polygon:",t)}}getClickDistanceRuleConfig(){return{...this.distanceRuleConfig}}clearTreeDistanceResultsExceptCorridor(){const t=[];this.entityCollectionplotting&&this.entityCollectionplotting.values.forEach(e=>{(!e.name||!e.name.startsWith("corridor-"))&&t.push(e)});for(let e=t.length-1;e>=0;e--){const r=t[e];try{this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationCache.clear(),this.terrainVerificationResultCache.forEach((e,r)=>{r.startsWith("corridor-")||this.terrainVerificationResultCache.delete(r)})}clearTreeDistanceResults(){try{if(this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll()}catch(t){console.warn("Failed to removeAll entities:",t)}}catch(t){console.warn("Error clearing tree distance results:",t)}try{this.terrainVerificationCache.clear()}catch(t){console.warn("Failed to clear terrain verification cache:",t)}try{this.terrainVerificationResultCache.clear()}catch(t){console.warn("Failed to clear terrain verification result cache:",t)}}LineChannelTerrainVerification(t,e,r,i,n,o=100,f){if(this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResults(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始地物校验:共${t.length}棵树,分${this.terrainVerificationTotalBatches}批处理`),this.processTerrainVerificationBatch(t,e,r,i,n,$.全部测量,f)}processTerrainVerificationBatch(t,e,r,i,n,o=$.全部测量,f,u=[]){if(!this.terrainVerificationIsRunning||this.terrainVerificationBatchIndex>=this.terrainVerificationTotalBatches){this.terrainVerificationIsRunning=!1,console.log("地物校验完成"),f&&f(u);return}const l=this.terrainVerificationBatchIndex*this.terrainVerificationBatchSize,a=Math.min(l+this.terrainVerificationBatchSize,t.length);console.log(`处理第${this.terrainVerificationBatchIndex+1}/${this.terrainVerificationTotalBatches}批:${l}-${a}`);const c=[];for(let p=l;p<a;p++){const d=t[p];if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],m=this.performTerrainVerification(h,r,i,n,null,d.id,o);m&&c.push(m)}}u.push(...c),this.terrainVerificationBatchIndex++,setTimeout(()=>{this.processTerrainVerificationBatch(t,e,r,i,n,o,f,u)},0)}stopLineChannelTerrainVerification(){this.terrainVerificationIsRunning=!1,console.log("地物校验已停止")}enableVisibleAreaTerrainVerification(t,e,r,i,n){this.isDynamicTerrainVerificationEnabled=!0,this.setupCameraMoveListenerForTerrainVerification(t,e,r,i,n)}disableVisibleAreaTerrainVerification(){this.isDynamicTerrainVerificationEnabled=!1,this.cameraMoveHandler&&(this.cameraMoveHandler(),this.cameraMoveHandler=null)}setupCameraMoveListenerForTerrainVerification(t,e,r,i,n){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleAreaTerrainVerification(t,e,r,i,n)})}updateVisibleAreaTerrainVerification(t,e,r,i,n){if(!this.isDynamicTerrainVerificationEnabled)return;this.getVisibleTreeIndices(e).forEach(f=>{const u=t[f];if(u){const l=[u.lon,u.lat,Number(u.alt||0)+Number(u.treeH||0)];this.performTerrainVerification(l,r,i,n)}})}getVisibleTreeIndices(t){var o;if(!this.viewer.camera||t.length===0)return[];const e=this.viewer.camera.position,r=((o=this.viewer.camera.positionCartographic)==null?void 0:o.height)||1e3;let i=Math.max(5e3,r*2);r>5e4&&(i=1e5);const n=[];for(let f=0;f<t.length;f++){const u=t[f];g.Cartesian3.distance(e,u)<=i&&n.push(f)}return n}loadTreeListen(t,e,r,i,n,o=$.全部测量){this.cameraMoveHandler&&this.removeTreeListen();const f=(l,a)=>{const c=l.scene.pick(a);if(g.defined(c)){let p=c.id;if(p===void 0&&c.primitive&&(p=c.primitive.id),p instanceof g.Entity)return p}};this.ensurePlottingDataSourceAdded(),new g.ScreenSpaceEventHandler(this.viewer.canvas).setInputAction(l=>{const a=f(this.viewer,l.position);if(a&&a.id){const c=String(a.id);if(c.startsWith("tree-")){const p=c.substring(5),d=t.find(h=>h&&h.id&&String(h.id)===p);if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],m=Fn(h,e,r,i),_=xn(h,m,d.id);n&&_&&n(_),Sr(h,m,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),o)}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeTreeListen(){if(this.cameraMoveHandler){try{this.cameraMoveHandler()}catch{}this.cameraMoveHandler=null}if(this.dataSourceplotting&&this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll(),this.entityCollectionplotting.show=!1}catch(t){console.warn("Error clearing tree listen entities:",t)}}loadWireListen(t,e,r,i,n,o){this.wireClickHandler&&this.removeWireListen();const f=(u,l)=>{const a=u.scene.pick(l);if(g.defined(a)){let c=a.id;if(c===void 0&&a.primitive&&(c=a.primitive.id),c instanceof g.Entity)return c}};this.ensurePlottingDataSourceAdded(),this.wireClickHandler=new g.ScreenSpaceEventHandler(this.viewer.canvas),this.wireClickHandler.setInputAction(async u=>{const l=f(this.viewer,u.position);if(l&&l.id){const a=String(l.id),c=l.name||"";if(a.includes("daoxian")||c.includes("导线")||c.includes("daoxian")){n&&l&&n(l);const d=this.viewer.scene.pickPosition(u.position);if(g.defined(d)){let h=null;if(l&&l.polyline&&l.polyline.positions){const m=l.polyline.positions.getValue(this.viewer.clock.currentTime);m&&Array.isArray(m)&&(h=m.map(_=>{const W=g.Cartographic.fromCartesian(_);return[g.Math.toDegrees(W.longitude),g.Math.toDegrees(W.latitude),W.height]}))}if((!h||h.length===0)&&(c.match(/(\d+)-(\d+)$/)&&(c.includes("A")||c.includes("_A")?h=e:c.includes("B")||c.includes("_B")?h=r:(c.includes("C")||c.includes("_C"))&&(h=i)),(!h||h.length===0)&&(h=[...e,...r,...i])),h&&h.length>1){const m=(o==null?void 0:o.measurementType)||$.全部测量,_=[$.垂直距离,$.净空距离,$.安全距离].includes(m),W=_||m===$.全部测量,C=!_||m===$.全部测量,I=W?1:10,L=this.interpolateWire(h,I),w=[];if(W){const N=await this.calculateAndDrawWireToGroundDistanceByType(L,m).catch(D=>(console.error("Error in wire to ground distance calculation:",D),null));N&&w.push(N)}if(C){const N=(o==null?void 0:o.width)||10,D=(o==null?void 0:o.show)!==!1,B=t.filter(M=>{const O=[M.lon,M.lat,Number(M.alt||0)+Number(M.treeH||0)];return this.isPointInWireCorridor(O,L,N)});D&&this.drawWireCorridor(L,N,`wire-corridor-${Date.now()}`),this.terrainVerificationCache.clear(),B.forEach(M=>{const O=[M.lon,M.lat,Number(M.alt||0)+Number(M.treeH||0)],R=this.calcResultSingleWire(O,L,m,this.getClickDistanceRuleConfig());R&&w.push(R)})}o!=null&&o.onMeasurementResult&&w.length>0&&o.onMeasurementResult(w)}}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeWireListen(){this.wireClickHandler&&(this.wireClickHandler.destroy(),this.wireClickHandler=null),this.clearWireCorridors()}getGroundElevation(t,e){return 0}calculateWireToGroundDistance(t){let e=1/0,r=[],i=[];for(const n of t){const[o,f,u]=n,l=this.getGroundElevation(o,f),a=Math.abs(u-l);a<e&&(e=a,r=n,i=[o,f,l])}return{distance:e,wirePoint:r,groundPoint:i}}async calculateAndDrawWireToGroundDistanceByType(t,e){if(!t||t.length===0)return null;try{const r=t.map(c=>new g.Cartographic(g.Math.toRadians(c[0]),g.Math.toRadians(c[1]))),i=this.viewer.terrainProvider;let n=[];if(i&&g.defined(i))try{n=(await g.sampleTerrainMostDetailed(i,r)).map(p=>p.height||0)}catch(c){console.warn("Terrain sampling failed, using default ground height:",c),n=new Array(t.length).fill(0)}else n=new Array(t.length).fill(0);let o=1/0,f=0;for(let c=0;c<t.length;c++){const p=t[c][2],d=n[c],h=p-d;h>0&&h<o&&(o=h,f=c)}if(o===1/0){o=1/0;for(let c=0;c<t.length;c++){const p=t[c][2],d=n[c],h=Math.abs(p-d);h<o&&(o=h,f=c)}}const u=t[f],l=[u[0],u[1],n[f]];return this.drawWireToGroundDistanceByType(u,l,o,e),{treeId:`ground-${Date.now()}`,treeCoordinates:l,conductorCoordinates:u,horizontalDistance:0,verticalDistance:parseFloat(o.toFixed(1)),straightLineDistance:parseFloat(o.toFixed(1)),clearanceDistance:parseFloat(o.toFixed(1)),timestamp:Date.now()}}catch(r){console.warn("Failed to calculate wire to ground distance:",r);const i=this.calculateWireToGroundDistance(t);return this.drawWireToGroundDistanceByType(i.wirePoint,i.groundPoint,i.distance,e),{treeId:`ground-${Date.now()}`,treeCoordinates:i.groundPoint,conductorCoordinates:i.wirePoint,horizontalDistance:0,verticalDistance:parseFloat(i.distance.toFixed(1)),straightLineDistance:parseFloat(i.distance.toFixed(1)),clearanceDistance:parseFloat(i.distance.toFixed(1)),timestamp:Date.now()}}}async calculateAndDrawWireToGroundDistanceBySegments(t,e,r,i){console.log("Calculating wire to ground distance by segments..."),console.log("A相导线数据点数:",(t==null?void 0:t.length)||0),console.log("B相导线数据点数:",(e==null?void 0:e.length)||0),console.log("C相导线数据点数:",(r==null?void 0:r.length)||0);const n=[];if(t&&t.length>=2&&n.push({name:"A",data:t}),e&&e.length>=2&&n.push({name:"B",data:e}),r&&r.length>=2&&n.push({name:"C",data:r}),console.log("有效相数:",n.length),n.length===0){console.warn("No valid wire data found for ground distance calculation");return}for(const o of n){const f=o.data;console.log(`处理${o.name}相导线,数据点数:`,f.length);const u=this.interpolateWire(f,1);console.log(`${o.name}相插值后点数:`,u.length);try{const l=u.map(_=>new g.Cartographic(g.Math.toRadians(_[0]),g.Math.toRadians(_[1]))),a=this.viewer.terrainProvider;let c=[];if(a&&g.defined(a))try{c=(await g.sampleTerrainMostDetailed(a,l)).map(W=>W.height||0)}catch(_){console.warn(`Terrain sampling failed for phase ${o.name}, using default ground height:`,_),c=new Array(u.length).fill(0)}else c=new Array(u.length).fill(0);let p=1/0,d=0;for(let _=0;_<u.length;_++){const W=u[_][2],C=c[_],I=W-C;I>0&&I<p&&(p=I,d=_)}if(p===1/0)for(let _=0;_<u.length;_++){const W=u[_][2],C=c[_],I=Math.abs(W-C);I<p&&(p=I,d=_)}console.log(`${o.name}相最低净空距离:`,p,"在索引:",d);const h=u[d],m=[h[0],h[1],c[d]];this.drawWireToGroundDistanceByType(h,m,p,i)}catch(l){console.warn(`Failed to calculate wire to ground distance for phase ${o.name}:`,l)}}console.log("Wire to ground distance calculation by segments completed.")}getDistanceTypeLabel(t,e){const r=`${e.toFixed(1)}米`;switch(t){case $.垂直距离:return`对地距离${r}`;case $.净空距离:return`净空距离${r}`;case $.安全距离:return`安全距离${r}`;case $.全部测量:return`净空距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(t,e,r,i){const n=[g.Cartesian3.fromDegrees(t[0],t[1],t[2]),g.Cartesian3.fromDegrees(e[0],e[1],e[2])];let o="#eff819",f=g.Color.RED;const u=this.distanceRuleConfig;let l,a=!1;if(i===$.净空距离&&u.clearanceLevels?l=u.clearanceLevels.find(c=>r>=c.minDistance&&r<=c.maxDistance):i===$.垂直距离&&u.verticalLevels?l=u.verticalLevels.find(c=>r>=c.minDistance&&r<=c.maxDistance):i===$.安全距离&&u.clearanceLevels?l=u.clearanceLevels.find(c=>r>=c.minDistance&&r<=c.maxDistance):i===$.全部测量&&u.clearanceLevels&&(l=u.clearanceLevels.find(c=>r>=c.minDistance&&r<=c.maxDistance)),l?(o=l.color,f=g.Color.fromCssColorString(l.color)):(a=!0,o="#00ff00",f=g.Color.GREEN),l||a){this.entityCollectionplotting.add({polyline:{positions:n,width:2,material:f,clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const c=g.Cartesian3.midpoint(n[0],n[1],new g.Cartesian3);this.entityCollectionplotting.add({position:c,name:"净空距离",label:{text:this.getDistanceTypeLabel(i,r),fillColor:g.Color.fromCssColorString(o),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE}})}}clearWireCorridors(){if(!this.entityCollectionplotting)return;const t=[];this.entityCollectionplotting.values.forEach(e=>{e.name==="wire-corridor"&&t.push(e)}),t.forEach(e=>{try{this.entityCollectionplotting.remove(e)}catch{}})}interpolateWire(t,e=1){if(t.length<2)return t;const r=[];for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],f=g.Cartesian3.fromDegrees(n[0],n[1],n[2]),u=g.Cartesian3.fromDegrees(o[0],o[1],o[2]),l=g.Cartesian3.distance(f,u);if(l<=e){i===0&&r.push(n),r.push(o);continue}const a=Math.ceil(l/e),c=1/a;i===0&&r.push(n);for(let p=1;p<a;p++){const d=p*c,h=g.Cartesian3.lerp(f,u,d,new g.Cartesian3),m=g.Cartographic.fromCartesian(h),_=g.Math.toDegrees(m.longitude),W=g.Math.toDegrees(m.latitude),C=m.height;r.push([_,W,C])}r.push(o)}return r}isPointInWireCorridor(t,e,r){if(e.length<2)return!1;const i=g.Cartesian3.fromDegrees(t[0],t[1],t[2]);let n=1/0;for(let o=0;o<e.length-1;o++){const f=e[o],u=e[o+1],l=g.Cartesian3.fromDegrees(f[0],f[1],f[2]),a=g.Cartesian3.fromDegrees(u[0],u[1],u[2]),c=this.calculatePointToSegmentDistance(i,l,a);c<n&&(n=c)}return n<=r/2}calculatePointToSegmentDistance(t,e,r){const i=g.Cartesian3.subtract(r,e,new g.Cartesian3),n=g.Cartesian3.subtract(t,e,new g.Cartesian3),o=g.Cartesian3.magnitudeSquared(i);if(o===0)return g.Cartesian3.distance(t,e);const f=g.Cartesian3.dot(n,i)/o;let u;return f<0?u=e:f>1?u=r:u=g.Cartesian3.add(e,g.Cartesian3.multiplyByScalar(i,f,new g.Cartesian3),new g.Cartesian3),g.Cartesian3.distance(t,u)}drawWireCorridor(t,e,r){if(t.length<2)return;const i=[],n=[];for(let f=0;f<t.length;f++){const u=t[f],l=g.Cartesian3.fromDegrees(u[0],u[1],u[2]);let a,c;if(f===0){const L=t[f+1];c=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),a=l}else if(f===t.length-1){const L=t[f-1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=l}else{const L=t[f-1],w=t[f+1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=g.Cartesian3.fromDegrees(w[0],w[1],w[2])}const p=g.Cartesian3.subtract(c,a,new g.Cartesian3);g.Cartesian3.normalize(p,p);const d=g.Cartesian3.clone(l);g.Cartesian3.normalize(d,d);const h=g.Cartesian3.cross(p,d,new g.Cartesian3);g.Cartesian3.normalize(h,h);const m=e/2,_=g.Cartesian3.multiplyByScalar(h,m,new g.Cartesian3),W=g.Cartesian3.multiplyByScalar(h,-m,new g.Cartesian3),C=g.Cartesian3.add(l,_,new g.Cartesian3),I=g.Cartesian3.add(l,W,new g.Cartesian3);i.push(C),n.push(I)}const o=[];o.push(...i),o.push(...n.reverse()),o.push(i[0]),this.entityCollectionplotting.add({id:r,name:"wire-corridor",polygon:{hierarchy:new g.PolygonHierarchy(o),material:g.Color.YELLOW.withAlpha(.3),outline:!0,outlineColor:g.Color.YELLOW,outlineWidth:2}})}calcResult(t,e,r,i,n=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const o=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(o)){const f=this.terrainVerificationCache.get(o);Sr(t,f,this.entityCollectionplotting,n,$.全部测量);return}else{const f=Fn(t,e,r,i);this.terrainVerificationCache.set(o,f),Sr(t,f,this.entityCollectionplotting,n||this.distanceRuleConfig,$.全部测量)}}calcResultSingleWire(t,e,r,i=this.distanceRuleConfig){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;const n=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(n)){const o=this.terrainVerificationCache.get(n);return Sr(t,o,this.entityCollectionplotting,i,r),xn(t,o,n)}else{const o=e;return this.terrainVerificationCache.set(n,o),Sr(t,o,this.entityCollectionplotting,i||this.distanceRuleConfig,r),xn(t,o,n)}}LineChannelTerrainVerificationForFilteredTrees(t,e,r,i,n,o=100,f=$.全部测量,u){if(console.log(`LineChannelTerrainVerificationForFilteredTrees called with ${t.length} trees`),this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResultsExceptCorridor(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始对${t.length}棵树进行地物校验`),this.processTerrainVerificationBatch(t,e,r,i,n,f,u)}getChannelCalculationDataSources(){return[this.dataSourceplotting]}}function ku(s,t){let e=0;for(let r of s)r!=null&&(r=+r)>=r&&++e;return e}function Vu(s,t){let e,r;if(t===void 0)for(const i of s)i!=null&&(e===void 0?i>=i&&(e=r=i):(e>i&&(e=i),r<i&&(r=i)));else{let i=-1;for(let n of s)(n=t(n,++i,s))!=null&&(e===void 0?n>=n&&(e=r=n):(e>n&&(e=n),r<n&&(r=n)))}return[e,r]}const Gu=Math.sqrt(50),Xu=Math.sqrt(10),Yu=Math.sqrt(2);function kn(s,t,e){const r=(t-s)/Math.max(0,e),i=Math.floor(Math.log10(r)),n=r/Math.pow(10,i),o=n>=Gu?10:n>=Xu?5:n>=Yu?2:1;let f,u,l;return i<0?(l=Math.pow(10,-i)/o,f=Math.round(s*l),u=Math.round(t*l),f/l<s&&++f,u/l>t&&--u,l=-l):(l=Math.pow(10,i)*o,f=Math.round(s/l),u=Math.round(t/l),f*l<s&&++f,u*l>t&&--u),u<f&&.5<=e&&e<2?kn(s,t,e*2):[f,u,l]}function zu(s,t,e){if(t=+t,s=+s,e=+e,!(e>0))return[];if(s===t)return[s];const r=t<s,[i,n,o]=r?kn(t,s,e):kn(s,t,e);if(!(n>=i))return[];const f=n-i+1,u=new Array(f);if(r)if(o<0)for(let l=0;l<f;++l)u[l]=(n-l)/-o;else for(let l=0;l<f;++l)u[l]=(n-l)*o;else if(o<0)for(let l=0;l<f;++l)u[l]=(i+l)/-o;else for(let l=0;l<f;++l)u[l]=(i+l)*o;return u}function Uu(s,t,e){return t=+t,s=+s,e=+e,kn(s,t,e)[2]}function qu(s,t,e){let r;for(;;){const i=Uu(s,t,e);if(i===r||i===0||!isFinite(i))return[s,t];i>0?(s=Math.floor(s/i)*i,t=Math.ceil(t/i)*i):i<0&&(s=Math.ceil(s*i)/i,t=Math.floor(t*i)/i),r=i}}function Hu(s){return Math.max(1,Math.ceil(Math.log(ku(s))/Math.LN2)+1)}var Zu=Array.prototype,Ku=Zu.slice;function ju(s,t){return s-t}function Ju(s){for(var t=0,e=s.length,r=s[e-1][1]*s[0][0]-s[e-1][0]*s[0][1];++t<e;)r+=s[t-1][1]*s[t][0]-s[t-1][0]*s[t][1];return r}const sf=s=>()=>s;function Qu(s,t){for(var e=-1,r=t.length,i;++e<r;)if(i=$u(s,t[e]))return i;return 0}function $u(s,t){for(var e=t[0],r=t[1],i=-1,n=0,o=s.length,f=o-1;n<o;f=n++){var u=s[n],l=u[0],a=u[1],c=s[f],p=c[0],d=c[1];if(th(u,c,t))return 0;a>r!=d>r&&e<(p-l)*(r-a)/(d-a)+l&&(i=-i)}return i}function th(s,t,e){var r;return eh(s,t,e)&&ih(s[r=+(s[0]===t[0])],e[r],t[r])}function eh(s,t,e){return(t[0]-s[0])*(e[1]-s[1])===(e[0]-s[0])*(t[1]-s[1])}function ih(s,t,e){return s<=t&&t<=e||e<=t&&t<=s}function rh(){}var cr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function sh(){var s=1,t=1,e=Hu,r=u;function i(l){var a=e(l);if(Array.isArray(a))a=a.slice().sort(ju);else{const c=Vu(l,nh);for(a=zu(...qu(c[0],c[1],a),a);a[a.length-1]>=c[1];)a.pop();for(;a[1]<c[0];)a.shift()}return a.map(c=>n(l,c))}function n(l,a){const c=a==null?NaN:+a;if(isNaN(c))throw new Error(`invalid value: ${a}`);var p=[],d=[];return o(l,c,function(h){r(h,l,c),Ju(h)>0?p.push([h]):d.push(h)}),d.forEach(function(h){for(var m=0,_=p.length,W;m<_;++m)if(Qu((W=p[m])[0],h)!==-1){W.push(h);return}}),{type:"MultiPolygon",value:a,coordinates:p}}function o(l,a,c){var p=new Array,d=new Array,h,m,_,W,C,I;for(h=m=-1,W=jr(l[0],a),cr[W<<1].forEach(L);++h<s-1;)_=W,W=jr(l[h+1],a),cr[_|W<<1].forEach(L);for(cr[W<<0].forEach(L);++m<t-1;){for(h=-1,W=jr(l[m*s+s],a),C=jr(l[m*s],a),cr[W<<1|C<<2].forEach(L);++h<s-1;)_=W,W=jr(l[m*s+s+h+1],a),I=C,C=jr(l[m*s+h+1],a),cr[_|W<<1|C<<2|I<<3].forEach(L);cr[W|C<<3].forEach(L)}for(h=-1,C=l[m*s]>=a,cr[C<<2].forEach(L);++h<s-1;)I=C,C=jr(l[m*s+h+1],a),cr[C<<2|I<<3].forEach(L);cr[C<<3].forEach(L);function L(w){var N=[w[0][0]+h,w[0][1]+m],D=[w[1][0]+h,w[1][1]+m],B=f(N),M=f(D),O,R;(O=d[B])?(R=p[M])?(delete d[O.end],delete p[R.start],O===R?(O.ring.push(D),c(O.ring)):p[O.start]=d[R.end]={start:O.start,end:R.end,ring:O.ring.concat(R.ring)}):(delete d[O.end],O.ring.push(D),d[O.end=M]=O):(O=p[M])?(R=d[B])?(delete p[O.start],delete d[R.end],O===R?(O.ring.push(D),c(O.ring)):p[R.start]=d[O.end]={start:R.start,end:O.end,ring:R.ring.concat(O.ring)}):(delete p[O.start],O.ring.unshift(N),p[O.start=B]=O):p[B]=d[M]={start:B,end:M,ring:[N,D]}}}function f(l){return l[0]*2+l[1]*(s+1)*4}function u(l,a,c){l.forEach(function(p){var d=p[0],h=p[1],m=d|0,_=h|0,W=wo(a[_*s+m]);d>0&&d<s&&m===d&&(p[0]=nf(d,wo(a[_*s+m-1]),W,c)),h>0&&h<t&&_===h&&(p[1]=nf(h,wo(a[(_-1)*s+m]),W,c))})}return i.contour=n,i.size=function(l){if(!arguments.length)return[s,t];var a=Math.floor(l[0]),c=Math.floor(l[1]);if(!(a>=0&&c>=0))throw new Error("invalid size");return s=a,t=c,i},i.thresholds=function(l){return arguments.length?(e=typeof l=="function"?l:Array.isArray(l)?sf(Ku.call(l)):sf(l),i):e},i.smooth=function(l){return arguments.length?(r=l?u:rh,i):r===u},i}function nh(s){return isFinite(s)?s:NaN}function jr(s,t){return s==null?!1:+s>=t}function wo(s){return s==null||isNaN(s=+s)?-1/0:s}function nf(s,t,e,r){const i=r-t,n=e-t,o=isFinite(i)||isFinite(n)?i/n:Math.sign(i)/Math.sign(n);return isNaN(o)?s:s+o-.5}function oh(s){return s.primitive!==void 0}class ah{constructor(t){T(this,"viewer");T(this,"lineInfo",null);T(this,"contourEntities",[]);T(this,"mountainEntities",[]);T(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});T(this,"mountainConfig",{minElev:500,minProm:300,minDistance:500});this.viewer=t}setMountainConfig(t){this.mountainConfig={...this.mountainConfig,...t}}getMountainConfig(){return{...this.mountainConfig}}setContourConfig(t){this.contourConfig={...this.contourConfig,...t}}getContourConfig(){return{...this.contourConfig}}setLineInfo(t){this.lineInfo=t}calculateCorridorBounds(){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const t=this.lineInfo.towers;let e=1/0,r=-1/0,i=1/0,n=-1/0;t.forEach(u=>{u.Longitude<e&&(e=u.Longitude),u.Longitude>r&&(r=u.Longitude),u.Latitude<i&&(i=u.Latitude),u.Latitude>n&&(n=u.Latitude)});const o=1/111,f=this.contourConfig.corridorWidthKm*o;return e-=f,r+=f,i-=f,n+=f,[e,i,r,n]}async getHeightFromTerrain(t,e){var r;try{const i=[g.Cartographic.fromDegrees(t,e)];return((r=(await g.sampleTerrainMostDetailed(this.viewer.terrainProvider,i))[0])==null?void 0:r.height)??0}catch(i){return console.warn(`获取高度失败 [${t}, ${e}]:`,i),0}}async generateGridPoints(t){const[e,r,i,n]=t,o=1/111,f=this.contourConfig.interpolationPrecision/1e3*o,u=Math.ceil((i-e)/f)+1,l=Math.ceil((n-r)/f)+1,a=u*l;let c=0;const p=new Array(a),d=[];console.log(`[d3-contour] 开始生成网格点: 总点数 ${a}, 经度步数 ${u}, 纬度步数 ${l}`);for(let h=0;h<l;h++){const m=n-h*f;for(let _=0;_<u;_++){const W=e+_*f,C=await this.getHeightFromTerrain(W,m),I=h*u+_;if(p[I]=C,d.push({longitude:W,latitude:m,height:C}),c++,c%100===0){const L=(c/a*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${c}/${a} (${L}%)`)}}}return console.log(`[d3-contour] 网格点生成完成: 共生成 ${d.length} 个点`),{values:p,width:u,height:l,x0:e,y0:n,dx:f,dy:-f,points:d}}generateContours(t){const e=[],{contourInterval:r}=this.contourConfig;if(t.values.length===0||t.width<2||t.height<2)return e;console.log(`[d3-contour] 开始生成等高线,等高距: ${r}m`);const i=t.values.filter(a=>a!=null);if(i.length===0)return e;const n=Math.floor(Math.min(...i)/r)*r,o=Math.ceil(Math.max(...i)/r)*r,f=[];for(let a=n;a<=o;a+=r)f.push(a);const l=sh().size([t.width,t.height]).thresholds(f)(t.values);return console.log(`[d3-contour] d3-contour 生成了 ${l.length} 条等高线`),l.forEach(a=>{const c={height:a.value,points:[]};a.coordinates.forEach(p=>{p.forEach(d=>{d.forEach(h=>{const m=t.x0+h[0]*t.dx,_=t.y0+h[1]*t.dy,W=this.getHeightAtGridPoint(t,h[0],h[1]);c.points.push({longitude:m,latitude:_,height:W})})})}),c.points.length>=2&&e.push(c)}),console.log(`[d3-contour] 转换完成,共 ${e.length} 条有效等高线`),e}getHeightAtGridPoint(t,e,r){const i=Math.floor(e),n=Math.floor(r),o=Math.min(i+1,t.width-1),f=Math.min(n+1,t.height-1),u=n*t.width+i,l=n*t.width+o,a=f*t.width+i,c=f*t.width+o,p=t.values[u]||0,d=t.values[l]||0,h=t.values[a]||0,m=t.values[c]||0,_=e-i,W=r-n,C=p*(1-_)+d*_,I=h*(1-_)+m*_;return C*(1-W)+I*W}drawContours(t){this.clearContours();const{contourColor:e,contourWidth:r,showLabels:i,labelFontSize:n}=this.contourConfig;console.log(`开始绘制等高线: ${t.length} 条, 颜色: ${e}, 宽度: ${r}`),t.forEach((o,f)=>{if(o.points.length<2)return;const u=g.Cartesian3.fromDegreesArray(o.points.flatMap(a=>[a.longitude,a.latitude])),l=new g.GroundPolylinePrimitive({geometryInstances:new g.GeometryInstance({geometry:new g.GroundPolylineGeometry({positions:u,width:r})}),appearance:new g.PolylineMaterialAppearance({material:g.Material.fromType("Color",{color:g.Color.fromCssColorString(e)})})});if(this.viewer.scene.primitives.add(l),this.contourEntities.push({primitive:l}),console.log(`绘制等高线 ${f}: 高度 ${o.height}m, 点数 ${o.points.length}`),i&&o.points.length>0){const a=Math.floor(o.points.length/2),c=o.points[a],p=this.viewer.entities.add({name:`Contour_Label_${f}_${o.height}m`,position:g.Cartesian3.fromDegrees(c.longitude,c.latitude,c.height+10),label:{text:`${o.height}m`,font:`${n}px sans-serif`,fillColor:g.Color.WHITE,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:g.VerticalOrigin.CENTER,horizontalOrigin:g.HorizontalOrigin.CENTER,heightReference:g.HeightReference.CLAMP_TO_GROUND}});this.contourEntities.push(p)}})}async getAndDrawContours(t,e){debugger;if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");console.log(`等高线获取范围: [${r[0].toFixed(6)}, ${r[1].toFixed(6)}, ${r[2].toFixed(6)}, ${r[3].toFixed(6)}]`),console.log(`等高距: ${this.contourConfig.contourInterval}m, 插值精度: ${this.contourConfig.interpolationPrecision}m`);const i=await this.generateGridPoints(r);console.log(`生成网格点数量: ${i.points.length}`);const n=this.generateContours(i);return console.log(`生成等高线数量: ${n.length}`),this.drawContours(n),n}async getContourData(t,e){if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");const i=await this.generateGridPoints(r);return this.generateContours(i)}async getCorridorGridData(t,e){if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");return(await this.generateGridPoints(r)).points}clearContours(){this.contourEntities.forEach(t=>{try{oh(t)?this.viewer.scene.primitives.remove(t.primitive):this.viewer.entities.remove(t)}catch(e){console.warn("Error removing contour entity:",e)}}),this.contourEntities=[]}setCorridorWidthKm(t){this.contourConfig.corridorWidthKm=t}setContourInterval(t){this.contourConfig.contourInterval=t}setInterpolationPrecision(t){this.contourConfig.interpolationPrecision=t}getCorridorWidthKm(){return this.contourConfig.corridorWidthKm}getContourInterval(){return this.contourConfig.contourInterval}async generateCrossSection(t,e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.lineInfo.towers;if(t<0||t>=r.length)throw new Error("无效的塔位索引");const i={width:100,interval:10,interpolationMethod:"linear",mountainThreshold:300,mountainProminence:50,...e},n=r[t];let o=n,f=n;t>0&&(o=r[t-1]),t<r.length-1&&(f=r[t+1]);const u=f.Longitude-o.Longitude,a=-(f.Latitude-o.Latitude),c=u,p=Math.sqrt(a*a+c*c),d={dx:a/p,dy:c/p},h=i.width/2,m=6371e3,_=h/m*(180/Math.PI),W=h/m*(180/Math.PI)/Math.cos(n.Latitude*Math.PI/180),C=n.Longitude-d.dx*W,I=n.Latitude-d.dy*_,L=n.Longitude+d.dx*W,w=n.Latitude+d.dy*_,N=[],D=Math.ceil(i.width/i.interval)+1;for(let O=0;O<D;O++){const R=O/(D-1),H=C+(L-C)*R,j=I+(w-I)*R,F=(R-.5)*i.width,G=await this.getHeightFromTerrain(H,j);N.push({distance:F,height:G,lon:H,lat:j,isCenter:Math.abs(F)<i.interval/2,isMountain:!1})}const B=this.applyInterpolation(N,i.interpolationMethod),M=this.detectMountains(B,i.mountainThreshold,i.mountainProminence);return M.forEach(O=>{B.forEach(R=>{R.distance>=O.startDistance&&R.distance<=O.endDistance&&(R.isMountain=!0)})}),{points:B,mountains:M}}applyInterpolation(t,e){return e==="cubic"?this.cubicSplineInterpolation(t):e==="nearest"?[...t]:[...t]}cubicSplineInterpolation(t){if(t.length<2)return t;const e=[],r=2;for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],f=i>0?t[i-1]:n,u=i<t.length-2?t[i+2]:o;for(let l=0;l<r;l++){const a=l/r,c=a*a,p=c*a,d=2*p-3*c+1,h=p-2*c+a,m=-2*p+3*c,_=p-c,W=d*n.height+h*(o.distance-n.distance)*this.getSlope(f,n,o)+m*o.height+_*(o.distance-n.distance)*this.getSlope(n,o,u),C=n.distance+(o.distance-n.distance)*a;e.push({distance:C,height:W,lon:n.lon,lat:n.lat,isCenter:n.isCenter||o.isCenter,isMountain:!1})}}return e.push({...t[t.length-1]}),e}getSlope(t,e,r){const i=e.distance-t.distance,n=r.distance-e.distance;return i===0?(r.height-e.height)/(n||1):n===0?(e.height-t.height)/i:((e.height-t.height)/i+(r.height-e.height)/n)/2}detectMountains(t,e,r){const i=[];if(t.length<3)return i;for(let n=1;n<t.length-1;n++){const o=t[n],f=t[n-1],u=t[n+1];if(o.height>f.height&&o.height>u.height){let l=n,a=n,c=o.height,p=o.height;for(let m=n-1;m>=0&&o.height-t[m].height>=r;m--)l=m,c=t[m].height;for(let m=n+1;m<t.length&&o.height-t[m].height>=r;m++)a=m,p=t[m].height;const d=(c+p)/2,h=o.height-d;h>=e&&i.push({id:i.length+1,peakDistance:o.distance,peakHeight:o.height,startDistance:t[l].distance,endDistance:t[a].distance,heightDiff:h,path:`[${t[l].distance.toFixed(1)}m, ${o.distance.toFixed(1)}m, ${t[a].distance.toFixed(1)}m]`})}}return i}async generateLongSection(t){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length<2)throw new Error("线路信息为空或杆塔数量不足");const e=this.lineInfo.towers,r={interval:50,interpolationMethod:"linear",...t},i=[];let n=0;i.push({towerName:e[0].name||"塔1",distance:n,height:e[0].Altitude||0,isTower:!0});for(let o=0;o<e.length-1;o++){const f=e[o],u=e[o+1],l=(u.Longitude-f.Longitude)*111e3,a=(u.Latitude-f.Latitude)*111e3,c=Math.sqrt(l*l+a*a),p=Math.floor(c/r.interval);for(let d=1;d<=p;d++){const h=d*r.interval/c,m=n+d*r.interval;if(r.interpolationMethod==="nearest"){const _=h<.5?f.Altitude||0:u.Altitude||0;i.push({towerName:"",distance:m,height:_,isTower:!1})}else{const _=(f.Altitude||0)+((u.Altitude||0)-(f.Altitude||0))*h;i.push({towerName:"",distance:m,height:_,isTower:!1})}}n+=c,i.push({towerName:u.name||`塔${o+2}`,distance:n,height:u.Altitude||0,isTower:!0})}return i}calculateCrossSectionLine(t,e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const r=this.lineInfo.towers;if(t<0||t>=r.length)return null;const i=r[t];let n=i,o=i;t>0&&(n=r[t-1]),t<r.length-1&&(o=r[t+1]);const f=o.Longitude-n.Longitude,l=-(o.Latitude-n.Latitude),a=f,c=Math.sqrt(l*l+a*a),p={dx:l/c,dy:a/c},d=e/2,h=6371e3,m=d/h*(180/Math.PI),_=d/h*(180/Math.PI)/Math.cos(i.Latitude*Math.PI/180);return{start:{lon:i.Longitude-p.dx*_,lat:i.Latitude-p.dy*m},end:{lon:i.Longitude+p.dx*_,lat:i.Latitude+p.dy*m}}}async getAndDrawMountains(t,e,r){if(e&&this.setContourConfig(e),r&&this.setMountainConfig(r),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const i=this.calculateCorridorBounds();if(!i)throw new Error("无法计算通道边界");console.log(`山峰识别范围: [${i[0].toFixed(6)}, ${i[1].toFixed(6)}, ${i[2].toFixed(6)}, ${i[3].toFixed(6)}]`),console.log(`山峰识别参数: minElev=${this.mountainConfig.minElev}m, minProm=${this.mountainConfig.minProm}m`);const n=await this.generateGridPoints(i);console.log(`生成网格点数量: ${n.points.length}`);const o=this.generateContours(n);console.log(`生成等高线数量: ${o.length}`);const f=this.detectMountainsFromGrid(n,o);return console.log(`识别到山峰数量: ${f.length}, 有效山峰: ${f.filter(u=>u.isValid).length}`),this.drawContours(o),this.drawMountains(f),f}detectMountainsFromGrid(t,e){const r=this.findCandidatePeaks(t,e);console.log(`粗筛候选山峰: ${r.length} 个`);const i=r.map((o,f)=>{const u=this.calculateProminence(o,t,e);return{id:f+1,longitude:o.longitude,latitude:o.latitude,elevation:o.elevation,prominence:u.prominence,saddleElevation:u.saddleElevation,isValid:u.prominence>=this.mountainConfig.minProm}});return this.deduplicateMountains(i)}findCandidatePeaks(t,e){const r=[],{minElev:i}=this.mountainConfig,n=[...e].sort((f,u)=>u.height-f.height),o=new Set;for(const f of n)if(!(f.height<i)&&f.points.length>=3){const u=this.calculatePolygonCenter(f.points),l=Math.floor((u.longitude-t.x0)/t.dx),a=Math.floor((u.latitude-t.y0)/t.dy),c=`${l},${a}`;if(!o.has(c)){o.add(c);const p=this.getHeightAtGridPoint(t,l,a);r.push({longitude:u.longitude,latitude:u.latitude,elevation:p})}}return r}calculatePolygonCenter(t){if(t.length===0)return{longitude:0,latitude:0};let e=0,r=0;return t.forEach(i=>{e+=i.longitude,r+=i.latitude}),{longitude:e/t.length,latitude:r/t.length}}calculateProminence(t,e,r){const i=t.elevation,n=[...r].sort((l,a)=>a.height-l.height);let o=i,f=!1;for(const l of n)if(!(l.height>=i))if(this.isPointInsideContour(t,l))o=l.height,f=!0;else break;return f||(o=Math.min(...e.values.filter(a=>a>0))),{prominence:i-o,saddleElevation:o}}isPointInsideContour(t,e){if(e.points.length<3)return!1;let r=!1;const i=e.points.length;for(let n=0,o=i-1;n<i;o=n++){const f=e.points[n].longitude,u=e.points[n].latitude,l=e.points[o].longitude,a=e.points[o].latitude;u>t.latitude!=a>t.latitude&&t.longitude<(l-f)*(t.latitude-u)/(a-u)+f&&(r=!r)}return r}deduplicateMountains(t){const{minDistance:e}=this.mountainConfig,r=[],i=new Set;for(let n=0;n<t.length;n++){if(i.has(n))continue;const o=t[n],f=[o];i.add(n);for(let u=n+1;u<t.length;u++){if(i.has(u))continue;this.calculateDistance(o,t[u])<e&&(f.push(t[u]),i.add(u))}if(f.length===1)r.push(o);else{const u=f.reduce((l,a)=>a.elevation>l.elevation?a:l);r.push(u)}}return r}calculateDistance(t,e){const i=(e.latitude-t.latitude)*Math.PI/180,n=(e.longitude-t.longitude)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.latitude*Math.PI/180)*Math.cos(e.latitude*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}drawMountains(t){this.clearMountains(),t.forEach((e,r)=>{if(!e.isValid)return;const i=this.viewer.entities.add({name:`Mountain_Peak_${r+1}`,position:g.Cartesian3.fromDegrees(e.longitude,e.latitude,e.elevation+10),point:{pixelSize:10,color:g.Color.RED,outlineColor:g.Color.WHITE,outlineWidth:2,heightReference:g.HeightReference.CLAMP_TO_GROUND},label:{text:`${e.elevation.toFixed(0)}m
5
+ Prom: ${e.prominence.toFixed(0)}m`,font:"14px sans-serif",fillColor:g.Color.WHITE,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:g.VerticalOrigin.BOTTOM,horizontalOrigin:g.HorizontalOrigin.CENTER,heightReference:g.HeightReference.CLAMP_TO_GROUND,pixelOffset:new g.Cartesian2(0,-15)}});this.mountainEntities.push(i),console.log(`绘制山峰 ${r+1}: [${e.longitude.toFixed(6)}, ${e.latitude.toFixed(6)}], 海拔 ${e.elevation.toFixed(0)}m, 突出度 ${e.prominence.toFixed(0)}m`)})}clearMountains(){this.mountainEntities.forEach(t=>{try{this.viewer.entities.remove(t)}catch(e){console.warn("Error removing mountain entity:",e)}}),this.mountainEntities=[]}async getMountainData(t,e,r){if(e&&this.setContourConfig(e),r&&this.setMountainConfig(r),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const i=this.calculateCorridorBounds();if(!i)throw new Error("无法计算通道边界");const n=await this.generateGridPoints(i),o=this.generateContours(n);return this.detectMountainsFromGrid(n,o)}detectTerrainFeatures(t,e,r){const i=[],n=[],o=e.windowSize,f=t.length;if(f<o*2+1)return{peaks:i,valleys:n};const u=(c,p)=>p===0?90:Math.atan(Math.abs(c)/Math.abs(p))*180/Math.PI;for(let c=o;c<f-o;c++){const p=t[c];if(p.height<e.minPeakElev)continue;let d=!0,h=p.height;for(let R=c-o;R<=c+o;R++){if(t[R].height>p.height){d=!1;break}t[R].height<h&&(h=t[R].height)}if(!d)continue;const m=p.height-h;if(m<e.minPeakDiff)continue;let _=c,W=c;for(let R=c-1;R>=0&&p.height-t[R].height>=e.minPeakDiff/2;R--)_=R;for(let R=c+1;R<f&&p.height-t[R].height>=e.minPeakDiff/2;R++)W=R;const C=p.height-t[_].height,I=p.height-t[W].height,L=p.distance-t[_].distance,w=t[W].distance-p.distance,N=u(C,L),D=u(I,w),B=e.peakMode==="slope_only"||m>=e.minPeakDiff,M=e.peakMode==="height_diff"||N>=e.minPeakSlope&&D>=e.minPeakSlope,O=e.peakMode==="both"?m>=e.minPeakDiff&&N>=e.minPeakSlope&&D>=e.minPeakSlope:!0;if(e.peakMode==="both"){if(!O)continue}else if(e.peakMode==="height_diff"){if(!B)continue}else if(!M)continue;i.push({id:i.length+1,type:"peak",distance:p.distance,height:p.height,startDistance:t[_].distance,endDistance:t[W].distance,heightDiff:m})}for(let c=o;c<f-o;c++){const p=t[c];let d=!0,h=p.height;for(let R=c-o;R<=c+o;R++){if(t[R].height<p.height){d=!1;break}t[R].height>h&&(h=t[R].height)}if(!d)continue;const m=h-p.height;if(m<e.minValleyDiff)continue;let _=c,W=c;for(let R=c-1;R>=0&&t[R].height-p.height>=e.minValleyDiff/2;R--)_=R;for(let R=c+1;R<f&&t[R].height-p.height>=e.minValleyDiff/2;R++)W=R;const C=t[_].height-p.height,I=t[W].height-p.height,L=p.distance-t[_].distance,w=t[W].distance-p.distance,N=u(C,L),D=u(I,w),B=e.valleyMode==="slope_only"||m>=e.minValleyDiff,M=e.valleyMode==="height_diff"||N>=e.minValleySlope&&D>=e.minValleySlope,O=e.valleyMode==="both"?m>=e.minValleyDiff&&N>=e.minValleySlope&&D>=e.minValleySlope:!0;if(e.valleyMode==="both"){if(!O)continue}else if(e.valleyMode==="height_diff"){if(!B)continue}else if(!M)continue;n.push({id:n.length+1,type:"valley",distance:p.distance,height:p.height,startDistance:t[_].distance,endDistance:t[W].distance,heightDiff:m})}const l=this.mergeCloseFeatures(i,r*2),a=this.mergeCloseFeatures(n,r*2);return l.sort((c,p)=>c.distance-p.distance),a.sort((c,p)=>c.distance-p.distance),l.forEach((c,p)=>c.id=p+1),a.forEach((c,p)=>c.id=p+1),{peaks:l,valleys:a}}mergeCloseFeatures(t,e){if(t.length<=1)return t;const r=[...t].sort((n,o)=>n.distance-o.distance),i=[r[0]];for(let n=1;n<r.length;n++){const o=i[i.length-1],f=r[n];f.distance-o.distance<e?f.type==="peak"?f.height>o.height&&(i[i.length-1]=f):f.height<o.height&&(i[i.length-1]=f):i.push(f)}return i}async generateCrossSectionWithFeatures(t,e,r){const i=await this.generateCrossSection(t,e),n=i.points.map(l=>({distance:l.distance,height:l.height})),{peaks:o,valleys:f}=this.detectTerrainFeatures(n,r,e.interval??10),u=i.points.map(l=>({...l,type:l.isCenter?"center":"normal"}));return o.forEach(l=>{const a=u.find(c=>Math.abs(c.distance-l.distance)<(e.interval??10)/2);a&&(a.type="peak")}),f.forEach(l=>{const a=u.find(c=>Math.abs(c.distance-l.distance)<(e.interval??10)/2);a&&(a.type="valley")}),{points:u,peaks:o,valleys:f}}}class fh{constructor(t,e,r){T(this,"viewer");T(this,"LineInfo");T(this,"lineConstruction");T(this,"terrainConstruction");T(this,"channelCalculation");T(this,"contourConstruction");T(this,"selectedWireEntity",null);T(this,"originalWireColor",null);T(this,"wireCorridorWidth",10);T(this,"showWireCorridor",!0);T(this,"wireMeasurementType",$.全部测量);T(this,"isDynamicLoadingEnabled",!0);T(this,"pathEntities",[]);this.viewer=t,this.LineInfo=e,this.lineConstruction=new Fu(t,e,r),this.terrainConstruction=new Ao(t,e,r),this.channelCalculation=new xu(t),this.contourConstruction=new ah(t),this.enableWireMeasurement=this.enableWireMeasurement.bind(this),this.removeWireListen=this.removeWireListen.bind(this)}setAutoCalculateRollX(t){this.lineConstruction.setAutoCalculateRollX(t)}getAutoCalculateRollX(){return this.lineConstruction.getAutoCalculateRollX()}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t,this.lineConstruction.setDynamicLoadingEnabled(t),this.terrainConstruction.setDynamicLoadingEnabled(t)}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}initializeLineData(){this.lineConstruction.initializeLineData()}loadLineTower(){this.lineConstruction.loadLineTower()}loadLineModel(){this.lineConstruction.getLineDataSources().forEach(e=>{this.viewer.dataSources.contains(e)||this.viewer.dataSources.add(e)})}loadTree(){this.terrainConstruction.loadTree()}loadtreeModel(){this.terrainConstruction.getTerrainDataSources().forEach(t=>{this.viewer.dataSources.contains(t)||this.viewer.dataSources.add(t)})}addTreeData(t){this.terrainConstruction.addTreeData(t)}flyToTower(t){this.lineConstruction.flyToTower(t)}flyToTree(t){this.terrainConstruction.flyToTree(t)}loadTreeListen(t,e=$.全部测量){const r=this.terrainConstruction.getLineInfo().corridor_features,i=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadTreeListen(r,i.arcLine1A1,i.arcLine1B1,i.arcLine1C1,t,e)}removeTreeListen(){this.channelCalculation.removeTreeListen()}loadWireListen(){const t=this.terrainConstruction.getLineInfo().corridor_features,e=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadWireListen(t,e.arcLine1A1,e.arcLine1B1,e.arcLine1C1)}removeWireListen(){if(this.channelCalculation.removeWireListen(),this.selectedWireEntity&&this.originalWireColor){try{this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor))}catch(t){console.warn("Error restoring wire color:",t)}this.selectedWireEntity=null,this.originalWireColor=null}}clearWireMeasurementResults(){this.channelCalculation.clearTreeDistanceResults()}enableWireMeasurement(t){const e=this.terrainConstruction.getLineInfo().corridor_features,r=this.lineConstruction.getWireDataForChannelCalculation(),i=o=>{if(this.selectedWireEntity&&this.originalWireColor&&this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor)),o.polyline&&o.polyline.material){const f=o.polyline.material;f instanceof g.Color?this.originalWireColor=f.toCssColorString():this.originalWireColor="#ffffff",o.polyline.material=g.Color.YELLOW,this.selectedWireEntity=o}},n={width:this.wireCorridorWidth,show:this.showWireCorridor,measurementType:this.wireMeasurementType,onMeasurementResult:t};this.channelCalculation.loadWireListen(e,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1,i,n)}setWireCorridorWidth(t){this.wireCorridorWidth=t}setShowWireCorridor(t){this.showWireCorridor=t}setWireMeasurementType(t){this.wireMeasurementType=t}async LineChannelTerrainVerification(t,e=100){const r=this.terrainConstruction.getLineInfo().corridor_features,i=this.terrainConstruction.getOffsetTrees(),n=this.lineConstruction.getAllWireSegments();let o=[],f=[],u=[];if(n.wireSegments1A1.length>0)n.wireSegments1A1.forEach(l=>{l&&l.length>0&&o.push(...l)}),n.wireSegments1B1.forEach(l=>{l&&l.length>0&&f.push(...l)}),n.wireSegments1C1.forEach(l=>{l&&l.length>0&&u.push(...l)}),console.log(`使用按塔段存储的导线数据: A相=${o.length}点, B相=${f.length}点, C相=${u.length}点`),await this.calculateClearanceBySegments(n);else{const l=this.lineConstruction.getWireDataForChannelCalculation();o=l.arcLine1A1,f=l.arcLine1B1,u=l.arcLine1C1,console.log(`使用整体导线数据: A相=${o.length}点, B相=${f.length}点, C相=${u.length}点`)}this.channelCalculation.LineChannelTerrainVerification(r,i,o,f,u,e,t)}async calculateClearanceBySegments(t){var i,n,o;console.log("========== 开始按塔段计算净空距离 ==========");const e=Math.max(t.wireSegments1A1.length,t.wireSegments1B1.length,t.wireSegments1C1.length);console.log(`塔段总数: ${e}`),console.log(`A相塔段数: ${t.wireSegments1A1.length}`),console.log(`B相塔段数: ${t.wireSegments1B1.length}`),console.log(`C相塔段数: ${t.wireSegments1C1.length}`);const r=[];if(t.wireSegments1A1.length>0&&((i=t.wireSegments1A1[0])==null?void 0:i.length)>0?(r.push({key:"A",data:t.wireSegments1A1}),console.log("A相数据有效,加入计算")):console.log("A相数据无效或为空"),t.wireSegments1B1.length>0&&((n=t.wireSegments1B1[0])==null?void 0:n.length)>0?(r.push({key:"B",data:t.wireSegments1B1}),console.log("B相数据有效,加入计算")):console.log("B相数据无效或为空"),t.wireSegments1C1.length>0&&((o=t.wireSegments1C1[0])==null?void 0:o.length)>0?(r.push({key:"C",data:t.wireSegments1C1}),console.log("C相数据有效,加入计算")):console.log("C相数据无效或为空"),console.log(`有效相数: ${r.length} (${r.map(f=>f.key).join(", ")})`),r.length===0){console.log("没有有效相数据,跳过净空距离计算");return}for(let f=0;f<e;f++){console.log(`
6
+ --- 处理塔段 ${f} ---`);for(const u of r){const l=u.data[f];if(!l){console.log(`${u.key} 塔段${f} 数据为空,跳过`);continue}if(l.length<2){console.log(`${u.key} 塔段${f} 点数不足(${l.length}),跳过`);continue}console.log(`${u.key} 塔段${f}: ${l.length}个点,开始计算净空距离`);try{await this.channelCalculation.calculateAndDrawWireToGroundDistanceByType(l,$.净空距离),console.log(`${u.key} 塔段${f} 净空距离计算完成`)}catch(a){console.error(`${u.key} 塔段${f} 净空距离计算失败:`,a)}}}console.log(`
7
+ ========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(t,e,r,i=100,n=2e3,o=!1,f=!0,u=$.全部测量,l=1,a="ABC"){debugger;const c=this.LineInfo.towers;let p=-1,d=-1;for(let z=0;z<c.length;z++)(c[z].id==t||c[z].name==t)&&(p=z),(c[z].id==e||c[z].name==e)&&(d=z);if(p===-1||d===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验"),this.LineChannelTerrainVerification(r,i);return}p>d&&([p,d]=[d,p]);const h=this.lineConstruction.getAllWireSegments();console.log(`获取到的导线数据: 回路1-A相${h.wireSegments1A1.length}段, B相${h.wireSegments1B1.length}段, C相${h.wireSegments1C1.length}段; 回路2-A相${h.wireSegments2A1.length}段, B相${h.wireSegments2B1.length}段, C相${h.wireSegments2C1.length}段`),console.log(`杆塔索引范围: ${p} - ${d}`);let m=h.wireSegments1A1,_=h.wireSegments1B1,W=h.wireSegments1C1,C=[],I=[],L=[];(l===0||l===2)&&(C=h.wireSegments2A1,I=h.wireSegments2B1,L=h.wireSegments2C1);const w=[],N=[],D=[],B=[],M=[],O=[];for(let z=p;z<d;z++)console.log(`检查塔段索引${z}: 回路1-A相存在=${!!m[z]}, B相存在=${!!_[z]}, C相存在=${!!W[z]}; 回路2-A相存在=${!!C[z]}, B相存在=${!!I[z]}, C相存在=${!!L[z]}`),(l===0||l===1)&&(m[z]&&w.push(m[z]),_[z]&&N.push(_[z]),W[z]&&D.push(W[z])),(l===0||l===2)&&(C[z]&&B.push(C[z]),I[z]&&M.push(I[z]),L[z]&&O.push(L[z]));console.log(`塔段范围 ${p}-${d}: 回路1-A相${w.length}段, B相${N.length}段, C相${D.length}段; 回路2-A相${B.length}段, B相${M.length}段, C相${O.length}段`);const R=[],H=[],j=[],F=[],G=[],Z=[];for(let z=0;z<w.length;z++)R.push(...w[z]);for(let z=0;z<N.length;z++)H.push(...N[z]);for(let z=0;z<D.length;z++)j.push(...D[z]);for(let z=0;z<B.length;z++)F.push(...B[z]);for(let z=0;z<M.length;z++)G.push(...M[z]);for(let z=0;z<O.length;z++)Z.push(...O[z]);a==="A"?(H.splice(0),j.splice(0),G.splice(0),Z.splice(0)):a==="B"?(R.splice(0),j.splice(0),F.splice(0),Z.splice(0)):a==="C"?(R.splice(0),H.splice(0),F.splice(0),G.splice(0)):a==="AB"?(j.splice(0),Z.splice(0)):a==="AC"?(H.splice(0),G.splice(0)):a==="BC"&&(R.splice(0),F.splice(0)),console.log(`导线数据状态(回路${l},相序${a}): 回路1-A相=${R.length}, B相=${H.length}, C相=${j.length}; 回路2-A相=${F.length}, B相=${G.length}, C相=${Z.length}`);const it=this.terrainConstruction.getLineInfo().corridor_features,ut=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${it.length}`);const ht=c.slice(p,d+1),ti=Bu(it,ht,n);console.log(`通道内树木数量: ${ti.length}`);const Ge=[],Ci=new Map;if(it.forEach((z,Jr)=>{Ci.set(z,Jr)}),ti.forEach(z=>{const Jr=Ci.get(z);Jr!==void 0&&Ge.push(ut[Jr])}),o){const z=Ou(ht,n);if(z.length>0){this.channelCalculation.drawCorridorPolygon(z,`corridor-${t}-${e}`);const Jr=ht.map(Te=>[Te.Longitude,Te.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(Jr,n,`corridor-${t}-${e}`,f)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();if(ti.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const lt=R.length>0||H.length>0||j.length>0,_t=F.length>0||G.length>0||Z.length>0;if(!lt&&!_t){console.error("过滤后的导线数据为空,无法进行测量"),r&&r([]);return}console.log(`开始对${ti.length}棵树进行测量...`);let wt=[...R],Es=[...H],hf=[...j];(l===0||l===2)&&_t&&(wt.push(...F),Es.push(...G),hf.push(...Z)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(ti,Ge,wt,Es,hf,i,u,z=>{if(u===$.全部测量||u===$.净空距离||u===$.垂直距离||u===$.安全距离){if(l===0||l===1)for(let Te=0;Te<w.length;Te++){const Qr=p+Te,tn=Qr+1,Po=w[Te]||[],So=N[Te]||[],No=D[Te]||[];let Bi=[...Po],Oi=[...So],Fi=[...No];a==="A"?(Oi=[],Fi=[]):a==="B"?(Bi=[],Fi=[]):a==="C"?(Bi=[],Oi=[]):a==="AB"?Fi=[]:a==="AC"?Oi=[]:a==="BC"&&(Bi=[]),console.log(`计算塔段 ${Qr}-${tn} (回路1) 的净空距离: A相=${Bi.length}, B相=${Oi.length}, C相=${Fi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(Bi,Oi,Fi,u).catch(bo=>{console.error(`Error calculating wire to ground distance for segment ${Qr}-${tn} (circuit 1):`,bo)})}if((l===0||l===2)&&_t)for(let Te=0;Te<B.length;Te++){const Qr=p+Te,tn=Qr+1,Po=B[Te]||[],So=M[Te]||[],No=O[Te]||[];let Bi=[...Po],Oi=[...So],Fi=[...No];a==="A"?(Oi=[],Fi=[]):a==="B"?(Bi=[],Fi=[]):a==="C"?(Bi=[],Oi=[]):a==="AB"?Fi=[]:a==="AC"?Oi=[]:a==="BC"&&(Bi=[]),console.log(`计算塔段 ${Qr}-${tn} (回路2) 的净空距离: A相=${Bi.length}, B相=${Oi.length}, C相=${Fi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(Bi,Oi,Fi,u).catch(bo=>{console.error(`Error calculating wire to ground distance for segment ${Qr}-${tn} (circuit 2):`,bo)})}}r&&r(z)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const t=this.terrainConstruction.getLineInfo().corridor_features,e=this.terrainConstruction.getOffsetTrees(),r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(t,e,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(t=200){this.channelCalculation.setMaxVisibleTerrainResults(t)}setDistanceRuleConfig(t){this.channelCalculation.setDistanceRuleConfig(t)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(t){console.warn("Error clearing corridor display:",t)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getContourConfig(){return this.contourConstruction.getContourConfig()}setContourConfig(t){this.contourConstruction.setContourConfig(t)}setContourCorridorWidthKm(t){this.contourConstruction.setCorridorWidthKm(t)}setContourInterval(t){this.contourConstruction.setContourInterval(t)}setContourInterpolationPrecision(t){this.contourConstruction.setInterpolationPrecision(t)}async getAndDrawContours(t){return this.contourConstruction.getAndDrawContours(this.LineInfo,t)}async getContourData(t){return this.contourConstruction.getContourData(this.LineInfo,t)}async getCorridorGridData(t){return this.contourConstruction.getCorridorGridData(this.LineInfo,t)}clearContours(){this.contourConstruction.clearContours()}async getAndDrawMountains(t,e){return this.contourConstruction.getAndDrawMountains(this.LineInfo,t,e)}async getMountainData(t,e){return this.contourConstruction.getMountainData(this.LineInfo,t,e)}clearMountains(){this.contourConstruction.clearMountains()}drawLinePath(t="#ff0000",e=3,r=!1){if(this.clearLinePath(),!this.LineInfo||!this.LineInfo.towers||this.LineInfo.towers.length<2){console.warn("无法绘制路径:杆塔数据不足");return}const i=this.LineInfo.towers,n=i.map(f=>g.Cartesian3.fromDegrees(f.Longitude,f.Latitude,f.Altitude)),o=this.viewer.entities.add({name:"LinePath",polyline:{positions:n,width:e,material:g.Color.fromCssColorString(t),clampToGround:r}});this.pathEntities.push(o),console.log(`线路路径绘制完成: ${i.length} 个杆塔点`)}clearLinePath(){this.pathEntities.forEach(t=>{try{this.viewer.entities.remove(t)}catch(e){console.warn("Error removing path entity:",e)}}),this.pathEntities=[]}async generateCrossSection(t,e){return this.contourConstruction.generateCrossSection(t,e||{})}async generateLongSection(t){return this.contourConstruction.generateLongSection(t||{})}calculateCrossSectionLine(t,e){return this.contourConstruction.calculateCrossSectionLine(t,e)}async generateCrossSectionWithFeatures(t,e,r){return this.contourConstruction.generateCrossSectionWithFeatures(t,e,r)}setLineInfoForContour(t){this.contourConstruction.setLineInfo(t)}}class uh{constructor(){T(this,"id","");T(this,"name","");T(this,"towerFZinfo","");T(this,"towerDisFile","");T(this,"stressFileContent","");T(this,"streesistrue",0);T(this,"TowerMemberColor","#FFFFFF");T(this,"TowerMembersWidth",2);T(this,"Longitude",0);T(this,"Latitude",0);T(this,"Altitude",0);T(this,"RollX",0);T(this,"RollY",90);T(this,"RollZ",0)}}function hh(s){debugger;const t=s.split(`
8
+ `),e=[],r=[],i=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,n=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const o of t){const f=o.trim();if(!f)continue;const u=f.match(i);if(u){e.push({id:parseInt(u[1]),x:parseFloat(u[2]),y:parseFloat(u[3]),z:parseFloat(u[4]),flag:parseInt(u[5])});continue}const l=f.match(n);l&&r.push({from:parseInt(l[1]),to:parseInt(l[2]),type:parseInt(l[3])})}return{TowerNodes:e,connections:r}}function lh(s){const t=s.split(`
9
+ `),e=[];for(const r of t){if(!r.trim())continue;const i=r.trim().split(/\s+/).filter(f=>f!==""),n=parseInt(i[0]);if(isNaN(n))continue;const o=[];for(let f=1;f<i.length;f+=3){const u=parseFloat(i[f]),l=parseFloat(i[f+1]),a=parseFloat(i[f+2]);if(!isNaN(u)&&!isNaN(l)&&!isNaN(a)){const c=Math.floor((f-1)/3)+1;o.push({timeStep:c,x:u,y:l,z:a})}}e.push({nodeId:n,displacements:o})}return e}function of(s){const t={};return s.forEach(e=>{e.displacements.forEach(r=>{t[r.timeStep]||(t[r.timeStep]=[]),t[r.timeStep].push({nodeId:e.nodeId,...r})})}),t}function ch(s){const t=s.split(`
10
+ `),e=[];for(const i of t){if(!i.trim())continue;const n=i.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(n){const o=n[1].replace(/\s+/g,""),f=n[2].trim().split(/\s+/).map(Number);e.push({elementId:o,stressRatios:f})}}const r=[];if(e.length>0){const i=e[0].stressRatios.length;for(let n=0;n<i;n++){const o={timeIndex:n,elements:[]};for(const f of e){let u;const l=f.stressRatios[n];l>1?u=bt.Color.RED:l>.95&&l<=1?u=bt.Color.PINK:l>.85&&l<=.95?u=bt.Color.YELLOW:l>.7&&l<=.85?u=bt.Color.GREEN:u=bt.Color.BLUE,o.elements.push({elementId:f.elementId,stressRatio:l,ylbColor:u})}r.push(o)}}return{byElement:e,byTime:r}}class af{constructor(t){T(this,"viewer");T(this,"lines",[]);this.viewer=t}addLine(t,e){const r=lf(this.viewer,t,e);return this.lines.push(r),r}removeAll(){this.lines.forEach(t=>this.viewer.entities.remove(t)),this.lines=[]}}var ff={exports:{}};(function(s,t){(function(e,r){r()})(Ps,function(){function e(l,a){return typeof a>"u"?a={autoBom:!1}:typeof a!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function r(l,a,c){var p=new XMLHttpRequest;p.open("GET",l),p.responseType="blob",p.onload=function(){u(p.response,a,c)},p.onerror=function(){console.error("could not download file")},p.send()}function i(l){var a=new XMLHttpRequest;a.open("HEAD",l,!1);try{a.send()}catch{}return 200<=a.status&&299>=a.status}function n(l){try{l.dispatchEvent(new MouseEvent("click"))}catch{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),l.dispatchEvent(a)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ps=="object"&&Ps.global===Ps?Ps:void 0,f=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(l,a,c){var p=o.URL||o.webkitURL,d=document.createElement("a");a=a||l.name||"download",d.download=a,d.rel="noopener",typeof l=="string"?(d.href=l,d.origin===location.origin?n(d):i(d.href)?r(l,a,c):n(d,d.target="_blank")):(d.href=p.createObjectURL(l),setTimeout(function(){p.revokeObjectURL(d.href)},4e4),setTimeout(function(){n(d)},0))}:"msSaveOrOpenBlob"in navigator?function(l,a,c){if(a=a||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(e(l,c),a);else if(i(l))r(l,a,c);else{var p=document.createElement("a");p.href=l,p.target="_blank",setTimeout(function(){n(p)})}}:function(l,a,c,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof l=="string")return r(l,a,c);var d=l.type==="application/octet-stream",h=/constructor/i.test(o.HTMLElement)||o.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||d&&h||f)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var I=_.result;I=m?I:I.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=I:location=I,p=null},_.readAsDataURL(l)}else{var W=o.URL||o.webkitURL,C=W.createObjectURL(l);p?p.location=C:location.href=C,p=null,setTimeout(function(){W.revokeObjectURL(C)},4e4)}});o.saveAs=u.saveAs=u,s.exports=u})})(ff);var Eo=ff.exports;const uf=require("shp-write");class ph{constructor(t,e,r){T(this,"towerNodes",[]);T(this,"connections",[]);T(this,"towerFZS");this.towerNodes=t,this.connections=e,this.towerFZS=r}async exportTowerToSHP(){try{const t=await this.generatePointFeatures(),e=await this.generateLineFeatures();await this.generateSHPFiles(t,e),console.log("SHP文件导出成功")}catch(t){console.error("导出SHP文件失败:",t)}}async generatePointFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const i of this.towerNodes){const n=new g.Cartesian3(i.x,i.y,i.z),o=this.getPositionByHprAndOffset(r,n,e),f=g.Ellipsoid.WGS84.cartesianToCartographic(o),u=g.Math.toDegrees(f.longitude),l=g.Math.toDegrees(f.latitude),a=f.height,c={type:"Feature",geometry:{type:"Point",coordinates:[u,l]},properties:{id:i.id,node_id:i.id,x:i.x,y:i.y,z:i.z,longitude:u,latitude:l,height:a,elevation:a,type:"tower_node"}};t.push(c)}return t}async generateLineFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const i of this.connections){const n=this.towerNodes.find(L=>L.id===i.from),o=this.towerNodes.find(L=>L.id===i.to);if(!n||!o)continue;const f=new g.Cartesian3(n.x,n.y,n.z),u=new g.Cartesian3(o.x,o.y,o.z),l=this.getPositionByHprAndOffset(r,f,e),a=this.getPositionByHprAndOffset(r,u,e),c=g.Ellipsoid.WGS84.cartesianToCartographic(l),p=g.Ellipsoid.WGS84.cartesianToCartographic(a),d=g.Math.toDegrees(c.longitude),h=g.Math.toDegrees(c.latitude),m=c.height,_=g.Math.toDegrees(p.longitude),W=g.Math.toDegrees(p.latitude),C=p.height,I={type:"Feature",geometry:{type:"LineString",coordinates:[[d,h],[_,W]]},properties:{id:`${i.from}-${i.to}`,from_node:i.from,to_node:i.to,from_height:m,to_height:C,avg_height:(m+C)/2,length:this.calculateDistance(l,a),type:"tower_member",width:this.towerFZS.TowerMembersWidth,from_longitude:d,from_latitude:h,to_longitude:_,to_latitude:W}};t.push(I)}return t}async generateSHPFiles(t,e){try{if(t.length>0){const r={type:"FeatureCollection",features:t},i=uf.point(r);this.downloadSHPFiles(i,"tower_nodes")}if(e.length>0){const r={type:"FeatureCollection",features:e},i=uf.line(r);this.downloadSHPFiles(i,"tower_members")}}catch(r){console.error("生成SHP文件时出错:",r),await this.alternativeExport(t,e)}}downloadSHPFiles(t,e){const r=new Blob([t],{type:"application/zip"});Eo.saveAs(r,`${e}.zip`)}async alternativeExport(t,e){if(console.log("使用备用方案导出为GeoJSON格式"),t.length>0){const r={type:"FeatureCollection",features:t};this.downloadJSON(r,"tower_nodes.geojson")}if(e.length>0){const r={type:"FeatureCollection",features:e};this.downloadJSON(r,"tower_members.geojson")}}downloadJSON(t,e){const r=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});Eo.saveAs(r,e)}calculateDistance(t,e){return g.Cartesian3.distance(t,e)}getPositionByHprAndOffset(t,e,r){const i=g.Transforms.headingPitchRollToFixedFrame(t,r);return g.Matrix4.multiplyByPoint(i,e,new g.Cartesian3)}}class gh{static async exportToCSV(t,e,r){const i=this.exportNodesToCSV(t,r);this.downloadCSV(i,"tower_nodes.csv");const n=this.exportConnectionsToCSV(e,t,r);this.downloadCSV(n,"tower_connections.csv")}static exportNodesToCSV(t,e){let r=`ID,X,Y,Z,Longitude,Latitude,Height
11
+ `;const i=new g.HeadingPitchRoll(g.Math.toRadians(e.RollX),e.RollY,e.RollZ),n=g.Cartesian3.fromDegrees(e.Longitude,e.Latitude,e.Altitude);return t.forEach(o=>{const f=new g.Cartesian3(o.x,o.y,o.z),u=this.getPositionByHprAndOffset(n,f,i),l=g.Ellipsoid.WGS84.cartesianToCartographic(u),a=g.Math.toDegrees(l.longitude),c=g.Math.toDegrees(l.latitude),p=l.height;r+=`${o.id},${o.x},${o.y},${o.z},${a},${c},${p}
12
+ `}),r}static exportConnectionsToCSV(t,e,r){let i=`FromNode,ToNode,FromX,FromY,FromZ,ToX,ToY,ToZ,Length
13
+ `;const n=new g.HeadingPitchRoll(g.Math.toRadians(r.RollX),r.RollY,r.RollZ),o=g.Cartesian3.fromDegrees(r.Longitude,r.Latitude,r.Altitude);return t.forEach(f=>{const u=e.find(m=>m.id===f.from),l=e.find(m=>m.id===f.to);if(!u||!l)return;const a=new g.Cartesian3(u.x,u.y,u.z),c=new g.Cartesian3(l.x,l.y,l.z),p=this.getPositionByHprAndOffset(o,a,n),d=this.getPositionByHprAndOffset(o,c,n),h=g.Cartesian3.distance(p,d);i+=`${f.from},${f.to},${u.x},${u.y},${u.z},${l.x},${l.y},${l.z},${h}
14
+ `}),i}static downloadCSV(t,e){const r=new Blob([t],{type:"text/csv;charset=utf-8;"});Eo.saveAs(r,e)}static getPositionByHprAndOffset(t,e,r){const i=g.Transforms.headingPitchRollToFixedFrame(t,r);return g.Matrix4.multiplyByPoint(i,e,new g.Cartesian3)}}class dh{constructor(t,e,r){T(this,"viewer");T(this,"TowerFZS");T(this,"Keym","");T(this,"dataSource2");T(this,"entityCollection2");T(this,"pointEntities",[]);T(this,"TowerLineManager");T(this,"TowerNodes",[]);T(this,"connections",[]);T(this,"displacementData",[]);T(this,"byTimes",[]);T(this,"_animationInterval",null);this.Keym=r,this.viewer=t,this.TowerFZS=e,this.dataSource2=new g.CustomDataSource(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities,this.TowerLineManager=new af(this.viewer)}initSHPExporter(){}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:t,connections:e}=hh(this.TowerFZS.towerFZinfo);this.TowerNodes=t,this.connections=e,this.displacementData=lh(this.TowerFZS.towerDisFile);const{byTime:r}=ch(this.TowerFZS.stressFileContent);this.byTimes=r;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let t=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const e=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(r=>{const i=this.TowerNodes.find(c=>c.id===r.from),n=this.TowerNodes.find(c=>c.id===r.to),o=[],f=new g.Cartesian3(i==null?void 0:i.x,i==null?void 0:i.y,i==null?void 0:i.z);o.push(b(e,f,t));const u=en(this.viewer,o[0],(i==null?void 0:i.id)+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(u);const l=new g.Cartesian3(n==null?void 0:n.x,n==null?void 0:n.y,n==null?void 0:n.z);o.push(b(e,l,t));const a=en(this.viewer,o[1],(i==null?void 0:i.id)+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(a),this.TowerLineManager.addLine(o)}),this.initSHPExporter()}async exportToSHP(){await new ph(this.TowerNodes,this.connections,this.TowerFZS).exportTowerToSHP()}async exportToCSV(){await gh.exportToCSV(this.TowerNodes,this.connections,this.TowerFZS)}loadFZDISTower(t){if(this.Keym!=="OW_JPS_EEngin_001")return;const r=of(this.displacementData)[t],i=this.byTimes.find(f=>f.timeIndex===t);debugger;if(!r){console.warn(`未找到时间步 ${t} 的位移数据`);return}const n=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),o=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(f=>{const u=this.TowerNodes.find(w=>w.id===f.from),l=this.TowerNodes.find(w=>w.id===f.to);if(!u||!l){console.warn(`找不到连接 ${f.from}->${f.to} 的节点`);return}debugger;const a=r.find(w=>w.nodeId===f.from),c=r.find(w=>w.nodeId===f.to);if(!a||!c){console.warn(`找不到连接 ${f.from}->${f.to} 的位移数据`);return}const p=new g.Cartesian3(u.x-a.x,u.y-a.y,u.z-a.z),d=new g.Cartesian3(l.x-c.x,l.y-c.y,l.z-c.z),h=b(o,p,n),m=en(this.viewer,h,f.from+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(m);const _=b(o,d,n),W=en(this.viewer,_,f.to+"",{pointColor:g.Color.RED,labelColor:g.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(W);const C=[h,_],I=f.from+"-"+f.to,L=i==null?void 0:i.elements.find(w=>w.elementId===I);debugger;this.TowerLineManager.addLine(C,{color:L==null?void 0:L.ylbColor,width:3,clampToGround:!1,zIndex:0,dashed:!1,dashLength:10})})}loadFZDISTower1(t){if(this.Keym!="OW_JPS_EEngin_001")return;const e=of(this.displacementData);let r=new g.HeadingPitchRoll(g.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const i=g.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(n=>{const o=this.TowerNodes.find(d=>d.id===n.from),f=e[t].find(d=>d.nodeId===n.from),u=this.TowerNodes.find(d=>d.id===n.to),l=e[t].find(d=>d.nodeId===n.to),a=[],c=new g.Cartesian3(o.x-f.x,o.y-f.y,o.z-f.z);a.push(b(i,c,r));const p=new g.Cartesian3(u.x-l.x,u.y-l.y,u.z-l.z);a.push(b(i,p,r));debugger;this.entityCollection2.add(y(a,n.from+""+n.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadAllFZDisTower(){if(this.Keym!=="OW_JPS_EEngin_001")return;if(!this.displacementData||this.displacementData.length===0){console.warn("没有可用的位移数据");return}let t=1;const e=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const r=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),t>e){t=1;return}this.dataSource2=new g.CustomDataSource("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(t),this.loadFZModel(),console.log(`正在显示位移帧: ${t}/${e}`),t++}catch(i){console.error("加载位移帧时出错:",i),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};r(),this._animationInterval=setInterval(r,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(t){t?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.TowerLineManager.removeAll(),this.pointEntities.forEach(t=>this.viewer.entities.remove(t)),this.pointEntities.length=0)}}dt.DistanceRuleConfig=tf,dt.GUAPoint=Su,dt.InsulatorInfo=Pu,dt.InsulatorType=jt,dt.LineManager=af,dt.LineNum=$s,dt.LineType=$a,dt.MeasurementResult=Eu,dt.OWEEgineFZManager=dh,dt.OWEEgineManager=fh,dt.PhaseSType=Ie,dt.TowerFZInfo=uh,dt.TowerInfo=wu,dt.TowerLineInfo=Lu,dt.TowerType=_i,dt.WairnumType=E,dt.corFeatureType=Au,dt.drawModel=Gn,dt.primaryDistanceType=$,Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"})});