ow-eengine-power 2.6.2 → 2.6.3
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,7 +1,7 @@
|
|
|
1
1
|
(function(pt,Pt){typeof exports=="object"&&typeof module<"u"?Pt(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],Pt):(pt=typeof globalThis<"u"?globalThis:pt||self,Pt(pt.OW_EEngine_Power={},pt.Cesium))})(this,function(pt,Pt){"use strict";var _h=Object.defineProperty;var Ch=(pt,Pt,is)=>Pt in pt?_h(pt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:is}):pt[Pt]=is;var L=(pt,Pt,is)=>Ch(pt,typeof Pt!="symbol"?Pt+"":Pt,is);function is(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=is(Pt);function gf(s,t,e={}){const{color:r=Pt.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 zn(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 sn(s,t,e,r={}){const{pointColor:i=Pt.Color.YELLOW,pointSize:n=12,labelColor:o=Pt.Color.WHITE,fontSize:f=16,pixelOffset:u=[0,-20],heightReference:l=Pt.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:Pt.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:Pt.Color.BLACK,heightReference:l,distanceDisplayCondition:new g.DistanceDisplayCondition(0,100)}})}var ye=63710088e-1,Oo={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 mr(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 Re(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(!xo(s[0])||!xo(s[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:s};return mr(r,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 r={type:"LineString",coordinates:s};return mr(r,t,e)}function nn(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 df(s,t,e){e===void 0&&(e={});var r={type:"MultiLineString",coordinates:s};return mr(r,t,e)}function Un(s,t){t===void 0&&(t="kilometers");var e=Oo[t];if(!e)throw new Error(t+" units is invalid");return s*e}function on(s,t){t===void 0&&(t="kilometers");var e=Oo[t];if(!e)throw new Error(t+" units is invalid");return s/e}function mf(s,t){return an(on(s,t))}function an(s){var t=s%(2*Math.PI);return t*180/Math.PI}function Ii(s){var t=s%360;return t*Math.PI/180}function Fo(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 Un(on(s,t),e)}function xo(s){return!isNaN(s)&&s!==null&&!Array.isArray(s)}function ko(s){return!!s&&s.constructor===Object}function qn(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,T=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,T)===!1)return!1;c++,I++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(t(u[r],c,W,I,T)===!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,T)===!1)return!1;c++}w==="MultiLineString"&&I++,w==="Polygon"&&T++}w==="Polygon"&&I++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(T=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,T)===!1)return!1;c++}T++}I++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(qn(o.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Hn(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 Zn(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 Vo(s,t){Zn(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(mr(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(mr(c,i),r,l)===!1)return!1}})}function yf(s,t){Vo(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(qn(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 _=ue([f,c],e.properties);if(t(_,r,i,m,n)===!1)return!1;n++,f=c})===!1)return!1}}})}function Kn(s){var t=[1/0,1/0,-1/0,-1/0];return qn(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}Kn.default=Kn;function Rr(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 vf(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 Go(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 _f(s,t){return s.type==="FeatureCollection"?"FeatureCollection":s.type==="GeometryCollection"?"GeometryCollection":s.type==="Feature"&&s.geometry!==null?s.geometry.type:s.type}var Ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function er(s,t,e){e===void 0&&(e={});var r=Rr(s),i=Rr(t),n=Ii(i[1]-r[1]),o=Ii(i[0]-r[0]),f=Ii(r[1]),u=Ii(i[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(f)*Math.cos(u);return Un(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),e.units)}function Cf(s){if(!s)throw new Error("geojson is required");switch(s.type){case"Feature":return Xo(s);case"FeatureCollection":return Wf(s);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return jn(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=Yo(s.properties),t.geometry=jn(s.geometry),t}function Yo(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]=Yo(r):t[e]=r}),t}function Wf(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 jn(s){var t={type:s.type};return s.bbox&&(t.bbox=s.bbox),s.type==="GeometryCollection"?(t.geometries=s.geometries.map(function(e){return jn(e)}),t):(t.coordinates=zo(s.coordinates),t)}function zo(s){var t=s;return typeof t[0]!="object"?t.slice():t.map(function(e){return zo(e)})}function Jn(s,t,e,r){r===void 0&&(r={});var i=Rr(s),n=Ii(i[0]),o=Ii(i[1]),f=Ii(e),u=on(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=an(a),p=an(l);return Re([c,p],r.properties)}function fn(s,t,e){if(e===void 0&&(e={}),e.final===!0)return If(s,t);var r=Rr(s),i=Rr(t),n=Ii(r[0]),o=Ii(i[0]),f=Ii(r[1]),u=Ii(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 an(Math.atan2(l,a))}function If(s,t){var e=fn(t,s);return e=(e+180)%360,e}function Tf(s,t){var e=er(s,t),r=fn(s,t),i=Jn(s,e/2,r);return i}function Lf(s,t){t===void 0&&(t={});var e=Kn(s),r=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return Re([r,i],t.properties,t)}function Af(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 Hn(t,function(n,o){var f=er(s,n);f<r&&(i=o,r=f)}),e=Cf(t.features[i]),e.properties.featureIndex=i,e.properties.distanceToPoint=r,e}function wf(s,t,e){e===void 0&&(e={});var r=Rr(s),i=Rr(t);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var n=Ef(r,i),o=Fo(n,"meters",e.units);return o}function Ef(s,t,e){e=e===void 0?ye: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 Mr(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=Re(s):s.type==="Point"?s=mr(s):Go(s,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=ue(t):t.type==="LineString"?t=mr(t):Go(t,"LineString","line");var r=1/0,i=s.geometry.coordinates;return yf(t,function(n){var o=n.geometry.coordinates[0],f=n.geometry.coordinates[1],u=Pf(i,o,f,e);u<r&&(r=u)}),Fo(r,"degrees",e.units)}function Pf(s,t,e,r){var i=[e[0]-t[0],e[1]-t[1]],n=[s[0]-t[0],s[1]-t[1]],o=Uo(n,i);if(o<=0)return Qn(s,t,{method:r.method,units:"degrees"});var f=Uo(i,i);if(f<=o)return Qn(s,e,{method:r.method,units:"degrees"});var u=o/f,l=[t[0]+u*i[0],t[1]+u*i[1]];return Qn(s,l,{method:r.method,units:"degrees"})}function Uo(s,t){return s[0]*t[0]+s[1]*t[1]}function Qn(s,t,e){return e.method==="planar"?wf(s,t,e):er(s,t,e)}function qo(s,t,e,r){if(r=r||{},!ko(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]),ue(n);l=fn(i[c],i[c-1])-180,a=Jn(i[c],u,l,r),n.push(a.geometry.coordinates)}if(f>=e)return u=e-f,u?(l=fn(i[c],i[c-1])-180,a=Jn(i[c],u,l,r),n.push(a.geometry.coordinates),ue(n)):(n.push(i[c]),ue(n));if(f>=t&&n.push(i[c]),c===i.length-1)return ue(n);f+=er(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 ue([p,p])}function un(s){var t=s[0],e=s[1];return[e[0]-t[0],e[1]-t[1]]}function $n(s,t){return s[0]*t[1]-t[0]*s[1]}function Sf(s,t){return[s[0]+t[0],s[1]+t[1]]}function Nf(s,t){return[s[0]-t[0],s[1]-t[1]]}function Df(s,t){return[s*t[0],s*t[1]]}function bf(s,t){var e=s[0],r=un(s),i=t[0],n=un(t),o=$n(r,n),f=Nf(i,e),u=$n(f,n),l=u/o,a=Sf(e,Df(l,r));return a}function Rf(s,t){var e=un(s),r=un(t);return $n(e,r)===0}function Mf(s,t){return Rf(s,t)?!1:bf(s,t)}function Bf(s,t,e){if(e=e||{},!ko(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=_f(s),n=s.properties;switch(i){case"LineString":return Ho(s,t,r);case"MultiLineString":var o=[];return Vo(s,function(f){o.push(Ho(f,t,r).geometry.coordinates)}),df(o,n);default:throw new Error("geometry "+i+" is not supported")}}function Ho(s,t,e){var r=[],i=mf(t,e),n=vf(s),o=[];return n.forEach(function(f,u){if(u!==n.length-1){var l=Of(f,n[u+1],i);if(r.push(l),u>0){var a=r[u-1],c=Mf(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 Of(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 Br=function(){};Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};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),j=function(){},Zo={MAX_VALUE:{configurable:!0}};j.isNaN=function(t){return Number.isNaN(t)},j.doubleToLongBits=function(t){return t},j.longBitsToDouble=function(t){return t},j.isInfinite=function(t){return!Number.isFinite(t)},Zo.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(j,Zo);var Me=function(){},hn=function(){},rs=function(){};function Be(){}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])},Or={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],r=arguments[1];return!(!Br.equalsWithTolerance(this.x,e.x,r)||!Br.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 vt("Invalid ordinate index: "+t)},A.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||j.isNaN(this.z))&&j.isNaN(t.z)},A.prototype.equals=function(t){return t instanceof A?this.equals2D(t):!1},A.prototype.equalInZ=function(t,e){return Br.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,hn,Be]},A.prototype.getClass=function(){return A},A.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=j.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Or.DimensionalComparator.get=function(){return ir},Or.serialVersionUID.get=function(){return 6683108902428367e3},Or.NULL_ORDINATE.get=function(){return j.NaN},Or.X.get=function(){return 0},Or.Y.get=function(){return 1},Or.Z.get=function(){return 2},Object.defineProperties(A,Or);var ir=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}}};ir.prototype.compare=function(t,e){var r=t,i=e,n=ir.compare(r.x,i.x);if(n!==0)return n;var o=ir.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var f=ir.compare(r.z,i.z);return f},ir.prototype.interfaces_=function(){return[rs]},ir.prototype.getClass=function(){return ir},ir.compare=function(t,e){return t<e?-1:t>e?1:j.isNaN(t)?j.isNaN(e)?0:-1:j.isNaN(e)?1:0};var ss=function(){};ss.prototype.create=function(){},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss};var P=function(){},Ds={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 vt("Unknown location value: "+t)},Ds.INTERIOR.get=function(){return 0},Ds.BOUNDARY.get=function(){return 1},Ds.EXTERIOR.get=function(){return 2},Ds.NONE.get=function(){return-1},Object.defineProperties(P,Ds);var H=function(s,t){return s.interfaces_&&s.interfaces_().indexOf(t)>-1},Ae=function(){},Ko={LOG_10:{configurable:!0}};Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.log10=function(t){var e=Math.log(t);return j.isInfinite(e)||j.isNaN(e)?e:e/Ae.LOG_10},Ae.min=function(t,e,r,i){var n=t;return e<n&&(n=e),r<n&&(n=r),i<n&&(n=i),n},Ae.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}},Ae.wrap=function(t,e){return t<0?e- -t%e:t%e},Ae.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}},Ae.average=function(t,e){return(t+e)/2},Ko.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ae,Ko);var ri=function(t){this.str=t};ri.prototype.append=function(t){this.str+=t},ri.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ri.prototype.toString=function(t){return this.str};var si=function(t){this.value=t};si.prototype.intValue=function(){return this.value},si.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},si.isNaN=function(t){return Number.isNaN(t)};var bs=function(){};bs.isWhitespace=function(t){return t<=32&&t>=0||t===127},bs.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)}},Ye={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 ri,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 j.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,T=W+(c-I);return this._hi=I,this._lo=T,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 j.isNaN(e)?S.createNaN():S.copy(this).selfMultiply(e,0)}},S.prototype.isNaN=function(){return j.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[Be,Me,hn]},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;bs.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++,bs.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=si.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(j.NaN,j.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 ri,i=0;i<e;i++)r.append(t);return r.toString()},Ye.PI.get=function(){return new S(3.141592653589793,12246467991473532e-32)},Ye.TWO_PI.get=function(){return new S(6.283185307179586,24492935982947064e-32)},Ye.PI_2.get=function(){return new S(1.5707963267948966,6123233995736766e-32)},Ye.E.get=function(){return new S(2.718281828459045,14456468917292502e-32)},Ye.NaN.get=function(){return new S(j.NaN,j.NaN)},Ye.EPS.get=function(){return 123259516440783e-46},Ye.SPLIT.get=function(){return 134217729},Ye.MAX_PRINT_DIGITS.get=function(){return 32},Ye.TEN.get=function(){return S.valueOf(10)},Ye.ONE.get=function(){return S.valueOf(1)},Ye.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ye.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(S,Ye);var he=function(){},jo={DP_SAFE_EPSILON:{configurable:!0}};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.orientationIndex=function(t,e,r){var i=he.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()},he.signOfDet2x2=function(t,e,r,i){var n=t.multiply(i).selfSubtract(e.multiply(r));return n.signum()},he.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)},he.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 he.signum(f);i=n+o}else if(n<0){if(o>=0)return he.signum(f);i=-n-o}else return he.signum(f);var u=he.DP_SAFE_EPSILON*i;return f>=u||-f>=u?he.signum(f):2},he.signum=function(t){return t>0?1:t<0?-1:0},jo.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(he,jo);var st=function(){},Rs={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Rs.X.get=function(){return 0},Rs.Y.get=function(){return 1},Rs.Z.get=function(){return 2},Rs.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[hn]},st.prototype.getClass=function(){return st},Object.defineProperties(st,Rs);var Jo=function(){},ns=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}(Jo),Xt=function(){};Xt.arraycopy=function(t,e,r,i,n){for(var o=0,f=e;f<e+n;f++)r[i+o]=t[f],o++},Xt.getProperty=function(t){return{"line.separator":`
|
|
2
2
|
`}[t]};var ze=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,T=d.x*h.y-h.x*d.y;this.x=_*T-I*W,this.y=C*W-m*T,this.w=m*I-C*_}};ze.prototype.getY=function(){var t=this.y/this.w;if(j.isNaN(t)||j.isInfinite(t))throw new ns;return t},ze.prototype.getX=function(){var t=this.x/this.w;if(j.isNaN(t)||j.isInfinite(t))throw new ns;return t},ze.prototype.getCoordinate=function(){var t=new A;return t.x=this.getX(),t.y=this.getY(),t},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.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(j.isNaN(h)||j.isInfinite(h)||j.isNaN(m)||j.isInfinite(m))throw new ns;return new A(h,m)};var G=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)}},Qo={serialVersionUID:{configurable:!0}};G.prototype.getArea=function(){return this.getWidth()*this.getHeight()},G.prototype.equals=function(t){if(!(t instanceof G))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()},G.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new G;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 G(e,i,r,n)},G.prototype.isNull=function(){return this._maxx<this._minx},G.prototype.getMaxX=function(){return this._maxx},G.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 G){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}},G.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof G){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)}},G.prototype.getMinY=function(){return this._miny},G.prototype.getMinX=function(){return this._minx},G.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 G){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))}},G.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},G.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},G.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},G.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},G.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},G.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},G.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},G.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},G.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()}},G.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof G){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)}},G.prototype.centre=function(){return this.isNull()?null:new A((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},G.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 G){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)}},G.prototype.getMaxY=function(){return this._maxy},G.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)},G.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},G.prototype.interfaces_=function(){return[Me,Be]},G.prototype.getClass=function(){return G},G.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)}},Qo.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(G,Qo);var ni={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*$/},ln=function(t){this.geometryFactory=t||new tt};ln.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var n=ni.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(n=ni.emptyTypeStr.exec(t),n[2]=void 0),n&&(r=n[1].toLowerCase(),i=n[2],os[r]&&(e=os[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},ln.prototype.write=function(t){return this.extractGeometry(t)},ln.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Vi[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Vi[e].apply(this,[t])+")",i};var Vi={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Vi.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("("+Vi.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(Vi.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(Vi.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("("+Vi.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+Vi.linestring.apply(this,[t._shell])+")");for(var i=0,n=t._holes.length;i<n;++i)r.push("("+Vi.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("("+Vi.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(",")}},os={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(ni.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(ni.trimParens,"$1"),n.push(os.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(ni.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(ni.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(ni.parenComma),n=[],o=0,f=i.length;o<f;++o)r=i[o].replace(ni.trimParens,"$1"),n.push(os.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(ni.parenComma),f,u=[],l=0,a=o.length;l<a;++l)r=o[l].replace(ni.trimParens,"$1"),i=os.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(ni.doubleParenComma),n=[],o=0,f=i.length;o<f;++o)r=i[o].replace(ni.trimParens,"$1"),n.push(os.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)}},Ue=function(t){this.parser=new ln(t)};Ue.prototype.write=function(t){return this.parser.write(t)},Ue.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Gi=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),cn=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}(Gi),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 cn("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 cn:new cn(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 cn("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};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},Fr={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 ri;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},_t.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)},_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),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)}},_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],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}},_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 r=_t.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r},_t.prototype.isCollinear=function(){return this._result===_t.COLLINEAR_INTERSECTION},_t.prototype.toString=function(){return Ue.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ue.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,r=0;r<this._result;r++)if(e._intPt[r].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,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},_t.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},Fr.DONT_INTERSECT.get=function(){return 0},Fr.DO_INTERSECT.get=function(){return 1},Fr.COLLINEAR.get=function(){return 2},Fr.NO_INTERSECTION.get=function(){return 0},Fr.POINT_INTERSECTION.get=function(){return 1},Fr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(_t,Fr);var yr=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 G(this._inputLines[0][0],this._inputLines[0][1]),n=new G(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,G.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=ze.intersection(r,i,n,o)}catch(u){if(u instanceof ns)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=he.intersection(r,i,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(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=G.intersects(r,i,n),u=G.intersects(r,i,o),l=G.intersects(n,o,r),a=G.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,T=(_+W)/2,w=(C+I)/2;f.x=T,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,!G.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}(_t),xr=function(){};xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},xr.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 xr.signOfDet2x2(i,n,o,f)},xr.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 oi=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};oi.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=xr.signOfDet2x2(n,o,f,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},oi.prototype.isPointInPolygon=function(){return this.getLocation()!==P.EXTERIOR},oi.prototype.getLocation=function(){return this._isPointOnSegment?P.BOUNDARY:this._crossingCount%2===1?P.INTERIOR:P.EXTERIOR},oi.prototype.isOnSegment=function(){return this._isPointOnSegment},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.locatePointInRing=function(){if(arguments[0]instanceof A&&H(arguments[1],st)){for(var t=arguments[0],e=arguments[1],r=new oi(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 oi(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(){},kr={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 he.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(H(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(!G.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?Ae.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 vt("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 oi.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 vt("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 yr,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},kr.CLOCKWISE.get=function(){return-1},kr.RIGHT.get=function(){return V.CLOCKWISE},kr.COUNTERCLOCKWISE.get=function(){return 1},kr.LEFT.get=function(){return V.COUNTERCLOCKWISE},kr.COLLINEAR.get=function(){return 0},kr.STRAIGHT.get=function(){return V.COLLINEAR},Object.defineProperties(V,kr);var Xi=function(){};Xi.prototype.filter=function(t){},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi};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()},Ti={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 vt("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 G(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[hn,Me,Be]},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},Ti.serialVersionUID.get=function(){return 8763622679187377e3},Ti.SORTINDEX_POINT.get=function(){return 0},Ti.SORTINDEX_MULTIPOINT.get=function(){return 1},Ti.SORTINDEX_LINESTRING.get=function(){return 2},Ti.SORTINDEX_LINEARRING.get=function(){return 3},Ti.SORTINDEX_MULTILINESTRING.get=function(){return 4},Ti.SORTINDEX_POLYGON.get=function(){return 5},Ti.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Ti.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Ti.geometryChangedFilter.get=function(){return to},Object.defineProperties(U,Ti);var to=function(){};to.interfaces_=function(){return[Xi]},to.filter=function(t){t.geometryChangedAction()};var Li=function(){};Li.prototype.filter=function(t){},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Oe=function(){},Yi={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}};Oe.prototype.isInBoundary=function(t){},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Yi.Mod2BoundaryNodeRule.get=function(){return as},Yi.EndPointBoundaryNodeRule.get=function(){return fs},Yi.MultiValentEndPointBoundaryNodeRule.get=function(){return us},Yi.MonoValentEndPointBoundaryNodeRule.get=function(){return hs},Yi.MOD2_BOUNDARY_RULE.get=function(){return new as},Yi.ENDPOINT_BOUNDARY_RULE.get=function(){return new fs},Yi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new us},Yi.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new hs},Yi.OGC_SFS_BOUNDARY_RULE.get=function(){return Oe.MOD2_BOUNDARY_RULE},Object.defineProperties(Oe,Yi);var as=function(){};as.prototype.isInBoundary=function(t){return t%2===1},as.prototype.interfaces_=function(){return[Oe]},as.prototype.getClass=function(){return as};var fs=function(){};fs.prototype.isInBoundary=function(t){return t>0},fs.prototype.interfaces_=function(){return[Oe]},fs.prototype.getClass=function(){return fs};var us=function(){};us.prototype.isInBoundary=function(t){return t>1},us.prototype.interfaces_=function(){return[Oe]},us.prototype.getClass=function(){return us};var hs=function(){};hs.prototype.isInBoundary=function(t){return t===1},hs.prototype.interfaces_=function(){return[Oe]},hs.prototype.getClass=function(){return hs};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 eo(s){this.message=s||""}eo.prototype=new Error,eo.prototype.name="IndexOutOfBoundsException";var ls=function(){};ls.prototype.hasNext=function(){},ls.prototype.next=function(){},ls.prototype.remove=function(){};var qe=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 cs(s){this.message=s||""}cs.prototype=new Error,cs.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 Ff(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new eo;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}(qe),Ff=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 cs;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}(ls),Ms=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],T=arguments[2];if(!T){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 b=this.get(C);if(b.equals2D(I))return null}}}s.prototype.add.call(this,C,I)}}else if(arguments.length===4){var B=arguments[0],R=arguments[1],F=arguments[2],M=arguments[3],q=1;F>M&&(q=-1);for(var Z=F;Z!==M;Z+=q)i.add(B[Z],R);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),$=function(){},pn={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};pn.ForwardComparator.get=function(){return Bs},pn.BidirectionalComparator.get=function(){return ps},pn.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 r=0;r<t.length;r++){var i=t[r];if($.indexOf(i,e)<0)return i}return null},$.scroll=function(t,e){var r=$.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);Xt.arraycopy(t,r,i,0,t.length-r),Xt.arraycopy(t,0,i,t.length-r,r),Xt.arraycopy(i,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 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}},$.intersection=function(t,e){for(var r=new Ms,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.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 Ms(t,!1);return e.toCoordinateArray()},$.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}},$.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},$.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])},$.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},$.envelope=function(t){for(var e=new G,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e},$.toCoordinateArray=function(t){return t.toArray($.coordArrayType)},$.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},$.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1},$.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},$.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},$.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},$.extract=function(t,e,r){e=Ae.clamp(e,0,t.length),r=Ae.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($,pn);var Bs=function(){};Bs.prototype.compare=function(t,e){var r=t,i=e;return $.compare(r,i)},Bs.prototype.interfaces_=function(){return[rs]},Bs.prototype.getClass=function(){return Bs};var ps=function(){};ps.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=$.compare(r,i),o=$.isEqualReversed(r,i);return o?0:n},ps.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=$.increasingDirection(r),o=$.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},ps.prototype.interfaces_=function(){return[rs]},ps.prototype.getClass=function(){return ps};var Vr=function(){};Vr.prototype.get=function(){},Vr.prototype.put=function(){},Vr.prototype.size=function(){},Vr.prototype.values=function(){},Vr.prototype.entrySet=function(){};var xf=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}(Vr);function Os(s){this.message=s||""}Os.prototype=new Error,Os.prototype.name="OperationNotSupported";function gn(){}gn.prototype=new bt,gn.prototype.contains=function(){};var io=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 kf(this)},t}(gn),kf=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 cs;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Os},t}(ls),zi=0,vr=1;function $o(s){return s===null?zi:s.color}function dt(s){return s===null?null:s.parent}function Ui(s,t){s!==null&&(s.color=t)}function ro(s){return s===null?null:s.left}function ta(s){return s===null?null:s.right}function jt(){this.root_=null,this.size_=0}jt.prototype=new xf,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:zi,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:zi,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=vr;s!=null&&s!==this.root_&&s.parent.color===vr;)if(dt(s)===ro(dt(dt(s)))){var e=ta(dt(dt(s)));$o(e)===vr?(Ui(dt(s),zi),Ui(e,zi),Ui(dt(dt(s)),vr),s=dt(dt(s))):(s===ta(dt(s))&&(s=dt(s),t.rotateLeft(s)),Ui(dt(s),zi),Ui(dt(dt(s)),vr),t.rotateRight(dt(dt(s))))}else{var r=ro(dt(dt(s)));$o(r)===vr?(Ui(dt(s),zi),Ui(r,zi),Ui(dt(dt(s)),vr),s=dt(dt(s))):(s===ro(dt(s))&&(s=dt(s),t.rotateRight(s)),Ui(dt(s),zi),Ui(dt(dt(s)),vr),t.rotateLeft(dt(dt(s))))}this.root_.color=zi},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 io,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 Fs=function(){};Fs.prototype.interfaces_=function(){return[]},Fs.prototype.getClass=function(){return Fs};function ea(){}ea.prototype=new gn;function ai(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}ai.prototype=new ea,ai.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},ai.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},ai.prototype.addAll=function(s){for(var t=this,e=s.iterator();e.hasNext();)t.add(e.next());return!0},ai.prototype.remove=function(s){throw new Os},ai.prototype.size=function(){return this.array_.length},ai.prototype.isEmpty=function(){return this.array_.length===0},ai.prototype.toArray=function(){for(var s=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(s.array_[e]);return t},ai.prototype.iterator=function(){return new dn(this)};var dn=function(s){this.treeSet_=s,this.position_=0};dn.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new cs;return this.treeSet_.array_[this.position_++]},dn.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},dn.prototype.remove=function(){throw new Os};var _r=function(){};_r.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])},_r.asList=function(t){for(var e=new k,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var ot=function(){},He={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}};He.P.get=function(){return 0},He.L.get=function(){return 1},He.A.get=function(){return 2},He.FALSE.get=function(){return-1},He.TRUE.get=function(){return-2},He.DONTCARE.get=function(){return-3},He.SYM_FALSE.get=function(){return"F"},He.SYM_TRUE.get=function(){return"T"},He.SYM_DONTCARE.get=function(){return"*"},He.SYM_P.get=function(){return"0"},He.SYM_L.get=function(){return"1"},He.SYM_A.get=function(){return"2"},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.toDimensionSymbol=function(t){switch(t){case ot.FALSE:return ot.SYM_FALSE;case ot.TRUE:return ot.SYM_TRUE;case ot.DONTCARE:return ot.SYM_DONTCARE;case ot.P:return ot.SYM_P;case ot.L:return ot.SYM_L;case ot.A:return ot.SYM_A}throw new vt("Unknown dimension value: "+t)},ot.toDimensionValue=function(t){switch(bs.toUpperCase(t)){case ot.SYM_FALSE:return ot.FALSE;case ot.SYM_TRUE:return ot.TRUE;case ot.SYM_DONTCARE:return ot.DONTCARE;case ot.SYM_P:return ot.P;case ot.SYM_L:return ot.L;case ot.SYM_A:return ot.A}throw new vt("Unknown dimension symbol: "+t)},Object.defineProperties(ot,He);var fi=function(){};fi.prototype.filter=function(t){},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi};var Ze=function(){};Ze.prototype.filter=function(t,e){},Ze.prototype.isDone=function(){},Ze.prototype.isGeometryChanged=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var te=function(s){function t(r,i){if(s.call(this,i),this._geometries=r||[],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 i=this,n=new G,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();_r.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,n=ot.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=ot.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 ai(_r.asList(this._geometries)),f=new ai(_r.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(H(arguments[0],Li))for(var n=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(n);else if(H(arguments[0],Ze)){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(H(arguments[0],fi)){var l=arguments[0];l.filter(this);for(var a=0;a<this._geometries.length;a++)i._geometries[a].apply(l)}else if(H(arguments[0],Xi)){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),Cr=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()?ot.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 Fe(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[Fs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(te),Fe=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Oe.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}};Fe.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)},Fe.prototype.getBoundary=function(){return this._geom instanceof Wt?this.boundaryLineString(this._geom):this._geom instanceof Cr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Fe.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()])},Fe.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Fe.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 $.toCoordinateArray(r)},Fe.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new mn,this._endpointMap.put(t,e)),e.count++},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Fe(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new Fe(r,i);return n.getBoundary()}};var mn=function(){this.count=null};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};function Vf(){}function Gf(){}var Xf=function(){};function Yf(){}function zf(){}function Uf(){}var xe=function(){},so={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)},xe.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Yf,r=new Vf;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],n=arguments[1],o="";new Gf(xe.getStackTrace(i));for(var f=new Uf,u=0;u<n;u++)try{o+=f.readLine()+xe.NEWLINE}catch(l){if(l instanceof zf)Q.shouldNeverReachHere();else throw l}finally{}return o}},xe.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},xe.toString=function(){if(arguments.length===1){var t=arguments[0];return xe.SIMPLE_ORDINATE_FORMAT.format(t)}},xe.spaces=function(t){return xe.chars(" ",t)},so.NEWLINE.get=function(){return Xt.getProperty("line.separator")},so.SIMPLE_ORDINATE_FORMAT.get=function(){return new Xf},Object.defineProperties(xe,so);var Lt=function(){};Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.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))},Lt.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)},Lt.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)&&!(j.isNaN(u)&&j.isNaN(l)))return!1}return!0},Lt.extend=function(t,e,r){var i=t.create(r,e.getDimension()),n=e.size();if(Lt.copy(e,0,i,0,n),n>0)for(var o=n;o<r;o++)Lt.copy(e,n-1,i,o,1);return i},Lt.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)Lt.swap(t,i,e-i)},Lt.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)}},Lt.copy=function(t,e,r,i,n){for(var o=0;o<n;o++)Lt.copyCoord(t,e+o,r,i+o)},Lt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new ri;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(xe.toString(t.getOrdinate(n,o)))}return i.append(")"),i.toString()}},Lt.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return Lt.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:Lt.createClosedRing(t,e,r+1)},Lt.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),n=e.size();Lt.copy(e,0,i,0,n);for(var o=n;o<r;o++)Lt.copy(e,0,i,o,1);return i};var Wt=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 G:this._points.expandEnvelope(new G)},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&&Lt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?ot.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();Lt.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(H(arguments[0],Li))for(var n=arguments[0],o=0;o<this._points.size();o++)n.filter(i._points.getCoordinate(o));else if(H(arguments[0],Ze)){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(H(arguments[0],fi)){var l=arguments[0];l.filter(this)}else if(H(arguments[0],Xi)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return new Fe(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 vt("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[Fs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(U),xs=function(){};xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs};var ve=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 G;var i=new G;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 ot.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(H(arguments[0],Li)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(H(arguments[0],Ze)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this._coordinates,0),n.isGeometryChanged()&&this.geometryChanged()}else if(H(arguments[0],fi)){var o=arguments[0];o.filter(this)}else if(H(arguments[0],Xi)){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[xs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(U),rr=function(){};rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr};var Rt=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 vt("holes must not contain null elements");if(r.isEmpty()&&s.hasNonEmptyElements(i))throw new vt("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);_r.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],V.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 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(H(i,Li)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)n._holes[o].apply(i)}else if(H(i,Ze)){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(H(i,fi))i.filter(this);else if(H(i,Xi)){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[rr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(U),gs=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 ot.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[xs]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(te),Ai=function(s){function t(r,i){r instanceof A&&i instanceof tt&&(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 ot.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:s.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Lt.reverse(i);var n=this.getFactory().createLinearRing(i);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),wi=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[rr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(te),ke=function(t){this._factory=t||null,this._isUserDataCopied=!1},yn={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};ke.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},ke.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r},ke.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof te?this.editGeometryCollection(t,e):t instanceof Rt?this.editPolygon(t,e):t instanceof ve?e.edit(t,this._factory):t instanceof Wt?e.edit(t,this._factory):(Q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},ke.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()===gs?this._factory.createMultiPoint(n.toArray([])):i.getClass()===Cr?this._factory.createMultiLineString(n.toArray([])):i.getClass()===wi?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},ke.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([]))},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.GeometryEditorOperation=function(){},yn.NoOpGeometryOperation.get=function(){return ks},yn.CoordinateOperation.get=function(){return Vs},yn.CoordinateSequenceOperation.get=function(){return Gs},Object.defineProperties(ke,yn);var ks=function(){};ks.prototype.edit=function(t,e){return t},ks.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},ks.prototype.getClass=function(){return ks};var Vs=function(){};Vs.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof Ai?e.createLinearRing(r):t instanceof Wt?e.createLineString(r):t instanceof ve?r.length>0?e.createPoint(r[0]):e.createPoint():t},Vs.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},Vs.prototype.getClass=function(){return Vs};var Gs=function(){};Gs.prototype.edit=function(t,e){return t instanceof Ai?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Gs.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},Gs.prototype.getClass=function(){return Gs};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 r=0;r<e;r++)t._coordinates[r]=new A}else if(H(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}}},ia={serialVersionUID:{configurable:!0}};At.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 vt("invalid ordinateIndex")}},At.prototype.size=function(){return this._coordinates.length},At.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 j.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],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.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),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new At(e,this._dimension)},At.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t},At.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 At(e,this._dimension)},At.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new ri(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"()"},At.prototype.getY=function(t){return this._coordinates[t].y},At.prototype.toCoordinateArray=function(){return this._coordinates},At.prototype.interfaces_=function(){return[st,Be]},At.prototype.getClass=function(){return At},ia.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(At,ia);var Ei=function(){},no={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ei.prototype.readResolve=function(){return Ei.instance()},Ei.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new At(t)}else if(H(arguments[0],st)){var e=arguments[0];return new At(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new At(r):new At(r,i)}},Ei.prototype.interfaces_=function(){return[ss,Be]},Ei.prototype.getClass=function(){return Ei},Ei.instance=function(){return Ei.instanceObject},no.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},no.instanceObject.get=function(){return new Ei},Object.defineProperties(Ei,no);var ra=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 io;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(Vr),at=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 ui){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}}},oo={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};at.prototype.equals=function(t){if(!(t instanceof at))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},at.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new si(r).compareTo(new si(i))},at.prototype.getScale=function(){return this._scale},at.prototype.isFloating=function(){return this._modelType===at.FLOATING||this._modelType===at.FLOATING_SINGLE},at.prototype.getType=function(){return this._modelType},at.prototype.toString=function(){var t="UNKNOWN";return this._modelType===at.FLOATING?t="Floating":this._modelType===at.FLOATING_SINGLE?t="Floating-Single":this._modelType===at.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},at.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(j.isNaN(t))return t;if(this._modelType===at.FLOATING_SINGLE){var e=t;return e}return this._modelType===at.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof A){var r=arguments[0];if(this._modelType===at.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},at.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===at.FLOATING?t=16:this._modelType===at.FLOATING_SINGLE?t=6:this._modelType===at.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},at.prototype.setScale=function(t){this._scale=Math.abs(t)},at.prototype.interfaces_=function(){return[Be,Me]},at.prototype.getClass=function(){return at},at.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},oo.serialVersionUID.get=function(){return 7777263578777804e3},oo.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(at,oo);var ui=function s(t){this._name=t||null,s.nameToTypeMap.put(t,this)},ao={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ui.prototype.readResolve=function(){return ui.nameToTypeMap.get(this._name)},ui.prototype.toString=function(){return this._name},ui.prototype.interfaces_=function(){return[Be]},ui.prototype.getClass=function(){return ui},ao.serialVersionUID.get=function(){return-552860263173159e4},ao.nameToTypeMap.get=function(){return new ra},Object.defineProperties(ui,ao),at.Type=ui,at.FIXED=new ui("FIXED"),at.FLOATING=new ui("FLOATING"),at.FLOATING_SINGLE=new ui("FLOATING SINGLE");var tt=function s(){this._precisionModel=new at,this._SRID=0,this._coordinateSequenceFactory=s.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?H(arguments[0],ss)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof at&&(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]))},sa={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(H(t,st))return new Wt(t,this)}else return new Wt(this.getCoordinateSequenceFactory().create([]),this)},tt.prototype.createMultiLineString=function(){if(arguments.length===0)return new Cr(null,this);if(arguments.length===1){var t=arguments[0];return new Cr(t,this)}},tt.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(tt.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Rt)return this.createMultiPolygon(tt.toPolygonArray(t));if(u instanceof Wt)return this.createMultiLineString(tt.toLineStringArray(t));if(u instanceof ve)return this.createMultiPoint(tt.toPointArray(t));Q.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(H(arguments[0],st)){var e=arguments[0];return new ve(e,this)}}},tt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},tt.prototype.createPolygon=function(){if(arguments.length===0)return new Rt(null,null,this);if(arguments.length===1){if(H(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 Ai){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return new Rt(i,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 ke(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},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(H(arguments[0],st)){var e=arguments[0];return new Ai(e,this)}}},tt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new wi(null,this);if(arguments.length===1){var t=arguments[0];return new wi(t,this)}},tt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new gs(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new gs(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(H(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());Lt.copy(i,o,f,0,1),n[o]=t.createPoint(f)}return this.createMultiPoint(n)}}},tt.prototype.interfaces_=function(){return[Be]},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 Ei.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)},sa.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(tt,sa);var qf=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],vn=function(t){this.geometryFactory=t||new tt};vn.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!hi[r])throw new Error("Unknown GeoJSON type: "+e.type);return qf.indexOf(r)!==-1?hi[r].apply(this,[e.coordinates]):r==="GeometryCollection"?hi[r].apply(this,[e.geometries]):hi[r].apply(this,[e])},vn.prototype.write=function(t){var e=t.getGeometryType();if(!qi[e])throw new Error("Geometry is not supported");return qi[e].apply(this,[t])};var hi={Feature:function(s){var t={};for(var e in s)t[e]=s[e];if(s.geometry){var r=s.geometry.type;if(!hi[r])throw new Error("Unknown GeoJSON type: "+s.type);t.geometry=this.read(s.geometry)}return s.bbox&&(t.bbox=hi.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(hi.Point.apply(t,[s[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(s){var t=hi.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(hi.LineString.apply(t,[s[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(s){for(var t=this,e=hi.coordinates.apply(this,[s[0]]),r=this.geometryFactory.createLinearRing(e),i=[],n=1;n<s.length;++n){var o=s[n],f=hi.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(hi.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)}},qi={coordinate:function(s){return[s.x,s.y]},Point:function(s){var t=qi.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=qi.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(qi.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=qi.LineString.apply(t,[i]);e.push(n.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(s){var t=this,e=[],r=qi.LineString.apply(this,[s._shell]);e.push(r.coordinates);for(var i=0;i<s._holes.length;++i){var n=s._holes[i],o=qi.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=qi.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(qi[n].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},fo=function(t){this.geometryFactory=t||new tt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new vn(this.geometryFactory)};fo.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===at.FIXED&&this.reducePrecision(e),e},fo.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 na=function(){this.parser=new vn(this.geometryFactory)};na.prototype.write=function(t){return this.parser.write(t)};var x=function(){},_n={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},_n.ON.get=function(){return 0},_n.LEFT.get=function(){return 1},_n.RIGHT.get=function(){return 2},Object.defineProperties(x,_n);function Cn(s){this.message=s||""}Cn.prototype=new Error,Cn.prototype.name="EmptyStackException";function li(){this.array_=[]}li.prototype=new qe,li.prototype.add=function(s){return this.array_.push(s),!0},li.prototype.get=function(s){if(s<0||s>=this.size())throw new Error;return this.array_[s]},li.prototype.push=function(s){return this.array_.push(s),s},li.prototype.pop=function(s){if(this.array_.length===0)throw new Cn;return this.array_.pop()},li.prototype.peek=function(){if(this.array_.length===0)throw new Cn;return this.array_[this.array_.length-1]},li.prototype.empty=function(){return this.array_.length===0},li.prototype.isEmpty=function(){return this.empty()},li.prototype.search=function(s){return this.array_.indexOf(s)},li.prototype.size=function(){return this.array_.length},li.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 ci=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};ci.prototype.getCoordinate=function(){return this._minCoord},ci.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},ci.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)},ci.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},ci.prototype.getEdge=function(){return this._orientedDe},ci.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])},ci.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)},ci.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())},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var Hi=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}(Gi),Wn=function(){this.array_=[]};Wn.prototype.addLast=function(t){this.array_.push(t)},Wn.prototype.removeFirst=function(){return this.array_.shift()},Wn.prototype.isEmpty=function(){return this.array_.length===0};var ee=function(){this._finder=null,this._dirEdgeList=new k,this._nodes=new k,this._rightMostCoord=null,this._env=null,this._finder=new ci};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,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 Hi("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)}},ee.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(x.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(x.RIGHT)>=1&&e.getDepth(x.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ee.prototype.computeDepths=function(t){var e=this,r=new io,i=new Wn,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))}}}},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 G,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},ee.prototype.addReachable=function(t){var e=this,r=new li;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}},ee.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(x.LEFT,t.getDepth(x.RIGHT)),e.setDepth(x.RIGHT,t.getDepth(x.LEFT))},ee.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)}},ee.prototype.getNodes=function(){return this._nodes},ee.prototype.getDirectedEdges=function(){return this._dirEdgeList},ee.prototype.interfaces_=function(){return[Me]},ee.prototype.getClass=function(){return ee};var mt=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}};mt.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t},mt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==P.NONE)return!1;return!0},mt.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===P.NONE&&(e.location[r]=t)},mt.prototype.isLine=function(){return this.location.length===1},mt.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])},mt.prototype.getLocations=function(){return this.location},mt.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},mt.prototype.toString=function(){var t=new ri;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()},mt.prototype.setLocations=function(t,e,r){this.location[x.ON]=t,this.location[x.LEFT]=e,this.location[x.RIGHT]=r},mt.prototype.get=function(t){return t<this.location.length?this.location[t]:P.NONE},mt.prototype.isArea=function(){return this.location.length>1},mt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===P.NONE)return!0;return!1},mt.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}},mt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(P.NONE)},mt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},mt.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0},mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt};var lt=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 mt(t),this.elt[1]=new mt(t)}else if(arguments[0]instanceof s){var e=arguments[0];this.elt[0]=new mt(e.elt[0]),this.elt[1]=new mt(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new mt(P.NONE),this.elt[1]=new mt(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 mt(n,o,f),this.elt[1]=new mt(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 mt(P.NONE,P.NONE,P.NONE),this.elt[1]=new mt(P.NONE,P.NONE,P.NONE),this.elt[u].setLocations(l,a,c)}};lt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},lt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},lt.prototype.isNull=function(t){return this.elt[t].isNull()},lt.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)}},lt.prototype.isLine=function(t){return this.elt[t].isLine()},lt.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 mt(t.elt[r]):e.elt[r].merge(t.elt[r])},lt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},lt.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)}},lt.prototype.toString=function(){var t=new ri;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()},lt.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()}},lt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},lt.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)}},lt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},lt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},lt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new mt(this.elt[t].location[0]))},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},lt.toLineLabel=function(t){for(var e=new lt(P.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var St=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new k,this._pts=new k,this._label=new lt(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()};St.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())},St.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},St.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Hi("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Hi("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)},St.prototype.getLinearRing=function(){return this._ring},St.prototype.getCoordinate=function(t){return this._pts.get(t)},St.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},St.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])}},St.prototype.isHole=function(){return this._isHole},St.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},St.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},St.prototype.addHole=function(t){this._holes.add(t)},St.prototype.isShell=function(){return this._shell===null},St.prototype.getLabel=function(){return this._label},St.prototype.getEdges=function(){return this._edges},St.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},St.prototype.getShell=function(){return this._shell},St.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}},St.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},St.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},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St};var Hf=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}(St),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.buildMinimalRings=function(){var r=this,i=new k,n=this._startDe;do{if(n.getMinEdgeRing()===null){var o=new Hf(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}(St),we=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}}};we.prototype.setVisited=function(t){this._isVisited=t},we.prototype.setInResult=function(t){this._isInResult=t},we.prototype.isCovered=function(){return this._isCovered},we.prototype.isCoveredSet=function(){return this._isCoveredSet},we.prototype.setLabel=function(t){this._label=t},we.prototype.getLabel=function(){return this._label},we.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},we.prototype.updateIM=function(t){Q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},we.prototype.isInResult=function(){return this._isInResult},we.prototype.isVisited=function(){return this._isVisited},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we};var In=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 lt(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 lt(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 lt)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}(we),pi=function(){this.nodeMap=new jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};pi.prototype.find=function(t){return this.nodeMap.get(t)},pi.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 In){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},pi.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},pi.prototype.iterator=function(){return this.nodeMap.values().iterator()},pi.prototype.values=function(){return this.nodeMap.values()},pi.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},pi.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var ct=function(){},Xs={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 r=(t-e+4)%4;return r===2},ct.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},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 r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new vt("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?ct.NE:ct.SE:i.y>=r.y?ct.NW:ct.SW}},Xs.NE.get=function(){return 0},Xs.NW.get=function(){return 1},Xs.SW.get=function(){return 2},Xs.SE.get=function(){return 3},Object.defineProperties(ct,Xs);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],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}};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:V.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),r=this.getClass().getName(),i=r.lastIndexOf("."),n=r.substring(i+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(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+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),Q.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Jt.prototype.interfaces_=function(){return[Me]},Jt.prototype.getClass=function(){return Jt};var uo=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 lt(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 Hi("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}(Jt),ds=function(){};ds.prototype.createNode=function(t){return new In(t,null)},ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds};var Ct=function(){if(this._edges=new k,this._nodes=null,this._edgeEndList=new k,arguments.length===0)this._nodes=new pi(new ds);else if(arguments.length===1){var t=arguments[0];this._nodes=new pi(t)}};Ct.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)}},Ct.prototype.find=function(t){return this._nodes.find(t)},Ct.prototype.addNode=function(){if(arguments[0]instanceof In){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 r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===P.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,r,i){return t.equals(r)?V.computeOrientation(t,e,i)===V.COLLINEAR&&ct.quadrant(t,e)===ct.quadrant(r,i):!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 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},Ct.prototype.insertEdge=function(t){this._edges.add(t)},Ct.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null},Ct.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var n=new uo(i,!0),o=new uo(i,!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 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},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var _e=function(){this._geometryFactory=null,this._shellList=new k;var t=arguments[0];this._geometryFactory=t};_e.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)}},_e.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},_e.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 Hi("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(o)}}},_e.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},_e.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1},_e.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 Zf(n,e._geometryFactory);r.add(o),o.setInResult()}}return r},_e.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}},_e.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},_e.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},_e.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},_e.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];Ct.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)}},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e};var ms=function(){};ms.prototype.getBounds=function(){},ms.prototype.interfaces_=function(){return[]},ms.prototype.getClass=function(){return ms};var Ke=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ke.prototype.getItem=function(){return this._item},Ke.prototype.getBounds=function(){return this._bounds},Ke.prototype.interfaces_=function(){return[ms,Be]},Ke.prototype.getClass=function(){return Ke};var Zi=function(){this._size=null,this._items=null,this._size=0,this._items=new k,this._items.add(null)};Zi.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},Zi.prototype.size=function(){return this._size},Zi.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)},Zi.prototype.clear=function(){this._size=0,this._items.clear()},Zi.prototype.isEmpty=function(){return this._size===0},Zi.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)},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi};var sr=function(){};sr.prototype.visitItem=function(t){},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var Gr=function(){};Gr.prototype.insert=function(t,e){},Gr.prototype.remove=function(t,e){},Gr.prototype.query=function(){},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr};var Mt=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}}},oa={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){Q.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[ms,Be]},Mt.prototype.getClass=function(){return Mt},oa.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Mt,oa);var je=function(){};je.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},je.min=function(t){return je.sort(t),t.get(0)},je.sort=function(t,e){var r=t.toArray();e?_r.sort(r,e):_r.sort(r);for(var i=t.iterator(),n=0,o=r.length;n<o;n++)i.next(),i.set(r[n])},je.singletonList=function(t){var e=new k;return e.add(t),e};var Nt=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()};Nt.prototype.expandToQueue=function(t,e){var r=Nt.isComposite(this._boundable1),i=Nt.isComposite(this._boundable2);if(r&&i)return Nt.area(this._boundable1)>Nt.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 vt("neither boundable is composite")},Nt.prototype.isLeaves=function(){return!(Nt.isComposite(this._boundable1)||Nt.isComposite(this._boundable2))},Nt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Nt.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 Nt(u,e,n._itemDistance);l.getDistance()<i&&r.add(l)}},Nt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Nt.prototype.getDistance=function(){return this._distance},Nt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Nt.prototype.interfaces_=function(){return[Me]},Nt.prototype.getClass=function(){return Nt},Nt.area=function(t){return t.getBounds().getArea()},Nt.isComposite=function(t){return t instanceof Mt};var kt=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}},Tn={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],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var n=i.next();n instanceof Mt?r+=t.size(n):n instanceof Ke&&(r+=1)}return r}},kt.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var n=i.next();n instanceof Ke&&n.getItem()===e&&(r=n)}return r!==null?(t.getChildBoundables().remove(r),!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 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 Mt){var f=t.itemsTree(o);f!==null&&i.add(f)}else o instanceof Ke?i.add(o.getItem()):Q.shouldNeverReachHere()}return i.size()<=0?null:i}},kt.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 Ke(t,e))},kt.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 Mt?t.boundablesAtLevel(i,u,o):(Q.isTrue(u instanceof Ke),i===-1&&o.add(u))}return null}},kt.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(H(arguments[2],sr)&&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 Ke?u.visitItem(c.getItem()):Q.shouldNeverReachHere())}else if(H(arguments[2],qe)&&arguments[0]instanceof Object&&arguments[1]instanceof Mt)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 Mt?t.query(p,W,h):W instanceof Ke?h.add(W.getItem()):Q.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],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 Mt&&(f=t.remove(i,a,o),f)){u=a;break}}return u!==null&&u.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(u),f}},kt.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)},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],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var n=i.next();if(n instanceof Mt){var o=t.depth(n);o>r&&(r=o)}}return r+1}},kt.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);je.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},kt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},kt.prototype.interfaces_=function(){return[Be]},kt.prototype.getClass=function(){return kt},kt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Tn.IntersectsOp.get=function(){return Kf},Tn.serialVersionUID.get=function(){return-3886435814360241e3},Tn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(kt,Tn);var Kf=function(){},ys=function(){};ys.prototype.distance=function(t,e){},ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys};var aa=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 fa(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(H(arguments[2],sr)&&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(H(arguments[2],qe)&&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(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);je.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(H(arguments[0],ys)){var i=arguments[0],n=new Nt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(n)}else if(arguments[0]instanceof Nt){var o=arguments[0];return this.nearestNeighbour(o,j.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&H(arguments[1],ys)){var f=arguments[0],u=arguments[1],l=new Nt(this.getRoot(),f.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Nt&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=c,d=null,h=new Zi;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],T=new Ke(W,C),w=new Nt(this.getRoot(),T,I);return this.nearestNeighbour(w)[0]}},t.prototype.interfaces_=function(){return[Gr,Be]},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 fa},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[rs]},compare:function(r,i){return s.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[rs]},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}(kt),fa=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 G(n.getBounds()):r.expandToInclude(n.getBounds())}return r},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,r){if(e.equals2D(r))return 0;var i=le.relativeSign(e.x,r.x),n=le.relativeSign(e.y,r.y);switch(t){case 0:return le.compareValue(i,n);case 1:return le.compareValue(n,i);case 2:return le.compareValue(n,-i);case 3:return le.compareValue(-i,n);case 4:return le.compareValue(-i,-n);case 5:return le.compareValue(-n,-i);case 6:return le.compareValue(-n,i);case 7:return le.compareValue(i,-n)}return Q.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 nr=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))};nr.prototype.getCoordinate=function(){return this.coord},nr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},nr.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)},nr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},nr.prototype.isInterior=function(){return this._isInterior},nr.prototype.interfaces_=function(){return[Me]},nr.prototype.getClass=function(){return nr};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 Ms;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()},ie.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)}},ie.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},ie.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 si(r+1))}},ie.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))},ie.prototype.iterator=function(){return this._nodeMap.values().iterator()},ie.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}},ie.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},ie.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 si(r[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 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 wt(f,this._edge.getData())},ie.prototype.add=function(t,e){var r=new nr(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)},ie.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new Gi("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 Gi("bad split edge end point at "+f)},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var Xr=function(){};Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.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 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 vt("Cannot compute the octant for two identical points "+n);return Xr.octant(f,u)}};var Pi=function(){};Pi.prototype.getCoordinates=function(){},Pi.prototype.size=function(){},Pi.prototype.getCoordinate=function(t){},Pi.prototype.isClosed=function(){},Pi.prototype.setData=function(t){},Pi.prototype.getData=function(){},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ys=function(){};Ys.prototype.addIntersection=function(t,e){},Ys.prototype.interfaces_=function(){return[Pi]},Ys.prototype.getClass=function(){return Ys};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:Xr.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 r=arguments[0],i=arguments[1],n=arguments[3],o=new A(r.getIntersection(n));this.addIntersection(o,i)}},wt.prototype.toString=function(){return Ue.toLineString(new At(this._pts))},wt.prototype.getNodeList=function(){return this._nodeList},wt.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},wt.prototype.addIntersections=function(t,e,r){for(var i=this,n=0;n<t.getIntersectionNum();n++)i.addIntersection(t,e,r,n)},wt.prototype.interfaces_=function(){return[Ys]},wt.prototype.getClass=function(){return wt},wt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new k;return wt.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)}},ua={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 yr;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 j.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=j.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=ze.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof ns))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||j.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=j.doubleToLongBits(this.p0.x);t^=j.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=j.doubleToLongBits(this.p1.x);r^=j.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i},Y.prototype.interfaces_=function(){return[Me,Be]},Y.prototype.getClass=function(){return Y},Y.midPoint=function(t,e){return new A((t.x+e.x)/2,(t.y+e.y)/2)},ua.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Y,ua);var zs=function(){this.tempEnv1=new G,this.tempEnv2=new G,this._overlapSeg1=new Y,this._overlapSeg2=new Y};zs.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)}}},zs.prototype.interfaces_=function(){return[]},zs.prototype.getClass=function(){return zs};var Ce=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};Ce.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Ce.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)},Ce.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},Ce.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Ce.prototype.setId=function(t){this._id=t},Ce.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Ce.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new G(t,e)}return this._env},Ce.prototype.getEndIndex=function(){return this._end},Ce.prototype.getStartIndex=function(){return this._start},Ce.prototype.getContext=function(){return this._context},Ce.prototype.getId=function(){return this._id},Ce.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))},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var gi=function(){};gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},gi.getChainStartIndices=function(t){var e=0,r=new k;r.add(new si(e));do{var i=gi.findChainEnd(t,e);r.add(new si(i)),e=i}while(e<t.length-1);var n=gi.toIntArray(r);return n},gi.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=ct.quadrant(t[r],t[r+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!==i)break}n++}return n-1},gi.getChains=function(){if(arguments.length===1){var t=arguments[0];return gi.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new k,n=gi.getChainStartIndices(e),o=0;o<n.length-1;o++){var f=new Ce(e,n[o],n[o+1],r);i.add(f)}return i}},gi.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 Wr=function(){};Wr.prototype.computeNodes=function(t){},Wr.prototype.getNodedSubstrings=function(){},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Us=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Us.prototype.setSegmentIntersector=function(t){this._segInt=t},Us.prototype.interfaces_=function(){return[Wr]},Us.prototype.getClass=function(){return Us};var ho=function(s){function t(r){r?s.call(this,r):s.call(this),this._monoChains=new k,this._index=new aa,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(i){for(var n=this,o=gi.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 ha(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 ha},Object.defineProperties(t,e),t}(Us),ha=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}(zs),ft=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)}}},Ki={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}};ft.prototype.getEndCapStyle=function(){return this._endCapStyle},ft.prototype.isSingleSided=function(){return this._isSingleSided},ft.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=ft.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=ft.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==ft.JOIN_ROUND&&(this._quadrantSegments=ft.DEFAULT_QUADRANT_SEGMENTS)},ft.prototype.getJoinStyle=function(){return this._joinStyle},ft.prototype.setJoinStyle=function(t){this._joinStyle=t},ft.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},ft.prototype.getSimplifyFactor=function(){return this._simplifyFactor},ft.prototype.getQuadrantSegments=function(){return this._quadrantSegments},ft.prototype.setEndCapStyle=function(t){this._endCapStyle=t},ft.prototype.getMitreLimit=function(){return this._mitreLimit},ft.prototype.setMitreLimit=function(t){this._mitreLimit=t},ft.prototype.setSingleSided=function(t){this._isSingleSided=t},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ki.CAP_ROUND.get=function(){return 1},Ki.CAP_FLAT.get=function(){return 2},Ki.CAP_SQUARE.get=function(){return 3},Ki.JOIN_ROUND.get=function(){return 1},Ki.JOIN_MITRE.get=function(){return 2},Ki.JOIN_BEVEL.get=function(){return 3},Ki.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ki.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ki.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(ft,Ki);var It=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=V.COUNTERCLOCKWISE,this._inputLine=t||null},qs={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};It.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)},It.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]=It.DELETE,o=!0,n=!0),o?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return n},It.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},It.prototype.isShallowSampled=function(t,e,r,i,n){var o=this,f=Math.trunc((i-r)/It.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},It.prototype.isConcave=function(t,e,r){var i=V.computeOrientation(t,e,r),n=i===this._angleOrientation;return n},It.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()},It.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===It.DELETE;)e++;return e},It.prototype.isShallow=function(t,e,r,i){var n=V.distancePointLine(e,t,r);return n<i},It.prototype.collapseLine=function(){for(var t=this,e=new Ms,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==It.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.simplify=function(t,e){var r=new It(t);return r.simplify(e)},qs.INIT.get=function(){return 0},qs.DELETE.get=function(){return 1},qs.KEEP.get=function(){return 1},qs.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(It,qs);var Ee=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new k},la={COORDINATE_ARRAY_TYPE:{configurable:!0}};Ee.prototype.getCoordinates=function(){var t=this._ptList.toArray(Ee.COORDINATE_ARRAY_TYPE);return t},Ee.prototype.setPrecisionModel=function(t){this._precisionModel=t},Ee.prototype.addPt=function(t){var e=new A(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Ee.prototype.revere=function(){},Ee.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])},Ee.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},Ee.prototype.toString=function(){var t=new tt,e=t.createLineString(this.getCoordinates());return e.toString()},Ee.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)},Ee.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},la.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Ee,la);var it=function(){},Yr={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},it.toDegrees=function(t){return t*180/Math.PI},it.normalize=function(t){for(;t>Math.PI;)t-=it.PI_TIMES_2;for(;t<=-Math.PI;)t+=it.PI_TIMES_2;return t},it.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)}},it.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},it.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},it.interiorAngle=function(t,e,r){var i=it.angle(e,t),n=it.angle(e,r);return Math.abs(n-i)},it.normalizePositive=function(t){if(t<0){for(;t<0;)t+=it.PI_TIMES_2;t>=it.PI_TIMES_2&&(t=0)}else{for(;t>=it.PI_TIMES_2;)t-=it.PI_TIMES_2;t<0&&(t=0)}return t},it.angleBetween=function(t,e,r){var i=it.angle(e,t),n=it.angle(e,r);return it.diff(i,n)},it.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},it.toRadians=function(t){return t*Math.PI/180},it.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?it.COUNTERCLOCKWISE:r<0?it.CLOCKWISE:it.NONE},it.angleBetweenOriented=function(t,e,r){var i=it.angle(e,t),n=it.angle(e,r),o=n-i;return o<=-Math.PI?o+it.PI_TIMES_2:o>Math.PI?o-it.PI_TIMES_2:o},Yr.PI_TIMES_2.get=function(){return 2*Math.PI},Yr.PI_OVER_2.get=function(){return Math.PI/2},Yr.PI_OVER_4.get=function(){return Math.PI/4},Yr.COUNTERCLOCKWISE.get=function(){return V.COUNTERCLOCKWISE},Yr.CLOCKWISE.get=function(){return V.CLOCKWISE},Yr.NONE.get=function(){return V.COLLINEAR},Object.defineProperties(it,Yr);var yt=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 yr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===ft.JOIN_ROUND&&(this._closingSegLengthFactor=s.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Hs={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}};yt.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)},yt.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 ft.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 ft.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(n.p1);break;case ft.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}},yt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},yt.prototype.addMitreJoin=function(t,e,r,i){var n=!0,o=null;try{o=ze.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 ns)o=new A(0,0),n=!1;else throw u}finally{}n?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())},yt.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)},yt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*yt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===ft.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===ft.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))},yt.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()},yt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},yt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},yt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},yt.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)},yt.prototype.addLimitedMitreJoin=function(t,e,r,i){var n=this._seg0.p1,o=it.angle(n,this._seg0.p0),f=it.angleBetweenOriented(this._seg0.p0,n,this._seg1.p1),u=f/2,l=it.normalize(o+u),a=it.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))},yt.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},yt.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}},yt.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*yt.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)}},yt.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()},yt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},yt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ee,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*yt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},yt.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()===ft.JOIN_BEVEL||this._bufParams.getJoinStyle()===ft.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))},yt.prototype.closeRing=function(){this._segList.closeRing()},yt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},Hs.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Hs.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Hs.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Hs.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(yt,Hs);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 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&&$.reverse(o),o},ce.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var n=It.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=It.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()},ce.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===x.RIGHT&&(i=-i);var n=It.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()},ce.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=It.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=It.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()},ce.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case ft.CAP_ROUND:e.createCircle(t);break;case ft.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 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},ce.prototype.getBufferParameters=function(){return this._bufParams},ce.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ce.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return ce.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},ce.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var n=It.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=It.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()},ce.prototype.getSegGen=function(t){return new yt(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),r=0;r<e.length;r++)e[r]=new A(t[r]);return e};var zr=function(){this._subgraphs=null,this._seg=new Y,this._cga=new V;var t=arguments[0];this._subgraphs=t},ca={DepthSegment:{configurable:!0}};zr.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(H(arguments[2],qe)&&arguments[0]instanceof A&&arguments[1]instanceof uo)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 Ir(t._seg,d);l.add(h)}}else if(H(arguments[2],qe)&&arguments[0]instanceof A&&H(arguments[1],qe))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)}}},zr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=je.min(e);return r._leftDepth},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},ca.DepthSegment.get=function(){return Ir},Object.defineProperties(zr,ca);var Ir=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Y(t),this._leftDepth=e};Ir.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)},Ir.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)},Ir.prototype.toString=function(){return this._upwardSeg.toString()},Ir.prototype.interfaces_=function(){return[Me]},Ir.prototype.getClass=function(){return Ir};var ut=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};ut.prototype.area=function(){return ut.area(this.p0,this.p1,this.p2)},ut.prototype.signedArea=function(){return ut.signedArea(this.p0,this.p1,this.p2)},ut.prototype.interpolateZ=function(t){if(t===null)throw new vt("Supplied point is null.");return ut.interpolateZ(t,this.p0,this.p1,this.p2)},ut.prototype.longestSideLength=function(){return ut.longestSideLength(this.p0,this.p1,this.p2)},ut.prototype.isAcute=function(){return ut.isAcute(this.p0,this.p1,this.p2)},ut.prototype.circumcentre=function(){return ut.circumcentre(this.p0,this.p1,this.p2)},ut.prototype.area3D=function(){return ut.area3D(this.p0,this.p1,this.p2)},ut.prototype.centroid=function(){return ut.centroid(this.p0,this.p1,this.p2)},ut.prototype.inCentre=function(){return ut.inCentre(this.p0,this.p1,this.p2)},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut},ut.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)},ut.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},ut.det=function(t,e,r,i){return t*i-e*r},ut.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 _},ut.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},ut.isAcute=function(t,e,r){return!(!it.isAcute(t,e,r)||!it.isAcute(e,r,t)||!it.isAcute(r,t,e))},ut.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*ut.det(o,f,u,l),c=ut.det(f,o*o+f*f,l,u*u+l*l),p=ut.det(o,o*o+f*f,u,u*u+l*l),d=i-c/a,h=n+p/a;return new A(d,h)},ut.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,n=new ze(t.x+r/2,t.y+i/2,1),o=new ze(t.x-i+r/2,t.y+r+i/2,1);return new ze(n,o)},ut.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},ut.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},ut.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)},ut.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 Ve=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};Ve.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)},Ve.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=$.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=$.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,x.opposite(i),P.INTERIOR,P.EXTERIOR)}},Ve.prototype.isTriangleErodedCompletely=function(t,e){var r=new ut(t[0],t[1],t[2]),i=r.inCentre(),n=V.distancePointLine(i,r.p0,r.p1);return n<Math.abs(e)},Ve.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=$.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,P.EXTERIOR,P.INTERIOR)},Ve.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new wt(t,new lt(0,P.BOUNDARY,e,r));this._curveList.add(i)},Ve.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ve.prototype.addPolygonRing=function(t,e,r,i,n){if(e===0&&t.length<Ai.MINIMUM_VALID_SIZE)return null;var o=i,f=n;t.length>=Ai.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)},Ve.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Rt?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof ve?this.addPoint(t):t instanceof gs?this.addCollection(t):t instanceof Cr?this.addCollection(t):t instanceof wi?this.addCollection(t):t instanceof te&&this.addCollection(t)},Ve.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},Ve.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var vs=function(){};vs.prototype.locate=function(t){},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var Si=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()};Si.prototype.next=function(){if(this._atStart)return this._atStart=!1,Si.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 cs;var t=this._parent.getGeometryN(this._index++);return t instanceof te?(this._subcollectionIterator=new Si(t),this._subcollectionIterator.next()):t},Si.prototype.remove=function(){throw new Error(this.getClass().getName())},Si.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)},Si.prototype.interfaces_=function(){return[ls]},Si.prototype.getClass=function(){return Si},Si.isAtomic=function(t){return!(t instanceof te)};var Pe=function(){this._geom=null;var t=arguments[0];this._geom=t};Pe.prototype.locate=function(t){return Pe.locate(t,this._geom)},Pe.prototype.interfaces_=function(){return[vs]},Pe.prototype.getClass=function(){return Pe},Pe.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.isPointInRing(t,e.getCoordinates()):!1},Pe.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Pe.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var n=e.getInteriorRingN(i);if(Pe.isPointInRing(t,n))return!1}return!0},Pe.containsPoint=function(t,e){if(e instanceof Rt)return Pe.containsPointInPolygon(t,e);if(e instanceof te)for(var r=new Si(e);r.hasNext();){var i=r.next();if(i!==e&&Pe.containsPoint(t,i))return!0}return!1},Pe.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:Pe.containsPoint(t,e)?P.INTERIOR:P.EXTERIOR};var Qt=function(){this._edgeMap=new jt,this._edgeList=null,this._ptInAreaLocation=[P.NONE,P.NONE]};Qt.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)},Qt.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 Hi("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)}}},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 r=e.next();r.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 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},Qt.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},Qt.prototype.iterator=function(){return this.getEdges().iterator()},Qt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new k(this._edgeMap.values())),this._edgeList},Qt.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===P.NONE&&(this._ptInAreaLocation[t]=Pe.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]},Qt.prototype.toString=function(){var t=new ri;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
|
|
3
3
|
`);for(var e=this.iterator();e.hasNext();){var r=e.next();t.append(r),t.append(`
|
|
4
|
-
`)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},Qt.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)}},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 jf=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 Hi("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 ct.isNorthern(f)&&ct.isNorthern(u)?n:!ct.isNorthern(f)&&!ct.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){Xt.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 Hi("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 lt(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}(Qt),pa=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 In(r,new jf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ds),or=function s(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=s.orientation(t)};or.prototype.compareTo=function(t){var e=t,r=or.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},or.prototype.interfaces_=function(){return[Me]},or.prototype.getClass=function(){return or},or.orientation=function(t){return $.increasingDirection(t)===1},or.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 or(t.getCoordinates()),r=this._ocaMap.get(e);return r},Je.prototype.add=function(t){this._edges.add(t);var e=new or(t.getCoordinates());this._ocaMap.put(e,t)},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Tr=function(){};Tr.prototype.processIntersections=function(t,e,r,i){},Tr.prototype.isDone=function(){},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Se=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};Se.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Se.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},Se.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Se.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Se.prototype.getLineIntersector=function(){return this._li},Se.prototype.hasProperIntersection=function(){return this._hasProper},Se.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)))},Se.prototype.hasIntersection=function(){return this._hasIntersection},Se.prototype.isDone=function(){return!1},Se.prototype.hasInteriorIntersection=function(){return this._hasInterior},Se.prototype.interfaces_=function(){return[Tr]},Se.prototype.getClass=function(){return Se},Se.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var di=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};di.prototype.getSegmentIndex=function(){return this.segmentIndex},di.prototype.getCoordinate=function(){return this.coord},di.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},di.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},di.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},di.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},di.prototype.getDistance=function(){return this.dist},di.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},di.prototype.interfaces_=function(){return[Me]},di.prototype.getClass=function(){return di};var Ni=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};Ni.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Ni.prototype.iterator=function(){return this._nodeMap.values().iterator()},Ni.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}},Ni.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)},Ni.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 Ln(f,new lt(this.edge._label))},Ni.prototype.add=function(t,e,r){var i=new di(t,e,r),n=this._nodeMap.get(i);return n!==null?n:(this._nodeMap.put(i,i),i)},Ni.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var Lr=function(){};Lr.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new k;i.add(new si(r));do{var n=e.findChainEnd(t,r);i.add(new si(n)),r=n}while(r<t.length-1);var o=Lr.toIntArray(i);return o},Lr.prototype.findChainEnd=function(t,e){for(var r=ct.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var n=ct.quadrant(t[i-1],t[i]);if(n!==r)break;i++}return i-1},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.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 ji=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new G,this.env2=new G;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Lr;this.startIndex=e.getChainStartIndices(this.pts)};ji.prototype.getCoordinates=function(){return this.pts},ji.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},ji.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},ji.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))}},ji.prototype.getStartIndexes=function(){return this.startIndex},ji.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)},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};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 r=0;r<3;r++)t._depth[e][r]=s.NULL_VALUE},ga={NULL_VALUE:{configurable:!0}};Yt.prototype.getDepth=function(t,e){return this._depth[t][e]},Yt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},Yt.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]!==Yt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][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 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}}},Yt.prototype.getDelta=function(t){return this._depth[t][x.RIGHT]-this._depth[t][x.LEFT]},Yt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?P.EXTERIOR:P.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],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]=Yt.depthAtLocation(n):t._depth[r][i]+=Yt.depthAtLocation(n))}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];u===P.INTERIOR&&this._depth[o][f]++}},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.depthAtLocation=function(t){return t===P.EXTERIOR?0:t===P.INTERIOR?1:Yt.NULL_VALUE},ga.NULL_VALUE.get=function(){return-1},Object.defineProperties(Yt,ga);var Ln=function(s){function t(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new Ni(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 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,lt.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 ji(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new G;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 ri;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}(we),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Je,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 r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new lt(t.getLabel()),i.flip()),r.merge(i);var n=re.depthDelta(i),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 r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=n.getRightmostCoordinate(),f=new zr(r),u=f.getDepth(o);n.computeDepth(u),n.findResultEdges(),r.add(n),e.add(n.getDirectedEdges(),n.getNodes())}},re.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 ee;n.create(i),e.add(n)}}return je.sort(e,je.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 ho,r=new yr;return r.setPrecisionModel(t),e.setSegmentIntersector(new Se(r)),e},re.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ce(r,this._bufParams),n=new Ve(t,e,i),o=n.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new Ct(new pa),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),u=new _e(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 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 Ln(f.getCoordinates(),new lt(l));r.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,x.LEFT),r=t.getLocation(0,x.RIGHT);return e===P.INTERIOR&&r===P.EXTERIOR?1:e===P.EXTERIOR&&r===P.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new tt,r=new k;t.hasNext();){var i=t.next(),n=e.createLineString(i.getCoordinates());r.add(n)}return e.buildGeometry(r)};var ar=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()}};ar.prototype.rescale=function(){var t=this;if(H(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])&&Xt.out.println(n)}},ar.prototype.scale=function(){var t=this;if(H(arguments[0],bt)){for(var e=arguments[0],r=new k,i=e.iterator();i.hasNext();){var n=i.next();r.add(new wt(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=$.removeRepeatedPoints(f);return l}},ar.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ar.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ar.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ar.prototype.interfaces_=function(){return[Wr]},ar.prototype.getClass=function(){return ar};var mi=function(){this._li=new yr,this._segStrings=null;var t=arguments[0];this._segStrings=t},da={fact:{configurable:!0}};mi.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 Gi("found endpt/interior pt intersection at index "+a+" :pt "+n)}},mi.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 Gi("found non-noded intersection at "+_+"-"+W+" and "+C+"-"+I)}},mi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mi.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])},mi.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},mi.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new Gi("found non-noded collapse at "+mi.fact.createLineString([t,e,r]))},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},da.fact.get=function(){return new tt},Object.defineProperties(mi,da);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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,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)},ma={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pe.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},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 G(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 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))},pe.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},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},ma.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pe,ma);var Zs=function(){this.tempEnv1=new G,this.selectedSegment=new Y};Zs.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)}}},Zs.prototype.interfaces_=function(){return[]},Zs.prototype.getClass=function(){return Zs};var _s=function(){this._index=null;var t=arguments[0];this._index=t},ya={HotPixelSnapAction:{configurable:!0}};_s.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 va(e,r,i);return this._index.query(n,{interfaces_:function(){return[sr]},visitItem:function(f){var u=f;u.select(n,o)}}),o.isNodeAdded()}},_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},ya.HotPixelSnapAction.get=function(){return va},Object.defineProperties(_s,ya);var va=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}(Zs),Ur=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new k};Ur.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)}},Ur.prototype.isDone=function(){return!1},Ur.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Ur.prototype.interfaces_=function(){return[Tr]},Ur.prototype.getClass=function(){return Ur};var Di=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 yr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Di.prototype.checkCorrectness=function(t){var e=wt.getNodedSubstrings(t),r=new mi(e);try{r.checkValid()}catch(i){if(i instanceof Jo)i.printStackTrace();else throw i}finally{}},Di.prototype.getNodedSubstrings=function(){return wt.getNodedSubstrings(this._nodedSegStrings)},Di.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},Di.prototype.findInteriorIntersections=function(t,e){var r=new Ur(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},Di.prototype.computeVertexSnaps=function(){var t=this;if(H(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 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)}},Di.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ho,this._pointSnapper=new _s(this._noder.getIndex()),this.snapRound(t,this._li)},Di.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=new pe(i,e._scaleFactor,e._li);e._pointSnapper.snap(n)}},Di.prototype.interfaces_=function(){return[Wr]},Di.prototype.getClass=function(){return Di};var zt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new ft,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}},Cs={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 ar(new Di(new at(1)),t.getScale()),r=new re(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.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 Hi)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=zt.precisionScaleFactor(this._argGeom,this._distance,r),n=new at(i);this.bufferFixedPrecision(n)}},zt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===at.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 Gi)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],r=new zt(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 zt(n);u.setQuadrantSegments(f);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof ft&&arguments[0]instanceof U&&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 m=arguments[0],_=arguments[1],W=arguments[2],C=arguments[3],I=new zt(m);I.setQuadrantSegments(W),I.setEndCapStyle(C);var T=I.getResultGeometry(_);return T}},zt.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),n=Ae.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},Cs.CAP_ROUND.get=function(){return ft.CAP_ROUND},Cs.CAP_BUTT.get=function(){return ft.CAP_FLAT},Cs.CAP_FLAT.get=function(){return ft.CAP_FLAT},Cs.CAP_SQUARE.get=function(){return ft.CAP_SQUARE},Cs.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(zt,Cs);var se=function(){this._pt=[new A,new A],this._distance=j.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],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)}},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 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}},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],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)}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var bi=function(){};bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.computeDistance=function(){if(arguments[2]instanceof se&&arguments[0]instanceof Wt&&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 se&&arguments[0]instanceof Rt&&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 se&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)bi.computeDistance(p,d,h);else if(p instanceof Rt)bi.computeDistance(p,d,h);else if(p instanceof te)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 se&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],T=arguments[2],w=C.closestPoint(I);T.setMinimum(w,I)}};var Ar=function(t){this._maxPtDist=new se,this._inputGeom=t||null},lo={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ar.prototype.computeMaxMidpointDistance=function(t){var e=new fr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ar.prototype.computeMaxVertexDistance=function(t){var e=new qr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ar.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Ar.prototype.getDistancePoints=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},lo.MaxPointDistanceFilter.get=function(){return qr},lo.MaxMidpointDistanceFilter.get=function(){return fr},Object.defineProperties(Ar,lo);var qr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};qr.prototype.filter=function(t){this._minPtDist.initialize(),bi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},qr.prototype.getMaxPointDistance=function(){return this._maxPtDist},qr.prototype.interfaces_=function(){return[Li]},qr.prototype.getClass=function(){return qr};var fr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};fr.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)},fr.prototype.isDone=function(){return!1},fr.prototype.isGeometryChanged=function(){return!1},fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},fr.prototype.interfaces_=function(){return[Ze]},fr.prototype.getClass=function(){return fr};var Ji=function(t){this._comps=t||null};Ji.prototype.filter=function(t){t instanceof Rt&&this._comps.add(t)},Ji.prototype.interfaces_=function(){return[fi]},Ji.prototype.getClass=function(){return Ji},Ji.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Ji.getPolygons(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Rt?r.add(e):e instanceof te&&e.apply(new Ji(r)),r}};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],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ai){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[Xi]},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],r=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,r))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(H(arguments[0],bt)&&H(arguments[1],bt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var n=i.next();Ut.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 Ut(u,f)),u}else if(arguments[0]instanceof U&&H(arguments[1],bt)){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"&&H(arguments[0],bt)&&H(arguments[1],bt)){for(var c=arguments[0],p=arguments[1],d=arguments[2],h=c.iterator();h.hasNext();){var m=h.next();Ut.getLines(m,p,d)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof U&&H(arguments[1],bt)){var _=arguments[0],W=arguments[1],C=arguments[2];return _.apply(new Ut(W,C)),W}}};var Qe=function(){if(this._boundaryRule=Oe.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}}};Qe.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof A&&arguments[1]instanceof Rt){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 Wt){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 ve){var p=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(p)?P.INTERIOR:P.EXTERIOR}},Qe.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.locatePointInRing(t,e.getCoordinates()):P.EXTERIOR},Qe.prototype.intersects=function(t,e){return this.locate(t,e)!==P.EXTERIOR},Qe.prototype.updateLocationInfo=function(t){t===P.INTERIOR&&(this._isIn=!0),t===P.BOUNDARY&&this._numBoundaries++},Qe.prototype.computeLocation=function(t,e){var r=this;if(e instanceof ve&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Rt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Cr)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 wi)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 te)for(var a=new Si(e);a.hasNext();){var c=a.next();c!==e&&r.computeLocation(t,c)}},Qe.prototype.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:e instanceof Wt?this.locateInternal(t,e):e instanceof Rt?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)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};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 r=arguments[0],i=arguments[1],n=arguments[2];this._component=r,this._segIndex=i,this._pt=n}},_a={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},_a.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ne,_a);var ur=function(t){this._pts=t||null};ur.prototype.filter=function(t){t instanceof ve&&this._pts.add(t)},ur.prototype.interfaces_=function(){return[fi]},ur.prototype.getClass=function(){return ur},ur.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof ve?je.singletonList(t):ur.getPoints(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof ve?r.add(e):e instanceof te&&e.apply(new ur(r)),r}};var Hr=function(){this._locations=null;var t=arguments[0];this._locations=t};Hr.prototype.filter=function(t){(t instanceof ve||t instanceof Wt||t instanceof Rt)&&this._locations.add(new ne(t,0,t.getCoordinate()))},Hr.prototype.interfaces_=function(){return[fi]},Hr.prototype.getClass=function(){return Hr},Hr.getLocations=function(t){var e=new k;return t.apply(new Hr(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Qe,this._minDistanceLocation=null,this._minDistance=j.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}};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 r=arguments[0],i=arguments[1],n=1-r,o=Ji.getPolygons(this._geom[r]);if(o.size()>0){var f=Hr.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&&H(arguments[0],qe)&&H(arguments[1],qe)){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 Rt){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 ne(m,W),null}}},qt.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}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),r=Ut.getLines(this._geom[1]),i=ur.getPoints(this._geom[0]),n=ur.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)},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 ve){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 ne(e,f,a),i[1]=new ne(r,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(),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]),T=new Y(m[W],m[W+1]),w=I.closestPoints(T);d[0]=new ne(c,_,w[0]),d[1]=new ne(p,W,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.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 ne(o,0,o.getCoordinate()),r[1]=new ne(u,0,u.getCoordinate())),i._minDistance<=i._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,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}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var r=new qt(t,e);return r.distance()},qt.isWithinDistance=function(t,e,r){var i=new qt(t,e,r);return i.distance()<=r},qt.nearestPoints=function(t,e){var r=new qt(t,e);return r.nearestPoints()};var $t=function(){this._pt=[new A,new A],this._distance=j.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],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)}},$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 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}},$t.prototype.toString=function(){return Ue.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],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)}},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var yi=function(){};yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi},yi.computeDistance=function(){if(arguments[2]instanceof $t&&arguments[0]instanceof Wt&&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 $t&&arguments[0]instanceof Rt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];yi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)yi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof $t&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)yi.computeDistance(p,d,h);else if(p instanceof Rt)yi.computeDistance(p,d,h);else if(p instanceof te)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);yi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof $t&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],T=arguments[2],w=C.closestPoint(I);T.setMinimum(w,I)}};var Ge=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},co={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ge.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ge.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new vt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ge.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ge.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ge.prototype.computeOrientedDistance=function(t,e,r){var i=new Zr(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var n=new hr(e,this._densifyFrac);t.apply(n),r.setMaximum(n.getMaxPointDistance())}},Ge.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ge(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new Ge(i,n);return f.setDensifyFraction(o),f.distance()}},co.MaxPointDistanceFilter.get=function(){return Zr},co.MaxDensifiedByFractionDistanceFilter.get=function(){return hr},Object.defineProperties(Ge,co);var Zr=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._euclideanDist=new yi,this._geom=null;var t=arguments[0];this._geom=t};Zr.prototype.filter=function(t){this._minPtDist.initialize(),yi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Zr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Zr.prototype.interfaces_=function(){return[Li]},Zr.prototype.getClass=function(){return Zr};var hr=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))};hr.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(),yi.computeDistance(r._geom,c,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},hr.prototype.isDone=function(){return!1},hr.prototype.isGeometryChanged=function(){return!1},hr.prototype.getMaxPointDistance=function(){return this._maxPtDist},hr.prototype.interfaces_=function(){return[Ze]},hr.prototype.getClass=function(){return hr};var We=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},po={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};We.prototype.checkMaximumDistance=function(t,e,r){var i=new Ge(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 "+Ue.toLineString(n[0],n[1])+")"}},We.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=We.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(),We.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)},We.prototype.checkNegativeValid=function(){if(!(this._input instanceof Rt||this._input instanceof wi||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)},We.prototype.getErrorIndicator=function(){return this._errorIndicator},We.prototype.checkMinimumDistance=function(t,e,r){var i=new qt(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 "+Ue.toLineString(n[0],n[1])+" )"}},We.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)},We.prototype.getErrorLocation=function(){return this._errorLocation},We.prototype.getPolygonLines=function(t){for(var e=new k,r=new Ut(e),i=Ji.getPolygons(t),n=i.iterator();n.hasNext();){var o=n.next();o.apply(r)}return t.getFactory().buildGeometry(e)},We.prototype.getErrorMessage=function(){return this._errMsg},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},po.VERBOSE.get=function(){return!1},po.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(We,po);var Ht=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},go={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ht.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},Ht.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ht.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new G(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new G(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")},Ht.prototype.checkDistance=function(){var t=new We(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")},Ht.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")},Ht.prototype.checkPolygonal=function(){this._result instanceof Rt||this._result instanceof wi||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ht.prototype.getErrorIndicator=function(){return this._errorIndicator},Ht.prototype.getErrorLocation=function(){return this._errorLocation},Ht.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")},Ht.prototype.report=function(t){if(!Ht.VERBOSE)return null;Xt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ht.prototype.getErrorMessage=function(){return this._errorMsg},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isValidMsg=function(t,e,r){var i=new Ht(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ht.isValid=function(t,e,r){var i=new Ht(t,e,r);return!!i.isValid()},go.VERBOSE.get=function(){return!1},go.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ht,go);var vi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};vi.prototype.getCoordinates=function(){return this._pts},vi.prototype.size=function(){return this._pts.length},vi.prototype.getCoordinate=function(t){return this._pts[t]},vi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},vi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Xr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},vi.prototype.setData=function(t){this._data=t},vi.prototype.getData=function(){return this._data},vi.prototype.toString=function(){return Ue.toLineString(new At(this._pts))},vi.prototype.interfaces_=function(){return[Pi]},vi.prototype.getClass=function(){return vi};var Vt=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};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,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++)},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[Tr]},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 $e=function(){this._li=new yr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};$e.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},$e.prototype.getIntersections=function(){return this._segInt.getIntersections()},$e.prototype.isValid=function(){return this.execute(),this._isValid},$e.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$e.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ho;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},$e.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Hi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},$e.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ue.toLineString(t[0],t[1])+" and "+Ue.toLineString(t[2],t[3])},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.computeIntersections=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var wr=function s(){this._nv=null;var t=arguments[0];this._nv=new $e(s.toSegmentStrings(t))};wr.prototype.checkValid=function(){this._nv.checkValid()},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.toSegmentStrings=function(t){for(var e=new k,r=t.iterator();r.hasNext();){var i=r.next();e.add(new vi(i.getCoordinates(),i))}return e},wr.checkValid=function(t){var e=new wr(t);e.checkValid()};var Kr=function(t){this._mapOp=t};Kr.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(tt.toGeometryArray(r))},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.map=function(t,e){var r=new Kr(e);return r.map(t)};var _i=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};_i.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)}},_i.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},_i.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},_i.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))},_i.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)}}},_i.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))}},_i.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)}},_i.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))},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var jr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new k;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};jr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},jr.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)}}},jr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};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 r=this,i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);(n===null||!(n instanceof Ai)||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 Ai||(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)},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 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)},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 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)},ge.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)},ge.prototype.copy=function(t){return t.copy()},ge.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(tt.toGeometryArray(i)):this._factory.buildGeometry(i)},ge.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ve)return this.transformPoint(t,null);if(t instanceof gs)return this.transformMultiPoint(t,null);if(t instanceof Ai)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof Cr)return this.transformMultiLineString(t,null);if(t instanceof Rt)return this.transformPolygon(t,null);if(t instanceof wi)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 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)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var Ri=function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Y,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 r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=s.isClosed(r),this._snapTolerance=i}};Ri.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)))}},Ri.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},Ri.prototype.snapTo=function(t){var e=new Ms(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Ri.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)}},Ri.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=j.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},Ri.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Et=function(t){this._srcGeom=t||null},Ca={SNAP_PRECISION_FACTOR:{configurable:!0}};Et.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Wa(e,r);return i.transform(this._srcGeom)},Et.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Wa(t,r,!0),n=i.transform(this._srcGeom),o=n;return e&&H(o,rr)&&(o=n.buffer(0)),o},Et.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},Et.prototype.extractTargetCoordinates=function(t){for(var e=new ai,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},Et.prototype.computeMinimumSegmentLength=function(t){for(var e=j.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.snap=function(t,e,r){var i=new Array(2).fill(null),n=new Et(t);i[0]=n.snapTo(e,r);var o=new Et(e);return i[1]=o.snapTo(i[0],r),i},Et.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Et.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===at.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(Et.computeOverlaySnapTolerance(n),Et.computeOverlaySnapTolerance(o))}},Et.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Et.SNAP_PRECISION_FACTOR;return i},Et.snapToSelf=function(t,e,r){var i=new Et(t);return i.snapToSelf(e,r)},Ca.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Et,Ca);var Wa=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 Ri(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}(ge),oe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};oe.prototype.getCommon=function(){return j.longBitsToDouble(this._commonBits)},oe.prototype.add=function(t){var e=j.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=oe.signExpBits(this._commonBits),this._isFirst=!1,null;var r=oe.signExpBits(e);if(r!==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=j.longBitsToDouble(t),r=j.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}},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.getBit=function(t,e){var r=1<<e;return t&r?1:0},oe.signExpBits=function(t){return t>>52},oe.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,n=t&i;return n},oe.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(oe.getBit(t,i)!==oe.getBit(e,i))return r;r++}return 52};var lr=function(){this._commonCoord=null,this._ccFilter=new Jr},mo={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};lr.prototype.addCommonBits=function(t){var e=new cr(this._commonCoord);t.apply(e),t.geometryChanged()},lr.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 cr(e);return t.apply(r),t.geometryChanged(),t},lr.prototype.getCommonCoordinate=function(){return this._commonCoord},lr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},mo.CommonCoordinateFilter.get=function(){return Jr},mo.Translater.get=function(){return cr},Object.defineProperties(lr,mo);var Jr=function(){this._commonBitsX=new oe,this._commonBitsY=new oe};Jr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Jr.prototype.getCommonCoordinate=function(){return new A(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Jr.prototype.interfaces_=function(){return[Li]},Jr.prototype.getClass=function(){return Jr};var cr=function(){this.trans=null;var t=arguments[0];this.trans=t};cr.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)},cr.prototype.isDone=function(){return!1},cr.prototype.isGeometryChanged=function(){return!0},cr.prototype.interfaces_=function(){return[Ze]},cr.prototype.getClass=function(){return cr};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),r=e.snapTo(t,this._snapTolerance);return r},Gt.prototype.removeCommonBits=function(t){this._cbr=new lr,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),r=J.overlayOp(e[0],e[1],t);return this.prepareResult(r)},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),r=Et.snap(e[0],e[1],this._snapTolerance);return r},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.overlayOp=function(t,e,r){var i=new Gt(t,e);return i.getResultGeometry(r)},Gt.union=function(t,e){return Gt.overlayOp(t,e,J.UNION)},Gt.intersection=function(t,e){return Gt.overlayOp(t,e,J.INTERSECTION)},Gt.symDifference=function(t,e){return Gt.overlayOp(t,e,J.SYMDIFFERENCE)},Gt.difference=function(t,e){return Gt.overlayOp(t,e,J.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,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 Gi)i=o;else throw o}finally{}if(!r)try{e=Gt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Gi?i:o}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,r){var i=new ae(t,e);return i.getResultGeometry(r)},ae.union=function(t,e){return ae.overlayOp(t,e,J.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,J.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,J.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,J.DIFFERENCE)};var Ks=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Ks.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks};var Ie=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}},yo={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ie.prototype.isDelete=function(){return this._eventType===Ie.DELETE},Ie.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ie.prototype.getObject=function(){return this._obj},Ie.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},Ie.prototype.getInsertEvent=function(){return this._insertEvent},Ie.prototype.isInsert=function(){return this._eventType===Ie.INSERT},Ie.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Ie.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ie.prototype.interfaces_=function(){return[Me]},Ie.prototype.getClass=function(){return Ie},yo.INSERT.get=function(){return 1},yo.DELETE.get=function(){return 2},Object.defineProperties(Ie,yo);var An=function(){};An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var Zt=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};Zt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Zt.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},Zt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Zt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zt.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},Zt.prototype.hasProperIntersection=function(){return this._hasProper},Zt.prototype.hasIntersection=function(){return this._hasIntersection},Zt.prototype.isDone=function(){return this._isDone},Zt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Zt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Zt.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))))},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Jf=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;je.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 Zt&&H(arguments[0],qe)&&H(arguments[1],qe)){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"&&H(arguments[0],qe)&&arguments[1]instanceof Zt){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 Ks(o,u),a=new Ie(i,o.getMinX(u),l);n.events.add(a),n.events.add(new Ie(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}(An),Mi=function(){this._min=j.POSITIVE_INFINITY,this._max=j.NEGATIVE_INFINITY},Ia={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 Ue.toLineString(new A(this._min,0),new A(this._max,0))},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Ia.NodeComparator.get=function(){return js},Object.defineProperties(Mi,Ia);var js=function(){};js.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},js.prototype.interfaces_=function(){return[rs]},js.prototype.getClass=function(){return js};var Qf=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),$f=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),Bi=function(){this._leaves=new k,this._root=null,this._level=0};Bi.prototype.buildTree=function(){var t=this;je.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}},Bi.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 Qf(t,e,r))},Bi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},Bi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Bi.prototype.printNode=function(t){Xt.out.println(Ue.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 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 $f(t.get(r),t.get(r+1));e.add(o)}}},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi};var Ws=function(){this._items=new k};Ws.prototype.visitItem=function(t){this._items.add(t)},Ws.prototype.getItems=function(){return this._items},Ws.prototype.interfaces_=function(){return[sr]},Ws.prototype.getClass=function(){return Ws};var Is=function(){this._index=null;var t=arguments[0];if(!H(t,rr))throw new vt("Argument must be Polygonal");this._index=new Er(t)},vo={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Is.prototype.locate=function(t){var e=new oi(t),r=new Ts(e);return this._index.query(t.y,t.y,r),e.getLocation()},Is.prototype.interfaces_=function(){return[vs]},Is.prototype.getClass=function(){return Is},vo.SegmentVisitor.get=function(){return Ts},vo.IntervalIndexedGeometry.get=function(){return Er},Object.defineProperties(Is,vo);var Ts=function(){this._counter=null;var t=arguments[0];this._counter=t};Ts.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ts.prototype.interfaces_=function(){return[sr]},Ts.prototype.getClass=function(){return Ts};var Er=function(){this._index=new Bi;var t=arguments[0];this.init(t)};Er.prototype.init=function(t){for(var e=this,r=Ut.getLines(t),i=r.iterator();i.hasNext();){var n=i.next(),o=n.getCoordinates();e.addLine(o)}},Er.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)}},Er.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ws;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)}},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var Js=function(s){function t(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new ra,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Qe,arguments.length===2){var e=arguments[0],r=arguments[1],i=Oe.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 Zt(n,!0,!1);u.setIsDoneIfProperInt(f);var l=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Ai||this._parentGeom instanceof Rt||this._parentGeom instanceof wi,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 Zt(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 ve){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=$.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var n=new Ln(i,new lt(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=$.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 Ln(o,new lt(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 lt(r,n):f.setLocation(r,n)},t.prototype.createEdgeSetIntersector=function(){return new Jf},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 wi&&(this._useBoundaryDeterminationRule=!1),r instanceof Rt)this.addPolygon(r);else if(r instanceof Wt)this.addLineString(r);else if(r instanceof ve)this.addPoint(r);else if(r instanceof gs)this.addCollection(r);else if(r instanceof Cr)this.addCollection(r);else if(r instanceof wi)this.addCollection(r);else if(r instanceof te)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 H(this._parentGeom,rr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Is(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}(Ct),Ls=function(){if(this._li=new yr,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 Js(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Oe.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 Js(0,e,i),this._arg[1]=new Js(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 Js(0,n,f),this._arg[1]=new Js(1,o,f)}};Ls.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ls.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Pr=function(){};Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.map=function(){if(arguments[0]instanceof U&&H(arguments[1],Pr.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(H(arguments[0],bt)&&H(arguments[1],Pr.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}},Pr.MapOp=function(){};var J=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r),this._ptLocator=new Qe,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 Ct(new pa),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 lt(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(),wr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var n=new _e(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var o=new _i(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var f=new jr(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}(Ls);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 Kr.map(s,{interfaces_:function(){return[Pr.MapOp]},map:function(r){return r.intersection(e)}})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.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),ae.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),ae.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 pr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Qe,this._seg=new Y;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};pr.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},pr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?P.BOUNDARY:this._ptLocator.locate(t,this._g)},pr.prototype.extractLinework=function(t){var e=new As;t.apply(e);var r=e.getLinework(),i=tt.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var As=function(){this._linework=null,this._linework=new k};As.prototype.getLinework=function(){return this._linework},As.prototype.filter=function(t){var e=this;if(t instanceof Rt){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},As.prototype.interfaces_=function(){return[fi]},As.prototype.getClass=function(){return As};var Sr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Sr.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)},Sr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Sr.prototype.getPoints=function(t){for(var e=this,r=new k,i=Ut.getLines(this._g),n=i.iterator();n.hasNext();){var o=n.next();e.extractPoints(o,t,r)}return r},Sr.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)}},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Ne=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 pr(this._geom[0],this._boundaryDistanceTolerance),new pr(this._geom[1],this._boundaryDistanceTolerance),new pr(this._geom[2],this._boundaryDistanceTolerance)]},Ta={TOLERANCE:{configurable:!0}};Ne.prototype.reportResult=function(t,e,r){Xt.out.println("Overlay result invalid - A:"+P.toLocationSymbol(e[0])+" B:"+P.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+P.toLocationSymbol(e[2]))},Ne.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ne.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),Ne.hasLocation(this._location,P.BOUNDARY)?!0:this.isValidResult(n,this._location)}},Ne.prototype.addTestPts=function(t){var e=new Sr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ne.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},Ne.prototype.getInvalidLocation=function(){return this._invalidLocation},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},Ne.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Et.computeSizeBasedSnapTolerance(t),Et.computeSizeBasedSnapTolerance(e))},Ne.isValid=function(t,e,r,i){var n=new Ne(t,e,i);return n.isValid(r)},Ta.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ne,Ta);var De=function s(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(t),this._inputGeoms=t};De.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)}},De.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)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.combine=function(){if(arguments.length===1){var t=arguments[0],e=new De(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new De(De.createList(r,i));return n.combine()}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2],l=new De(De.createList(o,f,u));return l.combine()}},De.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},De.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 Dt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new k)},La={STRTREE_NODE_CAPACITY:{configurable:!0}};Dt.prototype.reduceToGeometries=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=null;H(n,qe)?o=e.unionTree(n):n instanceof U&&(o=n),r.add(o)}return r},Dt.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)},Dt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var n=De.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)},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 aa(Dt.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},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],r=arguments[1],i=arguments[2];if(i-r<=1){var n=Dt.getGeometry(e,r);return this.unionSafe(n,null)}else{if(i-r===2)return this.unionSafe(Dt.getGeometry(e,r),Dt.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)}}},Dt.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},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),r=this.binaryUnion(e);return r},Dt.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=De.combine(i);return u},Dt.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}},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},Dt.restrictToPolygons=function(t){if(H(t,rr))return t;var e=Ji.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()},La.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Dt,La);var wn=function(){};wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.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),ae.overlayOp(t,e,J.UNION)};function Nr(){return new En}function En(){this.reset()}En.prototype={constructor:En,reset:function(){this.s=this.t=0},add:function(s){Aa(Pn,s,this.t),Aa(this,Pn.s,this.s),this.s?this.t+=Pn.t:this.s=Pn.t},valueOf:function(){return this.s}};var Pn=new En;function Aa(s,t,e){var r=s.s=t+e,i=r-t,n=r-i;s.t=t-n+(e-i)}var Tt=1e-6,gt=Math.PI,Qi=gt/2,wa=gt/4,$i=gt*2,Dr=180/gt,Ci=gt/180,fe=Math.abs,tu=Math.atan,ws=Math.atan2,Bt=Math.cos,Ot=Math.sin,Es=Math.sqrt;function Ea(s){return s>1?0:s<-1?gt:Math.acos(s)}function Qr(s){return s>1?Qi:s<-1?-Qi:Math.asin(s)}function Qs(){}function Sn(s,t){s&&Sa.hasOwnProperty(s.type)&&Sa[s.type](s,t)}var Pa={Feature:function(s,t){Sn(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,r=-1,i=e.length;++r<i;)Sn(e[r].geometry,t)}},Sa={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){_o(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)_o(e[r],t,0)},Polygon:function(s,t){Na(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)Na(e[r],t)},GeometryCollection:function(s,t){for(var e=s.geometries,r=-1,i=e.length;++r<i;)Sn(e[r],t)}};function _o(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 Na(s,t){var e=-1,r=s.length;for(t.polygonStart();++e<r;)_o(s[e],t,1);t.polygonEnd()}function eu(s,t){s&&Pa.hasOwnProperty(s.type)?Pa[s.type](s,t):Sn(s,t)}Nr(),Nr();function Co(s){return[ws(s[1],s[0]),Qr(s[2])]}function Ps(s){var t=s[0],e=s[1],r=Bt(e);return[r*Bt(t),r*Ot(t),Ot(e)]}function Nn(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function Dn(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 Wo(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function bn(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function Io(s){var t=Es(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}Nr();function Da(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 To(s,t){return[s>gt?s-$i:s<-gt?s+$i:s,t]}To.invert=To;function iu(s,t,e){return(s%=$i)?t||e?Da(Ra(s),Ma(t,e)):Ra(s):t||e?Ma(t,e):To}function ba(s){return function(t,e){return t+=s,[t>gt?t-$i:t<-gt?t+$i:t,e]}}function Ra(s){var t=ba(s);return t.invert=ba(-s),t}function Ma(s,t){var e=Bt(s),r=Ot(s),i=Bt(t),n=Ot(t);function o(f,u){var l=Bt(u),a=Bt(f)*l,c=Ot(f)*l,p=Ot(u),d=p*e+a*r;return[ws(c*i-d*n,a*e-p*r),Qr(d*i+c*n)]}return o.invert=function(f,u){var l=Bt(u),a=Bt(f)*l,c=Ot(f)*l,p=Ot(u),d=p*i-c*n;return[ws(c*i+p*n,a*e+d*r),Qr(d*e-a*r)]},o}function ru(s,t,e,r,i,n){if(e){var o=Bt(t),f=Ot(t),u=r*e;i==null?(i=t+r*$i,n=t-u/2):(i=Ba(o,i),n=Ba(o,n),(r>0?i<n:i>n)&&(i+=r*$i));for(var l,a=i;r>0?a>n:a<n;a-=u)l=Co([o,-f*Bt(a),-f*Ot(a)]),s.point(l[0],l[1])}}function Ba(s,t){t=Ps(t),t[0]-=s,Io(t);var e=Ea(-t[1]);return((-t[2]<0?-e:e)+$i-Tt)%$i}function Oa(){var s=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){s.push(t=[])},lineEnd:Qs,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function su(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 Rn(s,t){return fe(s[0]-t[0])<Tt&&fe(s[1]-t[1])<Tt}function Mn(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 Fa(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(Rn(_,W)){for(i.lineStart(),f=0;f<m;++f)i.point((_=h[f])[0],_[1]);i.lineEnd();return}n.push(C=new Mn(_,h,null,!0)),o.push(C.o=new Mn(_,null,C,!1)),n.push(C=new Mn(W,h,null,!1)),o.push(C.o=new Mn(W,null,C,!0))}}),!!n.length){for(o.sort(t),xa(n),xa(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 xa(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 ka(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function nu(s){return s.length===1&&(s=ou(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 ou(s){return function(t,e){return ka(s(t),e)}}nu(ka);function Va(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 $s=1e9,Bn=-$s;function au(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 fe(l[0]-s)<Tt?a>0?0:3:fe(l[0]-e)<Tt?a>0?2:1:fe(l[1]-t)<Tt?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=Oa(),p,d,h,m,_,W,C,I,T,w,N,b={point:B,lineStart:q,lineEnd:Z,polygonStart:F,polygonEnd:M};function B(X,K){i(X,K)&&a.point(X,K)}function R(){for(var X=0,K=0,et=d.length;K<et;++K)for(var nt=d[K],ht=1,ei=nt.length,Xe=nt[0],Ft,ii,tr=Xe[0],Oi=Xe[1];ht<ei;++ht)Ft=tr,ii=Oi,Xe=nt[ht],tr=Xe[0],Oi=Xe[1],ii<=r?Oi>r&&(tr-Ft)*(r-ii)>(Oi-ii)*(s-Ft)&&++X:Oi<=r&&(tr-Ft)*(r-ii)<(Oi-ii)*(s-Ft)&&--X;return X}function F(){a=c,p=[],d=[],N=!0}function M(){var X=R(),K=N&&X,et=(p=Va(p)).length;(K||et)&&(l.polygonStart(),K&&(l.lineStart(),n(null,null,1,l),l.lineEnd()),et&&Fa(p,f,X,n,l),l.polygonEnd()),a=l,p=d=h=null}function q(){b.point=O,d&&d.push(h=[]),w=!0,T=!1,C=I=NaN}function Z(){p&&(O(m,_),W&&T&&c.rejoin(),p.push(c.result())),b.point=B,T&&a.lineEnd()}function O(X,K){var et=i(X,K);if(d&&h.push([X,K]),w)m=X,_=K,W=et,w=!1,et&&(a.lineStart(),a.point(X,K));else if(et&&T)a.point(X,K);else{var nt=[C=Math.max(Bn,Math.min($s,C)),I=Math.max(Bn,Math.min($s,I))],ht=[X=Math.max(Bn,Math.min($s,X)),K=Math.max(Bn,Math.min($s,K))];su(nt,ht,s,t,e,r)?(T||(a.lineStart(),a.point(nt[0],nt[1])),a.point(ht[0],ht[1]),et||a.lineEnd(),N=!1):et&&(a.lineStart(),a.point(X,K),N=!1)}C=X,I=K,T=et}return b}}var Lo=Nr();function fu(s,t){var e=t[0],r=t[1],i=[Ot(e),-Bt(e),0],n=0,o=0;Lo.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+wa,h=Ot(d),m=Bt(d),_=0;_<a;++_,p=C,h=T,m=w,c=W){var W=l[_],C=W[0],I=W[1]/2+wa,T=Ot(I),w=Bt(I),N=C-p,b=N>=0?1:-1,B=b*N,R=B>gt,F=h*T;if(Lo.add(ws(F*b*Ot(B),m*w+F*Bt(B))),n+=R?N+b*$i:N,R^p>=e^C>=e){var M=Dn(Ps(c),Ps(W));Io(M);var q=Dn(i,M);Io(q);var Z=(R^N>=0?-1:1)*Qr(q[2]);(r>Z||r===Z&&(M[0]||M[1]))&&(o+=R^N>=0?1:-1)}}return(n<-Tt||n<Tt&&Lo<-Tt)^o&1}Nr();function Ga(s){return s}Nr(),Nr();var Ss=1/0,On=Ss,tn=-Ss,Fn=tn,Xa={point:uu,lineStart:Qs,lineEnd:Qs,polygonStart:Qs,polygonEnd:Qs,result:function(){var s=[[Ss,On],[tn,Fn]];return tn=Fn=-(On=Ss=1/0),s}};function uu(s,t){s<Ss&&(Ss=s),s>tn&&(tn=s),t<On&&(On=t),t>Fn&&(Fn=t)}Nr();function Ya(s,t,e,r){return function(i,n){var o=t(n),f=i.invert(r[0],r[1]),u=Oa(),l=t(u),a=!1,c,p,d,h={point:m,lineStart:W,lineEnd:C,polygonStart:function(){h.point=I,h.lineStart=T,h.lineEnd=w,p=[],c=[]},polygonEnd:function(){h.point=m,h.lineStart=W,h.lineEnd=C,p=Va(p);var N=fu(c,f);p.length?(a||(n.polygonStart(),a=!0),Fa(p,lu,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,b){var B=i(N,b);s(N=B[0],b=B[1])&&n.point(N,b)}function _(N,b){var B=i(N,b);o.point(B[0],B[1])}function W(){h.point=_,o.lineStart()}function C(){h.point=m,o.lineEnd()}function I(N,b){d.push([N,b]);var B=i(N,b);l.point(B[0],B[1])}function T(){l.lineStart(),d=[]}function w(){I(d[0][0],d[0][1]),l.lineEnd();var N=l.clean(),b=u.result(),B,R=b.length,F,M,q;if(d.pop(),c.push(d),d=null,!!R){if(N&1){if(M=b[0],(F=M.length-1)>0){for(a||(n.polygonStart(),a=!0),n.lineStart(),B=0;B<F;++B)n.point((q=M[B])[0],q[1]);n.lineEnd()}return}R>1&&N&2&&b.push(b.pop().concat(b.shift())),p.push(b.filter(hu))}}return h}}function hu(s){return s.length>1}function lu(s,t){return((s=s.x)[0]<0?s[1]-Qi-Tt:Qi-s[1])-((t=t.x)[0]<0?t[1]-Qi-Tt:Qi-t[1])}const za=Ya(function(){return!0},cu,gu,[-gt,-Qi]);function cu(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=fe(n-t);fe(u-gt)<Tt?(s.point(t,e=(e+o)/2>0?Qi:-Qi),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),s.point(n,e),i=0):r!==f&&u>=gt&&(fe(t-r)<Tt&&(t-=r*Tt),fe(n-f)<Tt&&(n-=f*Tt),e=pu(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 pu(s,t,e,r){var i,n,o=Ot(s-e);return fe(o)>Tt?tu((Ot(t)*(n=Bt(r))*Ot(e)-Ot(r)*(i=Bt(t))*Ot(s))/(i*n*o)):(t+r)/2}function gu(s,t,e,r){var i;if(s==null)i=e*Qi,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(fe(s[0]-t[0])>Tt){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 du(s,t){var e=Bt(s),r=e>0,i=fe(e)>Tt;function n(a,c,p,d){ru(d,s,t,p,a,c)}function o(a,c){return Bt(a)*Bt(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,T=o(_,W),w=r?T?0:l(_,W):T?l(_+(_<0?gt:-gt),W):0;if(!c&&(h=d=T)&&a.lineStart(),T!==d&&(I=u(c,C),(!I||Rn(c,I)||Rn(C,I))&&(C[0]+=Tt,C[1]+=Tt,T=o(C[0],C[1]))),T!==d)m=0,T?(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^T){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])))}T&&(!c||!Rn(c,C))&&a.point(C[0],C[1]),c=C,d=T,p=w},lineEnd:function(){d&&a.lineEnd(),c=null},clean:function(){return m|(h&&d)<<1}}}function u(a,c,p){var d=Ps(a),h=Ps(c),m=[1,0,0],_=Dn(d,h),W=Nn(_,_),C=_[0],I=W-C*C;if(!I)return!p&&a;var T=e*W/I,w=-e*C/I,N=Dn(m,_),b=bn(m,T),B=bn(_,w);Wo(b,B);var R=N,F=Nn(b,R),M=Nn(R,R),q=F*F-M*(Nn(b,b)-1);if(!(q<0)){var Z=Es(q),O=bn(R,(-F-Z)/M);if(Wo(O,b),O=Co(O),!p)return O;var X=a[0],K=c[0],et=a[1],nt=c[1],ht;K<X&&(ht=X,X=K,K=ht);var ei=K-X,Xe=fe(ei-gt)<Tt,Ft=Xe||ei<Tt;if(!Xe&&nt<et&&(ht=et,et=nt,nt=ht),Ft?Xe?et+nt>0^O[1]<(fe(O[0]-X)<Tt?et:nt):et<=O[1]&&O[1]<=nt:ei>gt^(X<=O[0]&&O[0]<=K)){var ii=bn(R,(-F+Z)/M);return Wo(ii,b),[O,Co(ii)]}}}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 Ya(o,f,n,r?[0,-s]:[-gt,s-gt])}function Ua(s){return function(t){var e=new Ao;for(var r in s)e[r]=s[r];return e.stream=t,e}}function Ao(){}Ao.prototype={constructor:Ao,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 qa(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),eu(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 mu(s,t,e){return qa(s,[[0,0],t],e)}var Ha=16,yu=Bt(30*Ci);function Za(s,t){return+t?_u(s,t):vu(s)}function vu(s){return Ua({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function _u(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 T=o+p,w=f+d,N=u+h,b=Es(T*T+w*w+N*N),B=Qr(N/=b),R=fe(fe(N)-1)<Tt||fe(n-c)<Tt?(n+c)/2:ws(w,T),F=s(R,B),M=F[0],q=F[1],Z=M-r,O=q-i,X=C*Z-W*O;(X*X/I>t||fe((W*Z+C*O)/I-.5)>.3||o*p+f*d+u*h<yu)&&(e(r,i,n,o,f,u,M,q,R,T/=b,w/=b,N,m,_),_.point(M,q),e(M,q,R,T,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:T,polygonStart:function(){r.polygonStart(),_.lineStart=w},polygonEnd:function(){r.polygonEnd(),_.lineStart=C}};function W(B,R){B=s(B,R),r.point(B[0],B[1])}function C(){c=NaN,_.point=I,r.lineStart()}function I(B,R){var F=Ps([B,R]),M=s(B,R);e(c,p,a,d,h,m,c=M[0],p=M[1],a=B,d=F[0],h=F[1],m=F[2],Ha,r),r.point(c,p)}function T(){_.point=W,r.lineEnd()}function w(){C(),_.point=N,_.lineEnd=b}function N(B,R){I(i=B,R),n=c,o=p,f=d,u=h,l=m,_.point=I}function b(){e(c,p,a,d,h,m,n,o,i,f,u,l,Ha,r),_.lineEnd=T,T()}return _}}var Cu=Ua({point:function(s,t){this.stream.point(s*Ci,t*Ci)}});function Wu(s){return Iu(function(){return s})()}function Iu(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=za,_=null,W,C,I,T=Ga,w=.5,N=Za(M,w),b,B;function R(O){return O=d(O[0]*Ci,O[1]*Ci),[O[0]*e+n,o-O[1]*e]}function F(O){return O=d.invert((O[0]-n)/e,(o-O[1])/e),O&&[O[0]*Dr,O[1]*Dr]}function M(O,X){return O=t(O,X),[O[0]*e+n,o-O[1]*e]}R.stream=function(O){return b&&B===O?b:b=Cu(m(p,N(T(B=O))))},R.clipAngle=function(O){return arguments.length?(m=+O?du(h=O*Ci,6*Ci):(h=null,za),Z()):h*Dr},R.clipExtent=function(O){return arguments.length?(T=O==null?(_=W=C=I=null,Ga):au(_=+O[0][0],W=+O[0][1],C=+O[1][0],I=+O[1][1]),Z()):_==null?null:[[_,W],[C,I]]},R.scale=function(O){return arguments.length?(e=+O,q()):e},R.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],q()):[r,i]},R.center=function(O){return arguments.length?(f=O[0]%360*Ci,u=O[1]%360*Ci,q()):[f*Dr,u*Dr]},R.rotate=function(O){return arguments.length?(l=O[0]%360*Ci,a=O[1]%360*Ci,c=O.length>2?O[2]%360*Ci:0,q()):[l*Dr,a*Dr,c*Dr]},R.precision=function(O){return arguments.length?(N=Za(M,w=O*O),Z()):Es(w)},R.fitExtent=function(O,X){return qa(R,O,X)},R.fitSize=function(O,X){return mu(R,O,X)};function q(){d=Da(p=iu(l,a,c),t);var O=t(f,u);return n=r-O[0]*e,o=i+O[1]*e,Z()}function Z(){return b=B=null,R}return function(){return t=s.apply(this,arguments),R.invert=t.invert&&F,q()}}function Ka(s){return function(t,e){var r=Bt(t),i=Bt(e),n=s(r*i);return[n*i*Ot(t),n*Ot(e)]}}function ja(s){return function(t,e){var r=Es(t*t+e*e),i=s(r),n=Ot(i),o=Bt(i);return[ws(t*n,r*o),Qr(r&&e*n/r)]}}var Tu=Ka(function(s){return Es(2/(1+s))});Tu.invert=ja(function(s){return 2*Qr(s/2)});var Ja=Ka(function(s){return(s=Ea(s))&&s/Ot(s)});Ja.invert=ja(function(s){return s});function Lu(){return Wu(Ja).scale(79.4188).clipAngle(180-.001)}function Qa(s,t){return[s,t]}Qa.invert=Qa;function Au(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 Zn(s,function(o){var f=xn(o,t,r,i);f&&n.push(f)}),nn(n);case"FeatureCollection":return Hn(s,function(o){var f=xn(o,t,r,i);f&&Hn(f,function(u){u&&n.push(u)})}),nn(n)}return xn(s,t,r,i)}function xn(s,t,e,r){var i=s.properties||{},n=s.type==="Feature"?s.geometry:s;if(n.type==="GeometryCollection"){var o=[];return Zn(s,function(m){var _=xn(m,t,e,r);_&&o.push(_)}),nn(o)}var f=wu(n),u={type:n.type,coordinates:tf(n.coordinates,f)},l=new fo,a=l.read(u),c=Un(on(t,e),"meters"),p=zt.bufferOp(a,c,r),d=new na;if(p=d.write(p),!$a(p.coordinates)){var h={type:p.type,coordinates:ef(p.coordinates,f)};return mr(h,i)}}function $a(s){return Array.isArray(s[0])?$a(s[0]):isNaN(s[0])}function tf(s,t){return typeof s[0]!="object"?t(s):s.map(function(e){return tf(e,t)})}function ef(s,t){return typeof s[0]!="object"?t.invert(s):s.map(function(e){return ef(e,t)})}function wu(s){var t=Lf(s).geometry.coordinates,e=[-t[0],-t[1]];return Lu().rotate(e).scale(ye)}class Eu{constructor(){L(this,"LineID","myEntity1");L(this,"Tag","");L(this,"towers",[]);L(this,"ISPhaseSequence",!1);L(this,"Wairnum",0);L(this,"Type",0);L(this,"corridor_features",[]);L(this,"wireAColor","#FFFFFF");L(this,"wireBColor","#FFFFFF");L(this,"wireCColor","#FFFFFF");L(this,"wireTColor","#FFFFFF");L(this,"wireD1Color","#FFFFFF");L(this,"wireD2Color","#FFFFFF");L(this,"wireWidth",1);L(this,"LineDistanceDisplaymin",0);L(this,"LineDistanceDisplaymax",5e3)}}class Pu{constructor(){L(this,"id","");L(this,"type",0);L(this,"modelid","");L(this,"lon",0);L(this,"lat",0);L(this,"alt",0);L(this,"modelH",0);L(this,"modelurl","");L(this,"modelScale",1);L(this,"modelbox","")}}var de=(s=>(s[s.树木=0]="树木",s[s.房屋=1]="房屋",s[s.高速公路=2]="高速公路",s[s.电力线=3]="电力线",s))(de||{});class Su{constructor(){L(this,"id","");L(this,"name","");L(this,"type",0);L(this,"Longitude",0);L(this,"Latitude",0);L(this,"Altitude",0);L(this,"RollX",0);L(this,"RollY",90);L(this,"RollZ",0);L(this,"towerScale",1);L(this,"towerHeight",0);L(this,"towerModelUri","");L(this,"towerPoint",[]);L(this,"Insulators",[]);L(this,"DistanceDisplaymin",0);L(this,"DistanceDisplaymax",1e3)}}class Nu{constructor(){L(this,"treeId",0);L(this,"treeCoordinates",[0,0,0]);L(this,"conductorCoordinates",[0,0,0]);L(this,"horizontalDistance",0);L(this,"verticalDistance",0);L(this,"straightLineDistance",0);L(this,"clearanceDistance",0);L(this,"timestamp",0)}}class Du{constructor(){L(this,"id","");L(this,"name","");L(this,"type",0);L(this,"WairFX","进");L(this,"linenum",1);L(this,"Wairnum",0);L(this,"PhaseSequence",0);L(this,"RollX",0);L(this,"RollY",0);L(this,"RollZ",0);L(this,"InsulatorScale",1);L(this,"InsulatorLength",0);L(this,"InsulatorModelUri","");L(this,"InsulatorPoint",[]);L(this,"DistanceDisplaymin",0);L(this,"DistanceDisplaymax",500)}}class bu{constructor(){L(this,"name","");L(this,"X",-45);L(this,"Y",90);L(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||{}),Wi=(s=>(s[s.直线塔=0]="直线塔",s[s.耐张塔=1]="耐张塔",s[s.门架塔=2]="门架塔",s[s.换位塔=3]="换位塔",s))(Wi||{}),rf=(s=>(s[s.交流单回路=0]="交流单回路",s[s.交流双回路=1]="交流双回路",s[s.直流单回路=2]="直流单回路",s[s.直流双回路=3]="直流双回路",s[s.交流四回路=4]="交流四回路",s))(rf||{}),en=(s=>(s[s.地线=0]="地线",s[s.回路一=1]="回路一",s[s.回路二=2]="回路二",s[s.回路三=3]="回路三",s[s.回路四=4]="回路四",s))(en||{}),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||{}),E=(s=>(s[s.单分裂=0]="单分裂",s[s.双分裂=1]="双分裂",s[s.四分裂=2]="四分裂",s[s.六分裂=3]="六分裂",s[s.八分裂=4]="八分裂",s))(E||{}),rt=(s=>(s[s.直线距离=0]="直线距离",s[s.水平距离=1]="水平距离",s[s.垂直距离=2]="垂直距离",s[s.净空距离=3]="净空距离",s[s.安全距离=4]="安全距离",s[s.全部测量=5]="全部测量",s))(rt||{});class sf{constructor(){L(this,"horizontalLevels");L(this,"verticalLevels");L(this,"straightLineLevels");L(this,"clearanceLevels")}}class wo{constructor(){L(this,"typeRules",new Map)}}const ti={units:"kilometers"};function kn(s,t,e,r){const i=Eo(s,t),n=Eo(s,e),o=Eo(s,r),f=Math.min(i,n,o);return f===i?t:f===n?e:r}function Eo(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 Vn=()=>({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"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]}),nf=(()=>{const s=new wo;return s.typeRules.set(de.树木,Vn()),s.typeRules.set(de.房屋,Vn()),s.typeRules.set(de.高速公路,Vn()),s.typeRules.set(de.电力线,Vn()),s})(),Ru=(s,t)=>s.typeRules.get(t)||new sf,br=(s,t,e,r=nf,i=rt.全部测量,n=de.树木)=>{const f=Ru(r||nf,n),u=Re(s.slice(0,2)),{nearestCoord:l}=of(s,t),a=t.findIndex(xt=>xt[0]==l[0]&&xt[1]==l[1]);let c=[];if(a==0)c.push(t[0],t[1]);else if(a==t.length-1)c.push(t[t.length-2],t[t.length-1]);else{const xt=[t[a],t[a+1]],me=[t[a-1],t[a]];var p=Mr(u,ue(xt),ti),d=Mr(u,ue(me),ti);c=p>d?me:xt}console.log("附近的点",a,c);const h=ue([c[0].slice(0,2),c[1].slice(0,2)]),m=Re(c[0].slice(0,2)),_=Re(c[1].slice(0,2));var W=Mr(u,h,ti),C=er(u,m,ti)||0,I=Math.sqrt(C*C-W*W)||0;let T=c[0].slice(0,2);I>0&&(T=qo(h,0,I,ti).geometry.coordinates[1]);const w=er(m,_,ti),N=Math.abs(c[0][2]-c[1][2]),b=Math.min(c[0][2],c[1][2]),B=Math.max(c[0][2],c[1][2]),R=c[0][2]>c[1][2]?B-I/w*N:I/w*N+b;console.log("高度差>>>>",N),console.log("最小高度>>>>",b),console.log("最大高度>>>>",B);const F=R-s[2],M=W*1e3,q=Math.sqrt(M*M+F*F);console.log("水平距离>>>>",M),console.log("竖直距离>>>>",F),console.log("直线距离>>>>",q);let Z="#eff819",O=g.Color.RED;const X=g.Cartesian3.fromDegrees(s[0],s[1],s[2]),K=g.Cartesian3.fromDegrees(T[0],T[1],s[2]),et=g.Cartesian3.fromDegrees(T[0],T[1],R);console.log(`坐标详情: 树木=[${s[0]}, ${s[1]}, ${s[2]}], 导线点=[${T[0]}, ${T[1]}, ${R}]`);var nt=Tf(Re([s[0],s[1]]),Re([T[0],T[1]])).geometry.coordinates;const ht=g.Cartesian3.fromDegrees(nt[0],nt[1],s[2]),ei=g.Cartesian3.fromDegrees(nt[0],nt[1],R-F/2),Xe=g.Cartesian3.fromDegrees(T[0],T[1],R-F/2);let Ft;if((i==rt.水平距离||i==rt.全部测量)&&(f.horizontalLevels&&(Ft=f.horizontalLevels.find(xt=>M>=xt.minDistance&&M<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:ht,name:"水平距离",label:{text:`水平距离${M.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(X),me.push(K);var ii={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(ii),i==rt.水平距离)return}if((i==rt.垂直距离||i==rt.全部测量)&&(f.verticalLevels&&(Ft=f.verticalLevels.find(xt=>F>=xt.minDistance&&F<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:Xe,name:"垂直距离",label:{text:`垂直距离${F.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(K),me.push(et);var tr={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(tr),i==rt.垂直距离)return}if((i==rt.直线距离||i==rt.全部测量)&&(f.straightLineLevels&&(Ft=f.straightLineLevels.find(xt=>q>=xt.minDistance&&q<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:ei,name:"直线距离",label:{text:`直线距离${q.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(X),me.push(et);var Oi={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(Oi),i==rt.直线距离)return}},Gn=(s,t,e)=>{const r=Re(s.slice(0,2)),{nearestCoord:i}=of(s,t),n=t.findIndex(F=>F[0]==i[0]&&F[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 F=[t[n],t[n+1]],M=[t[n-1],t[n]];var f=Mr(r,ue(F),ti),u=Mr(r,ue(M),ti);o=f>u?M:F}const l=ue([o[0].slice(0,2),o[1].slice(0,2)]),a=Re(o[0].slice(0,2)),c=Re(o[1].slice(0,2));var p=Mr(r,l,ti),d=er(r,a,ti)||0,h=Math.sqrt(d*d-p*p)||0;let m=o[0].slice(0,2);h>0&&(m=qo(l,0,h,ti).geometry.coordinates[1]);const _=er(a,c,ti),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]),T=o[0][2]>o[1][2]?I-h/_*W:h/_*W+C,w=T-s[2],N=p*1e3,b=Math.sqrt(N*N+w*w),B=parseFloat(T.toFixed(1));return{treeId:e,treeCoordinates:[s[0],s[1],s[2]],conductorCoordinates:[m[0],m[1],T],horizontalDistance:parseFloat(N.toFixed(1)),verticalDistance:parseFloat(w.toFixed(1)),straightLineDistance:parseFloat(b.toFixed(1)),clearanceDistance:B,timestamp:Date.now()}};function of(s,t){const e=Re(s.slice(0,2)),r=[];t.forEach(f=>{r.push(Re([f[0],f[1]]))});const i=nn(r),n=Af(e,i),o=er(e,n,ti);return{nearestCoord:n.geometry.coordinates,nearestDistance:o}}function D(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 gr(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(...Mu(s[r],s[r+1],t*-1e3,100));return e}function Mu(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),T=1-I,w=Math.sin(T*W)/Math.sin(W),N=Math.sin(I*W)/Math.sin(W),b=g.Cartesian3.multiplyByScalar(d,w,new g.Cartesian3),B=g.Cartesian3.multiplyByScalar(h,N,new g.Cartesian3),R=g.Cartesian3.add(b,B,new g.Cartesian3),F=I*Math.PI,M=m*T+_*I+Math.sin(F)*p;R=g.Cartesian3.multiplyByScalar(R,M,R),i.push(R)}return i.push(t),i}function Bu(s,t,e=30){const r=s.length;if(r<=2||t===0||t===r-1)return!1;const i=gr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let o=gr(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 Po(s,t,e=2){const r=s.length;if(r<=1)return 0;if(Bu(s,t,15))return t<r-1?gr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude):gr(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?gr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude):gr(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=gr(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 Ou(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 Fu(s,t,e){if(!t||t.length<2)return!1;const r=Re(s),i=ue(t),n=Mr(r,i,{units:"meters"});return console.log(`isPointInCorridor: point=[${s[0]}, ${s[1]}], distance=${n}, threshold=${e}`),n<=e}function xu(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=Fu(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 ku(s,t=2e3){if(!s||s.length<2)return[];const e=s.map(i=>[i.Longitude,i.Latitude]),r=ue(e);try{const i=Au(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&&af(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&&af(n)<0&&(n=n.reverse()),n}return[]}catch{return[]}}function af(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 Vu{constructor(t,e,r){L(this,"viewer");L(this,"LineInfo");L(this,"Keym","");L(this,"dataSource2");L(this,"entityCollection2");L(this,"offsetTowers",[]);L(this,"autoCalculateRollX",!0);L(this,"towerWirePoints",new Map);L(this,"loadedWireSegments",new Set);L(this,"loadedTowerIndices",new Set);L(this,"isDynamicLoadingEnabled",!0);L(this,"isLineModelRemoved",!1);L(this,"cameraMoveHandler",null);L(this,"offsetWires11",[]);L(this,"offsetWires12",[]);L(this,"offsetWires13",[]);L(this,"offsetWires21",[]);L(this,"offsetWires22",[]);L(this,"offsetWires23",[]);L(this,"ToffsetArcWires1A",[]);L(this,"ToffsetArcWires2A",[]);L(this,"ToffsetWires1A1",[]);L(this,"ToffsetWires1A2",[]);L(this,"ToffsetArcWires1B",[]);L(this,"ToffsetArcWires2B",[]);L(this,"ToffsetWires1B1",[]);L(this,"ToffsetWires1B2",[]);L(this,"ToffsetArcWires1C",[]);L(this,"ToffsetArcWires2C",[]);L(this,"ToffsetWires1C1",[]);L(this,"ToffsetWires1C2",[]);L(this,"ToffsetArcWires1A2",[]);L(this,"ToffsetArcWires2A2",[]);L(this,"ToffsetWires2A1",[]);L(this,"ToffsetWires2A2",[]);L(this,"ToffsetArcWires1B2",[]);L(this,"ToffsetArcWires2B2",[]);L(this,"ToffsetWires2B1",[]);L(this,"ToffsetWires2B2",[]);L(this,"ToffsetArcWires1C2",[]);L(this,"ToffsetArcWires2C2",[]);L(this,"ToffsetWires2C1",[]);L(this,"ToffsetWires2C2",[]);L(this,"offsetArcWires1A",[]);L(this,"offsetArcWires1B",[]);L(this,"offsetArcWires1C",[]);L(this,"offsetArcWires2A",[]);L(this,"offsetArcWires2B",[]);L(this,"offsetArcWires2C",[]);L(this,"offsetGrouundWires1",[]);L(this,"offsetGrouundWires2",[]);L(this,"offsetGrouundWires11",[]);L(this,"offsetGrouundWires12",[]);L(this,"arcLine1A1",[]);L(this,"arcLine1B1",[]);L(this,"arcLine1C1",[]);L(this,"LinedataSource2");L(this,"LineentityCollection2");L(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(zn(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===Wi.耐张塔)if(e===0)r=(Po(this.LineInfo.towers,e,3)-90+360)%360;else if(e===t-1)r=(Po(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=gr(i.Longitude,i.Latitude,n.Longitude,n.Latitude),u=gr(n.Longitude,n.Latitude,o.Longitude,o.Latitude);r=(Ou(f,u)-90+360)%360}else r=(Po(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=D(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===Wi.耐张塔?n:i);let a,c;if(this.autoCalculateRollX?c=this.LineInfo.towers[t].RollX:c=u.RollX,this.LineInfo.towers[t].type===Wi.耐张塔)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: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(D(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=D(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===Wi.耐张塔?f:o);let p,d;if(this.autoCalculateRollX?d=this.LineInfo.towers[i].RollX:d=a.RollX,this.LineInfo.towers[i].type===Wi.耐张塔)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(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(D(r,new g.Cartesian3(m.X,m.Y,m.Z),o))}),a.linenum){case en.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Wi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires11.push(w),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(I),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires11.push(B),this.offsetWires11.push(R),this.offsetWires11.push(F),this.offsetWires11.push(M),this.ToffsetWires1A2.push(N),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires11.push(q),this.offsetWires11.push(Z),this.offsetWires11.push(O),this.offsetWires11.push(X),this.offsetWires11.push(K),this.offsetWires11.push(et),this.offsetWires11.push(nt),this.offsetWires11.push(ht),this.ToffsetWires1A2.push(q),this.ToffsetWires1A2.push(Z),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(K),this.ToffsetWires1A2.push(et),this.ToffsetWires1A2.push(nt),this.ToffsetWires1A2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.B相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires12.push(w),this.ToffsetWires1B2.push(C),this.ToffsetWires1B2.push(I),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires12.push(B),this.offsetWires12.push(R),this.offsetWires12.push(F),this.offsetWires12.push(M),this.ToffsetWires1B2.push(N),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires12.push(q),this.offsetWires12.push(Z),this.offsetWires12.push(O),this.offsetWires12.push(X),this.offsetWires12.push(K),this.offsetWires12.push(et),this.offsetWires12.push(nt),this.offsetWires12.push(ht),this.ToffsetWires1B2.push(q),this.ToffsetWires1B2.push(Z),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(K),this.ToffsetWires1B2.push(et),this.ToffsetWires1B2.push(nt),this.ToffsetWires1B2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.C相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires13.push(w),this.ToffsetWires1C2.push(C),this.ToffsetWires1C2.push(I),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires13.push(B),this.offsetWires13.push(R),this.offsetWires13.push(F),this.offsetWires13.push(M),this.ToffsetWires1C2.push(N),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires13.push(q),this.offsetWires13.push(Z),this.offsetWires13.push(O),this.offsetWires13.push(X),this.offsetWires13.push(K),this.offsetWires13.push(et),this.offsetWires13.push(nt),this.offsetWires13.push(ht),this.ToffsetWires1C2.push(q),this.ToffsetWires1C2.push(Z),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(K),this.ToffsetWires1C2.push(et),this.ToffsetWires1C2.push(nt),this.ToffsetWires1C2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.A相:h.forEach(m=>{this.offsetWires11.push(m)});break;case Te.B相:h.forEach(m=>{this.offsetWires12.push(m)});break;case Te.C相:h.forEach(m=>{this.offsetWires13.push(m)});break}else if(this.LineInfo.towers[i].type==Wi.耐张塔)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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 _=D(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 _=D(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 en.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Wi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires21.push(w),this.ToffsetWires2A2.push(C),this.ToffsetWires2A2.push(I),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires21.push(B),this.offsetWires21.push(R),this.offsetWires21.push(F),this.offsetWires21.push(M),this.ToffsetWires2A2.push(N),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires21.push(q),this.offsetWires21.push(Z),this.offsetWires21.push(O),this.offsetWires21.push(X),this.offsetWires21.push(K),this.offsetWires21.push(et),this.offsetWires21.push(nt),this.offsetWires21.push(ht),this.ToffsetWires2A2.push(q),this.ToffsetWires2A2.push(Z),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(K),this.ToffsetWires2A2.push(et),this.ToffsetWires2A2.push(nt),this.ToffsetWires2A2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.B相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires22.push(w),this.ToffsetWires2B2.push(C),this.ToffsetWires2B2.push(I),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires22.push(B),this.offsetWires22.push(R),this.offsetWires22.push(F),this.offsetWires22.push(M),this.ToffsetWires2B2.push(N),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires22.push(q),this.offsetWires22.push(Z),this.offsetWires22.push(O),this.offsetWires22.push(X),this.offsetWires22.push(K),this.offsetWires22.push(et),this.offsetWires22.push(nt),this.offsetWires22.push(ht),this.ToffsetWires2B2.push(q),this.ToffsetWires2B2.push(Z),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(K),this.ToffsetWires2B2.push(et),this.ToffsetWires2B2.push(nt),this.ToffsetWires2B2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.C相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires23.push(w),this.ToffsetWires2C2.push(C),this.ToffsetWires2C2.push(I),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires23.push(B),this.offsetWires23.push(R),this.offsetWires23.push(F),this.offsetWires23.push(M),this.ToffsetWires2C2.push(N),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires23.push(q),this.offsetWires23.push(Z),this.offsetWires23.push(O),this.offsetWires23.push(X),this.offsetWires23.push(K),this.offsetWires23.push(et),this.offsetWires23.push(nt),this.offsetWires23.push(ht),this.ToffsetWires2C2.push(q),this.ToffsetWires2C2.push(Z),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(K),this.ToffsetWires2C2.push(et),this.ToffsetWires2C2.push(nt),this.ToffsetWires2C2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.A相:h.forEach(m=>{this.offsetWires21.push(m)});break;case Te.B相:h.forEach(m=>{this.offsetWires22.push(m)});break;case Te.C相:h.forEach(m=>{this.offsetWires23.push(m)});break}else if(this.LineInfo.towers[i].type==Wi.耐张塔)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=D(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 _=D(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=D(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 en.地线: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&&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==Wi.耐张塔){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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1A2[e-6]),T.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(T,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)),T.push(this.ToffsetWires1A2[e-10]),T.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(T,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)),b.push(this.ToffsetWires1A2[e-7]),b.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(b,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)),T.push(this.ToffsetWires1A2[e-14]),T.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(T,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)),b.push(this.ToffsetWires1A2[e-11]),b.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(b,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)),R.push(this.ToffsetWires1A2[e-9]),R.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1B2[e-6]),T.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(T,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)),T.push(this.ToffsetWires1B2[e-10]),T.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(T,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)),b.push(this.ToffsetWires1B2[e-7]),b.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(b,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)),T.push(this.ToffsetWires1B2[e-14]),T.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(T,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)),b.push(this.ToffsetWires1B2[e-11]),b.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(b,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)),R.push(this.ToffsetWires1B2[e-9]),R.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1C2[e-6]),T.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(T,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)),T.push(this.ToffsetWires1C2[e-10]),T.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(T,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)),b.push(this.ToffsetWires1C2[e-7]),b.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(b,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)),T.push(this.ToffsetWires1C2[e-14]),T.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(T,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)),b.push(this.ToffsetWires1C2[e-11]),b.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(b,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)),R.push(this.ToffsetWires1C2[e-9]),R.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2A2[e-6]),T.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(T,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)),T.push(this.ToffsetWires2A2[e-10]),T.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(T,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)),b.push(this.ToffsetWires2A2[e-7]),b.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(b,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)),T.push(this.ToffsetWires2A2[e-14]),T.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(T,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)),b.push(this.ToffsetWires2A2[e-11]),b.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(b,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)),R.push(this.ToffsetWires2A2[e-9]),R.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2B2[e-6]),T.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(T,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)),T.push(this.ToffsetWires2B2[e-10]),T.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(T,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)),b.push(this.ToffsetWires2B2[e-7]),b.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(b,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)),T.push(this.ToffsetWires2B2[e-14]),T.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(T,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)),b.push(this.ToffsetWires2B2[e-11]),b.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(b,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)),R.push(this.ToffsetWires2B2[e-9]),R.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2C2[e-6]),T.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(T,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)),T.push(this.ToffsetWires2C2[e-10]),T.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(T,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)),b.push(this.ToffsetWires2C2[e-7]),b.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(b,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)),T.push(this.ToffsetWires2C2[e-14]),T.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(T,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)),b.push(this.ToffsetWires2C2[e-11]),b.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(b,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)),R.push(this.ToffsetWires2C2[e-9]),R.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(R,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 Yn=class Yn{constructor(t,e,r){L(this,"viewer");L(this,"LineInfo");L(this,"Keym","");L(this,"offsetTrees",[]);L(this,"dataSourcetree");L(this,"entityCollectiontree");L(this,"isDynamicLoadingEnabled",!0);L(this,"loadedTreeIndices",new Set);L(this,"isTreeModelRemoved",!1);L(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(zn("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){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 Yn.TREE_ENTITY_PREFIX}};L(Yn,"TREE_ENTITY_PREFIX","tree-");let So=Yn;class Gu{constructor(t){L(this,"viewer");L(this,"dataSourceplotting");L(this,"entityCollectionplotting");L(this,"terrainVerificationCache",new Map);L(this,"terrainVerificationResultCache",new Map);L(this,"maxVisibleResults",200);L(this,"terrainVerificationBatchIndex",0);L(this,"terrainVerificationTotalBatches",0);L(this,"terrainVerificationIsRunning",!1);L(this,"terrainVerificationBatchSize",100);L(this,"cameraMoveHandler",null);L(this,"isDynamicTerrainVerificationEnabled",!1);L(this,"wireClickHandler",null);L(this,"distanceRuleConfig",new wo);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,f=de.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const l=this.terrainVerificationCache.get(u);br(t,l,this.entityCollectionplotting,o,n,f);return}else{const l=kn(t,e,r,i);this.terrainVerificationCache.set(u,l),br(t,l,this.entityCollectionplotting,o||this.distanceRuleConfig,n,f)}}performTerrainVerification(t,e,r,i,n=null,o,f=rt.全部测量,u=de.树木){const l=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`,a=kn(t,e,r,i);this.terrainVerificationCache.set(l,a);const c=Gn(t,a,o??"unknown");return br(t,a,this.entityCollectionplotting,n||this.distanceRuleConfig,f,u),c}setMaxVisibleTerrainResults(t=200){this.maxVisibleResults=Math.max(10,t)}setDistanceRuleConfig(t){this.distanceRuleConfig=t}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}setDistanceRulesByType(t,e){this.distanceRuleConfig.typeRules.set(t,e)}getDistanceRulesByType(t){return this.distanceRuleConfig.typeRules.get(t)}getDistanceRulesByTypeOrDefault(t){return this.distanceRuleConfig.typeRules.get(t)||new sf}hasDistanceRulesForType(t){return this.distanceRuleConfig.typeRules.has(t)}getConfiguredDistanceRuleTypes(){return Array.from(this.distanceRuleConfig.typeRules.keys())}clearDistanceRuleConfig(){this.distanceRuleConfig.typeRules.clear()}getDistanceRuleConfigCount(){return this.distanceRuleConfig.typeRules.size}getHorizontalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.horizontalLevels}getVerticalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.verticalLevels}getStraightLineDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.straightLineLevels}getClearanceDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.clearanceLevels}createDefaultDistanceRuleConfig(){const t={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"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]};this.setDistanceRulesByType(de.树木,{...t}),this.setDistanceRulesByType(de.房屋,{...t}),this.setDistanceRulesByType(de.高速公路,{...t}),this.setDistanceRulesByType(de.电力线,{...t})}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),T=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(T),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=ue(t),n=e/1e3;try{const o=r?-n:n,f=Bf(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,rt.全部测量,f)}processTerrainVerificationBatch(t,e,r,i,n,o=rt.全部测量,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=rt.全部测量){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=kn(h,e,r,i),_=Gn(h,m,d.id);n&&_&&n(_),br(h,m,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),o,de.树木)}}}},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)||rt.全部测量,_=[rt.垂直距离,rt.净空距离,rt.安全距离].includes(m),W=_||m===rt.全部测量,C=!_||m===rt.全部测量,I=W?1:10,T=this.interpolateWire(h,I),w=[];if(W){const N=await this.calculateAndDrawWireToGroundDistanceByType(T,m).catch(b=>(console.error("Error in wire to ground distance calculation:",b),null));N&&w.push(N)}if(C){const N=(o==null?void 0:o.width)||10,b=(o==null?void 0:o.show)!==!1,B=t.filter(R=>{const F=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)];return this.isPointInWireCorridor(F,T,N)});b&&this.drawWireCorridor(T,N,`wire-corridor-${Date.now()}`),this.terrainVerificationCache.clear(),B.forEach(R=>{const F=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)],M=this.calcResultSingleWire(F,T,m,this.getClickDistanceRuleConfig());M&&w.push(M)})}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 rt.垂直距离:return`对地距离${r}`;case rt.净空距离:return`净空距离${r}`;case rt.安全距离:return`安全距离${r}`;case rt.全部测量:return`净空距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(t,e,r,i,n=de.树木){var p,d,h,m,_,W,C,I;const o=[g.Cartesian3.fromDegrees(t[0],t[1],t[2]),g.Cartesian3.fromDegrees(e[0],e[1],e[2])];let f="#eff819",u=g.Color.RED;const l=this.distanceRuleConfig;let a,c=!1;if(i===rt.净空距离?a=(d=(p=l.typeRules.get(n))==null?void 0:p.clearanceLevels)==null?void 0:d.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.垂直距离?a=(m=(h=l.typeRules.get(n))==null?void 0:h.verticalLevels)==null?void 0:m.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.安全距离?a=(W=(_=l.typeRules.get(n))==null?void 0:_.clearanceLevels)==null?void 0:W.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.全部测量&&(a=(I=(C=l.typeRules.get(n))==null?void 0:C.clearanceLevels)==null?void 0:I.find(T=>r>=T.minDistance&&r<=T.maxDistance)),a?(f=a.color,u=g.Color.fromCssColorString(a.color)):(c=!0,f="#00ff00",u=g.Color.GREEN),a||c){this.entityCollectionplotting.add({polyline:{positions:o,width:2,material:u,clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const T=g.Cartesian3.midpoint(o[0],o[1],new g.Cartesian3);this.entityCollectionplotting.add({position:T,name:"净空距离",label:{text:this.getDistanceTypeLabel(i,r),fillColor:g.Color.fromCssColorString(f),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 T=t[f+1];c=g.Cartesian3.fromDegrees(T[0],T[1],T[2]),a=l}else if(f===t.length-1){const T=t[f-1];a=g.Cartesian3.fromDegrees(T[0],T[1],T[2]),c=l}else{const T=t[f-1],w=t[f+1];a=g.Cartesian3.fromDegrees(T[0],T[1],T[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,o=de.树木){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);br(t,u,this.entityCollectionplotting,n,rt.全部测量,o);return}else{const u=kn(t,e,r,i);this.terrainVerificationCache.set(f,u),br(t,u,this.entityCollectionplotting,n||this.distanceRuleConfig,rt.全部测量,o)}}calcResultSingleWire(t,e,r,i=this.distanceRuleConfig,n=de.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;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);return br(t,f,this.entityCollectionplotting,i,r,n),Gn(t,f,o)}else{const f=e;return this.terrainVerificationCache.set(o,f),br(t,f,this.entityCollectionplotting,i||this.distanceRuleConfig,r,n),Gn(t,f,o)}}LineChannelTerrainVerificationForFilteredTrees(t,e,r,i,n,o=100,f=rt.全部测量,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 Xu(s,t){let e=0;for(let r of s)r!=null&&(r=+r)>=r&&++e;return e}function Yu(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 zu=Math.sqrt(50),Uu=Math.sqrt(10),qu=Math.sqrt(2);function Xn(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>=zu?10:n>=Uu?5:n>=qu?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?Xn(s,t,e*2):[f,u,l]}function Hu(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?Xn(t,s,e):Xn(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 Zu(s,t,e){return t=+t,s=+s,e=+e,Xn(s,t,e)[2]}function Ku(s,t,e){let r;for(;;){const i=Zu(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 ju(s){return Math.max(1,Math.ceil(Math.log(Xu(s))/Math.LN2)+1)}var Ju=Array.prototype,Qu=Ju.slice;function $u(s,t){return s-t}function th(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 ff=s=>()=>s;function eh(s,t){for(var e=-1,r=t.length,i;++e<r;)if(i=ih(s,t[e]))return i;return 0}function ih(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(rh(u,c,t))return 0;a>r!=d>r&&e<(p-l)*(r-a)/(d-a)+l&&(i=-i)}return i}function rh(s,t,e){var r;return sh(s,t,e)&&nh(s[r=+(s[0]===t[0])],e[r],t[r])}function sh(s,t,e){return(t[0]-s[0])*(e[1]-s[1])===(e[0]-s[0])*(t[1]-s[1])}function nh(s,t,e){return s<=t&&t<=e||e<=t&&t<=s}function oh(){}var dr=[[],[[[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 ah(){var s=1,t=1,e=ju,r=u;function i(l){var a=e(l);if(Array.isArray(a))a=a.slice().sort($u);else{const c=Yu(l,fh);for(a=Hu(...Ku(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),th(h)>0?p.push([h]):d.push(h)}),d.forEach(function(h){for(var m=0,_=p.length,W;m<_;++m)if(eh((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=$r(l[0],a),dr[W<<1].forEach(T);++h<s-1;)_=W,W=$r(l[h+1],a),dr[_|W<<1].forEach(T);for(dr[W<<0].forEach(T);++m<t-1;){for(h=-1,W=$r(l[m*s+s],a),C=$r(l[m*s],a),dr[W<<1|C<<2].forEach(T);++h<s-1;)_=W,W=$r(l[m*s+s+h+1],a),I=C,C=$r(l[m*s+h+1],a),dr[_|W<<1|C<<2|I<<3].forEach(T);dr[W|C<<3].forEach(T)}for(h=-1,C=l[m*s]>=a,dr[C<<2].forEach(T);++h<s-1;)I=C,C=$r(l[m*s+h+1],a),dr[C<<2|I<<3].forEach(T);dr[C<<3].forEach(T);function T(w){var N=[w[0][0]+h,w[0][1]+m],b=[w[1][0]+h,w[1][1]+m],B=f(N),R=f(b),F,M;(F=d[B])?(M=p[R])?(delete d[F.end],delete p[M.start],F===M?(F.ring.push(b),c(F.ring)):p[F.start]=d[M.end]={start:F.start,end:M.end,ring:F.ring.concat(M.ring)}):(delete d[F.end],F.ring.push(b),d[F.end=R]=F):(F=p[R])?(M=d[B])?(delete p[F.start],delete d[M.end],F===M?(F.ring.push(b),c(F.ring)):p[M.start]=d[F.end]={start:M.start,end:F.end,ring:M.ring.concat(F.ring)}):(delete p[F.start],F.ring.unshift(N),p[F.start=B]=F):p[B]=d[R]={start:B,end:R,ring:[N,b]}}}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=No(a[_*s+m]);d>0&&d<s&&m===d&&(p[0]=uf(d,No(a[_*s+m-1]),W,c)),h>0&&h<t&&_===h&&(p[1]=uf(h,No(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)?ff(Qu.call(l)):ff(l),i):e},i.smooth=function(l){return arguments.length?(r=l?u:oh,i):r===u},i}function fh(s){return isFinite(s)?s:NaN}function $r(s,t){return s==null?!1:+s>=t}function No(s){return s==null||isNaN(s=+s)?-1/0:s}function uf(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 uh(s){return s.primitive!==void 0}class hh{constructor(t){L(this,"viewer");L(this,"lineInfo",null);L(this,"contourEntities",[]);L(this,"mountainEntities",[]);L(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});L(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 T=(c/a*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${c}/${a} (${T}%)`)}}}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=ah().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{uh(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*_,T=n.Longitude+d.dx*W,w=n.Latitude+d.dy*_,N=[],b=Math.ceil(i.width/i.interval)+1;for(let F=0;F<b;F++){const M=F/(b-1),q=C+(T-C)*M,Z=I+(w-I)*M,O=(M-.5)*i.width,X=await this.getHeightFromTerrain(q,Z);N.push({distance:O,height:X,lon:q,lat:Z,isCenter:Math.abs(O)<i.interval/2,isMountain:!1})}const B=this.applyInterpolation(N,i.interpolationMethod),R=this.detectMountains(B,i.mountainThreshold,i.mountainProminence);return R.forEach(F=>{B.forEach(M=>{M.distance>=F.startDistance&&M.distance<=F.endDistance&&(M.isMountain=!0)})}),{points:B,mountains:R}}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
|
|
4
|
+
`)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},Qt.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)}},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 jf=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 Hi("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 ct.isNorthern(f)&&ct.isNorthern(u)?n:!ct.isNorthern(f)&&!ct.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){Xt.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 Hi("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 lt(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}(Qt),pa=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 In(r,new jf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ds),or=function s(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=s.orientation(t)};or.prototype.compareTo=function(t){var e=t,r=or.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},or.prototype.interfaces_=function(){return[Me]},or.prototype.getClass=function(){return or},or.orientation=function(t){return $.increasingDirection(t)===1},or.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 or(t.getCoordinates()),r=this._ocaMap.get(e);return r},Je.prototype.add=function(t){this._edges.add(t);var e=new or(t.getCoordinates());this._ocaMap.put(e,t)},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Tr=function(){};Tr.prototype.processIntersections=function(t,e,r,i){},Tr.prototype.isDone=function(){},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Se=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};Se.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Se.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},Se.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Se.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Se.prototype.getLineIntersector=function(){return this._li},Se.prototype.hasProperIntersection=function(){return this._hasProper},Se.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)))},Se.prototype.hasIntersection=function(){return this._hasIntersection},Se.prototype.isDone=function(){return!1},Se.prototype.hasInteriorIntersection=function(){return this._hasInterior},Se.prototype.interfaces_=function(){return[Tr]},Se.prototype.getClass=function(){return Se},Se.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var di=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};di.prototype.getSegmentIndex=function(){return this.segmentIndex},di.prototype.getCoordinate=function(){return this.coord},di.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},di.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},di.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},di.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},di.prototype.getDistance=function(){return this.dist},di.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},di.prototype.interfaces_=function(){return[Me]},di.prototype.getClass=function(){return di};var Ni=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};Ni.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Ni.prototype.iterator=function(){return this._nodeMap.values().iterator()},Ni.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}},Ni.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)},Ni.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 Ln(f,new lt(this.edge._label))},Ni.prototype.add=function(t,e,r){var i=new di(t,e,r),n=this._nodeMap.get(i);return n!==null?n:(this._nodeMap.put(i,i),i)},Ni.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var Lr=function(){};Lr.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new k;i.add(new si(r));do{var n=e.findChainEnd(t,r);i.add(new si(n)),r=n}while(r<t.length-1);var o=Lr.toIntArray(i);return o},Lr.prototype.findChainEnd=function(t,e){for(var r=ct.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var n=ct.quadrant(t[i-1],t[i]);if(n!==r)break;i++}return i-1},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.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 ji=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new G,this.env2=new G;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Lr;this.startIndex=e.getChainStartIndices(this.pts)};ji.prototype.getCoordinates=function(){return this.pts},ji.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},ji.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},ji.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))}},ji.prototype.getStartIndexes=function(){return this.startIndex},ji.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)},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};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 r=0;r<3;r++)t._depth[e][r]=s.NULL_VALUE},ga={NULL_VALUE:{configurable:!0}};Yt.prototype.getDepth=function(t,e){return this._depth[t][e]},Yt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},Yt.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]!==Yt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][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 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}}},Yt.prototype.getDelta=function(t){return this._depth[t][x.RIGHT]-this._depth[t][x.LEFT]},Yt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?P.EXTERIOR:P.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],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]=Yt.depthAtLocation(n):t._depth[r][i]+=Yt.depthAtLocation(n))}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];u===P.INTERIOR&&this._depth[o][f]++}},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.depthAtLocation=function(t){return t===P.EXTERIOR?0:t===P.INTERIOR?1:Yt.NULL_VALUE},ga.NULL_VALUE.get=function(){return-1},Object.defineProperties(Yt,ga);var Ln=function(s){function t(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new Ni(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 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,lt.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 ji(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new G;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 ri;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}(we),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Je,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 r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new lt(t.getLabel()),i.flip()),r.merge(i);var n=re.depthDelta(i),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 r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=n.getRightmostCoordinate(),f=new zr(r),u=f.getDepth(o);n.computeDepth(u),n.findResultEdges(),r.add(n),e.add(n.getDirectedEdges(),n.getNodes())}},re.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 ee;n.create(i),e.add(n)}}return je.sort(e,je.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 ho,r=new yr;return r.setPrecisionModel(t),e.setSegmentIntersector(new Se(r)),e},re.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ce(r,this._bufParams),n=new Ve(t,e,i),o=n.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new Ct(new pa),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),u=new _e(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 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 Ln(f.getCoordinates(),new lt(l));r.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,x.LEFT),r=t.getLocation(0,x.RIGHT);return e===P.INTERIOR&&r===P.EXTERIOR?1:e===P.EXTERIOR&&r===P.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new tt,r=new k;t.hasNext();){var i=t.next(),n=e.createLineString(i.getCoordinates());r.add(n)}return e.buildGeometry(r)};var ar=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()}};ar.prototype.rescale=function(){var t=this;if(H(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])&&Xt.out.println(n)}},ar.prototype.scale=function(){var t=this;if(H(arguments[0],bt)){for(var e=arguments[0],r=new k,i=e.iterator();i.hasNext();){var n=i.next();r.add(new wt(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=$.removeRepeatedPoints(f);return l}},ar.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ar.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ar.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ar.prototype.interfaces_=function(){return[Wr]},ar.prototype.getClass=function(){return ar};var mi=function(){this._li=new yr,this._segStrings=null;var t=arguments[0];this._segStrings=t},da={fact:{configurable:!0}};mi.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 Gi("found endpt/interior pt intersection at index "+a+" :pt "+n)}},mi.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 Gi("found non-noded intersection at "+_+"-"+W+" and "+C+"-"+I)}},mi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mi.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])},mi.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},mi.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new Gi("found non-noded collapse at "+mi.fact.createLineString([t,e,r]))},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},da.fact.get=function(){return new tt},Object.defineProperties(mi,da);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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,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)},ma={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pe.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},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 G(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 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))},pe.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},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},ma.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pe,ma);var Zs=function(){this.tempEnv1=new G,this.selectedSegment=new Y};Zs.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)}}},Zs.prototype.interfaces_=function(){return[]},Zs.prototype.getClass=function(){return Zs};var _s=function(){this._index=null;var t=arguments[0];this._index=t},ya={HotPixelSnapAction:{configurable:!0}};_s.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 va(e,r,i);return this._index.query(n,{interfaces_:function(){return[sr]},visitItem:function(f){var u=f;u.select(n,o)}}),o.isNodeAdded()}},_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},ya.HotPixelSnapAction.get=function(){return va},Object.defineProperties(_s,ya);var va=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}(Zs),Ur=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new k};Ur.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)}},Ur.prototype.isDone=function(){return!1},Ur.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Ur.prototype.interfaces_=function(){return[Tr]},Ur.prototype.getClass=function(){return Ur};var Di=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 yr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Di.prototype.checkCorrectness=function(t){var e=wt.getNodedSubstrings(t),r=new mi(e);try{r.checkValid()}catch(i){if(i instanceof Jo)i.printStackTrace();else throw i}finally{}},Di.prototype.getNodedSubstrings=function(){return wt.getNodedSubstrings(this._nodedSegStrings)},Di.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},Di.prototype.findInteriorIntersections=function(t,e){var r=new Ur(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},Di.prototype.computeVertexSnaps=function(){var t=this;if(H(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 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)}},Di.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ho,this._pointSnapper=new _s(this._noder.getIndex()),this.snapRound(t,this._li)},Di.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=new pe(i,e._scaleFactor,e._li);e._pointSnapper.snap(n)}},Di.prototype.interfaces_=function(){return[Wr]},Di.prototype.getClass=function(){return Di};var zt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new ft,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}},Cs={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 ar(new Di(new at(1)),t.getScale()),r=new re(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.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 Hi)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=zt.precisionScaleFactor(this._argGeom,this._distance,r),n=new at(i);this.bufferFixedPrecision(n)}},zt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===at.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 Gi)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],r=new zt(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 zt(n);u.setQuadrantSegments(f);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof ft&&arguments[0]instanceof U&&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 m=arguments[0],_=arguments[1],W=arguments[2],C=arguments[3],I=new zt(m);I.setQuadrantSegments(W),I.setEndCapStyle(C);var T=I.getResultGeometry(_);return T}},zt.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),n=Ae.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},Cs.CAP_ROUND.get=function(){return ft.CAP_ROUND},Cs.CAP_BUTT.get=function(){return ft.CAP_FLAT},Cs.CAP_FLAT.get=function(){return ft.CAP_FLAT},Cs.CAP_SQUARE.get=function(){return ft.CAP_SQUARE},Cs.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(zt,Cs);var se=function(){this._pt=[new A,new A],this._distance=j.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],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)}},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 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}},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],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)}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var bi=function(){};bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.computeDistance=function(){if(arguments[2]instanceof se&&arguments[0]instanceof Wt&&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 se&&arguments[0]instanceof Rt&&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 se&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)bi.computeDistance(p,d,h);else if(p instanceof Rt)bi.computeDistance(p,d,h);else if(p instanceof te)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 se&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],T=arguments[2],w=C.closestPoint(I);T.setMinimum(w,I)}};var Ar=function(t){this._maxPtDist=new se,this._inputGeom=t||null},lo={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ar.prototype.computeMaxMidpointDistance=function(t){var e=new fr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ar.prototype.computeMaxVertexDistance=function(t){var e=new qr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Ar.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Ar.prototype.getDistancePoints=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},lo.MaxPointDistanceFilter.get=function(){return qr},lo.MaxMidpointDistanceFilter.get=function(){return fr},Object.defineProperties(Ar,lo);var qr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};qr.prototype.filter=function(t){this._minPtDist.initialize(),bi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},qr.prototype.getMaxPointDistance=function(){return this._maxPtDist},qr.prototype.interfaces_=function(){return[Li]},qr.prototype.getClass=function(){return qr};var fr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};fr.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)},fr.prototype.isDone=function(){return!1},fr.prototype.isGeometryChanged=function(){return!1},fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},fr.prototype.interfaces_=function(){return[Ze]},fr.prototype.getClass=function(){return fr};var Ji=function(t){this._comps=t||null};Ji.prototype.filter=function(t){t instanceof Rt&&this._comps.add(t)},Ji.prototype.interfaces_=function(){return[fi]},Ji.prototype.getClass=function(){return Ji},Ji.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Ji.getPolygons(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Rt?r.add(e):e instanceof te&&e.apply(new Ji(r)),r}};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],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ai){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[Xi]},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],r=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,r))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(H(arguments[0],bt)&&H(arguments[1],bt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var n=i.next();Ut.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 Ut(u,f)),u}else if(arguments[0]instanceof U&&H(arguments[1],bt)){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"&&H(arguments[0],bt)&&H(arguments[1],bt)){for(var c=arguments[0],p=arguments[1],d=arguments[2],h=c.iterator();h.hasNext();){var m=h.next();Ut.getLines(m,p,d)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof U&&H(arguments[1],bt)){var _=arguments[0],W=arguments[1],C=arguments[2];return _.apply(new Ut(W,C)),W}}};var Qe=function(){if(this._boundaryRule=Oe.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}}};Qe.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof A&&arguments[1]instanceof Rt){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 Wt){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 ve){var p=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(p)?P.INTERIOR:P.EXTERIOR}},Qe.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.locatePointInRing(t,e.getCoordinates()):P.EXTERIOR},Qe.prototype.intersects=function(t,e){return this.locate(t,e)!==P.EXTERIOR},Qe.prototype.updateLocationInfo=function(t){t===P.INTERIOR&&(this._isIn=!0),t===P.BOUNDARY&&this._numBoundaries++},Qe.prototype.computeLocation=function(t,e){var r=this;if(e instanceof ve&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Rt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Cr)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 wi)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 te)for(var a=new Si(e);a.hasNext();){var c=a.next();c!==e&&r.computeLocation(t,c)}},Qe.prototype.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:e instanceof Wt?this.locateInternal(t,e):e instanceof Rt?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)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};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 r=arguments[0],i=arguments[1],n=arguments[2];this._component=r,this._segIndex=i,this._pt=n}},_a={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},_a.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ne,_a);var ur=function(t){this._pts=t||null};ur.prototype.filter=function(t){t instanceof ve&&this._pts.add(t)},ur.prototype.interfaces_=function(){return[fi]},ur.prototype.getClass=function(){return ur},ur.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof ve?je.singletonList(t):ur.getPoints(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof ve?r.add(e):e instanceof te&&e.apply(new ur(r)),r}};var Hr=function(){this._locations=null;var t=arguments[0];this._locations=t};Hr.prototype.filter=function(t){(t instanceof ve||t instanceof Wt||t instanceof Rt)&&this._locations.add(new ne(t,0,t.getCoordinate()))},Hr.prototype.interfaces_=function(){return[fi]},Hr.prototype.getClass=function(){return Hr},Hr.getLocations=function(t){var e=new k;return t.apply(new Hr(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Qe,this._minDistanceLocation=null,this._minDistance=j.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}};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 r=arguments[0],i=arguments[1],n=1-r,o=Ji.getPolygons(this._geom[r]);if(o.size()>0){var f=Hr.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&&H(arguments[0],qe)&&H(arguments[1],qe)){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 Rt){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 ne(m,W),null}}},qt.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}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),r=Ut.getLines(this._geom[1]),i=ur.getPoints(this._geom[0]),n=ur.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)},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 ve){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 ne(e,f,a),i[1]=new ne(r,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(),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]),T=new Y(m[W],m[W+1]),w=I.closestPoints(T);d[0]=new ne(c,_,w[0]),d[1]=new ne(p,W,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.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 ne(o,0,o.getCoordinate()),r[1]=new ne(u,0,u.getCoordinate())),i._minDistance<=i._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,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}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var r=new qt(t,e);return r.distance()},qt.isWithinDistance=function(t,e,r){var i=new qt(t,e,r);return i.distance()<=r},qt.nearestPoints=function(t,e){var r=new qt(t,e);return r.nearestPoints()};var $t=function(){this._pt=[new A,new A],this._distance=j.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],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)}},$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 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}},$t.prototype.toString=function(){return Ue.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],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)}},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var yi=function(){};yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi},yi.computeDistance=function(){if(arguments[2]instanceof $t&&arguments[0]instanceof Wt&&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 $t&&arguments[0]instanceof Rt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];yi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)yi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof $t&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Wt)yi.computeDistance(p,d,h);else if(p instanceof Rt)yi.computeDistance(p,d,h);else if(p instanceof te)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);yi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof $t&&arguments[0]instanceof Y&&arguments[1]instanceof A){var C=arguments[0],I=arguments[1],T=arguments[2],w=C.closestPoint(I);T.setMinimum(w,I)}};var Ge=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},co={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ge.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ge.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new vt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ge.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ge.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ge.prototype.computeOrientedDistance=function(t,e,r){var i=new Zr(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var n=new hr(e,this._densifyFrac);t.apply(n),r.setMaximum(n.getMaxPointDistance())}},Ge.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ge(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new Ge(i,n);return f.setDensifyFraction(o),f.distance()}},co.MaxPointDistanceFilter.get=function(){return Zr},co.MaxDensifiedByFractionDistanceFilter.get=function(){return hr},Object.defineProperties(Ge,co);var Zr=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._euclideanDist=new yi,this._geom=null;var t=arguments[0];this._geom=t};Zr.prototype.filter=function(t){this._minPtDist.initialize(),yi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Zr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Zr.prototype.interfaces_=function(){return[Li]},Zr.prototype.getClass=function(){return Zr};var hr=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))};hr.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(),yi.computeDistance(r._geom,c,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},hr.prototype.isDone=function(){return!1},hr.prototype.isGeometryChanged=function(){return!1},hr.prototype.getMaxPointDistance=function(){return this._maxPtDist},hr.prototype.interfaces_=function(){return[Ze]},hr.prototype.getClass=function(){return hr};var We=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},po={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};We.prototype.checkMaximumDistance=function(t,e,r){var i=new Ge(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 "+Ue.toLineString(n[0],n[1])+")"}},We.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=We.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(),We.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)},We.prototype.checkNegativeValid=function(){if(!(this._input instanceof Rt||this._input instanceof wi||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)},We.prototype.getErrorIndicator=function(){return this._errorIndicator},We.prototype.checkMinimumDistance=function(t,e,r){var i=new qt(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 "+Ue.toLineString(n[0],n[1])+" )"}},We.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)},We.prototype.getErrorLocation=function(){return this._errorLocation},We.prototype.getPolygonLines=function(t){for(var e=new k,r=new Ut(e),i=Ji.getPolygons(t),n=i.iterator();n.hasNext();){var o=n.next();o.apply(r)}return t.getFactory().buildGeometry(e)},We.prototype.getErrorMessage=function(){return this._errMsg},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},po.VERBOSE.get=function(){return!1},po.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(We,po);var Ht=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},go={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ht.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},Ht.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ht.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new G(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new G(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")},Ht.prototype.checkDistance=function(){var t=new We(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")},Ht.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")},Ht.prototype.checkPolygonal=function(){this._result instanceof Rt||this._result instanceof wi||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ht.prototype.getErrorIndicator=function(){return this._errorIndicator},Ht.prototype.getErrorLocation=function(){return this._errorLocation},Ht.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")},Ht.prototype.report=function(t){if(!Ht.VERBOSE)return null;Xt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ht.prototype.getErrorMessage=function(){return this._errorMsg},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isValidMsg=function(t,e,r){var i=new Ht(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ht.isValid=function(t,e,r){var i=new Ht(t,e,r);return!!i.isValid()},go.VERBOSE.get=function(){return!1},go.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ht,go);var vi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};vi.prototype.getCoordinates=function(){return this._pts},vi.prototype.size=function(){return this._pts.length},vi.prototype.getCoordinate=function(t){return this._pts[t]},vi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},vi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Xr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},vi.prototype.setData=function(t){this._data=t},vi.prototype.getData=function(){return this._data},vi.prototype.toString=function(){return Ue.toLineString(new At(this._pts))},vi.prototype.interfaces_=function(){return[Pi]},vi.prototype.getClass=function(){return vi};var Vt=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};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,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++)},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[Tr]},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 $e=function(){this._li=new yr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};$e.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},$e.prototype.getIntersections=function(){return this._segInt.getIntersections()},$e.prototype.isValid=function(){return this.execute(),this._isValid},$e.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$e.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ho;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},$e.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Hi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},$e.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ue.toLineString(t[0],t[1])+" and "+Ue.toLineString(t[2],t[3])},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.computeIntersections=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var wr=function s(){this._nv=null;var t=arguments[0];this._nv=new $e(s.toSegmentStrings(t))};wr.prototype.checkValid=function(){this._nv.checkValid()},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.toSegmentStrings=function(t){for(var e=new k,r=t.iterator();r.hasNext();){var i=r.next();e.add(new vi(i.getCoordinates(),i))}return e},wr.checkValid=function(t){var e=new wr(t);e.checkValid()};var Kr=function(t){this._mapOp=t};Kr.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(tt.toGeometryArray(r))},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.map=function(t,e){var r=new Kr(e);return r.map(t)};var _i=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};_i.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)}},_i.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},_i.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},_i.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))},_i.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)}}},_i.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))}},_i.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)}},_i.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))},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var jr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new k;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};jr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},jr.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)}}},jr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};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 r=this,i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);(n===null||!(n instanceof Ai)||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 Ai||(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)},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 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)},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 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)},ge.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)},ge.prototype.copy=function(t){return t.copy()},ge.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(tt.toGeometryArray(i)):this._factory.buildGeometry(i)},ge.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ve)return this.transformPoint(t,null);if(t instanceof gs)return this.transformMultiPoint(t,null);if(t instanceof Ai)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof Cr)return this.transformMultiLineString(t,null);if(t instanceof Rt)return this.transformPolygon(t,null);if(t instanceof wi)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 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)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var Ri=function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Y,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 r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=s.isClosed(r),this._snapTolerance=i}};Ri.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)))}},Ri.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},Ri.prototype.snapTo=function(t){var e=new Ms(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Ri.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)}},Ri.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=j.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},Ri.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Et=function(t){this._srcGeom=t||null},Ca={SNAP_PRECISION_FACTOR:{configurable:!0}};Et.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Wa(e,r);return i.transform(this._srcGeom)},Et.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Wa(t,r,!0),n=i.transform(this._srcGeom),o=n;return e&&H(o,rr)&&(o=n.buffer(0)),o},Et.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},Et.prototype.extractTargetCoordinates=function(t){for(var e=new ai,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},Et.prototype.computeMinimumSegmentLength=function(t){for(var e=j.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.snap=function(t,e,r){var i=new Array(2).fill(null),n=new Et(t);i[0]=n.snapTo(e,r);var o=new Et(e);return i[1]=o.snapTo(i[0],r),i},Et.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Et.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===at.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(Et.computeOverlaySnapTolerance(n),Et.computeOverlaySnapTolerance(o))}},Et.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Et.SNAP_PRECISION_FACTOR;return i},Et.snapToSelf=function(t,e,r){var i=new Et(t);return i.snapToSelf(e,r)},Ca.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Et,Ca);var Wa=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 Ri(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}(ge),oe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};oe.prototype.getCommon=function(){return j.longBitsToDouble(this._commonBits)},oe.prototype.add=function(t){var e=j.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=oe.signExpBits(this._commonBits),this._isFirst=!1,null;var r=oe.signExpBits(e);if(r!==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=j.longBitsToDouble(t),r=j.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}},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.getBit=function(t,e){var r=1<<e;return t&r?1:0},oe.signExpBits=function(t){return t>>52},oe.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,n=t&i;return n},oe.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(oe.getBit(t,i)!==oe.getBit(e,i))return r;r++}return 52};var lr=function(){this._commonCoord=null,this._ccFilter=new Jr},mo={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};lr.prototype.addCommonBits=function(t){var e=new cr(this._commonCoord);t.apply(e),t.geometryChanged()},lr.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 cr(e);return t.apply(r),t.geometryChanged(),t},lr.prototype.getCommonCoordinate=function(){return this._commonCoord},lr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},mo.CommonCoordinateFilter.get=function(){return Jr},mo.Translater.get=function(){return cr},Object.defineProperties(lr,mo);var Jr=function(){this._commonBitsX=new oe,this._commonBitsY=new oe};Jr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Jr.prototype.getCommonCoordinate=function(){return new A(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Jr.prototype.interfaces_=function(){return[Li]},Jr.prototype.getClass=function(){return Jr};var cr=function(){this.trans=null;var t=arguments[0];this.trans=t};cr.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)},cr.prototype.isDone=function(){return!1},cr.prototype.isGeometryChanged=function(){return!0},cr.prototype.interfaces_=function(){return[Ze]},cr.prototype.getClass=function(){return cr};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),r=e.snapTo(t,this._snapTolerance);return r},Gt.prototype.removeCommonBits=function(t){this._cbr=new lr,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),r=J.overlayOp(e[0],e[1],t);return this.prepareResult(r)},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),r=Et.snap(e[0],e[1],this._snapTolerance);return r},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.overlayOp=function(t,e,r){var i=new Gt(t,e);return i.getResultGeometry(r)},Gt.union=function(t,e){return Gt.overlayOp(t,e,J.UNION)},Gt.intersection=function(t,e){return Gt.overlayOp(t,e,J.INTERSECTION)},Gt.symDifference=function(t,e){return Gt.overlayOp(t,e,J.SYMDIFFERENCE)},Gt.difference=function(t,e){return Gt.overlayOp(t,e,J.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,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 Gi)i=o;else throw o}finally{}if(!r)try{e=Gt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Gi?i:o}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,r){var i=new ae(t,e);return i.getResultGeometry(r)},ae.union=function(t,e){return ae.overlayOp(t,e,J.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,J.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,J.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,J.DIFFERENCE)};var Ks=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Ks.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks};var Ie=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}},yo={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ie.prototype.isDelete=function(){return this._eventType===Ie.DELETE},Ie.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ie.prototype.getObject=function(){return this._obj},Ie.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},Ie.prototype.getInsertEvent=function(){return this._insertEvent},Ie.prototype.isInsert=function(){return this._eventType===Ie.INSERT},Ie.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Ie.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ie.prototype.interfaces_=function(){return[Me]},Ie.prototype.getClass=function(){return Ie},yo.INSERT.get=function(){return 1},yo.DELETE.get=function(){return 2},Object.defineProperties(Ie,yo);var An=function(){};An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var Zt=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};Zt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Zt.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},Zt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Zt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zt.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},Zt.prototype.hasProperIntersection=function(){return this._hasProper},Zt.prototype.hasIntersection=function(){return this._hasIntersection},Zt.prototype.isDone=function(){return this._isDone},Zt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Zt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Zt.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))))},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Jf=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;je.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 Zt&&H(arguments[0],qe)&&H(arguments[1],qe)){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"&&H(arguments[0],qe)&&arguments[1]instanceof Zt){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 Ks(o,u),a=new Ie(i,o.getMinX(u),l);n.events.add(a),n.events.add(new Ie(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}(An),Mi=function(){this._min=j.POSITIVE_INFINITY,this._max=j.NEGATIVE_INFINITY},Ia={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 Ue.toLineString(new A(this._min,0),new A(this._max,0))},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Ia.NodeComparator.get=function(){return js},Object.defineProperties(Mi,Ia);var js=function(){};js.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},js.prototype.interfaces_=function(){return[rs]},js.prototype.getClass=function(){return js};var Qf=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),$f=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),Bi=function(){this._leaves=new k,this._root=null,this._level=0};Bi.prototype.buildTree=function(){var t=this;je.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}},Bi.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 Qf(t,e,r))},Bi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},Bi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Bi.prototype.printNode=function(t){Xt.out.println(Ue.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 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 $f(t.get(r),t.get(r+1));e.add(o)}}},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi};var Ws=function(){this._items=new k};Ws.prototype.visitItem=function(t){this._items.add(t)},Ws.prototype.getItems=function(){return this._items},Ws.prototype.interfaces_=function(){return[sr]},Ws.prototype.getClass=function(){return Ws};var Is=function(){this._index=null;var t=arguments[0];if(!H(t,rr))throw new vt("Argument must be Polygonal");this._index=new Er(t)},vo={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Is.prototype.locate=function(t){var e=new oi(t),r=new Ts(e);return this._index.query(t.y,t.y,r),e.getLocation()},Is.prototype.interfaces_=function(){return[vs]},Is.prototype.getClass=function(){return Is},vo.SegmentVisitor.get=function(){return Ts},vo.IntervalIndexedGeometry.get=function(){return Er},Object.defineProperties(Is,vo);var Ts=function(){this._counter=null;var t=arguments[0];this._counter=t};Ts.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ts.prototype.interfaces_=function(){return[sr]},Ts.prototype.getClass=function(){return Ts};var Er=function(){this._index=new Bi;var t=arguments[0];this.init(t)};Er.prototype.init=function(t){for(var e=this,r=Ut.getLines(t),i=r.iterator();i.hasNext();){var n=i.next(),o=n.getCoordinates();e.addLine(o)}},Er.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)}},Er.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ws;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)}},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var Js=function(s){function t(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new ra,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Qe,arguments.length===2){var e=arguments[0],r=arguments[1],i=Oe.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 Zt(n,!0,!1);u.setIsDoneIfProperInt(f);var l=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Ai||this._parentGeom instanceof Rt||this._parentGeom instanceof wi,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 Zt(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 ve){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=$.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var n=new Ln(i,new lt(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=$.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 Ln(o,new lt(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 lt(r,n):f.setLocation(r,n)},t.prototype.createEdgeSetIntersector=function(){return new Jf},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 wi&&(this._useBoundaryDeterminationRule=!1),r instanceof Rt)this.addPolygon(r);else if(r instanceof Wt)this.addLineString(r);else if(r instanceof ve)this.addPoint(r);else if(r instanceof gs)this.addCollection(r);else if(r instanceof Cr)this.addCollection(r);else if(r instanceof wi)this.addCollection(r);else if(r instanceof te)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 H(this._parentGeom,rr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Is(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}(Ct),Ls=function(){if(this._li=new yr,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 Js(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Oe.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 Js(0,e,i),this._arg[1]=new Js(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 Js(0,n,f),this._arg[1]=new Js(1,o,f)}};Ls.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ls.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Pr=function(){};Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.map=function(){if(arguments[0]instanceof U&&H(arguments[1],Pr.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(H(arguments[0],bt)&&H(arguments[1],Pr.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}},Pr.MapOp=function(){};var J=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r),this._ptLocator=new Qe,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 Ct(new pa),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 lt(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(),wr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var n=new _e(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var o=new _i(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var f=new jr(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}(Ls);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 Kr.map(s,{interfaces_:function(){return[Pr.MapOp]},map:function(r){return r.intersection(e)}})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.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),ae.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),ae.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 pr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Qe,this._seg=new Y;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};pr.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},pr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?P.BOUNDARY:this._ptLocator.locate(t,this._g)},pr.prototype.extractLinework=function(t){var e=new As;t.apply(e);var r=e.getLinework(),i=tt.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var As=function(){this._linework=null,this._linework=new k};As.prototype.getLinework=function(){return this._linework},As.prototype.filter=function(t){var e=this;if(t instanceof Rt){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},As.prototype.interfaces_=function(){return[fi]},As.prototype.getClass=function(){return As};var Sr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Sr.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)},Sr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Sr.prototype.getPoints=function(t){for(var e=this,r=new k,i=Ut.getLines(this._g),n=i.iterator();n.hasNext();){var o=n.next();e.extractPoints(o,t,r)}return r},Sr.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)}},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Ne=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 pr(this._geom[0],this._boundaryDistanceTolerance),new pr(this._geom[1],this._boundaryDistanceTolerance),new pr(this._geom[2],this._boundaryDistanceTolerance)]},Ta={TOLERANCE:{configurable:!0}};Ne.prototype.reportResult=function(t,e,r){Xt.out.println("Overlay result invalid - A:"+P.toLocationSymbol(e[0])+" B:"+P.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+P.toLocationSymbol(e[2]))},Ne.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ne.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),Ne.hasLocation(this._location,P.BOUNDARY)?!0:this.isValidResult(n,this._location)}},Ne.prototype.addTestPts=function(t){var e=new Sr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ne.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},Ne.prototype.getInvalidLocation=function(){return this._invalidLocation},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},Ne.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Et.computeSizeBasedSnapTolerance(t),Et.computeSizeBasedSnapTolerance(e))},Ne.isValid=function(t,e,r,i){var n=new Ne(t,e,i);return n.isValid(r)},Ta.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ne,Ta);var De=function s(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(t),this._inputGeoms=t};De.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)}},De.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)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.combine=function(){if(arguments.length===1){var t=arguments[0],e=new De(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new De(De.createList(r,i));return n.combine()}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2],l=new De(De.createList(o,f,u));return l.combine()}},De.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},De.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 Dt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new k)},La={STRTREE_NODE_CAPACITY:{configurable:!0}};Dt.prototype.reduceToGeometries=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=null;H(n,qe)?o=e.unionTree(n):n instanceof U&&(o=n),r.add(o)}return r},Dt.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)},Dt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var n=De.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)},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 aa(Dt.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},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],r=arguments[1],i=arguments[2];if(i-r<=1){var n=Dt.getGeometry(e,r);return this.unionSafe(n,null)}else{if(i-r===2)return this.unionSafe(Dt.getGeometry(e,r),Dt.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)}}},Dt.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},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),r=this.binaryUnion(e);return r},Dt.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=De.combine(i);return u},Dt.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}},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},Dt.restrictToPolygons=function(t){if(H(t,rr))return t;var e=Ji.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()},La.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Dt,La);var wn=function(){};wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.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),ae.overlayOp(t,e,J.UNION)};function Nr(){return new En}function En(){this.reset()}En.prototype={constructor:En,reset:function(){this.s=this.t=0},add:function(s){Aa(Pn,s,this.t),Aa(this,Pn.s,this.s),this.s?this.t+=Pn.t:this.s=Pn.t},valueOf:function(){return this.s}};var Pn=new En;function Aa(s,t,e){var r=s.s=t+e,i=r-t,n=r-i;s.t=t-n+(e-i)}var Tt=1e-6,gt=Math.PI,Qi=gt/2,wa=gt/4,$i=gt*2,Dr=180/gt,Ci=gt/180,fe=Math.abs,tu=Math.atan,ws=Math.atan2,Bt=Math.cos,Ot=Math.sin,Es=Math.sqrt;function Ea(s){return s>1?0:s<-1?gt:Math.acos(s)}function Qr(s){return s>1?Qi:s<-1?-Qi:Math.asin(s)}function Qs(){}function Sn(s,t){s&&Sa.hasOwnProperty(s.type)&&Sa[s.type](s,t)}var Pa={Feature:function(s,t){Sn(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,r=-1,i=e.length;++r<i;)Sn(e[r].geometry,t)}},Sa={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){_o(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)_o(e[r],t,0)},Polygon:function(s,t){Na(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)Na(e[r],t)},GeometryCollection:function(s,t){for(var e=s.geometries,r=-1,i=e.length;++r<i;)Sn(e[r],t)}};function _o(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 Na(s,t){var e=-1,r=s.length;for(t.polygonStart();++e<r;)_o(s[e],t,1);t.polygonEnd()}function eu(s,t){s&&Pa.hasOwnProperty(s.type)?Pa[s.type](s,t):Sn(s,t)}Nr(),Nr();function Co(s){return[ws(s[1],s[0]),Qr(s[2])]}function Ps(s){var t=s[0],e=s[1],r=Bt(e);return[r*Bt(t),r*Ot(t),Ot(e)]}function Nn(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function Dn(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 Wo(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function bn(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function Io(s){var t=Es(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}Nr();function Da(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 To(s,t){return[s>gt?s-$i:s<-gt?s+$i:s,t]}To.invert=To;function iu(s,t,e){return(s%=$i)?t||e?Da(Ra(s),Ma(t,e)):Ra(s):t||e?Ma(t,e):To}function ba(s){return function(t,e){return t+=s,[t>gt?t-$i:t<-gt?t+$i:t,e]}}function Ra(s){var t=ba(s);return t.invert=ba(-s),t}function Ma(s,t){var e=Bt(s),r=Ot(s),i=Bt(t),n=Ot(t);function o(f,u){var l=Bt(u),a=Bt(f)*l,c=Ot(f)*l,p=Ot(u),d=p*e+a*r;return[ws(c*i-d*n,a*e-p*r),Qr(d*i+c*n)]}return o.invert=function(f,u){var l=Bt(u),a=Bt(f)*l,c=Ot(f)*l,p=Ot(u),d=p*i-c*n;return[ws(c*i+p*n,a*e+d*r),Qr(d*e-a*r)]},o}function ru(s,t,e,r,i,n){if(e){var o=Bt(t),f=Ot(t),u=r*e;i==null?(i=t+r*$i,n=t-u/2):(i=Ba(o,i),n=Ba(o,n),(r>0?i<n:i>n)&&(i+=r*$i));for(var l,a=i;r>0?a>n:a<n;a-=u)l=Co([o,-f*Bt(a),-f*Ot(a)]),s.point(l[0],l[1])}}function Ba(s,t){t=Ps(t),t[0]-=s,Io(t);var e=Ea(-t[1]);return((-t[2]<0?-e:e)+$i-Tt)%$i}function Oa(){var s=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){s.push(t=[])},lineEnd:Qs,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function su(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 Rn(s,t){return fe(s[0]-t[0])<Tt&&fe(s[1]-t[1])<Tt}function Mn(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 Fa(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(Rn(_,W)){for(i.lineStart(),f=0;f<m;++f)i.point((_=h[f])[0],_[1]);i.lineEnd();return}n.push(C=new Mn(_,h,null,!0)),o.push(C.o=new Mn(_,null,C,!1)),n.push(C=new Mn(W,h,null,!1)),o.push(C.o=new Mn(W,null,C,!0))}}),!!n.length){for(o.sort(t),xa(n),xa(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 xa(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 ka(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function nu(s){return s.length===1&&(s=ou(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 ou(s){return function(t,e){return ka(s(t),e)}}nu(ka);function Va(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 $s=1e9,Bn=-$s;function au(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 fe(l[0]-s)<Tt?a>0?0:3:fe(l[0]-e)<Tt?a>0?2:1:fe(l[1]-t)<Tt?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=Oa(),p,d,h,m,_,W,C,I,T,w,N,b={point:B,lineStart:q,lineEnd:Z,polygonStart:F,polygonEnd:M};function B(X,K){i(X,K)&&a.point(X,K)}function R(){for(var X=0,K=0,et=d.length;K<et;++K)for(var nt=d[K],ht=1,ei=nt.length,Xe=nt[0],Ft,ii,tr=Xe[0],Oi=Xe[1];ht<ei;++ht)Ft=tr,ii=Oi,Xe=nt[ht],tr=Xe[0],Oi=Xe[1],ii<=r?Oi>r&&(tr-Ft)*(r-ii)>(Oi-ii)*(s-Ft)&&++X:Oi<=r&&(tr-Ft)*(r-ii)<(Oi-ii)*(s-Ft)&&--X;return X}function F(){a=c,p=[],d=[],N=!0}function M(){var X=R(),K=N&&X,et=(p=Va(p)).length;(K||et)&&(l.polygonStart(),K&&(l.lineStart(),n(null,null,1,l),l.lineEnd()),et&&Fa(p,f,X,n,l),l.polygonEnd()),a=l,p=d=h=null}function q(){b.point=O,d&&d.push(h=[]),w=!0,T=!1,C=I=NaN}function Z(){p&&(O(m,_),W&&T&&c.rejoin(),p.push(c.result())),b.point=B,T&&a.lineEnd()}function O(X,K){var et=i(X,K);if(d&&h.push([X,K]),w)m=X,_=K,W=et,w=!1,et&&(a.lineStart(),a.point(X,K));else if(et&&T)a.point(X,K);else{var nt=[C=Math.max(Bn,Math.min($s,C)),I=Math.max(Bn,Math.min($s,I))],ht=[X=Math.max(Bn,Math.min($s,X)),K=Math.max(Bn,Math.min($s,K))];su(nt,ht,s,t,e,r)?(T||(a.lineStart(),a.point(nt[0],nt[1])),a.point(ht[0],ht[1]),et||a.lineEnd(),N=!1):et&&(a.lineStart(),a.point(X,K),N=!1)}C=X,I=K,T=et}return b}}var Lo=Nr();function fu(s,t){var e=t[0],r=t[1],i=[Ot(e),-Bt(e),0],n=0,o=0;Lo.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+wa,h=Ot(d),m=Bt(d),_=0;_<a;++_,p=C,h=T,m=w,c=W){var W=l[_],C=W[0],I=W[1]/2+wa,T=Ot(I),w=Bt(I),N=C-p,b=N>=0?1:-1,B=b*N,R=B>gt,F=h*T;if(Lo.add(ws(F*b*Ot(B),m*w+F*Bt(B))),n+=R?N+b*$i:N,R^p>=e^C>=e){var M=Dn(Ps(c),Ps(W));Io(M);var q=Dn(i,M);Io(q);var Z=(R^N>=0?-1:1)*Qr(q[2]);(r>Z||r===Z&&(M[0]||M[1]))&&(o+=R^N>=0?1:-1)}}return(n<-Tt||n<Tt&&Lo<-Tt)^o&1}Nr();function Ga(s){return s}Nr(),Nr();var Ss=1/0,On=Ss,tn=-Ss,Fn=tn,Xa={point:uu,lineStart:Qs,lineEnd:Qs,polygonStart:Qs,polygonEnd:Qs,result:function(){var s=[[Ss,On],[tn,Fn]];return tn=Fn=-(On=Ss=1/0),s}};function uu(s,t){s<Ss&&(Ss=s),s>tn&&(tn=s),t<On&&(On=t),t>Fn&&(Fn=t)}Nr();function Ya(s,t,e,r){return function(i,n){var o=t(n),f=i.invert(r[0],r[1]),u=Oa(),l=t(u),a=!1,c,p,d,h={point:m,lineStart:W,lineEnd:C,polygonStart:function(){h.point=I,h.lineStart=T,h.lineEnd=w,p=[],c=[]},polygonEnd:function(){h.point=m,h.lineStart=W,h.lineEnd=C,p=Va(p);var N=fu(c,f);p.length?(a||(n.polygonStart(),a=!0),Fa(p,lu,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,b){var B=i(N,b);s(N=B[0],b=B[1])&&n.point(N,b)}function _(N,b){var B=i(N,b);o.point(B[0],B[1])}function W(){h.point=_,o.lineStart()}function C(){h.point=m,o.lineEnd()}function I(N,b){d.push([N,b]);var B=i(N,b);l.point(B[0],B[1])}function T(){l.lineStart(),d=[]}function w(){I(d[0][0],d[0][1]),l.lineEnd();var N=l.clean(),b=u.result(),B,R=b.length,F,M,q;if(d.pop(),c.push(d),d=null,!!R){if(N&1){if(M=b[0],(F=M.length-1)>0){for(a||(n.polygonStart(),a=!0),n.lineStart(),B=0;B<F;++B)n.point((q=M[B])[0],q[1]);n.lineEnd()}return}R>1&&N&2&&b.push(b.pop().concat(b.shift())),p.push(b.filter(hu))}}return h}}function hu(s){return s.length>1}function lu(s,t){return((s=s.x)[0]<0?s[1]-Qi-Tt:Qi-s[1])-((t=t.x)[0]<0?t[1]-Qi-Tt:Qi-t[1])}const za=Ya(function(){return!0},cu,gu,[-gt,-Qi]);function cu(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=fe(n-t);fe(u-gt)<Tt?(s.point(t,e=(e+o)/2>0?Qi:-Qi),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),s.point(n,e),i=0):r!==f&&u>=gt&&(fe(t-r)<Tt&&(t-=r*Tt),fe(n-f)<Tt&&(n-=f*Tt),e=pu(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 pu(s,t,e,r){var i,n,o=Ot(s-e);return fe(o)>Tt?tu((Ot(t)*(n=Bt(r))*Ot(e)-Ot(r)*(i=Bt(t))*Ot(s))/(i*n*o)):(t+r)/2}function gu(s,t,e,r){var i;if(s==null)i=e*Qi,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(fe(s[0]-t[0])>Tt){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 du(s,t){var e=Bt(s),r=e>0,i=fe(e)>Tt;function n(a,c,p,d){ru(d,s,t,p,a,c)}function o(a,c){return Bt(a)*Bt(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,T=o(_,W),w=r?T?0:l(_,W):T?l(_+(_<0?gt:-gt),W):0;if(!c&&(h=d=T)&&a.lineStart(),T!==d&&(I=u(c,C),(!I||Rn(c,I)||Rn(C,I))&&(C[0]+=Tt,C[1]+=Tt,T=o(C[0],C[1]))),T!==d)m=0,T?(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^T){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])))}T&&(!c||!Rn(c,C))&&a.point(C[0],C[1]),c=C,d=T,p=w},lineEnd:function(){d&&a.lineEnd(),c=null},clean:function(){return m|(h&&d)<<1}}}function u(a,c,p){var d=Ps(a),h=Ps(c),m=[1,0,0],_=Dn(d,h),W=Nn(_,_),C=_[0],I=W-C*C;if(!I)return!p&&a;var T=e*W/I,w=-e*C/I,N=Dn(m,_),b=bn(m,T),B=bn(_,w);Wo(b,B);var R=N,F=Nn(b,R),M=Nn(R,R),q=F*F-M*(Nn(b,b)-1);if(!(q<0)){var Z=Es(q),O=bn(R,(-F-Z)/M);if(Wo(O,b),O=Co(O),!p)return O;var X=a[0],K=c[0],et=a[1],nt=c[1],ht;K<X&&(ht=X,X=K,K=ht);var ei=K-X,Xe=fe(ei-gt)<Tt,Ft=Xe||ei<Tt;if(!Xe&&nt<et&&(ht=et,et=nt,nt=ht),Ft?Xe?et+nt>0^O[1]<(fe(O[0]-X)<Tt?et:nt):et<=O[1]&&O[1]<=nt:ei>gt^(X<=O[0]&&O[0]<=K)){var ii=bn(R,(-F+Z)/M);return Wo(ii,b),[O,Co(ii)]}}}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 Ya(o,f,n,r?[0,-s]:[-gt,s-gt])}function Ua(s){return function(t){var e=new Ao;for(var r in s)e[r]=s[r];return e.stream=t,e}}function Ao(){}Ao.prototype={constructor:Ao,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 qa(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),eu(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 mu(s,t,e){return qa(s,[[0,0],t],e)}var Ha=16,yu=Bt(30*Ci);function Za(s,t){return+t?_u(s,t):vu(s)}function vu(s){return Ua({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function _u(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 T=o+p,w=f+d,N=u+h,b=Es(T*T+w*w+N*N),B=Qr(N/=b),R=fe(fe(N)-1)<Tt||fe(n-c)<Tt?(n+c)/2:ws(w,T),F=s(R,B),M=F[0],q=F[1],Z=M-r,O=q-i,X=C*Z-W*O;(X*X/I>t||fe((W*Z+C*O)/I-.5)>.3||o*p+f*d+u*h<yu)&&(e(r,i,n,o,f,u,M,q,R,T/=b,w/=b,N,m,_),_.point(M,q),e(M,q,R,T,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:T,polygonStart:function(){r.polygonStart(),_.lineStart=w},polygonEnd:function(){r.polygonEnd(),_.lineStart=C}};function W(B,R){B=s(B,R),r.point(B[0],B[1])}function C(){c=NaN,_.point=I,r.lineStart()}function I(B,R){var F=Ps([B,R]),M=s(B,R);e(c,p,a,d,h,m,c=M[0],p=M[1],a=B,d=F[0],h=F[1],m=F[2],Ha,r),r.point(c,p)}function T(){_.point=W,r.lineEnd()}function w(){C(),_.point=N,_.lineEnd=b}function N(B,R){I(i=B,R),n=c,o=p,f=d,u=h,l=m,_.point=I}function b(){e(c,p,a,d,h,m,n,o,i,f,u,l,Ha,r),_.lineEnd=T,T()}return _}}var Cu=Ua({point:function(s,t){this.stream.point(s*Ci,t*Ci)}});function Wu(s){return Iu(function(){return s})()}function Iu(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=za,_=null,W,C,I,T=Ga,w=.5,N=Za(M,w),b,B;function R(O){return O=d(O[0]*Ci,O[1]*Ci),[O[0]*e+n,o-O[1]*e]}function F(O){return O=d.invert((O[0]-n)/e,(o-O[1])/e),O&&[O[0]*Dr,O[1]*Dr]}function M(O,X){return O=t(O,X),[O[0]*e+n,o-O[1]*e]}R.stream=function(O){return b&&B===O?b:b=Cu(m(p,N(T(B=O))))},R.clipAngle=function(O){return arguments.length?(m=+O?du(h=O*Ci,6*Ci):(h=null,za),Z()):h*Dr},R.clipExtent=function(O){return arguments.length?(T=O==null?(_=W=C=I=null,Ga):au(_=+O[0][0],W=+O[0][1],C=+O[1][0],I=+O[1][1]),Z()):_==null?null:[[_,W],[C,I]]},R.scale=function(O){return arguments.length?(e=+O,q()):e},R.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],q()):[r,i]},R.center=function(O){return arguments.length?(f=O[0]%360*Ci,u=O[1]%360*Ci,q()):[f*Dr,u*Dr]},R.rotate=function(O){return arguments.length?(l=O[0]%360*Ci,a=O[1]%360*Ci,c=O.length>2?O[2]%360*Ci:0,q()):[l*Dr,a*Dr,c*Dr]},R.precision=function(O){return arguments.length?(N=Za(M,w=O*O),Z()):Es(w)},R.fitExtent=function(O,X){return qa(R,O,X)},R.fitSize=function(O,X){return mu(R,O,X)};function q(){d=Da(p=iu(l,a,c),t);var O=t(f,u);return n=r-O[0]*e,o=i+O[1]*e,Z()}function Z(){return b=B=null,R}return function(){return t=s.apply(this,arguments),R.invert=t.invert&&F,q()}}function Ka(s){return function(t,e){var r=Bt(t),i=Bt(e),n=s(r*i);return[n*i*Ot(t),n*Ot(e)]}}function ja(s){return function(t,e){var r=Es(t*t+e*e),i=s(r),n=Ot(i),o=Bt(i);return[ws(t*n,r*o),Qr(r&&e*n/r)]}}var Tu=Ka(function(s){return Es(2/(1+s))});Tu.invert=ja(function(s){return 2*Qr(s/2)});var Ja=Ka(function(s){return(s=Ea(s))&&s/Ot(s)});Ja.invert=ja(function(s){return s});function Lu(){return Wu(Ja).scale(79.4188).clipAngle(180-.001)}function Qa(s,t){return[s,t]}Qa.invert=Qa;function Au(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 Zn(s,function(o){var f=xn(o,t,r,i);f&&n.push(f)}),nn(n);case"FeatureCollection":return Hn(s,function(o){var f=xn(o,t,r,i);f&&Hn(f,function(u){u&&n.push(u)})}),nn(n)}return xn(s,t,r,i)}function xn(s,t,e,r){var i=s.properties||{},n=s.type==="Feature"?s.geometry:s;if(n.type==="GeometryCollection"){var o=[];return Zn(s,function(m){var _=xn(m,t,e,r);_&&o.push(_)}),nn(o)}var f=wu(n),u={type:n.type,coordinates:tf(n.coordinates,f)},l=new fo,a=l.read(u),c=Un(on(t,e),"meters"),p=zt.bufferOp(a,c,r),d=new na;if(p=d.write(p),!$a(p.coordinates)){var h={type:p.type,coordinates:ef(p.coordinates,f)};return mr(h,i)}}function $a(s){return Array.isArray(s[0])?$a(s[0]):isNaN(s[0])}function tf(s,t){return typeof s[0]!="object"?t(s):s.map(function(e){return tf(e,t)})}function ef(s,t){return typeof s[0]!="object"?t.invert(s):s.map(function(e){return ef(e,t)})}function wu(s){var t=Lf(s).geometry.coordinates,e=[-t[0],-t[1]];return Lu().rotate(e).scale(ye)}class Eu{constructor(){L(this,"LineID","myEntity1");L(this,"Tag","");L(this,"towers",[]);L(this,"ISPhaseSequence",!1);L(this,"Wairnum",0);L(this,"Type",0);L(this,"corridor_features",[]);L(this,"wireAColor","#FFFFFF");L(this,"wireBColor","#FFFFFF");L(this,"wireCColor","#FFFFFF");L(this,"wireTColor","#FFFFFF");L(this,"wireD1Color","#FFFFFF");L(this,"wireD2Color","#FFFFFF");L(this,"wireWidth",1);L(this,"LineDistanceDisplaymin",0);L(this,"LineDistanceDisplaymax",5e3)}}class Pu{constructor(){L(this,"id","");L(this,"type",0);L(this,"modelid","");L(this,"lon",0);L(this,"lat",0);L(this,"alt",0);L(this,"modelH",0);L(this,"modelurl","");L(this,"modelScale",1);L(this,"modelbox","")}}var de=(s=>(s[s.树木=0]="树木",s[s.房屋=1]="房屋",s[s.高速公路=2]="高速公路",s[s.电力线=3]="电力线",s[s.导线=4]="导线",s[s.地面=5]="地面",s[s.其他地物=6]="其他地物",s))(de||{});class Su{constructor(){L(this,"id","");L(this,"name","");L(this,"type",0);L(this,"Longitude",0);L(this,"Latitude",0);L(this,"Altitude",0);L(this,"RollX",0);L(this,"RollY",90);L(this,"RollZ",0);L(this,"towerScale",1);L(this,"towerHeight",0);L(this,"towerModelUri","");L(this,"towerPoint",[]);L(this,"Insulators",[]);L(this,"DistanceDisplaymin",0);L(this,"DistanceDisplaymax",1e3)}}class Nu{constructor(){L(this,"treeId",0);L(this,"treeCoordinates",[0,0,0]);L(this,"conductorCoordinates",[0,0,0]);L(this,"horizontalDistance",0);L(this,"verticalDistance",0);L(this,"straightLineDistance",0);L(this,"clearanceDistance",0);L(this,"timestamp",0)}}class Du{constructor(){L(this,"id","");L(this,"name","");L(this,"type",0);L(this,"WairFX","进");L(this,"linenum",1);L(this,"Wairnum",0);L(this,"PhaseSequence",0);L(this,"RollX",0);L(this,"RollY",0);L(this,"RollZ",0);L(this,"InsulatorScale",1);L(this,"InsulatorLength",0);L(this,"InsulatorModelUri","");L(this,"InsulatorPoint",[]);L(this,"DistanceDisplaymin",0);L(this,"DistanceDisplaymax",500)}}class bu{constructor(){L(this,"name","");L(this,"X",-45);L(this,"Y",90);L(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||{}),Wi=(s=>(s[s.直线塔=0]="直线塔",s[s.耐张塔=1]="耐张塔",s[s.门架塔=2]="门架塔",s[s.换位塔=3]="换位塔",s))(Wi||{}),rf=(s=>(s[s.交流单回路=0]="交流单回路",s[s.交流双回路=1]="交流双回路",s[s.直流单回路=2]="直流单回路",s[s.直流双回路=3]="直流双回路",s[s.交流四回路=4]="交流四回路",s))(rf||{}),en=(s=>(s[s.地线=0]="地线",s[s.回路一=1]="回路一",s[s.回路二=2]="回路二",s[s.回路三=3]="回路三",s[s.回路四=4]="回路四",s))(en||{}),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||{}),E=(s=>(s[s.单分裂=0]="单分裂",s[s.双分裂=1]="双分裂",s[s.四分裂=2]="四分裂",s[s.六分裂=3]="六分裂",s[s.八分裂=4]="八分裂",s))(E||{}),rt=(s=>(s[s.直线距离=0]="直线距离",s[s.水平距离=1]="水平距离",s[s.垂直距离=2]="垂直距离",s[s.净空距离=3]="净空距离",s[s.安全距离=4]="安全距离",s[s.全部测量=5]="全部测量",s))(rt||{});class sf{constructor(){L(this,"horizontalLevels");L(this,"verticalLevels");L(this,"straightLineLevels");L(this,"clearanceLevels")}}class wo{constructor(){L(this,"typeRules",new Map)}}const ti={units:"kilometers"};function kn(s,t,e,r){const i=Eo(s,t),n=Eo(s,e),o=Eo(s,r),f=Math.min(i,n,o);return f===i?t:f===n?e:r}function Eo(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 Vn=()=>({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"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]}),nf=(()=>{const s=new wo;return s.typeRules.set(de.树木,Vn()),s.typeRules.set(de.房屋,Vn()),s.typeRules.set(de.高速公路,Vn()),s.typeRules.set(de.电力线,Vn()),s})(),Ru=(s,t)=>s.typeRules.get(t)||new sf,br=(s,t,e,r=nf,i=rt.全部测量,n=de.树木)=>{const f=Ru(r||nf,n),u=Re(s.slice(0,2)),{nearestCoord:l}=of(s,t),a=t.findIndex(xt=>xt[0]==l[0]&&xt[1]==l[1]);let c=[];if(a==0)c.push(t[0],t[1]);else if(a==t.length-1)c.push(t[t.length-2],t[t.length-1]);else{const xt=[t[a],t[a+1]],me=[t[a-1],t[a]];var p=Mr(u,ue(xt),ti),d=Mr(u,ue(me),ti);c=p>d?me:xt}console.log("附近的点",a,c);const h=ue([c[0].slice(0,2),c[1].slice(0,2)]),m=Re(c[0].slice(0,2)),_=Re(c[1].slice(0,2));var W=Mr(u,h,ti),C=er(u,m,ti)||0,I=Math.sqrt(C*C-W*W)||0;let T=c[0].slice(0,2);I>0&&(T=qo(h,0,I,ti).geometry.coordinates[1]);const w=er(m,_,ti),N=Math.abs(c[0][2]-c[1][2]),b=Math.min(c[0][2],c[1][2]),B=Math.max(c[0][2],c[1][2]),R=c[0][2]>c[1][2]?B-I/w*N:I/w*N+b;console.log("高度差>>>>",N),console.log("最小高度>>>>",b),console.log("最大高度>>>>",B);const F=R-s[2],M=W*1e3,q=Math.sqrt(M*M+F*F);console.log("水平距离>>>>",M),console.log("竖直距离>>>>",F),console.log("直线距离>>>>",q);let Z="#eff819",O=g.Color.RED;const X=g.Cartesian3.fromDegrees(s[0],s[1],s[2]),K=g.Cartesian3.fromDegrees(T[0],T[1],s[2]),et=g.Cartesian3.fromDegrees(T[0],T[1],R);console.log(`坐标详情: 树木=[${s[0]}, ${s[1]}, ${s[2]}], 导线点=[${T[0]}, ${T[1]}, ${R}]`);var nt=Tf(Re([s[0],s[1]]),Re([T[0],T[1]])).geometry.coordinates;const ht=g.Cartesian3.fromDegrees(nt[0],nt[1],s[2]),ei=g.Cartesian3.fromDegrees(nt[0],nt[1],R-F/2),Xe=g.Cartesian3.fromDegrees(T[0],T[1],R-F/2);let Ft;if((i==rt.水平距离||i==rt.全部测量)&&(f.horizontalLevels&&(Ft=f.horizontalLevels.find(xt=>M>=xt.minDistance&&M<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:ht,name:"水平距离",label:{text:`水平距离${M.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(X),me.push(K);var ii={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(ii),i==rt.水平距离)return}if((i==rt.垂直距离||i==rt.全部测量)&&(f.verticalLevels&&(Ft=f.verticalLevels.find(xt=>F>=xt.minDistance&&F<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:Xe,name:"垂直距离",label:{text:`垂直距离${F.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(K),me.push(et);var tr={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(tr),i==rt.垂直距离)return}if((i==rt.直线距离||i==rt.全部测量)&&(f.straightLineLevels&&(Ft=f.straightLineLevels.find(xt=>q>=xt.minDistance&&q<=xt.maxDistance)),Ft)){Z=Ft.color,O=g.Color.fromCssColorString(Ft.color);const xt={position:ei,name:"直线距离",label:{text:`直线距离${q.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},me=[];me.push(X),me.push(et);var Oi={polyline:{show:!0,positions:me,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};if(e.add(xt),e.add(Oi),i==rt.直线距离)return}},Gn=(s,t,e)=>{const r=Re(s.slice(0,2)),{nearestCoord:i}=of(s,t),n=t.findIndex(F=>F[0]==i[0]&&F[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 F=[t[n],t[n+1]],M=[t[n-1],t[n]];var f=Mr(r,ue(F),ti),u=Mr(r,ue(M),ti);o=f>u?M:F}const l=ue([o[0].slice(0,2),o[1].slice(0,2)]),a=Re(o[0].slice(0,2)),c=Re(o[1].slice(0,2));var p=Mr(r,l,ti),d=er(r,a,ti)||0,h=Math.sqrt(d*d-p*p)||0;let m=o[0].slice(0,2);h>0&&(m=qo(l,0,h,ti).geometry.coordinates[1]);const _=er(a,c,ti),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]),T=o[0][2]>o[1][2]?I-h/_*W:h/_*W+C,w=T-s[2],N=p*1e3,b=Math.sqrt(N*N+w*w),B=parseFloat(T.toFixed(1));return{treeId:e,treeCoordinates:[s[0],s[1],s[2]],conductorCoordinates:[m[0],m[1],T],horizontalDistance:parseFloat(N.toFixed(1)),verticalDistance:parseFloat(w.toFixed(1)),straightLineDistance:parseFloat(b.toFixed(1)),clearanceDistance:B,timestamp:Date.now()}};function of(s,t){const e=Re(s.slice(0,2)),r=[];t.forEach(f=>{r.push(Re([f[0],f[1]]))});const i=nn(r),n=Af(e,i),o=er(e,n,ti);return{nearestCoord:n.geometry.coordinates,nearestDistance:o}}function D(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 gr(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(...Mu(s[r],s[r+1],t*-1e3,100));return e}function Mu(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),T=1-I,w=Math.sin(T*W)/Math.sin(W),N=Math.sin(I*W)/Math.sin(W),b=g.Cartesian3.multiplyByScalar(d,w,new g.Cartesian3),B=g.Cartesian3.multiplyByScalar(h,N,new g.Cartesian3),R=g.Cartesian3.add(b,B,new g.Cartesian3),F=I*Math.PI,M=m*T+_*I+Math.sin(F)*p;R=g.Cartesian3.multiplyByScalar(R,M,R),i.push(R)}return i.push(t),i}function Bu(s,t,e=30){const r=s.length;if(r<=2||t===0||t===r-1)return!1;const i=gr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let o=gr(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 Po(s,t,e=2){const r=s.length;if(r<=1)return 0;if(Bu(s,t,15))return t<r-1?gr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude):gr(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?gr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude):gr(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=gr(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 Ou(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 Fu(s,t,e){if(!t||t.length<2)return!1;const r=Re(s),i=ue(t),n=Mr(r,i,{units:"meters"});return console.log(`isPointInCorridor: point=[${s[0]}, ${s[1]}], distance=${n}, threshold=${e}`),n<=e}function xu(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=Fu(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 ku(s,t=2e3){if(!s||s.length<2)return[];const e=s.map(i=>[i.Longitude,i.Latitude]),r=ue(e);try{const i=Au(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&&af(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&&af(n)<0&&(n=n.reverse()),n}return[]}catch{return[]}}function af(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 Vu{constructor(t,e,r){L(this,"viewer");L(this,"LineInfo");L(this,"Keym","");L(this,"dataSource2");L(this,"entityCollection2");L(this,"offsetTowers",[]);L(this,"autoCalculateRollX",!0);L(this,"towerWirePoints",new Map);L(this,"loadedWireSegments",new Set);L(this,"loadedTowerIndices",new Set);L(this,"isDynamicLoadingEnabled",!0);L(this,"isLineModelRemoved",!1);L(this,"cameraMoveHandler",null);L(this,"offsetWires11",[]);L(this,"offsetWires12",[]);L(this,"offsetWires13",[]);L(this,"offsetWires21",[]);L(this,"offsetWires22",[]);L(this,"offsetWires23",[]);L(this,"ToffsetArcWires1A",[]);L(this,"ToffsetArcWires2A",[]);L(this,"ToffsetWires1A1",[]);L(this,"ToffsetWires1A2",[]);L(this,"ToffsetArcWires1B",[]);L(this,"ToffsetArcWires2B",[]);L(this,"ToffsetWires1B1",[]);L(this,"ToffsetWires1B2",[]);L(this,"ToffsetArcWires1C",[]);L(this,"ToffsetArcWires2C",[]);L(this,"ToffsetWires1C1",[]);L(this,"ToffsetWires1C2",[]);L(this,"ToffsetArcWires1A2",[]);L(this,"ToffsetArcWires2A2",[]);L(this,"ToffsetWires2A1",[]);L(this,"ToffsetWires2A2",[]);L(this,"ToffsetArcWires1B2",[]);L(this,"ToffsetArcWires2B2",[]);L(this,"ToffsetWires2B1",[]);L(this,"ToffsetWires2B2",[]);L(this,"ToffsetArcWires1C2",[]);L(this,"ToffsetArcWires2C2",[]);L(this,"ToffsetWires2C1",[]);L(this,"ToffsetWires2C2",[]);L(this,"offsetArcWires1A",[]);L(this,"offsetArcWires1B",[]);L(this,"offsetArcWires1C",[]);L(this,"offsetArcWires2A",[]);L(this,"offsetArcWires2B",[]);L(this,"offsetArcWires2C",[]);L(this,"offsetGrouundWires1",[]);L(this,"offsetGrouundWires2",[]);L(this,"offsetGrouundWires11",[]);L(this,"offsetGrouundWires12",[]);L(this,"arcLine1A1",[]);L(this,"arcLine1B1",[]);L(this,"arcLine1C1",[]);L(this,"LinedataSource2");L(this,"LineentityCollection2");L(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(zn(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===Wi.耐张塔)if(e===0)r=(Po(this.LineInfo.towers,e,3)-90+360)%360;else if(e===t-1)r=(Po(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=gr(i.Longitude,i.Latitude,n.Longitude,n.Latitude),u=gr(n.Longitude,n.Latitude,o.Longitude,o.Latitude);r=(Ou(f,u)-90+360)%360}else r=(Po(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=D(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===Wi.耐张塔?n:i);let a,c;if(this.autoCalculateRollX?c=this.LineInfo.towers[t].RollX:c=u.RollX,this.LineInfo.towers[t].type===Wi.耐张塔)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: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(D(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=D(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===Wi.耐张塔?f:o);let p,d;if(this.autoCalculateRollX?d=this.LineInfo.towers[i].RollX:d=a.RollX,this.LineInfo.towers[i].type===Wi.耐张塔)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(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(D(r,new g.Cartesian3(m.X,m.Y,m.Z),o))}),a.linenum){case en.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Wi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires11.push(w),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(I),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires11.push(B),this.offsetWires11.push(R),this.offsetWires11.push(F),this.offsetWires11.push(M),this.ToffsetWires1A2.push(N),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires11.push(q),this.offsetWires11.push(Z),this.offsetWires11.push(O),this.offsetWires11.push(X),this.offsetWires11.push(K),this.offsetWires11.push(et),this.offsetWires11.push(nt),this.offsetWires11.push(ht),this.ToffsetWires1A2.push(q),this.ToffsetWires1A2.push(Z),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(K),this.ToffsetWires1A2.push(et),this.ToffsetWires1A2.push(nt),this.ToffsetWires1A2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.B相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires12.push(w),this.ToffsetWires1B2.push(C),this.ToffsetWires1B2.push(I),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires12.push(B),this.offsetWires12.push(R),this.offsetWires12.push(F),this.offsetWires12.push(M),this.ToffsetWires1B2.push(N),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires12.push(q),this.offsetWires12.push(Z),this.offsetWires12.push(O),this.offsetWires12.push(X),this.offsetWires12.push(K),this.offsetWires12.push(et),this.offsetWires12.push(nt),this.offsetWires12.push(ht),this.ToffsetWires1B2.push(q),this.ToffsetWires1B2.push(Z),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(K),this.ToffsetWires1B2.push(et),this.ToffsetWires1B2.push(nt),this.ToffsetWires1B2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.C相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires13.push(w),this.ToffsetWires1C2.push(C),this.ToffsetWires1C2.push(I),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires13.push(B),this.offsetWires13.push(R),this.offsetWires13.push(F),this.offsetWires13.push(M),this.ToffsetWires1C2.push(N),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires13.push(q),this.offsetWires13.push(Z),this.offsetWires13.push(O),this.offsetWires13.push(X),this.offsetWires13.push(K),this.offsetWires13.push(et),this.offsetWires13.push(nt),this.offsetWires13.push(ht),this.ToffsetWires1C2.push(q),this.ToffsetWires1C2.push(Z),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(K),this.ToffsetWires1C2.push(et),this.ToffsetWires1C2.push(nt),this.ToffsetWires1C2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.A相:h.forEach(m=>{this.offsetWires11.push(m)});break;case Te.B相:h.forEach(m=>{this.offsetWires12.push(m)});break;case Te.C相:h.forEach(m=>{this.offsetWires13.push(m)});break}else if(this.LineInfo.towers[i].type==Wi.耐张塔)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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 _=D(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 _=D(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 en.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Wi.耐张塔)switch(a.PhaseSequence){case Te.A相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires21.push(w),this.ToffsetWires2A2.push(C),this.ToffsetWires2A2.push(I),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires21.push(B),this.offsetWires21.push(R),this.offsetWires21.push(F),this.offsetWires21.push(M),this.ToffsetWires2A2.push(N),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires21.push(q),this.offsetWires21.push(Z),this.offsetWires21.push(O),this.offsetWires21.push(X),this.offsetWires21.push(K),this.offsetWires21.push(et),this.offsetWires21.push(nt),this.offsetWires21.push(ht),this.ToffsetWires2A2.push(q),this.ToffsetWires2A2.push(Z),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(K),this.ToffsetWires2A2.push(et),this.ToffsetWires2A2.push(nt),this.ToffsetWires2A2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.B相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires22.push(w),this.ToffsetWires2B2.push(C),this.ToffsetWires2B2.push(I),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires22.push(B),this.offsetWires22.push(R),this.offsetWires22.push(F),this.offsetWires22.push(M),this.ToffsetWires2B2.push(N),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires22.push(q),this.offsetWires22.push(Z),this.offsetWires22.push(O),this.offsetWires22.push(X),this.offsetWires22.push(K),this.offsetWires22.push(et),this.offsetWires22.push(nt),this.offsetWires22.push(ht),this.ToffsetWires2B2.push(q),this.ToffsetWires2B2.push(Z),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(K),this.ToffsetWires2B2.push(et),this.ToffsetWires2B2.push(nt),this.ToffsetWires2B2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.C相:if(a.type==Kt.耐张串)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=D(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 _=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=D(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=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),I=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),T=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=D(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(T),this.offsetWires23.push(w),this.ToffsetWires2C2.push(C),this.ToffsetWires2C2.push(I),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(w);break;case E.六分裂:const N=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),F=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=D(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(b),this.offsetWires23.push(B),this.offsetWires23.push(R),this.offsetWires23.push(F),this.offsetWires23.push(M),this.ToffsetWires2C2.push(N),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(M);break;case E.八分裂:const q=D(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=D(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=D(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=D(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=D(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=D(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),nt=D(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ht=D(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires23.push(q),this.offsetWires23.push(Z),this.offsetWires23.push(O),this.offsetWires23.push(X),this.offsetWires23.push(K),this.offsetWires23.push(et),this.offsetWires23.push(nt),this.offsetWires23.push(ht),this.ToffsetWires2C2.push(q),this.ToffsetWires2C2.push(Z),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(K),this.ToffsetWires2C2.push(et),this.ToffsetWires2C2.push(nt),this.ToffsetWires2C2.push(ht);break}else if(a.type==Kt.跳线串)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 Te.A相:h.forEach(m=>{this.offsetWires21.push(m)});break;case Te.B相:h.forEach(m=>{this.offsetWires22.push(m)});break;case Te.C相:h.forEach(m=>{this.offsetWires23.push(m)});break}else if(this.LineInfo.towers[i].type==Wi.耐张塔)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=D(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 _=D(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=D(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 en.地线: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&&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==Wi.耐张塔){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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1A2[e-6]),T.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(T,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)),T.push(this.ToffsetWires1A2[e-10]),T.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(T,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)),b.push(this.ToffsetWires1A2[e-7]),b.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(b,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)),T.push(this.ToffsetWires1A2[e-14]),T.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(T,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)),b.push(this.ToffsetWires1A2[e-11]),b.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(b,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)),R.push(this.ToffsetWires1A2[e-9]),R.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1B2[e-6]),T.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(T,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)),T.push(this.ToffsetWires1B2[e-10]),T.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(T,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)),b.push(this.ToffsetWires1B2[e-7]),b.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(b,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)),T.push(this.ToffsetWires1B2[e-14]),T.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(T,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)),b.push(this.ToffsetWires1B2[e-11]),b.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(b,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)),R.push(this.ToffsetWires1B2[e-9]),R.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires1C2[e-6]),T.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(T,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)),T.push(this.ToffsetWires1C2[e-10]),T.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(T,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)),b.push(this.ToffsetWires1C2[e-7]),b.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(b,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)),T.push(this.ToffsetWires1C2[e-14]),T.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(T,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)),b.push(this.ToffsetWires1C2[e-11]),b.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(b,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)),R.push(this.ToffsetWires1C2[e-9]),R.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2A2[e-6]),T.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(T,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)),T.push(this.ToffsetWires2A2[e-10]),T.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(T,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)),b.push(this.ToffsetWires2A2[e-7]),b.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(b,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)),T.push(this.ToffsetWires2A2[e-14]),T.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(T,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)),b.push(this.ToffsetWires2A2[e-11]),b.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(b,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)),R.push(this.ToffsetWires2A2[e-9]),R.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2B2[e-6]),T.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(T,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)),T.push(this.ToffsetWires2B2[e-10]),T.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(T,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)),b.push(this.ToffsetWires2B2[e-7]),b.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(b,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)),T.push(this.ToffsetWires2B2[e-14]),T.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(T,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)),b.push(this.ToffsetWires2B2[e-11]),b.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(b,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)),R.push(this.ToffsetWires2B2[e-9]),R.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(R,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=[],T=[],w=[],N=[],b=[],B=[],R=[];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)),T.push(this.ToffsetWires2C2[e-6]),T.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(T,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)),T.push(this.ToffsetWires2C2[e-10]),T.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(T,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)),b.push(this.ToffsetWires2C2[e-7]),b.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(b,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)),T.push(this.ToffsetWires2C2[e-14]),T.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(T,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)),b.push(this.ToffsetWires2C2[e-11]),b.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(b,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)),R.push(this.ToffsetWires2C2[e-9]),R.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(R,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 Yn=class Yn{constructor(t,e,r){L(this,"viewer");L(this,"LineInfo");L(this,"Keym","");L(this,"offsetTrees",[]);L(this,"dataSourcetree");L(this,"entityCollectiontree");L(this,"isDynamicLoadingEnabled",!0);L(this,"loadedTreeIndices",new Set);L(this,"isTreeModelRemoved",!1);L(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(zn("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){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 Yn.TREE_ENTITY_PREFIX}};L(Yn,"TREE_ENTITY_PREFIX","tree-");let So=Yn;class Gu{constructor(t){L(this,"viewer");L(this,"dataSourceplotting");L(this,"entityCollectionplotting");L(this,"terrainVerificationCache",new Map);L(this,"terrainVerificationResultCache",new Map);L(this,"maxVisibleResults",200);L(this,"terrainVerificationBatchIndex",0);L(this,"terrainVerificationTotalBatches",0);L(this,"terrainVerificationIsRunning",!1);L(this,"terrainVerificationBatchSize",100);L(this,"cameraMoveHandler",null);L(this,"isDynamicTerrainVerificationEnabled",!1);L(this,"wireClickHandler",null);L(this,"distanceRuleConfig",new wo);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,f=de.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const l=this.terrainVerificationCache.get(u);br(t,l,this.entityCollectionplotting,o,n,f);return}else{const l=kn(t,e,r,i);this.terrainVerificationCache.set(u,l),br(t,l,this.entityCollectionplotting,o||this.distanceRuleConfig,n,f)}}performTerrainVerification(t,e,r,i,n=null,o,f=rt.全部测量,u=de.树木){const l=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`,a=kn(t,e,r,i);this.terrainVerificationCache.set(l,a);const c=Gn(t,a,o??"unknown");return br(t,a,this.entityCollectionplotting,n||this.distanceRuleConfig,f,u),c}setMaxVisibleTerrainResults(t=200){this.maxVisibleResults=Math.max(10,t)}setDistanceRuleConfig(t){this.distanceRuleConfig=t}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}setDistanceRulesByType(t,e){this.distanceRuleConfig.typeRules.set(t,e)}getDistanceRulesByType(t){return this.distanceRuleConfig.typeRules.get(t)}getDistanceRulesByTypeOrDefault(t){return this.distanceRuleConfig.typeRules.get(t)||new sf}hasDistanceRulesForType(t){return this.distanceRuleConfig.typeRules.has(t)}getConfiguredDistanceRuleTypes(){return Array.from(this.distanceRuleConfig.typeRules.keys())}clearDistanceRuleConfig(){this.distanceRuleConfig.typeRules.clear()}getDistanceRuleConfigCount(){return this.distanceRuleConfig.typeRules.size}getHorizontalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.horizontalLevels}getVerticalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.verticalLevels}getStraightLineDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.straightLineLevels}getClearanceDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.clearanceLevels}createDefaultDistanceRuleConfig(){const t={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"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]};this.setDistanceRulesByType(de.树木,{...t}),this.setDistanceRulesByType(de.房屋,{...t}),this.setDistanceRulesByType(de.高速公路,{...t}),this.setDistanceRulesByType(de.电力线,{...t})}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),T=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(T),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=ue(t),n=e/1e3;try{const o=r?-n:n,f=Bf(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,rt.全部测量,f)}processTerrainVerificationBatch(t,e,r,i,n,o=rt.全部测量,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=rt.全部测量){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=kn(h,e,r,i),_=Gn(h,m,d.id);n&&_&&n(_),br(h,m,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),o,de.树木)}}}},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)||rt.全部测量,_=[rt.垂直距离,rt.净空距离,rt.安全距离].includes(m),W=_||m===rt.全部测量,C=!_||m===rt.全部测量,I=W?1:10,T=this.interpolateWire(h,I),w=[];if(W){const N=await this.calculateAndDrawWireToGroundDistanceByType(T,m).catch(b=>(console.error("Error in wire to ground distance calculation:",b),null));N&&w.push(N)}if(C){const N=(o==null?void 0:o.width)||10,b=(o==null?void 0:o.show)!==!1,B=t.filter(R=>{const F=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)];return this.isPointInWireCorridor(F,T,N)});b&&this.drawWireCorridor(T,N,`wire-corridor-${Date.now()}`),this.terrainVerificationCache.clear(),B.forEach(R=>{const F=[R.lon,R.lat,Number(R.alt||0)+Number(R.treeH||0)],M=this.calcResultSingleWire(F,T,m,this.getClickDistanceRuleConfig());M&&w.push(M)})}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 rt.垂直距离:return`对地距离${r}`;case rt.净空距离:return`净空距离${r}`;case rt.安全距离:return`安全距离${r}`;case rt.全部测量:return`净空距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(t,e,r,i,n=de.树木){var p,d,h,m,_,W,C,I;const o=[g.Cartesian3.fromDegrees(t[0],t[1],t[2]),g.Cartesian3.fromDegrees(e[0],e[1],e[2])];let f="#eff819",u=g.Color.RED;const l=this.distanceRuleConfig;let a,c=!1;if(i===rt.净空距离?a=(d=(p=l.typeRules.get(n))==null?void 0:p.clearanceLevels)==null?void 0:d.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.垂直距离?a=(m=(h=l.typeRules.get(n))==null?void 0:h.verticalLevels)==null?void 0:m.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.安全距离?a=(W=(_=l.typeRules.get(n))==null?void 0:_.clearanceLevels)==null?void 0:W.find(T=>r>=T.minDistance&&r<=T.maxDistance):i===rt.全部测量&&(a=(I=(C=l.typeRules.get(n))==null?void 0:C.clearanceLevels)==null?void 0:I.find(T=>r>=T.minDistance&&r<=T.maxDistance)),a?(f=a.color,u=g.Color.fromCssColorString(a.color)):(c=!0,f="#00ff00",u=g.Color.GREEN),a||c){this.entityCollectionplotting.add({polyline:{positions:o,width:2,material:u,clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const T=g.Cartesian3.midpoint(o[0],o[1],new g.Cartesian3);this.entityCollectionplotting.add({position:T,name:"净空距离",label:{text:this.getDistanceTypeLabel(i,r),fillColor:g.Color.fromCssColorString(f),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 T=t[f+1];c=g.Cartesian3.fromDegrees(T[0],T[1],T[2]),a=l}else if(f===t.length-1){const T=t[f-1];a=g.Cartesian3.fromDegrees(T[0],T[1],T[2]),c=l}else{const T=t[f-1],w=t[f+1];a=g.Cartesian3.fromDegrees(T[0],T[1],T[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,o=de.树木){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);br(t,u,this.entityCollectionplotting,n,rt.全部测量,o);return}else{const u=kn(t,e,r,i);this.terrainVerificationCache.set(f,u),br(t,u,this.entityCollectionplotting,n||this.distanceRuleConfig,rt.全部测量,o)}}calcResultSingleWire(t,e,r,i=this.distanceRuleConfig,n=de.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;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);return br(t,f,this.entityCollectionplotting,i,r,n),Gn(t,f,o)}else{const f=e;return this.terrainVerificationCache.set(o,f),br(t,f,this.entityCollectionplotting,i||this.distanceRuleConfig,r,n),Gn(t,f,o)}}LineChannelTerrainVerificationForFilteredTrees(t,e,r,i,n,o=100,f=rt.全部测量,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 Xu(s,t){let e=0;for(let r of s)r!=null&&(r=+r)>=r&&++e;return e}function Yu(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 zu=Math.sqrt(50),Uu=Math.sqrt(10),qu=Math.sqrt(2);function Xn(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>=zu?10:n>=Uu?5:n>=qu?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?Xn(s,t,e*2):[f,u,l]}function Hu(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?Xn(t,s,e):Xn(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 Zu(s,t,e){return t=+t,s=+s,e=+e,Xn(s,t,e)[2]}function Ku(s,t,e){let r;for(;;){const i=Zu(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 ju(s){return Math.max(1,Math.ceil(Math.log(Xu(s))/Math.LN2)+1)}var Ju=Array.prototype,Qu=Ju.slice;function $u(s,t){return s-t}function th(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 ff=s=>()=>s;function eh(s,t){for(var e=-1,r=t.length,i;++e<r;)if(i=ih(s,t[e]))return i;return 0}function ih(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(rh(u,c,t))return 0;a>r!=d>r&&e<(p-l)*(r-a)/(d-a)+l&&(i=-i)}return i}function rh(s,t,e){var r;return sh(s,t,e)&&nh(s[r=+(s[0]===t[0])],e[r],t[r])}function sh(s,t,e){return(t[0]-s[0])*(e[1]-s[1])===(e[0]-s[0])*(t[1]-s[1])}function nh(s,t,e){return s<=t&&t<=e||e<=t&&t<=s}function oh(){}var dr=[[],[[[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 ah(){var s=1,t=1,e=ju,r=u;function i(l){var a=e(l);if(Array.isArray(a))a=a.slice().sort($u);else{const c=Yu(l,fh);for(a=Hu(...Ku(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),th(h)>0?p.push([h]):d.push(h)}),d.forEach(function(h){for(var m=0,_=p.length,W;m<_;++m)if(eh((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=$r(l[0],a),dr[W<<1].forEach(T);++h<s-1;)_=W,W=$r(l[h+1],a),dr[_|W<<1].forEach(T);for(dr[W<<0].forEach(T);++m<t-1;){for(h=-1,W=$r(l[m*s+s],a),C=$r(l[m*s],a),dr[W<<1|C<<2].forEach(T);++h<s-1;)_=W,W=$r(l[m*s+s+h+1],a),I=C,C=$r(l[m*s+h+1],a),dr[_|W<<1|C<<2|I<<3].forEach(T);dr[W|C<<3].forEach(T)}for(h=-1,C=l[m*s]>=a,dr[C<<2].forEach(T);++h<s-1;)I=C,C=$r(l[m*s+h+1],a),dr[C<<2|I<<3].forEach(T);dr[C<<3].forEach(T);function T(w){var N=[w[0][0]+h,w[0][1]+m],b=[w[1][0]+h,w[1][1]+m],B=f(N),R=f(b),F,M;(F=d[B])?(M=p[R])?(delete d[F.end],delete p[M.start],F===M?(F.ring.push(b),c(F.ring)):p[F.start]=d[M.end]={start:F.start,end:M.end,ring:F.ring.concat(M.ring)}):(delete d[F.end],F.ring.push(b),d[F.end=R]=F):(F=p[R])?(M=d[B])?(delete p[F.start],delete d[M.end],F===M?(F.ring.push(b),c(F.ring)):p[M.start]=d[F.end]={start:M.start,end:F.end,ring:M.ring.concat(F.ring)}):(delete p[F.start],F.ring.unshift(N),p[F.start=B]=F):p[B]=d[R]={start:B,end:R,ring:[N,b]}}}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=No(a[_*s+m]);d>0&&d<s&&m===d&&(p[0]=uf(d,No(a[_*s+m-1]),W,c)),h>0&&h<t&&_===h&&(p[1]=uf(h,No(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)?ff(Qu.call(l)):ff(l),i):e},i.smooth=function(l){return arguments.length?(r=l?u:oh,i):r===u},i}function fh(s){return isFinite(s)?s:NaN}function $r(s,t){return s==null?!1:+s>=t}function No(s){return s==null||isNaN(s=+s)?-1/0:s}function uf(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 uh(s){return s.primitive!==void 0}class hh{constructor(t){L(this,"viewer");L(this,"lineInfo",null);L(this,"contourEntities",[]);L(this,"mountainEntities",[]);L(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});L(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 T=(c/a*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${c}/${a} (${T}%)`)}}}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=ah().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{uh(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*_,T=n.Longitude+d.dx*W,w=n.Latitude+d.dy*_,N=[],b=Math.ceil(i.width/i.interval)+1;for(let F=0;F<b;F++){const M=F/(b-1),q=C+(T-C)*M,Z=I+(w-I)*M,O=(M-.5)*i.width,X=await this.getHeightFromTerrain(q,Z);N.push({distance:O,height:X,lon:q,lat:Z,isCenter:Math.abs(O)<i.interval/2,isMountain:!1})}const B=this.applyInterpolation(N,i.interpolationMethod),R=this.detectMountains(B,i.mountainThreshold,i.mountainProminence);return R.forEach(F=>{B.forEach(M=>{M.distance>=F.startDistance&&M.distance<=F.endDistance&&(M.isMountain=!0)})}),{points:B,mountains:R}}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
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 M=c-o;M<=c+o;M++){if(t[M].height>p.height){d=!1;break}t[M].height<h&&(h=t[M].height)}if(!d)continue;const m=p.height-h;if(m<e.minPeakDiff)continue;let _=c,W=c;for(let M=c-1;M>=0&&p.height-t[M].height>=e.minPeakDiff/2;M--)_=M;for(let M=c+1;M<f&&p.height-t[M].height>=e.minPeakDiff/2;M++)W=M;const C=p.height-t[_].height,I=p.height-t[W].height,T=p.distance-t[_].distance,w=t[W].distance-p.distance,N=u(C,T),b=u(I,w),B=e.peakMode==="slope_only"||m>=e.minPeakDiff,R=e.peakMode==="height_diff"||N>=e.minPeakSlope&&b>=e.minPeakSlope,F=e.peakMode==="both"?m>=e.minPeakDiff&&N>=e.minPeakSlope&&b>=e.minPeakSlope:!0;if(e.peakMode==="both"){if(!F)continue}else if(e.peakMode==="height_diff"){if(!B)continue}else if(!R)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 M=c-o;M<=c+o;M++){if(t[M].height<p.height){d=!1;break}t[M].height>h&&(h=t[M].height)}if(!d)continue;const m=h-p.height;if(m<e.minValleyDiff)continue;let _=c,W=c;for(let M=c-1;M>=0&&t[M].height-p.height>=e.minValleyDiff/2;M--)_=M;for(let M=c+1;M<f&&t[M].height-p.height>=e.minValleyDiff/2;M++)W=M;const C=t[_].height-p.height,I=t[W].height-p.height,T=p.distance-t[_].distance,w=t[W].distance-p.distance,N=u(C,T),b=u(I,w),B=e.valleyMode==="slope_only"||m>=e.minValleyDiff,R=e.valleyMode==="height_diff"||N>=e.minValleySlope&&b>=e.minValleySlope,F=e.valleyMode==="both"?m>=e.minValleyDiff&&N>=e.minValleySlope&&b>=e.minValleySlope:!0;if(e.valleyMode==="both"){if(!F)continue}else if(e.valleyMode==="height_diff"){if(!B)continue}else if(!R)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 lh{constructor(t,e,r){L(this,"viewer");L(this,"LineInfo");L(this,"lineConstruction");L(this,"terrainConstruction");L(this,"channelCalculation");L(this,"contourConstruction");L(this,"selectedWireEntity",null);L(this,"originalWireColor",null);L(this,"wireCorridorWidth",10);L(this,"showWireCorridor",!0);L(this,"wireMeasurementType",rt.全部测量);L(this,"isDynamicLoadingEnabled",!0);L(this,"pathEntities",[]);this.viewer=t,this.LineInfo=e,this.lineConstruction=new Vu(t,e,r),this.terrainConstruction=new So(t,e,r),this.channelCalculation=new Gu(t),this.contourConstruction=new hh(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)}setDynamicLoadingEnabled_line(t){this.lineConstruction.setDynamicLoadingEnabled(t)}setDynamicLoadingEnabled_tree(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=rt.全部测量){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
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,rt.净空距离),console.log(`${u.key}相 塔段${f} 净空距离计算完成`)}catch(a){console.error(`${u.key}相 塔段${f} 净空距离计算失败:`,a)}}}console.log(`
|
|
7
7
|
========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(t,e,r,i=100,n=2e3,o=!1,f=!0,u=rt.全部测量,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=[],T=[];(l===0||l===2)&&(C=h.wireSegments2A1,I=h.wireSegments2B1,T=h.wireSegments2C1);const w=[],N=[],b=[],B=[],R=[],F=[];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相存在=${!!T[z]}`),(l===0||l===1)&&(m[z]&&w.push(m[z]),_[z]&&N.push(_[z]),W[z]&&b.push(W[z])),(l===0||l===2)&&(C[z]&&B.push(C[z]),I[z]&&R.push(I[z]),T[z]&&F.push(T[z]));console.log(`塔段范围 ${p}-${d}: 回路1-A相${w.length}段, B相${N.length}段, C相${b.length}段; 回路2-A相${B.length}段, B相${R.length}段, C相${F.length}段`);const M=[],q=[],Z=[],O=[],X=[],K=[];for(let z=0;z<w.length;z++)M.push(...w[z]);for(let z=0;z<N.length;z++)q.push(...N[z]);for(let z=0;z<b.length;z++)Z.push(...b[z]);for(let z=0;z<B.length;z++)O.push(...B[z]);for(let z=0;z<R.length;z++)X.push(...R[z]);for(let z=0;z<F.length;z++)K.push(...F[z]);a==="A"?(q.splice(0),Z.splice(0),X.splice(0),K.splice(0)):a==="B"?(M.splice(0),Z.splice(0),O.splice(0),K.splice(0)):a==="C"?(M.splice(0),q.splice(0),O.splice(0),X.splice(0)):a==="AB"?(Z.splice(0),K.splice(0)):a==="AC"?(q.splice(0),X.splice(0)):a==="BC"&&(M.splice(0),O.splice(0)),console.log(`导线数据状态(回路${l},相序${a}): 回路1-A相=${M.length}, B相=${q.length}, C相=${Z.length}; 回路2-A相=${O.length}, B相=${X.length}, C相=${K.length}`);const et=this.terrainConstruction.getLineInfo().corridor_features,nt=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${et.length}`);const ht=c.slice(p,d+1),ei=xu(et,ht,n);console.log(`通道内树木数量: ${ei.length}`);const Xe=[],Ft=new Map;if(et.forEach((z,ts)=>{Ft.set(z,ts)}),ei.forEach(z=>{const ts=Ft.get(z);ts!==void 0&&Xe.push(nt[ts])}),o){const z=ku(ht,n);if(z.length>0){this.channelCalculation.drawCorridorPolygon(z,`corridor-${t}-${e}`);const ts=ht.map(Le=>[Le.Longitude,Le.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(ts,n,`corridor-${t}-${e}`,f)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();if(ei.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const ii=M.length>0||q.length>0||Z.length>0,tr=O.length>0||X.length>0||K.length>0;if(!ii&&!tr){console.error("过滤后的导线数据为空,无法进行测量"),r&&r([]);return}console.log(`开始对${ei.length}棵树进行测量...`);let Oi=[...M],xt=[...q],me=[...Z];(l===0||l===2)&&tr&&(Oi.push(...O),xt.push(...X),me.push(...K)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(ei,Xe,Oi,xt,me,i,u,z=>{if(u===rt.全部测量||u===rt.净空距离||u===rt.垂直距离||u===rt.安全距离){if(l===0||l===1)for(let Le=0;Le<w.length;Le++){const es=p+Le,rn=es+1,bo=w[Le]||[],Ro=N[Le]||[],Mo=b[Le]||[];let Fi=[...bo],xi=[...Ro],ki=[...Mo];a==="A"?(xi=[],ki=[]):a==="B"?(Fi=[],ki=[]):a==="C"?(Fi=[],xi=[]):a==="AB"?ki=[]:a==="AC"?xi=[]:a==="BC"&&(Fi=[]),console.log(`计算塔段 ${es}-${rn} (回路1) 的净空距离: A相=${Fi.length}, B相=${xi.length}, C相=${ki.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(Fi,xi,ki,u).catch(Bo=>{console.error(`Error calculating wire to ground distance for segment ${es}-${rn} (circuit 1):`,Bo)})}if((l===0||l===2)&&tr)for(let Le=0;Le<B.length;Le++){const es=p+Le,rn=es+1,bo=B[Le]||[],Ro=R[Le]||[],Mo=F[Le]||[];let Fi=[...bo],xi=[...Ro],ki=[...Mo];a==="A"?(xi=[],ki=[]):a==="B"?(Fi=[],ki=[]):a==="C"?(Fi=[],xi=[]):a==="AB"?ki=[]:a==="AC"?xi=[]:a==="BC"&&(Fi=[]),console.log(`计算塔段 ${es}-${rn} (回路2) 的净空距离: A相=${Fi.length}, B相=${xi.length}, C相=${ki.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(Fi,xi,ki,u).catch(Bo=>{console.error(`Error calculating wire to ground distance for segment ${es}-${rn} (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 ch{constructor(){L(this,"id","");L(this,"name","");L(this,"towerFZinfo","");L(this,"towerDisFile","");L(this,"stressFileContent","");L(this,"streesistrue",0);L(this,"TowerMemberColor","#FFFFFF");L(this,"TowerMembersWidth",2);L(this,"Longitude",0);L(this,"Latitude",0);L(this,"Altitude",0);L(this,"RollX",0);L(this,"RollY",90);L(this,"RollZ",0)}}function ph(s){debugger;const t=s.split(`
|