earthsdk3-cesium 3.5.0-beta.2 → 3.5.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +111 -111
- package/dist/earthsdk3-cesium.js +657 -657
- package/dist/earthsdk3-cesium.umd.cjs +20 -20
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(I,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],Ce):(I=typeof globalThis<"u"?globalThis:I||self,Ce(I.EarthSDK3_Cesium={},I.Cesium,I.EarthSDK3,I.html2canvas,I.Mapbox,I.Delaunator,I.earcut))})(this,function(I,Ce,a,Wh,N_,B_,V_){"use strict";var Hz=Object.defineProperty;var qz=(I,Ce,a)=>Ce in I?Hz(I,Ce,{enumerable:!0,configurable:!0,writable:!0,value:a}):I[Ce]=a;var v=(I,Ce,a)=>qz(I,typeof Ce!="symbol"?Ce+"":Ce,a);var Go=typeof document<"u"?document.currentScript:null;function lm(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=lm(Ce),U_=lm(N_);window.Cesium=h;function W_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const Kr=class Kr extends a.Destroyable{};v(Kr,"defaults",{enabled:!0}),v(Kr,"createDefaultProps",()=>({...Kr.defaults}));let Nt=Kr;a.extendClassProps(Nt.prototype,Nt.createDefaultProps);class Zt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s)=>this.flyTo(o,s))),this.d(i.flyInEvent.don((o,s)=>this.flyIn(o,s))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l){const{sceneObject:c,czmViewer:u}=this,d=u.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e);d&&d.then(p=>{})}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyToParam&&(n.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),n.flyInParam){const{position:s,rotation:r,flyDuration:l}=n.flyInParam,c=i??l;return this.flyToWithPromise(e,s,void 0,r,c),!0}return!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyInParam){const{position:s,rotation:r,flyDuration:l}=n.flyInParam,c=i??l;return this.flyToWithPromise(e,s,void 0,r,c),!0}return!1}get czmViewer(){return this.viewer}}function Be(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const G_=new h.Cartographic;function le(t,i){const e=h.Cartographic.fromCartesian(t,void 0,G_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function be(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function cm(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function si(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function or(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function Gh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function hm(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ri(t,i){if(t.length===4)return Gh(t,i);if(t.length===3)return si(t,i);if(t.length===2)return be(t,i);throw new Error("toCartesian error: should not be here!")}function H_(t,i){if(t instanceof h.Cartesian2)return cm(t,i);if(t instanceof h.Cartesian3)return or(t,i);if(t instanceof h.Cartesian4)return hm(t,i);throw new Error("fromCartesian error: should not be here!")}function q_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Ho(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function $_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function ln(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function X_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function um(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function Y_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function sr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function Z_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function Q_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function k_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const K_=new h.HeadingPitchRoll,J_=new h.Cartesian3;function j_(t,i,e){const n=um(i,K_),o=Be(t,J_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function We(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function e1(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const t1=new h.Cartesian3;function _e(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,t1),i)}function i1(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function fi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),rectangle:t.rectangle&&We(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new Iy({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Dy({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function rr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(si(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function Ql(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(si(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function kl(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Be(s))})),enabled:e,inverse:n})}function Kl(t,i){return Hh(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function dm(t,i){return Hh(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function Hh(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function cn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function pm(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Re(t,i){if(!((!t.localScale||cn(t.localScale,3))&&(!t.localRotation||cn(t.localRotation,3))&&(!t.localPosition||cn(t.localPosition,3))&&(!t.localModelMatrix||cn(t.localModelMatrix,16))&&(!t.scale||cn(t.scale,3))&&(!t.rotation||cn(t.rotation,3))&&(!t.position||cn(t.position,3))&&(!t.modelMatrix||cn(t.modelMatrix,16)))||t.localScale&&!pm(t.localScale)||t.scale&&!pm(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=Kl(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=Kl(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const n1=new h.Cartesian3,ar=new h.HeadingPitchRoll,o1=new h.Matrix4,s1=new h.Cartesian3,r1=new h.Cartographic;function a1(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,n1),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){ar.heading=c[0],ar.pitch=c[1],ar.roll=c[2],ar.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,ar,void 0,void 0,o1),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,s1);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,r1);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function fm(t,i,e,n){return a1(t,i,e,n)}const hn=h.Math.toDegrees;function Bt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=hn(e),i[1]=hn(n),i[2]=o,i):[hn(e),hn(n),o]}function qo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=hn(e),i[1]=hn(n),i[2]=hn(o),i):[e,n,o].map(hn)}class Jl extends a.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class l1 extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class c1 extends a.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new l1(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Zn extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_visibleAlpha",this.disposeVar(a.react(1)));v(this,"_viewDistance",this.disposeVar(a.react(0)));v(this,"_debug",this.disposeVar(a.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new c1(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,m]=a.getReactFuncs(r),[g,y,_]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const M=c(),D=p(),L=g?g():0,V=l.getCurrentCameraInfo();if(!M||!D||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,D)-(L??0);const[O,z,U,C]=M;O>z||z>U||U>C?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=U?x=1:A<=O||A>=C?x=0:A>O&&A<z?z-O<=0?x=0:x=(A-O)/(z-O):A>U&&A<C?(C<=U&&(x=0),x=(C-A)/(C-U)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const w=[l.cameraChanged,d,m];_&&w.push(_);const b=this.disposeVar(a.createNextAnimateFrameEvent(...w));this.dispose(b.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const h1=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Bi(t,i,e){var n=h1;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function ht(t){const i=t.length;let e;const n=[];for(let o=0;o<i;++o){const[s,r,l]=t[o],c=h.Cartesian3.fromDegrees(s,r,l);if(!c)continue;const{x:u,y:d,z:p}=c;[u,d,p].every(Number.isFinite)&&(!e||!h.Cartesian3.equals(e,c))&&(e=c,n.push(e))}return n}function Qn(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function u1(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function d1(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const gm=new h.Cartesian3,p1=new h.Ray,f1=new h.Plane(h.Cartesian3.UNIT_X,0);function jl(t,i,e,n){const o=h.Cartesian3.normalize(i,gm),s=h.Cartesian3.cross(t.camera.right,o,gm);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,f1),l=t.camera.getPickRay(e,p1);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const qh=new h.Cartesian3,g1=new h.Ray,m1=new h.Cartographic,v1=new h.Ellipsoid;function $o(t,i,e,n){const o=t.camera.getPickRay(i,g1);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,qh),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,qh),l=h.Ellipsoid.fromCartesian3(r,v1),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,qh),p=h.Cartographic.fromCartesian(d,void 0,m1);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function Xo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function mm(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const vm=new h.Cartographic,ym=new h.Cartesian3,xt=[0,0,0],un=[0,0,0],$h=new h.Cartesian2,Xh=new h.Cartesian3;function Yh(t,i,e,n,o,s){o.constraintMode="none",Xo([0,0,0],o.startDragPos),s=s||{},ri(a.getDomEventCurrentTargetPos(t),$h);const r=e.position;if(!Be(r,Xh))return;const l=Bi(i,Xh,n);if(l===void 0||!jl(i,Xh,$h,ym)||!le(ym,xt))return;const c=mm(xt[2])*a.geoDistance(r,xt);if(!s.z&&c<l&&Math.abs(r[2]-xt[2])<e.dimensions[0]&&xt[2]>r[2])return o.constraintMode="z",Xo(xt,o.startDragPos),!0;if(!$o(i,$h,r[2],vm)||!Ho(vm,xt))return;const u=mm(r[2])*a.geoDistance(r,xt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",Xo(xt,o.startDragPos);return}{const[p,f]=Qn(r,e.heading+90,xt,un);if(!s.x&&p>0&&f&&(un[2]=r[2],a.geoDistance(un,xt)<l)){o.constraintMode="x",Xo(un,o.startDragPos);return}}{const[p,f]=Qn(r,e.heading,xt,un);if(!s.y&&p>0&&f&&(un[2]=r[2],a.geoDistance(un,xt)<l)){o.constraintMode="y",Xo(un,o.startDragPos);return}}s.xy||(o.constraintMode="xy",Xo(xt,o.startDragPos))}}async function wm(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ri(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=$o(o,r,e);return c?Ho(c):void 0}}let Zh,Qh;function Cm(t,i,e,n,o){o=o||new h.Cartesian3,Zh=Zh||new h.Ray,Qh=Qh||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,Zh),r=h.Plane.fromPointNormal(i,e,Qh);return o=h.IntersectionTests.rayPlane(s,r,o),o}function _m(t){const i=h.Material.fromType(t.type);return kh(i,t),i}function Vt(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function y1(t){return{x:t[0],y:t[1]}}function kh(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=be(i.lineCount??[8,8]),t.uniforms.lineThickness=be(i.lineThickness??[1,1]),t.uniforms.lineOffset=be(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=be(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=be(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Vt(i.specularMap),t.uniforms.normalMap=Vt(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=y1(i.fadeDirection??[!0,!0]),t.uniforms.time=be(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Vt(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Vt(i.image):i.type==="ElevationBand"?(t.uniforms.color=Vt(i.colors),t.uniforms.heights=Vt(i.heights)):console.warn(`未知材质类型,无法更新 ${i.type}`)}function ai(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=_m(c)):e.value&&kh(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Vi(t){const i=ht(t.positions),e=t.holes&&t.holes.map(n=>Vi(n));return{positions:i,holes:e}}function Kh(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Pm=new h.Cartesian4,w1=new h.Matrix4;function C1(){return{left:0,top:0,right:0,bottom:0,depth:0}}function bm(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Sm(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,w1),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Pm),Pm);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,m=c.z;if(!(u<0||d<0||p<0||f<0||m<0||m>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=m):e={left:u,top:f,right:p,bottom:d,depth:m},e}const kn={left:0,top:0,right:0,bottom:0,depth:0};class ec extends a.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new a.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Jl(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Sm(this._viewer,this._cartesian,kn);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?bm(this._winPos,kn)||(e=!0,this._winPos.left=kn.left,this._winPos.top=kn.top,this._winPos.right=kn.right,this._winPos.bottom=kn.bottom,this._winPos.depth=kn.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function xm(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const _1=h.Check,P1=h.defaultValue,Kn=h.defined,Em=h.Math.EPSILON10;function b1(t,i,e,n){if(_1.defined("equalsEpsilon",i),!Kn(t))return;e=P1(e,!1);const o=Kn(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,Em)?(Kn(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(Kn(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],Em)&&(o&&(Kn(u)?n.splice(p,0,d):n.push(s-1)),Kn(u)?u.length-=1:u=t.slice(0,-1)),Kn(u)?u:t}const ye=h.Cartesian3,Yo=h.Cartographic,Jn=h.defaultValue,jn=h.defined,Am=h.DeveloperError,Tm=h.Ellipsoid,S1=h.EllipsoidGeodesic,Mm=h.EllipsoidRhumbLine,x1=h.IntersectionTests,Jh=h.Math,Zo=h.Matrix4,eo=h.Plane,Je={};Je.numberOfPoints=function(t,i,e){const n=ye.distance(t,i);return Math.ceil(n/e)},Je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const E1=new Yo;Je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,E1).height}return n};const A1=new Zo,T1=new ye,Im=new ye,M1=new eo(ye.UNIT_X,0),Dm=new ye,I1=new eo(ye.UNIT_X,0),D1=new ye,R1=new ye,jh=[];function Rm(t,i,e){const n=jh;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const tc=new Yo,ic=new Yo,dn=new ye,eu=new ye,F1=new ye,tu=new S1;let lr=new Mm;function z1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,eu),u=n.scaleToGeodeticSurface(i,F1),d=Je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,tc),f=n.cartesianToCartographic(u,ic),m=Rm(d,o,s);tu.setEndPoints(p,f);const g=tu.surfaceDistance/d;let y=l;p.height=o;let _=n.cartographicToCartesian(p,dn);ye.pack(_,r,y),y+=3;for(let P=1;P<d;P++){const w=tu.interpolateUsingSurfaceDistance(P*g,ic);w.height=m[P],_=n.cartographicToCartesian(w,dn),ye.pack(_,r,y),y+=3}return y}function L1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,tc),u=n.cartesianToCartographic(i,ic),d=Je.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=Rm(d,o,s);lr.ellipsoid.equals(n)||(lr=new Mm(void 0,void 0,n)),lr.setEndPoints(c,u);const f=lr.surfaceDistance/d;let m=l;c.height=o;let g=n.cartographicToCartesian(c,dn);ye.pack(g,r,m),m+=3;for(let y=1;y<d;y++){const _=lr.interpolateUsingSurfaceDistance(y*f,ic);_.height=p[y],g=n.cartographicToCartesian(_,dn),ye.pack(g,r,m),m+=3}return m}Je.wrapLongitude=function(t,i){const e=[],n=[];if(jn(t)&&t.length>0){i=Jn(i,Zo.IDENTITY);const o=Zo.inverseTransformation(i,A1),s=Zo.multiplyByPoint(o,ye.ZERO,T1),r=ye.normalize(Zo.multiplyByPointAsVector(o,ye.UNIT_Y,Im),Im),l=eo.fromPointNormal(s,r,M1),c=ye.normalize(Zo.multiplyByPointAsVector(o,ye.UNIT_X,Dm),Dm),u=eo.fromPointNormal(s,c,I1);let d=1;e.push(ye.clone(t[0]));let p=e[0];const f=t.length;for(let m=1;m<f;++m){const g=t[m];if(eo.getPointDistance(u,p)<0||eo.getPointDistance(u,g)<0){const y=x1.lineSegmentPlane(p,g,l,D1);if(jn(y)){const _=ye.multiplyByScalar(r,5e-9,R1);eo.getPointDistance(l,p)<0&&ye.negate(_,_),e.push(ye.add(y,_,new ye)),n.push(d+1),ye.negate(_,_),e.push(ye.add(y,_,new ye)),d=1}}e.push(ye.clone(t[m])),d++,p=g}n.push(d)}return{positions:e,lengths:n}},Je.generateArc=function(t){jn(t)||(t={});const i=t.positions;if(!jn(i))throw new Am("options.positions is required.");const e=i.length,n=Jn(t.ellipsoid,Tm.WGS84);let o=Jn(t.height,0);const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],eu);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(y,dn);ye.multiplyByScalar(_,o,_),ye.add(y,_,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!jn(r)){const y=Jn(t.granularity,Jh.RADIANS_PER_DEGREE);r=Jh.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Je.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],_=i[c+1],P=s?o[c]:o,w=s?o[c+1]:o;p=z1(y,_,r,n,P,w,d,p)}jh.length=0;const f=i[e-1],m=n.cartesianToCartographic(f,tc);m.height=s?o[e-1]:o;const g=n.cartographicToCartesian(m,dn);return ye.pack(g,d,u-3),d};const Fm=new Yo,O1=new Yo;Je.generateRhumbArc=function(t){jn(t)||(t={});const i=t.positions;if(!jn(i))throw new Am("options.positions is required.");const e=i.length,n=Jn(t.ellipsoid,Tm.WGS84);let o=Jn(t.height,0);const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],eu);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(P,dn);ye.multiplyByScalar(w,o,w),ye.add(P,w,P)}return[P.x,P.y,P.z]}const r=Jn(t.granularity,Jh.RADIANS_PER_DEGREE);let l=0,c,u=n.cartesianToCartographic(i[0],Fm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],O1),l+=Je.numberOfPointsRhumbLine(u,d,r),u=Yo.clone(d,Fm);const p=(l+1)*3,f=new Array(p);let m=0;for(c=0;c<e-1;c++){const P=i[c],w=i[c+1],b=s?o[c]:o,x=s?o[c+1]:o;m=L1(P,w,r,n,b,x,f,m)}jh.length=0;const g=i[e-1],y=n.cartesianToCartographic(g,tc);y.height=s?o[e-1]:o;const _=n.cartographicToCartesian(y,dn);return ye.pack(_,f,p-3),f},Je.generateCartesianArc=function(t){const i=Je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ye.unpack(i,o*3);return n},Je.generateCartesianRhumbArc=function(t){const i=Je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ye.unpack(i,o*3);return n};const nc=h.ArcType,N1=h.Cartesian3,B1=h.Math;function zm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=b1(t.positions,N1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===nc.GEODESIC||i===nc.RHUMB){let l;i===nc.GEODESIC?(l=B1.chordLength(e,n.maximumRadius),Je.numberOfPoints):(l=e,Je.numberOfPointsRhumbLine);const c=Je.extractHeights(s,n);i===nc.GEODESIC?s=Je.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Je.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function iu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=zm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function Lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function nu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?Kl(o,l):r==="XForwardZUp"&&dm(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ri(s),e),Lm(e,i)}const V1=new h.Matrix4;function Om(t,i){const e=h.Matrix4.fromArray(t,0,V1);return h.Matrix4.inverse(e,e),Lm(e,i)}const U1=new h.Matrix4,W1=new h.Cartesian3;function Nm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,W1),l=h.Matrix4.fromArray(t,0,U1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const G1=new h.Matrix4,H1=new h.Cartesian3,q1=new h.Cartographic;function pn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,H1),l=h.Matrix4.fromArray(t,0,G1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,q1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Et(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=nu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=Om(r);return[i.map(u=>Nm(l,u)),r,l]}function fn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=nu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>pn(r,c)),r]}function Bm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=Ce.Cartesian3.fromDegrees(...t[e]),o=Ce.Cartesian3.fromDegrees(...t[e+1]),s=Ce.Cartesian3.fromDegrees(...t[e+2]),r=Ce.Cartesian3.angleBetween(Ce.Cartesian3.subtract(n,o,new Ce.Cartesian3),Ce.Cartesian3.subtract(s,o,new Ce.Cartesian3));i.push(isNaN(r)?0:Ce.Math.toDegrees(r))}return i}function ou(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>le(n)))),t.holes&&t.holes.forEach(n=>{e=ou(n,e)}),e}function Ut(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class su extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,m=()=>{let g=r();g&&(g=[...g],i.editingHeightOffset&&(g[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...g,void 0,f))};m(),this.dispose(c.disposableOn(m)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const g=Bi(s,f,o);g!==void 0?d([g,g,g]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${g??"undefined"}`)}))}}function $1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=le(e),u=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=le(n),d=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=le(o),p=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=pn(i,[e.x,e.y,e.z]),u=pn(i,[-e.x,-e.y,-e.z]),l=pn(i,[n.x,n.y,n.z]),d=pn(i,[-n.x,-n.y,-n.z]),c=pn(i,[o.x,o.y,o.z]),p=pn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const Vm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(m=>m.json()).then(m=>{m&&!Reflect.has(m,"success")?n[f]=m:o.push({index:p,url:f,message:m.message}),p==i.length-1&&u()}).catch(m=>{o.push({index:p,url:f,message:m}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=$1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function X1(t){return new Promise((i,e)=>{Vm.restart(void 0,t),Vm.completeEvent.don(n=>{i(n)})})}class ru extends a.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function Um(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
(function(I,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],Ce):(I=typeof globalThis<"u"?globalThis:I||self,Ce(I.EarthSDK3_Cesium={},I.Cesium,I.EarthSDK3,I.html2canvas,I.Mapbox,I.Delaunator,I.earcut))})(this,(function(I,Ce,a,Wh,N_,B_,V_){"use strict";var Hz=Object.defineProperty;var qz=(I,Ce,a)=>Ce in I?Hz(I,Ce,{enumerable:!0,configurable:!0,writable:!0,value:a}):I[Ce]=a;var v=(I,Ce,a)=>qz(I,typeof Ce!="symbol"?Ce+"":Ce,a);var Go=typeof document<"u"?document.currentScript:null;function lm(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=lm(Ce),U_=lm(N_);window.Cesium=h;function W_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const Kr=class Kr extends a.Destroyable{};v(Kr,"defaults",{enabled:!0}),v(Kr,"createDefaultProps",()=>({...Kr.defaults}));let Nt=Kr;a.extendClassProps(Nt.prototype,Nt.createDefaultProps);class Zt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s)=>this.flyTo(o,s))),this.d(i.flyInEvent.don((o,s)=>this.flyIn(o,s))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l){const{sceneObject:c,czmViewer:u}=this,d=u.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e);d&&d.then(p=>{})}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyToParam&&(n.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),n.flyInParam){const{position:s,rotation:r,flyDuration:l}=n.flyInParam,c=i??l;return this.flyToWithPromise(e,s,void 0,r,c),!0}return!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyInParam){const{position:s,rotation:r,flyDuration:l}=n.flyInParam,c=i??l;return this.flyToWithPromise(e,s,void 0,r,c),!0}return!1}get czmViewer(){return this.viewer}}function Be(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const G_=new h.Cartographic;function le(t,i){const e=h.Cartographic.fromCartesian(t,void 0,G_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function be(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function cm(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function si(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function or(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function Gh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function hm(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ri(t,i){if(t.length===4)return Gh(t,i);if(t.length===3)return si(t,i);if(t.length===2)return be(t,i);throw new Error("toCartesian error: should not be here!")}function H_(t,i){if(t instanceof h.Cartesian2)return cm(t,i);if(t instanceof h.Cartesian3)return or(t,i);if(t instanceof h.Cartesian4)return hm(t,i);throw new Error("fromCartesian error: should not be here!")}function q_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Ho(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function $_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function ln(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function X_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function um(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function Y_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function sr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function Z_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function Q_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function k_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const K_=new h.HeadingPitchRoll,J_=new h.Cartesian3;function j_(t,i,e){const n=um(i,K_),o=Be(t,J_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function We(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function e1(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const t1=new h.Cartesian3;function _e(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,t1),i)}function i1(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function fi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),rectangle:t.rectangle&&We(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new Iy({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Dy({ellipsoid:t.ellipsoid&&_e(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&be(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&be(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function rr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(si(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function Ql(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(si(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function kl(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Be(s))})),enabled:e,inverse:n})}function Kl(t,i){return Hh(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function dm(t,i){return Hh(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function Hh(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function cn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function pm(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Re(t,i){if(!((!t.localScale||cn(t.localScale,3))&&(!t.localRotation||cn(t.localRotation,3))&&(!t.localPosition||cn(t.localPosition,3))&&(!t.localModelMatrix||cn(t.localModelMatrix,16))&&(!t.scale||cn(t.scale,3))&&(!t.rotation||cn(t.rotation,3))&&(!t.position||cn(t.position,3))&&(!t.modelMatrix||cn(t.modelMatrix,16)))||t.localScale&&!pm(t.localScale)||t.scale&&!pm(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=Kl(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=Kl(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const n1=new h.Cartesian3,ar=new h.HeadingPitchRoll,o1=new h.Matrix4,s1=new h.Cartesian3,r1=new h.Cartographic;function a1(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,n1),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){ar.heading=c[0],ar.pitch=c[1],ar.roll=c[2],ar.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,ar,void 0,void 0,o1),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,s1);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,r1);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function fm(t,i,e,n){return a1(t,i,e,n)}const hn=h.Math.toDegrees;function Bt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=hn(e),i[1]=hn(n),i[2]=o,i):[hn(e),hn(n),o]}function qo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=hn(e),i[1]=hn(n),i[2]=hn(o),i):[e,n,o].map(hn)}class Jl extends a.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class l1 extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class c1 extends a.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new l1(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Zn extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_visibleAlpha",this.disposeVar(a.react(1)));v(this,"_viewDistance",this.disposeVar(a.react(0)));v(this,"_debug",this.disposeVar(a.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new c1(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,m]=a.getReactFuncs(r),[g,y,_]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const M=c(),D=p(),L=g?g():0,V=l.getCurrentCameraInfo();if(!M||!D||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,D)-(L??0);const[O,z,U,C]=M;O>z||z>U||U>C?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=U?x=1:A<=O||A>=C?x=0:A>O&&A<z?z-O<=0?x=0:x=(A-O)/(z-O):A>U&&A<C?(C<=U&&(x=0),x=(C-A)/(C-U)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const w=[l.cameraChanged,d,m];_&&w.push(_);const b=this.disposeVar(a.createNextAnimateFrameEvent(...w));this.dispose(b.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const h1=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Bi(t,i,e){var n=h1;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function ht(t){const i=t.length;let e;const n=[];for(let o=0;o<i;++o){const[s,r,l]=t[o],c=h.Cartesian3.fromDegrees(s,r,l);if(!c)continue;const{x:u,y:d,z:p}=c;[u,d,p].every(Number.isFinite)&&(!e||!h.Cartesian3.equals(e,c))&&(e=c,n.push(e))}return n}function Qn(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function u1(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function d1(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const gm=new h.Cartesian3,p1=new h.Ray,f1=new h.Plane(h.Cartesian3.UNIT_X,0);function jl(t,i,e,n){const o=h.Cartesian3.normalize(i,gm),s=h.Cartesian3.cross(t.camera.right,o,gm);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,f1),l=t.camera.getPickRay(e,p1);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const qh=new h.Cartesian3,g1=new h.Ray,m1=new h.Cartographic,v1=new h.Ellipsoid;function $o(t,i,e,n){const o=t.camera.getPickRay(i,g1);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,qh),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,qh),l=h.Ellipsoid.fromCartesian3(r,v1),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,qh),p=h.Cartographic.fromCartesian(d,void 0,m1);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function Xo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function mm(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const vm=new h.Cartographic,ym=new h.Cartesian3,xt=[0,0,0],un=[0,0,0],$h=new h.Cartesian2,Xh=new h.Cartesian3;function Yh(t,i,e,n,o,s){o.constraintMode="none",Xo([0,0,0],o.startDragPos),s=s||{},ri(a.getDomEventCurrentTargetPos(t),$h);const r=e.position;if(!Be(r,Xh))return;const l=Bi(i,Xh,n);if(l===void 0||!jl(i,Xh,$h,ym)||!le(ym,xt))return;const c=mm(xt[2])*a.geoDistance(r,xt);if(!s.z&&c<l&&Math.abs(r[2]-xt[2])<e.dimensions[0]&&xt[2]>r[2])return o.constraintMode="z",Xo(xt,o.startDragPos),!0;if(!$o(i,$h,r[2],vm)||!Ho(vm,xt))return;const u=mm(r[2])*a.geoDistance(r,xt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",Xo(xt,o.startDragPos);return}{const[p,f]=Qn(r,e.heading+90,xt,un);if(!s.x&&p>0&&f&&(un[2]=r[2],a.geoDistance(un,xt)<l)){o.constraintMode="x",Xo(un,o.startDragPos);return}}{const[p,f]=Qn(r,e.heading,xt,un);if(!s.y&&p>0&&f&&(un[2]=r[2],a.geoDistance(un,xt)<l)){o.constraintMode="y",Xo(un,o.startDragPos);return}}s.xy||(o.constraintMode="xy",Xo(xt,o.startDragPos))}}async function wm(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ri(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=$o(o,r,e);return c?Ho(c):void 0}}let Zh,Qh;function Cm(t,i,e,n,o){o=o||new h.Cartesian3,Zh=Zh||new h.Ray,Qh=Qh||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,Zh),r=h.Plane.fromPointNormal(i,e,Qh);return o=h.IntersectionTests.rayPlane(s,r,o),o}function _m(t){const i=h.Material.fromType(t.type);return kh(i,t),i}function Vt(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function y1(t){return{x:t[0],y:t[1]}}function kh(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Vt(i.image),t.uniforms.repeat=be(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=be(i.lineCount??[8,8]),t.uniforms.lineThickness=be(i.lineThickness??[1,1]),t.uniforms.lineOffset=be(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=be(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=be(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Vt(i.specularMap),t.uniforms.normalMap=Vt(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=y1(i.fadeDirection??[!0,!0]),t.uniforms.time=be(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Vt(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Vt(i.image):i.type==="ElevationBand"?(t.uniforms.color=Vt(i.colors),t.uniforms.heights=Vt(i.heights)):console.warn(`未知材质类型,无法更新 ${i.type}`)}function ai(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=_m(c)):e.value&&kh(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Vi(t){const i=ht(t.positions),e=t.holes&&t.holes.map(n=>Vi(n));return{positions:i,holes:e}}function Kh(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Pm=new h.Cartesian4,w1=new h.Matrix4;function C1(){return{left:0,top:0,right:0,bottom:0,depth:0}}function bm(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Sm(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,w1),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Pm),Pm);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,m=c.z;if(!(u<0||d<0||p<0||f<0||m<0||m>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=m):e={left:u,top:f,right:p,bottom:d,depth:m},e}const kn={left:0,top:0,right:0,bottom:0,depth:0};class ec extends a.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new a.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Jl(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Sm(this._viewer,this._cartesian,kn);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?bm(this._winPos,kn)||(e=!0,this._winPos.left=kn.left,this._winPos.top=kn.top,this._winPos.right=kn.right,this._winPos.bottom=kn.bottom,this._winPos.depth=kn.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function xm(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const _1=h.Check,P1=h.defaultValue,Kn=h.defined,Em=h.Math.EPSILON10;function b1(t,i,e,n){if(_1.defined("equalsEpsilon",i),!Kn(t))return;e=P1(e,!1);const o=Kn(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,Em)?(Kn(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(Kn(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],Em)&&(o&&(Kn(u)?n.splice(p,0,d):n.push(s-1)),Kn(u)?u.length-=1:u=t.slice(0,-1)),Kn(u)?u:t}const ye=h.Cartesian3,Yo=h.Cartographic,Jn=h.defaultValue,jn=h.defined,Am=h.DeveloperError,Tm=h.Ellipsoid,S1=h.EllipsoidGeodesic,Mm=h.EllipsoidRhumbLine,x1=h.IntersectionTests,Jh=h.Math,Zo=h.Matrix4,eo=h.Plane,Je={};Je.numberOfPoints=function(t,i,e){const n=ye.distance(t,i);return Math.ceil(n/e)},Je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const E1=new Yo;Je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,E1).height}return n};const A1=new Zo,T1=new ye,Im=new ye,M1=new eo(ye.UNIT_X,0),Dm=new ye,I1=new eo(ye.UNIT_X,0),D1=new ye,R1=new ye,jh=[];function Rm(t,i,e){const n=jh;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const tc=new Yo,ic=new Yo,dn=new ye,eu=new ye,F1=new ye,tu=new S1;let lr=new Mm;function z1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,eu),u=n.scaleToGeodeticSurface(i,F1),d=Je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,tc),f=n.cartesianToCartographic(u,ic),m=Rm(d,o,s);tu.setEndPoints(p,f);const g=tu.surfaceDistance/d;let y=l;p.height=o;let _=n.cartographicToCartesian(p,dn);ye.pack(_,r,y),y+=3;for(let P=1;P<d;P++){const w=tu.interpolateUsingSurfaceDistance(P*g,ic);w.height=m[P],_=n.cartographicToCartesian(w,dn),ye.pack(_,r,y),y+=3}return y}function L1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,tc),u=n.cartesianToCartographic(i,ic),d=Je.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=Rm(d,o,s);lr.ellipsoid.equals(n)||(lr=new Mm(void 0,void 0,n)),lr.setEndPoints(c,u);const f=lr.surfaceDistance/d;let m=l;c.height=o;let g=n.cartographicToCartesian(c,dn);ye.pack(g,r,m),m+=3;for(let y=1;y<d;y++){const _=lr.interpolateUsingSurfaceDistance(y*f,ic);_.height=p[y],g=n.cartographicToCartesian(_,dn),ye.pack(g,r,m),m+=3}return m}Je.wrapLongitude=function(t,i){const e=[],n=[];if(jn(t)&&t.length>0){i=Jn(i,Zo.IDENTITY);const o=Zo.inverseTransformation(i,A1),s=Zo.multiplyByPoint(o,ye.ZERO,T1),r=ye.normalize(Zo.multiplyByPointAsVector(o,ye.UNIT_Y,Im),Im),l=eo.fromPointNormal(s,r,M1),c=ye.normalize(Zo.multiplyByPointAsVector(o,ye.UNIT_X,Dm),Dm),u=eo.fromPointNormal(s,c,I1);let d=1;e.push(ye.clone(t[0]));let p=e[0];const f=t.length;for(let m=1;m<f;++m){const g=t[m];if(eo.getPointDistance(u,p)<0||eo.getPointDistance(u,g)<0){const y=x1.lineSegmentPlane(p,g,l,D1);if(jn(y)){const _=ye.multiplyByScalar(r,5e-9,R1);eo.getPointDistance(l,p)<0&&ye.negate(_,_),e.push(ye.add(y,_,new ye)),n.push(d+1),ye.negate(_,_),e.push(ye.add(y,_,new ye)),d=1}}e.push(ye.clone(t[m])),d++,p=g}n.push(d)}return{positions:e,lengths:n}},Je.generateArc=function(t){jn(t)||(t={});const i=t.positions;if(!jn(i))throw new Am("options.positions is required.");const e=i.length,n=Jn(t.ellipsoid,Tm.WGS84);let o=Jn(t.height,0);const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],eu);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(y,dn);ye.multiplyByScalar(_,o,_),ye.add(y,_,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!jn(r)){const y=Jn(t.granularity,Jh.RADIANS_PER_DEGREE);r=Jh.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Je.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],_=i[c+1],P=s?o[c]:o,w=s?o[c+1]:o;p=z1(y,_,r,n,P,w,d,p)}jh.length=0;const f=i[e-1],m=n.cartesianToCartographic(f,tc);m.height=s?o[e-1]:o;const g=n.cartographicToCartesian(m,dn);return ye.pack(g,d,u-3),d};const Fm=new Yo,O1=new Yo;Je.generateRhumbArc=function(t){jn(t)||(t={});const i=t.positions;if(!jn(i))throw new Am("options.positions is required.");const e=i.length,n=Jn(t.ellipsoid,Tm.WGS84);let o=Jn(t.height,0);const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],eu);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(P,dn);ye.multiplyByScalar(w,o,w),ye.add(P,w,P)}return[P.x,P.y,P.z]}const r=Jn(t.granularity,Jh.RADIANS_PER_DEGREE);let l=0,c,u=n.cartesianToCartographic(i[0],Fm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],O1),l+=Je.numberOfPointsRhumbLine(u,d,r),u=Yo.clone(d,Fm);const p=(l+1)*3,f=new Array(p);let m=0;for(c=0;c<e-1;c++){const P=i[c],w=i[c+1],b=s?o[c]:o,x=s?o[c+1]:o;m=L1(P,w,r,n,b,x,f,m)}jh.length=0;const g=i[e-1],y=n.cartesianToCartographic(g,tc);y.height=s?o[e-1]:o;const _=n.cartographicToCartesian(y,dn);return ye.pack(_,f,p-3),f},Je.generateCartesianArc=function(t){const i=Je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ye.unpack(i,o*3);return n},Je.generateCartesianRhumbArc=function(t){const i=Je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ye.unpack(i,o*3);return n};const nc=h.ArcType,N1=h.Cartesian3,B1=h.Math;function zm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=b1(t.positions,N1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===nc.GEODESIC||i===nc.RHUMB){let l;i===nc.GEODESIC?(l=B1.chordLength(e,n.maximumRadius),Je.numberOfPoints):(l=e,Je.numberOfPointsRhumbLine);const c=Je.extractHeights(s,n);i===nc.GEODESIC?s=Je.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Je.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function iu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=zm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function Lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function nu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?Kl(o,l):r==="XForwardZUp"&&dm(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ri(s),e),Lm(e,i)}const V1=new h.Matrix4;function Om(t,i){const e=h.Matrix4.fromArray(t,0,V1);return h.Matrix4.inverse(e,e),Lm(e,i)}const U1=new h.Matrix4,W1=new h.Cartesian3;function Nm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,W1),l=h.Matrix4.fromArray(t,0,U1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const G1=new h.Matrix4,H1=new h.Cartesian3,q1=new h.Cartographic;function pn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,H1),l=h.Matrix4.fromArray(t,0,G1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,q1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Et(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=nu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=Om(r);return[i.map(u=>Nm(l,u)),r,l]}function fn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=nu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>pn(r,c)),r]}function Bm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=Ce.Cartesian3.fromDegrees(...t[e]),o=Ce.Cartesian3.fromDegrees(...t[e+1]),s=Ce.Cartesian3.fromDegrees(...t[e+2]),r=Ce.Cartesian3.angleBetween(Ce.Cartesian3.subtract(n,o,new Ce.Cartesian3),Ce.Cartesian3.subtract(s,o,new Ce.Cartesian3));i.push(isNaN(r)?0:Ce.Math.toDegrees(r))}return i}function ou(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>le(n)))),t.holes&&t.holes.forEach(n=>{e=ou(n,e)}),e}function Ut(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class su extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,m=()=>{let g=r();g&&(g=[...g],i.editingHeightOffset&&(g[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...g,void 0,f))};m(),this.dispose(c.disposableOn(m)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const g=Bi(s,f,o);g!==void 0?d([g,g,g]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${g??"undefined"}`)}))}}function $1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=le(e),u=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=le(n),d=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=le(o),p=le(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=pn(i,[e.x,e.y,e.z]),u=pn(i,[-e.x,-e.y,-e.z]),l=pn(i,[n.x,n.y,n.z]),d=pn(i,[-n.x,-n.y,-n.z]),c=pn(i,[o.x,o.y,o.z]),p=pn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const Vm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(m=>m.json()).then(m=>{m&&!Reflect.has(m,"success")?n[f]=m:o.push({index:p,url:f,message:m.message}),p==i.length-1&&u()}).catch(m=>{o.push({index:p,url:f,message:m}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=$1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function X1(t){return new Promise((i,e)=>{Vm.restart(void 0,t),Vm.completeEvent.don(n=>{i(n)})})}class ru extends a.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function Um(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
2
2
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
3
3
|
|
|
4
4
|
uniform sampler2D specularMap;
|
|
@@ -113,7 +113,7 @@ ${e};
|
|
|
113
113
|
margin: auto;
|
|
114
114
|
">
|
|
115
115
|
</div>
|
|
116
|
-
`}function oo(t,i){if(t)return Object.prototype.hasOwnProperty.call(t,i)?t[i]!=null?Object.assign({},t[i]):void 0:oo(t.childPickedInfo,i)}function so(t){return new Promise((e,n)=>{let o=new Image;o.src=t+"?v="+Math.random(),o.crossOrigin="*",o.onload=function(){e({width:o.width,height:o.height,base64:i(o),url:t})},o.onerror=function(){e(void 0)}});function i(e){let n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0,e.width,e.height);let s=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return n.toDataURL("image/"+s)}}function Xm(t,i){const{width:e,height:n}=i;t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-e*.5,-n*.5,0],max:[e*.5,n*.5,0]}},t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*e,-.5*n,0,.5*e,-.5*n,0,.5*e,.5*n,0,-.5*e,.5*n,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}},t.indexTypedArray=new Uint16Array([0,1,2,0,2,3])}function Ym(t){const i=a.min(a.objsIterator(t,["0"])),e=a.min(a.objsIterator(t,["1"])),n=a.min(a.objsIterator(t,["2"])),o=a.max(a.objsIterator(t,["0"])),s=a.max(a.objsIterator(t,["1"])),r=a.max(a.objsIterator(t,["2"]));return{minPos:[i,e,n],maxPos:[o,s,r]}}function pu(t,i){const e=360/i.segments,n=Math.PI/180*e,o=Math.floor(360/e),s=i.startRadius,r=i.stopRadius,l=i.height,c=[...new Array(o+1).keys()],u=c.map(A=>A*n).map(A=>[s*Math.cos(A),s*Math.sin(A),0]),d=c.map(A=>A*n).map(A=>[r*Math.cos(A),r*Math.sin(A),l]),p=[...u,...d],{minPos:f,maxPos:m}=Ym(p);t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:f,max:m}};const g=c.map(A=>[0,1,0]).flat(),y=c.map(A=>[A/o,0]).flat(),_=c.map(A=>[A/o,1]).flat();t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array(p.flat())},normal:{componentsPerAttribute:3,typedArray:new Float32Array([...g,...g])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([...y,..._])}};const P=[...new Array(o).keys()],w=P.map(A=>[A,A+o+1,A+o+2,A,A+o+2,A+1]),b=P.map(A=>[A,A+o+2,A+o+1,A,A+1,A+o+2]),x=[...w,...b].flat();t.indexTypedArray=new Uint16Array(x)}function sP(t,i){for(let[e,{defaultValue:n,componentName:o,originPropName:s=e}]of Object.entries(i))Reflect.has(t,e)?console.error(`Prop(${e}) conflicts!`):Object.defineProperties(t,{[e]:{get(){return this[o][s]},set(r){this[o][s]=r}},[`${e}Changed`]:{get(){return this[o][`${s}Changed`]}}})}function rP(t){const i={};for(let[e,{defaultValue:n}]of Object.entries(t))i[e]=n;return i}function fu(t,i,e,n){const o=new qe(e,n);return o.innerHTML=no(t),o.position=i,o.show=!0,o}function Zm(t){const[i,e,n]=a.getReactFuncs(t),o=a.react(void 0),s=()=>{const r=i();o.value=r&&a.getGeoBoundingSphereFromPositions(r)};return s(),o.dispose(n.disposableOn(s)),o}function gi(t,i,e,n,o){const s=h.subscribeAndEvaluate(t,i,e,n,o);return()=>s.dispose()}var aP=function(){function t(i){this.points=i.points||[],this.duration=i.duration||1e4,this.sharpness=i.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=i.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],o=this.points[e+1];this.centers.push({x:(n.x+o.x)/2,y:(n.y+o.y)/2,z:(n.z+o.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var s=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,r=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,l=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+s),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+l)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+s),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+l)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return t.prototype.cacheSteps=function(i){var e=[],n=this.pos(0);e.push(0);for(var o=0;o<this.duration;o+=10){var s=this.pos(o),r=Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z));r>i&&(e.push(o),n=s)}return e},t.prototype.vector=function(i){var e=this.pos(i+10),n=this.pos(i-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(i){var e=i-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var o=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-o;return lP(s,this.points[o],this.controls[o][1],this.controls[o+1][0],this.points[o+1])},t}();function lP(t,i,e,n,o){var s=cP(t),r={x:o.x*s[0]+n.x*s[1]+e.x*s[2]+i.x*s[3],y:o.y*s[0]+n.y*s[1]+e.y*s[2]+i.y*s[3],z:o.z*s[0]+n.z*s[1]+e.z*s[2]+i.z*s[3]};return r}function cP(t){var i=t*t,e=i*t;return[e,3*i*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function hP(t,i){i===void 0&&(i={});var e=i.resolution||1e3,n=i.sharpness||.85;const o=[],s=t.map(u=>{const[d,p,f]=a.lbhToXyz(u);return{x:d,y:p,z:f}});for(var r=new aP({duration:e,points:s,sharpness:n}),l=function(u){var d=r.pos(u);const p=a.xyzToLbh([d.x,d.y,d.z]);o.push(p)},c=0;c<r.duration;c+=10)l(c);return l(r.duration),o}function gu(t,i,e){return hP(t,{resolution:i,sharpness:e})}function Ui(t){var e;const i=(e=oo(t,"pickResult"))==null?void 0:e.pointerEvent;return(i==null?void 0:i.buttons)!=0?(i==null?void 0:i.button)??0:-1}const Qt=[0,-30,0],uP=new h.Cartesian3,ur=new h.HeadingPitchRoll,dP=new h.Matrix4,pP=new h.Cartesian3;function fP(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}const gP=[0,0,0];function dr(t,i){const{position:e,viewDistance:n,rotation:o,duration:s,cancelCallback:r,hdelta:l,pdelta:c}=i;if(!e&&n===void 0&&!o)return;const[u,d,p]=e??fP(t.positionCartographic,gP),f=h.Cartesian3.fromDegrees(u,d,p,void 0,uP),m=o&&[...o].map(h.Math.toRadians)||[t.heading,t.pitch,t.roll];let g={heading:m[0],pitch:m[1],roll:m[2]};if(n){ur.heading=m[0],ur.pitch=m[1],ur.roll=m[2],ur.heading-=h.Math.PI_OVER_TWO;const P=h.Transforms.headingPitchRollToFixedFrame(f,ur,void 0,void 0,dP),w=h.Matrix4.multiplyByPointAsVector(P,h.Cartesian3.UNIT_X,pP);h.Cartesian3.multiplyByScalar(w,n,w),h.Cartesian3.subtract(f,w,f)}if(l&&(g.heading-=h.Math.toRadians(l)),c&&(g.pitch+=h.Math.toRadians(c)),s===0){t.setView({destination:f,orientation:g});return}let y;const _=new Promise((P,w)=>{t.flyTo({destination:f,orientation:g,duration:(s??1e3)*.001,complete:()=>{P(!0)},cancel:()=>{r&&r(),P(!1)}});const b=t._currentFlight;y=()=>{b===t._currentFlight&&(t.cancelFlight(),t._currentFlight&&(console.error("cancelFlight后_currentFlight不应该存在!"),w("cancelFlight后_currentFlight不应该存在!")))}});return a.pairToPromise([y,_])}function se(t,i,e,n,o,s){const r=t==null?void 0:t.camera;return r&&dr(r,{position:i,viewDistance:e,rotation:n,duration:o&&o*1e3,cancelCallback:s})}async function kt(t,i,e,n,o,s,r=!1){if(!t.viewer)return;const l=vu(t,o),c=[...Qt];r&&(c[0]=i.rotation[0]-90);const{position:u,rotation:d}=ac(n,c,l);let p=await t.flyTo({distance:0,heading:d[0],pitch:d[1],flyDuration:s??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}async function re(t,i,e,n,o,s=!1){const r=a.getGeoBoundingSphereFromPositions(n);if(r&&r.center&&r.radius&&t.viewer){const l=vu(t,r.radius),c=[...Qt];s&&(c[0]=i.rotation[0]-90);const{position:u,rotation:d}=ac(r.center,c,l);let p=await t.flyTo({distance:0,heading:d[0],pitch:d[1],flyDuration:o??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}return!1}async function At(t,i,e,n,o,s=!1){const r=mP(t,o);if(r!=null){const[l,c]=r,u=[...Qt];s&&(u[0]=i.rotation[0]-90);const{position:d,rotation:p}=ac(l,u,c);let f=await t.flyTo({distance:0,heading:p[0],pitch:p[1],flyDuration:n??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,f?"over":f==null?"error":"cancelled",t),f??!1}return!1}function mP(t,i){if(i instanceof Fe&&i.nativePrimitive&&i.nativePrimitive.boundingVolume)return mu(t,i.nativePrimitive.boundingVolume);if(i instanceof rt&&i.primitive)return mu(t,i.primitive.boundingSphere)}function mu(t,i){let e,n;if(i instanceof h.BoundingSphere)n=le(i.center),e=i.radius;else if(i instanceof h.BoundingRectangle){const{x:o,y:s,width:r,height:l}=i,c=h.Rectangle.fromRadians(o,s,o+r,s+l),u=h.BoundingSphere.fromRectangle2D(c);n=le(u.center),e=u.radius}else if(i instanceof h.OrientedBoundingBox){n=le(i.center);const o=i.halfAxes,s=a.Vector.magnitude([o[0],o[1],o[2]]),r=a.Vector.magnitude([o[3],o[4],o[5]]),l=a.Vector.magnitude([o[6],o[7],o[8]]);e=Math.max(s,r,l)}if(!(!n||e===void 0||!t.viewer))return e=vu(t,e),[n,e]}function vu(t,i){if(i=Math.abs(i),i==0&&(i=1),!t.viewer)return i;const e=i/((t.flyToBoundingSize??256)*.5/(t.viewer.canvas.width/2)*Math.tan(h.Math.toRadians(t.fov/2)));return Math.sqrt(i*i+e*e)}function ac(t,i,e){const n=new h.Cartesian3(-e*Math.cos(h.Math.toRadians(i[1]))*Math.cos(h.Math.toRadians(i[0]-90)),e*Math.cos(h.Math.toRadians(i[1]))*Math.sin(h.Math.toRadians(i[0]-90)),-e*Math.sin(h.Math.toRadians(i[1]))),o=h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(...t));let s=h.Matrix4.multiplyByPoint(o,n,new h.Cartesian3);const r=h.Cartesian3.fromDegrees(...t),l=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(l,l);const c=h.Transforms.rotationMatrixFromPositionVelocity(s,l,h.Ellipsoid.WGS84),u=h.Matrix4.fromRotationTranslation(c,s);var d=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(u,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),p=h.Matrix4.multiply(h.Matrix4.inverse(d,new h.Matrix4),u,new h.Matrix4),f=h.Matrix4.getMatrix3(p,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(f),g=h.HeadingPitchRoll.fromQuaternion(m);const y=h.Cartographic.fromCartesian(s);return{position:[h.Math.toDegrees(y.longitude),h.Math.toDegrees(y.latitude),y.height],rotation:[h.Math.toDegrees(g.heading)+90,h.Math.toDegrees(g.pitch),h.Math.toDegrees(g.roll)]}}function Qm(t,i=128,e=128,n="image/jpeg"){let o;return new Promise((s,r)=>{var l=t._postRender.addEventListener(()=>{let c=t.canvas,u=c.width,d=c.height;o||(o=document.createElement("canvas")),o.setAttribute("width",`${i}`),o.setAttribute("height",`${e}`);let p,f,m,g;u/i<d/e?(p=0,m=u,g=e*u/i,f=(d-g)*.5):(f=0,g=d,m=i*d/e,p=(u-m)*.5);let y=o.getContext("2d");if(!y){l(),r(new Error("captureScreenCanvas.getContext('2d') error!"));return}y.drawImage(c,p,f,m,g,0,0,i,e);let _=o.toDataURL(n);l(),s(_)},null)})}async function km(t,i){const e=[],n=i.length;let o=0;for(let s=0;s<n-1;++s)o+=await Km(t,i[s],i[s+1]),e.push(o);return e}function Km(t,i,e){const n=si(i),o=si(e),s=[];return new Promise(async r=>{const l=parseInt(h.Cartesian3.distance(n,o).toString()),c=h.Cartographic.fromCartesian(n),u=[c.longitude,c.latitude],d=h.Cartographic.fromCartesian(o),p=[d.longitude,d.latitude];s.push(new h.Cartographic(u[0],u[1]));for(let g=1;g<=l-1;g++){let y=h.Math.lerp(u[0],p[0],g/l),_=h.Math.lerp(u[1],p[1],g/l);s.push(new h.Cartographic(y,_))}const f=await h.sampleTerrainMostDetailed(t.terrainProvider,[...s]),m=await Jm(f);r(m)})}function Jm(t){return new Promise(i=>{let e=0;t.map((n,o)=>{if(o==t.length-1)return;const s=t[o+1],r=h.Cartesian3.fromRadians(n.longitude,n.latitude,n.height),l=h.Cartesian3.fromRadians(s.longitude,s.latitude,s.height);e+=h.Cartesian3.distance(r,l)}),i(e)})}class vP extends a.Destroyable{constructor(i){super(),this._nativePrimitive=i;const{sceneObject:e,sceneScaleFromPixelSize:n,viewer:o,primitive:s}=this,r=()=>{if(!this.finalShow){s.show=!1;return}s.show=!0;const l=Re({localScale:e.localScale,initialRotation:"xForwardzUp",localRotation:e.localRotation,localPosition:e.localPosition,localModelMatrix:e.localModelMatrix,sceneScaleFromPixelSize:n.value,scale:e.scale,rotation:e.rotation,position:e.instances&&e.instances.length!==0?le(h.BoundingSphere.fromPoints(e.instances.map(c=>Be(c.position))).center):e.position,modelMatrix:e.modelMatrix});if(!l){console.warn("computeCzmModelMatrix error.");return}s.modelMatrix=l};{let l=!0;this.dispose(e.showChanged.disposableOn(()=>l=!0)),this.dispose(e.localPositionChanged.disposableOn(()=>l=!0)),this.dispose(e.localRotationChanged.disposableOn(()=>l=!0)),this.dispose(e.localScaleChanged.disposableOn(()=>l=!0)),this.dispose(e.localModelMatrixChanged.disposableOn(()=>l=!0)),this.dispose(e.positionChanged.disposableOn(()=>l=!0)),this.dispose(e.rotationChanged.disposableOn(()=>l=!0)),this.dispose(e.instancesChanged.disposableOn(()=>l=!0)),this.dispose(e.scaleChanged.disposableOn(()=>l=!0)),this.dispose(e.modelMatrixChanged.disposableOn(()=>l=!0)),this.dispose(n.changed.disposableOn(()=>l=!0)),this.dispose(e.readyEvent.don(()=>l=!0)),r(),this.dispose(o.scene.preUpdate.addEventListener(()=>{l&&(l&&(l=!1),r())}))}}get nativePrimitive(){return this._nativePrimitive}get czmCzmModelPrimitive(){return this.nativePrimitive.czmCzmModelPrimitive}get sceneObject(){return this.czmCzmModelPrimitive}get sceneScaleFromPixelSize(){return this.czmCzmModelPrimitive.sceneScaleFromPixelSize}get viewer(){return this.czmCzmModelPrimitive.czmViewer.viewer}get finalShow(){return this.czmCzmModelPrimitive.finalShow}get primitive(){return this.nativePrimitive.primitive}}class yP extends a.Destroyable{constructor(i){super(),this._owner=i}get owner(){return this._owner}updateNodeMatrix(i){const e=this.owner.owner.owner.owner,n=i._nodesByName&&Object.keys(i._nodesByName);if(n)for(const o of n){const s=i.getNode(o);if(!s){console.error(`!node ${o}`);continue}const r=e.nodeTransformations&&e.nodeTransformations[o];if(!r){h.Matrix4.equals(s.matrix,s.originalMatrix)||(s.matrix=void 0);continue}const{translationX:l,translationY:c,translationZ:u,rotationHeading:d,rotationPitch:p,rotationRoll:f,scaleX:m,scaleY:g,scaleZ:y}=r;if(!Number.isFinite(l)||!Number.isFinite(c)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(m)||!Number.isFinite(g)||!Number.isFinite(y)){console.error(`transformation数值有误!${JSON.stringify(r,void 0," ")}`,r);continue}if(m<0||g<0||y<0){console.error("scaleX < 0 || scaleY < 0 || scaleZ < 0");continue}const _=h.Math.toRadians,P=h.Matrix4.fromTranslationQuaternionRotationScale(new h.Cartesian3(l,c,u),h.Quaternion.fromHeadingPitchRoll(new h.HeadingPitchRoll(_(d),_(p),_(f))),new h.Cartesian3(m,g,y));s.matrix=h.Matrix4.multiply(s.originalMatrix,P,s.matrix??new h.Matrix4)}}update(){const i=this.owner.owner.owner.owner,{primitive:e}=this.owner;if(e.activeAnimations.animateWhilePaused=i.activeAnimationsAnimateWhilePaused??rt.defaults.activeAnimationsAnimateWhilePaused,e.activeAnimations.removeAll(),i.activeAnimations)for(let n of i.activeAnimations)e.activeAnimations.add({name:n.name,index:n.index,startTime:n.startTime,delay:n.delay,stopTime:n.stopTime,removeOnStop:n.removeOnStop,multiplier:n.multiplier,reverse:n.reverse,loop:n.loop,animationTime:n.animationTime});this.updateNodeMatrix(e)}}const wP=[6378137,6378137,6356752314245179e-9];var ut;(t=>{t.heightReferencePropsMap={NONE:h.HeightReference.NONE,CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_GROUND,RELATIVE_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND},t.shadowPropsMap={DISABLED:h.ShadowMode.DISABLED,CAST_ONLY:h.ShadowMode.CAST_ONLY,ENABLED:h.ShadowMode.ENABLED,RECEIVE_ONLY:h.ShadowMode.RECEIVE_ONLY},t.classificationTypeMap={TERRAIN:h.ClassificationType.TERRAIN,CESIUM_3D_TILE:h.ClassificationType.CESIUM_3D_TILE,BOTH:h.ClassificationType.BOTH,NONE:void 0},t.textureMinificationFilterType={NEAREST:h.TextureMinificationFilter.NEAREST,LINEAR:h.TextureMinificationFilter.LINEAR,NEAREST_MIPMAP_NEAREST:h.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:h.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:h.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:h.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR},t.textureMagnificationFilterType={NEAREST:h.TextureMagnificationFilter.NEAREST,LINEAR:h.TextureMagnificationFilter.LINEAR},t.colorBlendModeType={HIGHLIGHT:h.ColorBlendMode.HIGHLIGHT,REPLACE:h.ColorBlendMode.REPLACE,MIX:h.ColorBlendMode.MIX},t.horizontalOriginType={CENTER:h.HorizontalOrigin.CENTER,LEFT:h.HorizontalOrigin.LEFT,RIGHT:h.HorizontalOrigin.RIGHT},t.verticalOriginOriginType={CENTER:h.VerticalOrigin.CENTER,BOTTOM:h.VerticalOrigin.BOTTOM,BASELINE:h.VerticalOrigin.BASELINE,TOP:h.VerticalOrigin.TOP},t.labelStyleType={FILL:h.LabelStyle.FILL,OUTLINE:h.LabelStyle.OUTLINE,FILL_AND_OUTLINE:h.LabelStyle.FILL_AND_OUTLINE},t.blendOptionType={OPAQUE:h.BlendOption.OPAQUE,TRANSLUCENT:h.BlendOption.TRANSLUCENT,OPAQUE_AND_TRANSLUCENT:h.BlendOption.OPAQUE_AND_TRANSLUCENT}})(ut||(ut={}));const yu={river:{waterColor:[95/255,115/255,70/255,1],frequency:800,waveVelocity:.6,amplitude:.1,specularIntensity:.8,flowDirection:0,flowSpeed:0},ocean:{waterColor:[12/255,30/255,69/255,1],frequency:360,waveVelocity:.8,amplitude:.5,specularIntensity:.8,flowDirection:0,flowSpeed:0},lake:{waterColor:[32/255,84/255,105/255,1],frequency:200,waveVelocity:.4,amplitude:.01,specularIntensity:.8,flowDirection:0,flowSpeed:0}};class CP extends a.Destroyable{constructor(e,n,o){super();v(this,"_modelMatrixUpdating");v(this,"_nativePrimitiveReady");this._gltf=e,this._primitive=n,this._owner=o,this._modelMatrixUpdating=this.disposeVar(new vP(this));const{czmViewer:s,sceneObject:r,pickingManager:l}=this,{viewer:c}=s;if(!c)throw new Error("!viewer");const{scene:u}=c;u.primitives.add(this._primitive),this.dispose(()=>u.primitives.remove(this._primitive)),this.owner.owner.owner.setPrimitive(this._primitive),this.dispose(()=>this.owner.owner.owner.setPrimitive(void 0)),this.dispose(r.printDebugInfoEvent.disposableOn(()=>{console.log(`---czm-model-primitive-debug-info-viewerid-${s.id}-begin---`),console.log("CzmCzmModelPrimitive: ",this),console.log("native gltf: ",this.gltf),console.log("native primitive: ",this.primitive),console.log(`---czm-model-primitive-debug-info-viewerid-${s.id}-end---`)}));const d=this._primitive.readyEvent.addEventListener(()=>{if(d(),!this.primitive.ready)throw console.error("!this.primitive.ready"),new Error("!this.primitive.ready");if(this._nativePrimitiveReady)throw console.error("this._nativePrimitiveReady"),new Error("this._nativePrimitiveReady");this._nativePrimitiveReady=this.disposeVar(new yP(this)),this._nativePrimitiveReady.update()});this.dispose(d)}get owner(){return this._owner}get czmCzmModelPrimitive(){return this.owner.owner.owner}get czmViewer(){return this.czmCzmModelPrimitive.czmViewer}get viewer(){return this.czmViewer.viewer}get scene(){return this.viewer.scene}get primitive(){return this._primitive}get sceneObject(){return this.czmCzmModelPrimitive}get gltf(){return this._gltf}get pickingManager(){var e;return(e=this.czmViewer.extensions)==null?void 0:e.pickingManager}get nativePrimitiveReady(){return this._nativePrimitiveReady}update(){const{visibleAlpha:e,finalShow:n,finalSpecularEnvironmentMapsReact:o}=this.owner.owner.owner,s=this.owner.owner.owner,{primitive:r}=this,l=n;r.show=l,r.clampAnimations=s.clampAnimations??!0,r.shadows=ut.shadowPropsMap[s.shadows??"DISABLED"],r.debugShowBoundingVolume=s.debugShowBoundingVolume??!1,r.debugWireframe=s.debugWireframe??!1,r.backFaceCulling=s.backFaceCulling??!0,r.heightReference=s.heightReference?ut.heightReferencePropsMap[s.heightReference]:ut.heightReferencePropsMap.NONE,r.distanceDisplayCondition=sr(s.distanceDisplayCondition??[0,Number.MAX_VALUE]);{const u=s.color??[1,1,1,1];u[3]*=e;const d=te(u);r.color=d}r.colorBlendMode=ut.colorBlendModeType[s.colorBlendMode??"HIGHLIGHT"],r.silhouetteColor=s.silhouetteColor&&te(s.silhouetteColor)||h.Color.RED,r.silhouetteSize=s.silhouetteSize??0,r.colorBlendAmount=s.colorBlendAmount??.5,r.lightColor=(s.lightColor&&si(s.lightColor))??void 0;const c=r.imageBasedLighting;c&&(c.imageBasedLightingFactor=be(s.imageBasedLightingFactor??rt.defaults.imageBasedLightingFactor),c.sphericalHarmonicCoefficients=s.sphericalHarmonicCoefficients&&lu(s.sphericalHarmonicCoefficients),c.specularEnvironmentMaps=o.value),r.environmentMapManager&&au(r.environmentMapManager,s),r.minimumPixelSize=s.nativeMinimumPixelSize,r.maximumScale=s.nativeMaximumScale,r.scale=s.nativeScale,this._nativePrimitiveReady&&this._nativePrimitiveReady.update()}}const lc=new h.Cartesian3,_P=new h.HeadingPitchRoll,jm=new h.Matrix3,PP=new h.Quaternion,cc=h.ModelComponents.Attribute,bP=h.ModelComponents.FeatureIdAttribute,ev=h.ModelComponents.Instances;function SP(t,i,e,n){if(!n||n.length===0){const V=i.nodes,O=V.length;for(let z=0;z<O;z++){const U=V[z];U.primitives.length>0&&(U.instances=void 0)}return}let o;const s=n?n.length:0;if(s===0)return;const r=new Float32Array(3*s),l=new Float32Array(4*s),c=new Float32Array(3*s),u=new Float32Array(s),d=new Array(4),p=new Array(3),f=h.BoundingSphere.fromPoints(n.map(V=>Be(V.position))),m=h.Matrix4.inverse(h.Transforms.northWestUpToFixedFrame(f.center),new h.Matrix4);for(o=0;o<s;o++)h.Matrix4.multiplyByPoint(m,Be(n[o].position),lc),r[3*o+0]=lc.x,r[3*o+1]=lc.y,r[3*o+2]=lc.z,h.Matrix3.fromHeadingPitchRoll(h.HeadingPitchRoll.fromDegrees(...n[o].rotation??[0,0,0],_P),jm),h.Quaternion.pack(h.Quaternion.fromRotationMatrix(jm,PP),d,0),l[4*o+0]=d[0],l[4*o+1]=d[1],l[4*o+2]=d[2],l[4*o+3]=d[3],h.Cartesian3.pack(h.Cartesian3.fromArray(n[o].scale??[1,1,1]),p,0),c[3*o+0]=p[1],c[3*o+1]=p[0],c[3*o+2]=p[2],u[o]=o;const g=new ev;g.transformInWorldSpace=!0,t._buffers||(t._buffers=[]);const y=t._buffers,_=new cc;_.name="Instance Translation",_.semantic=h.InstanceAttributeSemantic.TRANSLATION,_.componentDatatype=h.ComponentDatatype.FLOAT,_.type=h.AttributeType.VEC3,_.count=s,_.typedArray=r,g.attributes.push(_);const P=new cc;P.name="Instance Rotation",P.semantic=h.InstanceAttributeSemantic.ROTATION,P.componentDatatype=h.ComponentDatatype.FLOAT,P.type=h.AttributeType.VEC4,P.count=s,P.typedArray=l,g.attributes.push(P);const w=new cc;w.name="Instance Scale",w.semantic=h.InstanceAttributeSemantic.SCALE,w.componentDatatype=h.ComponentDatatype.FLOAT,w.type=h.AttributeType.VEC3,w.count=s,w.typedArray=c,g.attributes.push(w);const b=new cc;b.name="Instance Feature ID",b.setIndex=0,b.semantic=h.InstanceAttributeSemantic.FEATURE_ID,b.componentDatatype=h.ComponentDatatype.FLOAT,b.type=h.AttributeType.SCALAR,b.count=s;const x=h.Buffer.createVertexBuffer({context:e.context,typedArray:u,usage:h.BufferUsage.STATIC_DRAW});x.vertexArrayDestroyable=!1,y.push(x),b.buffer=x,g.attributes.push(b);const A=new bP;A.propertyTableId=0,A.setIndex=0,A.positionalLabel="instanceFeatureId_0",g.featureIds.push(A);const M=i.nodes,D=M.length;let L=!1;for(o=0;o<D;o++){const V=M[o];V.primitives.length>0&&(V.instances=L?EP(g):g,L=!0)}}function xP(t,i){var o;const e=t?t.length:0;if(e===0){i.structuralMetadata=void 0;return}let n;if(t!=null&&t[0]){const s={id:new Array(e)};for(let c=0;c<e;c++)s.id[c]=((o=t[c])==null?void 0:o.id)??c;const r=new h.JsonMetadataTable({count:e,properties:s}),l=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e,jsonMetadataTable:r});n=new h.StructuralMetadata({schema:{},propertyTables:[l]})}else{const s=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e});n=new h.StructuralMetadata({schema:{},propertyTables:[s]})}i.structuralMetadata=n}function EP(t){const i=new ev;i.transformInWorldSpace=t.transformInWorldSpace;const e=t.attributes,n=e.length;for(let o=0;o<n;o++){const s=h.clone(e[o],!1);i.attributes.push(s)}return i}class AP extends a.Destroyable{constructor(e){super();v(this,"_nativePrimitive");this._owner=e;const n=this.owner.owner,{visibleAlphaChanged:o}=n,s=c=>{var d;this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!0),c._resourcesLoaded=c._texturesLoaded=!1;const u=(d=e.owner.czmViewer.viewer)==null?void 0:d.scene.preUpdate.addEventListener(p=>{const f=p.frameState;if(c._loader.components){const m=c._loader.components;SP(c._loader,m,f,n.instances),xP(n.instances,m),c._loader._components=m,c._loader._arrayBuffer=void 0,n.instances&&n.instances.length>0?c._featureTableIdDirty=!0:c._drawCommandsBuilt=!1,u&&u(),this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!1),f.afterRender.push(()=>{var g;(g=this.nativePrimitive)==null||g.update()})}})};{let c=Promise.resolve();const u=()=>{c=c.then(()=>{if(!this.nativePrimitive)return;const d=this.nativePrimitive.primitive;s(d)})};u(),this.ad(n.instancesChanged.don(u))}this.ad(n.setMaterialEvent.don(async c=>{let u=!0;if(!this.nativePrimitive)return;if(c=="default")u=cr(this.nativePrimitive.primitive,"default");else{if(!this.nativePrimitive)return;const p={};for(const f in c){let m,g,y;const _=c[f];p[f]={..._},Reflect.has(_,"baseColorTexture")&&(_.baseColorTexture==null?p[f].baseColorTexture=void 0:_.baseColorTexture.value!=""&&(m=to(this.owner.owner.czmViewer.viewer,_.baseColorTexture,{magFilter:_.magFilter,minFilter:_.minFilter}))),Reflect.has(_,"normalTexture")&&(_.normalTexture==null?p[f].normalTexture=void 0:_.normalTexture.value!=""&&(g=to(this.owner.owner.czmViewer.viewer,_.normalTexture,{magFilter:_.magFilter,minFilter:_.minFilter}))),Reflect.has(_,"metallicRoughnessTexture")&&(_.metallicRoughnessTexture==null?p[f].metallicRoughnessTexture=void 0:_.metallicRoughnessTexture.value!=""&&(y=to(this.owner.owner.czmViewer.viewer,_.metallicRoughnessTexture,{magFilter:_.magFilter,minFilter:_.minFilter})));const P=await Promise.allSettled([m,g,y]);m=P[0].value,g=P[1].value,y=P[2].value,y!=null&&(p[f].metallicRoughnessTexture=y),m!=null&&(p[f].baseColorTexture=m),g!=null&&(p[f].normalTexture=g)}u=cr(this.nativePrimitive.primitive,p)}const d=a.ESSceneObject.getSceneObject(this._owner.owner.id);d&&d instanceof a.ESGltfModel&&d.setMaterialInfoEvent.emit({type:u?"success":"warn",message:u?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));const r=async()=>{const c=this.owner.owner,{finalModelUriReact:u,czmViewer:d,visibleAlpha:p,finalShow:f}=c,m=d.viewer;if(!u.value)return;const g=n.customShaderInstanceClass&&new n.customShaderInstanceClass(n,d),y=n.color??[1,1,1,1];y[3]*=p;const _=te(y);let P;const w=await h.Model.fromGltfAsync({url:n.gltfJson?void 0:u.value,gltf:n.gltfJson?JSON.parse(JSON.stringify(n.gltfJson)):void 0,releaseGltfJson:!!n.gltfJson,basePath:n.basePath,show:f,allowPicking:n.allowPicking,incrementallyLoadTextures:n.incrementallyLoadTextures,asynchronous:n.asynchronous,clampAnimations:n.clampAnimations,shadows:n.shadows&&ut.shadowPropsMap[n.shadows],debugShowBoundingVolume:n.debugShowBoundingVolume,debugWireframe:n.debugWireframe,backFaceCulling:n.backFaceCulling,showOutline:n.showOutline,heightReference:n.heightReference&&ut.heightReferencePropsMap[n.heightReference],distanceDisplayCondition:n.distanceDisplayCondition&&sr(n.distanceDisplayCondition),color:_,scene:m.scene,colorBlendMode:n.colorBlendMode&&ut.colorBlendModeType[n.colorBlendMode],credit:n.credit,silhouetteColor:n.silhouetteColor&&te(n.silhouetteColor),colorBlendAmount:n.colorBlendAmount,silhouetteSize:n.silhouetteSize,upAxis:n.upAxis,forwardAxis:n.forwardAxis,customShader:g&&g.customShader,opaquePass:h.Pass[n.opaquePass],gltfCallback:x=>{P=x}});h.Model.prototype&&(w.ESSceneObjectID=n.id);const b=w.readyEvent.addEventListener(x=>{n.instances&&s(x),n.readyEvent.emit(x)});return this.dispose(b),[w,g,P]};this.disposeVar(a.createProcessingFromAsyncFunc(async c=>{const u=this.owner.owner,{finalModelUriReact:d}=u;if(!d.value)return;const p=await c.promise(r());if(!p)return;const[f,m,g]=p;this._nativePrimitive=this.disposeVar(new CP(g,f,this)),this._nativePrimitive.update(),this.owner.owner.gltf=g})).start();{const c=()=>{this.nativePrimitive&&this.nativePrimitive.update()};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(n.showChanged,n.clampAnimationsChanged,n.shadowsChanged,n.debugShowBoundingVolumeChanged,n.debugWireframeChanged,n.backFaceCullingChanged,n.heightReferenceChanged,n.distanceDisplayConditionChanged,n.colorChanged,n.colorBlendModeChanged,n.silhouetteColorChanged,n.colorBlendAmountChanged,n.silhouetteSizeChanged,n.activeAnimationsChanged,n.activeAnimationsAnimateWhilePausedChanged,n.nodeTransformationsChanged,n.nativeMinimumPixelSizeChanged,n.nativeMaximumScaleChanged,n.nativeScaleChanged,n.environmentMapManagerChanged,n.imageBasedLightingFactorChanged,o));this.dispose(u.disposableOn(c))}}get owner(){return this._owner}get nativePrimitive(){return this._nativePrimitive}}class TP extends a.Destroyable{constructor(i){super(),this._owner=i;const{owner:e}=this,{finalModelUriReact:n,finalSpecularEnvironmentMapsReact:o}=e,s=this.disposeVar(a.createNextAnimateFrameEvent(n.changed,e.basePathChanged,e.allowPickingChanged,e.incrementallyLoadTexturesChanged,e.showOutlineChanged,e.asynchronousChanged,e.creditChanged,e.forwardAxisChanged,e.upAxisChanged,e.lightColorChanged,e.sphericalHarmonicCoefficientsChanged,o.changed,e.customShaderInstanceClassChanged,e.opaquePassChanged,e.gltfJsonChanged,e.resetEvent));this.disposeVar(new a.ObjResettingWithEvent(s,()=>new AP(this)))}get owner(){return this._owner}}const wu={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Qs=class Qs extends a.Destroyable{constructor(e,n){super();v(this,"_readyEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_customShaderInstanceClass",this.disposeVar(a.react(void 0)));v(this,"_updateCustomShaderEvent",this.disposeVar(new a.Event));v(this,"_activeAnimations",this.disposeVar(a.reactDeepArrayWithUndefined(void 0,(e,n)=>e.animationTime===n.animationTime&&e.delay===n.delay&&e.index===n.index&&e.loop===n.loop&&e.multiplier===n.multiplier&&e.name===n.name&&e.removeOnStop===n.removeOnStop&&e.reverse===n.reverse&&h.JulianDate.equals(e.startTime,n.startTime)&&h.JulianDate.equals(e.stopTime,n.stopTime)&&!0,e=>({...e}))));v(this,"_primitive");v(this,"_customShaderInstance");v(this,"_gltf",this.disposeVar(a.react(void 0)));v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_sceneScaleFromPixelSize",this.disposeVar(a.react(void 0)));v(this,"_finalShowReact",this.disposeVar(a.react(!0)));v(this,"_finalModelUriReact");v(this,"_finalSpecularEnvironmentMapsReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"specularEnvironmentMaps"])));v(this,"_id",this.disposeVar(a.react(void 0)));v(this,"_setMaterialEvent",this.disposeVar(new a.Event));v(this,"_resetEvent",this.disposeVar(new a.Event));v(this,"_printDebugInfoEvent",this.disposeVar(new a.Event));v(this,"_smoothMoving",this.disposeVar(new qm));v(this,"_smoothMovingBinding",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.position=this._smoothMoving.currentPosition)));v(this,"_smoothMovingBinding2",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.rotation=[this._smoothMoving.currentHeading??0,this.rotation&&this.rotation[1]||0,this.rotation&&this.rotation[2]||0])));this._czmViewer=e,n&&(this.id=n),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Zn(this.czmViewer,[this,"viewDistanceRange"],[this,"position"])),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._finalModelUriReact=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"url"],Qs.defaultUrl)),this.disposeVar(new TP(this));const o=e.viewer;if(!o)return;const s=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};s(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(s));{const l=()=>{if(!this.activeAnimationsJson){this.activeAnimations=void 0;return}this.activeAnimations=this.activeAnimationsJson.map(c=>{let u;try{u=c.animationTime&&Function(`"use strict";return (${c.animationTime})`)()}catch(d){console.error(`animationTimeStr eval error: ${d}`,d),u=void 0}return{name:c.name,index:c.index,startTime:c.startTime!==void 0&&h.JulianDate.fromDate(new Date(c.startTime))||void 0,delay:c.delay,stopTime:c.stopTime!==void 0&&h.JulianDate.fromDate(new Date(c.stopTime))||void 0,removeOnStop:c.removeOnStop,multiplier:c.multiplier,reverse:c.reverse,loop:c.loop&&h.ModelAnimationLoop[c.loop],animationTime:u}})};l(),this.activeAnimationsJsonChanged.disposableOn(l)}{const l=()=>this._finalShowReact.value=(this.show??!0)&&this.visibleAlpha>0;l(),this.dispose(this.showChanged.disposableOn(l)),this.dispose(this.visibleAlphaChanged.disposableOn(l))}const{sceneScaleFromPixelSize:r}=this;{const l=()=>{let c;if(this.position&&this.pixelSize){const u=h.Cartesian3.fromDegrees(...this.position);u&&(c=Bi(o.scene,u,this.pixelSize),c&&(this.maximumScale!==void 0&&c>this.maximumScale&&(c=this.maximumScale),this.minimumScale!==void 0&&c<this.minimumScale&&(c=this.minimumScale)))}r.value=c};l(),this.dispose(o.scene.preUpdate.addEventListener(l))}this.dispose(this.flyToEvent.disposableOn(l=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}if(this._primitive&&this._primitive.ready&&this._primitive.boundingSphere){const{center:c,radius:u}=this._primitive._boundingSphere;h.Matrix4.multiplyByPoint(this._primitive.modelMatrix,c,new h.Cartesian3);const d=u*3;se(o,this.position,d,void 0,l)}else{const c=o.scene.camera.positionCartographic.height;se(o,this.position,c,void 0,l)}})),this.dispose(this.updateCustomShaderEvent.disposableOn(l=>{this._customShaderInstance&&l(this._customShaderInstance,this,this.czmViewer)}))}get readyEvent(){return this._readyEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get activeAnimations(){return this._activeAnimations.value}get activeAnimationsChanged(){return this._activeAnimations.changed}set activeAnimations(e){this._activeAnimations.value=e}setPrimitive(e){this._primitive=e}get primitive(){return this._primitive}get gltf(){return this._gltf.value}set gltf(e){this._gltf.value=e}get gltfChanged(){return this._gltf.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get sceneScaleFromPixelSize(){return this._sceneScaleFromPixelSize}get finalShow(){return this._finalShowReact.value}get finalModelUriReact(){return this._finalModelUriReact}get finalSpecularEnvironmentMapsReact(){return this._finalSpecularEnvironmentMapsReact}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}get resetEvent(){return this._resetEvent}reset(){this._resetEvent.emit()}get ready(){return!!this._primitive&&this._primitive.ready}async openLocalDir(){const e=await a.defaultGetLocalFilePath(["gltf","glb"],"gltf");this.url=e}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}setNodeTranslation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s))){console.error(`setNodeTranslation error: translation.length !== 3 || translation.some(e => !Number.isFinite(e)): ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,translationX:n[0],translationY:n[1],translationZ:n[2]}}}getNodeTranslation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}setNodeRotation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s))){console.error(`setNodeTranslation error: rotation.length !== 3 || rotation.some(e => !Number.isFinite(e)) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}setNodeScale(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeTranslation error: scale.length !== 3 || scale.some(e => !Number.isFinite(e) || e < 0) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}smoothMove(e,n){this.position||(this.position=e),this._smoothMoving.restart(this.position,0),this._smoothMoving.restart(e,n)}};v(Qs,"defaultUrl","${earthsdk3-assets-script-dir}/assets/glb/building.glb"),v(Qs,"defaultSpecularEnvironmentMaps","${earthsdk3-assets-script-dir}/assets/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx2"),v(Qs,"defaults",{activeAnimationsAnimateWhilePaused:!1,viewDistanceRange:[1e3,1e4,3e4,6e4],imageBasedLightingFactor:[1,1]});let rt=Qs;(t=>{t.createDefaultProps=()=>({show:void 0,url:void 0,allowPicking:void 0,allowPickingDepth:!0,maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),scale:a.reactArrayWithUndefined(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),modelMatrix:a.reactArrayWithUndefined(void 0),forwardAxis:void 0,upAxis:void 0,color:a.reactArrayWithUndefined(void 0),silhouetteColor:a.reactArrayWithUndefined(void 0),shadows:void 0,credit:void 0,basePath:void 0,gltfJson:a.reactJson(void 0),heightReference:void 0,distanceDisplayCondition:void 0,colorBlendMode:void 0,incrementallyLoadTextures:void 0,asynchronous:void 0,clampAnimations:void 0,debugShowBoundingVolume:void 0,debugWireframe:void 0,backFaceCulling:void 0,showOutline:void 0,colorBlendAmount:void 0,silhouetteSize:void 0,imageBasedLightingFactor:a.reactArrayWithUndefined(void 0),lightColor:void 0,environmentMapManager:a.reactJsonWithUndefined(void 0),sphericalHarmonicCoefficients:void 0,specularEnvironmentMaps:void 0,customShaderInstanceClassStr:void 0,activeAnimationsJson:a.reactJsonWithUndefined(void 0),activeAnimationsAnimateWhilePaused:void 0,nodeTransformations:a.reactJsonWithUndefined(void 0),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,nativeMinimumPixelSize:0,nativeMaximumScale:void 0,nativeScale:1,opaquePass:"OPAQUE",instances:a.reactArrayWithUndefined(void 0)})})(rt||(rt={})),a.extendClassProps(rt.prototype,rt.createDefaultProps);const MP={id:"e80d8802-e7dc-40d6-8cff-cfe3a12c8763",type:"CzmCustomPrimitive",show:!0,allowPicking:!0,cull:!1,pass:"OVERLAY",vertexShaderSource:`in vec3 position;
|
|
116
|
+
`}function oo(t,i){if(t)return Object.prototype.hasOwnProperty.call(t,i)?t[i]!=null?Object.assign({},t[i]):void 0:oo(t.childPickedInfo,i)}function so(t){return new Promise((e,n)=>{let o=new Image;o.src=t+"?v="+Math.random(),o.crossOrigin="*",o.onload=function(){e({width:o.width,height:o.height,base64:i(o),url:t})},o.onerror=function(){e(void 0)}});function i(e){let n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0,e.width,e.height);let s=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return n.toDataURL("image/"+s)}}function Xm(t,i){const{width:e,height:n}=i;t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-e*.5,-n*.5,0],max:[e*.5,n*.5,0]}},t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*e,-.5*n,0,.5*e,-.5*n,0,.5*e,.5*n,0,-.5*e,.5*n,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}},t.indexTypedArray=new Uint16Array([0,1,2,0,2,3])}function Ym(t){const i=a.min(a.objsIterator(t,["0"])),e=a.min(a.objsIterator(t,["1"])),n=a.min(a.objsIterator(t,["2"])),o=a.max(a.objsIterator(t,["0"])),s=a.max(a.objsIterator(t,["1"])),r=a.max(a.objsIterator(t,["2"]));return{minPos:[i,e,n],maxPos:[o,s,r]}}function pu(t,i){const e=360/i.segments,n=Math.PI/180*e,o=Math.floor(360/e),s=i.startRadius,r=i.stopRadius,l=i.height,c=[...new Array(o+1).keys()],u=c.map(A=>A*n).map(A=>[s*Math.cos(A),s*Math.sin(A),0]),d=c.map(A=>A*n).map(A=>[r*Math.cos(A),r*Math.sin(A),l]),p=[...u,...d],{minPos:f,maxPos:m}=Ym(p);t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:f,max:m}};const g=c.map(A=>[0,1,0]).flat(),y=c.map(A=>[A/o,0]).flat(),_=c.map(A=>[A/o,1]).flat();t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array(p.flat())},normal:{componentsPerAttribute:3,typedArray:new Float32Array([...g,...g])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([...y,..._])}};const P=[...new Array(o).keys()],w=P.map(A=>[A,A+o+1,A+o+2,A,A+o+2,A+1]),b=P.map(A=>[A,A+o+2,A+o+1,A,A+1,A+o+2]),x=[...w,...b].flat();t.indexTypedArray=new Uint16Array(x)}function sP(t,i){for(let[e,{defaultValue:n,componentName:o,originPropName:s=e}]of Object.entries(i))Reflect.has(t,e)?console.error(`Prop(${e}) conflicts!`):Object.defineProperties(t,{[e]:{get(){return this[o][s]},set(r){this[o][s]=r}},[`${e}Changed`]:{get(){return this[o][`${s}Changed`]}}})}function rP(t){const i={};for(let[e,{defaultValue:n}]of Object.entries(t))i[e]=n;return i}function fu(t,i,e,n){const o=new qe(e,n);return o.innerHTML=no(t),o.position=i,o.show=!0,o}function Zm(t){const[i,e,n]=a.getReactFuncs(t),o=a.react(void 0),s=()=>{const r=i();o.value=r&&a.getGeoBoundingSphereFromPositions(r)};return s(),o.dispose(n.disposableOn(s)),o}function gi(t,i,e,n,o){const s=h.subscribeAndEvaluate(t,i,e,n,o);return()=>s.dispose()}var aP=(function(){function t(i){this.points=i.points||[],this.duration=i.duration||1e4,this.sharpness=i.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=i.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],o=this.points[e+1];this.centers.push({x:(n.x+o.x)/2,y:(n.y+o.y)/2,z:(n.z+o.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var s=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,r=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,l=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+s),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+l)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+s),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+l)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return t.prototype.cacheSteps=function(i){var e=[],n=this.pos(0);e.push(0);for(var o=0;o<this.duration;o+=10){var s=this.pos(o),r=Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z));r>i&&(e.push(o),n=s)}return e},t.prototype.vector=function(i){var e=this.pos(i+10),n=this.pos(i-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(i){var e=i-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var o=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-o;return lP(s,this.points[o],this.controls[o][1],this.controls[o+1][0],this.points[o+1])},t})();function lP(t,i,e,n,o){var s=cP(t),r={x:o.x*s[0]+n.x*s[1]+e.x*s[2]+i.x*s[3],y:o.y*s[0]+n.y*s[1]+e.y*s[2]+i.y*s[3],z:o.z*s[0]+n.z*s[1]+e.z*s[2]+i.z*s[3]};return r}function cP(t){var i=t*t,e=i*t;return[e,3*i*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function hP(t,i){i===void 0&&(i={});var e=i.resolution||1e3,n=i.sharpness||.85;const o=[],s=t.map(u=>{const[d,p,f]=a.lbhToXyz(u);return{x:d,y:p,z:f}});for(var r=new aP({duration:e,points:s,sharpness:n}),l=function(u){var d=r.pos(u);const p=a.xyzToLbh([d.x,d.y,d.z]);o.push(p)},c=0;c<r.duration;c+=10)l(c);return l(r.duration),o}function gu(t,i,e){return hP(t,{resolution:i,sharpness:e})}function Ui(t){var e;const i=(e=oo(t,"pickResult"))==null?void 0:e.pointerEvent;return(i==null?void 0:i.buttons)!=0?(i==null?void 0:i.button)??0:-1}const Qt=[0,-30,0],uP=new h.Cartesian3,ur=new h.HeadingPitchRoll,dP=new h.Matrix4,pP=new h.Cartesian3;function fP(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}const gP=[0,0,0];function dr(t,i){const{position:e,viewDistance:n,rotation:o,duration:s,cancelCallback:r,hdelta:l,pdelta:c}=i;if(!e&&n===void 0&&!o)return;const[u,d,p]=e??fP(t.positionCartographic,gP),f=h.Cartesian3.fromDegrees(u,d,p,void 0,uP),m=o&&[...o].map(h.Math.toRadians)||[t.heading,t.pitch,t.roll];let g={heading:m[0],pitch:m[1],roll:m[2]};if(n){ur.heading=m[0],ur.pitch=m[1],ur.roll=m[2],ur.heading-=h.Math.PI_OVER_TWO;const P=h.Transforms.headingPitchRollToFixedFrame(f,ur,void 0,void 0,dP),w=h.Matrix4.multiplyByPointAsVector(P,h.Cartesian3.UNIT_X,pP);h.Cartesian3.multiplyByScalar(w,n,w),h.Cartesian3.subtract(f,w,f)}if(l&&(g.heading-=h.Math.toRadians(l)),c&&(g.pitch+=h.Math.toRadians(c)),s===0){t.setView({destination:f,orientation:g});return}let y;const _=new Promise((P,w)=>{t.flyTo({destination:f,orientation:g,duration:(s??1e3)*.001,complete:()=>{P(!0)},cancel:()=>{r&&r(),P(!1)}});const b=t._currentFlight;y=()=>{b===t._currentFlight&&(t.cancelFlight(),t._currentFlight&&(console.error("cancelFlight后_currentFlight不应该存在!"),w("cancelFlight后_currentFlight不应该存在!")))}});return a.pairToPromise([y,_])}function se(t,i,e,n,o,s){const r=t==null?void 0:t.camera;return r&&dr(r,{position:i,viewDistance:e,rotation:n,duration:o&&o*1e3,cancelCallback:s})}async function kt(t,i,e,n,o,s,r=!1){if(!t.viewer)return;const l=vu(t,o),c=[...Qt];r&&(c[0]=i.rotation[0]-90);const{position:u,rotation:d}=ac(n,c,l);let p=await t.flyTo({distance:0,heading:d[0],pitch:d[1],flyDuration:s??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}async function re(t,i,e,n,o,s=!1){const r=a.getGeoBoundingSphereFromPositions(n);if(r&&r.center&&r.radius&&t.viewer){const l=vu(t,r.radius),c=[...Qt];s&&(c[0]=i.rotation[0]-90);const{position:u,rotation:d}=ac(r.center,c,l);let p=await t.flyTo({distance:0,heading:d[0],pitch:d[1],flyDuration:o??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}return!1}async function At(t,i,e,n,o,s=!1){const r=mP(t,o);if(r!=null){const[l,c]=r,u=[...Qt];s&&(u[0]=i.rotation[0]-90);const{position:d,rotation:p}=ac(l,u,c);let f=await t.flyTo({distance:0,heading:p[0],pitch:p[1],flyDuration:n??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,f?"over":f==null?"error":"cancelled",t),f??!1}return!1}function mP(t,i){if(i instanceof Fe&&i.nativePrimitive&&i.nativePrimitive.boundingVolume)return mu(t,i.nativePrimitive.boundingVolume);if(i instanceof rt&&i.primitive)return mu(t,i.primitive.boundingSphere)}function mu(t,i){let e,n;if(i instanceof h.BoundingSphere)n=le(i.center),e=i.radius;else if(i instanceof h.BoundingRectangle){const{x:o,y:s,width:r,height:l}=i,c=h.Rectangle.fromRadians(o,s,o+r,s+l),u=h.BoundingSphere.fromRectangle2D(c);n=le(u.center),e=u.radius}else if(i instanceof h.OrientedBoundingBox){n=le(i.center);const o=i.halfAxes,s=a.Vector.magnitude([o[0],o[1],o[2]]),r=a.Vector.magnitude([o[3],o[4],o[5]]),l=a.Vector.magnitude([o[6],o[7],o[8]]);e=Math.max(s,r,l)}if(!(!n||e===void 0||!t.viewer))return e=vu(t,e),[n,e]}function vu(t,i){if(i=Math.abs(i),i==0&&(i=1),!t.viewer)return i;const e=i/((t.flyToBoundingSize??256)*.5/(t.viewer.canvas.width/2)*Math.tan(h.Math.toRadians(t.fov/2)));return Math.sqrt(i*i+e*e)}function ac(t,i,e){const n=new h.Cartesian3(-e*Math.cos(h.Math.toRadians(i[1]))*Math.cos(h.Math.toRadians(i[0]-90)),e*Math.cos(h.Math.toRadians(i[1]))*Math.sin(h.Math.toRadians(i[0]-90)),-e*Math.sin(h.Math.toRadians(i[1]))),o=h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(...t));let s=h.Matrix4.multiplyByPoint(o,n,new h.Cartesian3);const r=h.Cartesian3.fromDegrees(...t),l=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(l,l);const c=h.Transforms.rotationMatrixFromPositionVelocity(s,l,h.Ellipsoid.WGS84),u=h.Matrix4.fromRotationTranslation(c,s);var d=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(u,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),p=h.Matrix4.multiply(h.Matrix4.inverse(d,new h.Matrix4),u,new h.Matrix4),f=h.Matrix4.getMatrix3(p,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(f),g=h.HeadingPitchRoll.fromQuaternion(m);const y=h.Cartographic.fromCartesian(s);return{position:[h.Math.toDegrees(y.longitude),h.Math.toDegrees(y.latitude),y.height],rotation:[h.Math.toDegrees(g.heading)+90,h.Math.toDegrees(g.pitch),h.Math.toDegrees(g.roll)]}}function Qm(t,i=128,e=128,n="image/jpeg"){let o;return new Promise((s,r)=>{var l=t._postRender.addEventListener(()=>{let c=t.canvas,u=c.width,d=c.height;o||(o=document.createElement("canvas")),o.setAttribute("width",`${i}`),o.setAttribute("height",`${e}`);let p,f,m,g;u/i<d/e?(p=0,m=u,g=e*u/i,f=(d-g)*.5):(f=0,g=d,m=i*d/e,p=(u-m)*.5);let y=o.getContext("2d");if(!y){l(),r(new Error("captureScreenCanvas.getContext('2d') error!"));return}y.drawImage(c,p,f,m,g,0,0,i,e);let _=o.toDataURL(n);l(),s(_)},null)})}async function km(t,i){const e=[],n=i.length;let o=0;for(let s=0;s<n-1;++s)o+=await Km(t,i[s],i[s+1]),e.push(o);return e}function Km(t,i,e){const n=si(i),o=si(e),s=[];return new Promise(async r=>{const l=parseInt(h.Cartesian3.distance(n,o).toString()),c=h.Cartographic.fromCartesian(n),u=[c.longitude,c.latitude],d=h.Cartographic.fromCartesian(o),p=[d.longitude,d.latitude];s.push(new h.Cartographic(u[0],u[1]));for(let g=1;g<=l-1;g++){let y=h.Math.lerp(u[0],p[0],g/l),_=h.Math.lerp(u[1],p[1],g/l);s.push(new h.Cartographic(y,_))}const f=await h.sampleTerrainMostDetailed(t.terrainProvider,[...s]),m=await Jm(f);r(m)})}function Jm(t){return new Promise(i=>{let e=0;t.map((n,o)=>{if(o==t.length-1)return;const s=t[o+1],r=h.Cartesian3.fromRadians(n.longitude,n.latitude,n.height),l=h.Cartesian3.fromRadians(s.longitude,s.latitude,s.height);e+=h.Cartesian3.distance(r,l)}),i(e)})}class vP extends a.Destroyable{constructor(i){super(),this._nativePrimitive=i;const{sceneObject:e,sceneScaleFromPixelSize:n,viewer:o,primitive:s}=this,r=()=>{if(!this.finalShow){s.show=!1;return}s.show=!0;const l=Re({localScale:e.localScale,initialRotation:"xForwardzUp",localRotation:e.localRotation,localPosition:e.localPosition,localModelMatrix:e.localModelMatrix,sceneScaleFromPixelSize:n.value,scale:e.scale,rotation:e.rotation,position:e.instances&&e.instances.length!==0?le(h.BoundingSphere.fromPoints(e.instances.map(c=>Be(c.position))).center):e.position,modelMatrix:e.modelMatrix});if(!l){console.warn("computeCzmModelMatrix error.");return}s.modelMatrix=l};{let l=!0;this.dispose(e.showChanged.disposableOn(()=>l=!0)),this.dispose(e.localPositionChanged.disposableOn(()=>l=!0)),this.dispose(e.localRotationChanged.disposableOn(()=>l=!0)),this.dispose(e.localScaleChanged.disposableOn(()=>l=!0)),this.dispose(e.localModelMatrixChanged.disposableOn(()=>l=!0)),this.dispose(e.positionChanged.disposableOn(()=>l=!0)),this.dispose(e.rotationChanged.disposableOn(()=>l=!0)),this.dispose(e.instancesChanged.disposableOn(()=>l=!0)),this.dispose(e.scaleChanged.disposableOn(()=>l=!0)),this.dispose(e.modelMatrixChanged.disposableOn(()=>l=!0)),this.dispose(n.changed.disposableOn(()=>l=!0)),this.dispose(e.readyEvent.don(()=>l=!0)),r(),this.dispose(o.scene.preUpdate.addEventListener(()=>{l&&(l&&(l=!1),r())}))}}get nativePrimitive(){return this._nativePrimitive}get czmCzmModelPrimitive(){return this.nativePrimitive.czmCzmModelPrimitive}get sceneObject(){return this.czmCzmModelPrimitive}get sceneScaleFromPixelSize(){return this.czmCzmModelPrimitive.sceneScaleFromPixelSize}get viewer(){return this.czmCzmModelPrimitive.czmViewer.viewer}get finalShow(){return this.czmCzmModelPrimitive.finalShow}get primitive(){return this.nativePrimitive.primitive}}class yP extends a.Destroyable{constructor(i){super(),this._owner=i}get owner(){return this._owner}updateNodeMatrix(i){const e=this.owner.owner.owner.owner,n=i._nodesByName&&Object.keys(i._nodesByName);if(n)for(const o of n){const s=i.getNode(o);if(!s){console.error(`!node ${o}`);continue}const r=e.nodeTransformations&&e.nodeTransformations[o];if(!r){h.Matrix4.equals(s.matrix,s.originalMatrix)||(s.matrix=void 0);continue}const{translationX:l,translationY:c,translationZ:u,rotationHeading:d,rotationPitch:p,rotationRoll:f,scaleX:m,scaleY:g,scaleZ:y}=r;if(!Number.isFinite(l)||!Number.isFinite(c)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(m)||!Number.isFinite(g)||!Number.isFinite(y)){console.error(`transformation数值有误!${JSON.stringify(r,void 0," ")}`,r);continue}if(m<0||g<0||y<0){console.error("scaleX < 0 || scaleY < 0 || scaleZ < 0");continue}const _=h.Math.toRadians,P=h.Matrix4.fromTranslationQuaternionRotationScale(new h.Cartesian3(l,c,u),h.Quaternion.fromHeadingPitchRoll(new h.HeadingPitchRoll(_(d),_(p),_(f))),new h.Cartesian3(m,g,y));s.matrix=h.Matrix4.multiply(s.originalMatrix,P,s.matrix??new h.Matrix4)}}update(){const i=this.owner.owner.owner.owner,{primitive:e}=this.owner;if(e.activeAnimations.animateWhilePaused=i.activeAnimationsAnimateWhilePaused??rt.defaults.activeAnimationsAnimateWhilePaused,e.activeAnimations.removeAll(),i.activeAnimations)for(let n of i.activeAnimations)e.activeAnimations.add({name:n.name,index:n.index,startTime:n.startTime,delay:n.delay,stopTime:n.stopTime,removeOnStop:n.removeOnStop,multiplier:n.multiplier,reverse:n.reverse,loop:n.loop,animationTime:n.animationTime});this.updateNodeMatrix(e)}}const wP=[6378137,6378137,6356752314245179e-9];var ut;(t=>{t.heightReferencePropsMap={NONE:h.HeightReference.NONE,CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_GROUND,RELATIVE_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND},t.shadowPropsMap={DISABLED:h.ShadowMode.DISABLED,CAST_ONLY:h.ShadowMode.CAST_ONLY,ENABLED:h.ShadowMode.ENABLED,RECEIVE_ONLY:h.ShadowMode.RECEIVE_ONLY},t.classificationTypeMap={TERRAIN:h.ClassificationType.TERRAIN,CESIUM_3D_TILE:h.ClassificationType.CESIUM_3D_TILE,BOTH:h.ClassificationType.BOTH,NONE:void 0},t.textureMinificationFilterType={NEAREST:h.TextureMinificationFilter.NEAREST,LINEAR:h.TextureMinificationFilter.LINEAR,NEAREST_MIPMAP_NEAREST:h.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:h.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:h.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:h.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR},t.textureMagnificationFilterType={NEAREST:h.TextureMagnificationFilter.NEAREST,LINEAR:h.TextureMagnificationFilter.LINEAR},t.colorBlendModeType={HIGHLIGHT:h.ColorBlendMode.HIGHLIGHT,REPLACE:h.ColorBlendMode.REPLACE,MIX:h.ColorBlendMode.MIX},t.horizontalOriginType={CENTER:h.HorizontalOrigin.CENTER,LEFT:h.HorizontalOrigin.LEFT,RIGHT:h.HorizontalOrigin.RIGHT},t.verticalOriginOriginType={CENTER:h.VerticalOrigin.CENTER,BOTTOM:h.VerticalOrigin.BOTTOM,BASELINE:h.VerticalOrigin.BASELINE,TOP:h.VerticalOrigin.TOP},t.labelStyleType={FILL:h.LabelStyle.FILL,OUTLINE:h.LabelStyle.OUTLINE,FILL_AND_OUTLINE:h.LabelStyle.FILL_AND_OUTLINE},t.blendOptionType={OPAQUE:h.BlendOption.OPAQUE,TRANSLUCENT:h.BlendOption.TRANSLUCENT,OPAQUE_AND_TRANSLUCENT:h.BlendOption.OPAQUE_AND_TRANSLUCENT}})(ut||(ut={}));const yu={river:{waterColor:[95/255,115/255,70/255,1],frequency:800,waveVelocity:.6,amplitude:.1,specularIntensity:.8,flowDirection:0,flowSpeed:0},ocean:{waterColor:[12/255,30/255,69/255,1],frequency:360,waveVelocity:.8,amplitude:.5,specularIntensity:.8,flowDirection:0,flowSpeed:0},lake:{waterColor:[32/255,84/255,105/255,1],frequency:200,waveVelocity:.4,amplitude:.01,specularIntensity:.8,flowDirection:0,flowSpeed:0}};class CP extends a.Destroyable{constructor(e,n,o){super();v(this,"_modelMatrixUpdating");v(this,"_nativePrimitiveReady");this._gltf=e,this._primitive=n,this._owner=o,this._modelMatrixUpdating=this.disposeVar(new vP(this));const{czmViewer:s,sceneObject:r,pickingManager:l}=this,{viewer:c}=s;if(!c)throw new Error("!viewer");const{scene:u}=c;u.primitives.add(this._primitive),this.dispose(()=>u.primitives.remove(this._primitive)),this.owner.owner.owner.setPrimitive(this._primitive),this.dispose(()=>this.owner.owner.owner.setPrimitive(void 0)),this.dispose(r.printDebugInfoEvent.disposableOn(()=>{console.log(`---czm-model-primitive-debug-info-viewerid-${s.id}-begin---`),console.log("CzmCzmModelPrimitive: ",this),console.log("native gltf: ",this.gltf),console.log("native primitive: ",this.primitive),console.log(`---czm-model-primitive-debug-info-viewerid-${s.id}-end---`)}));const d=this._primitive.readyEvent.addEventListener(()=>{if(d(),!this.primitive.ready)throw console.error("!this.primitive.ready"),new Error("!this.primitive.ready");if(this._nativePrimitiveReady)throw console.error("this._nativePrimitiveReady"),new Error("this._nativePrimitiveReady");this._nativePrimitiveReady=this.disposeVar(new yP(this)),this._nativePrimitiveReady.update()});this.dispose(d)}get owner(){return this._owner}get czmCzmModelPrimitive(){return this.owner.owner.owner}get czmViewer(){return this.czmCzmModelPrimitive.czmViewer}get viewer(){return this.czmViewer.viewer}get scene(){return this.viewer.scene}get primitive(){return this._primitive}get sceneObject(){return this.czmCzmModelPrimitive}get gltf(){return this._gltf}get pickingManager(){var e;return(e=this.czmViewer.extensions)==null?void 0:e.pickingManager}get nativePrimitiveReady(){return this._nativePrimitiveReady}update(){const{visibleAlpha:e,finalShow:n,finalSpecularEnvironmentMapsReact:o}=this.owner.owner.owner,s=this.owner.owner.owner,{primitive:r}=this,l=n;r.show=l,r.clampAnimations=s.clampAnimations??!0,r.shadows=ut.shadowPropsMap[s.shadows??"DISABLED"],r.debugShowBoundingVolume=s.debugShowBoundingVolume??!1,r.debugWireframe=s.debugWireframe??!1,r.backFaceCulling=s.backFaceCulling??!0,r.heightReference=s.heightReference?ut.heightReferencePropsMap[s.heightReference]:ut.heightReferencePropsMap.NONE,r.distanceDisplayCondition=sr(s.distanceDisplayCondition??[0,Number.MAX_VALUE]);{const u=s.color??[1,1,1,1];u[3]*=e;const d=te(u);r.color=d}r.colorBlendMode=ut.colorBlendModeType[s.colorBlendMode??"HIGHLIGHT"],r.silhouetteColor=s.silhouetteColor&&te(s.silhouetteColor)||h.Color.RED,r.silhouetteSize=s.silhouetteSize??0,r.colorBlendAmount=s.colorBlendAmount??.5,r.lightColor=(s.lightColor&&si(s.lightColor))??void 0;const c=r.imageBasedLighting;c&&(c.imageBasedLightingFactor=be(s.imageBasedLightingFactor??rt.defaults.imageBasedLightingFactor),c.sphericalHarmonicCoefficients=s.sphericalHarmonicCoefficients&&lu(s.sphericalHarmonicCoefficients),c.specularEnvironmentMaps=o.value),r.environmentMapManager&&au(r.environmentMapManager,s),r.minimumPixelSize=s.nativeMinimumPixelSize,r.maximumScale=s.nativeMaximumScale,r.scale=s.nativeScale,this._nativePrimitiveReady&&this._nativePrimitiveReady.update()}}const lc=new h.Cartesian3,_P=new h.HeadingPitchRoll,jm=new h.Matrix3,PP=new h.Quaternion,cc=h.ModelComponents.Attribute,bP=h.ModelComponents.FeatureIdAttribute,ev=h.ModelComponents.Instances;function SP(t,i,e,n){if(!n||n.length===0){const V=i.nodes,O=V.length;for(let z=0;z<O;z++){const U=V[z];U.primitives.length>0&&(U.instances=void 0)}return}let o;const s=n?n.length:0;if(s===0)return;const r=new Float32Array(3*s),l=new Float32Array(4*s),c=new Float32Array(3*s),u=new Float32Array(s),d=new Array(4),p=new Array(3),f=h.BoundingSphere.fromPoints(n.map(V=>Be(V.position))),m=h.Matrix4.inverse(h.Transforms.northWestUpToFixedFrame(f.center),new h.Matrix4);for(o=0;o<s;o++)h.Matrix4.multiplyByPoint(m,Be(n[o].position),lc),r[3*o+0]=lc.x,r[3*o+1]=lc.y,r[3*o+2]=lc.z,h.Matrix3.fromHeadingPitchRoll(h.HeadingPitchRoll.fromDegrees(...n[o].rotation??[0,0,0],_P),jm),h.Quaternion.pack(h.Quaternion.fromRotationMatrix(jm,PP),d,0),l[4*o+0]=d[0],l[4*o+1]=d[1],l[4*o+2]=d[2],l[4*o+3]=d[3],h.Cartesian3.pack(h.Cartesian3.fromArray(n[o].scale??[1,1,1]),p,0),c[3*o+0]=p[1],c[3*o+1]=p[0],c[3*o+2]=p[2],u[o]=o;const g=new ev;g.transformInWorldSpace=!0,t._buffers||(t._buffers=[]);const y=t._buffers,_=new cc;_.name="Instance Translation",_.semantic=h.InstanceAttributeSemantic.TRANSLATION,_.componentDatatype=h.ComponentDatatype.FLOAT,_.type=h.AttributeType.VEC3,_.count=s,_.typedArray=r,g.attributes.push(_);const P=new cc;P.name="Instance Rotation",P.semantic=h.InstanceAttributeSemantic.ROTATION,P.componentDatatype=h.ComponentDatatype.FLOAT,P.type=h.AttributeType.VEC4,P.count=s,P.typedArray=l,g.attributes.push(P);const w=new cc;w.name="Instance Scale",w.semantic=h.InstanceAttributeSemantic.SCALE,w.componentDatatype=h.ComponentDatatype.FLOAT,w.type=h.AttributeType.VEC3,w.count=s,w.typedArray=c,g.attributes.push(w);const b=new cc;b.name="Instance Feature ID",b.setIndex=0,b.semantic=h.InstanceAttributeSemantic.FEATURE_ID,b.componentDatatype=h.ComponentDatatype.FLOAT,b.type=h.AttributeType.SCALAR,b.count=s;const x=h.Buffer.createVertexBuffer({context:e.context,typedArray:u,usage:h.BufferUsage.STATIC_DRAW});x.vertexArrayDestroyable=!1,y.push(x),b.buffer=x,g.attributes.push(b);const A=new bP;A.propertyTableId=0,A.setIndex=0,A.positionalLabel="instanceFeatureId_0",g.featureIds.push(A);const M=i.nodes,D=M.length;let L=!1;for(o=0;o<D;o++){const V=M[o];V.primitives.length>0&&(V.instances=L?EP(g):g,L=!0)}}function xP(t,i){var o;const e=t?t.length:0;if(e===0){i.structuralMetadata=void 0;return}let n;if(t!=null&&t[0]){const s={id:new Array(e)};for(let c=0;c<e;c++)s.id[c]=((o=t[c])==null?void 0:o.id)??c;const r=new h.JsonMetadataTable({count:e,properties:s}),l=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e,jsonMetadataTable:r});n=new h.StructuralMetadata({schema:{},propertyTables:[l]})}else{const s=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e});n=new h.StructuralMetadata({schema:{},propertyTables:[s]})}i.structuralMetadata=n}function EP(t){const i=new ev;i.transformInWorldSpace=t.transformInWorldSpace;const e=t.attributes,n=e.length;for(let o=0;o<n;o++){const s=h.clone(e[o],!1);i.attributes.push(s)}return i}class AP extends a.Destroyable{constructor(e){super();v(this,"_nativePrimitive");this._owner=e;const n=this.owner.owner,{visibleAlphaChanged:o}=n,s=c=>{var d;this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!0),c._resourcesLoaded=c._texturesLoaded=!1;const u=(d=e.owner.czmViewer.viewer)==null?void 0:d.scene.preUpdate.addEventListener(p=>{const f=p.frameState;if(c._loader.components){const m=c._loader.components;SP(c._loader,m,f,n.instances),xP(n.instances,m),c._loader._components=m,c._loader._arrayBuffer=void 0,n.instances&&n.instances.length>0?c._featureTableIdDirty=!0:c._drawCommandsBuilt=!1,u&&u(),this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!1),f.afterRender.push(()=>{var g;(g=this.nativePrimitive)==null||g.update()})}})};{let c=Promise.resolve();const u=()=>{c=c.then(()=>{if(!this.nativePrimitive)return;const d=this.nativePrimitive.primitive;s(d)})};u(),this.ad(n.instancesChanged.don(u))}this.ad(n.setMaterialEvent.don(async c=>{let u=!0;if(!this.nativePrimitive)return;if(c=="default")u=cr(this.nativePrimitive.primitive,"default");else{if(!this.nativePrimitive)return;const p={};for(const f in c){let m,g,y;const _=c[f];p[f]={..._},Reflect.has(_,"baseColorTexture")&&(_.baseColorTexture==null?p[f].baseColorTexture=void 0:_.baseColorTexture.value!=""&&(m=to(this.owner.owner.czmViewer.viewer,_.baseColorTexture,{magFilter:_.magFilter,minFilter:_.minFilter}))),Reflect.has(_,"normalTexture")&&(_.normalTexture==null?p[f].normalTexture=void 0:_.normalTexture.value!=""&&(g=to(this.owner.owner.czmViewer.viewer,_.normalTexture,{magFilter:_.magFilter,minFilter:_.minFilter}))),Reflect.has(_,"metallicRoughnessTexture")&&(_.metallicRoughnessTexture==null?p[f].metallicRoughnessTexture=void 0:_.metallicRoughnessTexture.value!=""&&(y=to(this.owner.owner.czmViewer.viewer,_.metallicRoughnessTexture,{magFilter:_.magFilter,minFilter:_.minFilter})));const P=await Promise.allSettled([m,g,y]);m=P[0].value,g=P[1].value,y=P[2].value,y!=null&&(p[f].metallicRoughnessTexture=y),m!=null&&(p[f].baseColorTexture=m),g!=null&&(p[f].normalTexture=g)}u=cr(this.nativePrimitive.primitive,p)}const d=a.ESSceneObject.getSceneObject(this._owner.owner.id);d&&d instanceof a.ESGltfModel&&d.setMaterialInfoEvent.emit({type:u?"success":"warn",message:u?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));const r=async()=>{const c=this.owner.owner,{finalModelUriReact:u,czmViewer:d,visibleAlpha:p,finalShow:f}=c,m=d.viewer;if(!u.value)return;const g=n.customShaderInstanceClass&&new n.customShaderInstanceClass(n,d),y=n.color??[1,1,1,1];y[3]*=p;const _=te(y);let P;const w=await h.Model.fromGltfAsync({url:n.gltfJson?void 0:u.value,gltf:n.gltfJson?JSON.parse(JSON.stringify(n.gltfJson)):void 0,releaseGltfJson:!!n.gltfJson,basePath:n.basePath,show:f,allowPicking:n.allowPicking,incrementallyLoadTextures:n.incrementallyLoadTextures,asynchronous:n.asynchronous,clampAnimations:n.clampAnimations,shadows:n.shadows&&ut.shadowPropsMap[n.shadows],debugShowBoundingVolume:n.debugShowBoundingVolume,debugWireframe:n.debugWireframe,backFaceCulling:n.backFaceCulling,showOutline:n.showOutline,heightReference:n.heightReference&&ut.heightReferencePropsMap[n.heightReference],distanceDisplayCondition:n.distanceDisplayCondition&&sr(n.distanceDisplayCondition),color:_,scene:m.scene,colorBlendMode:n.colorBlendMode&&ut.colorBlendModeType[n.colorBlendMode],credit:n.credit,silhouetteColor:n.silhouetteColor&&te(n.silhouetteColor),colorBlendAmount:n.colorBlendAmount,silhouetteSize:n.silhouetteSize,upAxis:n.upAxis,forwardAxis:n.forwardAxis,customShader:g&&g.customShader,opaquePass:h.Pass[n.opaquePass],gltfCallback:x=>{P=x}});h.Model.prototype&&(w.ESSceneObjectID=n.id);const b=w.readyEvent.addEventListener(x=>{n.instances&&s(x),n.readyEvent.emit(x)});return this.dispose(b),[w,g,P]};this.disposeVar(a.createProcessingFromAsyncFunc(async c=>{const u=this.owner.owner,{finalModelUriReact:d}=u;if(!d.value)return;const p=await c.promise(r());if(!p)return;const[f,m,g]=p;this._nativePrimitive=this.disposeVar(new CP(g,f,this)),this._nativePrimitive.update(),this.owner.owner.gltf=g})).start();{const c=()=>{this.nativePrimitive&&this.nativePrimitive.update()};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(n.showChanged,n.clampAnimationsChanged,n.shadowsChanged,n.debugShowBoundingVolumeChanged,n.debugWireframeChanged,n.backFaceCullingChanged,n.heightReferenceChanged,n.distanceDisplayConditionChanged,n.colorChanged,n.colorBlendModeChanged,n.silhouetteColorChanged,n.colorBlendAmountChanged,n.silhouetteSizeChanged,n.activeAnimationsChanged,n.activeAnimationsAnimateWhilePausedChanged,n.nodeTransformationsChanged,n.nativeMinimumPixelSizeChanged,n.nativeMaximumScaleChanged,n.nativeScaleChanged,n.environmentMapManagerChanged,n.imageBasedLightingFactorChanged,o));this.dispose(u.disposableOn(c))}}get owner(){return this._owner}get nativePrimitive(){return this._nativePrimitive}}class TP extends a.Destroyable{constructor(i){super(),this._owner=i;const{owner:e}=this,{finalModelUriReact:n,finalSpecularEnvironmentMapsReact:o}=e,s=this.disposeVar(a.createNextAnimateFrameEvent(n.changed,e.basePathChanged,e.allowPickingChanged,e.incrementallyLoadTexturesChanged,e.showOutlineChanged,e.asynchronousChanged,e.creditChanged,e.forwardAxisChanged,e.upAxisChanged,e.lightColorChanged,e.sphericalHarmonicCoefficientsChanged,o.changed,e.customShaderInstanceClassChanged,e.opaquePassChanged,e.gltfJsonChanged,e.resetEvent));this.disposeVar(new a.ObjResettingWithEvent(s,()=>new AP(this)))}get owner(){return this._owner}}const wu={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Qs=class Qs extends a.Destroyable{constructor(e,n){super();v(this,"_readyEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_customShaderInstanceClass",this.disposeVar(a.react(void 0)));v(this,"_updateCustomShaderEvent",this.disposeVar(new a.Event));v(this,"_activeAnimations",this.disposeVar(a.reactDeepArrayWithUndefined(void 0,(e,n)=>e.animationTime===n.animationTime&&e.delay===n.delay&&e.index===n.index&&e.loop===n.loop&&e.multiplier===n.multiplier&&e.name===n.name&&e.removeOnStop===n.removeOnStop&&e.reverse===n.reverse&&h.JulianDate.equals(e.startTime,n.startTime)&&h.JulianDate.equals(e.stopTime,n.stopTime)&&!0,e=>({...e}))));v(this,"_primitive");v(this,"_customShaderInstance");v(this,"_gltf",this.disposeVar(a.react(void 0)));v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_sceneScaleFromPixelSize",this.disposeVar(a.react(void 0)));v(this,"_finalShowReact",this.disposeVar(a.react(!0)));v(this,"_finalModelUriReact");v(this,"_finalSpecularEnvironmentMapsReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"specularEnvironmentMaps"])));v(this,"_id",this.disposeVar(a.react(void 0)));v(this,"_setMaterialEvent",this.disposeVar(new a.Event));v(this,"_resetEvent",this.disposeVar(new a.Event));v(this,"_printDebugInfoEvent",this.disposeVar(new a.Event));v(this,"_smoothMoving",this.disposeVar(new qm));v(this,"_smoothMovingBinding",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.position=this._smoothMoving.currentPosition)));v(this,"_smoothMovingBinding2",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.rotation=[this._smoothMoving.currentHeading??0,this.rotation&&this.rotation[1]||0,this.rotation&&this.rotation[2]||0])));this._czmViewer=e,n&&(this.id=n),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Zn(this.czmViewer,[this,"viewDistanceRange"],[this,"position"])),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._finalModelUriReact=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"url"],Qs.defaultUrl)),this.disposeVar(new TP(this));const o=e.viewer;if(!o)return;const s=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};s(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(s));{const l=()=>{if(!this.activeAnimationsJson){this.activeAnimations=void 0;return}this.activeAnimations=this.activeAnimationsJson.map(c=>{let u;try{u=c.animationTime&&Function(`"use strict";return (${c.animationTime})`)()}catch(d){console.error(`animationTimeStr eval error: ${d}`,d),u=void 0}return{name:c.name,index:c.index,startTime:c.startTime!==void 0&&h.JulianDate.fromDate(new Date(c.startTime))||void 0,delay:c.delay,stopTime:c.stopTime!==void 0&&h.JulianDate.fromDate(new Date(c.stopTime))||void 0,removeOnStop:c.removeOnStop,multiplier:c.multiplier,reverse:c.reverse,loop:c.loop&&h.ModelAnimationLoop[c.loop],animationTime:u}})};l(),this.activeAnimationsJsonChanged.disposableOn(l)}{const l=()=>this._finalShowReact.value=(this.show??!0)&&this.visibleAlpha>0;l(),this.dispose(this.showChanged.disposableOn(l)),this.dispose(this.visibleAlphaChanged.disposableOn(l))}const{sceneScaleFromPixelSize:r}=this;{const l=()=>{let c;if(this.position&&this.pixelSize){const u=h.Cartesian3.fromDegrees(...this.position);u&&(c=Bi(o.scene,u,this.pixelSize),c&&(this.maximumScale!==void 0&&c>this.maximumScale&&(c=this.maximumScale),this.minimumScale!==void 0&&c<this.minimumScale&&(c=this.minimumScale)))}r.value=c};l(),this.dispose(o.scene.preUpdate.addEventListener(l))}this.dispose(this.flyToEvent.disposableOn(l=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}if(this._primitive&&this._primitive.ready&&this._primitive.boundingSphere){const{center:c,radius:u}=this._primitive._boundingSphere;h.Matrix4.multiplyByPoint(this._primitive.modelMatrix,c,new h.Cartesian3);const d=u*3;se(o,this.position,d,void 0,l)}else{const c=o.scene.camera.positionCartographic.height;se(o,this.position,c,void 0,l)}})),this.dispose(this.updateCustomShaderEvent.disposableOn(l=>{this._customShaderInstance&&l(this._customShaderInstance,this,this.czmViewer)}))}get readyEvent(){return this._readyEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get activeAnimations(){return this._activeAnimations.value}get activeAnimationsChanged(){return this._activeAnimations.changed}set activeAnimations(e){this._activeAnimations.value=e}setPrimitive(e){this._primitive=e}get primitive(){return this._primitive}get gltf(){return this._gltf.value}set gltf(e){this._gltf.value=e}get gltfChanged(){return this._gltf.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get sceneScaleFromPixelSize(){return this._sceneScaleFromPixelSize}get finalShow(){return this._finalShowReact.value}get finalModelUriReact(){return this._finalModelUriReact}get finalSpecularEnvironmentMapsReact(){return this._finalSpecularEnvironmentMapsReact}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}get resetEvent(){return this._resetEvent}reset(){this._resetEvent.emit()}get ready(){return!!this._primitive&&this._primitive.ready}async openLocalDir(){const e=await a.defaultGetLocalFilePath(["gltf","glb"],"gltf");this.url=e}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}setNodeTranslation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s))){console.error(`setNodeTranslation error: translation.length !== 3 || translation.some(e => !Number.isFinite(e)): ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,translationX:n[0],translationY:n[1],translationZ:n[2]}}}getNodeTranslation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}setNodeRotation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s))){console.error(`setNodeTranslation error: rotation.length !== 3 || rotation.some(e => !Number.isFinite(e)) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}setNodeScale(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...wu};if(n.length!==3||n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeTranslation error: scale.length !== 3 || scale.some(e => !Number.isFinite(e) || e < 0) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}smoothMove(e,n){this.position||(this.position=e),this._smoothMoving.restart(this.position,0),this._smoothMoving.restart(e,n)}};v(Qs,"defaultUrl","${earthsdk3-assets-script-dir}/assets/glb/building.glb"),v(Qs,"defaultSpecularEnvironmentMaps","${earthsdk3-assets-script-dir}/assets/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx2"),v(Qs,"defaults",{activeAnimationsAnimateWhilePaused:!1,viewDistanceRange:[1e3,1e4,3e4,6e4],imageBasedLightingFactor:[1,1]});let rt=Qs;(t=>{t.createDefaultProps=()=>({show:void 0,url:void 0,allowPicking:void 0,allowPickingDepth:!0,maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),scale:a.reactArrayWithUndefined(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),modelMatrix:a.reactArrayWithUndefined(void 0),forwardAxis:void 0,upAxis:void 0,color:a.reactArrayWithUndefined(void 0),silhouetteColor:a.reactArrayWithUndefined(void 0),shadows:void 0,credit:void 0,basePath:void 0,gltfJson:a.reactJson(void 0),heightReference:void 0,distanceDisplayCondition:void 0,colorBlendMode:void 0,incrementallyLoadTextures:void 0,asynchronous:void 0,clampAnimations:void 0,debugShowBoundingVolume:void 0,debugWireframe:void 0,backFaceCulling:void 0,showOutline:void 0,colorBlendAmount:void 0,silhouetteSize:void 0,imageBasedLightingFactor:a.reactArrayWithUndefined(void 0),lightColor:void 0,environmentMapManager:a.reactJsonWithUndefined(void 0),sphericalHarmonicCoefficients:void 0,specularEnvironmentMaps:void 0,customShaderInstanceClassStr:void 0,activeAnimationsJson:a.reactJsonWithUndefined(void 0),activeAnimationsAnimateWhilePaused:void 0,nodeTransformations:a.reactJsonWithUndefined(void 0),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,nativeMinimumPixelSize:0,nativeMaximumScale:void 0,nativeScale:1,opaquePass:"OPAQUE",instances:a.reactArrayWithUndefined(void 0)})})(rt||(rt={})),a.extendClassProps(rt.prototype,rt.createDefaultProps);const MP={id:"e80d8802-e7dc-40d6-8cff-cfe3a12c8763",type:"CzmCustomPrimitive",show:!0,allowPicking:!0,cull:!1,pass:"OVERLAY",vertexShaderSource:`in vec3 position;
|
|
117
117
|
in vec2 st;
|
|
118
118
|
uniform sampler2D u_image;
|
|
119
119
|
out vec2 v_st;
|
|
@@ -316,14 +316,14 @@ ${sv}
|
|
|
316
316
|
// out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
317
317
|
// #endif
|
|
318
318
|
}
|
|
319
|
-
`;o.vertexShaderSource=s,o.fragmentShaderSource=r;const l={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};o.renderState=l;const c=()=>{this.czmTextureId?o.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:o.uniformMap={myImage:{type:"image",uri:a.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([o,"position"],[this,"position"]));{const p=()=>{o.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(a.track([o,"maximumScale"],[this,"maximumScale"])),this.dispose(a.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(a.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const u=()=>{const{scale:p=[1,1]}=this;o.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};u(),this.dispose(this.scaleChanged.disposableOn(u));const d=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),f=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];o.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?f:p:0,this.useAxis.includes("Z")?f:0],o.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const f={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},m={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};o.attributes={position:{typedArray:new Float32Array(f[this.useAxis??Jr.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},o.boundingVolume={type:"LocalAxisedBoundingBox",data:m[this.useAxis??Jr.defaults.useAxis]},d()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(d)),this.dispose(this.sizeChanged.disposableOn(d)),this.dispose(this.flyToEvent.disposableOn(p=>{o.flyTo(p)})),this.disposeVar(new a.ObjResettingWithEvent(this.rotationModeChanged,()=>new bb(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};v(Jr,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Gi=Jr;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:a.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:a.reactArray([1,1,1,1]),originRatioAndOffset:a.reactArray([.5,1,0,0]),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Gi||(Gi={})),a.extendClassProps(Gi.prototype,Gi.createDefaultProps);class bb extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,this._czmImageModel=e;const{customPrimitive:n,rotationMode:o}=this._czmImageModel;if(o==="WithProp")this.dispose(a.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(o==="WithCameraOnlyZ"){const s=()=>{const{rotation:r}=this._czmImageModel,l=this._czmViewer.getCameraInfo();l&&(n.rotation=[l.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),r[1],r[2]])};s(),this.dispose(this._czmViewer.cameraChanged.disposableOn(s)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(s))}else if(o==="WithCamera"){const s=()=>{const r=this._czmViewer.getCameraInfo();if(!r)return;const l=r.rotation;n.rotation=[l[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),l[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),l[2]]};s(),this.dispose(this._czmViewer.cameraChanged.disposableOn(s)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(s))}}}class ns extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;const r=this.disposeVar(ai([this,"material"])),l=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,r.changed)),c=this.disposeVar(new a.ObjResettingWithEvent(l,()=>{if(r.value)return new Sb(e,o,this,r.value)}));this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&(l.flush(),c.obj&&c.obj.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:a.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(ns||(ns={})),a.extendClassProps(ns.prototype,ns.createDefaultProps);class Sb extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_boundingSphere",(()=>{const e=this._sceneObject;this._material;const n=new h.BoundingSphere;if(!e.polygonHierarchy)return;const o=ht(e.polygonHierarchy.positions);if(o.length<3){n.radius=-1;return}return h.BoundingSphere.fromPoints(o,n),n})());this._czmViewer=e,this._viewer=n,this._sceneObject=o,this._material=s;const r=this._sceneObject,l=this._material,c=this._viewer;if(!r.polygonHierarchy)return;const u=new h.MaterialAppearance({material:l}),d=[],p=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Vi(r.polygonHierarchy),stRotation:r.stRotation&&h.Math.toRadians(r.stRotation),arcType:r.arcType&&h.ArcType[r.arcType],height:r.height,extrudedHeight:r.extrudedHeight,perPositionHeight:r.perPositionHeight,closeTop:r.closeTop,closeBottom:r.closeBottom,ellipsoid:r.ellipsoid&&_e(r.ellipsoid),granularity:r.granularity!==void 0?h.Math.toRadians(r.granularity):void 0}),id:this});d.push(p);const f=new h.GroundPrimitive({geometryInstances:d,appearance:u,asynchronous:!1,allowPicking:r.allowPicking,compressVertices:!1});h.GroundPrimitive.prototype&&(f.ESSceneObjectID=o.id),c.scene.primitives.add(f),this.dispose(()=>c.scene.primitives.remove(f));{const m=()=>{f.show=r.show};m(),this.dispose(r.showChanged.disposableOn(m))}this.disposeVar(new De.ObjectsToExcludeWrapper(this._czmViewer,f))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const o=le(n.center);o&&se(this._viewer,o,n.radius*4,void 0,e)}}}class xb extends a.Destroyable{constructor(e,n){super();v(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new ns(n,e.id));const o=this._groundPolygonPrimitive;{const s=()=>{const l=e.show,c=e.fill;o.show=l&&c&&e.visibleAlpha>0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.material={type:"Color",color:e.color||[1,1,1,.5]}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(r.disposableOn(s))}this.dispose(a.track([o,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class Eb extends a.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ae(n,e.id));const s=this._geoPolyline;s.arcType="GEODESIC",s.loop=!0;{const r=()=>{const c=e.show,u=e.outline;if(s.show=c&&u&&e.visibleAlpha>0,s.show&&e.positions&&e.positions.length>1){const d=e.positions[0][2];s.positions=e.positions.map(p=>[p[0],p[1],d])}else s.positions=void 0;s.color=e.outlineColor,s.width=e.outlineWidth};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class Ab extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new xb(e,n)),this._bottomPolyline=this.disposeVar(new Eb(e,n,o)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class wn extends a.Destroyable{constructor(e,n){super();v(this,"_positions",this.disposeVar(a.reactPositions(void 0)));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"])),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=m=>{if(!this.polygonHierarchy)return;const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Vi(this.polygonHierarchy),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),arcType:this.arcType&&h.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:this.granularity!==void 0?h.Math.toRadians(this.granularity):void 0}),id:this});y.push(_);const P=new h.Primitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=new h.BoundingSphere,u=()=>{if(r(),!this.polygonHierarchy)return;const m=ht(this.polygonHierarchy.positions);if(m.length<3||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(m,c),this._primitive=l(s.value),this._primitive&&o.scene.primitives.add(this._primitive)},d=()=>{const m=this.show??!0;this._primitive&&(this._primitive.show=m)};u(),d();const p=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed));this.dispose(p.disposableOn(()=>{u(),d()}));const f=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&(p.flush(),f.flush(),c.radius>0)){const g=le(c.center),y=this.height??0,_=this.extrudedHeight??0,P=Math.max(y,_),w=c.radius<P?P:c.radius;g&&se(o,g,w*4,void 0,m)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(wn,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(wn||(wn={})),a.extendClassProps(wn.prototype,wn.createDefaultProps);class uv extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new wn(n,e.id));const r=this._czmInnerPolygonPrimitive;{const l=()=>{const u=e.show,d=e.fill;if(r.show=u&&d&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!s?r.height=e.positions[0][2]:r.height=void 0,r.polygonHierarchy=r.show?{positions:e.positions||[]}:{positions:[]},r.material={type:"Color",color:e.color||[1,1,1,.5]},o){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");r.extrudedHeight=(r.height??0)+e.depth}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(c.disposableOn(l))}this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class dv extends a.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ae(n,e.id));const s=this._geoPolyline;s.arcType="GEODESIC",s.loop=!0,this.dispose(a.bind([s,"depthTest"],[e,"depthTest"])),this.dispose(a.bind([s,"ground"],[e,"strokeGround"]));{const r=()=>{const c=e.show,u=e.outline;if(s.show=c&&u&&e.visibleAlpha>0,s.show&&e.positions&&e.positions.length>1){const d=e.positions[0][2];s.positions=e.positions.map(p=>[p[0],p[1],d])}else s.positions=void 0;s.color=e.outlineColor,s.width=e.outlineWidth};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class Tb extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new li(e,i.id));n.arcType="GEODESIC",this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const r=i.show,l=i.outline;n.show=r&&l&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const d=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],d])}let u;if(i.positions&&i.positions.length>0?u=i.positions[0][2]:u=void 0,n.show&&c){const d=u,p=(u??0)+i.depth;n.positions=c.map(f=>[[f[0],f[1],d],[f[0],f[1],p]])}else n.positions=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(s.disposableOn(o))}}}class Mb extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new Ae(e,i.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const r=i.show,l=i.outline;n.show=r&&l&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const d=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],d])}let u;if(i.positions&&i.positions.length>0?u=i.positions[0][2]:u=void 0,n.show&&c){const d=(u??0)+i.depth;n.positions=c.map(p=>[p[0],p[1],d])}else n.positions=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(s.disposableOn(o))}}}class Ib extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new uv(e,n,!0,o)),this._bottomPolyline=this.disposeVar(new dv(e,n,o)),this.disposeVar(new Tb(e,n)),this.disposeVar(new Mb(e,n)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Db extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new uv(e,n,!1,o)),this._bottomPolyline=this.disposeVar(new dv(e,n,o)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Cn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_polygonOrGroundPolygonResetting");v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_positionsCenter");this._positionsCenter=this.ad(new ru(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Zn(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new a.ObjResettingWithEvent(o,()=>this.ground?new Ab(this,e):this.depth!==void 0&&this.depth>0?new Ib(this,e):new Db(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}v(Cn,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Cn||(Cn={})),a.extendClassProps(Cn.prototype,Cn.createDefaultProps);class fr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"])),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=(f,m)=>{const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,height:this.height,rotation:this.rotation&&h.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(_);const P=new h.Primitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=We(this.positions);!f||!s.value||(this._primitive=l(f,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,s.changed,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),positions:a.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(fr||(fr={})),a.extendClassProps(fr.prototype,fr.createDefaultProps);const Rh=class Rh extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"],Rh.defaults.material)),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=(f,m)=>{const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,rotation:this.rotation&&h.Math.toRadians(this.rotation),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(_);const P=new h.GroundPrimitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=We(this.positions);!f||!s.value||(this._primitive=l(f,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,s.changed,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,0);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Rh,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let ao=Rh;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),positions:a.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(ao||(ao={})),a.extendClassProps(ao.prototype,ao.createDefaultProps);class gr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const r=new h.Color,l=f=>{const m=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],y=new h.GeometryInstance({geometry:new h.RectangleOutlineGeometry({rectangle:f,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&h.Math.toRadians(this.rotation)}),attributes:{color:this.color?h.ColorGeometryInstanceAttribute.fromColor(te(this.color,r)):h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,1,1,1))},id:this});g.push(y);const _=new h.Primitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(_.ESSceneObjectID=n),_},c=()=>{if(s(),!this.positions)return;const f=We(this.positions);f&&(this._primitive=l(f),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:a.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:a.reactArrayWithUndefined(void 0)})})(gr||(gr={})),a.extendClassProps(gr.prototype,gr.createDefaultProps);const jr=class jr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new fr(e,n)),r=this.ad(new ao(e,n)),l=this.ad(new gr(e,n));this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const d=this.show??!0,p=this.ground??!1,f=this.outline??!1;l.show=d&&!p&&f,s.show=d&&!p,l.show?l.positions=this.rectangle:l.positions=void 0,s.show?s.positions=this.rectangle:s.positions=void 0,l.rotation=s.rotation=this.rotation,s.material=this.material??jr.defaults.material,s.stRotation=this.stRotation,l.extrudedHeight=s.extrudedHeight=this.extrudedHeight,l.height=s.height=this.height,l.color=this.outlineColor,l.translucent=this.outlineTranslucent,r.show=d&&p,r.show?r.positions=this.rectangle:r.positions=void 0,r.rotation=this.rotation,r.material=this.material??jr.defaults.material,r.stRotation=this.stRotation};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(d=>{this.ground?r.flyTo(d):s.flyTo(d)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(jr,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let wi=jr;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:a.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:a.reactJsonWithUndefined(void 0),rectangle:a.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(wi||(wi={})),a.extendClassProps(wi.prototype,wi.createDefaultProps);const ea=class ea extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=this.disposeVar(ai([this,"material"])),r=(p,f)=>{if(!p||!this.radius)return;const m=new h.MaterialAppearance({material:f}),g=[],y=()=>{let A=this.granularity??ea.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),h.Math.toRadians(A)},_=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,height:this.height,extrudedHeight:this.extrudedHeight,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:y()}),id:this}),P=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),w=Re({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!w||!P){console.warn("modelMatrix is undefined!");return}const b=h.Matrix4.inverseTransformation(P,new h.Matrix4);h.Matrix4.multiply(w,b,_.modelMatrix),g.push(_);const x=new h.Primitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??ea.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(x.ESSceneObjectID=n),x},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Be(this.position);!p||!s.value||(this._primitive=r(p,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,s.changed,this.rotationChanged));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ea,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let _n=ea;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJson({type:"Color"}),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0})})(_n||(_n={})),a.extendClassProps(_n.prototype,_n.createDefaultProps);const Fo=class Fo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=this.disposeVar(ai([this,"material"],Fo.defaults.material)),r=(p,f)=>{if(!p||!this.radius)return;const m=new h.MaterialAppearance({material:f}),g=[],y=()=>{let w=this.granularity??Fo.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),w=w|0,w=Math.max(1,w),h.Math.toRadians(w)},_=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),granularity:y(),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&_e(this.ellipsoid)}),id:this});g.push(_);const P=new h.GroundPrimitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??Fo.defaults.allowPicking,compressVertices:!1});return h.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position||!this.radius||!s.value)return;const p=Be(this.position);this._primitive=r(p,s.value),this._primitive&&o.scene.primitives.add(this._primitive)},c=()=>{const p=this.show??Fo.defaults.show;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,s.changed));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Fo,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Pn=Fo;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),granularity:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0})})(Pn||(Pn={})),a.extendClassProps(Pn.prototype,Pn.createDefaultProps);const ta=class ta extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=new h.Color,r=p=>{if(!p||!this.radius)return;const f=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],g=h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE),y=()=>{let A=this.granularity??ta.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),h.Math.toRadians(A)},_=new h.GeometryInstance({geometry:new h.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:y(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?h.ColorGeometryInstanceAttribute.fromColor(te(this.outlineColor,s)):g},id:this}),P=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),w=Re({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!w||!P){console.warn("modelMatrix is undefined!");return}const b=h.Matrix4.inverseTransformation(P,new h.Matrix4);h.Matrix4.multiply(w,b,_.modelMatrix),m.push(_);const x=new h.Primitive({geometryInstances:m,appearance:f,asynchronous:!1,allowPicking:this.allowPicking??ta.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(x.ESSceneObjectID=n),x},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Be(this.position);p&&(this._primitive=r(p),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ta,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let bn=ta;(t=>{t.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:a.reactArrayWithUndefined(void 0),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(bn||(bn={})),a.extendClassProps(bn.prototype,bn.createDefaultProps);class lo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new _n(e,n)),r=this.ad(new Pn(e,n)),l=this.ad(new bn(e,n));this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([l,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const d=this.show??!0,p=this.ground??!1,f=this.outline??!1;l.show=d&&!p&&f,s.show=d&&!p,l.show?l.position=this.position:l.position=void 0,s.show?s.position=this.position:s.position=void 0,s.rotation=l.rotation=this.rotation,l.radius=s.radius=this.radius,l.extrudedHeight=s.extrudedHeight=this.extrudedHeight,this.position&&(l.height=s.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),s.granularity=l.granularity=this.granularity,s.ellipsoid=l.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation,l.outlineColor=this.outlineColor,l.translucent=this.outlineTranslucent,l.numberOfVerticalLines=this.numberOfVerticalLines,r.show=d&&p,r.show?r.position=this.position:r.position=void 0,r.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),r.granularity=1):r.granularity=this.granularity,r.rotation=this.rotation,r.ellipsoid=this.ellipsoid,r.material=this.material,r.stRotation=this.stRotation};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(u.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(d=>{this.ground?r.flyTo(d):s.flyTo(d)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(lo,"defaults",{extrudedHeight:void 0}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:a.reactArray([1,1,1,1]),material:a.reactJson({type:"Color",color:[1,1,1,.5]}),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:a.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0})})(lo||(lo={})),a.extendClassProps(lo.prototype,lo.createDefaultProps);class mr extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;const r=h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),l=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(l);const c=()=>{const b={baseWaterColor:te(this.waterColor),normalMap:r,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new h.Material({fabric:{type:"Water",uniforms:b}})},u=()=>{if(!this.points)return;const b={positions:this.points},x=new h.PolygonGeometry({polygonHierarchy:Vi(b),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new h.GeometryInstance({geometry:x,id:this})},d=()=>{if(!this.points)return;const b=new h.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),x=u();let A;return this.ground??!1?A=new h.GroundPrimitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):A=new h.Primitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),h.Primitive.prototype&&h.GroundPrimitive.prototype&&(A.ESSceneObjectID=n),A},p=new h.BoundingSphere,f=()=>{l(),m(p),this._primitive=d(),this._primitive&&o.scene.primitives.add(this._primitive)},m=b=>{if(!this.points)return;const x=ht(this.points);if(x.length<3){b.radius=-1;return}h.BoundingSphere.fromPoints(x,b)},g=()=>{const b=this.show??!0;this._primitive&&(this._primitive.show=b)},y=()=>{f(),g()};y();let _=a.debounce(y,500);const P=this.dv(a.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(P.don(y));const w=this.dv(a.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(w.don(()=>{if(!this.points){l();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=u(),m(p),_&&_[0]()):y()})),this.d(this.showChanged.don(g)),this.d(this.flyToEvent.don(b=>{if(p.radius>0){const x=le(p.center);x&&se(o,x,p.radius*4,void 0,b)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:a.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:a.reactJsonWithUndefined(void 0),flowSpeed:0})})(mr||(mr={})),a.extendClassProps(mr.prototype,mr.createDefaultProps);class co extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_updateBoundingSphereEvent",this.ad(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=new h.BoundingSphere,r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(r);const l=b=>a.ESSceneObject.context.getStrFromEnv(b),c=()=>{this._primitive=new h[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:f()}),h.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),o.scene.primitives.add(this._primitive)},u=()=>{var M;const b=l(this.normalMap??h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),x={baseWaterColor:te(this.waterColor??[.25,.6,1,.7]),normalMap:b,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(x.blendColor=te(this.blendColor)),this.specularMap&&(x.specularMap=l(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:D,minPos:L}=a.getMinMaxCorner(this.points),V=a.getDistancesFromPositions([L,[D[0],D[1],L[2]]],"GEODESIC")[0],O=a.getDistancesFromPositions([L,[L[0],D[1],D[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(x.baseWaterImage=l(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(x.repeatX=V/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(x.repeatY=O/this.baseWaterImage.vDis)),x.flowSpeed=this.flowSpeed/(((M=this.baseWaterImage)==null?void 0:M.uDis)??V)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,x);return}const A=new h.EllipsoidSurfaceAppearance({material:Um(x),aboveGround:!0});this._primitive&&(this._primitive.appearance=A)},d=this.ad(a.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(d.don(u));const p=b=>{if(!this.points)return;const x=ht(this.points);if(x.length<3){b.radius=-1;return}h.BoundingSphere.fromPoints(x,b)},f=()=>{if(!this.points||this.points.length<3)return;const{minPos:b}=a.getMinMaxCorner(this.points),[x]=Et({originPosition:b},this.points),{minPos:A,maxPos:M}=a.getMinMaxCorner(x),D=M[0]-A[0],L=M[1]-A[1],V={positions:this.points},O=new h.PolygonGeometry({polygonHierarchy:Vi(V),vertexFormat:h.VertexFormat.DEFAULT,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x.map(U=>[h.Math.clamp(U[0]/D,0,1),h.Math.clamp(U[1]/L,0,1)]).flat())})}});return new h.GeometryInstance({id:this,geometry:O})},m=()=>{this._primitive&&(this._primitive.show=this.show??!0)},g=this.ad(a.createNextAnimateFrameEvent(this.showChanged));this.ad(g.don(m));const y=this.ad(()=>{r(),c(),m(),u(),p(s)});y();const _=this.ad(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(_.don(y)),this.ad(new a.ObjResettingWithEvent(this.updateBoundingSphereEvent,b=>{const x=new a.Destroyable;return b?x.ad(o.scene.preUpdate.addEventListener(()=>{const A=o.camera;o.camera.frustum.computeCullingVolume(A.position,A.direction,A.up).computeVisibility(s)===h.Intersect.OUTSIDE&&y()})):(y(),x.ad(this.pointsChanged.don(y))),x}));const P=()=>{if(!this.points||this.points.length<3){y();return}this._primitive instanceof h.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=f(),this._primitive._recomputeBoundingSpheres=!0},w=this.dv(a.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(w.don(P)),this.d(this.flyToEvent.don(b=>{if(s.radius>0){const x=le(s.center);x&&se(o,x,s.radius*4,void 0,b)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:a.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:a.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:a.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(co||(co={})),a.extendClassProps(co.prototype,co.createDefaultProps);class ho extends a.Destroyable{constructor(e,n){super();v(this,"pointPrimitives");v(this,"_flyToEvent",this.dv(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;let{pointPrimitives:r}=this;const l=()=>{r&&(r.removeAll(),o.scene.primitives.remove(r),r=void 0)};this.d(l);const c=()=>{const g=new h.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(_=>{g.add({show:_.show??!0,color:_.color&&te(_.color),disableDepthTestDistance:_.disableDepthTestDistance,distanceDisplayCondition:_.distanceDisplayCondition&&sr(_.distanceDisplayCondition),outlineColor:_.outlineColor&&te(_.outlineColor),outlineWidth:_.outlineWidth,pixelSize:_.pixelSize,position:_.position&&Be(_.position),scaleByDistance:_.scaleByDistance&&ln(_.scaleByDistance),translucencyByDistance:_.translucencyByDistance&&ln(_.translucencyByDistance)})}),h.PointPrimitiveCollection.prototype&&(g.ESSceneObjectID=n)),g},u=()=>{l(),r=c(),o.scene.primitives.add(r)};u();const d=this.dv(a.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{r&&(r.show=this.show??!0,r.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,r.blendOption=(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(d.don(p));const f=this.dv(a.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(f.don(u));const m=new h.BoundingSphere;this.d(this.flyToEvent.don(g=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(d.flush(),f.flush(),this.pointPrimitiveOptions.length===1){const y=this.pointPrimitiveOptions[0].position;if(!y)return;const _=o.scene.camera.positionCartographic.height;se(o,y,_,void 0,g)}else{const y=this.pointPrimitiveOptions,_=[];y.forEach(w=>{w.position&&_.push(w.position)});const P=ht(_);if(h.BoundingSphere.fromPoints(P,m),m.radius>0){const w=le(m.center);w&&se(o,w,m.radius*4,void 0,g)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),scale:a.reactArrayWithUndefined(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),modelMatrix:a.reactArrayWithUndefined(void 0)})})(ho||(ho={})),a.extendClassProps(ho.prototype,ho.createDefaultProps);class Rb extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const o=ue.czmJulianDateToTimeStamp,s=ue.getClockRange,r=ue.getClockStep;{const l=()=>n.clockViewModel.startTime=h.JulianDate.fromDate(new Date(i.startTime??a.getDefaultValue(ue.defaults.startTime)));l(),this.dispose(gi(n.clockViewModel,"startTime",c=>i.startTime=o(c))),this.dispose(i.startTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.stopTime=h.JulianDate.fromDate(new Date(i.stopTime??a.getDefaultValue(ue.defaults.stopTime)));l(),this.dispose(gi(n.clockViewModel,"stopTime",c=>i.stopTime=o(c))),this.dispose(i.stopTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(i.currentTime??a.getDefaultValue(ue.defaults.currentTime)));l(),this.dispose(gi(n.clockViewModel,"currentTime",c=>i.currentTime=o(c))),this.dispose(i.currentTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.multiplier=i.multiplier??ue.defaults.multiplier;l(),this.dispose(gi(n.clockViewModel,"multiplier",c=>{(i.multiplier??ue.defaults.multiplier!==c)&&(i.multiplier=c)})),this.dispose(i.currentTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.clockStep=h.ClockStep[i.clockStep??ue.defaults.clockStep];l(),this.dispose(gi(n.clockViewModel,"clockStep",c=>{const u=r(c);(i.clockStep??ue.defaults.clockStep!==u)&&(i.clockStep=u)})),this.dispose(i.clockStepChanged.disposableOn(l))}{const l=()=>n.clockViewModel.clockRange=h.ClockRange[i.clockRange??ue.defaults.clockRange];l(),this.dispose(gi(n.clockViewModel,"clockRange",c=>{const u=s(c);(i.clockRange??ue.defaults.clockRange!==u)&&(i.clockRange=u)})),this.dispose(i.clockRangeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.shouldAnimate=i.shouldAnimate??ue.defaults.shouldAnimate;l(),this.dispose(gi(n.clockViewModel,"shouldAnimate",c=>{(i.shouldAnimate??ue.defaults.shouldAnimate!==c)&&(i.shouldAnimate=c)})),this.dispose(i.shouldAnimateChanged.disposableOn(l))}}}const zo=class zo extends a.Destroyable{constructor(i){super(),this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??zo.defaults.enabled)return new Rb(this,i)}))}};v(zo,"czmJulianDateToTimeStamp",Fb),v(zo,"getClockRange",zb),v(zo,"getClockStep",Lb),v(zo,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let ue=zo;(t=>{t.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(ue||(ue={})),a.extendClassProps(ue.prototype,ue.createDefaultProps);function Fb(t){return h.JulianDate.toDate(t).getTime()}function zb(t){if(t===h.ClockRange.CLAMPED)return"CLAMPED";if(t===h.ClockRange.LOOP_STOP)return"LOOP_STOP";if(t===h.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${t}`)}function Lb(t){if(t===h.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(t===h.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(t===h.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${t}`)}function T(t){return t!=null}function G(t){this.name="DeveloperError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}T(Object.create)&&(G.prototype=Object.create(Error.prototype),G.prototype.constructor=G),G.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return T(this.stack)&&(t+=`
|
|
319
|
+
`;o.vertexShaderSource=s,o.fragmentShaderSource=r;const l={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};o.renderState=l;const c=()=>{this.czmTextureId?o.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:o.uniformMap={myImage:{type:"image",uri:a.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([o,"position"],[this,"position"]));{const p=()=>{o.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(a.track([o,"maximumScale"],[this,"maximumScale"])),this.dispose(a.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(a.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const u=()=>{const{scale:p=[1,1]}=this;o.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};u(),this.dispose(this.scaleChanged.disposableOn(u));const d=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),f=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];o.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?f:p:0,this.useAxis.includes("Z")?f:0],o.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const f={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},m={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};o.attributes={position:{typedArray:new Float32Array(f[this.useAxis??Jr.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},o.boundingVolume={type:"LocalAxisedBoundingBox",data:m[this.useAxis??Jr.defaults.useAxis]},d()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(d)),this.dispose(this.sizeChanged.disposableOn(d)),this.dispose(this.flyToEvent.disposableOn(p=>{o.flyTo(p)})),this.disposeVar(new a.ObjResettingWithEvent(this.rotationModeChanged,()=>new bb(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};v(Jr,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Gi=Jr;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:a.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:a.reactArray([1,1,1,1]),originRatioAndOffset:a.reactArray([.5,1,0,0]),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Gi||(Gi={})),a.extendClassProps(Gi.prototype,Gi.createDefaultProps);class bb extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,this._czmImageModel=e;const{customPrimitive:n,rotationMode:o}=this._czmImageModel;if(o==="WithProp")this.dispose(a.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(o==="WithCameraOnlyZ"){const s=()=>{const{rotation:r}=this._czmImageModel,l=this._czmViewer.getCameraInfo();l&&(n.rotation=[l.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),r[1],r[2]])};s(),this.dispose(this._czmViewer.cameraChanged.disposableOn(s)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(s))}else if(o==="WithCamera"){const s=()=>{const r=this._czmViewer.getCameraInfo();if(!r)return;const l=r.rotation;n.rotation=[l[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),l[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),l[2]]};s(),this.dispose(this._czmViewer.cameraChanged.disposableOn(s)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(s))}}}class ns extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;const r=this.disposeVar(ai([this,"material"])),l=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,r.changed)),c=this.disposeVar(new a.ObjResettingWithEvent(l,()=>{if(r.value)return new Sb(e,o,this,r.value)}));this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&(l.flush(),c.obj&&c.obj.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:a.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(ns||(ns={})),a.extendClassProps(ns.prototype,ns.createDefaultProps);class Sb extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_boundingSphere",(()=>{const e=this._sceneObject;this._material;const n=new h.BoundingSphere;if(!e.polygonHierarchy)return;const o=ht(e.polygonHierarchy.positions);if(o.length<3){n.radius=-1;return}return h.BoundingSphere.fromPoints(o,n),n})());this._czmViewer=e,this._viewer=n,this._sceneObject=o,this._material=s;const r=this._sceneObject,l=this._material,c=this._viewer;if(!r.polygonHierarchy)return;const u=new h.MaterialAppearance({material:l}),d=[],p=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Vi(r.polygonHierarchy),stRotation:r.stRotation&&h.Math.toRadians(r.stRotation),arcType:r.arcType&&h.ArcType[r.arcType],height:r.height,extrudedHeight:r.extrudedHeight,perPositionHeight:r.perPositionHeight,closeTop:r.closeTop,closeBottom:r.closeBottom,ellipsoid:r.ellipsoid&&_e(r.ellipsoid),granularity:r.granularity!==void 0?h.Math.toRadians(r.granularity):void 0}),id:this});d.push(p);const f=new h.GroundPrimitive({geometryInstances:d,appearance:u,asynchronous:!1,allowPicking:r.allowPicking,compressVertices:!1});h.GroundPrimitive.prototype&&(f.ESSceneObjectID=o.id),c.scene.primitives.add(f),this.dispose(()=>c.scene.primitives.remove(f));{const m=()=>{f.show=r.show};m(),this.dispose(r.showChanged.disposableOn(m))}this.disposeVar(new De.ObjectsToExcludeWrapper(this._czmViewer,f))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const o=le(n.center);o&&se(this._viewer,o,n.radius*4,void 0,e)}}}class xb extends a.Destroyable{constructor(e,n){super();v(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new ns(n,e.id));const o=this._groundPolygonPrimitive;{const s=()=>{const l=e.show,c=e.fill;o.show=l&&c&&e.visibleAlpha>0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.material={type:"Color",color:e.color||[1,1,1,.5]}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(r.disposableOn(s))}this.dispose(a.track([o,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class Eb extends a.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ae(n,e.id));const s=this._geoPolyline;s.arcType="GEODESIC",s.loop=!0;{const r=()=>{const c=e.show,u=e.outline;if(s.show=c&&u&&e.visibleAlpha>0,s.show&&e.positions&&e.positions.length>1){const d=e.positions[0][2];s.positions=e.positions.map(p=>[p[0],p[1],d])}else s.positions=void 0;s.color=e.outlineColor,s.width=e.outlineWidth};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class Ab extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new xb(e,n)),this._bottomPolyline=this.disposeVar(new Eb(e,n,o)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class wn extends a.Destroyable{constructor(e,n){super();v(this,"_positions",this.disposeVar(a.reactPositions(void 0)));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"])),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=m=>{if(!this.polygonHierarchy)return;const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Vi(this.polygonHierarchy),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),arcType:this.arcType&&h.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:this.granularity!==void 0?h.Math.toRadians(this.granularity):void 0}),id:this});y.push(_);const P=new h.Primitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=new h.BoundingSphere,u=()=>{if(r(),!this.polygonHierarchy)return;const m=ht(this.polygonHierarchy.positions);if(m.length<3||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(m,c),this._primitive=l(s.value),this._primitive&&o.scene.primitives.add(this._primitive)},d=()=>{const m=this.show??!0;this._primitive&&(this._primitive.show=m)};u(),d();const p=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed));this.dispose(p.disposableOn(()=>{u(),d()}));const f=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&(p.flush(),f.flush(),c.radius>0)){const g=le(c.center),y=this.height??0,_=this.extrudedHeight??0,P=Math.max(y,_),w=c.radius<P?P:c.radius;g&&se(o,g,w*4,void 0,m)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(wn,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(wn||(wn={})),a.extendClassProps(wn.prototype,wn.createDefaultProps);class uv extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new wn(n,e.id));const r=this._czmInnerPolygonPrimitive;{const l=()=>{const u=e.show,d=e.fill;if(r.show=u&&d&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!s?r.height=e.positions[0][2]:r.height=void 0,r.polygonHierarchy=r.show?{positions:e.positions||[]}:{positions:[]},r.material={type:"Color",color:e.color||[1,1,1,.5]},o){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");r.extrudedHeight=(r.height??0)+e.depth}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(c.disposableOn(l))}this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class dv extends a.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ae(n,e.id));const s=this._geoPolyline;s.arcType="GEODESIC",s.loop=!0,this.dispose(a.bind([s,"depthTest"],[e,"depthTest"])),this.dispose(a.bind([s,"ground"],[e,"strokeGround"]));{const r=()=>{const c=e.show,u=e.outline;if(s.show=c&&u&&e.visibleAlpha>0,s.show&&e.positions&&e.positions.length>1){const d=e.positions[0][2];s.positions=e.positions.map(p=>[p[0],p[1],d])}else s.positions=void 0;s.color=e.outlineColor,s.width=e.outlineWidth};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class Tb extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new li(e,i.id));n.arcType="GEODESIC",this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const r=i.show,l=i.outline;n.show=r&&l&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const d=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],d])}let u;if(i.positions&&i.positions.length>0?u=i.positions[0][2]:u=void 0,n.show&&c){const d=u,p=(u??0)+i.depth;n.positions=c.map(f=>[[f[0],f[1],d],[f[0],f[1],p]])}else n.positions=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(s.disposableOn(o))}}}class Mb extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new Ae(e,i.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const r=i.show,l=i.outline;n.show=r&&l&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const d=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],d])}let u;if(i.positions&&i.positions.length>0?u=i.positions[0][2]:u=void 0,n.show&&c){const d=(u??0)+i.depth;n.positions=c.map(p=>[p[0],p[1],d])}else n.positions=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(s.disposableOn(o))}}}class Ib extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new uv(e,n,!0,o)),this._bottomPolyline=this.disposeVar(new dv(e,n,o)),this.disposeVar(new Tb(e,n)),this.disposeVar(new Mb(e,n)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Db extends a.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new uv(e,n,!1,o)),this._bottomPolyline=this.disposeVar(new dv(e,n,o)),this.dispose(e.flyToEvent.disposableOn(s=>{if(e.viewDistanceRange){const r=e.positionsCenter.center,l=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,r,l,void 0,s)}else{const r=e.positionsCenter.center;if(!e.positions)return;const l=[r[0],r[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,l,c,void 0,s)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Cn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_polygonOrGroundPolygonResetting");v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_positionsCenter");this._positionsCenter=this.ad(new ru(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Zn(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new a.ObjResettingWithEvent(o,()=>this.ground?new Ab(this,e):this.depth!==void 0&&this.depth>0?new Ib(this,e):new Db(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}v(Cn,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Cn||(Cn={})),a.extendClassProps(Cn.prototype,Cn.createDefaultProps);class fr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"])),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=(f,m)=>{const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,height:this.height,rotation:this.rotation&&h.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(_);const P=new h.Primitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=We(this.positions);!f||!s.value||(this._primitive=l(f,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,s.changed,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),positions:a.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(fr||(fr={})),a.extendClassProps(fr.prototype,fr.createDefaultProps);const Rh=class Rh extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(ai([this,"material"],Rh.defaults.material)),r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const l=(f,m)=>{const g=new h.MaterialAppearance({material:m}),y=[],_=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,rotation:this.rotation&&h.Math.toRadians(this.rotation),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(_);const P=new h.GroundPrimitive({geometryInstances:y,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=We(this.positions);!f||!s.value||(this._primitive=l(f,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,s.changed,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,0);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Rh,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let ao=Rh;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),positions:a.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(ao||(ao={})),a.extendClassProps(ao.prototype,ao.createDefaultProps);class gr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const r=new h.Color,l=f=>{const m=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],y=new h.GeometryInstance({geometry:new h.RectangleOutlineGeometry({rectangle:f,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&h.Math.toRadians(this.rotation)}),attributes:{color:this.color?h.ColorGeometryInstanceAttribute.fromColor(te(this.color,r)):h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,1,1,1))},id:this});g.push(y);const _=new h.Primitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(_.ESSceneObjectID=n),_},c=()=>{if(s(),!this.positions)return;const f=We(this.positions);f&&(this._primitive=l(f),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),u();const d=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(d.disposableOn(()=>{c(),u()}));const p=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const m=We(this.positions),g=h.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(g.radius>0){const y=le(g.center);y&&se(o,y,g.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:a.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:a.reactArrayWithUndefined(void 0)})})(gr||(gr={})),a.extendClassProps(gr.prototype,gr.createDefaultProps);const jr=class jr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new fr(e,n)),r=this.ad(new ao(e,n)),l=this.ad(new gr(e,n));this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const d=this.show??!0,p=this.ground??!1,f=this.outline??!1;l.show=d&&!p&&f,s.show=d&&!p,l.show?l.positions=this.rectangle:l.positions=void 0,s.show?s.positions=this.rectangle:s.positions=void 0,l.rotation=s.rotation=this.rotation,s.material=this.material??jr.defaults.material,s.stRotation=this.stRotation,l.extrudedHeight=s.extrudedHeight=this.extrudedHeight,l.height=s.height=this.height,l.color=this.outlineColor,l.translucent=this.outlineTranslucent,r.show=d&&p,r.show?r.positions=this.rectangle:r.positions=void 0,r.rotation=this.rotation,r.material=this.material??jr.defaults.material,r.stRotation=this.stRotation};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(d=>{this.ground?r.flyTo(d):s.flyTo(d)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(jr,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let wi=jr;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:a.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:a.reactJsonWithUndefined(void 0),rectangle:a.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(wi||(wi={})),a.extendClassProps(wi.prototype,wi.createDefaultProps);const ea=class ea extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=this.disposeVar(ai([this,"material"])),r=(p,f)=>{if(!p||!this.radius)return;const m=new h.MaterialAppearance({material:f}),g=[],y=()=>{let A=this.granularity??ea.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),h.Math.toRadians(A)},_=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,height:this.height,extrudedHeight:this.extrudedHeight,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:y()}),id:this}),P=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),w=Re({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!w||!P){console.warn("modelMatrix is undefined!");return}const b=h.Matrix4.inverseTransformation(P,new h.Matrix4);h.Matrix4.multiply(w,b,_.modelMatrix),g.push(_);const x=new h.Primitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??ea.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(x.ESSceneObjectID=n),x},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Be(this.position);!p||!s.value||(this._primitive=r(p,s.value),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,s.changed,this.rotationChanged));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ea,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let _n=ea;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJson({type:"Color"}),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0})})(_n||(_n={})),a.extendClassProps(_n.prototype,_n.createDefaultProps);const Fo=class Fo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=this.disposeVar(ai([this,"material"],Fo.defaults.material)),r=(p,f)=>{if(!p||!this.radius)return;const m=new h.MaterialAppearance({material:f}),g=[],y=()=>{let w=this.granularity??Fo.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),w=w|0,w=Math.max(1,w),h.Math.toRadians(w)},_=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),granularity:y(),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&_e(this.ellipsoid)}),id:this});g.push(_);const P=new h.GroundPrimitive({geometryInstances:g,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??Fo.defaults.allowPicking,compressVertices:!1});return h.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position||!this.radius||!s.value)return;const p=Be(this.position);this._primitive=r(p,s.value),this._primitive&&o.scene.primitives.add(this._primitive)},c=()=>{const p=this.show??Fo.defaults.show;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,s.changed));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Fo,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Pn=Fo;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:a.reactJsonWithUndefined(void 0),granularity:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0})})(Pn||(Pn={})),a.extendClassProps(Pn.prototype,Pn.createDefaultProps);const ta=class ta extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const s=new h.Color,r=p=>{if(!p||!this.radius)return;const f=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],g=h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE),y=()=>{let A=this.granularity??ta.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),h.Math.toRadians(A)},_=new h.GeometryInstance({geometry:new h.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&_e(this.ellipsoid),granularity:y(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?h.ColorGeometryInstanceAttribute.fromColor(te(this.outlineColor,s)):g},id:this}),P=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),w=Re({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!w||!P){console.warn("modelMatrix is undefined!");return}const b=h.Matrix4.inverseTransformation(P,new h.Matrix4);h.Matrix4.multiply(w,b,_.modelMatrix),m.push(_);const x=new h.Primitive({geometryInstances:m,appearance:f,asynchronous:!1,allowPicking:this.allowPicking??ta.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(x.ESSceneObjectID=n),x},l=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Be(this.position);p&&(this._primitive=r(p),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};l(),c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(u.disposableOn(()=>{l(),c()}));const d=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ta,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let bn=ta;(t=>{t.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:a.reactArrayWithUndefined(void 0),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(bn||(bn={})),a.extendClassProps(bn.prototype,bn.createDefaultProps);class lo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new _n(e,n)),r=this.ad(new Pn(e,n)),l=this.ad(new bn(e,n));this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([l,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const d=this.show??!0,p=this.ground??!1,f=this.outline??!1;l.show=d&&!p&&f,s.show=d&&!p,l.show?l.position=this.position:l.position=void 0,s.show?s.position=this.position:s.position=void 0,s.rotation=l.rotation=this.rotation,l.radius=s.radius=this.radius,l.extrudedHeight=s.extrudedHeight=this.extrudedHeight,this.position&&(l.height=s.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),s.granularity=l.granularity=this.granularity,s.ellipsoid=l.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation,l.outlineColor=this.outlineColor,l.translucent=this.outlineTranslucent,l.numberOfVerticalLines=this.numberOfVerticalLines,r.show=d&&p,r.show?r.position=this.position:r.position=void 0,r.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),r.granularity=1):r.granularity=this.granularity,r.rotation=this.rotation,r.ellipsoid=this.ellipsoid,r.material=this.material,r.stRotation=this.stRotation};c();const u=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(u.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(d=>{this.ground?r.flyTo(d):s.flyTo(d)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(lo,"defaults",{extrudedHeight:void 0}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:a.reactArray([1,1,1,1]),material:a.reactJson({type:"Color",color:[1,1,1,.5]}),position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:a.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0})})(lo||(lo={})),a.extendClassProps(lo.prototype,lo.createDefaultProps);class mr extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;const r=h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),l=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(l);const c=()=>{const b={baseWaterColor:te(this.waterColor),normalMap:r,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new h.Material({fabric:{type:"Water",uniforms:b}})},u=()=>{if(!this.points)return;const b={positions:this.points},x=new h.PolygonGeometry({polygonHierarchy:Vi(b),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new h.GeometryInstance({geometry:x,id:this})},d=()=>{if(!this.points)return;const b=new h.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),x=u();let A;return this.ground??!1?A=new h.GroundPrimitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):A=new h.Primitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),h.Primitive.prototype&&h.GroundPrimitive.prototype&&(A.ESSceneObjectID=n),A},p=new h.BoundingSphere,f=()=>{l(),m(p),this._primitive=d(),this._primitive&&o.scene.primitives.add(this._primitive)},m=b=>{if(!this.points)return;const x=ht(this.points);if(x.length<3){b.radius=-1;return}h.BoundingSphere.fromPoints(x,b)},g=()=>{const b=this.show??!0;this._primitive&&(this._primitive.show=b)},y=()=>{f(),g()};y();let _=a.debounce(y,500);const P=this.dv(a.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(P.don(y));const w=this.dv(a.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(w.don(()=>{if(!this.points){l();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=u(),m(p),_&&_[0]()):y()})),this.d(this.showChanged.don(g)),this.d(this.flyToEvent.don(b=>{if(p.radius>0){const x=le(p.center);x&&se(o,x,p.radius*4,void 0,b)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:a.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:a.reactJsonWithUndefined(void 0),flowSpeed:0})})(mr||(mr={})),a.extendClassProps(mr.prototype,mr.createDefaultProps);class co extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_updateBoundingSphereEvent",this.ad(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=new h.BoundingSphere,r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(r);const l=b=>a.ESSceneObject.context.getStrFromEnv(b),c=()=>{this._primitive=new h[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:f()}),h.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),o.scene.primitives.add(this._primitive)},u=()=>{var M;const b=l(this.normalMap??h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),x={baseWaterColor:te(this.waterColor??[.25,.6,1,.7]),normalMap:b,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(x.blendColor=te(this.blendColor)),this.specularMap&&(x.specularMap=l(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:D,minPos:L}=a.getMinMaxCorner(this.points),V=a.getDistancesFromPositions([L,[D[0],D[1],L[2]]],"GEODESIC")[0],O=a.getDistancesFromPositions([L,[L[0],D[1],D[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(x.baseWaterImage=l(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(x.repeatX=V/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(x.repeatY=O/this.baseWaterImage.vDis)),x.flowSpeed=this.flowSpeed/(((M=this.baseWaterImage)==null?void 0:M.uDis)??V)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,x);return}const A=new h.EllipsoidSurfaceAppearance({material:Um(x),aboveGround:!0});this._primitive&&(this._primitive.appearance=A)},d=this.ad(a.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(d.don(u));const p=b=>{if(!this.points)return;const x=ht(this.points);if(x.length<3){b.radius=-1;return}h.BoundingSphere.fromPoints(x,b)},f=()=>{if(!this.points||this.points.length<3)return;const{minPos:b}=a.getMinMaxCorner(this.points),[x]=Et({originPosition:b},this.points),{minPos:A,maxPos:M}=a.getMinMaxCorner(x),D=M[0]-A[0],L=M[1]-A[1],V={positions:this.points},O=new h.PolygonGeometry({polygonHierarchy:Vi(V),vertexFormat:h.VertexFormat.DEFAULT,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x.map(U=>[h.Math.clamp(U[0]/D,0,1),h.Math.clamp(U[1]/L,0,1)]).flat())})}});return new h.GeometryInstance({id:this,geometry:O})},m=()=>{this._primitive&&(this._primitive.show=this.show??!0)},g=this.ad(a.createNextAnimateFrameEvent(this.showChanged));this.ad(g.don(m));const y=this.ad(()=>{r(),c(),m(),u(),p(s)});y();const _=this.ad(a.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(_.don(y)),this.ad(new a.ObjResettingWithEvent(this.updateBoundingSphereEvent,b=>{const x=new a.Destroyable;return b?x.ad(o.scene.preUpdate.addEventListener(()=>{const A=o.camera;o.camera.frustum.computeCullingVolume(A.position,A.direction,A.up).computeVisibility(s)===h.Intersect.OUTSIDE&&y()})):(y(),x.ad(this.pointsChanged.don(y))),x}));const P=()=>{if(!this.points||this.points.length<3){y();return}this._primitive instanceof h.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=f(),this._primitive._recomputeBoundingSpheres=!0},w=this.dv(a.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(w.don(P)),this.d(this.flyToEvent.don(b=>{if(s.radius>0){const x=le(s.center);x&&se(o,x,s.radius*4,void 0,b)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:a.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:a.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:a.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(co||(co={})),a.extendClassProps(co.prototype,co.createDefaultProps);class ho extends a.Destroyable{constructor(e,n){super();v(this,"pointPrimitives");v(this,"_flyToEvent",this.dv(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Xt(e.viewer))return;let{pointPrimitives:r}=this;const l=()=>{r&&(r.removeAll(),o.scene.primitives.remove(r),r=void 0)};this.d(l);const c=()=>{const g=new h.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(_=>{g.add({show:_.show??!0,color:_.color&&te(_.color),disableDepthTestDistance:_.disableDepthTestDistance,distanceDisplayCondition:_.distanceDisplayCondition&&sr(_.distanceDisplayCondition),outlineColor:_.outlineColor&&te(_.outlineColor),outlineWidth:_.outlineWidth,pixelSize:_.pixelSize,position:_.position&&Be(_.position),scaleByDistance:_.scaleByDistance&&ln(_.scaleByDistance),translucencyByDistance:_.translucencyByDistance&&ln(_.translucencyByDistance)})}),h.PointPrimitiveCollection.prototype&&(g.ESSceneObjectID=n)),g},u=()=>{l(),r=c(),o.scene.primitives.add(r)};u();const d=this.dv(a.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{r&&(r.show=this.show??!0,r.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,r.blendOption=(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(d.don(p));const f=this.dv(a.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(f.don(u));const m=new h.BoundingSphere;this.d(this.flyToEvent.don(g=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(d.flush(),f.flush(),this.pointPrimitiveOptions.length===1){const y=this.pointPrimitiveOptions[0].position;if(!y)return;const _=o.scene.camera.positionCartographic.height;se(o,y,_,void 0,g)}else{const y=this.pointPrimitiveOptions,_=[];y.forEach(w=>{w.position&&_.push(w.position)});const P=ht(_);if(h.BoundingSphere.fromPoints(P,m),m.radius>0){const w=le(m.center);w&&se(o,w,m.radius*4,void 0,g)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),scale:a.reactArrayWithUndefined(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),modelMatrix:a.reactArrayWithUndefined(void 0)})})(ho||(ho={})),a.extendClassProps(ho.prototype,ho.createDefaultProps);class Rb extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const o=ue.czmJulianDateToTimeStamp,s=ue.getClockRange,r=ue.getClockStep;{const l=()=>n.clockViewModel.startTime=h.JulianDate.fromDate(new Date(i.startTime??a.getDefaultValue(ue.defaults.startTime)));l(),this.dispose(gi(n.clockViewModel,"startTime",c=>i.startTime=o(c))),this.dispose(i.startTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.stopTime=h.JulianDate.fromDate(new Date(i.stopTime??a.getDefaultValue(ue.defaults.stopTime)));l(),this.dispose(gi(n.clockViewModel,"stopTime",c=>i.stopTime=o(c))),this.dispose(i.stopTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(i.currentTime??a.getDefaultValue(ue.defaults.currentTime)));l(),this.dispose(gi(n.clockViewModel,"currentTime",c=>i.currentTime=o(c))),this.dispose(i.currentTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.multiplier=i.multiplier??ue.defaults.multiplier;l(),this.dispose(gi(n.clockViewModel,"multiplier",c=>{(i.multiplier??ue.defaults.multiplier!==c)&&(i.multiplier=c)})),this.dispose(i.currentTimeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.clockStep=h.ClockStep[i.clockStep??ue.defaults.clockStep];l(),this.dispose(gi(n.clockViewModel,"clockStep",c=>{const u=r(c);(i.clockStep??ue.defaults.clockStep!==u)&&(i.clockStep=u)})),this.dispose(i.clockStepChanged.disposableOn(l))}{const l=()=>n.clockViewModel.clockRange=h.ClockRange[i.clockRange??ue.defaults.clockRange];l(),this.dispose(gi(n.clockViewModel,"clockRange",c=>{const u=s(c);(i.clockRange??ue.defaults.clockRange!==u)&&(i.clockRange=u)})),this.dispose(i.clockRangeChanged.disposableOn(l))}{const l=()=>n.clockViewModel.shouldAnimate=i.shouldAnimate??ue.defaults.shouldAnimate;l(),this.dispose(gi(n.clockViewModel,"shouldAnimate",c=>{(i.shouldAnimate??ue.defaults.shouldAnimate!==c)&&(i.shouldAnimate=c)})),this.dispose(i.shouldAnimateChanged.disposableOn(l))}}}const zo=class zo extends a.Destroyable{constructor(i){super(),this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??zo.defaults.enabled)return new Rb(this,i)}))}};v(zo,"czmJulianDateToTimeStamp",Fb),v(zo,"getClockRange",zb),v(zo,"getClockStep",Lb),v(zo,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+1440*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let ue=zo;(t=>{t.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(ue||(ue={})),a.extendClassProps(ue.prototype,ue.createDefaultProps);function Fb(t){return h.JulianDate.toDate(t).getTime()}function zb(t){if(t===h.ClockRange.CLAMPED)return"CLAMPED";if(t===h.ClockRange.LOOP_STOP)return"LOOP_STOP";if(t===h.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${t}`)}function Lb(t){if(t===h.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(t===h.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(t===h.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${t}`)}function T(t){return t!=null}function G(t){this.name="DeveloperError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}T(Object.create)&&(G.prototype=Object.create(Error.prototype),G.prototype.constructor=G),G.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return T(this.stack)&&(t+=`
|
|
320
320
|
${this.stack.toString()}`),t},G.throwInstantiationError=function(){throw new G("This function defines an interface and should not be called directly.")};const S={};S.typeOf={};function Ob(t){return`${t} is required, actual value was undefined`}function os(t,i,e){return`Expected ${e} to be typeof ${i}, actual typeof was ${t}`}S.defined=function(t,i){if(!T(i))throw new G(Ob(t))},S.typeOf.func=function(t,i){if(typeof i!="function")throw new G(os(typeof i,"function",t))},S.typeOf.string=function(t,i){if(typeof i!="string")throw new G(os(typeof i,"string",t))},S.typeOf.number=function(t,i){if(typeof i!="number")throw new G(os(typeof i,"number",t))},S.typeOf.number.lessThan=function(t,i,e){if(S.typeOf.number(t,i),i>=e)throw new G(`Expected ${t} to be less than ${e}, actual value was ${i}`)},S.typeOf.number.lessThanOrEquals=function(t,i,e){if(S.typeOf.number(t,i),i>e)throw new G(`Expected ${t} to be less than or equal to ${e}, actual value was ${i}`)},S.typeOf.number.greaterThan=function(t,i,e){if(S.typeOf.number(t,i),i<=e)throw new G(`Expected ${t} to be greater than ${e}, actual value was ${i}`)},S.typeOf.number.greaterThanOrEquals=function(t,i,e){if(S.typeOf.number(t,i),i<e)throw new G(`Expected ${t} to be greater than or equal to ${e}, actual value was ${i}`)},S.typeOf.object=function(t,i){if(typeof i!="object")throw new G(os(typeof i,"object",t))},S.typeOf.bool=function(t,i){if(typeof i!="boolean")throw new G(os(typeof i,"boolean",t))},S.typeOf.bigint=function(t,i){if(typeof i!="bigint")throw new G(os(typeof i,"bigint",t))},S.typeOf.number.equals=function(t,i,e,n){if(S.typeOf.number(t,e),S.typeOf.number(i,n),e!==n)throw new G(`${t} must be equal to ${i}, the actual values are ${e} and ${n}`)};var pv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xu,fv;function Nb(){if(fv)return xu;fv=1;var t=function(i){i==null&&(i=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,i.constructor==Array?this.init_by_array(i,i.length):this.init_seed(i)};return t.prototype.init_seed=function(i){for(this.mt[0]=i>>>0,this.mti=1;this.mti<this.N;this.mti++){var i=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((i&4294901760)>>>16)*1812433253<<16)+(i&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(i,e){var n,o,s;for(this.init_seed(19650218),n=1,o=0,s=this.N>e?this.N:e;s;s--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+i[o]+o,this.mt[n]>>>=0,n++,o++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),o>=e&&(o=0)}for(s=this.N-1;s;s--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var i,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^i>>>1^e[i&1];for(;n<this.N-1;n++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^i>>>1^e[i&1];i=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^i>>>1^e[i&1],this.mti=0}return i=this.mt[this.mti++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,i^=i>>>18,i>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){var i=this.random_int()>>>5,e=this.random_int()>>>6;return(i*67108864+e)*(1/9007199254740992)},xu=t,xu}var Bb=Nb();const gv=dc(Bb),N={};N.EPSILON1=.1,N.EPSILON2=.01,N.EPSILON3=.001,N.EPSILON4=1e-4,N.EPSILON5=1e-5,N.EPSILON6=1e-6,N.EPSILON7=1e-7,N.EPSILON8=1e-8,N.EPSILON9=1e-9,N.EPSILON10=1e-10,N.EPSILON11=1e-11,N.EPSILON12=1e-12,N.EPSILON13=1e-13,N.EPSILON14=1e-14,N.EPSILON15=1e-15,N.EPSILON16=1e-16,N.EPSILON17=1e-17,N.EPSILON18=1e-18,N.EPSILON19=1e-19,N.EPSILON20=1e-20,N.EPSILON21=1e-21,N.GRAVITATIONALPARAMETER=3986004418e5,N.SOLAR_RADIUS=6955e5,N.LUNAR_RADIUS=1737400,N.SIXTY_FOUR_KILOBYTES=64*1024,N.FOUR_GIGABYTES=4*1024*1024*1024,N.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1},N.signNotZero=function(t){return t<0?-1:1},N.toSNorm=function(t,i){return i=i??255,Math.round((N.clamp(t,-1,1)*.5+.5)*i)},N.fromSNorm=function(t,i){return i=i??255,N.clamp(t,0,i)/i*2-1},N.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:N.clamp((t-i)/e,0,1)},N.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2},N.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2},N.lerp=function(t,i,e){return(1-e)*t+e*i},N.PI=Math.PI,N.ONE_OVER_PI=1/Math.PI,N.PI_OVER_TWO=Math.PI/2,N.PI_OVER_THREE=Math.PI/3,N.PI_OVER_FOUR=Math.PI/4,N.PI_OVER_SIX=Math.PI/6,N.THREE_PI_OVER_TWO=3*Math.PI/2,N.TWO_PI=2*Math.PI,N.ONE_OVER_TWO_PI=1/(2*Math.PI),N.RADIANS_PER_DEGREE=Math.PI/180,N.DEGREES_PER_RADIAN=180/Math.PI,N.RADIANS_PER_ARCSECOND=N.RADIANS_PER_DEGREE/3600,N.toRadians=function(t){if(!T(t))throw new G("degrees is required.");return t*N.RADIANS_PER_DEGREE},N.toDegrees=function(t){if(!T(t))throw new G("radians is required.");return t*N.DEGREES_PER_RADIAN},N.convertLongitudeRange=function(t){if(!T(t))throw new G("angle is required.");const i=N.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e},N.clampToLatitudeRange=function(t){if(!T(t))throw new G("angle is required.");return N.clamp(t,-1*N.PI_OVER_TWO,N.PI_OVER_TWO)},N.negativePiToPi=function(t){if(!T(t))throw new G("angle is required.");return t>=-N.PI&&t<=N.PI?t:N.zeroToTwoPi(t+N.PI)-N.PI},N.zeroToTwoPi=function(t){if(!T(t))throw new G("angle is required.");if(t>=0&&t<=N.TWO_PI)return t;const i=N.mod(t,N.TWO_PI);return Math.abs(i)<N.EPSILON14&&Math.abs(t)>N.EPSILON14?N.TWO_PI:i},N.mod=function(t,i){if(!T(t))throw new G("m is required.");if(!T(i))throw new G("n is required.");if(i===0)throw new G("divisor cannot be 0.");return N.sign(t)===N.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i},N.equalsEpsilon=function(t,i,e,n){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");e=e??0,n=n??e;const o=Math.abs(t-i);return o<=n||o<=e*Math.max(Math.abs(t),Math.abs(i))},N.lessThan=function(t,i,e){if(!T(t))throw new G("first is required.");if(!T(i))throw new G("second is required.");if(!T(e))throw new G("absoluteEpsilon is required.");return t-i<-e},N.lessThanOrEquals=function(t,i,e){if(!T(t))throw new G("first is required.");if(!T(i))throw new G("second is required.");if(!T(e))throw new G("absoluteEpsilon is required.");return t-i<e},N.greaterThan=function(t,i,e){if(!T(t))throw new G("first is required.");if(!T(i))throw new G("second is required.");if(!T(e))throw new G("absoluteEpsilon is required.");return t-i>e},N.greaterThanOrEquals=function(t,i,e){if(!T(t))throw new G("first is required.");if(!T(i))throw new G("second is required.");if(!T(e))throw new G("absoluteEpsilon is required.");return t-i>-e};const pc=[1];N.factorial=function(t){if(typeof t!="number"||t<0)throw new G("A number greater than or equal to 0 is required.");const i=pc.length;if(t>=i){let e=pc[i-1];for(let n=i;n<=t;n++){const o=e*n;pc.push(o),e=o}}return pc[t]},N.incrementWrap=function(t,i,e){if(e=e??0,!T(t))throw new G("n is required.");if(i<=e)throw new G("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t},N.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new G("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},N.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new G("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},N.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new G("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t},N.clamp=function(t,i,e){return S.typeOf.number("value",t),S.typeOf.number("min",i),S.typeOf.number("max",e),t<i?i:t>e?e:t};let mv=new gv;N.setRandomNumberSeed=function(t){if(!T(t))throw new G("seed is required.");mv=new gv(t)},N.nextRandomNumber=function(){return mv.random()},N.randomBetween=function(t,i){return N.nextRandomNumber()*(i-t)+t},N.acosClamped=function(t){if(!T(t))throw new G("value is required.");return Math.acos(N.clamp(t,-1,1))},N.asinClamped=function(t){if(!T(t))throw new G("value is required.");return Math.asin(N.clamp(t,-1,1))},N.chordLength=function(t,i){if(!T(t))throw new G("angle is required.");if(!T(i))throw new G("radius is required.");return 2*i*Math.sin(t*.5)},N.logBase=function(t,i){if(!T(t))throw new G("number is required.");if(!T(i))throw new G("base is required.");return Math.log(t)/Math.log(i)},N.cbrt=Math.cbrt??function(i){const e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e},N.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E},N.fog=function(t,i){const e=t*i;return 1-Math.exp(-(e*e))},N.fastApproximateAtan=function(t){return S.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},N.fastApproximateAtan2=function(t,i){S.typeOf.number("x",t),S.typeOf.number("y",i);let e,n=Math.abs(t);e=Math.abs(i);const o=Math.max(n,e);e=Math.min(n,e);const s=e/o;if(isNaN(s))throw new G("either x or y must be nonzero");return n=N.fastApproximateAtan(s),n=Math.abs(i)>Math.abs(t)?N.PI_OVER_TWO-n:n,n=t<0?N.PI-n:n,n=i<0?-n:n,n};function F(t,i,e){this.x=t??0,this.y=i??0,this.z=e??0}F.fromSpherical=function(t,i){S.typeOf.object("spherical",t),T(i)||(i=new F);const e=t.clock,n=t.cone,o=t.magnitude??1,s=o*Math.sin(n);return i.x=s*Math.cos(e),i.y=s*Math.sin(e),i.z=o*Math.cos(n),i},F.fromElements=function(t,i,e,n){return T(n)?(n.x=t,n.y=i,n.z=e,n):new F(t,i,e)},F.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i):new F(t.x,t.y,t.z)},F.fromCartesian4=F.clone,F.packedLength=3,F.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e]=t.z,i},F.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new F),e.x=t[i++],e.y=t[i++],e.z=t[i],e},F.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*3;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 3 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)F.pack(t[o],i,o*3);return i},F.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new G("array length must be a multiple of 3.");const e=t.length;T(i)?i.length=e/3:i=new Array(e/3);for(let n=0;n<e;n+=3){const o=n/3;i[o]=F.unpack(t,n,i[o])}return i},F.fromArray=F.unpack,F.maximumComponent=function(t){return S.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},F.minimumComponent=function(t){return S.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},F.minimumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e},F.maximumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e},F.clamp=function(t,i,e,n){S.typeOf.object("value",t),S.typeOf.object("min",i),S.typeOf.object("max",e),S.typeOf.object("result",n);const o=N.clamp(t.x,i.x,e.x),s=N.clamp(t.y,i.y,e.y),r=N.clamp(t.z,i.z,e.z);return n.x=o,n.y=s,n.z=r,n},F.magnitudeSquared=function(t){return S.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},F.magnitude=function(t){return Math.sqrt(F.magnitudeSquared(t))};const fc=new F;F.distance=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),F.subtract(t,i,fc),F.magnitude(fc)},F.distanceSquared=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),F.subtract(t,i,fc),F.magnitudeSquared(fc)},F.normalize=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=F.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,i.z=t.z/e,isNaN(i.x)||isNaN(i.y)||isNaN(i.z))throw new G("normalized result is not a number");return i},F.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z},F.multiplyComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e},F.divideComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e},F.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e},F.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e},F.multiplyByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e},F.divideByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e},F.negate=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i},F.abs=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i.z=Math.abs(t.z),i};const vv=new F;F.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),F.multiplyByScalar(i,e,vv),n=F.multiplyByScalar(t,1-e,n),F.add(vv,n,n)};const gc=new F,Eu=new F;F.angleBetween=function(t,i){S.typeOf.object("left",t),S.typeOf.object("right",i),F.normalize(t,gc),F.normalize(i,Eu);const e=F.dot(gc,Eu),n=F.magnitude(F.cross(gc,Eu,gc));return Math.atan2(n,e)};const Vb=new F;F.mostOrthogonalAxis=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=F.normalize(t,Vb);return F.abs(e,e),e.x<=e.y?e.x<=e.z?i=F.clone(F.UNIT_X,i):i=F.clone(F.UNIT_Z,i):e.y<=e.z?i=F.clone(F.UNIT_Y,i):i=F.clone(F.UNIT_Z,i),i},F.projectVector=function(t,i,e){S.defined("a",t),S.defined("b",i),S.defined("result",e);const n=F.dot(t,i)/F.dot(i,i);return F.multiplyByScalar(i,n,e)},F.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z},F.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]&&t.z===i[e+2]},F.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.x,i.x,e,n)&&N.equalsEpsilon(t.y,i.y,e,n)&&N.equalsEpsilon(t.z,i.z,e,n)},F.cross=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t.x,o=t.y,s=t.z,r=i.x,l=i.y,c=i.z,u=o*c-s*l,d=s*r-n*c,p=n*l-o*r;return e.x=u,e.y=d,e.z=p,e},F.midpoint=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=(t.x+i.x)*.5,e.y=(t.y+i.y)*.5,e.z=(t.z+i.z)*.5,e},F.fromDegrees=function(t,i,e,n,o){return S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),t=N.toRadians(t),i=N.toRadians(i),F.fromRadians(t,i,e,n,o)};let Jt=new F,ss=new F;F._ellipsoidRadiiSquared=new F(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),F.fromRadians=function(t,i,e,n,o){S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),e=e??0;const s=T(n)?n.radiiSquared:F._ellipsoidRadiiSquared,r=Math.cos(i);Jt.x=r*Math.cos(t),Jt.y=r*Math.sin(t),Jt.z=Math.sin(i),Jt=F.normalize(Jt,Jt),F.multiplyComponents(s,Jt,ss);const l=Math.sqrt(F.dot(Jt,ss));return ss=F.divideByScalar(ss,l,ss),Jt=F.multiplyByScalar(Jt,e,Jt),T(o)||(o=new F),F.add(ss,Jt,o)},F.fromDegreesArray=function(t,i,e){if(S.defined("coordinates",t),t.length<2||t.length%2!==0)throw new G("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;T(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const s=t[o],r=t[o+1],l=o/2;e[l]=F.fromDegrees(s,r,0,i,e[l])}return e},F.fromRadiansArray=function(t,i,e){if(S.defined("coordinates",t),t.length<2||t.length%2!==0)throw new G("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;T(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const s=t[o],r=t[o+1],l=o/2;e[l]=F.fromRadians(s,r,0,i,e[l])}return e},F.fromDegreesArrayHeights=function(t,i,e){if(S.defined("coordinates",t),t.length<3||t.length%3!==0)throw new G("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;T(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const s=t[o],r=t[o+1],l=t[o+2],c=o/3;e[c]=F.fromDegrees(s,r,l,i,e[c])}return e},F.fromRadiansArrayHeights=function(t,i,e){if(S.defined("coordinates",t),t.length<3||t.length%3!==0)throw new G("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;T(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const s=t[o],r=t[o+1],l=t[o+2],c=o/3;e[c]=F.fromRadians(s,r,l,i,e[c])}return e},F.ZERO=Object.freeze(new F(0,0,0)),F.ONE=Object.freeze(new F(1,1,1)),F.UNIT_X=Object.freeze(new F(1,0,0)),F.UNIT_Y=Object.freeze(new F(0,1,0)),F.UNIT_Z=Object.freeze(new F(0,0,1)),F.prototype.clone=function(t){return F.clone(this,t)},F.prototype.equals=function(t){return F.equals(this,t)},F.prototype.equalsEpsilon=function(t,i,e){return F.equalsEpsilon(this,t,i,e)},F.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function K(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}K.fromElements=function(t,i,e,n,o){return T(o)?(o.x=t,o.y=i,o.z=e,o.w=n,o):new K(t,i,e,n)},K.fromColor=function(t,i){return S.typeOf.object("color",t),T(i)?(i.x=t.red,i.y=t.green,i.z=t.blue,i.w=t.alpha,i):new K(t.red,t.green,t.blue,t.alpha)},K.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new K(t.x,t.y,t.z,t.w)},K.packedLength=4,K.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},K.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new K),e.x=t[i++],e.y=t[i++],e.z=t[i++],e.w=t[i],e},K.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*4;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 4 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)K.pack(t[o],i,o*4);return i},K.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new G("array length must be a multiple of 4.");const e=t.length;T(i)?i.length=e/4:i=new Array(e/4);for(let n=0;n<e;n+=4){const o=n/4;i[o]=K.unpack(t,n,i[o])}return i},K.fromArray=K.unpack,K.maximumComponent=function(t){return S.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},K.minimumComponent=function(t){return S.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},K.minimumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e.w=Math.min(t.w,i.w),e},K.maximumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e.w=Math.max(t.w,i.w),e},K.clamp=function(t,i,e,n){S.typeOf.object("value",t),S.typeOf.object("min",i),S.typeOf.object("max",e),S.typeOf.object("result",n);const o=N.clamp(t.x,i.x,e.x),s=N.clamp(t.y,i.y,e.y),r=N.clamp(t.z,i.z,e.z),l=N.clamp(t.w,i.w,e.w);return n.x=o,n.y=s,n.z=r,n.w=l,n},K.magnitudeSquared=function(t){return S.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},K.magnitude=function(t){return Math.sqrt(K.magnitudeSquared(t))};const mc=new K;K.distance=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),K.subtract(t,i,mc),K.magnitude(mc)},K.distanceSquared=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),K.subtract(t,i,mc),K.magnitudeSquared(mc)},K.normalize=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=K.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,i.z=t.z/e,i.w=t.w/e,isNaN(i.x)||isNaN(i.y)||isNaN(i.z)||isNaN(i.w))throw new G("normalized result is not a number");return i},K.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},K.multiplyComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e.w=t.w*i.w,e},K.divideComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e.w=t.w/i.w,e},K.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},K.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},K.multiplyByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},K.divideByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},K.negate=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},K.abs=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i.z=Math.abs(t.z),i.w=Math.abs(t.w),i};const yv=new K;K.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),K.multiplyByScalar(i,e,yv),n=K.multiplyByScalar(t,1-e,n),K.add(yv,n,n)};const Ub=new K;K.mostOrthogonalAxis=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=K.normalize(t,Ub);return K.abs(e,e),e.x<=e.y?e.x<=e.z?e.x<=e.w?i=K.clone(K.UNIT_X,i):i=K.clone(K.UNIT_W,i):e.z<=e.w?i=K.clone(K.UNIT_Z,i):i=K.clone(K.UNIT_W,i):e.y<=e.z?e.y<=e.w?i=K.clone(K.UNIT_Y,i):i=K.clone(K.UNIT_W,i):e.z<=e.w?i=K.clone(K.UNIT_Z,i):i=K.clone(K.UNIT_W,i),i},K.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},K.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]&&t.z===i[e+2]&&t.w===i[e+3]},K.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.x,i.x,e,n)&&N.equalsEpsilon(t.y,i.y,e,n)&&N.equalsEpsilon(t.z,i.z,e,n)&&N.equalsEpsilon(t.w,i.w,e,n)},K.ZERO=Object.freeze(new K(0,0,0,0)),K.ONE=Object.freeze(new K(1,1,1,1)),K.UNIT_X=Object.freeze(new K(1,0,0,0)),K.UNIT_Y=Object.freeze(new K(0,1,0,0)),K.UNIT_Z=Object.freeze(new K(0,0,1,0)),K.UNIT_W=Object.freeze(new K(0,0,0,1)),K.prototype.clone=function(t){return K.clone(this,t)},K.prototype.equals=function(t){return K.equals(this,t)},K.prototype.equalsEpsilon=function(t,i,e){return K.equalsEpsilon(this,t,i,e)},K.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Au=new Float32Array(1),dt=new Uint8Array(Au.buffer),Wb=new Uint32Array([287454020]),wv=new Uint8Array(Wb.buffer)[0]===68;K.packFloat=function(t,i){return S.typeOf.number("value",t),T(i)||(i=new K),Au[0]=t,wv?(i.x=dt[0],i.y=dt[1],i.z=dt[2],i.w=dt[3]):(i.x=dt[3],i.y=dt[2],i.z=dt[1],i.w=dt[0]),i},K.unpackFloat=function(t){return S.typeOf.object("packedFloat",t),wv?(dt[0]=t.x,dt[1]=t.y,dt[2]=t.z,dt[3]=t.w):(dt[0]=t.w,dt[1]=t.z,dt[2]=t.y,dt[3]=t.x),Au[0]};const Ci={};Ci.EMPTY_OBJECT=Object.freeze({}),Ci.EMPTY_ARRAY=Object.freeze([]);function H(t,i,e,n,o,s,r,l,c){this[0]=t??0,this[1]=n??0,this[2]=r??0,this[3]=i??0,this[4]=o??0,this[5]=l??0,this[6]=e??0,this[7]=s??0,this[8]=c??0}H.packedLength=9,H.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i},H.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new H),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e},H.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*9;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 9 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)H.pack(t[o],i,o*9);return i},H.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new G("array length must be a multiple of 9.");const e=t.length;T(i)?i.length=e/9:i=new Array(e/9);for(let n=0;n<e;n+=9){const o=n/9;i[o]=H.unpack(t,n,i[o])}return i},H.clone=function(t,i){if(T(t))return T(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):new H(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},H.fromArray=H.unpack,H.fromColumnMajorArray=function(t,i){return S.defined("values",t),H.clone(t,i)},H.fromRowMajorArray=function(t,i){return S.defined("values",t),T(i)?(i[0]=t[0],i[1]=t[3],i[2]=t[6],i[3]=t[1],i[4]=t[4],i[5]=t[7],i[6]=t[2],i[7]=t[5],i[8]=t[8],i):new H(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},H.fromQuaternion=function(t,i){S.typeOf.object("quaternion",t);const e=t.x*t.x,n=t.x*t.y,o=t.x*t.z,s=t.x*t.w,r=t.y*t.y,l=t.y*t.z,c=t.y*t.w,u=t.z*t.z,d=t.z*t.w,p=t.w*t.w,f=e-r-u+p,m=2*(n-d),g=2*(o+c),y=2*(n+d),_=-e+r-u+p,P=2*(l-s),w=2*(o-c),b=2*(l+s),x=-e-r+u+p;return T(i)?(i[0]=f,i[1]=y,i[2]=w,i[3]=m,i[4]=_,i[5]=b,i[6]=g,i[7]=P,i[8]=x,i):new H(f,m,g,y,_,P,w,b,x)},H.fromHeadingPitchRoll=function(t,i){S.typeOf.object("headingPitchRoll",t);const e=Math.cos(-t.pitch),n=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),r=Math.sin(-t.heading),l=Math.sin(t.roll),c=e*n,u=-o*r+l*s*n,d=l*r+o*s*n,p=e*r,f=o*n+l*s*r,m=-l*n+o*s*r,g=-s,y=l*e,_=o*e;return T(i)?(i[0]=c,i[1]=p,i[2]=g,i[3]=u,i[4]=f,i[5]=y,i[6]=d,i[7]=m,i[8]=_,i):new H(c,u,d,p,f,m,g,y,_)},H.fromScale=function(t,i){return S.typeOf.object("scale",t),T(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=t.y,i[5]=0,i[6]=0,i[7]=0,i[8]=t.z,i):new H(t.x,0,0,0,t.y,0,0,0,t.z)},H.fromUniformScale=function(t,i){return S.typeOf.number("scale",t),T(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=t,i[5]=0,i[6]=0,i[7]=0,i[8]=t,i):new H(t,0,0,0,t,0,0,0,t)},H.fromCrossProduct=function(t,i){return S.typeOf.object("vector",t),T(i)?(i[0]=0,i[1]=t.z,i[2]=-t.y,i[3]=-t.z,i[4]=0,i[5]=t.x,i[6]=t.y,i[7]=-t.x,i[8]=0,i):new H(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},H.fromRotationX=function(t,i){S.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return T(i)?(i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=e,i[5]=n,i[6]=0,i[7]=-n,i[8]=e,i):new H(1,0,0,0,e,-n,0,n,e)},H.fromRotationY=function(t,i){S.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return T(i)?(i[0]=e,i[1]=0,i[2]=-n,i[3]=0,i[4]=1,i[5]=0,i[6]=n,i[7]=0,i[8]=e,i):new H(e,0,n,0,1,0,-n,0,e)},H.fromRotationZ=function(t,i){S.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return T(i)?(i[0]=e,i[1]=n,i[2]=0,i[3]=-n,i[4]=e,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new H(e,-n,0,n,e,0,0,0,1)},H.toArray=function(t,i){return S.typeOf.object("matrix",t),T(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},H.getElementIndex=function(t,i){return S.typeOf.number.greaterThanOrEquals("row",i,0),S.typeOf.number.lessThanOrEquals("row",i,2),S.typeOf.number.greaterThanOrEquals("column",t,0),S.typeOf.number.lessThanOrEquals("column",t,2),t*3+i},H.getColumn=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,2),S.typeOf.object("result",e);const n=i*3,o=t[n],s=t[n+1],r=t[n+2];return e.x=o,e.y=s,e.z=r,e},H.setColumn=function(t,i,e,n){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,2),S.typeOf.object("cartesian",e),S.typeOf.object("result",n),n=H.clone(t,n);const o=i*3;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n},H.getRow=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,2),S.typeOf.object("result",e);const n=t[i],o=t[i+3],s=t[i+6];return e.x=n,e.y=o,e.z=s,e},H.setRow=function(t,i,e,n){return S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,2),S.typeOf.object("cartesian",e),S.typeOf.object("result",n),n=H.clone(t,n),n[i]=e.x,n[i+3]=e.y,n[i+6]=e.z,n};const Gb=new F;H.setScale=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("scale",i),S.typeOf.object("result",e);const n=H.getScale(t,Gb),o=i.x/n.x,s=i.y/n.y,r=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*s,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e};const Hb=new F;H.setUniformScale=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number("scale",i),S.typeOf.object("result",e);const n=H.getScale(t,Hb),o=i/n.x,s=i/n.y,r=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*s,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e};const Tu=new F;H.getScale=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i.x=F.magnitude(F.fromElements(t[0],t[1],t[2],Tu)),i.y=F.magnitude(F.fromElements(t[3],t[4],t[5],Tu)),i.z=F.magnitude(F.fromElements(t[6],t[7],t[8],Tu)),i};const Cv=new F;H.getMaximumScale=function(t){return H.getScale(t,Cv),F.maximumComponent(Cv)};const qb=new F;H.setRotation=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("result",e);const n=H.getScale(t,qb);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=i[3]*n.y,e[4]=i[4]*n.y,e[5]=i[5]*n.y,e[6]=i[6]*n.z,e[7]=i[7]*n.z,e[8]=i[8]*n.z,e};const $b=new F;H.getRotation=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=H.getScale(t,$b);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[3]/e.y,i[4]=t[4]/e.y,i[5]=t[5]/e.y,i[6]=t[6]/e.z,i[7]=t[7]/e.z,i[8]=t[8]/e.z,i},H.multiply=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t[0]*i[0]+t[3]*i[1]+t[6]*i[2],o=t[1]*i[0]+t[4]*i[1]+t[7]*i[2],s=t[2]*i[0]+t[5]*i[1]+t[8]*i[2],r=t[0]*i[3]+t[3]*i[4]+t[6]*i[5],l=t[1]*i[3]+t[4]*i[4]+t[7]*i[5],c=t[2]*i[3]+t[5]*i[4]+t[8]*i[5],u=t[0]*i[6]+t[3]*i[7]+t[6]*i[8],d=t[1]*i[6]+t[4]*i[7]+t[7]*i[8],p=t[2]*i[6]+t[5]*i[7]+t[8]*i[8];return e[0]=n,e[1]=o,e[2]=s,e[3]=r,e[4]=l,e[5]=c,e[6]=u,e[7]=d,e[8]=p,e},H.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e},H.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e},H.multiplyByVector=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("cartesian",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z,r=t[0]*n+t[3]*o+t[6]*s,l=t[1]*n+t[4]*o+t[7]*s,c=t[2]*n+t[5]*o+t[8]*s;return e.x=r,e.y=l,e.z=c,e},H.multiplyByScalar=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},H.multiplyByScale=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.object("scale",i),S.typeOf.object("result",e),e[0]=t[0]*i.x,e[1]=t[1]*i.x,e[2]=t[2]*i.x,e[3]=t[3]*i.y,e[4]=t[4]*i.y,e[5]=t[5]*i.y,e[6]=t[6]*i.z,e[7]=t[7]*i.z,e[8]=t[8]*i.z,e},H.multiplyByUniformScale=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.number("scale",i),S.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},H.negate=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i},H.transpose=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=t[0],n=t[3],o=t[6],s=t[1],r=t[4],l=t[7],c=t[2],u=t[5],d=t[8];return i[0]=e,i[1]=n,i[2]=o,i[3]=s,i[4]=r,i[5]=l,i[6]=c,i[7]=u,i[8]=d,i};function Xb(t){let i=0;for(let e=0;e<9;++e){const n=t[e];i+=n*n}return Math.sqrt(i)}const Mu=[1,0,0],Iu=[2,2,1];function Yb(t){let i=0;for(let e=0;e<3;++e){const n=t[H.getElementIndex(Iu[e],Mu[e])];i+=2*n*n}return Math.sqrt(i)}function Zb(t,i){const e=N.EPSILON15;let n=0,o=1;for(let u=0;u<3;++u){const d=Math.abs(t[H.getElementIndex(Iu[u],Mu[u])]);d>n&&(o=u,n=d)}let s=1,r=0;const l=Mu[o],c=Iu[o];if(Math.abs(t[H.getElementIndex(c,l)])>e){const u=t[H.getElementIndex(c,c)],d=t[H.getElementIndex(l,l)],p=t[H.getElementIndex(c,l)],f=(u-d)/2/p;let m;f<0?m=-1/(-f+Math.sqrt(1+f*f)):m=1/(f+Math.sqrt(1+f*f)),s=1/Math.sqrt(1+m*m),r=m*s}return i=H.clone(H.IDENTITY,i),i[H.getElementIndex(l,l)]=i[H.getElementIndex(c,c)]=s,i[H.getElementIndex(c,l)]=r,i[H.getElementIndex(l,c)]=-r,i}const vc=new H,_v=new H;H.computeEigenDecomposition=function(t,i){S.typeOf.object("matrix",t);const e=N.EPSILON20,n=10;let o=0,s=0;T(i)||(i={});const r=i.unitary=H.clone(H.IDENTITY,i.unitary),l=i.diagonal=H.clone(t,i.diagonal),c=e*Xb(l);for(;s<n&&Yb(l)>c;)Zb(l,vc),H.transpose(vc,_v),H.multiply(l,vc,l),H.multiply(_v,l,l),H.multiply(r,vc,r),++o>2&&(++s,o=0);return i},H.abs=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i},H.determinant=function(t){S.typeOf.object("matrix",t);const i=t[0],e=t[3],n=t[6],o=t[1],s=t[4],r=t[7],l=t[2],c=t[5],u=t[8];return i*(s*u-c*r)+o*(c*n-e*u)+l*(e*r-s*n)},H.inverse=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],s=t[3],r=t[4],l=t[5],c=t[6],u=t[7],d=t[8],p=H.determinant(t);if(Math.abs(p)<=N.EPSILON15)throw new G("matrix is not invertible");i[0]=r*d-u*l,i[1]=u*o-n*d,i[2]=n*l-r*o,i[3]=c*l-s*d,i[4]=e*d-c*o,i[5]=s*o-e*l,i[6]=s*u-c*r,i[7]=c*n-e*u,i[8]=e*r-s*n;const f=1/p;return H.multiplyByScalar(i,f,i)};const Qb=new H;H.inverseTranspose=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),H.inverse(H.transpose(t,Qb),i)},H.equals=function(t,i){return t===i||T(t)&&T(i)&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[3]===i[3]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[7]===i[7]&&t[8]===i[8]},H.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e},H.IDENTITY=Object.freeze(new H(1,0,0,0,1,0,0,0,1)),H.ZERO=Object.freeze(new H(0,0,0,0,0,0,0,0,0)),H.COLUMN0ROW0=0,H.COLUMN0ROW1=1,H.COLUMN0ROW2=2,H.COLUMN1ROW0=3,H.COLUMN1ROW1=4,H.COLUMN1ROW2=5,H.COLUMN2ROW0=6,H.COLUMN2ROW1=7,H.COLUMN2ROW2=8,Object.defineProperties(H.prototype,{length:{get:function(){return H.packedLength}}}),H.prototype.clone=function(t){return H.clone(this,t)},H.prototype.equals=function(t){return H.equals(this,t)},H.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]},H.prototype.equalsEpsilon=function(t,i){return H.equalsEpsilon(this,t,i)},H.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
321
321
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
322
322
|
(${this[2]}, ${this[5]}, ${this[8]})`};function at(t){this.name="RuntimeError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}T(Object.create)&&(at.prototype=Object.create(Error.prototype),at.prototype.constructor=at),at.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return T(this.stack)&&(t+=`
|
|
323
323
|
${this.stack.toString()}`),t};function $(t,i,e,n,o,s,r,l,c,u,d,p,f,m,g,y){this[0]=t??0,this[1]=o??0,this[2]=c??0,this[3]=f??0,this[4]=i??0,this[5]=s??0,this[6]=u??0,this[7]=m??0,this[8]=e??0,this[9]=r??0,this[10]=d??0,this[11]=g??0,this[12]=n??0,this[13]=l??0,this[14]=p??0,this[15]=y??0}$.packedLength=16,$.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i[e++]=t[9],i[e++]=t[10],i[e++]=t[11],i[e++]=t[12],i[e++]=t[13],i[e++]=t[14],i[e]=t[15],i},$.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new $),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e[9]=t[i++],e[10]=t[i++],e[11]=t[i++],e[12]=t[i++],e[13]=t[i++],e[14]=t[i++],e[15]=t[i],e},$.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*16;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 16 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)$.pack(t[o],i,o*16);return i},$.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!==0)throw new G("array length must be a multiple of 16.");const e=t.length;T(i)?i.length=e/16:i=new Array(e/16);for(let n=0;n<e;n+=16){const o=n/16;i[o]=$.unpack(t,n,i[o])}return i},$.clone=function(t,i){if(T(t))return T(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):new $(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},$.fromArray=$.unpack,$.fromColumnMajorArray=function(t,i){return S.defined("values",t),$.clone(t,i)},$.fromRowMajorArray=function(t,i){return S.defined("values",t),T(i)?(i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=t[1],i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=t[2],i[9]=t[6],i[10]=t[10],i[11]=t[14],i[12]=t[3],i[13]=t[7],i[14]=t[11],i[15]=t[15],i):new $(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},$.fromRotationTranslation=function(t,i,e){return S.typeOf.object("rotation",t),i=i??F.ZERO,T(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=1,e):new $(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},$.fromTranslationQuaternionRotationScale=function(t,i,e,n){S.typeOf.object("translation",t),S.typeOf.object("rotation",i),S.typeOf.object("scale",e),T(n)||(n=new $);const o=e.x,s=e.y,r=e.z,l=i.x*i.x,c=i.x*i.y,u=i.x*i.z,d=i.x*i.w,p=i.y*i.y,f=i.y*i.z,m=i.y*i.w,g=i.z*i.z,y=i.z*i.w,_=i.w*i.w,P=l-p-g+_,w=2*(c-y),b=2*(u+m),x=2*(c+y),A=-l+p-g+_,M=2*(f-d),D=2*(u-m),L=2*(f+d),V=-l-p+g+_;return n[0]=P*o,n[1]=x*o,n[2]=D*o,n[3]=0,n[4]=w*s,n[5]=A*s,n[6]=L*s,n[7]=0,n[8]=b*r,n[9]=M*r,n[10]=V*r,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},$.fromTranslationRotationScale=function(t,i){return S.typeOf.object("translationRotationScale",t),$.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,i)},$.fromTranslation=function(t,i){return S.typeOf.object("translation",t),$.fromRotationTranslation(H.IDENTITY,t,i)},$.fromScale=function(t,i){return S.typeOf.object("scale",t),T(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t.y,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t.z,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new $(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},$.fromUniformScale=function(t,i){return S.typeOf.number("scale",t),T(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new $(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},$.fromRotation=function(t,i){return S.typeOf.object("rotation",t),T(i)||(i=new $),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};const rs=new F,as=new F,vr=new F;$.fromCamera=function(t,i){S.typeOf.object("camera",t);const e=t.position,n=t.direction,o=t.up;S.typeOf.object("camera.position",e),S.typeOf.object("camera.direction",n),S.typeOf.object("camera.up",o),F.normalize(n,rs),F.normalize(F.cross(rs,o,as),as),F.normalize(F.cross(as,rs,vr),vr);const s=as.x,r=as.y,l=as.z,c=rs.x,u=rs.y,d=rs.z,p=vr.x,f=vr.y,m=vr.z,g=e.x,y=e.y,_=e.z,P=s*-g+r*-y+l*-_,w=p*-g+f*-y+m*-_,b=c*g+u*y+d*_;return T(i)?(i[0]=s,i[1]=p,i[2]=-c,i[3]=0,i[4]=r,i[5]=f,i[6]=-u,i[7]=0,i[8]=l,i[9]=m,i[10]=-d,i[11]=0,i[12]=P,i[13]=w,i[14]=b,i[15]=1,i):new $(s,r,l,P,p,f,m,w,-c,-u,-d,b,0,0,0,1)},$.computePerspectiveFieldOfView=function(t,i,e,n,o){S.typeOf.number.greaterThan("fovY",t,0),S.typeOf.number.lessThan("fovY",t,Math.PI),S.typeOf.number.greaterThan("near",e,0),S.typeOf.number.greaterThan("far",n,0),S.typeOf.object("result",o);const r=1/Math.tan(t*.5),l=r/i,c=(n+e)/(e-n),u=2*n*e/(e-n);return o[0]=l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o},$.computeOrthographicOffCenter=function(t,i,e,n,o,s,r){S.typeOf.number("left",t),S.typeOf.number("right",i),S.typeOf.number("bottom",e),S.typeOf.number("top",n),S.typeOf.number("near",o),S.typeOf.number("far",s),S.typeOf.object("result",r);let l=1/(i-t),c=1/(n-e),u=1/(s-o);const d=-(i+t)*l,p=-(n+e)*c,f=-(s+o)*u;return l*=2,c*=2,u*=-2,r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=u,r[11]=0,r[12]=d,r[13]=p,r[14]=f,r[15]=1,r},$.computePerspectiveOffCenter=function(t,i,e,n,o,s,r){S.typeOf.number("left",t),S.typeOf.number("right",i),S.typeOf.number("bottom",e),S.typeOf.number("top",n),S.typeOf.number("near",o),S.typeOf.number("far",s),S.typeOf.object("result",r);const l=2*o/(i-t),c=2*o/(n-e),u=(i+t)/(i-t),d=(n+e)/(n-e),p=-(s+o)/(s-o),f=-1,m=-2*s*o/(s-o);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=u,r[9]=d,r[10]=p,r[11]=f,r[12]=0,r[13]=0,r[14]=m,r[15]=0,r},$.computeInfinitePerspectiveOffCenter=function(t,i,e,n,o,s){S.typeOf.number("left",t),S.typeOf.number("right",i),S.typeOf.number("bottom",e),S.typeOf.number("top",n),S.typeOf.number("near",o),S.typeOf.object("result",s);const r=2*o/(i-t),l=2*o/(n-e),c=(i+t)/(i-t),u=(n+e)/(n-e),d=-1,p=-1,f=-2*o;return s[0]=r,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=c,s[9]=u,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=f,s[15]=0,s},$.computeViewportTransformation=function(t,i,e,n){T(n)||(n=new $),t=t??Ci.EMPTY_OBJECT;const o=t.x??0,s=t.y??0,r=t.width??0,l=t.height??0;i=i??0,e=e??1;const c=r*.5,u=l*.5,d=(e-i)*.5,p=c,f=u,m=d,g=o+c,y=s+u,_=i+d,P=1;return n[0]=p,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=m,n[11]=0,n[12]=g,n[13]=y,n[14]=_,n[15]=P,n},$.computeView=function(t,i,e,n,o){return S.typeOf.object("position",t),S.typeOf.object("direction",i),S.typeOf.object("up",e),S.typeOf.object("right",n),S.typeOf.object("result",o),o[0]=n.x,o[1]=e.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=e.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=e.z,o[10]=-i.z,o[11]=0,o[12]=-F.dot(n,t),o[13]=-F.dot(e,t),o[14]=F.dot(i,t),o[15]=1,o},$.toArray=function(t,i){return S.typeOf.object("matrix",t),T(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},$.getElementIndex=function(t,i){return S.typeOf.number.greaterThanOrEquals("row",i,0),S.typeOf.number.lessThanOrEquals("row",i,3),S.typeOf.number.greaterThanOrEquals("column",t,0),S.typeOf.number.lessThanOrEquals("column",t,3),t*4+i},$.getColumn=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,3),S.typeOf.object("result",e);const n=i*4,o=t[n],s=t[n+1],r=t[n+2],l=t[n+3];return e.x=o,e.y=s,e.z=r,e.w=l,e},$.setColumn=function(t,i,e,n){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,3),S.typeOf.object("cartesian",e),S.typeOf.object("result",n),n=$.clone(t,n);const o=i*4;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n[o+3]=e.w,n},$.getRow=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,3),S.typeOf.object("result",e);const n=t[i],o=t[i+4],s=t[i+8],r=t[i+12];return e.x=n,e.y=o,e.z=s,e.w=r,e},$.setRow=function(t,i,e,n){return S.typeOf.object("matrix",t),S.typeOf.number.greaterThanOrEquals("index",i,0),S.typeOf.number.lessThanOrEquals("index",i,3),S.typeOf.object("cartesian",e),S.typeOf.object("result",n),n=$.clone(t,n),n[i]=e.x,n[i+4]=e.y,n[i+8]=e.z,n[i+12]=e.w,n},$.setTranslation=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.object("translation",i),S.typeOf.object("result",e),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=t[15],e};const kb=new F;$.setScale=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("scale",i),S.typeOf.object("result",e);const n=$.getScale(t,kb),o=i.x/n.x,s=i.y/n.y,r=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7],e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const Kb=new F;$.setUniformScale=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.number("scale",i),S.typeOf.object("result",e);const n=$.getScale(t,Kb),o=i/n.x,s=i/n.y,r=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7],e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const Du=new F;$.getScale=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i.x=F.magnitude(F.fromElements(t[0],t[1],t[2],Du)),i.y=F.magnitude(F.fromElements(t[4],t[5],t[6],Du)),i.z=F.magnitude(F.fromElements(t[8],t[9],t[10],Du)),i};const Pv=new F;$.getMaximumScale=function(t){return $.getScale(t,Pv),F.maximumComponent(Pv)};const Jb=new F;$.setRotation=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("result",e);const n=$.getScale(t,Jb);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=t[3],e[4]=i[3]*n.y,e[5]=i[4]*n.y,e[6]=i[5]*n.y,e[7]=t[7],e[8]=i[6]*n.z,e[9]=i[7]*n.z,e[10]=i[8]*n.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const jb=new F;$.getRotation=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=$.getScale(t,jb);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[4]/e.y,i[4]=t[5]/e.y,i[5]=t[6]/e.y,i[6]=t[8]/e.z,i[7]=t[9]/e.z,i[8]=t[10]/e.z,i},$.multiply=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t[0],o=t[1],s=t[2],r=t[3],l=t[4],c=t[5],u=t[6],d=t[7],p=t[8],f=t[9],m=t[10],g=t[11],y=t[12],_=t[13],P=t[14],w=t[15],b=i[0],x=i[1],A=i[2],M=i[3],D=i[4],L=i[5],V=i[6],O=i[7],z=i[8],U=i[9],C=i[10],E=i[11],R=i[12],B=i[13],W=i[14],Y=i[15],q=n*b+l*x+p*A+y*M,X=o*b+c*x+f*A+_*M,Q=s*b+u*x+m*A+P*M,ee=r*b+d*x+g*A+w*M,oe=n*D+l*L+p*V+y*O,fe=o*D+c*L+f*V+_*O,ve=s*D+u*L+m*V+P*O,xe=r*D+d*L+g*V+w*O,Oe=n*z+l*U+p*C+y*E,Ue=o*z+c*U+f*C+_*E,ge=s*z+u*U+m*C+P*E,ie=r*z+d*U+g*C+w*E,ce=n*R+l*B+p*W+y*Y,he=o*R+c*B+f*W+_*Y,Ee=s*R+u*B+m*W+P*Y,Ne=r*R+d*B+g*W+w*Y;return e[0]=q,e[1]=X,e[2]=Q,e[3]=ee,e[4]=oe,e[5]=fe,e[6]=ve,e[7]=xe,e[8]=Oe,e[9]=Ue,e[10]=ge,e[11]=ie,e[12]=ce,e[13]=he,e[14]=Ee,e[15]=Ne,e},$.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e},$.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e},$.multiplyTransformation=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t[0],o=t[1],s=t[2],r=t[4],l=t[5],c=t[6],u=t[8],d=t[9],p=t[10],f=t[12],m=t[13],g=t[14],y=i[0],_=i[1],P=i[2],w=i[4],b=i[5],x=i[6],A=i[8],M=i[9],D=i[10],L=i[12],V=i[13],O=i[14],z=n*y+r*_+u*P,U=o*y+l*_+d*P,C=s*y+c*_+p*P,E=n*w+r*b+u*x,R=o*w+l*b+d*x,B=s*w+c*b+p*x,W=n*A+r*M+u*D,Y=o*A+l*M+d*D,q=s*A+c*M+p*D,X=n*L+r*V+u*O+f,Q=o*L+l*V+d*O+m,ee=s*L+c*V+p*O+g;return e[0]=z,e[1]=U,e[2]=C,e[3]=0,e[4]=E,e[5]=R,e[6]=B,e[7]=0,e[8]=W,e[9]=Y,e[10]=q,e[11]=0,e[12]=X,e[13]=Q,e[14]=ee,e[15]=1,e},$.multiplyByMatrix3=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("rotation",i),S.typeOf.object("result",e);const n=t[0],o=t[1],s=t[2],r=t[4],l=t[5],c=t[6],u=t[8],d=t[9],p=t[10],f=i[0],m=i[1],g=i[2],y=i[3],_=i[4],P=i[5],w=i[6],b=i[7],x=i[8],A=n*f+r*m+u*g,M=o*f+l*m+d*g,D=s*f+c*m+p*g,L=n*y+r*_+u*P,V=o*y+l*_+d*P,O=s*y+c*_+p*P,z=n*w+r*b+u*x,U=o*w+l*b+d*x,C=s*w+c*b+p*x;return e[0]=A,e[1]=M,e[2]=D,e[3]=0,e[4]=L,e[5]=V,e[6]=O,e[7]=0,e[8]=z,e[9]=U,e[10]=C,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},$.multiplyByTranslation=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("translation",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z,r=n*t[0]+o*t[4]+s*t[8]+t[12],l=n*t[1]+o*t[5]+s*t[9]+t[13],c=n*t[2]+o*t[6]+s*t[10]+t[14];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=r,e[13]=l,e[14]=c,e[15]=t[15],e},$.multiplyByScale=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("scale",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z;return n===1&&o===1&&s===1?$.clone(t,e):(e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=o*t[6],e[7]=t[7],e[8]=s*t[8],e[9]=s*t[9],e[10]=s*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},$.multiplyByUniformScale=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.number("scale",i),S.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3],e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7],e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},$.multiplyByVector=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("cartesian",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z,r=i.w,l=t[0]*n+t[4]*o+t[8]*s+t[12]*r,c=t[1]*n+t[5]*o+t[9]*s+t[13]*r,u=t[2]*n+t[6]*o+t[10]*s+t[14]*r,d=t[3]*n+t[7]*o+t[11]*s+t[15]*r;return e.x=l,e.y=c,e.z=u,e.w=d,e},$.multiplyByPointAsVector=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("cartesian",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z,r=t[0]*n+t[4]*o+t[8]*s,l=t[1]*n+t[5]*o+t[9]*s,c=t[2]*n+t[6]*o+t[10]*s;return e.x=r,e.y=l,e.z=c,e},$.multiplyByPoint=function(t,i,e){S.typeOf.object("matrix",t),S.typeOf.object("cartesian",i),S.typeOf.object("result",e);const n=i.x,o=i.y,s=i.z,r=t[0]*n+t[4]*o+t[8]*s+t[12],l=t[1]*n+t[5]*o+t[9]*s+t[13],c=t[2]*n+t[6]*o+t[10]*s+t[14];return e.x=r,e.y=l,e.z=c,e},$.multiplyByScalar=function(t,i,e){return S.typeOf.object("matrix",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e},$.negate=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i[9]=-t[9],i[10]=-t[10],i[11]=-t[11],i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=-t[15],i},$.transpose=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=t[1],n=t[2],o=t[3],s=t[6],r=t[7],l=t[11];return i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=e,i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=n,i[9]=s,i[10]=t[10],i[11]=t[14],i[12]=o,i[13]=r,i[14]=l,i[15]=t[15],i},$.abs=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i[9]=Math.abs(t[9]),i[10]=Math.abs(t[10]),i[11]=Math.abs(t[11]),i[12]=Math.abs(t[12]),i[13]=Math.abs(t[13]),i[14]=Math.abs(t[14]),i[15]=Math.abs(t[15]),i},$.equals=function(t,i){return t===i||T(t)&&T(i)&&t[12]===i[12]&&t[13]===i[13]&&t[14]===i[14]&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[8]===i[8]&&t[9]===i[9]&&t[10]===i[10]&&t[3]===i[3]&&t[7]===i[7]&&t[11]===i[11]&&t[15]===i[15]},$.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e&&Math.abs(t[9]-i[9])<=e&&Math.abs(t[10]-i[10])<=e&&Math.abs(t[11]-i[11])<=e&&Math.abs(t[12]-i[12])<=e&&Math.abs(t[13]-i[13])<=e&&Math.abs(t[14]-i[14])<=e&&Math.abs(t[15]-i[15])<=e},$.getTranslation=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i.x=t[12],i.y=t[13],i.z=t[14],i},$.getMatrix3=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[4],i[4]=t[5],i[5]=t[6],i[6]=t[8],i[7]=t[9],i[8]=t[10],i};const eS=new H,tS=new H,iS=new K,nS=new K(0,0,0,1);$.inverse=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=t[0],n=t[4],o=t[8],s=t[12],r=t[1],l=t[5],c=t[9],u=t[13],d=t[2],p=t[6],f=t[10],m=t[14],g=t[3],y=t[7],_=t[11],P=t[15];let w=f*P,b=m*_,x=p*P,A=m*y,M=p*_,D=f*y,L=d*P,V=m*g,O=d*_,z=f*g,U=d*y,C=p*g;const E=w*l+A*c+M*u-(b*l+x*c+D*u),R=b*r+L*c+z*u-(w*r+V*c+O*u),B=x*r+V*l+U*u-(A*r+L*l+C*u),W=D*r+O*l+C*c-(M*r+z*l+U*c),Y=b*n+x*o+D*s-(w*n+A*o+M*s),q=w*e+V*o+O*s-(b*e+L*o+z*s),X=A*e+L*n+C*s-(x*e+V*n+U*s),Q=M*e+z*n+U*o-(D*e+O*n+C*o);w=o*u,b=s*c,x=n*u,A=s*l,M=n*c,D=o*l,L=e*u,V=s*r,O=e*c,z=o*r,U=e*l,C=n*r;const ee=w*y+A*_+M*P-(b*y+x*_+D*P),oe=b*g+L*_+z*P-(w*g+V*_+O*P),fe=x*g+V*y+U*P-(A*g+L*y+C*P),ve=D*g+O*y+C*_-(M*g+z*y+U*_),xe=x*f+D*m+b*p-(M*m+w*p+A*f),Oe=O*m+w*d+V*f-(L*f+z*m+b*d),Ue=L*p+C*m+A*d-(U*m+x*d+V*p),ge=U*f+M*d+z*p-(O*p+C*f+D*d);let ie=e*E+n*R+o*B+s*W;if(Math.abs(ie)<N.EPSILON21){if(H.equalsEpsilon($.getMatrix3(t,eS),tS,N.EPSILON7)&&K.equals($.getRow(t,3,iS),nS))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=1,i;throw new at("matrix is not invertible because its determinate is zero.")}return ie=1/ie,i[0]=E*ie,i[1]=R*ie,i[2]=B*ie,i[3]=W*ie,i[4]=Y*ie,i[5]=q*ie,i[6]=X*ie,i[7]=Q*ie,i[8]=ee*ie,i[9]=oe*ie,i[10]=fe*ie,i[11]=ve*ie,i[12]=xe*ie,i[13]=Oe*ie,i[14]=Ue*ie,i[15]=ge*ie,i},$.inverseTransformation=function(t,i){S.typeOf.object("matrix",t),S.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],s=t[4],r=t[5],l=t[6],c=t[8],u=t[9],d=t[10],p=t[12],f=t[13],m=t[14],g=-e*p-n*f-o*m,y=-s*p-r*f-l*m,_=-c*p-u*f-d*m;return i[0]=e,i[1]=s,i[2]=c,i[3]=0,i[4]=n,i[5]=r,i[6]=u,i[7]=0,i[8]=o,i[9]=l,i[10]=d,i[11]=0,i[12]=g,i[13]=y,i[14]=_,i[15]=1,i};const oS=new $;$.inverseTranspose=function(t,i){return S.typeOf.object("matrix",t),S.typeOf.object("result",i),$.inverse($.transpose(t,oS),i)},$.IDENTITY=Object.freeze(new $(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),$.ZERO=Object.freeze(new $(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),$.COLUMN0ROW0=0,$.COLUMN0ROW1=1,$.COLUMN0ROW2=2,$.COLUMN0ROW3=3,$.COLUMN1ROW0=4,$.COLUMN1ROW1=5,$.COLUMN1ROW2=6,$.COLUMN1ROW3=7,$.COLUMN2ROW0=8,$.COLUMN2ROW1=9,$.COLUMN2ROW2=10,$.COLUMN2ROW3=11,$.COLUMN3ROW0=12,$.COLUMN3ROW1=13,$.COLUMN3ROW2=14,$.COLUMN3ROW3=15,Object.defineProperties($.prototype,{length:{get:function(){return $.packedLength}}}),$.prototype.clone=function(t){return $.clone(this,t)},$.prototype.equals=function(t){return $.equals(this,t)},$.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]&&t[9]===i[e+9]&&t[10]===i[e+10]&&t[11]===i[e+11]&&t[12]===i[e+12]&&t[13]===i[e+13]&&t[14]===i[e+14]&&t[15]===i[e+15]},$.prototype.equalsEpsilon=function(t,i){return $.equalsEpsilon(this,t,i)},$.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
|
|
324
324
|
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
|
|
325
325
|
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
|
|
326
|
-
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function sS(){return!0}function rS(t,i){i=i??"This object was destroyed, i.e., destroy() was called.";function e(){throw new G(i)}for(const n in t)typeof t[n]=="function"&&(t[n]=e);t.isDestroyed=sS}let Sn;const Ge={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Mt={};Object.defineProperties(Mt,{element:{get:function(){if(Mt.supportsFullscreen())return document[Ge.fullscreenElement]}},changeEventName:{get:function(){if(Mt.supportsFullscreen())return Ge.fullscreenchange}},errorEventName:{get:function(){if(Mt.supportsFullscreen())return Ge.fullscreenerror}},enabled:{get:function(){if(Mt.supportsFullscreen())return document[Ge.fullscreenEnabled]}},fullscreen:{get:function(){if(Mt.supportsFullscreen())return Mt.element!==null}}}),Mt.supportsFullscreen=function(){if(T(Sn))return Sn;Sn=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return Ge.requestFullscreen="requestFullscreen",Ge.exitFullscreen="exitFullscreen",Ge.fullscreenEnabled="fullscreenEnabled",Ge.fullscreenElement="fullscreenElement",Ge.fullscreenchange="fullscreenchange",Ge.fullscreenerror="fullscreenerror",Sn=!0,Sn;const i=["webkit","moz","o","ms","khtml"];let e;for(let n=0,o=i.length;n<o;++n){const s=i[n];e=`${s}RequestFullscreen`,typeof t[e]=="function"?(Ge.requestFullscreen=e,Sn=!0):(e=`${s}RequestFullScreen`,typeof t[e]=="function"&&(Ge.requestFullscreen=e,Sn=!0)),e=`${s}ExitFullscreen`,typeof document[e]=="function"?Ge.exitFullscreen=e:(e=`${s}CancelFullScreen`,typeof document[e]=="function"&&(Ge.exitFullscreen=e)),e=`${s}FullscreenEnabled`,document[e]!==void 0?Ge.fullscreenEnabled=e:(e=`${s}FullScreenEnabled`,document[e]!==void 0&&(Ge.fullscreenEnabled=e)),e=`${s}FullscreenElement`,document[e]!==void 0?Ge.fullscreenElement=e:(e=`${s}FullScreenElement`,document[e]!==void 0&&(Ge.fullscreenElement=e)),e=`${s}fullscreenchange`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenChange"),Ge.fullscreenchange=e),e=`${s}fullscreenerror`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenError"),Ge.fullscreenerror=e)}return Sn},Mt.requestFullscreen=function(t,i){Mt.supportsFullscreen()&&t[Ge.requestFullscreen]({vrDisplay:i})},Mt.exitFullscreen=function(){Mt.supportsFullscreen()&&document[Ge.exitFullscreen]()},Mt._names=Ge;let pt;typeof navigator<"u"?pt=navigator:pt={};function uo(t){const i=t.split(".");for(let e=0,n=i.length;e<n;++e)i[e]=parseInt(i[e],10);return i}let yc,bv;function Ru(){if(!T(yc)&&(yc=!1,!Pc())){const t=/ Chrome\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(yc=!0,bv=uo(t[1]))}return yc}function aS(){return Ru()&&bv}let wc,Sv;function xv(){if(!T(wc)&&(wc=!1,!Ru()&&!Pc()&&/ Safari\/[\.0-9]+/.test(pt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(wc=!0,Sv=uo(t[1]))}return wc}function lS(){return xv()&&Sv}let Cc,Fu;function Ev(){if(!T(Cc)){Cc=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(pt.userAgent);t!==null&&(Cc=!0,Fu=uo(t[1]),Fu.isNightly=!!t[2])}return Cc}function cS(){return Ev()&&Fu}let yr,zu;function Av(){if(!T(yr)){yr=!1;let t;pt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(pt.userAgent),t!==null&&(yr=!0,zu=uo(t[1]))):pt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(pt.userAgent),t!==null&&(yr=!0,zu=uo(t[1])))}return yr}function hS(){return Av()&&zu}let _c,Tv;function Pc(){if(!T(_c)){_c=!1;const t=/ Edg\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(_c=!0,Tv=uo(t[1]))}return _c}function uS(){return Pc()&&Tv}let bc,Lu;function Sc(){if(!T(bc)){bc=!1;const t=/Firefox\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(bc=!0,Lu=uo(t[1]))}return bc}let Ou;function dS(){return T(Ou)||(Ou=/Windows/i.test(pt.appVersion)),Ou}let Nu;function pS(){return T(Nu)||(Nu=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Nu}function fS(){return Sc()&&Lu}let Bu;function gS(){return T(Bu)||(Bu=!Sc()&&typeof PointerEvent<"u"&&(!T(pt.pointerEnabled)||pt.pointerEnabled)),Bu}let Mv,xc;function Iv(){if(!T(xc)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const i=t.style.imageRendering;xc=T(i)&&i!=="",xc&&(Mv=i)}return xc}function mS(){return Iv()?Mv:void 0}function ft(){if(!ft.initialized)throw new G("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ft._result}ft._promise=void 0,ft._result=void 0,ft.initialize=function(){return T(ft._promise)||(ft._promise=new Promise(t=>{const i=new Image;i.onload=function(){ft._result=i.width>0&&i.height>0,t(ft._result)},i.onerror=function(){ft._result=!1,t(ft._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ft._promise},Object.defineProperties(ft,{initialized:{get:function(){return T(ft._result)}}});const ls=[];typeof ArrayBuffer<"u"&&(ls.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&ls.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&ls.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&ls.push(BigInt64Array),typeof BigUint64Array<"u"&&ls.push(BigUint64Array));const lt={isChrome:Ru,chromeVersion:aS,isSafari:xv,safariVersion:lS,isWebkit:Ev,webkitVersion:cS,isInternetExplorer:Av,internetExplorerVersion:hS,isEdge:Pc,edgeVersion:uS,isFirefox:Sc,firefoxVersion:fS,isWindows:dS,isIPadOrIOS:pS,hardwareConcurrency:pt.hardwareConcurrency??3,supportsPointerEvents:gS,supportsImageRenderingPixelated:Iv,supportsWebP:ft,imageRenderingValue:mS,typedArrayTypes:ls};lt.supportsBasis=function(t){return lt.supportsWebAssembly()&&t.context.supportsBasis},lt.supportsFullscreen=function(){return Mt.supportsFullscreen()},lt.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},lt.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},lt.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},lt.supportsBigInt=function(){return typeof BigInt<"u"},lt.supportsWebWorkers=function(){return typeof Worker<"u"},lt.supportsWebAssembly=function(){return typeof WebAssembly<"u"},lt.supportsWebgl2=function(t){return S.defined("scene",t),t.context.webgl2},lt.supportsEsmWebWorkers=function(){return!Sc()||parseInt(Lu)>=114};function j(t,i){this.x=t??0,this.y=i??0}j.fromElements=function(t,i,e){return T(e)?(e.x=t,e.y=i,e):new j(t,i)},j.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i):new j(t.x,t.y)},j.fromCartesian3=j.clone,j.fromCartesian4=j.clone,j.packedLength=2,j.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e]=t.y,i},j.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new j),e.x=t[i++],e.y=t[i],e},j.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*2;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)j.pack(t[o],i,o*2);return i},j.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new G("array length must be a multiple of 2.");const e=t.length;T(i)?i.length=e/2:i=new Array(e/2);for(let n=0;n<e;n+=2){const o=n/2;i[o]=j.unpack(t,n,i[o])}return i},j.fromArray=j.unpack,j.maximumComponent=function(t){return S.typeOf.object("cartesian",t),Math.max(t.x,t.y)},j.minimumComponent=function(t){return S.typeOf.object("cartesian",t),Math.min(t.x,t.y)},j.minimumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e},j.maximumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e},j.clamp=function(t,i,e,n){S.typeOf.object("value",t),S.typeOf.object("min",i),S.typeOf.object("max",e),S.typeOf.object("result",n);const o=N.clamp(t.x,i.x,e.x),s=N.clamp(t.y,i.y,e.y);return n.x=o,n.y=s,n},j.magnitudeSquared=function(t){return S.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},j.magnitude=function(t){return Math.sqrt(j.magnitudeSquared(t))};const Ec=new j;j.distance=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.subtract(t,i,Ec),j.magnitude(Ec)},j.distanceSquared=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.subtract(t,i,Ec),j.magnitudeSquared(Ec)},j.normalize=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=j.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,isNaN(i.x)||isNaN(i.y))throw new G("normalized result is not a number");return i},j.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y},j.cross=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.y-t.y*i.x},j.multiplyComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e},j.divideComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e},j.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e},j.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e},j.multiplyByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e},j.divideByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e},j.negate=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i},j.abs=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i};const Dv=new j;j.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),j.multiplyByScalar(i,e,Dv),n=j.multiplyByScalar(t,1-e,n),j.add(Dv,n,n)};const Rv=new j,Fv=new j;j.angleBetween=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.normalize(t,Rv),j.normalize(i,Fv),N.acosClamped(j.dot(Rv,Fv))};const vS=new j;j.mostOrthogonalAxis=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=j.normalize(t,vS);return j.abs(e,e),e.x<=e.y?i=j.clone(j.UNIT_X,i):i=j.clone(j.UNIT_Y,i),i},j.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y},j.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]},j.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.x,i.x,e,n)&&N.equalsEpsilon(t.y,i.y,e,n)},j.ZERO=Object.freeze(new j(0,0)),j.ONE=Object.freeze(new j(1,1)),j.UNIT_X=Object.freeze(new j(1,0)),j.UNIT_Y=Object.freeze(new j(0,1)),j.prototype.clone=function(t){return j.clone(this,t)},j.prototype.equals=function(t){return j.equals(this,t)},j.prototype.equalsEpsilon=function(t,i,e){return j.equalsEpsilon(this,t,i,e)},j.prototype.toString=function(){return`(${this.x}, ${this.y})`};const yS=new F,wS=new F;function zv(t,i,e,n,o){if(!T(t))throw new G("cartesian is required.");if(!T(i))throw new G("oneOverRadii is required.");if(!T(e))throw new G("oneOverRadiiSquared is required.");if(!T(n))throw new G("centerToleranceSquared is required.");const s=t.x,r=t.y,l=t.z,c=i.x,u=i.y,d=i.z,p=s*s*c*c,f=r*r*u*u,m=l*l*d*d,g=p+f+m,y=Math.sqrt(1/g),_=F.multiplyByScalar(t,y,yS);if(g<n)return isFinite(y)?F.clone(_,o):void 0;const P=e.x,w=e.y,b=e.z,x=wS;x.x=_.x*P*2,x.y=_.y*w*2,x.z=_.z*b*2;let A=(1-y)*F.magnitude(t)/(.5*F.magnitude(x)),M=0,D,L,V,O,z,U,C,E,R,B,W;do{A-=M,V=1/(1+A*P),O=1/(1+A*w),z=1/(1+A*b),U=V*V,C=O*O,E=z*z,R=U*V,B=C*O,W=E*z,D=p*U+f*C+m*E-1,L=p*R*P+f*B*w+m*W*b;const Y=-2*L;M=D/Y}while(Math.abs(D)>N.EPSILON12);return T(o)?(o.x=s*V,o.y=r*O,o.z=l*z,o):new F(s*V,r*O,l*z)}function pe(t,i,e){this.longitude=t??0,this.latitude=i??0,this.height=e??0}pe.fromRadians=function(t,i,e,n){return S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),e=e??0,T(n)?(n.longitude=t,n.latitude=i,n.height=e,n):new pe(t,i,e)},pe.fromDegrees=function(t,i,e,n){return S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),t=N.toRadians(t),i=N.toRadians(i),pe.fromRadians(t,i,e,n)};const CS=new F,_S=new F,PS=new F;pe._ellipsoidOneOverRadii=new F(1/6378137,1/6378137,1/6356752314245179e-9),pe._ellipsoidOneOverRadiiSquared=new F(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),pe._ellipsoidCenterToleranceSquared=N.EPSILON1,pe.fromCartesian=function(t,i,e){const n=T(i)?i.oneOverRadii:pe._ellipsoidOneOverRadii,o=T(i)?i.oneOverRadiiSquared:pe._ellipsoidOneOverRadiiSquared,s=T(i)?i._centerToleranceSquared:pe._ellipsoidCenterToleranceSquared,r=zv(t,n,o,s,_S);if(!T(r))return;let l=F.multiplyComponents(r,o,CS);l=F.normalize(l,l);const c=F.subtract(t,r,PS),u=Math.atan2(l.y,l.x),d=Math.asin(l.z),p=N.sign(F.dot(c,t))*F.magnitude(c);return T(e)?(e.longitude=u,e.latitude=d,e.height=p,e):new pe(u,d,p)},pe.toCartesian=function(t,i,e){return S.defined("cartographic",t),F.fromRadians(t.longitude,t.latitude,t.height,i,e)},pe.clone=function(t,i){if(T(t))return T(i)?(i.longitude=t.longitude,i.latitude=t.latitude,i.height=t.height,i):new pe(t.longitude,t.latitude,t.height)},pe.equals=function(t,i){return t===i||T(t)&&T(i)&&t.longitude===i.longitude&&t.latitude===i.latitude&&t.height===i.height},pe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.longitude-i.longitude)<=e&&Math.abs(t.latitude-i.latitude)<=e&&Math.abs(t.height-i.height)<=e},pe.ZERO=Object.freeze(new pe(0,0,0)),pe.prototype.clone=function(t){return pe.clone(this,t)},pe.prototype.equals=function(t){return pe.equals(this,t)},pe.prototype.equalsEpsilon=function(t,i){return pe.equalsEpsilon(this,t,i)},pe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Lv(t,i,e,n){i=i??0,e=e??0,n=n??0,S.typeOf.number.greaterThanOrEquals("x",i,0),S.typeOf.number.greaterThanOrEquals("y",e,0),S.typeOf.number.greaterThanOrEquals("z",n,0),t._radii=new F(i,e,n),t._radiiSquared=new F(i*i,e*e,n*n),t._radiiToTheFourth=new F(i*i*i*i,e*e*e*e,n*n*n*n),t._oneOverRadii=new F(i===0?0:1/i,e===0?0:1/e,n===0?0:1/n),t._oneOverRadiiSquared=new F(i===0?0:1/(i*i),e===0?0:1/(e*e),n===0?0:1/(n*n)),t._minimumRadius=Math.min(i,e,n),t._maximumRadius=Math.max(i,e,n),t._centerToleranceSquared=N.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function ae(t,i,e){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Lv(this,t,i,e)}Object.defineProperties(ae.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),ae.clone=function(t,i){if(!T(t))return;const e=t._radii;return T(i)?(F.clone(e,i._radii),F.clone(t._radiiSquared,i._radiiSquared),F.clone(t._radiiToTheFourth,i._radiiToTheFourth),F.clone(t._oneOverRadii,i._oneOverRadii),F.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new ae(e.x,e.y,e.z)},ae.fromCartesian3=function(t,i){return T(i)||(i=new ae),T(t)&&Lv(i,t.x,t.y,t.z),i},ae.WGS84=Object.freeze(new ae(6378137,6378137,6356752314245179e-9)),ae.UNIT_SPHERE=Object.freeze(new ae(1,1,1)),ae.MOON=Object.freeze(new ae(N.LUNAR_RADIUS,N.LUNAR_RADIUS,N.LUNAR_RADIUS)),ae.MARS=Object.freeze(new ae(3396190,3396190,3376200)),ae._default=ae.WGS84,Object.defineProperties(ae,{default:{get:function(){return ae._default},set:function(t){S.typeOf.object("value",t),ae._default=t,F._ellipsoidRadiiSquared=t.radiiSquared,pe._ellipsoidOneOverRadii=t.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),ae.prototype.clone=function(t){return ae.clone(this,t)},ae.packedLength=F.packedLength,ae.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,F.pack(t._radii,i,e),i},ae.unpack=function(t,i,e){S.defined("array",t),i=i??0;const n=F.unpack(t,i);return ae.fromCartesian3(n,e)},ae.prototype.geocentricSurfaceNormal=F.normalize,ae.prototype.geodeticSurfaceNormalCartographic=function(t,i){S.typeOf.object("cartographic",t);const e=t.longitude,n=t.latitude,o=Math.cos(n),s=o*Math.cos(e),r=o*Math.sin(e),l=Math.sin(n);return T(i)||(i=new F),i.x=s,i.y=r,i.z=l,F.normalize(i,i)},ae.prototype.geodeticSurfaceNormal=function(t,i){if(S.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new G("cartesian has a NaN component");if(!F.equalsEpsilon(t,F.ZERO,N.EPSILON14))return T(i)||(i=new F),i=F.multiplyComponents(t,this._oneOverRadiiSquared,i),F.normalize(i,i)};const bS=new F,SS=new F;ae.prototype.cartographicToCartesian=function(t,i){const e=bS,n=SS;this.geodeticSurfaceNormalCartographic(t,e),F.multiplyComponents(this._radiiSquared,e,n);const o=Math.sqrt(F.dot(e,n));return F.divideByScalar(n,o,n),F.multiplyByScalar(e,t.height,e),T(i)||(i=new F),F.add(n,e,i)},ae.prototype.cartographicArrayToCartesianArray=function(t,i){S.defined("cartographics",t);const e=t.length;T(i)?i.length=e:i=new Array(e);for(let n=0;n<e;n++)i[n]=this.cartographicToCartesian(t[n],i[n]);return i};const xS=new F,ES=new F,AS=new F;ae.prototype.cartesianToCartographic=function(t,i){const e=this.scaleToGeodeticSurface(t,ES);if(!T(e))return;const n=this.geodeticSurfaceNormal(e,xS),o=F.subtract(t,e,AS),s=Math.atan2(n.y,n.x),r=Math.asin(n.z),l=N.sign(F.dot(o,t))*F.magnitude(o);return T(i)?(i.longitude=s,i.latitude=r,i.height=l,i):new pe(s,r,l)},ae.prototype.cartesianArrayToCartographicArray=function(t,i){S.defined("cartesians",t);const e=t.length;T(i)?i.length=e:i=new Array(e);for(let n=0;n<e;++n)i[n]=this.cartesianToCartographic(t[n],i[n]);return i},ae.prototype.scaleToGeodeticSurface=function(t,i){return zv(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,i)},ae.prototype.scaleToGeocentricSurface=function(t,i){S.typeOf.object("cartesian",t),T(i)||(i=new F);const e=t.x,n=t.y,o=t.z,s=this._oneOverRadiiSquared,r=1/Math.sqrt(e*e*s.x+n*n*s.y+o*o*s.z);return F.multiplyByScalar(t,r,i)},ae.prototype.transformPositionToScaledSpace=function(t,i){return T(i)||(i=new F),F.multiplyComponents(t,this._oneOverRadii,i)},ae.prototype.transformPositionFromScaledSpace=function(t,i){return T(i)||(i=new F),F.multiplyComponents(t,this._radii,i)},ae.prototype.equals=function(t){return this===t||T(t)&&F.equals(this._radii,t._radii)},ae.prototype.toString=function(){return this._radii.toString()},ae.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,e){if(S.typeOf.object("position",t),!N.equalsEpsilon(this._radii.x,this._radii.y,N.EPSILON15))throw new G("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");S.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=i??0;const n=this._squaredXOverSquaredZ;if(T(e)||(e=new F),e.x=0,e.y=0,e.z=t.z*(1-n),!(Math.abs(e.z)>=this._radii.z-i))return e};const TS=new F;ae.prototype.getLocalCurvature=function(t,i){S.typeOf.object("surfacePosition",t),T(i)||(i=new j);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,TS),n=F.distance(t,e),o=this.minimumRadius*n/this.maximumRadius**2,s=n*o**2;return j.fromElements(1/n,1/s,i)};const MS=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],IS=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Ov(t,i,e){S.typeOf.number("a",t),S.typeOf.number("b",i),S.typeOf.func("func",e);const n=.5*(i+t),o=.5*(i-t);let s=0;for(let r=0;r<5;r++){const l=o*MS[r];s+=IS[r]*(e(n+l)+e(n-l))}return s*=o,s}ae.prototype.surfaceArea=function(t){S.typeOf.object("rectangle",t);const i=t.west;let e=t.east;const n=t.south,o=t.north;for(;e<i;)e+=N.TWO_PI;const s=this._radiiSquared,r=s.x,l=s.y,c=s.z,u=r*l;return Ov(n,o,function(d){const p=Math.cos(d),f=Math.sin(d);return Math.cos(d)*Ov(i,e,function(m){const g=Math.cos(m),y=Math.sin(m);return Math.sqrt(u*f*f+c*(l*g*g+r*y*y)*p*p)})})};function wr(t,i,e){S.defined("array",t),S.defined("itemToFind",i),S.defined("comparator",e);let n=0,o=t.length-1,s,r;for(;n<=o;){if(s=~~((n+o)/2),r=e(t[s],i),r<0){n=s+1;continue}if(r>0){o=s-1;continue}return s}return~(o+1)}function Vu(t,i,e,n,o){this.xPoleWander=t,this.yPoleWander=i,this.xPoleOffset=e,this.yPoleOffset=n,this.ut1MinusUtc=o}function Uu(t){if(t===null||isNaN(t))throw new G("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const Nv=[31,28,31,30,31,30,31,31,30,31,30,31];function Wu(t,i,e,n,o,s,r,l){t=t??1,i=i??1,e=e??1,n=n??0,o=o??0,s=s??0,r=r??0,l=l??!1,y(),_(),this.year=t,this.month=i,this.day=e,this.hour=n,this.minute=o,this.second=s,this.millisecond=r,this.isLeapSecond=l;function y(){S.typeOf.number.greaterThanOrEquals("Year",t,1),S.typeOf.number.lessThanOrEquals("Year",t,9999),S.typeOf.number.greaterThanOrEquals("Month",i,1),S.typeOf.number.lessThanOrEquals("Month",i,12),S.typeOf.number.greaterThanOrEquals("Day",e,1),S.typeOf.number.lessThanOrEquals("Day",e,31),S.typeOf.number.greaterThanOrEquals("Hour",n,0),S.typeOf.number.lessThanOrEquals("Hour",n,23),S.typeOf.number.greaterThanOrEquals("Minute",o,0),S.typeOf.number.lessThanOrEquals("Minute",o,59),S.typeOf.bool("IsLeapSecond",l),S.typeOf.number.greaterThanOrEquals("Second",s,0),S.typeOf.number.lessThanOrEquals("Second",s,l?60:59),S.typeOf.number.greaterThanOrEquals("Millisecond",r,0),S.typeOf.number.lessThan("Millisecond",r,1e3)}function _(){const P=i===2&&Uu(t)?Nv[i-1]+1:Nv[i-1];if(e>P)throw new G("Month and Day represents invalid date")}}function Te(t,i){this.julianDate=t,this.offset=i}const Ve=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1}),me=Object.freeze({UTC:0,TAI:1}),Bv=new Wu,Ac=[31,28,31,30,31,30,31,31,30,31,30,31],Tc=29;function Gu(t,i){return k.compare(t.julianDate,i.julianDate)}const cs=new Te;function Mc(t){cs.julianDate=t;const i=k.leapSeconds;let e=wr(i,cs,Gu);e<0&&(e=~e),e>=i.length&&(e=i.length-1);let n=i[e].offset;e>0&&k.secondsDifference(i[e].julianDate,t)>n&&(e--,n=i[e].offset),k.addSeconds(t,n,t)}function Vv(t,i){cs.julianDate=t;const e=k.leapSeconds;let n=wr(e,cs,Gu);if(n<0&&(n=~n),n===0)return k.addSeconds(t,-e[0].offset,i);if(n>=e.length)return k.addSeconds(t,-e[n-1].offset,i);const o=k.secondsDifference(e[n].julianDate,t);if(o===0)return k.addSeconds(t,-e[n].offset,i);if(!(o<=1))return k.addSeconds(t,-e[--n].offset,i)}function xn(t,i,e){const n=i/Ve.SECONDS_PER_DAY|0;return t+=n,i-=Ve.SECONDS_PER_DAY*n,i<0&&(t--,i+=Ve.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=i,e}function Hu(t,i,e,n,o,s,r){const l=(i-14)/12|0,c=t+4800+l;let u=(1461*c/4|0)+(367*(i-2-12*l)/12|0)-(3*((c+100)/100|0)/4|0)+e-32075;n=n-12,n<0&&(n+=24);const d=s+(n*Ve.SECONDS_PER_HOUR+o*Ve.SECONDS_PER_MINUTE+r*Ve.SECONDS_PER_MILLISECOND);return d>=43200&&(u-=1),[u,d]}const DS=/^(\d{4})$/,RS=/^(\d{4})-(\d{2})$/,FS=/^(\d{4})-?(\d{3})$/,zS=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,LS=/^(\d{4})-?(\d{2})-?(\d{2})$/,qu=/([Z+\-])?(\d{2})?:?(\d{2})?$/,OS=/^(\d{2})(\.\d+)?/.source+qu.source,NS=/^(\d{2}):?(\d{2})(\.\d+)?/.source+qu.source,BS=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+qu.source,ci="Invalid ISO 8601 date.";function k(t,i,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,i=i??0,e=e??me.UTC;const n=t|0;i=i+(t-n)*Ve.SECONDS_PER_DAY,xn(n,i,this),e===me.UTC&&Mc(this)}k.fromGregorianDate=function(t,i){if(!(t instanceof Wu))throw new G("date must be a valid GregorianDate.");const e=Hu(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return T(i)?(xn(e[0],e[1],i),Mc(i),i):new k(e[0],e[1],me.UTC)},k.fromDate=function(t,i){if(!(t instanceof Date)||isNaN(t.getTime()))throw new G("date must be a valid JavaScript Date.");const e=Hu(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return T(i)?(xn(e[0],e[1],i),Mc(i),i):new k(e[0],e[1],me.UTC)},k.fromIso8601=function(t,i){if(typeof t!="string")throw new G(ci);t=t.replace(",",".");let e=t.split("T"),n,o=1,s=1,r=0,l=0,c=0,u=0;const d=e[0],p=e[1];let f,m;if(!T(d))throw new G(ci);let g;if(e=d.match(LS),e!==null){if(g=d.split("-").length-1,g>0&&g!==2)throw new G(ci);n=+e[1],o=+e[2],s=+e[3]}else if(e=d.match(RS),e!==null)n=+e[1],o=+e[2];else if(e=d.match(DS),e!==null)n=+e[1];else{let w;if(e=d.match(FS),e!==null){if(n=+e[1],w=+e[2],m=Uu(n),w<1||m&&w>366||!m&&w>365)throw new G(ci)}else if(e=d.match(zS),e!==null){n=+e[1];const b=+e[2],x=+e[3]||0;if(g=d.split("-").length-1,g>0&&(!T(e[3])&&g!==1||T(e[3])&&g!==2))throw new G(ci);const A=new Date(Date.UTC(n,0,4));w=b*7+x-A.getUTCDay()-3}else throw new G(ci);f=new Date(Date.UTC(n,0,1)),f.setUTCDate(w),o=f.getUTCMonth()+1,s=f.getUTCDate()}if(m=Uu(n),o<1||o>12||s<1||(o!==2||!m)&&s>Ac[o-1]||m&&o===2&&s>Tc)throw new G(ci);let y;if(T(p)){if(e=p.match(BS),e!==null){if(g=p.split(":").length-1,g>0&&g!==2&&g!==3)throw new G(ci);r=+e[1],l=+e[2],c=+e[3],u=+(e[4]||0)*1e3,y=5}else if(e=p.match(NS),e!==null){if(g=p.split(":").length-1,g>2)throw new G(ci);r=+e[1],l=+e[2],c=+(e[3]||0)*60,y=4}else if(e=p.match(OS),e!==null)r=+e[1],l=+(e[2]||0)*60,y=3;else throw new G(ci);if(l>=60||c>=61||r>24||r===24&&(l>0||c>0||u>0))throw new G(ci);const w=e[y],b=+e[y+1],x=+(e[y+2]||0);switch(w){case"+":r=r-b,l=l-x;break;case"-":r=r+b,l=l+x;break;case"Z":break;default:l=l+new Date(Date.UTC(n,o-1,s,r,l)).getTimezoneOffset();break}}const _=c===60;for(_&&c--;l>=60;)l-=60,r++;for(;r>=24;)r-=24,s++;for(f=m&&o===2?Tc:Ac[o-1];s>f;)s-=f,o++,o>12&&(o-=12,n++),f=m&&o===2?Tc:Ac[o-1];for(;l<0;)l+=60,r--;for(;r<0;)r+=24,s--;for(;s<1;)o--,o<1&&(o+=12,n--),f=m&&o===2?Tc:Ac[o-1],s+=f;const P=Hu(n,o,s,r,l,c,u);return T(i)?(xn(P[0],P[1],i),Mc(i)):i=new k(P[0],P[1],me.UTC),_&&k.addSeconds(i,1,i),i},k.now=function(t){return k.fromDate(new Date,t)};const Ic=new k(0,0,me.TAI);k.toGregorianDate=function(t,i){if(!T(t))throw new G("julianDate is required.");let e=!1,n=Vv(t,Ic);T(n)||(k.addSeconds(t,-1,Ic),n=Vv(Ic,Ic),e=!0);let o=n.dayNumber;const s=n.secondsOfDay;s>=43200&&(o+=1);let r=o+68569|0;const l=4*r/146097|0;r=r-((146097*l+3)/4|0)|0;const c=4e3*(r+1)/1461001|0;r=r-(1461*c/4|0)+31|0;const u=80*r/2447|0,d=r-(2447*u/80|0)|0;r=u/11|0;const p=u+2-12*r|0,f=100*(l-49)+c+r|0;let m=s/Ve.SECONDS_PER_HOUR|0,g=s-m*Ve.SECONDS_PER_HOUR;const y=g/Ve.SECONDS_PER_MINUTE|0;g=g-y*Ve.SECONDS_PER_MINUTE;let _=g|0;const P=(g-_)/Ve.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),e&&(_+=1),T(i)?(i.year=f,i.month=p,i.day=d,i.hour=m,i.minute=y,i.second=_,i.millisecond=P,i.isLeapSecond=e,i):new Wu(f,p,d,m,y,_,P,e)},k.toDate=function(t){if(!T(t))throw new G("julianDate is required.");const i=k.toGregorianDate(t,Bv);let e=i.second;return i.isLeapSecond&&(e-=1),new Date(Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,e,i.millisecond))},k.toIso8601=function(t,i){if(!T(t))throw new G("julianDate is required.");const e=k.toGregorianDate(t,Bv);let n=e.year,o=e.month,s=e.day,r=e.hour;const l=e.minute,c=e.second,u=e.millisecond;n===1e4&&o===1&&s===1&&r===0&&l===0&&c===0&&u===0&&(n=9999,o=12,s=31,r=24);let d;if(!T(i)&&u!==0){const p=u*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`}return!T(i)||i===0?`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(u*.01).toFixed(i).replace(".","").slice(0,i),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},k.clone=function(t,i){if(T(t))return T(i)?(i.dayNumber=t.dayNumber,i.secondsOfDay=t.secondsOfDay,i):new k(t.dayNumber,t.secondsOfDay,me.TAI)},k.compare=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");const e=t.dayNumber-i.dayNumber;return e!==0?e:t.secondsOfDay-i.secondsOfDay},k.equals=function(t,i){return t===i||T(t)&&T(i)&&t.dayNumber===i.dayNumber&&t.secondsOfDay===i.secondsOfDay},k.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(k.secondsDifference(t,i))<=e},k.totalDays=function(t){if(!T(t))throw new G("julianDate is required.");return t.dayNumber+t.secondsOfDay/Ve.SECONDS_PER_DAY},k.secondsDifference=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");return(t.dayNumber-i.dayNumber)*Ve.SECONDS_PER_DAY+(t.secondsOfDay-i.secondsOfDay)},k.daysDifference=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");const e=t.dayNumber-i.dayNumber,n=(t.secondsOfDay-i.secondsOfDay)/Ve.SECONDS_PER_DAY;return e+n},k.computeTaiMinusUtc=function(t){cs.julianDate=t;const i=k.leapSeconds;let e=wr(i,cs,Gu);return e<0&&(e=~e,--e,e<0&&(e=0)),i[e].offset},k.addSeconds=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("seconds is required.");if(!T(e))throw new G("result is required.");return xn(t.dayNumber,t.secondsOfDay+i,e)},k.addMinutes=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("minutes is required.");if(!T(e))throw new G("result is required.");const n=t.secondsOfDay+i*Ve.SECONDS_PER_MINUTE;return xn(t.dayNumber,n,e)},k.addHours=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("hours is required.");if(!T(e))throw new G("result is required.");const n=t.secondsOfDay+i*Ve.SECONDS_PER_HOUR;return xn(t.dayNumber,n,e)},k.addDays=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("days is required.");if(!T(e))throw new G("result is required.");const n=t.dayNumber+i;return xn(n,t.secondsOfDay,e)},k.lessThan=function(t,i){return k.compare(t,i)<0},k.lessThanOrEquals=function(t,i){return k.compare(t,i)<=0},k.greaterThan=function(t,i){return k.compare(t,i)>0},k.greaterThanOrEquals=function(t,i){return k.compare(t,i)>=0},k.prototype.clone=function(t){return k.clone(this,t)},k.prototype.equals=function(t){return k.equals(this,t)},k.prototype.equalsEpsilon=function(t,i){return k.equalsEpsilon(this,t,i)},k.prototype.toString=function(){return k.toIso8601(this)},k.leapSeconds=[new Te(new k(2441317,43210,me.TAI),10),new Te(new k(2441499,43211,me.TAI),11),new Te(new k(2441683,43212,me.TAI),12),new Te(new k(2442048,43213,me.TAI),13),new Te(new k(2442413,43214,me.TAI),14),new Te(new k(2442778,43215,me.TAI),15),new Te(new k(2443144,43216,me.TAI),16),new Te(new k(2443509,43217,me.TAI),17),new Te(new k(2443874,43218,me.TAI),18),new Te(new k(2444239,43219,me.TAI),19),new Te(new k(2444786,43220,me.TAI),20),new Te(new k(2445151,43221,me.TAI),21),new Te(new k(2445516,43222,me.TAI),22),new Te(new k(2446247,43223,me.TAI),23),new Te(new k(2447161,43224,me.TAI),24),new Te(new k(2447892,43225,me.TAI),25),new Te(new k(2448257,43226,me.TAI),26),new Te(new k(2448804,43227,me.TAI),27),new Te(new k(2449169,43228,me.TAI),28),new Te(new k(2449534,43229,me.TAI),29),new Te(new k(2450083,43230,me.TAI),30),new Te(new k(2450630,43231,me.TAI),31),new Te(new k(2451179,43232,me.TAI),32),new Te(new k(2453736,43233,me.TAI),33),new Te(new k(2454832,43234,me.TAI),34),new Te(new k(2456109,43235,me.TAI),35),new Te(new k(2457204,43236,me.TAI),36),new Te(new k(2457754,43237,me.TAI),37)];var Dc={exports:{}},Cr={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var VS=Cr.exports,Uv;function US(){return Uv||(Uv=1,function(t,i){(function(e){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s=typeof pv=="object"&&pv;(s.global===s||s.window===s||s.self===s)&&(e=s);var r,l=2147483647,c=36,u=1,d=26,p=38,f=700,m=72,g=128,y="-",_=/^xn--/,P=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-u,A=Math.floor,M=String.fromCharCode,D;function L(X){throw new RangeError(b[X])}function V(X,Q){for(var ee=X.length,oe=[];ee--;)oe[ee]=Q(X[ee]);return oe}function O(X,Q){var ee=X.split("@"),oe="";ee.length>1&&(oe=ee[0]+"@",X=ee[1]),X=X.replace(w,".");var fe=X.split("."),ve=V(fe,Q).join(".");return oe+ve}function z(X){for(var Q=[],ee=0,oe=X.length,fe,ve;ee<oe;)fe=X.charCodeAt(ee++),fe>=55296&&fe<=56319&&ee<oe?(ve=X.charCodeAt(ee++),(ve&64512)==56320?Q.push(((fe&1023)<<10)+(ve&1023)+65536):(Q.push(fe),ee--)):Q.push(fe);return Q}function U(X){return V(X,function(Q){var ee="";return Q>65535&&(Q-=65536,ee+=M(Q>>>10&1023|55296),Q=56320|Q&1023),ee+=M(Q),ee}).join("")}function C(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:c}function E(X,Q){return X+22+75*(X<26)-((Q!=0)<<5)}function R(X,Q,ee){var oe=0;for(X=ee?A(X/f):X>>1,X+=A(X/Q);X>x*d>>1;oe+=c)X=A(X/x);return A(oe+(x+1)*X/(X+p))}function B(X){var Q=[],ee=X.length,oe,fe=0,ve=g,xe=m,Oe,Ue,ge,ie,ce,he,Ee,Ne,Ot;for(Oe=X.lastIndexOf(y),Oe<0&&(Oe=0),Ue=0;Ue<Oe;++Ue)X.charCodeAt(Ue)>=128&&L("not-basic"),Q.push(X.charCodeAt(Ue));for(ge=Oe>0?Oe+1:0;ge<ee;){for(ie=fe,ce=1,he=c;ge>=ee&&L("invalid-input"),Ee=C(X.charCodeAt(ge++)),(Ee>=c||Ee>A((l-fe)/ce))&&L("overflow"),fe+=Ee*ce,Ne=he<=xe?u:he>=xe+d?d:he-xe,!(Ee<Ne);he+=c)Ot=c-Ne,ce>A(l/Ot)&&L("overflow"),ce*=Ot;oe=Q.length+1,xe=R(fe-ie,oe,ie==0),A(fe/oe)>l-ve&&L("overflow"),ve+=A(fe/oe),fe%=oe,Q.splice(fe++,0,ve)}return U(Q)}function W(X){var Q,ee,oe,fe,ve,xe,Oe,Ue,ge,ie,ce,he=[],Ee,Ne,Ot,st;for(X=z(X),Ee=X.length,Q=g,ee=0,ve=m,xe=0;xe<Ee;++xe)ce=X[xe],ce<128&&he.push(M(ce));for(oe=fe=he.length,fe&&he.push(y);oe<Ee;){for(Oe=l,xe=0;xe<Ee;++xe)ce=X[xe],ce>=Q&&ce<Oe&&(Oe=ce);for(Ne=oe+1,Oe-Q>A((l-ee)/Ne)&&L("overflow"),ee+=(Oe-Q)*Ne,Q=Oe,xe=0;xe<Ee;++xe)if(ce=X[xe],ce<Q&&++ee>l&&L("overflow"),ce==Q){for(Ue=ee,ge=c;ie=ge<=ve?u:ge>=ve+d?d:ge-ve,!(Ue<ie);ge+=c)st=Ue-ie,Ot=c-ie,he.push(M(E(ie+st%Ot,0))),Ue=A(st/Ot);he.push(M(E(Ue,0))),ve=R(ee,Ne,oe==fe),ee=0,++oe}++ee,++Q}return he.join("")}function Y(X){return O(X,function(Q){return _.test(Q)?B(Q.slice(4).toLowerCase()):Q})}function q(X){return O(X,function(Q){return P.test(Q)?"xn--"+W(Q):Q})}if(r={version:"1.3.2",ucs2:{decode:z,encode:U},decode:B,encode:W,toASCII:q,toUnicode:Y},n&&o)if(t.exports==n)o.exports=r;else for(D in r)r.hasOwnProperty(D)&&(n[D]=r[D]);else e.punycode=r})(VS)}(Cr,Cr.exports)),Cr.exports}var Rc={exports:{}};/*!
|
|
326
|
+
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function sS(){return!0}function rS(t,i){i=i??"This object was destroyed, i.e., destroy() was called.";function e(){throw new G(i)}for(const n in t)typeof t[n]=="function"&&(t[n]=e);t.isDestroyed=sS}let Sn;const Ge={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Mt={};Object.defineProperties(Mt,{element:{get:function(){if(Mt.supportsFullscreen())return document[Ge.fullscreenElement]}},changeEventName:{get:function(){if(Mt.supportsFullscreen())return Ge.fullscreenchange}},errorEventName:{get:function(){if(Mt.supportsFullscreen())return Ge.fullscreenerror}},enabled:{get:function(){if(Mt.supportsFullscreen())return document[Ge.fullscreenEnabled]}},fullscreen:{get:function(){if(Mt.supportsFullscreen())return Mt.element!==null}}}),Mt.supportsFullscreen=function(){if(T(Sn))return Sn;Sn=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return Ge.requestFullscreen="requestFullscreen",Ge.exitFullscreen="exitFullscreen",Ge.fullscreenEnabled="fullscreenEnabled",Ge.fullscreenElement="fullscreenElement",Ge.fullscreenchange="fullscreenchange",Ge.fullscreenerror="fullscreenerror",Sn=!0,Sn;const i=["webkit","moz","o","ms","khtml"];let e;for(let n=0,o=i.length;n<o;++n){const s=i[n];e=`${s}RequestFullscreen`,typeof t[e]=="function"?(Ge.requestFullscreen=e,Sn=!0):(e=`${s}RequestFullScreen`,typeof t[e]=="function"&&(Ge.requestFullscreen=e,Sn=!0)),e=`${s}ExitFullscreen`,typeof document[e]=="function"?Ge.exitFullscreen=e:(e=`${s}CancelFullScreen`,typeof document[e]=="function"&&(Ge.exitFullscreen=e)),e=`${s}FullscreenEnabled`,document[e]!==void 0?Ge.fullscreenEnabled=e:(e=`${s}FullScreenEnabled`,document[e]!==void 0&&(Ge.fullscreenEnabled=e)),e=`${s}FullscreenElement`,document[e]!==void 0?Ge.fullscreenElement=e:(e=`${s}FullScreenElement`,document[e]!==void 0&&(Ge.fullscreenElement=e)),e=`${s}fullscreenchange`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenChange"),Ge.fullscreenchange=e),e=`${s}fullscreenerror`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenError"),Ge.fullscreenerror=e)}return Sn},Mt.requestFullscreen=function(t,i){Mt.supportsFullscreen()&&t[Ge.requestFullscreen]({vrDisplay:i})},Mt.exitFullscreen=function(){Mt.supportsFullscreen()&&document[Ge.exitFullscreen]()},Mt._names=Ge;let pt;typeof navigator<"u"?pt=navigator:pt={};function uo(t){const i=t.split(".");for(let e=0,n=i.length;e<n;++e)i[e]=parseInt(i[e],10);return i}let yc,bv;function Ru(){if(!T(yc)&&(yc=!1,!Pc())){const t=/ Chrome\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(yc=!0,bv=uo(t[1]))}return yc}function aS(){return Ru()&&bv}let wc,Sv;function xv(){if(!T(wc)&&(wc=!1,!Ru()&&!Pc()&&/ Safari\/[\.0-9]+/.test(pt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(wc=!0,Sv=uo(t[1]))}return wc}function lS(){return xv()&&Sv}let Cc,Fu;function Ev(){if(!T(Cc)){Cc=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(pt.userAgent);t!==null&&(Cc=!0,Fu=uo(t[1]),Fu.isNightly=!!t[2])}return Cc}function cS(){return Ev()&&Fu}let yr,zu;function Av(){if(!T(yr)){yr=!1;let t;pt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(pt.userAgent),t!==null&&(yr=!0,zu=uo(t[1]))):pt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(pt.userAgent),t!==null&&(yr=!0,zu=uo(t[1])))}return yr}function hS(){return Av()&&zu}let _c,Tv;function Pc(){if(!T(_c)){_c=!1;const t=/ Edg\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(_c=!0,Tv=uo(t[1]))}return _c}function uS(){return Pc()&&Tv}let bc,Lu;function Sc(){if(!T(bc)){bc=!1;const t=/Firefox\/([\.0-9]+)/.exec(pt.userAgent);t!==null&&(bc=!0,Lu=uo(t[1]))}return bc}let Ou;function dS(){return T(Ou)||(Ou=/Windows/i.test(pt.appVersion)),Ou}let Nu;function pS(){return T(Nu)||(Nu=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Nu}function fS(){return Sc()&&Lu}let Bu;function gS(){return T(Bu)||(Bu=!Sc()&&typeof PointerEvent<"u"&&(!T(pt.pointerEnabled)||pt.pointerEnabled)),Bu}let Mv,xc;function Iv(){if(!T(xc)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const i=t.style.imageRendering;xc=T(i)&&i!=="",xc&&(Mv=i)}return xc}function mS(){return Iv()?Mv:void 0}function ft(){if(!ft.initialized)throw new G("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ft._result}ft._promise=void 0,ft._result=void 0,ft.initialize=function(){return T(ft._promise)||(ft._promise=new Promise(t=>{const i=new Image;i.onload=function(){ft._result=i.width>0&&i.height>0,t(ft._result)},i.onerror=function(){ft._result=!1,t(ft._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ft._promise},Object.defineProperties(ft,{initialized:{get:function(){return T(ft._result)}}});const ls=[];typeof ArrayBuffer<"u"&&(ls.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&ls.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&ls.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&ls.push(BigInt64Array),typeof BigUint64Array<"u"&&ls.push(BigUint64Array));const lt={isChrome:Ru,chromeVersion:aS,isSafari:xv,safariVersion:lS,isWebkit:Ev,webkitVersion:cS,isInternetExplorer:Av,internetExplorerVersion:hS,isEdge:Pc,edgeVersion:uS,isFirefox:Sc,firefoxVersion:fS,isWindows:dS,isIPadOrIOS:pS,hardwareConcurrency:pt.hardwareConcurrency??3,supportsPointerEvents:gS,supportsImageRenderingPixelated:Iv,supportsWebP:ft,imageRenderingValue:mS,typedArrayTypes:ls};lt.supportsBasis=function(t){return lt.supportsWebAssembly()&&t.context.supportsBasis},lt.supportsFullscreen=function(){return Mt.supportsFullscreen()},lt.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},lt.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},lt.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},lt.supportsBigInt=function(){return typeof BigInt<"u"},lt.supportsWebWorkers=function(){return typeof Worker<"u"},lt.supportsWebAssembly=function(){return typeof WebAssembly<"u"},lt.supportsWebgl2=function(t){return S.defined("scene",t),t.context.webgl2},lt.supportsEsmWebWorkers=function(){return!Sc()||parseInt(Lu)>=114};function j(t,i){this.x=t??0,this.y=i??0}j.fromElements=function(t,i,e){return T(e)?(e.x=t,e.y=i,e):new j(t,i)},j.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i):new j(t.x,t.y)},j.fromCartesian3=j.clone,j.fromCartesian4=j.clone,j.packedLength=2,j.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e]=t.y,i},j.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new j),e.x=t[i++],e.y=t[i],e},j.packArray=function(t,i){S.defined("array",t);const e=t.length,n=e*2;if(!T(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new G("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)j.pack(t[o],i,o*2);return i},j.unpackArray=function(t,i){if(S.defined("array",t),S.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new G("array length must be a multiple of 2.");const e=t.length;T(i)?i.length=e/2:i=new Array(e/2);for(let n=0;n<e;n+=2){const o=n/2;i[o]=j.unpack(t,n,i[o])}return i},j.fromArray=j.unpack,j.maximumComponent=function(t){return S.typeOf.object("cartesian",t),Math.max(t.x,t.y)},j.minimumComponent=function(t){return S.typeOf.object("cartesian",t),Math.min(t.x,t.y)},j.minimumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e},j.maximumByComponent=function(t,i,e){return S.typeOf.object("first",t),S.typeOf.object("second",i),S.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e},j.clamp=function(t,i,e,n){S.typeOf.object("value",t),S.typeOf.object("min",i),S.typeOf.object("max",e),S.typeOf.object("result",n);const o=N.clamp(t.x,i.x,e.x),s=N.clamp(t.y,i.y,e.y);return n.x=o,n.y=s,n},j.magnitudeSquared=function(t){return S.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},j.magnitude=function(t){return Math.sqrt(j.magnitudeSquared(t))};const Ec=new j;j.distance=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.subtract(t,i,Ec),j.magnitude(Ec)},j.distanceSquared=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.subtract(t,i,Ec),j.magnitudeSquared(Ec)},j.normalize=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=j.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,isNaN(i.x)||isNaN(i.y))throw new G("normalized result is not a number");return i},j.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y},j.cross=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.y-t.y*i.x},j.multiplyComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e},j.divideComponents=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e},j.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e},j.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e},j.multiplyByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e},j.divideByScalar=function(t,i,e){return S.typeOf.object("cartesian",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e},j.negate=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i},j.abs=function(t,i){return S.typeOf.object("cartesian",t),S.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i};const Dv=new j;j.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),j.multiplyByScalar(i,e,Dv),n=j.multiplyByScalar(t,1-e,n),j.add(Dv,n,n)};const Rv=new j,Fv=new j;j.angleBetween=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),j.normalize(t,Rv),j.normalize(i,Fv),N.acosClamped(j.dot(Rv,Fv))};const vS=new j;j.mostOrthogonalAxis=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=j.normalize(t,vS);return j.abs(e,e),e.x<=e.y?i=j.clone(j.UNIT_X,i):i=j.clone(j.UNIT_Y,i),i},j.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y},j.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]},j.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.x,i.x,e,n)&&N.equalsEpsilon(t.y,i.y,e,n)},j.ZERO=Object.freeze(new j(0,0)),j.ONE=Object.freeze(new j(1,1)),j.UNIT_X=Object.freeze(new j(1,0)),j.UNIT_Y=Object.freeze(new j(0,1)),j.prototype.clone=function(t){return j.clone(this,t)},j.prototype.equals=function(t){return j.equals(this,t)},j.prototype.equalsEpsilon=function(t,i,e){return j.equalsEpsilon(this,t,i,e)},j.prototype.toString=function(){return`(${this.x}, ${this.y})`};const yS=new F,wS=new F;function zv(t,i,e,n,o){if(!T(t))throw new G("cartesian is required.");if(!T(i))throw new G("oneOverRadii is required.");if(!T(e))throw new G("oneOverRadiiSquared is required.");if(!T(n))throw new G("centerToleranceSquared is required.");const s=t.x,r=t.y,l=t.z,c=i.x,u=i.y,d=i.z,p=s*s*c*c,f=r*r*u*u,m=l*l*d*d,g=p+f+m,y=Math.sqrt(1/g),_=F.multiplyByScalar(t,y,yS);if(g<n)return isFinite(y)?F.clone(_,o):void 0;const P=e.x,w=e.y,b=e.z,x=wS;x.x=_.x*P*2,x.y=_.y*w*2,x.z=_.z*b*2;let A=(1-y)*F.magnitude(t)/(.5*F.magnitude(x)),M=0,D,L,V,O,z,U,C,E,R,B,W;do{A-=M,V=1/(1+A*P),O=1/(1+A*w),z=1/(1+A*b),U=V*V,C=O*O,E=z*z,R=U*V,B=C*O,W=E*z,D=p*U+f*C+m*E-1,L=p*R*P+f*B*w+m*W*b;const Y=-2*L;M=D/Y}while(Math.abs(D)>N.EPSILON12);return T(o)?(o.x=s*V,o.y=r*O,o.z=l*z,o):new F(s*V,r*O,l*z)}function pe(t,i,e){this.longitude=t??0,this.latitude=i??0,this.height=e??0}pe.fromRadians=function(t,i,e,n){return S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),e=e??0,T(n)?(n.longitude=t,n.latitude=i,n.height=e,n):new pe(t,i,e)},pe.fromDegrees=function(t,i,e,n){return S.typeOf.number("longitude",t),S.typeOf.number("latitude",i),t=N.toRadians(t),i=N.toRadians(i),pe.fromRadians(t,i,e,n)};const CS=new F,_S=new F,PS=new F;pe._ellipsoidOneOverRadii=new F(1/6378137,1/6378137,1/6356752314245179e-9),pe._ellipsoidOneOverRadiiSquared=new F(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),pe._ellipsoidCenterToleranceSquared=N.EPSILON1,pe.fromCartesian=function(t,i,e){const n=T(i)?i.oneOverRadii:pe._ellipsoidOneOverRadii,o=T(i)?i.oneOverRadiiSquared:pe._ellipsoidOneOverRadiiSquared,s=T(i)?i._centerToleranceSquared:pe._ellipsoidCenterToleranceSquared,r=zv(t,n,o,s,_S);if(!T(r))return;let l=F.multiplyComponents(r,o,CS);l=F.normalize(l,l);const c=F.subtract(t,r,PS),u=Math.atan2(l.y,l.x),d=Math.asin(l.z),p=N.sign(F.dot(c,t))*F.magnitude(c);return T(e)?(e.longitude=u,e.latitude=d,e.height=p,e):new pe(u,d,p)},pe.toCartesian=function(t,i,e){return S.defined("cartographic",t),F.fromRadians(t.longitude,t.latitude,t.height,i,e)},pe.clone=function(t,i){if(T(t))return T(i)?(i.longitude=t.longitude,i.latitude=t.latitude,i.height=t.height,i):new pe(t.longitude,t.latitude,t.height)},pe.equals=function(t,i){return t===i||T(t)&&T(i)&&t.longitude===i.longitude&&t.latitude===i.latitude&&t.height===i.height},pe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.longitude-i.longitude)<=e&&Math.abs(t.latitude-i.latitude)<=e&&Math.abs(t.height-i.height)<=e},pe.ZERO=Object.freeze(new pe(0,0,0)),pe.prototype.clone=function(t){return pe.clone(this,t)},pe.prototype.equals=function(t){return pe.equals(this,t)},pe.prototype.equalsEpsilon=function(t,i){return pe.equalsEpsilon(this,t,i)},pe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Lv(t,i,e,n){i=i??0,e=e??0,n=n??0,S.typeOf.number.greaterThanOrEquals("x",i,0),S.typeOf.number.greaterThanOrEquals("y",e,0),S.typeOf.number.greaterThanOrEquals("z",n,0),t._radii=new F(i,e,n),t._radiiSquared=new F(i*i,e*e,n*n),t._radiiToTheFourth=new F(i*i*i*i,e*e*e*e,n*n*n*n),t._oneOverRadii=new F(i===0?0:1/i,e===0?0:1/e,n===0?0:1/n),t._oneOverRadiiSquared=new F(i===0?0:1/(i*i),e===0?0:1/(e*e),n===0?0:1/(n*n)),t._minimumRadius=Math.min(i,e,n),t._maximumRadius=Math.max(i,e,n),t._centerToleranceSquared=N.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function ae(t,i,e){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Lv(this,t,i,e)}Object.defineProperties(ae.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),ae.clone=function(t,i){if(!T(t))return;const e=t._radii;return T(i)?(F.clone(e,i._radii),F.clone(t._radiiSquared,i._radiiSquared),F.clone(t._radiiToTheFourth,i._radiiToTheFourth),F.clone(t._oneOverRadii,i._oneOverRadii),F.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new ae(e.x,e.y,e.z)},ae.fromCartesian3=function(t,i){return T(i)||(i=new ae),T(t)&&Lv(i,t.x,t.y,t.z),i},ae.WGS84=Object.freeze(new ae(6378137,6378137,6356752314245179e-9)),ae.UNIT_SPHERE=Object.freeze(new ae(1,1,1)),ae.MOON=Object.freeze(new ae(N.LUNAR_RADIUS,N.LUNAR_RADIUS,N.LUNAR_RADIUS)),ae.MARS=Object.freeze(new ae(3396190,3396190,3376200)),ae._default=ae.WGS84,Object.defineProperties(ae,{default:{get:function(){return ae._default},set:function(t){S.typeOf.object("value",t),ae._default=t,F._ellipsoidRadiiSquared=t.radiiSquared,pe._ellipsoidOneOverRadii=t.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),ae.prototype.clone=function(t){return ae.clone(this,t)},ae.packedLength=F.packedLength,ae.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,F.pack(t._radii,i,e),i},ae.unpack=function(t,i,e){S.defined("array",t),i=i??0;const n=F.unpack(t,i);return ae.fromCartesian3(n,e)},ae.prototype.geocentricSurfaceNormal=F.normalize,ae.prototype.geodeticSurfaceNormalCartographic=function(t,i){S.typeOf.object("cartographic",t);const e=t.longitude,n=t.latitude,o=Math.cos(n),s=o*Math.cos(e),r=o*Math.sin(e),l=Math.sin(n);return T(i)||(i=new F),i.x=s,i.y=r,i.z=l,F.normalize(i,i)},ae.prototype.geodeticSurfaceNormal=function(t,i){if(S.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new G("cartesian has a NaN component");if(!F.equalsEpsilon(t,F.ZERO,N.EPSILON14))return T(i)||(i=new F),i=F.multiplyComponents(t,this._oneOverRadiiSquared,i),F.normalize(i,i)};const bS=new F,SS=new F;ae.prototype.cartographicToCartesian=function(t,i){const e=bS,n=SS;this.geodeticSurfaceNormalCartographic(t,e),F.multiplyComponents(this._radiiSquared,e,n);const o=Math.sqrt(F.dot(e,n));return F.divideByScalar(n,o,n),F.multiplyByScalar(e,t.height,e),T(i)||(i=new F),F.add(n,e,i)},ae.prototype.cartographicArrayToCartesianArray=function(t,i){S.defined("cartographics",t);const e=t.length;T(i)?i.length=e:i=new Array(e);for(let n=0;n<e;n++)i[n]=this.cartographicToCartesian(t[n],i[n]);return i};const xS=new F,ES=new F,AS=new F;ae.prototype.cartesianToCartographic=function(t,i){const e=this.scaleToGeodeticSurface(t,ES);if(!T(e))return;const n=this.geodeticSurfaceNormal(e,xS),o=F.subtract(t,e,AS),s=Math.atan2(n.y,n.x),r=Math.asin(n.z),l=N.sign(F.dot(o,t))*F.magnitude(o);return T(i)?(i.longitude=s,i.latitude=r,i.height=l,i):new pe(s,r,l)},ae.prototype.cartesianArrayToCartographicArray=function(t,i){S.defined("cartesians",t);const e=t.length;T(i)?i.length=e:i=new Array(e);for(let n=0;n<e;++n)i[n]=this.cartesianToCartographic(t[n],i[n]);return i},ae.prototype.scaleToGeodeticSurface=function(t,i){return zv(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,i)},ae.prototype.scaleToGeocentricSurface=function(t,i){S.typeOf.object("cartesian",t),T(i)||(i=new F);const e=t.x,n=t.y,o=t.z,s=this._oneOverRadiiSquared,r=1/Math.sqrt(e*e*s.x+n*n*s.y+o*o*s.z);return F.multiplyByScalar(t,r,i)},ae.prototype.transformPositionToScaledSpace=function(t,i){return T(i)||(i=new F),F.multiplyComponents(t,this._oneOverRadii,i)},ae.prototype.transformPositionFromScaledSpace=function(t,i){return T(i)||(i=new F),F.multiplyComponents(t,this._radii,i)},ae.prototype.equals=function(t){return this===t||T(t)&&F.equals(this._radii,t._radii)},ae.prototype.toString=function(){return this._radii.toString()},ae.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,e){if(S.typeOf.object("position",t),!N.equalsEpsilon(this._radii.x,this._radii.y,N.EPSILON15))throw new G("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");S.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=i??0;const n=this._squaredXOverSquaredZ;if(T(e)||(e=new F),e.x=0,e.y=0,e.z=t.z*(1-n),!(Math.abs(e.z)>=this._radii.z-i))return e};const TS=new F;ae.prototype.getLocalCurvature=function(t,i){S.typeOf.object("surfacePosition",t),T(i)||(i=new j);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,TS),n=F.distance(t,e),o=this.minimumRadius*n/this.maximumRadius**2,s=n*o**2;return j.fromElements(1/n,1/s,i)};const MS=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],IS=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Ov(t,i,e){S.typeOf.number("a",t),S.typeOf.number("b",i),S.typeOf.func("func",e);const n=.5*(i+t),o=.5*(i-t);let s=0;for(let r=0;r<5;r++){const l=o*MS[r];s+=IS[r]*(e(n+l)+e(n-l))}return s*=o,s}ae.prototype.surfaceArea=function(t){S.typeOf.object("rectangle",t);const i=t.west;let e=t.east;const n=t.south,o=t.north;for(;e<i;)e+=N.TWO_PI;const s=this._radiiSquared,r=s.x,l=s.y,c=s.z,u=r*l;return Ov(n,o,function(d){const p=Math.cos(d),f=Math.sin(d);return Math.cos(d)*Ov(i,e,function(m){const g=Math.cos(m),y=Math.sin(m);return Math.sqrt(u*f*f+c*(l*g*g+r*y*y)*p*p)})})};function wr(t,i,e){S.defined("array",t),S.defined("itemToFind",i),S.defined("comparator",e);let n=0,o=t.length-1,s,r;for(;n<=o;){if(s=~~((n+o)/2),r=e(t[s],i),r<0){n=s+1;continue}if(r>0){o=s-1;continue}return s}return~(o+1)}function Vu(t,i,e,n,o){this.xPoleWander=t,this.yPoleWander=i,this.xPoleOffset=e,this.yPoleOffset=n,this.ut1MinusUtc=o}function Uu(t){if(t===null||isNaN(t))throw new G("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const Nv=[31,28,31,30,31,30,31,31,30,31,30,31];function Wu(t,i,e,n,o,s,r,l){t=t??1,i=i??1,e=e??1,n=n??0,o=o??0,s=s??0,r=r??0,l=l??!1,y(),_(),this.year=t,this.month=i,this.day=e,this.hour=n,this.minute=o,this.second=s,this.millisecond=r,this.isLeapSecond=l;function y(){S.typeOf.number.greaterThanOrEquals("Year",t,1),S.typeOf.number.lessThanOrEquals("Year",t,9999),S.typeOf.number.greaterThanOrEquals("Month",i,1),S.typeOf.number.lessThanOrEquals("Month",i,12),S.typeOf.number.greaterThanOrEquals("Day",e,1),S.typeOf.number.lessThanOrEquals("Day",e,31),S.typeOf.number.greaterThanOrEquals("Hour",n,0),S.typeOf.number.lessThanOrEquals("Hour",n,23),S.typeOf.number.greaterThanOrEquals("Minute",o,0),S.typeOf.number.lessThanOrEquals("Minute",o,59),S.typeOf.bool("IsLeapSecond",l),S.typeOf.number.greaterThanOrEquals("Second",s,0),S.typeOf.number.lessThanOrEquals("Second",s,l?60:59),S.typeOf.number.greaterThanOrEquals("Millisecond",r,0),S.typeOf.number.lessThan("Millisecond",r,1e3)}function _(){const P=i===2&&Uu(t)?Nv[i-1]+1:Nv[i-1];if(e>P)throw new G("Month and Day represents invalid date")}}function Te(t,i){this.julianDate=t,this.offset=i}const Ve=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1}),me=Object.freeze({UTC:0,TAI:1}),Bv=new Wu,Ac=[31,28,31,30,31,30,31,31,30,31,30,31],Tc=29;function Gu(t,i){return k.compare(t.julianDate,i.julianDate)}const cs=new Te;function Mc(t){cs.julianDate=t;const i=k.leapSeconds;let e=wr(i,cs,Gu);e<0&&(e=~e),e>=i.length&&(e=i.length-1);let n=i[e].offset;e>0&&k.secondsDifference(i[e].julianDate,t)>n&&(e--,n=i[e].offset),k.addSeconds(t,n,t)}function Vv(t,i){cs.julianDate=t;const e=k.leapSeconds;let n=wr(e,cs,Gu);if(n<0&&(n=~n),n===0)return k.addSeconds(t,-e[0].offset,i);if(n>=e.length)return k.addSeconds(t,-e[n-1].offset,i);const o=k.secondsDifference(e[n].julianDate,t);if(o===0)return k.addSeconds(t,-e[n].offset,i);if(!(o<=1))return k.addSeconds(t,-e[--n].offset,i)}function xn(t,i,e){const n=i/Ve.SECONDS_PER_DAY|0;return t+=n,i-=Ve.SECONDS_PER_DAY*n,i<0&&(t--,i+=Ve.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=i,e}function Hu(t,i,e,n,o,s,r){const l=(i-14)/12|0,c=t+4800+l;let u=(1461*c/4|0)+(367*(i-2-12*l)/12|0)-(3*((c+100)/100|0)/4|0)+e-32075;n=n-12,n<0&&(n+=24);const d=s+(n*Ve.SECONDS_PER_HOUR+o*Ve.SECONDS_PER_MINUTE+r*Ve.SECONDS_PER_MILLISECOND);return d>=43200&&(u-=1),[u,d]}const DS=/^(\d{4})$/,RS=/^(\d{4})-(\d{2})$/,FS=/^(\d{4})-?(\d{3})$/,zS=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,LS=/^(\d{4})-?(\d{2})-?(\d{2})$/,qu=/([Z+\-])?(\d{2})?:?(\d{2})?$/,OS=/^(\d{2})(\.\d+)?/.source+qu.source,NS=/^(\d{2}):?(\d{2})(\.\d+)?/.source+qu.source,BS=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+qu.source,ci="Invalid ISO 8601 date.";function k(t,i,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,i=i??0,e=e??me.UTC;const n=t|0;i=i+(t-n)*Ve.SECONDS_PER_DAY,xn(n,i,this),e===me.UTC&&Mc(this)}k.fromGregorianDate=function(t,i){if(!(t instanceof Wu))throw new G("date must be a valid GregorianDate.");const e=Hu(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return T(i)?(xn(e[0],e[1],i),Mc(i),i):new k(e[0],e[1],me.UTC)},k.fromDate=function(t,i){if(!(t instanceof Date)||isNaN(t.getTime()))throw new G("date must be a valid JavaScript Date.");const e=Hu(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return T(i)?(xn(e[0],e[1],i),Mc(i),i):new k(e[0],e[1],me.UTC)},k.fromIso8601=function(t,i){if(typeof t!="string")throw new G(ci);t=t.replace(",",".");let e=t.split("T"),n,o=1,s=1,r=0,l=0,c=0,u=0;const d=e[0],p=e[1];let f,m;if(!T(d))throw new G(ci);let g;if(e=d.match(LS),e!==null){if(g=d.split("-").length-1,g>0&&g!==2)throw new G(ci);n=+e[1],o=+e[2],s=+e[3]}else if(e=d.match(RS),e!==null)n=+e[1],o=+e[2];else if(e=d.match(DS),e!==null)n=+e[1];else{let w;if(e=d.match(FS),e!==null){if(n=+e[1],w=+e[2],m=Uu(n),w<1||m&&w>366||!m&&w>365)throw new G(ci)}else if(e=d.match(zS),e!==null){n=+e[1];const b=+e[2],x=+e[3]||0;if(g=d.split("-").length-1,g>0&&(!T(e[3])&&g!==1||T(e[3])&&g!==2))throw new G(ci);const A=new Date(Date.UTC(n,0,4));w=b*7+x-A.getUTCDay()-3}else throw new G(ci);f=new Date(Date.UTC(n,0,1)),f.setUTCDate(w),o=f.getUTCMonth()+1,s=f.getUTCDate()}if(m=Uu(n),o<1||o>12||s<1||(o!==2||!m)&&s>Ac[o-1]||m&&o===2&&s>Tc)throw new G(ci);let y;if(T(p)){if(e=p.match(BS),e!==null){if(g=p.split(":").length-1,g>0&&g!==2&&g!==3)throw new G(ci);r=+e[1],l=+e[2],c=+e[3],u=+(e[4]||0)*1e3,y=5}else if(e=p.match(NS),e!==null){if(g=p.split(":").length-1,g>2)throw new G(ci);r=+e[1],l=+e[2],c=+(e[3]||0)*60,y=4}else if(e=p.match(OS),e!==null)r=+e[1],l=+(e[2]||0)*60,y=3;else throw new G(ci);if(l>=60||c>=61||r>24||r===24&&(l>0||c>0||u>0))throw new G(ci);const w=e[y],b=+e[y+1],x=+(e[y+2]||0);switch(w){case"+":r=r-b,l=l-x;break;case"-":r=r+b,l=l+x;break;case"Z":break;default:l=l+new Date(Date.UTC(n,o-1,s,r,l)).getTimezoneOffset();break}}const _=c===60;for(_&&c--;l>=60;)l-=60,r++;for(;r>=24;)r-=24,s++;for(f=m&&o===2?Tc:Ac[o-1];s>f;)s-=f,o++,o>12&&(o-=12,n++),f=m&&o===2?Tc:Ac[o-1];for(;l<0;)l+=60,r--;for(;r<0;)r+=24,s--;for(;s<1;)o--,o<1&&(o+=12,n--),f=m&&o===2?Tc:Ac[o-1],s+=f;const P=Hu(n,o,s,r,l,c,u);return T(i)?(xn(P[0],P[1],i),Mc(i)):i=new k(P[0],P[1],me.UTC),_&&k.addSeconds(i,1,i),i},k.now=function(t){return k.fromDate(new Date,t)};const Ic=new k(0,0,me.TAI);k.toGregorianDate=function(t,i){if(!T(t))throw new G("julianDate is required.");let e=!1,n=Vv(t,Ic);T(n)||(k.addSeconds(t,-1,Ic),n=Vv(Ic,Ic),e=!0);let o=n.dayNumber;const s=n.secondsOfDay;s>=43200&&(o+=1);let r=o+68569|0;const l=4*r/146097|0;r=r-((146097*l+3)/4|0)|0;const c=4e3*(r+1)/1461001|0;r=r-(1461*c/4|0)+31|0;const u=80*r/2447|0,d=r-(2447*u/80|0)|0;r=u/11|0;const p=u+2-12*r|0,f=100*(l-49)+c+r|0;let m=s/Ve.SECONDS_PER_HOUR|0,g=s-m*Ve.SECONDS_PER_HOUR;const y=g/Ve.SECONDS_PER_MINUTE|0;g=g-y*Ve.SECONDS_PER_MINUTE;let _=g|0;const P=(g-_)/Ve.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),e&&(_+=1),T(i)?(i.year=f,i.month=p,i.day=d,i.hour=m,i.minute=y,i.second=_,i.millisecond=P,i.isLeapSecond=e,i):new Wu(f,p,d,m,y,_,P,e)},k.toDate=function(t){if(!T(t))throw new G("julianDate is required.");const i=k.toGregorianDate(t,Bv);let e=i.second;return i.isLeapSecond&&(e-=1),new Date(Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,e,i.millisecond))},k.toIso8601=function(t,i){if(!T(t))throw new G("julianDate is required.");const e=k.toGregorianDate(t,Bv);let n=e.year,o=e.month,s=e.day,r=e.hour;const l=e.minute,c=e.second,u=e.millisecond;n===1e4&&o===1&&s===1&&r===0&&l===0&&c===0&&u===0&&(n=9999,o=12,s=31,r=24);let d;if(!T(i)&&u!==0){const p=u*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`}return!T(i)||i===0?`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(u*.01).toFixed(i).replace(".","").slice(0,i),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},k.clone=function(t,i){if(T(t))return T(i)?(i.dayNumber=t.dayNumber,i.secondsOfDay=t.secondsOfDay,i):new k(t.dayNumber,t.secondsOfDay,me.TAI)},k.compare=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");const e=t.dayNumber-i.dayNumber;return e!==0?e:t.secondsOfDay-i.secondsOfDay},k.equals=function(t,i){return t===i||T(t)&&T(i)&&t.dayNumber===i.dayNumber&&t.secondsOfDay===i.secondsOfDay},k.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(k.secondsDifference(t,i))<=e},k.totalDays=function(t){if(!T(t))throw new G("julianDate is required.");return t.dayNumber+t.secondsOfDay/Ve.SECONDS_PER_DAY},k.secondsDifference=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");return(t.dayNumber-i.dayNumber)*Ve.SECONDS_PER_DAY+(t.secondsOfDay-i.secondsOfDay)},k.daysDifference=function(t,i){if(!T(t))throw new G("left is required.");if(!T(i))throw new G("right is required.");const e=t.dayNumber-i.dayNumber,n=(t.secondsOfDay-i.secondsOfDay)/Ve.SECONDS_PER_DAY;return e+n},k.computeTaiMinusUtc=function(t){cs.julianDate=t;const i=k.leapSeconds;let e=wr(i,cs,Gu);return e<0&&(e=~e,--e,e<0&&(e=0)),i[e].offset},k.addSeconds=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("seconds is required.");if(!T(e))throw new G("result is required.");return xn(t.dayNumber,t.secondsOfDay+i,e)},k.addMinutes=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("minutes is required.");if(!T(e))throw new G("result is required.");const n=t.secondsOfDay+i*Ve.SECONDS_PER_MINUTE;return xn(t.dayNumber,n,e)},k.addHours=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("hours is required.");if(!T(e))throw new G("result is required.");const n=t.secondsOfDay+i*Ve.SECONDS_PER_HOUR;return xn(t.dayNumber,n,e)},k.addDays=function(t,i,e){if(!T(t))throw new G("julianDate is required.");if(!T(i))throw new G("days is required.");if(!T(e))throw new G("result is required.");const n=t.dayNumber+i;return xn(n,t.secondsOfDay,e)},k.lessThan=function(t,i){return k.compare(t,i)<0},k.lessThanOrEquals=function(t,i){return k.compare(t,i)<=0},k.greaterThan=function(t,i){return k.compare(t,i)>0},k.greaterThanOrEquals=function(t,i){return k.compare(t,i)>=0},k.prototype.clone=function(t){return k.clone(this,t)},k.prototype.equals=function(t){return k.equals(this,t)},k.prototype.equalsEpsilon=function(t,i){return k.equalsEpsilon(this,t,i)},k.prototype.toString=function(){return k.toIso8601(this)},k.leapSeconds=[new Te(new k(2441317,43210,me.TAI),10),new Te(new k(2441499,43211,me.TAI),11),new Te(new k(2441683,43212,me.TAI),12),new Te(new k(2442048,43213,me.TAI),13),new Te(new k(2442413,43214,me.TAI),14),new Te(new k(2442778,43215,me.TAI),15),new Te(new k(2443144,43216,me.TAI),16),new Te(new k(2443509,43217,me.TAI),17),new Te(new k(2443874,43218,me.TAI),18),new Te(new k(2444239,43219,me.TAI),19),new Te(new k(2444786,43220,me.TAI),20),new Te(new k(2445151,43221,me.TAI),21),new Te(new k(2445516,43222,me.TAI),22),new Te(new k(2446247,43223,me.TAI),23),new Te(new k(2447161,43224,me.TAI),24),new Te(new k(2447892,43225,me.TAI),25),new Te(new k(2448257,43226,me.TAI),26),new Te(new k(2448804,43227,me.TAI),27),new Te(new k(2449169,43228,me.TAI),28),new Te(new k(2449534,43229,me.TAI),29),new Te(new k(2450083,43230,me.TAI),30),new Te(new k(2450630,43231,me.TAI),31),new Te(new k(2451179,43232,me.TAI),32),new Te(new k(2453736,43233,me.TAI),33),new Te(new k(2454832,43234,me.TAI),34),new Te(new k(2456109,43235,me.TAI),35),new Te(new k(2457204,43236,me.TAI),36),new Te(new k(2457754,43237,me.TAI),37)];var Dc={exports:{}},Cr={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var VS=Cr.exports,Uv;function US(){return Uv||(Uv=1,(function(t,i){(function(e){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s=typeof pv=="object"&&pv;(s.global===s||s.window===s||s.self===s)&&(e=s);var r,l=2147483647,c=36,u=1,d=26,p=38,f=700,m=72,g=128,y="-",_=/^xn--/,P=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-u,A=Math.floor,M=String.fromCharCode,D;function L(X){throw new RangeError(b[X])}function V(X,Q){for(var ee=X.length,oe=[];ee--;)oe[ee]=Q(X[ee]);return oe}function O(X,Q){var ee=X.split("@"),oe="";ee.length>1&&(oe=ee[0]+"@",X=ee[1]),X=X.replace(w,".");var fe=X.split("."),ve=V(fe,Q).join(".");return oe+ve}function z(X){for(var Q=[],ee=0,oe=X.length,fe,ve;ee<oe;)fe=X.charCodeAt(ee++),fe>=55296&&fe<=56319&&ee<oe?(ve=X.charCodeAt(ee++),(ve&64512)==56320?Q.push(((fe&1023)<<10)+(ve&1023)+65536):(Q.push(fe),ee--)):Q.push(fe);return Q}function U(X){return V(X,function(Q){var ee="";return Q>65535&&(Q-=65536,ee+=M(Q>>>10&1023|55296),Q=56320|Q&1023),ee+=M(Q),ee}).join("")}function C(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:c}function E(X,Q){return X+22+75*(X<26)-((Q!=0)<<5)}function R(X,Q,ee){var oe=0;for(X=ee?A(X/f):X>>1,X+=A(X/Q);X>x*d>>1;oe+=c)X=A(X/x);return A(oe+(x+1)*X/(X+p))}function B(X){var Q=[],ee=X.length,oe,fe=0,ve=g,xe=m,Oe,Ue,ge,ie,ce,he,Ee,Ne,Ot;for(Oe=X.lastIndexOf(y),Oe<0&&(Oe=0),Ue=0;Ue<Oe;++Ue)X.charCodeAt(Ue)>=128&&L("not-basic"),Q.push(X.charCodeAt(Ue));for(ge=Oe>0?Oe+1:0;ge<ee;){for(ie=fe,ce=1,he=c;ge>=ee&&L("invalid-input"),Ee=C(X.charCodeAt(ge++)),(Ee>=c||Ee>A((l-fe)/ce))&&L("overflow"),fe+=Ee*ce,Ne=he<=xe?u:he>=xe+d?d:he-xe,!(Ee<Ne);he+=c)Ot=c-Ne,ce>A(l/Ot)&&L("overflow"),ce*=Ot;oe=Q.length+1,xe=R(fe-ie,oe,ie==0),A(fe/oe)>l-ve&&L("overflow"),ve+=A(fe/oe),fe%=oe,Q.splice(fe++,0,ve)}return U(Q)}function W(X){var Q,ee,oe,fe,ve,xe,Oe,Ue,ge,ie,ce,he=[],Ee,Ne,Ot,st;for(X=z(X),Ee=X.length,Q=g,ee=0,ve=m,xe=0;xe<Ee;++xe)ce=X[xe],ce<128&&he.push(M(ce));for(oe=fe=he.length,fe&&he.push(y);oe<Ee;){for(Oe=l,xe=0;xe<Ee;++xe)ce=X[xe],ce>=Q&&ce<Oe&&(Oe=ce);for(Ne=oe+1,Oe-Q>A((l-ee)/Ne)&&L("overflow"),ee+=(Oe-Q)*Ne,Q=Oe,xe=0;xe<Ee;++xe)if(ce=X[xe],ce<Q&&++ee>l&&L("overflow"),ce==Q){for(Ue=ee,ge=c;ie=ge<=ve?u:ge>=ve+d?d:ge-ve,!(Ue<ie);ge+=c)st=Ue-ie,Ot=c-ie,he.push(M(E(ie+st%Ot,0))),Ue=A(st/Ot);he.push(M(E(Ue,0))),ve=R(ee,Ne,oe==fe),ee=0,++oe}++ee,++Q}return he.join("")}function Y(X){return O(X,function(Q){return _.test(Q)?B(Q.slice(4).toLowerCase()):Q})}function q(X){return O(X,function(Q){return P.test(Q)?"xn--"+W(Q):Q})}if(r={version:"1.3.2",ucs2:{decode:z,encode:U},decode:B,encode:W,toASCII:q,toUnicode:Y},n&&o)if(t.exports==n)o.exports=r;else for(D in r)r.hasOwnProperty(D)&&(n[D]=r[D]);else e.punycode=r})(VS)})(Cr,Cr.exports)),Cr.exports}var Rc={exports:{}};/*!
|
|
327
327
|
* URI.js - Mutating URLs
|
|
328
328
|
* IPv6 Support
|
|
329
329
|
*
|
|
@@ -335,7 +335,7 @@ ${this.stack.toString()}`),t};function $(t,i,e,n,o,s,r,l,c,u,d,p,f,m,g,y){this[0
|
|
|
335
335
|
* Licensed under
|
|
336
336
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
337
337
|
*
|
|
338
|
-
*/var WS=Rc.exports,Wv;function GS(){return Wv||(Wv=1,function(t){(function(i,e){t.exports?t.exports=e():i.IPv6=e(i)})(WS,function(i){var e=i&&i.IPv6;function n(s){var r=s.toLowerCase(),l=r.split(":"),c=l.length,u=8;l[0]===""&&l[1]===""&&l[2]===""?(l.shift(),l.shift()):l[0]===""&&l[1]===""?l.shift():l[c-1]===""&&l[c-2]===""&&l.pop(),c=l.length,l[c-1].indexOf(".")!==-1&&(u=7);var d;for(d=0;d<c&&l[d]!=="";d++);if(d<u)for(l.splice(d,1,"0000");l.length<u;)l.splice(d,0,"0000");for(var p,f=0;f<u;f++){p=l[f].split("");for(var m=0;m<3&&(p[0]==="0"&&p.length>1);m++)p.splice(0,1);l[f]=p.join("")}var g=-1,y=0,_=0,P=-1,w=!1;for(f=0;f<u;f++)w?l[f]==="0"?_+=1:(w=!1,_>y&&(g=P,y=_)):l[f]==="0"&&(w=!0,P=f,_=1);_>y&&(g=P,y=_),y>1&&l.splice(g,y,""),c=l.length;var b="";for(l[0]===""&&(b=":"),f=0;f<c&&(b+=l[f],f!==c-1);f++)b+=":";return l[c-1]===""&&(b+=":"),b}function o(){return i.IPv6===this&&(i.IPv6=e),this}return{best:n,noConflict:o}})}(Rc)),Rc.exports}var Fc={exports:{}};/*!
|
|
338
|
+
*/var WS=Rc.exports,Wv;function GS(){return Wv||(Wv=1,(function(t){(function(i,e){t.exports?t.exports=e():i.IPv6=e(i)})(WS,function(i){var e=i&&i.IPv6;function n(s){var r=s.toLowerCase(),l=r.split(":"),c=l.length,u=8;l[0]===""&&l[1]===""&&l[2]===""?(l.shift(),l.shift()):l[0]===""&&l[1]===""?l.shift():l[c-1]===""&&l[c-2]===""&&l.pop(),c=l.length,l[c-1].indexOf(".")!==-1&&(u=7);var d;for(d=0;d<c&&l[d]!=="";d++);if(d<u)for(l.splice(d,1,"0000");l.length<u;)l.splice(d,0,"0000");for(var p,f=0;f<u;f++){p=l[f].split("");for(var m=0;m<3&&(p[0]==="0"&&p.length>1);m++)p.splice(0,1);l[f]=p.join("")}var g=-1,y=0,_=0,P=-1,w=!1;for(f=0;f<u;f++)w?l[f]==="0"?_+=1:(w=!1,_>y&&(g=P,y=_)):l[f]==="0"&&(w=!0,P=f,_=1);_>y&&(g=P,y=_),y>1&&l.splice(g,y,""),c=l.length;var b="";for(l[0]===""&&(b=":"),f=0;f<c&&(b+=l[f],f!==c-1);f++)b+=":";return l[c-1]===""&&(b+=":"),b}function o(){return i.IPv6===this&&(i.IPv6=e),this}return{best:n,noConflict:o}})})(Rc)),Rc.exports}var Fc={exports:{}};/*!
|
|
339
339
|
* URI.js - Mutating URLs
|
|
340
340
|
* Second Level Domain (SLD) Support
|
|
341
341
|
*
|
|
@@ -347,7 +347,7 @@ ${this.stack.toString()}`),t};function $(t,i,e,n,o,s,r,l,c,u,d,p,f,m,g,y){this[0
|
|
|
347
347
|
* Licensed under
|
|
348
348
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
349
349
|
*
|
|
350
|
-
*/var HS=Fc.exports,Gv;function qS(){return Gv||(Gv=1,function(t){(function(i,e){t.exports?t.exports=e():i.SecondLevelDomains=e(i)})(HS,function(i){var e=i&&i.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var r=o.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return!1;var l=n.list[o.slice(s+1)];return l?l.indexOf(" "+o.slice(r+1,s)+" ")>=0:!1},is:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var r=o.lastIndexOf(".",s-1);if(r>=0)return!1;var l=n.list[o.slice(s+1)];return l?l.indexOf(" "+o.slice(0,s)+" ")>=0:!1},get:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return null;var r=o.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return null;var l=n.list[o.slice(s+1)];return!l||l.indexOf(" "+o.slice(r+1,s)+" ")<0?null:o.slice(r+1)},noConflict:function(){return i.SecondLevelDomains===this&&(i.SecondLevelDomains=e),this}};return n})}(Fc)),Fc.exports}/*!
|
|
350
|
+
*/var HS=Fc.exports,Gv;function qS(){return Gv||(Gv=1,(function(t){(function(i,e){t.exports?t.exports=e():i.SecondLevelDomains=e(i)})(HS,function(i){var e=i&&i.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var r=o.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return!1;var l=n.list[o.slice(s+1)];return l?l.indexOf(" "+o.slice(r+1,s)+" ")>=0:!1},is:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var r=o.lastIndexOf(".",s-1);if(r>=0)return!1;var l=n.list[o.slice(s+1)];return l?l.indexOf(" "+o.slice(0,s)+" ")>=0:!1},get:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return null;var r=o.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return null;var l=n.list[o.slice(s+1)];return!l||l.indexOf(" "+o.slice(r+1,s)+" ")<0?null:o.slice(r+1)},noConflict:function(){return i.SecondLevelDomains===this&&(i.SecondLevelDomains=e),this}};return n})})(Fc)),Fc.exports}/*!
|
|
351
351
|
* URI.js - Mutating URLs
|
|
352
352
|
*
|
|
353
353
|
* Version: 1.19.11
|
|
@@ -358,8 +358,8 @@ ${this.stack.toString()}`),t};function $(t,i,e,n,o,s,r,l,c,u,d,p,f,m,g,y){this[0
|
|
|
358
358
|
* Licensed under
|
|
359
359
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
360
360
|
*
|
|
361
|
-
*/var $S=Dc.exports,Hv;function XS(){return Hv||(Hv=1,function(t){(function(i,e){t.exports?t.exports=e(US(),GS(),qS()):i.URI=e(i.punycode,i.IPv6,i.SecondLevelDomains,i)})($S,function(i,e,n,o){var s=o&&o.URI;function r(C,E){var R=arguments.length>=1,B=arguments.length>=2;if(!(this instanceof r))return R?B?new r(C,E):new r(C):new r;if(C===void 0){if(R)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&R)throw new TypeError("null is not a valid argument for URI");return this.href(C),E!==void 0?this.absoluteTo(E):this}function l(C){return/^[0-9]+$/.test(C)}r.version="1.19.11";var c=r.prototype,u=Object.prototype.hasOwnProperty;function d(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function f(C){return p(C)==="Array"}function m(C,E){var R={},B,W;if(p(E)==="RegExp")R=null;else if(f(E))for(B=0,W=E.length;B<W;B++)R[E[B]]=!0;else R[E]=!0;for(B=0,W=C.length;B<W;B++){var Y=R&&R[C[B]]!==void 0||!R&&E.test(C[B]);Y&&(C.splice(B,1),W--,B--)}return C}function g(C,E){var R,B;if(f(E)){for(R=0,B=E.length;R<B;R++)if(!g(C,E[R]))return!1;return!0}var W=p(E);for(R=0,B=C.length;R<B;R++)if(W==="RegExp"){if(typeof C[R]=="string"&&C[R].match(E))return!0}else if(C[R]===E)return!0;return!1}function y(C,E){if(!f(C)||!f(E)||C.length!==E.length)return!1;C.sort(),E.sort();for(var R=0,B=C.length;R<B;R++)if(C[R]!==E[R])return!1;return!0}function _(C){var E=/^\/+|\/+$/g;return C.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var E=C.nodeName.toLowerCase();if(!(E==="input"&&C.type!=="image"))return r.domAttributes[E]}};function P(C){return escape(C)}function w(C){return encodeURIComponent(C).replace(/[!'()*]/g,P).replace(/\*/g,"%2A")}r.encode=w,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=w,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(C,E){var R=r.encode(C+"");return E===void 0&&(E=r.escapeQuerySpace),E?R.replace(/%20/g,"+"):R},r.decodeQuery=function(C,E){C+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?C.replace(/\+/g,"%20"):C)}catch{return C}};var b={encode:"encode",decode:"decode"},x,A=function(C,E){return function(R){try{return r[E](R+"").replace(r.characters[C][E].expression,function(B){return r.characters[C][E].map[B]})}catch{return R}}};for(x in b)r[x+"PathSegment"]=A("pathname",b[x]),r[x+"UrnPathSegment"]=A("urnpath",b[x]);var M=function(C,E,R){return function(B){var W;R?W=function(Q){return r[E](r[R](Q))}:W=r[E];for(var Y=(B+"").split(C),q=0,X=Y.length;q<X;q++)Y[q]=W(Y[q]);return Y.join(C)}};r.decodePath=M("/","decodePathSegment"),r.decodeUrnPath=M(":","decodeUrnPathSegment"),r.recodePath=M("/","encodePathSegment","decode"),r.recodeUrnPath=M(":","encodeUrnPathSegment","decode"),r.encodeReserved=A("reserved","encode"),r.parse=function(C,E){var R;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),C=C.replace(r.leading_whitespace_expression,""),C=C.replace(r.ascii_tab_whitespace,""),R=C.indexOf("#"),R>-1&&(E.fragment=C.substring(R+1)||null,C=C.substring(0,R)),R=C.indexOf("?"),R>-1&&(E.query=C.substring(R+1)||null,C=C.substring(0,R)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(E.protocol=null,C=C.substring(2),C=r.parseAuthority(C,E)):(R=C.indexOf(":"),R>-1&&(E.protocol=C.substring(0,R)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:C.substring(R+1,R+3).replace(/\\/g,"/")==="//"?(C=C.substring(R+3),C=r.parseAuthority(C,E)):(C=C.substring(R+1),E.urn=!0))),E.path=C,E},r.parseHost=function(C,E){C||(C=""),C=C.replace(/\\/g,"/");var R=C.indexOf("/"),B,W;if(R===-1&&(R=C.length),C.charAt(0)==="[")B=C.indexOf("]"),E.hostname=C.substring(1,B)||null,E.port=C.substring(B+2,R)||null,E.port==="/"&&(E.port=null);else{var Y=C.indexOf(":"),q=C.indexOf("/"),X=C.indexOf(":",Y+1);X!==-1&&(q===-1||X<q)?(E.hostname=C.substring(0,R)||null,E.port=null):(W=C.substring(0,R).split(":"),E.hostname=W[0]||null,E.port=W[1]||null)}return E.hostname&&C.substring(R).charAt(0)!=="/"&&(R++,C="/"+C),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),C.substring(R)||"/"},r.parseAuthority=function(C,E){return C=r.parseUserinfo(C,E),r.parseHost(C,E)},r.parseUserinfo=function(C,E){var R=C,B=C.indexOf("\\");B!==-1&&(C=C.replace(/\\/g,"/"));var W=C.indexOf("/"),Y=C.lastIndexOf("@",W>-1?W:C.length-1),q;return Y>-1&&(W===-1||Y<W)?(q=C.substring(0,Y).split(":"),E.username=q[0]?r.decode(q[0]):null,q.shift(),E.password=q[0]?r.decode(q.join(":")):null,C=R.substring(Y+1)):(E.username=null,E.password=null),C},r.parseQuery=function(C,E){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var R={},B=C.split("&"),W=B.length,Y,q,X,Q=0;Q<W;Q++)Y=B[Q].split("="),q=r.decodeQuery(Y.shift(),E),X=Y.length?r.decodeQuery(Y.join("="),E):null,q!=="__proto__"&&(u.call(R,q)?((typeof R[q]=="string"||R[q]===null)&&(R[q]=[R[q]]),R[q].push(X)):R[q]=X);return R},r.build=function(C){var E="",R=!1;return C.protocol&&(E+=C.protocol+":"),!C.urn&&(E||C.hostname)&&(E+="//",R=!0),E+=r.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&R&&(E+="/"),E+=C.path),typeof C.query=="string"&&C.query&&(E+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(E+="#"+C.fragment),E},r.buildHost=function(C){var E="";if(C.hostname)r.ip6_expression.test(C.hostname)?E+="["+C.hostname+"]":E+=C.hostname;else return"";return C.port&&(E+=":"+C.port),E},r.buildAuthority=function(C){return r.buildUserinfo(C)+r.buildHost(C)},r.buildUserinfo=function(C){var E="";return C.username&&(E+=r.encode(C.username)),C.password&&(E+=":"+r.encode(C.password)),E&&(E+="@"),E},r.buildQuery=function(C,E,R){var B="",W,Y,q,X;for(Y in C)if(Y!=="__proto__"&&u.call(C,Y))if(f(C[Y]))for(W={},q=0,X=C[Y].length;q<X;q++)C[Y][q]!==void 0&&W[C[Y][q]+""]===void 0&&(B+="&"+r.buildQueryParameter(Y,C[Y][q],R),E!==!0&&(W[C[Y][q]+""]=!0));else C[Y]!==void 0&&(B+="&"+r.buildQueryParameter(Y,C[Y],R));return B.substring(1)},r.buildQueryParameter=function(C,E,R){return r.encodeQuery(C,R)+(E!==null?"="+r.encodeQuery(E,R):"")},r.addQuery=function(C,E,R){if(typeof E=="object")for(var B in E)u.call(E,B)&&r.addQuery(C,B,E[B]);else if(typeof E=="string"){if(C[E]===void 0){C[E]=R;return}else typeof C[E]=="string"&&(C[E]=[C[E]]);f(R)||(R=[R]),C[E]=(C[E]||[]).concat(R)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(C,E,R){if(typeof E=="object")for(var B in E)u.call(E,B)&&r.setQuery(C,B,E[B]);else if(typeof E=="string")C[E]=R===void 0?null:R;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(C,E,R){var B,W,Y;if(f(E))for(B=0,W=E.length;B<W;B++)C[E[B]]=void 0;else if(p(E)==="RegExp")for(Y in C)E.test(Y)&&(C[Y]=void 0);else if(typeof E=="object")for(Y in E)u.call(E,Y)&&r.removeQuery(C,Y,E[Y]);else if(typeof E=="string")R!==void 0?p(R)==="RegExp"?!f(C[E])&&R.test(C[E])?C[E]=void 0:C[E]=m(C[E],R):C[E]===String(R)&&(!f(R)||R.length===1)?C[E]=void 0:f(C[E])&&(C[E]=m(C[E],R)):C[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(C,E,R,B){switch(p(E)){case"String":break;case"RegExp":for(var W in C)if(u.call(C,W)&&E.test(W)&&(R===void 0||r.hasQuery(C,W,R)))return!0;return!1;case"Object":for(var Y in E)if(u.call(E,Y)&&!r.hasQuery(C,Y,E[Y]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(R)){case"Undefined":return E in C;case"Boolean":var q=!!(f(C[E])?C[E].length:C[E]);return R===q;case"Function":return!!R(C[E],E,C);case"Array":if(!f(C[E]))return!1;var X=B?g:y;return X(C[E],R);case"RegExp":return f(C[E])?B?g(C[E],R):!1:!!(C[E]&&C[E].match(R));case"Number":R=String(R);case"String":return f(C[E])?B?g(C[E],R):!1:C[E]===R;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var C=[],E=[],R=0,B=0;B<arguments.length;B++){var W=new r(arguments[B]);C.push(W);for(var Y=W.segment(),q=0;q<Y.length;q++)typeof Y[q]=="string"&&E.push(Y[q]),Y[q]&&R++}if(!E.length||!R)return new r("");var X=new r("").segment(E);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},r.commonPath=function(C,E){var R=Math.min(C.length,E.length),B;for(B=0;B<R;B++)if(C.charAt(B)!==E.charAt(B)){B--;break}return B<1?C.charAt(0)===E.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(B)!=="/"||E.charAt(B)!=="/")&&(B=C.substring(0,B).lastIndexOf("/")),C.substring(0,B+1))},r.withinString=function(C,E,R){R||(R={});var B=R.start||r.findUri.start,W=R.end||r.findUri.end,Y=R.trim||r.findUri.trim,q=R.parens||r.findUri.parens,X=/[a-z0-9-]=["']?$/i;for(B.lastIndex=0;;){var Q=B.exec(C);if(!Q)break;var ee=Q.index;if(R.ignoreHtml){var oe=C.slice(Math.max(ee-3,0),ee);if(oe&&X.test(oe))continue}for(var fe=ee+C.slice(ee).search(W),ve=C.slice(ee,fe),xe=-1;;){var Oe=q.exec(ve);if(!Oe)break;var Ue=Oe.index+Oe[0].length;xe=Math.max(xe,Ue)}if(xe>-1?ve=ve.slice(0,xe)+ve.slice(xe).replace(Y,""):ve=ve.replace(Y,""),!(ve.length<=Q[0].length)&&!(R.ignore&&R.ignore.test(ve))){fe=ee+ve.length;var ge=E(ve,ee,fe,C);if(ge===void 0){B.lastIndex=fe;continue}ge=String(ge),C=C.slice(0,ee)+ge+C.slice(fe),B.lastIndex=ee+ge.length}}return B.lastIndex=0,C},r.ensureValidHostname=function(C,E){var R=!!C,B=!!E,W=!1;if(B&&(W=g(r.hostProtocols,E)),W&&!R)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(C&&C.match(r.invalid_hostname_characters)){if(!i)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(i.toASCII(C).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(C){if(C){var E=Number(C);if(!(l(E)&&E>0&&E<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},r.noConflict=function(C){if(C){var E={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(E.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(E.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=o.SecondLevelDomains.noConflict()),E}else o.URI===this&&(o.URI=s);return this},c.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new r(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function D(C){return function(E,R){return E===void 0?this._parts[C]||"":(this._parts[C]=E||null,this.build(!R),this)}}function L(C,E){return function(R,B){return R===void 0?this._parts[C]||"":(R!==null&&(R=R+"",R.charAt(0)===E&&(R=R.substring(1))),this._parts[C]=R,this.build(!B),this)}}c.protocol=D("protocol"),c.username=D("username"),c.password=D("password"),c.hostname=D("hostname"),c.port=D("port"),c.query=L("query","?"),c.fragment=L("fragment","#"),c.search=function(C,E){var R=this.query(C,E);return typeof R=="string"&&R.length?"?"+R:R},c.hash=function(C,E){var R=this.fragment(C,E);return typeof R=="string"&&R.length?"#"+R:R},c.pathname=function(C,E){if(C===void 0||C===!0){var R=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?r.decodeUrnPath:r.decodePath)(R):R}else return this._parts.urn?this._parts.path=C?r.recodeUrnPath(C):"":this._parts.path=C?r.recodePath(C):"/",this.build(!E),this},c.path=c.pathname,c.href=function(C,E){var R;if(C===void 0)return this.toString();this._string="",this._parts=r._parts();var B=C instanceof r,W=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var Y=r.getDomAttribute(C);C=C[Y]||"",W=!1}if(!B&&W&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=r.parse(String(C),this._parts);else if(B||W){var q=B?C._parts:C;for(R in q)R!=="query"&&u.call(this._parts,R)&&(this._parts[R]=q[R]);q.query&&this.query(q.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},c.is=function(C){var E=!1,R=!1,B=!1,W=!1,Y=!1,q=!1,X=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,R=r.ip4_expression.test(this._parts.hostname),B=r.ip6_expression.test(this._parts.hostname),E=R||B,W=!E,Y=W&&n&&n.has(this._parts.hostname),q=W&&r.idn_expression.test(this._parts.hostname),X=W&&r.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return W;case"sld":return Y;case"ip":return E;case"ip4":case"ipv4":case"inet4":return R;case"ip6":case"ipv6":case"inet6":return B;case"idn":return q;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return X}return null};var V=c.protocol,O=c.port,z=c.hostname;c.protocol=function(C,E){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(r.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return V.call(this,C,E)},c.scheme=c.protocol,c.port=function(C,E){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),r.ensureValidPort(C))),O.call(this,C,E))},c.hostname=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var R={preventInvalidHostname:this._parts.preventInvalidHostname},B=r.parseHost(C,R);if(B!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=R.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(C,this._parts.protocol)}return z.call(this,C,E)},c.origin=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var R=this.protocol(),B=this.authority();return B?(R?R+"://":"")+this.authority():""}else{var W=r(C);return this.protocol(W.protocol()).authority(W.authority()).build(!E),this}},c.host=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var R=r.parseHost(C,this._parts);if(R!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},c.authority=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var R=r.parseAuthority(C,this._parts);if(R!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},c.userinfo=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var R=r.buildUserinfo(this._parts);return R&&R.substring(0,R.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),r.parseUserinfo(C,this._parts),this.build(!E),this},c.resource=function(C,E){var R;return C===void 0?this.path()+this.search()+this.hash():(R=r.parse(C),this._parts.path=R.path,this._parts.query=R.query,this._parts.fragment=R.fragment,this.build(!E),this)},c.subdomain=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,R)||""}else{var B=this._parts.hostname.length-this.domain().length,W=this._parts.hostname.substring(0,B),Y=new RegExp("^"+d(W));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&r.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(Y,C),this.build(!E),this}},c.domain=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(E=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.match(/\./g);if(R&&R.length<2)return this._parts.hostname;var B=this._parts.hostname.length-this.tld(E).length-1;return B=this._parts.hostname.lastIndexOf(".",B-1)+1,this._parts.hostname.substring(B)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var W=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(W,C)}return this.build(!E),this}},c.tld=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(E=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.lastIndexOf("."),B=this._parts.hostname.substring(R+1);return E!==!0&&n&&n.list[B.toLowerCase()]&&n.get(this._parts.hostname)||B}else{var W;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))W=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(W,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");W=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(W,C)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},c.directory=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var R=this._parts.path.length-this.filename().length-1,B=this._parts.path.substring(0,R)||(this._parts.hostname?"/":"");return C?r.decodePath(B):B}else{var W=this._parts.path.length-this.filename().length,Y=this._parts.path.substring(0,W),q=new RegExp("^"+d(Y));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=r.recodePath(C),this._parts.path=this._parts.path.replace(q,C),this.build(!E),this}},c.filename=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var R=this._parts.path.lastIndexOf("/"),B=this._parts.path.substring(R+1);return C?r.decodePathSegment(B):B}else{var W=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(W=!0);var Y=new RegExp(d(this.filename())+"$");return C=r.recodePath(C),this._parts.path=this._parts.path.replace(Y,C),W?this.normalizePath(E):this.build(!E),this}},c.suffix=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var R=this.filename(),B=R.lastIndexOf("."),W,Y;return B===-1?"":(W=R.substring(B+1),Y=/^[a-z0-9%]+$/i.test(W)?W:"",C?r.decodePathSegment(Y):Y)}else{C.charAt(0)==="."&&(C=C.substring(1));var q=this.suffix(),X;if(q)C?X=new RegExp(d(q)+"$"):X=new RegExp(d("."+q)+"$");else{if(!C)return this;this._parts.path+="."+r.recodePath(C)}return X&&(C=r.recodePath(C),this._parts.path=this._parts.path.replace(X,C)),this.build(!E),this}},c.segment=function(C,E,R){var B=this._parts.urn?":":"/",W=this.path(),Y=W.substring(0,1)==="/",q=W.split(B);if(C!==void 0&&typeof C!="number"&&(R=E,E=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(Y&&q.shift(),C<0&&(C=Math.max(q.length+C,0)),E===void 0)return C===void 0?q:q[C];if(C===null||q[C]===void 0)if(f(E)){q=[];for(var X=0,Q=E.length;X<Q;X++)!E[X].length&&(!q.length||!q[q.length-1].length)||(q.length&&!q[q.length-1].length&&q.pop(),q.push(_(E[X])))}else(E||typeof E=="string")&&(E=_(E),q[q.length-1]===""?q[q.length-1]=E:q.push(E));else E?q[C]=_(E):q.splice(C,1);return Y&&q.unshift(""),this.path(q.join(B),R)},c.segmentCoded=function(C,E,R){var B,W,Y;if(typeof C!="number"&&(R=E,E=C,C=void 0),E===void 0){if(B=this.segment(C,E,R),!f(B))B=B!==void 0?r.decode(B):void 0;else for(W=0,Y=B.length;W<Y;W++)B[W]=r.decode(B[W]);return B}if(!f(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(W=0,Y=E.length;W<Y;W++)E[W]=r.encode(E[W]);return this.segment(C,E,R)};var U=c.query;return c.query=function(C,E){if(C===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),B=C.call(this,R);return this._parts.query=r.buildQuery(B||R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=r.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):U.call(this,C,E)},c.setQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)B[C]=E!==void 0?E:null;else if(typeof C=="object")for(var W in C)u.call(C,W)&&(B[W]=C[W]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.addQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(B,C,E===void 0?null:E),this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.removeQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(B,C,E),this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.hasQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(B,C,E,R)},c.setSearch=c.setQuery,c.addSearch=c.addQuery,c.removeSearch=c.removeQuery,c.hasSearch=c.hasQuery,c.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},c.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},c.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&i?this._parts.hostname=i.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},c.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},c.normalizePath=function(C){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var R,B="",W,Y;for(E.charAt(0)!=="/"&&(R=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),R&&(B=E.substring(1).match(/^(\.\.\/)+/)||"",B&&(B=B[0]));W=E.search(/\/\.\.(\/|$)/),W!==-1;){if(W===0){E=E.substring(3);continue}Y=E.substring(0,W).lastIndexOf("/"),Y===-1&&(Y=W),E=E.substring(0,Y)+E.substring(W+3)}return R&&this.is("relative")&&(E=B+E.substring(1)),this._parts.path=E,this.build(!C),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},c.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var C=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=C,r.decode=E}return this},c.unicode=function(){var C=r.encode,E=r.decode;r.encode=w,r.decode=unescape;try{this.normalize()}finally{r.encode=C,r.decode=E}return this},c.readable=function(){var C=this.clone();C.username("").password("").normalize();var E="";if(C._parts.protocol&&(E+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&i?(E+=i.toUnicode(C._parts.hostname),C._parts.port&&(E+=":"+C._parts.port)):E+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(E+="/"),E+=C.path(!0),C._parts.query){for(var R="",B=0,W=C._parts.query.split("&"),Y=W.length;B<Y;B++){var q=(W[B]||"").split("=");R+="&"+r.decodeQuery(q[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),q[1]!==void 0&&(R+="="+r.decodeQuery(q[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+R.substring(1)}return E+=r.decodeQuery(C.hash(),!0),E},c.absoluteTo=function(C){var E=this.clone(),R=["protocol","username","password","hostname","port"],B,W,Y;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof r||(C=new r(C)),E._parts.protocol||(E._parts.protocol=C._parts.protocol,this._parts.hostname))return E;for(W=0;Y=R[W];W++)E._parts[Y]=C._parts[Y];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(B=C.directory(),B=B||(C.path().indexOf("/")===0?"/":""),E._parts.path=(B?B+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=C._parts.path,E._parts.query||(E._parts.query=C._parts.query)),E.build(),E},c.relativeTo=function(C){var E=this.clone().normalize(),R,B,W,Y,q;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new r(C).normalize(),R=E._parts,B=C._parts,Y=E.path(),q=C.path(),Y.charAt(0)!=="/")throw new Error("URI is already relative");if(q.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(R.protocol===B.protocol&&(R.protocol=null),R.username!==B.username||R.password!==B.password||R.protocol!==null||R.username!==null||R.password!==null)return E.build();if(R.hostname===B.hostname&&R.port===B.port)R.hostname=null,R.port=null;else return E.build();if(Y===q)return R.path="",E.build();if(W=r.commonPath(Y,q),!W)return E.build();var X=B.path.substring(W.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return R.path=X+R.path.substring(W.length)||"./",E.build()},c.equals=function(C){var E=this.clone(),R=new r(C),B={},W={},Y={},q,X,Q;if(E.normalize(),R.normalize(),E.toString()===R.toString())return!0;if(q=E.query(),X=R.query(),E.query(""),R.query(""),E.toString()!==R.toString()||q.length!==X.length)return!1;B=r.parseQuery(q,this._parts.escapeQuerySpace),W=r.parseQuery(X,this._parts.escapeQuerySpace);for(Q in B)if(u.call(B,Q)){if(f(B[Q])){if(!y(B[Q],W[Q]))return!1}else if(B[Q]!==W[Q])return!1;Y[Q]=!0}for(Q in W)if(u.call(W,Q)&&!Y[Q])return!1;return!0},c.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},c.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},c.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},r})}(Dc)),Dc.exports}var YS=XS();const Hi=dc(YS);function ZS(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function hs(t,i){if(t===null||typeof t!="object")return t;i=i??!1;const e=new t.constructor;for(const n in t)if(t.hasOwnProperty(n)){let o=t[n];i&&(o=hs(o,i)),e[n]=o}return e}function En(t,i,e){e=e??!1;const n={},o=T(t),s=T(i);let r,l,c;if(o)for(r in t)t.hasOwnProperty(r)&&(l=t[r],s&&e&&typeof l=="object"&&i.hasOwnProperty(r)?(c=i[r],typeof c=="object"?n[r]=En(l,c,e):n[r]=l):n[r]=l);if(s)for(r in i)i.hasOwnProperty(r)&&!n.hasOwnProperty(r)&&(c=i[r],n[r]=c);return n}function _r(){let t,i;const e=new Promise(function(n,o){t=n,i=o});return{resolve:t,reject:i,promise:e}}function Pr(t,i){let e;return typeof document<"u"&&(e=document),Pr._implementation(t,i,e)}Pr._implementation=function(t,i,e){if(!T(t))throw new G("relative uri is required.");if(!T(i)){if(typeof e>"u")return t;i=e.baseURI??e.location.href}const n=new Hi(t);return n.scheme()!==""?n.toString():n.absoluteTo(i).toString()};function QS(t,i){if(!T(t))throw new G("uri is required.");let e="";const n=t.lastIndexOf("/");return n!==-1&&(e=t.substring(0,n+1)),i&&(t=new Hi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function kS(t){if(!T(t))throw new G("uri is required.");const i=new Hi(t);i.normalize();let e=i.path(),n=e.lastIndexOf("/");return n!==-1&&(e=e.substr(n+1)),n=e.lastIndexOf("."),n===-1?e="":e=e.substr(n+1),e}const qv={};function $v(t,i,e){T(i)||(i=t.width),T(e)||(e=t.height);let n=qv[i];T(n)||(n={},qv[i]=n);let o=n[e];if(!T(o)){const s=document.createElement("canvas");s.width=i,s.height=e,o=s.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",n[e]=o}return o.drawImage(t,0,0,i,e),o.getImageData(0,0,i,e).data}const KS=/^blob:/i;function Xv(t){return S.typeOf.string("uri",t),KS.test(t)}let _i;function $u(t){T(_i)||(_i=document.createElement("a")),_i.href=window.location.href;const i=_i.host,e=_i.protocol;return _i.href=t,_i.href=_i.href,e!==_i.protocol||i!==_i.host}const JS=/^data:/i;function Yv(t){return S.typeOf.string("uri",t),JS.test(t)}function jS(t){const i=document.createElement("script");return i.async=!0,i.src=t,new Promise((e,n)=>{window.crossOriginIsolated&&i.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,o.removeChild(i),e()},i.onerror=function(s){n(s)},o.appendChild(i)})}function ex(t){if(!T(t))throw new G("obj is required.");let i="";for(const e in t)if(t.hasOwnProperty(e)){const n=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(n))for(let s=0,r=n.length;s<r;++s)i+=`${o+encodeURIComponent(n[s])}&`;else i+=`${o+encodeURIComponent(n)}&`}return i=i.slice(0,-1),i}function tx(t){if(!T(t))throw new G("queryString is required.");const i={};if(t==="")return i;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let n=0,o=e.length;n<o;++n){const s=e[n].split("="),r=decodeURIComponent(s[0]);let l=s[1];T(l)?l=decodeURIComponent(l):l="";const c=i[r];typeof c=="string"?i[r]=[c,l]:Array.isArray(c)?c.push(l):i[r]=l}return i}const $e=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),ix=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function zc(t){t=t??Ci.EMPTY_OBJECT;const i=t.throttleByServer??!1,e=t.throttle??!1;this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=t.priority??0,this.throttle=e,this.throttleByServer=i,this.type=t.type??ix.OTHER,this.serverKey=t.serverKey,this.state=$e.UNISSUED,this.deferred=void 0,this.cancelled=!1}zc.prototype.cancel=function(){this.cancelled=!0},zc.prototype.clone=function(t){return T(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=$e.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new zc(this)};function nx(t){const i={};if(!t)return i;const e=t.split(`\r
|
|
362
|
-
`);for(let n=0;n<e.length;++n){const o=e[n],s=o.indexOf(": ");if(s>0){const r=o.substring(0,s),l=o.substring(s+2);i[r]=l}}return i}function br(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=nx(this.responseHeaders))}br.prototype.toString=function(){let t="Request has failed.";return T(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function us(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(us.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),us.prototype.addEventListener=function(t,i){S.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(i);const e=this;return function(){e.removeEventListener(t,i)}},us.prototype.removeEventListener=function(t,i){S.typeOf.func("listener",t);const e=this._listeners,n=this._scopes;let o=-1;for(let s=0;s<e.length;s++)if(e[s]===t&&n[s]===i){o=s;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,n[o]=void 0):(e.splice(o,1),n.splice(o,1)),!0):!1};function ox(t,i){return i-t}us.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const i=this._listeners,e=this._scopes;let n=i.length;for(t=0;t<n;t++){const s=i[t];T(s)&&i[t].apply(e[t],arguments)}const o=this._toRemove;if(n=o.length,n>0){for(o.sort(ox),t=0;t<n;t++){const s=o[t];i.splice(s,1),e.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function po(t){S.typeOf.object("options",t),S.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(po.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){S.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Xu(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}po.prototype.reserve=function(t){t=t??this._length,this._array.length=t},po.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,s=!0;for(;s;){const r=2*(t+1),l=r-1;l<i&&e(n[l],n[t])<0?o=l:o=t,r<i&&e(n[r],n[o])<0&&(o=r),o!==t?(Xu(n,o,t),t=o):s=!1}},po.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},po.prototype.insert=function(t){S.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const r=Math.floor((o-1)/2);if(e(i[o],i[r])<0)Xu(i,o,r),o=r;else break}let s;return T(n)&&this._length>n&&(s=i[n],this._length=n),s},po.prototype.pop=function(t){if(t=t??0,this._length===0)return;S.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return Xu(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function sx(t,i){return t.priority-i.priority}const Pe={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ds=20;const gt=new po({comparator:sx});gt.maximumLength=ds,gt.reserve(ds);const Pi=[];let qi={};const rx=typeof document<"u"?new Hi(document.location.href):new Hi,Lc=new us;function Ie(){}Ie.maximumRequests=50,Ie.maximumRequestsPerServer=18,Ie.requestsByServer={},Ie.throttleRequests=!0,Ie.debugShowStatistics=!1,Ie.requestCompletedEvent=Lc,Object.defineProperties(Ie,{statistics:{get:function(){return Pe}},priorityHeapLength:{get:function(){return ds},set:function(t){if(t<ds)for(;gt.length>t;){const i=gt.pop();fo(i)}ds=t,gt.maximumLength=t,gt.reserve(t)}}});function Zv(t){T(t.priorityFunction)&&(t.priority=t.priorityFunction())}Ie.serverHasOpenSlots=function(t,i){i=i??1;const e=Ie.requestsByServer[t]??Ie.maximumRequestsPerServer;return qi[t]+i<=e},Ie.heapHasOpenSlots=function(t){return gt.length+t<=ds};function Qv(t){return t.state===$e.UNISSUED&&(t.state=$e.ISSUED,t.deferred=_r()),t.deferred.promise}function ax(t){return function(i){if(t.state===$e.CANCELLED)return;const e=t.deferred;--Pe.numberOfActiveRequests,--qi[t.serverKey],Lc.raiseEvent(),t.state=$e.RECEIVED,t.deferred=void 0,e.resolve(i)}}function lx(t){return function(i){t.state!==$e.CANCELLED&&(++Pe.numberOfFailedRequests,--Pe.numberOfActiveRequests,--qi[t.serverKey],Lc.raiseEvent(i),t.state=$e.FAILED,t.deferred.reject(i))}}function kv(t){const i=Qv(t);return t.state=$e.ACTIVE,Pi.push(t),++Pe.numberOfActiveRequests,++Pe.numberOfActiveRequestsEver,++qi[t.serverKey],t.requestFunction().then(ax(t)).catch(lx(t)),i}function fo(t){const i=t.state===$e.ACTIVE;if(t.state=$e.CANCELLED,++Pe.numberOfCancelledRequests,T(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--Pe.numberOfActiveRequests,--qi[t.serverKey],++Pe.numberOfCancelledActiveRequests),T(t.cancelFunction)&&t.cancelFunction()}Ie.update=function(){let t,i,e=0;const n=Pi.length;for(t=0;t<n;++t){if(i=Pi[t],i.cancelled&&fo(i),i.state!==$e.ACTIVE){++e;continue}e>0&&(Pi[t-e]=i)}Pi.length-=e;const o=gt.internalArray,s=gt.length;for(t=0;t<s;++t)Zv(o[t]);gt.resort();const r=Math.max(Ie.maximumRequests-Pi.length,0);let l=0;for(;l<r&>.length>0;){if(i=gt.pop(),i.cancelled){fo(i);continue}if(i.throttleByServer&&!Ie.serverHasOpenSlots(i.serverKey)){fo(i);continue}kv(i),++l}cx()},Ie.getServerKey=function(t){S.typeOf.string("url",t);let i=new Hi(t);i.scheme()===""&&(i=i.absoluteTo(rx),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=qi[e];return T(n)||(qi[e]=0),e},Ie.request=function(t){if(S.typeOf.object("request",t),S.typeOf.string("request.url",t.url),S.typeOf.func("request.requestFunction",t.requestFunction),Yv(t.url)||Xv(t.url))return Lc.raiseEvent(),t.state=$e.RECEIVED,t.requestFunction();if(++Pe.numberOfAttemptedRequests,T(t.serverKey)||(t.serverKey=Ie.getServerKey(t.url)),Ie.throttleRequests&&t.throttleByServer&&!Ie.serverHasOpenSlots(t.serverKey))return;if(!Ie.throttleRequests||!t.throttle)return kv(t);if(Pi.length>=Ie.maximumRequests)return;Zv(t);const i=gt.insert(t);if(T(i)){if(i===t)return;fo(i)}return Qv(t)};function cx(){Ie.debugShowStatistics&&(Pe.numberOfActiveRequests===0&&Pe.lastNumberOfActiveRequests>0&&(Pe.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Pe.numberOfAttemptedRequests}`),Pe.numberOfAttemptedRequests=0),Pe.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Pe.numberOfCancelledRequests}`),Pe.numberOfCancelledRequests=0),Pe.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Pe.numberOfCancelledActiveRequests}`),Pe.numberOfCancelledActiveRequests=0),Pe.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Pe.numberOfFailedRequests}`),Pe.numberOfFailedRequests=0)),Pe.lastNumberOfActiveRequests=Pe.numberOfActiveRequests)}Ie.clearForSpecs=function(){for(;gt.length>0;){const i=gt.pop();fo(i)}const t=Pi.length;for(let i=0;i<t;++i)fo(Pi[i]);Pi.length=0,qi={},Pe.numberOfAttemptedRequests=0,Pe.numberOfActiveRequests=0,Pe.numberOfCancelledRequests=0,Pe.numberOfCancelledActiveRequests=0,Pe.numberOfFailedRequests=0,Pe.numberOfActiveRequestsEver=0,Pe.lastNumberOfActiveRequests=0},Ie.numberOfActiveRequestsByServer=function(t){return qi[t]},Ie.requestHeap=gt;const ps={};let fs={};ps.add=function(t,i){if(!T(t))throw new G("host is required.");if(!T(i)||i<=0)throw new G("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(fs[e])||(fs[e]=!0)},ps.remove=function(t,i){if(!T(t))throw new G("host is required.");if(!T(i)||i<=0)throw new G("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(fs[e])&&delete fs[e]};function hx(t){const i=new Hi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=window.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}ps.contains=function(t){if(!T(t))throw new G("url is required.");const i=hx(t);return!!(T(i)&&T(fs[i]))},ps.clear=function(){fs={}};const Kv=function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}}();function J(t){t=t??Ci.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),S.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=bi(t.templateValues,{}),this._queryParameters=bi(t.queryParameters,{}),this.headers=bi(t.headers,{}),this.request=t.request??new zc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function bi(t,i){return T(t)?hs(t):i}J.createIfNeeded=function(t){return t instanceof J?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new J({url:t})};let gs;J.supportsImageBitmapOptions=function(){return T(gs)?gs:typeof createImageBitmap!="function"?(gs=Promise.resolve(!1),gs):(gs=J.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=$v(i[0]),n=$v(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),gs)},Object.defineProperties(J,{isBlobSupported:{get:function(){return Kv}}}),Object.defineProperties(J.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return kS(this._url)}},isDataUri:{get:function(){return Yv(this._url)}},isBlobUri:{get:function(){return Xv(this._url)}},isCrossOriginUrl:{get:function(){return $u(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),J.prototype.toString=function(){return this.getUrlComponent(!0,!0)},J.prototype.parseUrl=function(t,i,e,n){let o=new Hi(t);const s=ux(o.query());this._queryParameters=i?Oc(s,this.queryParameters,e):s,o.search(""),o.fragment(""),T(n)&&o.scheme()===""&&(o=o.absoluteTo(Pr(n))),this._url=o.toString()};function ux(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:tx(t)}function Oc(t,i,e){if(!e)return En(t,i);const n=hs(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let s=n[o];const r=i[o];T(s)?(Array.isArray(s)||(s=n[o]=[s]),n[o]=s.concat(r)):n[o]=Array.isArray(r)?r.slice():r}return n}J.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${dx(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,s){const r=n[s];return T(r)?encodeURIComponent(r):o})),i&&T(this.proxy)&&(e=this.proxy.getURL(e)),e};function dx(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!T(t[i[0]])?`?${i[0]}`:`?${ex(t)}`}J.prototype.setQueryParameters=function(t,i){i?this._queryParameters=Oc(this._queryParameters,t,!1):this._queryParameters=Oc(t,this._queryParameters,!1)},J.prototype.appendQueryParameters=function(t){this._queryParameters=Oc(t,this._queryParameters,!0)},J.prototype.setTemplateValues=function(t,i){i?this._templateValues=En(this._templateValues,t):this._templateValues=En(t,this._templateValues)},J.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,T(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return T(t.queryParameters)&&(i._queryParameters=En(t.queryParameters,i.queryParameters)),T(t.templateValues)&&(i._templateValues=En(t.templateValues,i.templateValues)),T(t.headers)&&(i.headers=En(t.headers,i.headers)),T(t.proxy)&&(i.proxy=t.proxy),T(t.request)&&(i.request=t.request),T(t.retryCallback)&&(i.retryCallback=t.retryCallback),T(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},J.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},J.prototype.clone=function(t){return T(t)?(t._url=this._url,t._queryParameters=hs(this._queryParameters),t._templateValues=hs(this._templateValues),t.headers=hs(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new J({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:T(this.credits)?this.credits.slice():void 0})},J.prototype.getBaseUri=function(t){return QS(this.getUrlComponent(t),t)},J.prototype.appendForwardSlash=function(){this._url=ZS(this._url)},J.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},J.fetchArrayBuffer=function(t){return new J(t).fetchArrayBuffer()},J.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},J.fetchBlob=function(t){return new J(t).fetchBlob()},J.prototype.fetchImage=function(t){t=t??Ci.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(Zu(this.request),!Kv||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return Yu({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const s=this.fetchBlob();if(!T(s))return;let r,l,c,u;return J.supportsImageBitmapOptions().then(function(d){return r=d,l=r&&i,s}).then(function(d){if(!T(d))return;if(u=d,l)return J.createImageBitmapFromBlob(d,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return c=new J({url:p}),Yu({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(T(d))return d.blob=u,l||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return T(c)&&window.URL.revokeObjectURL(c.url),d.blob=u,Promise.reject(d)})};function Yu(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,s=i.request;s.url=i.url,s.requestFunction=function(){let l=!1;!i.isDataUri&&!i.isBlobUri&&(l=i.isCrossOriginUrl);const c=_r();return J._Implementations.createImage(s,l,c,e,n,o),c.promise};const r=Ie.request(s);if(T(r))return r.catch(function(l){return s.state!==$e.FAILED?Promise.reject(l):i.retryOnError(l).then(function(c){return c?(s.state=$e.UNISSUED,s.deferred=void 0,Yu({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(l)})})}J.fetchImage=function(t){return new J(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},J.prototype.fetchText=function(){return this.fetch({responseType:"text"})},J.fetchText=function(t){return new J(t).fetchText()},J.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(T(t))return t.then(function(i){if(T(i))return JSON.parse(i)})},J.fetchJson=function(t){return new J(t).fetchJson()},J.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},J.fetchXML=function(t){return new J(t).fetchXML()},J.prototype.fetchJsonp=function(t){t=t??"callback",Zu(this.request);let i;do i=`loadJsonp${N.nextRandomNumber().toString().substring(2,8)}`;while(T(window[i]));return Jv(this,t,i)};function Jv(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,s=t.url;o.url=s,o.requestFunction=function(){const l=_r();return window[e]=function(c){l.resolve(c);try{delete window[e]}catch{window[e]=void 0}},J._Implementations.loadAndExecuteScript(s,e,l),l.promise};const r=Ie.request(o);if(T(r))return r.catch(function(l){return o.state!==$e.FAILED?Promise.reject(l):t.retryOnError(l).then(function(c){return c?(o.state=$e.UNISSUED,o.deferred=void 0,Jv(t,i,e)):Promise.reject(l)})})}J.fetchJsonp=function(t){return new J(t).fetchJsonp(t.callbackParameterName)},J.prototype._makeRequest=function(t){const i=this;Zu(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const s=t.responseType,r=En(t.headers,i.headers),l=t.overrideMimeType,c=t.method,u=t.data,d=_r(),p=J._Implementations.loadWithXhr(n,s,c,u,r,d,l);return T(p)&&T(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise};const o=Ie.request(e);if(T(o))return o.then(function(s){return e.cancelFunction=void 0,s}).catch(function(s){return e.cancelFunction=void 0,e.state!==$e.FAILED?Promise.reject(s):i.retryOnError(s).then(function(r){return r?(e.state=$e.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(s)})})};function Zu(t){if(t.state===$e.ISSUED||t.state===$e.ACTIVE)throw new at("The Resource is already being fetched.");t.state=$e.UNISSUED,t.deferred=void 0}const px=/^data:(.*?)(;base64)?,(.*)$/;function Nc(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function jv(t,i){const e=Nc(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return n}function fx(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let s,r;switch(i){case"":case"text":return Nc(n,o);case"arraybuffer":return jv(n,o);case"blob":return s=jv(n,o),new Blob([s],{type:e});case"document":return r=new DOMParser,r.parseFromString(Nc(n,o),e);case"json":return JSON.parse(Nc(n,o));default:throw new G(`Unhandled responseType: ${i}`)}}J.prototype.fetch=function(t){return t=bi(t,{}),t.method="GET",this._makeRequest(t)},J.fetch=function(t){return new J(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.delete=function(t){return t=bi(t,{}),t.method="DELETE",this._makeRequest(t)},J.delete=function(t){return new J(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},J.prototype.head=function(t){return t=bi(t,{}),t.method="HEAD",this._makeRequest(t)},J.head=function(t){return new J(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.options=function(t){return t=bi(t,{}),t.method="OPTIONS",this._makeRequest(t)},J.options=function(t){return new J(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.post=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},J.post=function(t){return new J(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.put=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},J.put=function(t){return new J(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.patch=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},J.patch=function(t){return new J(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J._Implementations={},J._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(ps.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},J._Implementations.createImage=function(t,i,e,n,o,s){const r=t.url;J.supportsImageBitmapOptions().then(function(l){if(!(l&&s)){J._Implementations.loadImageElement(r,i,e);return}const c="blob",u="GET",d=_r(),p=J._Implementations.loadWithXhr(r,c,u,void 0,void 0,d,void 0,void 0,void 0);return T(p)&&T(p.abort)&&(t.cancelFunction=function(){p.abort()}),d.promise.then(function(f){if(!T(f)){e.reject(new at(`Successfully retrieved ${r} but it contained no content.`));return}return J.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(l){e.reject(l)})},J.createImageBitmapFromBlob=function(t,i){return S.defined("options",i),S.typeOf.bool("options.flipY",i.flipY),S.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),S.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"from-image",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function gx(t,i,e,n,o,s,r){fetch(t,{method:e,headers:o}).then(async l=>{if(!l.ok){const c={};l.headers.forEach((u,d)=>{c[d]=u}),s.reject(new br(l.status,l,c));return}switch(i){case"text":s.resolve(l.text());break;case"json":s.resolve(l.json());break;default:s.resolve(new Uint8Array(await l.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new br)})}const mx=typeof XMLHttpRequest>"u";J._Implementations.loadWithXhr=function(t,i,e,n,o,s,r){const l=px.exec(t);if(l!==null){s.resolve(fx(l,i));return}if(mx){gx(t,i,e,n,o,s);return}const c=new XMLHttpRequest;if(ps.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),T(r)&&T(c.overrideMimeType)&&c.overrideMimeType(r),T(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);T(i)&&(c.responseType=i);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){s.reject(new br(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const m=c.getAllResponseHeaders().trim().split(/[\r\n]+/),g={};m.forEach(function(y){const _=y.split(": "),P=_.shift();g[P]=_.join(": ")}),s.resolve(g);return}if(c.status===204)s.resolve(void 0);else if(T(d)&&(!T(i)||p===i))s.resolve(d);else if(i==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(f){s.reject(f)}else(p===""||p==="document")&&T(c.responseXML)&&c.responseXML.hasChildNodes()?s.resolve(c.responseXML):(p===""||p==="text")&&T(c.responseText)?s.resolve(c.responseText):s.reject(new at("Invalid XMLHttpRequest response type."))},c.onerror=function(d){s.reject(new br)},c.send(n),c},J._Implementations.loadAndExecuteScript=function(t,i,e){return jS(t).catch(function(n){e.reject(n)})},J._DefaultImplementations={},J._DefaultImplementations.createImage=J._Implementations.createImage,J._DefaultImplementations.loadWithXhr=J._Implementations.loadWithXhr,J._DefaultImplementations.loadAndExecuteScript=J._Implementations.loadAndExecuteScript,J.DEFAULT=Object.freeze(new J({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function Sr(t){t=t??Ci.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=t.addNewLeapSeconds??!0,T(t.data)?ey(this,t.data):ey(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Sr.fromUrl=async function(t,i){S.defined("url",t),i=i??Ci.EMPTY_OBJECT;const e=J.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new at(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new Sr({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},Sr.NONE=Object.freeze({compute:function(t,i){return T(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new Vu(0,0,0,0,0),i}}),Sr.prototype.compute=function(t,i){if(!T(this._samples))return;if(T(i)||(i=new Vu(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,s=0;if(T(n)){const l=e[n],c=e[n+1],u=k.lessThanOrEquals(l,t),d=!T(c),p=d||k.greaterThanOrEquals(c,t);if(u&&p)return o=n,!d&&c.equals(t)&&++o,s=o+1,iy(this,e,this._samples,t,o,s,i),i}let r=wr(e,t,k.compare,this._dateColumn);return r>=0?(r<e.length-1&&e[r+1].equals(t)&&++r,o=r,s=r):(s=~r,o=s-1,o<0&&(o=0)),this._lastIndex=o,iy(this,e,this._samples,t,o,s,i),i};function vx(t,i){return k.compare(t.julianDate,i)}function ey(t,i){if(!T(i.columnNames))throw new at("Error in loaded EOP data: The columnNames property is required.");if(!T(i.samples))throw new at("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),s=i.columnNames.indexOf("ut1MinusUtcSeconds"),r=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),l=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||s<0||r<0||l<0||c<0)throw new at("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=i.samples,d=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=s,t._xCelestialPoleOffsetRadiansColumn=r,t._yCelestialPoleOffsetRadiansColumn=l,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let m=0,g=u.length;m<g;m+=t._columnCount){const y=u[m+e],_=u[m+c],P=y+Ve.MODIFIED_JULIAN_DATE_DIFFERENCE,w=new k(P,_,me.TAI);if(d.push(w),f){if(_!==p&&T(p)){const b=k.leapSeconds,x=wr(b,w,vx);if(x<0){const A=new Te(w,_);b.splice(~x,0,A)}}p=_}}}function ty(t,i,e,n,o){const s=e*n;o.xPoleWander=i[s+t._xPoleWanderRadiansColumn],o.yPoleWander=i[s+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[s+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[s+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[s+t._ut1MinusUtcSecondsColumn]}function xr(t,i,e){return i+t*(e-i)}function iy(t,i,e,n,o,s,r){const l=t._columnCount;if(s>i.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=i[o],u=i[s];if(c.equals(u)||n.equals(c))return ty(t,e,o,l,r),r;if(n.equals(u))return ty(t,e,s,l,r),r;const d=k.secondsDifference(n,c)/k.secondsDifference(u,c),p=o*l,f=s*l;let m=e[p+t._ut1MinusUtcSecondsColumn],g=e[f+t._ut1MinusUtcSecondsColumn];const y=g-m;if(y>.5||y<-.5){const _=e[p+t._taiMinusUtcSecondsColumn],P=e[f+t._taiMinusUtcSecondsColumn];_!==P&&(u.equals(n)?m=g:g-=P-_)}return r.xPoleWander=xr(d,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),r.yPoleWander=xr(d,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),r.xPoleOffset=xr(d,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=xr(d,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=xr(d,m,g),r}function et(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}et.fromQuaternion=function(t,i){if(!T(t))throw new G("quaternion is required");T(i)||(i=new et);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),s=1-2*(t.y*t.y+t.z*t.z),r=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(r,s),i.roll=Math.atan2(o,n),i.pitch=-N.asinClamped(e),i},et.fromDegrees=function(t,i,e,n){if(!T(t))throw new G("heading is required");if(!T(i))throw new G("pitch is required");if(!T(e))throw new G("roll is required");return T(n)||(n=new et),n.heading=t*N.RADIANS_PER_DEGREE,n.pitch=i*N.RADIANS_PER_DEGREE,n.roll=e*N.RADIANS_PER_DEGREE,n},et.clone=function(t,i){if(T(t))return T(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new et(t.heading,t.pitch,t.roll)},et.equals=function(t,i){return t===i||T(t)&&T(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},et.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.heading,i.heading,e,n)&&N.equalsEpsilon(t.pitch,i.pitch,e,n)&&N.equalsEpsilon(t.roll,i.roll,e,n)},et.prototype.clone=function(t){return et.clone(this,t)},et.prototype.equals=function(t){return et.equals(this,t)},et.prototype.equalsEpsilon=function(t,i,e){return et.equalsEpsilon(this,t,i,e)},et.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const ny=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function yx(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=ny.exec(n);if(o!==null)return o[1]}}let Bc;function oy(t){return typeof document>"u"?t:(T(Bc)||(Bc=document.createElement("a")),Bc.href=t,Bc.href)}let go;function sy(){if(T(go))return go;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:T(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Go&&Go.tagName.toUpperCase()==="SCRIPT"&&Go.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Pr(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Go&&Go.tagName.toUpperCase()==="SCRIPT"&&Go.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?t=Pr("..",jt("Core/buildModuleUrl.js")):t=yx(),!T(t))throw new G("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return go=new J({url:oy(t)}),go.appendForwardSlash(),go}function wx(t){return oy(require.toUrl(`../${t}`))}function ry(t){return sy().getDerivedResource({url:t}).url}let Vc;function jt(t){return T(Vc)||(typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?Vc=wx:Vc=ry),Vc(t)}jt._cesiumScriptRegex=ny,jt._buildModuleUrlFromBaseUrl=ry,jt._clearBaseResource=function(){go=void 0},jt.setBaseUrl=function(t){go=J.DEFAULT.getDerivedResource({url:t})},jt.getCesiumBaseUrl=sy;function ay(t,i,e){this.x=t,this.y=i,this.s=e}function Qu(t){t=t??Ci.EMPTY_OBJECT,this._xysFileUrlTemplate=J.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new k(this._sampleZeroJulianEphemerisDate,0,me.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let s=0;s<=i;++s){e[s]=o,n[s]=s*this._stepSizeDays;for(let r=0;r<=i;++r)r!==s&&(e[s]*=s-r);e[s]=1/e[s]}this._work=new Array(i+1),this._coef=new Array(i+1)}const Cx=new k(0,0,me.TAI);function ku(t,i,e){const n=Cx;return n.dayNumber=i,n.secondsOfDay=e,k.daysDifference(n,t._sampleZeroDateTT)}Qu.prototype.preload=function(t,i,e,n){const o=ku(this,t,i),s=ku(this,e,n);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let l=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,u=l/this._samplesPerXysFile|0,d=[];for(let p=c;p<=u;++p)d.push(Ku(this,p));return Promise.all(d)},Qu.prototype.computeXysRadians=function(t,i,e){const n=ku(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let r=o-(s/2|0);r<0&&(r=0);let l=r+s;l>=this._totalSamples&&(l=this._totalSamples-1,r=l-s,r<0&&(r=0));let c=!1;const u=this._samples;if(T(u[r*3])||(Ku(this,r/this._samplesPerXysFile|0),c=!0),T(u[l*3])||(Ku(this,l/this._samplesPerXysFile|0),c=!0),c)return;T(e)?(e.x=0,e.y=0,e.s=0):e=new ay(0,0,0);const d=n-r*this._stepSizeDays,p=this._work,f=this._denominators,m=this._coef,g=this._xTable;let y,_;for(y=0;y<=s;++y)p[y]=d-g[y];for(y=0;y<=s;++y){for(m[y]=1,_=0;_<=s;++_)_!==y&&(m[y]*=p[_]);m[y]*=f[y];let P=(r+y)*3;e.x+=m[y]*u[P++],e.y+=m[y]*u[P++],e.s+=m[y]*u[P]}return e};function Ku(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;T(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new J({url:jt(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(s){t._chunkDownloadsInProgress[i]=!1;const r=t._samples,l=s.samples,c=i*t._samplesPerXysFile*3;for(let u=0,d=l.length;u<d;++u)r[c+u]=l[u]});return t._chunkDownloadsInProgress[i]=o,o}function Z(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Er=new F;Z.fromAxisAngle=function(t,i,e){S.typeOf.object("axis",t),S.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Er=F.normalize(t,Er);const s=Er.x*o,r=Er.y*o,l=Er.z*o,c=Math.cos(n);return T(e)?(e.x=s,e.y=r,e.z=l,e.w=c,e):new Z(s,r,l,c)};const _x=[1,2,0],Px=new Array(3);Z.fromRotationMatrix=function(t,i){S.typeOf.object("matrix",t);let e,n,o,s,r;const l=t[H.COLUMN0ROW0],c=t[H.COLUMN1ROW1],u=t[H.COLUMN2ROW2],d=l+c+u;if(d>0)e=Math.sqrt(d+1),r=.5*e,e=.5/e,n=(t[H.COLUMN1ROW2]-t[H.COLUMN2ROW1])*e,o=(t[H.COLUMN2ROW0]-t[H.COLUMN0ROW2])*e,s=(t[H.COLUMN0ROW1]-t[H.COLUMN1ROW0])*e;else{const p=_x;let f=0;c>l&&(f=1),u>l&&u>c&&(f=2);const m=p[f],g=p[m];e=Math.sqrt(t[H.getElementIndex(f,f)]-t[H.getElementIndex(m,m)]-t[H.getElementIndex(g,g)]+1);const y=Px;y[f]=.5*e,e=.5/e,r=(t[H.getElementIndex(g,m)]-t[H.getElementIndex(m,g)])*e,y[m]=(t[H.getElementIndex(m,f)]+t[H.getElementIndex(f,m)])*e,y[g]=(t[H.getElementIndex(g,f)]+t[H.getElementIndex(f,g)])*e,n=-y[0],o=-y[1],s=-y[2]}return T(i)?(i.x=n,i.y=o,i.z=s,i.w=r,i):new Z(n,o,s,r)};const ly=new Z;let cy=new Z,Ju=new Z,hy=new Z;Z.fromHeadingPitchRoll=function(t,i){return S.typeOf.object("headingPitchRoll",t),hy=Z.fromAxisAngle(F.UNIT_X,t.roll,ly),Ju=Z.fromAxisAngle(F.UNIT_Y,-t.pitch,i),i=Z.multiply(Ju,hy,Ju),cy=Z.fromAxisAngle(F.UNIT_Z,-t.heading,ly),Z.multiply(cy,i,i)};const Uc=new F,ju=new F,hi=new Z,uy=new Z,Wc=new Z;Z.packedLength=4,Z.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Z.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new Z),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Z.packedInterpolationLength=3,Z.convertPackedArrayForInterpolation=function(t,i,e,n){Z.unpack(t,e*4,Wc),Z.conjugate(Wc,Wc);for(let o=0,s=e-i+1;o<s;o++){const r=o*3;Z.unpack(t,(i+o)*4,hi),Z.multiply(hi,Wc,hi),hi.w<0&&Z.negate(hi,hi),Z.computeAxis(hi,Uc);const l=Z.computeAngle(hi);T(n)||(n=[]),n[r]=Uc.x*l,n[r+1]=Uc.y*l,n[r+2]=Uc.z*l}},Z.unpackInterpolationResult=function(t,i,e,n,o){T(o)||(o=new Z),F.fromArray(t,0,ju);const s=F.magnitude(ju);return Z.unpack(i,n*4,uy),s===0?Z.clone(Z.IDENTITY,hi):Z.fromAxisAngle(ju,s,hi),Z.multiply(hi,uy,o)},Z.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Z(t.x,t.y,t.z,t.w)},Z.conjugate=function(t,i){return S.typeOf.object("quaternion",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Z.magnitudeSquared=function(t){return S.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Z.magnitude=function(t){return Math.sqrt(Z.magnitudeSquared(t))},Z.normalize=function(t,i){S.typeOf.object("result",i);const e=1/Z.magnitude(t),n=t.x*e,o=t.y*e,s=t.z*e,r=t.w*e;return i.x=n,i.y=o,i.z=s,i.w=r,i},Z.inverse=function(t,i){S.typeOf.object("result",i);const e=Z.magnitudeSquared(t);return i=Z.conjugate(t,i),Z.multiplyByScalar(i,1/e,i)},Z.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Z.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Z.negate=function(t,i){return S.typeOf.object("quaternion",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Z.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Z.multiply=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t.x,o=t.y,s=t.z,r=t.w,l=i.x,c=i.y,u=i.z,d=i.w,p=r*l+n*d+o*u-s*c,f=r*c-n*u+o*d+s*l,m=r*u+n*c-o*l+s*d,g=r*d-n*l-o*c-s*u;return e.x=p,e.y=f,e.z=m,e.w=g,e},Z.multiplyByScalar=function(t,i,e){return S.typeOf.object("quaternion",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Z.divideByScalar=function(t,i,e){return S.typeOf.object("quaternion",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Z.computeAxis=function(t,i){S.typeOf.object("quaternion",t),S.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<N.EPSILON6||Math.abs(e+1)<N.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Z.computeAngle=function(t){return S.typeOf.object("quaternion",t),Math.abs(t.w-1)<N.EPSILON6?0:2*Math.acos(t.w)};let ed=new Z;Z.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),ed=Z.multiplyByScalar(i,e,ed),n=Z.multiplyByScalar(t,1-e,n),Z.add(ed,n,n)};let dy=new Z,td=new Z,id=new Z;Z.slerp=function(t,i,e,n){S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n);let o=Z.dot(t,i),s=i;if(o<0&&(o=-o,s=dy=Z.negate(i,dy)),1-o<N.EPSILON6)return Z.lerp(t,s,e,n);const r=Math.acos(o);return td=Z.multiplyByScalar(t,Math.sin((1-e)*r),td),id=Z.multiplyByScalar(s,Math.sin(e*r),id),n=Z.add(td,id,n),Z.multiplyByScalar(n,1/Math.sin(r),n)},Z.log=function(t,i){S.typeOf.object("quaternion",t),S.typeOf.object("result",i);const e=N.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),F.multiplyByScalar(t,n,i)},Z.exp=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=F.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const bx=new F,Sx=new F,Ar=new Z,ms=new Z;Z.computeInnerQuadrangle=function(t,i,e,n){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("q2",e),S.typeOf.object("result",n);const o=Z.conjugate(i,Ar);Z.multiply(o,e,ms);const s=Z.log(ms,bx);Z.multiply(o,t,ms);const r=Z.log(ms,Sx);return F.add(s,r,s),F.multiplyByScalar(s,.25,s),F.negate(s,s),Z.exp(s,Ar),Z.multiply(i,Ar,n)},Z.squad=function(t,i,e,n,o,s){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("s0",e),S.typeOf.object("s1",n),S.typeOf.number("t",o),S.typeOf.object("result",s);const r=Z.slerp(t,i,o,Ar),l=Z.slerp(e,n,o,ms);return Z.slerp(r,l,2*o*(1-o),s)};const xx=new Z,py=1.9011074535173003,Gc=lt.supportsTypedArrays()?new Float32Array(8):[],Hc=lt.supportsTypedArrays()?new Float32Array(8):[],$i=lt.supportsTypedArrays()?new Float32Array(8):[],Xi=lt.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;Gc[t]=1/(i*e),Hc[t]=i/e}Gc[7]=py/(8*17),Hc[7]=py*8/17,Z.fastSlerp=function(t,i,e,n){S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n);let o=Z.dot(t,i),s;o>=0?s=1:(s=-1,o=-o);const r=o-1,l=1-e,c=e*e,u=l*l;for(let m=7;m>=0;--m)$i[m]=(Gc[m]*c-Hc[m])*r,Xi[m]=(Gc[m]*u-Hc[m])*r;const d=s*e*(1+$i[0]*(1+$i[1]*(1+$i[2]*(1+$i[3]*(1+$i[4]*(1+$i[5]*(1+$i[6]*(1+$i[7])))))))),p=l*(1+Xi[0]*(1+Xi[1]*(1+Xi[2]*(1+Xi[3]*(1+Xi[4]*(1+Xi[5]*(1+Xi[6]*(1+Xi[7])))))))),f=Z.multiplyByScalar(t,p,xx);return Z.multiplyByScalar(i,d,n),Z.add(f,n,n)},Z.fastSquad=function(t,i,e,n,o,s){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("s0",e),S.typeOf.object("s1",n),S.typeOf.number("t",o),S.typeOf.object("result",s);const r=Z.fastSlerp(t,i,o,Ar),l=Z.fastSlerp(e,n,o,ms);return Z.fastSlerp(r,l,2*o*(1-o),s)},Z.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Z.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.IDENTITY=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(t){return Z.clone(this,t)},Z.prototype.equals=function(t){return Z.equals(this,t)},Z.prototype.equalsEpsilon=function(t,i){return Z.equalsEpsilon(this,t,i)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const de={},nd={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},vs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},od={},It={east:new F,north:new F,up:new F,west:new F,south:new F,down:new F};let An=new F,Tn=new F,Mn=new F;de.localFrameToFixedFrameGenerator=function(t,i){if(!nd.hasOwnProperty(t)||!nd[t].hasOwnProperty(i))throw new G("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=nd[t][i];let n;const o=t+i;return T(od[o])?n=od[o]:(n=function(s,r,l){if(!T(s))throw new G("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new G("origin has a NaN component");if(T(l)||(l=new $),F.equalsEpsilon(s,F.ZERO,N.EPSILON14))F.unpack(vs[t],0,An),F.unpack(vs[i],0,Tn),F.unpack(vs[e],0,Mn);else if(N.equalsEpsilon(s.x,0,N.EPSILON14)&&N.equalsEpsilon(s.y,0,N.EPSILON14)){const c=N.sign(s.z);F.unpack(vs[t],0,An),t!=="east"&&t!=="west"&&F.multiplyByScalar(An,c,An),F.unpack(vs[i],0,Tn),i!=="east"&&i!=="west"&&F.multiplyByScalar(Tn,c,Tn),F.unpack(vs[e],0,Mn),e!=="east"&&e!=="west"&&F.multiplyByScalar(Mn,c,Mn)}else{r=r??ae.default,r.geodeticSurfaceNormal(s,It.up);const c=It.up,u=It.east;u.x=-s.y,u.y=s.x,u.z=0,F.normalize(u,It.east),F.cross(c,u,It.north),F.multiplyByScalar(It.up,-1,It.down),F.multiplyByScalar(It.east,-1,It.west),F.multiplyByScalar(It.north,-1,It.south),An=It[t],Tn=It[i],Mn=It[e]}return l[0]=An.x,l[1]=An.y,l[2]=An.z,l[3]=0,l[4]=Tn.x,l[5]=Tn.y,l[6]=Tn.z,l[7]=0,l[8]=Mn.x,l[9]=Mn.y,l[10]=Mn.z,l[11]=0,l[12]=s.x,l[13]=s.y,l[14]=s.z,l[15]=1,l},od[o]=n),n},de.eastNorthUpToFixedFrame=de.localFrameToFixedFrameGenerator("east","north"),de.northEastDownToFixedFrame=de.localFrameToFixedFrameGenerator("north","east"),de.northUpEastToFixedFrame=de.localFrameToFixedFrameGenerator("north","up"),de.northWestUpToFixedFrame=de.localFrameToFixedFrameGenerator("north","west");const Ex=new Z,Ax=new F(1,1,1),Tx=new $;de.headingPitchRollToFixedFrame=function(t,i,e,n,o){S.typeOf.object("HeadingPitchRoll",i),n=n??de.eastNorthUpToFixedFrame;const s=Z.fromHeadingPitchRoll(i,Ex),r=$.fromTranslationQuaternionRotationScale(F.ZERO,s,Ax,Tx);return o=n(t,e,o),$.multiply(o,r,o)};const Mx=new $,Ix=new H;de.headingPitchRollQuaternion=function(t,i,e,n,o){S.typeOf.object("HeadingPitchRoll",i);const s=de.headingPitchRollToFixedFrame(t,i,e,n,Mx),r=$.getMatrix3(s,Ix);return Z.fromRotationMatrix(r,o)};const Dx=new F(1,1,1),Rx=new F,fy=new $,Fx=new $,zx=new H,Lx=new Z;de.fixedFrameToHeadingPitchRoll=function(t,i,e,n){S.defined("transform",t),i=i??ae.default,e=e??de.eastNorthUpToFixedFrame,T(n)||(n=new et);const o=$.getTranslation(t,Rx);if(F.equals(o,F.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let s=$.inverseTransformation(e(o,i,fy),fy),r=$.setScale(t,Dx,Fx);r=$.setTranslation(r,F.ZERO,r),s=$.multiply(s,r,s);let l=Z.fromRotationMatrix($.getMatrix3(s,zx),Lx);return l=Z.normalize(l,l),et.fromQuaternion(l,n)};const Ox=6*3600+41*60+50.54841,Nx=8640184812866e-6,Bx=.093104,Vx=-62e-7,Ux=11772758384668e-32,Wx=72921158553e-15,Gx=N.TWO_PI/86400;let qc=new k;de.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=de.computeIcrfToFixedMatrix(t,i);return T(e)||(e=de.computeTemeToPseudoFixedMatrix(t,i)),e},de.computeTemeToPseudoFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");qc=k.addSeconds(t,-k.computeTaiMinusUtc(t),qc);const e=qc.dayNumber,n=qc.secondsOfDay;let o;const s=e-2451545;n>=43200?o=(s+.5)/Ve.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/Ve.DAYS_PER_JULIAN_CENTURY;const l=(Ox+o*(Nx+o*(Bx+o*Vx)))*Gx%N.TWO_PI,c=Wx+Ux*(e-24515455e-1),u=(n+Ve.SECONDS_PER_DAY*.5)%Ve.SECONDS_PER_DAY,d=l+c*u,p=Math.cos(d),f=Math.sin(d);return T(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new H(p,f,0,-f,p,0,0,0,1)},de.iau2006XysData=new Qu,de.earthOrientationParameters=Sr.NONE;const sd=32.184,Hx=2451545;de.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+sd,n=t.stop.dayNumber,o=t.stop.secondsOfDay+sd;return de.iau2006XysData.preload(i,e,n,o)},de.computeIcrfToFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.computeFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const qx=32.184,$x=2451545,$c=new et,Xx=new H,Yx=new k;de.computeMoonFixedToIcrfMatrix=function(t,i){if(!T(t))throw new G("date is required.");const e=k.addSeconds(t,qx,Yx),n=k.totalDays(e)-$x,o=N.toRadians(12.112)-N.toRadians(.052992)*n,s=N.toRadians(24.224)-N.toRadians(.105984)*n,r=N.toRadians(227.645)+N.toRadians(13.012)*n,l=N.toRadians(261.105)+N.toRadians(13.340716)*n,c=N.toRadians(358)+N.toRadians(.9856)*n;return $c.pitch=N.toRadians(180)-N.toRadians(3.878)*Math.sin(o)-N.toRadians(.12)*Math.sin(s)+N.toRadians(.07)*Math.sin(r)-N.toRadians(.017)*Math.sin(l),$c.roll=N.toRadians(66.53-90)+N.toRadians(1.543)*Math.cos(o)+N.toRadians(.24)*Math.cos(s)-N.toRadians(.028)*Math.cos(r)+N.toRadians(.007)*Math.cos(l),$c.heading=N.toRadians(244.375-90)+N.toRadians(13.17635831)*n+N.toRadians(3.558)*Math.sin(o)+N.toRadians(.121)*Math.sin(s)-N.toRadians(.064)*Math.sin(r)+N.toRadians(.016)*Math.sin(l)+N.toRadians(.025)*Math.sin(c),H.fromHeadingPitchRoll($c,Xx)},de.computeIcrfToMoonFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.computeMoonFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const Zx=new ay(0,0,0),Qx=new Vu(0,0,0,0,0),rd=new H,ad=new H;de.computeFixedToIcrfMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.earthOrientationParameters.compute(t,Qx);if(!T(e))return;const n=t.dayNumber,o=t.secondsOfDay+sd,s=de.iau2006XysData.computeXysRadians(n,o,Zx);if(!T(s))return;const r=s.x+e.xPoleOffset,l=s.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-l*l)),u=rd;u[0]=1-c*r*r,u[3]=-c*r*l,u[6]=r,u[1]=-c*r*l,u[4]=1-c*l*l,u[7]=l,u[2]=-r,u[5]=-l,u[8]=1-c*(r*r+l*l);const d=H.fromRotationZ(-s.s,ad),p=H.multiply(u,d,rd),f=t.dayNumber,m=t.secondsOfDay-k.computeTaiMinusUtc(t)+e.ut1MinusUtc,g=f-2451545,y=m/Ve.SECONDS_PER_DAY;let _=.779057273264+y+.00273781191135448*(g+y);_=_%1*N.TWO_PI;const P=H.fromRotationZ(_,ad),w=H.multiply(p,P,rd),b=Math.cos(e.xPoleWander),x=Math.cos(e.yPoleWander),A=Math.sin(e.xPoleWander),M=Math.sin(e.yPoleWander);let D=n-Hx+o/Ve.SECONDS_PER_DAY;D/=36525;const L=-47e-6*D*N.RADIANS_PER_DEGREE/3600,V=Math.cos(L),O=Math.sin(L),z=ad;return z[0]=b*V,z[1]=b*O,z[2]=A,z[3]=-x*O+M*A*V,z[4]=x*V+M*A*O,z[5]=-M*b,z[6]=-M*O-x*A*V,z[7]=M*V-x*A*O,z[8]=x*b,H.multiply(w,z,i)};const kx=new K;de.pointToWindowCoordinates=function(t,i,e,n){return n=de.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},de.pointToGLWindowCoordinates=function(t,i,e,n){if(!T(t))throw new G("modelViewProjectionMatrix is required.");if(!T(i))throw new G("viewportTransformation is required.");if(!T(e))throw new G("point is required.");T(n)||(n=new j);const o=kx;return $.multiplyByVector(t,K.fromElements(e.x,e.y,e.z,1,o),o),K.multiplyByScalar(o,1/o.w,o),$.multiplyByVector(i,o,o),j.fromCartesian4(o,n)};const Kx=new F,Jx=new F,jx=new F;de.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!T(t))throw new G("position is required.");if(!T(i))throw new G("velocity is required.");const o=(e??ae.default).geodeticSurfaceNormal(t,Kx);let s=F.cross(i,o,Jx);F.equalsEpsilon(s,F.ZERO,N.EPSILON6)&&(s=F.clone(F.UNIT_X,s));const r=F.cross(s,i,jx);return F.normalize(r,r),F.cross(i,r,s),F.negate(s,s),F.normalize(s,s),T(n)||(n=new H),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=s.x,n[4]=s.y,n[5]=s.z,n[6]=r.x,n[7]=r.y,n[8]=r.z,n};const gy=new $(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),my=new pe,ld=new F,eE=new F,tE=new H,cd=new $,vy=new $;de.basisTo2D=function(t,i,e){if(!T(t))throw new G("projection is required.");if(!T(i))throw new G("matrix is required.");if(!T(e))throw new G("result is required.");const n=$.getTranslation(i,eE),o=t.ellipsoid;let s;if(F.equals(n,F.ZERO))s=F.clone(F.ZERO,ld);else{const d=o.cartesianToCartographic(n,my);s=t.project(d,ld),F.fromElements(s.z,s.x,s.y,s)}const r=de.eastNorthUpToFixedFrame(n,o,cd),l=$.inverseTransformation(r,vy),c=$.getMatrix3(i,tE),u=$.multiplyByMatrix3(l,c,e);return $.multiply(gy,u,e),$.setTranslation(e,s,e),e},de.ellipsoidTo2DModelMatrix=function(t,i,e){if(!T(t))throw new G("projection is required.");if(!T(i))throw new G("center is required.");if(!T(e))throw new G("result is required.");const n=t.ellipsoid,o=de.eastNorthUpToFixedFrame(i,n,cd),s=$.inverseTransformation(o,vy),r=n.cartesianToCartographic(i,my),l=t.project(r,ld);F.fromElements(l.z,l.x,l.y,l);const c=$.fromTranslation(l,cd);return $.multiply(gy,s,e),$.multiply(c,e,e),e};function ne(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(ne.prototype,{width:{get:function(){return ne.computeWidth(this)}},height:{get:function(){return ne.computeHeight(this)}}}),ne.packedLength=4,ne.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},ne.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new ne),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},ne.computeWidth=function(t){S.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=N.TWO_PI),i-e},ne.computeHeight=function(t){return S.typeOf.object("rectangle",t),t.north-t.south},ne.fromDegrees=function(t,i,e,n,o){return t=N.toRadians(t??0),i=N.toRadians(i??0),e=N.toRadians(e??0),n=N.toRadians(n??0),T(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new ne(t,i,e,n)},ne.fromRadians=function(t,i,e,n,o){return T(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new ne(t,i,e,n)},ne.fromCartographicArray=function(t,i){S.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let c=0,u=t.length;c<u;c++){const d=t[c];e=Math.min(e,d.longitude),n=Math.max(n,d.longitude),r=Math.min(r,d.latitude),l=Math.max(l,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+N.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return n-e>s-o&&(e=o,n=s,n>N.PI&&(n=n-N.TWO_PI),e>N.PI&&(e=e-N.TWO_PI)),T(i)?(i.west=e,i.south=r,i.east=n,i.north=l,i):new ne(e,r,n,l)},ne.fromCartesianArray=function(t,i,e){S.defined("cartesians",t),i=i??ae.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,d=t.length;u<d;u++){const p=i.cartesianToCartographic(t[u]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),l=Math.min(l,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+N.TWO_PI;s=Math.min(s,f),r=Math.max(r,f)}return o-n>r-s&&(n=s,o=r,o>N.PI&&(o=o-N.TWO_PI),n>N.PI&&(n=n-N.TWO_PI)),T(e)?(e.west=n,e.south=l,e.east=o,e.north=c,e):new ne(n,l,o,c)};const iE=new F,nE=new F,oE=new F,sE=new F,rE=new F,hd=new Array(5);for(let t=0;t<hd.length;++t)hd[t]=new F;ne.fromBoundingSphere=function(t,i,e){S.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(T(i)||(i=ae.default),T(e)||(e=new ne),F.equals(n,F.ZERO))return ne.clone(ne.MAX_VALUE,e),e;const s=de.eastNorthUpToFixedFrame(n,i,iE),r=$.multiplyByPointAsVector(s,F.UNIT_X,nE);F.normalize(r,r);const l=$.multiplyByPointAsVector(s,F.UNIT_Y,oE);F.normalize(l,l),F.multiplyByScalar(l,o,l),F.multiplyByScalar(r,o,r);const c=F.negate(l,rE),u=F.negate(r,sE),d=hd;let p=d[0];return F.add(n,l,p),p=d[1],F.add(n,u,p),p=d[2],F.add(n,c,p),p=d[3],F.add(n,r,p),d[4]=n,ne.fromCartesianArray(d,i,e)},ne.clone=function(t,i){if(T(t))return T(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new ne(t.west,t.south,t.east,t.north)},ne.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},ne.prototype.clone=function(t){return ne.clone(this,t)},ne.prototype.equals=function(t){return ne.equals(this,t)},ne.equals=function(t,i){return t===i||T(t)&&T(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},ne.prototype.equalsEpsilon=function(t,i){return ne.equalsEpsilon(this,t,i)},ne._validate=function(t){S.typeOf.object("rectangle",t);const i=t.north;S.typeOf.number.greaterThanOrEquals("north",i,-N.PI_OVER_TWO),S.typeOf.number.lessThanOrEquals("north",i,N.PI_OVER_TWO);const e=t.south;S.typeOf.number.greaterThanOrEquals("south",e,-N.PI_OVER_TWO),S.typeOf.number.lessThanOrEquals("south",e,N.PI_OVER_TWO);const n=t.west;S.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),S.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;S.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),S.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ne.southwest=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new pe(t.west,t.south)},ne.northwest=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new pe(t.west,t.north)},ne.northeast=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new pe(t.east,t.north)},ne.southeast=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new pe(t.east,t.south)},ne.center=function(t,i){S.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=N.TWO_PI);const o=N.negativePiToPi((n+e)*.5),s=(t.south+t.north)*.5;return T(i)?(i.longitude=o,i.latitude=s,i.height=0,i):new pe(o,s)},ne.intersection=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=N.TWO_PI:s<r&&n>0&&(s+=N.TWO_PI),n<o&&r<0?r+=N.TWO_PI:s<r&&o<0&&(o+=N.TWO_PI);const l=N.negativePiToPi(Math.max(o,r)),c=N.negativePiToPi(Math.min(n,s));if((t.west<t.east||i.west<i.east)&&c<=l)return;const u=Math.max(t.south,i.south),d=Math.min(t.north,i.north);if(!(u>=d))return T(e)?(e.west=l,e.south=u,e.east=c,e.north=d,e):new ne(l,u,c,d)},ne.simpleIntersection=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),s=Math.min(t.east,i.east),r=Math.min(t.north,i.north);if(!(o>=r||n>=s))return T(e)?(e.west=n,e.south=o,e.east=s,e.north=r,e):new ne(n,o,s,r)},ne.union=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i),T(e)||(e=new ne);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=N.TWO_PI:s<r&&n>0&&(s+=N.TWO_PI),n<o&&r<0?r+=N.TWO_PI:s<r&&o<0&&(o+=N.TWO_PI);const l=N.negativePiToPi(Math.min(o,r)),c=N.negativePiToPi(Math.max(n,s));return e.west=l,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},ne.expand=function(t,i,e){return S.typeOf.object("rectangle",t),S.typeOf.object("cartographic",i),T(e)||(e=new ne),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},ne.contains=function(t,i){S.typeOf.object("rectangle",t),S.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let s=t.east;return s<o&&(s+=N.TWO_PI,e<0&&(e+=N.TWO_PI)),(e>o||N.equalsEpsilon(e,o,N.EPSILON14))&&(e<s||N.equalsEpsilon(e,s,N.EPSILON14))&&n>=t.south&&n<=t.north};const aE=new pe;ne.subsample=function(t,i,e,n){S.typeOf.object("rectangle",t),i=i??ae.default,e=e??0,T(n)||(n=[]);let o=0;const s=t.north,r=t.south,l=t.east,c=t.west,u=aE;u.height=e,u.longitude=c,u.latitude=s,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.latitude=r,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,s<0?u.latitude=s:r>0?u.latitude=r:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*N.PI_OVER_TWO,ne.contains(t,u)&&(n[o]=i.cartographicToCartesian(u,n[o]),o++);return u.latitude===0&&(u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++),n.length=o,n},ne.subsection=function(t,i,e,n,o,s){if(S.typeOf.object("rectangle",t),S.typeOf.number.greaterThanOrEquals("westLerp",i,0),S.typeOf.number.lessThanOrEquals("westLerp",i,1),S.typeOf.number.greaterThanOrEquals("southLerp",e,0),S.typeOf.number.lessThanOrEquals("southLerp",e,1),S.typeOf.number.greaterThanOrEquals("eastLerp",n,0),S.typeOf.number.lessThanOrEquals("eastLerp",n,1),S.typeOf.number.greaterThanOrEquals("northLerp",o,0),S.typeOf.number.lessThanOrEquals("northLerp",o,1),S.typeOf.number.lessThanOrEquals("westLerp",i,n),S.typeOf.number.lessThanOrEquals("southLerp",e,o),T(s)||(s=new ne),t.west<=t.east){const l=t.east-t.west;s.west=t.west+i*l,s.east=t.west+n*l}else{const l=N.TWO_PI+t.east-t.west;s.west=N.negativePiToPi(t.west+i*l),s.east=N.negativePiToPi(t.west+n*l)}const r=t.north-t.south;return s.south=t.south+e*r,s.north=t.south+o*r,i===1&&(s.west=t.east),n===1&&(s.east=t.east),e===1&&(s.south=t.north),o===1&&(s.north=t.north),s},ne.MAX_VALUE=Object.freeze(new ne(-Math.PI,-N.PI_OVER_TWO,Math.PI,N.PI_OVER_TWO));function ys(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(ys.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),ys.clone=function(t){if(T(t))return new ys(t._format,t._datatype,t._width,t._height,t._buffer)},ys.prototype.clone=function(){return ys.clone(this)};function yy(){if(!T(tt._canTransferArrayBuffer)){const t=pd("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return tt._canTransferArrayBuffer=!1,tt._canTransferArrayBuffer}tt._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const s=o.data.array,r=T(s)&&s[0]===i;n(r),t.terminate(),tt._canTransferArrayBuffer=r}})}return tt._canTransferArrayBuffer}const ud=new us;function dd(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new o;s.append(t),i=s.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function pd(t){const i=new Hi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let s,r;if($u(t))r=t;else if(!e){const l=jt(`${tt._workerModulePrefix}/${n}.js`);$u(l)&&(r=l)}if(r){const l=`import "${r}";`;return s=dd(l),o.type="module",new Worker(s,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const l=`
|
|
361
|
+
*/var $S=Dc.exports,Hv;function XS(){return Hv||(Hv=1,(function(t){(function(i,e){t.exports?t.exports=e(US(),GS(),qS()):i.URI=e(i.punycode,i.IPv6,i.SecondLevelDomains,i)})($S,function(i,e,n,o){var s=o&&o.URI;function r(C,E){var R=arguments.length>=1,B=arguments.length>=2;if(!(this instanceof r))return R?B?new r(C,E):new r(C):new r;if(C===void 0){if(R)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&R)throw new TypeError("null is not a valid argument for URI");return this.href(C),E!==void 0?this.absoluteTo(E):this}function l(C){return/^[0-9]+$/.test(C)}r.version="1.19.11";var c=r.prototype,u=Object.prototype.hasOwnProperty;function d(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function f(C){return p(C)==="Array"}function m(C,E){var R={},B,W;if(p(E)==="RegExp")R=null;else if(f(E))for(B=0,W=E.length;B<W;B++)R[E[B]]=!0;else R[E]=!0;for(B=0,W=C.length;B<W;B++){var Y=R&&R[C[B]]!==void 0||!R&&E.test(C[B]);Y&&(C.splice(B,1),W--,B--)}return C}function g(C,E){var R,B;if(f(E)){for(R=0,B=E.length;R<B;R++)if(!g(C,E[R]))return!1;return!0}var W=p(E);for(R=0,B=C.length;R<B;R++)if(W==="RegExp"){if(typeof C[R]=="string"&&C[R].match(E))return!0}else if(C[R]===E)return!0;return!1}function y(C,E){if(!f(C)||!f(E)||C.length!==E.length)return!1;C.sort(),E.sort();for(var R=0,B=C.length;R<B;R++)if(C[R]!==E[R])return!1;return!0}function _(C){var E=/^\/+|\/+$/g;return C.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var E=C.nodeName.toLowerCase();if(!(E==="input"&&C.type!=="image"))return r.domAttributes[E]}};function P(C){return escape(C)}function w(C){return encodeURIComponent(C).replace(/[!'()*]/g,P).replace(/\*/g,"%2A")}r.encode=w,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=w,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(C,E){var R=r.encode(C+"");return E===void 0&&(E=r.escapeQuerySpace),E?R.replace(/%20/g,"+"):R},r.decodeQuery=function(C,E){C+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?C.replace(/\+/g,"%20"):C)}catch{return C}};var b={encode:"encode",decode:"decode"},x,A=function(C,E){return function(R){try{return r[E](R+"").replace(r.characters[C][E].expression,function(B){return r.characters[C][E].map[B]})}catch{return R}}};for(x in b)r[x+"PathSegment"]=A("pathname",b[x]),r[x+"UrnPathSegment"]=A("urnpath",b[x]);var M=function(C,E,R){return function(B){var W;R?W=function(Q){return r[E](r[R](Q))}:W=r[E];for(var Y=(B+"").split(C),q=0,X=Y.length;q<X;q++)Y[q]=W(Y[q]);return Y.join(C)}};r.decodePath=M("/","decodePathSegment"),r.decodeUrnPath=M(":","decodeUrnPathSegment"),r.recodePath=M("/","encodePathSegment","decode"),r.recodeUrnPath=M(":","encodeUrnPathSegment","decode"),r.encodeReserved=A("reserved","encode"),r.parse=function(C,E){var R;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),C=C.replace(r.leading_whitespace_expression,""),C=C.replace(r.ascii_tab_whitespace,""),R=C.indexOf("#"),R>-1&&(E.fragment=C.substring(R+1)||null,C=C.substring(0,R)),R=C.indexOf("?"),R>-1&&(E.query=C.substring(R+1)||null,C=C.substring(0,R)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(E.protocol=null,C=C.substring(2),C=r.parseAuthority(C,E)):(R=C.indexOf(":"),R>-1&&(E.protocol=C.substring(0,R)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:C.substring(R+1,R+3).replace(/\\/g,"/")==="//"?(C=C.substring(R+3),C=r.parseAuthority(C,E)):(C=C.substring(R+1),E.urn=!0))),E.path=C,E},r.parseHost=function(C,E){C||(C=""),C=C.replace(/\\/g,"/");var R=C.indexOf("/"),B,W;if(R===-1&&(R=C.length),C.charAt(0)==="[")B=C.indexOf("]"),E.hostname=C.substring(1,B)||null,E.port=C.substring(B+2,R)||null,E.port==="/"&&(E.port=null);else{var Y=C.indexOf(":"),q=C.indexOf("/"),X=C.indexOf(":",Y+1);X!==-1&&(q===-1||X<q)?(E.hostname=C.substring(0,R)||null,E.port=null):(W=C.substring(0,R).split(":"),E.hostname=W[0]||null,E.port=W[1]||null)}return E.hostname&&C.substring(R).charAt(0)!=="/"&&(R++,C="/"+C),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),C.substring(R)||"/"},r.parseAuthority=function(C,E){return C=r.parseUserinfo(C,E),r.parseHost(C,E)},r.parseUserinfo=function(C,E){var R=C,B=C.indexOf("\\");B!==-1&&(C=C.replace(/\\/g,"/"));var W=C.indexOf("/"),Y=C.lastIndexOf("@",W>-1?W:C.length-1),q;return Y>-1&&(W===-1||Y<W)?(q=C.substring(0,Y).split(":"),E.username=q[0]?r.decode(q[0]):null,q.shift(),E.password=q[0]?r.decode(q.join(":")):null,C=R.substring(Y+1)):(E.username=null,E.password=null),C},r.parseQuery=function(C,E){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var R={},B=C.split("&"),W=B.length,Y,q,X,Q=0;Q<W;Q++)Y=B[Q].split("="),q=r.decodeQuery(Y.shift(),E),X=Y.length?r.decodeQuery(Y.join("="),E):null,q!=="__proto__"&&(u.call(R,q)?((typeof R[q]=="string"||R[q]===null)&&(R[q]=[R[q]]),R[q].push(X)):R[q]=X);return R},r.build=function(C){var E="",R=!1;return C.protocol&&(E+=C.protocol+":"),!C.urn&&(E||C.hostname)&&(E+="//",R=!0),E+=r.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&R&&(E+="/"),E+=C.path),typeof C.query=="string"&&C.query&&(E+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(E+="#"+C.fragment),E},r.buildHost=function(C){var E="";if(C.hostname)r.ip6_expression.test(C.hostname)?E+="["+C.hostname+"]":E+=C.hostname;else return"";return C.port&&(E+=":"+C.port),E},r.buildAuthority=function(C){return r.buildUserinfo(C)+r.buildHost(C)},r.buildUserinfo=function(C){var E="";return C.username&&(E+=r.encode(C.username)),C.password&&(E+=":"+r.encode(C.password)),E&&(E+="@"),E},r.buildQuery=function(C,E,R){var B="",W,Y,q,X;for(Y in C)if(Y!=="__proto__"&&u.call(C,Y))if(f(C[Y]))for(W={},q=0,X=C[Y].length;q<X;q++)C[Y][q]!==void 0&&W[C[Y][q]+""]===void 0&&(B+="&"+r.buildQueryParameter(Y,C[Y][q],R),E!==!0&&(W[C[Y][q]+""]=!0));else C[Y]!==void 0&&(B+="&"+r.buildQueryParameter(Y,C[Y],R));return B.substring(1)},r.buildQueryParameter=function(C,E,R){return r.encodeQuery(C,R)+(E!==null?"="+r.encodeQuery(E,R):"")},r.addQuery=function(C,E,R){if(typeof E=="object")for(var B in E)u.call(E,B)&&r.addQuery(C,B,E[B]);else if(typeof E=="string"){if(C[E]===void 0){C[E]=R;return}else typeof C[E]=="string"&&(C[E]=[C[E]]);f(R)||(R=[R]),C[E]=(C[E]||[]).concat(R)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(C,E,R){if(typeof E=="object")for(var B in E)u.call(E,B)&&r.setQuery(C,B,E[B]);else if(typeof E=="string")C[E]=R===void 0?null:R;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(C,E,R){var B,W,Y;if(f(E))for(B=0,W=E.length;B<W;B++)C[E[B]]=void 0;else if(p(E)==="RegExp")for(Y in C)E.test(Y)&&(C[Y]=void 0);else if(typeof E=="object")for(Y in E)u.call(E,Y)&&r.removeQuery(C,Y,E[Y]);else if(typeof E=="string")R!==void 0?p(R)==="RegExp"?!f(C[E])&&R.test(C[E])?C[E]=void 0:C[E]=m(C[E],R):C[E]===String(R)&&(!f(R)||R.length===1)?C[E]=void 0:f(C[E])&&(C[E]=m(C[E],R)):C[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(C,E,R,B){switch(p(E)){case"String":break;case"RegExp":for(var W in C)if(u.call(C,W)&&E.test(W)&&(R===void 0||r.hasQuery(C,W,R)))return!0;return!1;case"Object":for(var Y in E)if(u.call(E,Y)&&!r.hasQuery(C,Y,E[Y]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(R)){case"Undefined":return E in C;case"Boolean":var q=!!(f(C[E])?C[E].length:C[E]);return R===q;case"Function":return!!R(C[E],E,C);case"Array":if(!f(C[E]))return!1;var X=B?g:y;return X(C[E],R);case"RegExp":return f(C[E])?B?g(C[E],R):!1:!!(C[E]&&C[E].match(R));case"Number":R=String(R);case"String":return f(C[E])?B?g(C[E],R):!1:C[E]===R;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var C=[],E=[],R=0,B=0;B<arguments.length;B++){var W=new r(arguments[B]);C.push(W);for(var Y=W.segment(),q=0;q<Y.length;q++)typeof Y[q]=="string"&&E.push(Y[q]),Y[q]&&R++}if(!E.length||!R)return new r("");var X=new r("").segment(E);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},r.commonPath=function(C,E){var R=Math.min(C.length,E.length),B;for(B=0;B<R;B++)if(C.charAt(B)!==E.charAt(B)){B--;break}return B<1?C.charAt(0)===E.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(B)!=="/"||E.charAt(B)!=="/")&&(B=C.substring(0,B).lastIndexOf("/")),C.substring(0,B+1))},r.withinString=function(C,E,R){R||(R={});var B=R.start||r.findUri.start,W=R.end||r.findUri.end,Y=R.trim||r.findUri.trim,q=R.parens||r.findUri.parens,X=/[a-z0-9-]=["']?$/i;for(B.lastIndex=0;;){var Q=B.exec(C);if(!Q)break;var ee=Q.index;if(R.ignoreHtml){var oe=C.slice(Math.max(ee-3,0),ee);if(oe&&X.test(oe))continue}for(var fe=ee+C.slice(ee).search(W),ve=C.slice(ee,fe),xe=-1;;){var Oe=q.exec(ve);if(!Oe)break;var Ue=Oe.index+Oe[0].length;xe=Math.max(xe,Ue)}if(xe>-1?ve=ve.slice(0,xe)+ve.slice(xe).replace(Y,""):ve=ve.replace(Y,""),!(ve.length<=Q[0].length)&&!(R.ignore&&R.ignore.test(ve))){fe=ee+ve.length;var ge=E(ve,ee,fe,C);if(ge===void 0){B.lastIndex=fe;continue}ge=String(ge),C=C.slice(0,ee)+ge+C.slice(fe),B.lastIndex=ee+ge.length}}return B.lastIndex=0,C},r.ensureValidHostname=function(C,E){var R=!!C,B=!!E,W=!1;if(B&&(W=g(r.hostProtocols,E)),W&&!R)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(C&&C.match(r.invalid_hostname_characters)){if(!i)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(i.toASCII(C).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(C){if(C){var E=Number(C);if(!(l(E)&&E>0&&E<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},r.noConflict=function(C){if(C){var E={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(E.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(E.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=o.SecondLevelDomains.noConflict()),E}else o.URI===this&&(o.URI=s);return this},c.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new r(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function D(C){return function(E,R){return E===void 0?this._parts[C]||"":(this._parts[C]=E||null,this.build(!R),this)}}function L(C,E){return function(R,B){return R===void 0?this._parts[C]||"":(R!==null&&(R=R+"",R.charAt(0)===E&&(R=R.substring(1))),this._parts[C]=R,this.build(!B),this)}}c.protocol=D("protocol"),c.username=D("username"),c.password=D("password"),c.hostname=D("hostname"),c.port=D("port"),c.query=L("query","?"),c.fragment=L("fragment","#"),c.search=function(C,E){var R=this.query(C,E);return typeof R=="string"&&R.length?"?"+R:R},c.hash=function(C,E){var R=this.fragment(C,E);return typeof R=="string"&&R.length?"#"+R:R},c.pathname=function(C,E){if(C===void 0||C===!0){var R=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?r.decodeUrnPath:r.decodePath)(R):R}else return this._parts.urn?this._parts.path=C?r.recodeUrnPath(C):"":this._parts.path=C?r.recodePath(C):"/",this.build(!E),this},c.path=c.pathname,c.href=function(C,E){var R;if(C===void 0)return this.toString();this._string="",this._parts=r._parts();var B=C instanceof r,W=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var Y=r.getDomAttribute(C);C=C[Y]||"",W=!1}if(!B&&W&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=r.parse(String(C),this._parts);else if(B||W){var q=B?C._parts:C;for(R in q)R!=="query"&&u.call(this._parts,R)&&(this._parts[R]=q[R]);q.query&&this.query(q.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},c.is=function(C){var E=!1,R=!1,B=!1,W=!1,Y=!1,q=!1,X=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,R=r.ip4_expression.test(this._parts.hostname),B=r.ip6_expression.test(this._parts.hostname),E=R||B,W=!E,Y=W&&n&&n.has(this._parts.hostname),q=W&&r.idn_expression.test(this._parts.hostname),X=W&&r.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return W;case"sld":return Y;case"ip":return E;case"ip4":case"ipv4":case"inet4":return R;case"ip6":case"ipv6":case"inet6":return B;case"idn":return q;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return X}return null};var V=c.protocol,O=c.port,z=c.hostname;c.protocol=function(C,E){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(r.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return V.call(this,C,E)},c.scheme=c.protocol,c.port=function(C,E){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),r.ensureValidPort(C))),O.call(this,C,E))},c.hostname=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var R={preventInvalidHostname:this._parts.preventInvalidHostname},B=r.parseHost(C,R);if(B!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=R.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(C,this._parts.protocol)}return z.call(this,C,E)},c.origin=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var R=this.protocol(),B=this.authority();return B?(R?R+"://":"")+this.authority():""}else{var W=r(C);return this.protocol(W.protocol()).authority(W.authority()).build(!E),this}},c.host=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var R=r.parseHost(C,this._parts);if(R!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},c.authority=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var R=r.parseAuthority(C,this._parts);if(R!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},c.userinfo=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var R=r.buildUserinfo(this._parts);return R&&R.substring(0,R.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),r.parseUserinfo(C,this._parts),this.build(!E),this},c.resource=function(C,E){var R;return C===void 0?this.path()+this.search()+this.hash():(R=r.parse(C),this._parts.path=R.path,this._parts.query=R.query,this._parts.fragment=R.fragment,this.build(!E),this)},c.subdomain=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,R)||""}else{var B=this._parts.hostname.length-this.domain().length,W=this._parts.hostname.substring(0,B),Y=new RegExp("^"+d(W));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&r.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(Y,C),this.build(!E),this}},c.domain=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(E=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.match(/\./g);if(R&&R.length<2)return this._parts.hostname;var B=this._parts.hostname.length-this.tld(E).length-1;return B=this._parts.hostname.lastIndexOf(".",B-1)+1,this._parts.hostname.substring(B)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var W=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(W,C)}return this.build(!E),this}},c.tld=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(E=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var R=this._parts.hostname.lastIndexOf("."),B=this._parts.hostname.substring(R+1);return E!==!0&&n&&n.list[B.toLowerCase()]&&n.get(this._parts.hostname)||B}else{var W;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))W=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(W,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");W=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(W,C)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},c.directory=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var R=this._parts.path.length-this.filename().length-1,B=this._parts.path.substring(0,R)||(this._parts.hostname?"/":"");return C?r.decodePath(B):B}else{var W=this._parts.path.length-this.filename().length,Y=this._parts.path.substring(0,W),q=new RegExp("^"+d(Y));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=r.recodePath(C),this._parts.path=this._parts.path.replace(q,C),this.build(!E),this}},c.filename=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var R=this._parts.path.lastIndexOf("/"),B=this._parts.path.substring(R+1);return C?r.decodePathSegment(B):B}else{var W=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(W=!0);var Y=new RegExp(d(this.filename())+"$");return C=r.recodePath(C),this._parts.path=this._parts.path.replace(Y,C),W?this.normalizePath(E):this.build(!E),this}},c.suffix=function(C,E){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var R=this.filename(),B=R.lastIndexOf("."),W,Y;return B===-1?"":(W=R.substring(B+1),Y=/^[a-z0-9%]+$/i.test(W)?W:"",C?r.decodePathSegment(Y):Y)}else{C.charAt(0)==="."&&(C=C.substring(1));var q=this.suffix(),X;if(q)C?X=new RegExp(d(q)+"$"):X=new RegExp(d("."+q)+"$");else{if(!C)return this;this._parts.path+="."+r.recodePath(C)}return X&&(C=r.recodePath(C),this._parts.path=this._parts.path.replace(X,C)),this.build(!E),this}},c.segment=function(C,E,R){var B=this._parts.urn?":":"/",W=this.path(),Y=W.substring(0,1)==="/",q=W.split(B);if(C!==void 0&&typeof C!="number"&&(R=E,E=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(Y&&q.shift(),C<0&&(C=Math.max(q.length+C,0)),E===void 0)return C===void 0?q:q[C];if(C===null||q[C]===void 0)if(f(E)){q=[];for(var X=0,Q=E.length;X<Q;X++)!E[X].length&&(!q.length||!q[q.length-1].length)||(q.length&&!q[q.length-1].length&&q.pop(),q.push(_(E[X])))}else(E||typeof E=="string")&&(E=_(E),q[q.length-1]===""?q[q.length-1]=E:q.push(E));else E?q[C]=_(E):q.splice(C,1);return Y&&q.unshift(""),this.path(q.join(B),R)},c.segmentCoded=function(C,E,R){var B,W,Y;if(typeof C!="number"&&(R=E,E=C,C=void 0),E===void 0){if(B=this.segment(C,E,R),!f(B))B=B!==void 0?r.decode(B):void 0;else for(W=0,Y=B.length;W<Y;W++)B[W]=r.decode(B[W]);return B}if(!f(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(W=0,Y=E.length;W<Y;W++)E[W]=r.encode(E[W]);return this.segment(C,E,R)};var U=c.query;return c.query=function(C,E){if(C===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),B=C.call(this,R);return this._parts.query=r.buildQuery(B||R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=r.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):U.call(this,C,E)},c.setQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)B[C]=E!==void 0?E:null;else if(typeof C=="object")for(var W in C)u.call(C,W)&&(B[W]=C[W]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.addQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(B,C,E===void 0?null:E),this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.removeQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(B,C,E),this._parts.query=r.buildQuery(B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(R=E),this.build(!R),this},c.hasQuery=function(C,E,R){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(B,C,E,R)},c.setSearch=c.setQuery,c.addSearch=c.addQuery,c.removeSearch=c.removeQuery,c.hasSearch=c.hasQuery,c.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},c.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},c.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&i?this._parts.hostname=i.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},c.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},c.normalizePath=function(C){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var R,B="",W,Y;for(E.charAt(0)!=="/"&&(R=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),R&&(B=E.substring(1).match(/^(\.\.\/)+/)||"",B&&(B=B[0]));W=E.search(/\/\.\.(\/|$)/),W!==-1;){if(W===0){E=E.substring(3);continue}Y=E.substring(0,W).lastIndexOf("/"),Y===-1&&(Y=W),E=E.substring(0,Y)+E.substring(W+3)}return R&&this.is("relative")&&(E=B+E.substring(1)),this._parts.path=E,this.build(!C),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},c.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var C=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=C,r.decode=E}return this},c.unicode=function(){var C=r.encode,E=r.decode;r.encode=w,r.decode=unescape;try{this.normalize()}finally{r.encode=C,r.decode=E}return this},c.readable=function(){var C=this.clone();C.username("").password("").normalize();var E="";if(C._parts.protocol&&(E+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&i?(E+=i.toUnicode(C._parts.hostname),C._parts.port&&(E+=":"+C._parts.port)):E+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(E+="/"),E+=C.path(!0),C._parts.query){for(var R="",B=0,W=C._parts.query.split("&"),Y=W.length;B<Y;B++){var q=(W[B]||"").split("=");R+="&"+r.decodeQuery(q[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),q[1]!==void 0&&(R+="="+r.decodeQuery(q[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+R.substring(1)}return E+=r.decodeQuery(C.hash(),!0),E},c.absoluteTo=function(C){var E=this.clone(),R=["protocol","username","password","hostname","port"],B,W,Y;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof r||(C=new r(C)),E._parts.protocol||(E._parts.protocol=C._parts.protocol,this._parts.hostname))return E;for(W=0;Y=R[W];W++)E._parts[Y]=C._parts[Y];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(B=C.directory(),B=B||(C.path().indexOf("/")===0?"/":""),E._parts.path=(B?B+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=C._parts.path,E._parts.query||(E._parts.query=C._parts.query)),E.build(),E},c.relativeTo=function(C){var E=this.clone().normalize(),R,B,W,Y,q;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new r(C).normalize(),R=E._parts,B=C._parts,Y=E.path(),q=C.path(),Y.charAt(0)!=="/")throw new Error("URI is already relative");if(q.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(R.protocol===B.protocol&&(R.protocol=null),R.username!==B.username||R.password!==B.password||R.protocol!==null||R.username!==null||R.password!==null)return E.build();if(R.hostname===B.hostname&&R.port===B.port)R.hostname=null,R.port=null;else return E.build();if(Y===q)return R.path="",E.build();if(W=r.commonPath(Y,q),!W)return E.build();var X=B.path.substring(W.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return R.path=X+R.path.substring(W.length)||"./",E.build()},c.equals=function(C){var E=this.clone(),R=new r(C),B={},W={},Y={},q,X,Q;if(E.normalize(),R.normalize(),E.toString()===R.toString())return!0;if(q=E.query(),X=R.query(),E.query(""),R.query(""),E.toString()!==R.toString()||q.length!==X.length)return!1;B=r.parseQuery(q,this._parts.escapeQuerySpace),W=r.parseQuery(X,this._parts.escapeQuerySpace);for(Q in B)if(u.call(B,Q)){if(f(B[Q])){if(!y(B[Q],W[Q]))return!1}else if(B[Q]!==W[Q])return!1;Y[Q]=!0}for(Q in W)if(u.call(W,Q)&&!Y[Q])return!1;return!0},c.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},c.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},c.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},r})})(Dc)),Dc.exports}var YS=XS();const Hi=dc(YS);function ZS(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function hs(t,i){if(t===null||typeof t!="object")return t;i=i??!1;const e=new t.constructor;for(const n in t)if(t.hasOwnProperty(n)){let o=t[n];i&&(o=hs(o,i)),e[n]=o}return e}function En(t,i,e){e=e??!1;const n={},o=T(t),s=T(i);let r,l,c;if(o)for(r in t)t.hasOwnProperty(r)&&(l=t[r],s&&e&&typeof l=="object"&&i.hasOwnProperty(r)?(c=i[r],typeof c=="object"?n[r]=En(l,c,e):n[r]=l):n[r]=l);if(s)for(r in i)i.hasOwnProperty(r)&&!n.hasOwnProperty(r)&&(c=i[r],n[r]=c);return n}function _r(){let t,i;const e=new Promise(function(n,o){t=n,i=o});return{resolve:t,reject:i,promise:e}}function Pr(t,i){let e;return typeof document<"u"&&(e=document),Pr._implementation(t,i,e)}Pr._implementation=function(t,i,e){if(!T(t))throw new G("relative uri is required.");if(!T(i)){if(typeof e>"u")return t;i=e.baseURI??e.location.href}const n=new Hi(t);return n.scheme()!==""?n.toString():n.absoluteTo(i).toString()};function QS(t,i){if(!T(t))throw new G("uri is required.");let e="";const n=t.lastIndexOf("/");return n!==-1&&(e=t.substring(0,n+1)),i&&(t=new Hi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function kS(t){if(!T(t))throw new G("uri is required.");const i=new Hi(t);i.normalize();let e=i.path(),n=e.lastIndexOf("/");return n!==-1&&(e=e.substr(n+1)),n=e.lastIndexOf("."),n===-1?e="":e=e.substr(n+1),e}const qv={};function $v(t,i,e){T(i)||(i=t.width),T(e)||(e=t.height);let n=qv[i];T(n)||(n={},qv[i]=n);let o=n[e];if(!T(o)){const s=document.createElement("canvas");s.width=i,s.height=e,o=s.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",n[e]=o}return o.drawImage(t,0,0,i,e),o.getImageData(0,0,i,e).data}const KS=/^blob:/i;function Xv(t){return S.typeOf.string("uri",t),KS.test(t)}let _i;function $u(t){T(_i)||(_i=document.createElement("a")),_i.href=window.location.href;const i=_i.host,e=_i.protocol;return _i.href=t,_i.href=_i.href,e!==_i.protocol||i!==_i.host}const JS=/^data:/i;function Yv(t){return S.typeOf.string("uri",t),JS.test(t)}function jS(t){const i=document.createElement("script");return i.async=!0,i.src=t,new Promise((e,n)=>{window.crossOriginIsolated&&i.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,o.removeChild(i),e()},i.onerror=function(s){n(s)},o.appendChild(i)})}function ex(t){if(!T(t))throw new G("obj is required.");let i="";for(const e in t)if(t.hasOwnProperty(e)){const n=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(n))for(let s=0,r=n.length;s<r;++s)i+=`${o+encodeURIComponent(n[s])}&`;else i+=`${o+encodeURIComponent(n)}&`}return i=i.slice(0,-1),i}function tx(t){if(!T(t))throw new G("queryString is required.");const i={};if(t==="")return i;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let n=0,o=e.length;n<o;++n){const s=e[n].split("="),r=decodeURIComponent(s[0]);let l=s[1];T(l)?l=decodeURIComponent(l):l="";const c=i[r];typeof c=="string"?i[r]=[c,l]:Array.isArray(c)?c.push(l):i[r]=l}return i}const $e=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),ix=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function zc(t){t=t??Ci.EMPTY_OBJECT;const i=t.throttleByServer??!1,e=t.throttle??!1;this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=t.priority??0,this.throttle=e,this.throttleByServer=i,this.type=t.type??ix.OTHER,this.serverKey=t.serverKey,this.state=$e.UNISSUED,this.deferred=void 0,this.cancelled=!1}zc.prototype.cancel=function(){this.cancelled=!0},zc.prototype.clone=function(t){return T(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=$e.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new zc(this)};function nx(t){const i={};if(!t)return i;const e=t.split(`\r
|
|
362
|
+
`);for(let n=0;n<e.length;++n){const o=e[n],s=o.indexOf(": ");if(s>0){const r=o.substring(0,s),l=o.substring(s+2);i[r]=l}}return i}function br(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=nx(this.responseHeaders))}br.prototype.toString=function(){let t="Request has failed.";return T(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function us(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(us.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),us.prototype.addEventListener=function(t,i){S.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(i);const e=this;return function(){e.removeEventListener(t,i)}},us.prototype.removeEventListener=function(t,i){S.typeOf.func("listener",t);const e=this._listeners,n=this._scopes;let o=-1;for(let s=0;s<e.length;s++)if(e[s]===t&&n[s]===i){o=s;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,n[o]=void 0):(e.splice(o,1),n.splice(o,1)),!0):!1};function ox(t,i){return i-t}us.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const i=this._listeners,e=this._scopes;let n=i.length;for(t=0;t<n;t++){const s=i[t];T(s)&&i[t].apply(e[t],arguments)}const o=this._toRemove;if(n=o.length,n>0){for(o.sort(ox),t=0;t<n;t++){const s=o[t];i.splice(s,1),e.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function po(t){S.typeOf.object("options",t),S.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(po.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){S.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Xu(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}po.prototype.reserve=function(t){t=t??this._length,this._array.length=t},po.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,s=!0;for(;s;){const r=2*(t+1),l=r-1;l<i&&e(n[l],n[t])<0?o=l:o=t,r<i&&e(n[r],n[o])<0&&(o=r),o!==t?(Xu(n,o,t),t=o):s=!1}},po.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},po.prototype.insert=function(t){S.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const r=Math.floor((o-1)/2);if(e(i[o],i[r])<0)Xu(i,o,r),o=r;else break}let s;return T(n)&&this._length>n&&(s=i[n],this._length=n),s},po.prototype.pop=function(t){if(t=t??0,this._length===0)return;S.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return Xu(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function sx(t,i){return t.priority-i.priority}const Pe={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ds=20;const gt=new po({comparator:sx});gt.maximumLength=ds,gt.reserve(ds);const Pi=[];let qi={};const rx=typeof document<"u"?new Hi(document.location.href):new Hi,Lc=new us;function Ie(){}Ie.maximumRequests=50,Ie.maximumRequestsPerServer=18,Ie.requestsByServer={},Ie.throttleRequests=!0,Ie.debugShowStatistics=!1,Ie.requestCompletedEvent=Lc,Object.defineProperties(Ie,{statistics:{get:function(){return Pe}},priorityHeapLength:{get:function(){return ds},set:function(t){if(t<ds)for(;gt.length>t;){const i=gt.pop();fo(i)}ds=t,gt.maximumLength=t,gt.reserve(t)}}});function Zv(t){T(t.priorityFunction)&&(t.priority=t.priorityFunction())}Ie.serverHasOpenSlots=function(t,i){i=i??1;const e=Ie.requestsByServer[t]??Ie.maximumRequestsPerServer;return qi[t]+i<=e},Ie.heapHasOpenSlots=function(t){return gt.length+t<=ds};function Qv(t){return t.state===$e.UNISSUED&&(t.state=$e.ISSUED,t.deferred=_r()),t.deferred.promise}function ax(t){return function(i){if(t.state===$e.CANCELLED)return;const e=t.deferred;--Pe.numberOfActiveRequests,--qi[t.serverKey],Lc.raiseEvent(),t.state=$e.RECEIVED,t.deferred=void 0,e.resolve(i)}}function lx(t){return function(i){t.state!==$e.CANCELLED&&(++Pe.numberOfFailedRequests,--Pe.numberOfActiveRequests,--qi[t.serverKey],Lc.raiseEvent(i),t.state=$e.FAILED,t.deferred.reject(i))}}function kv(t){const i=Qv(t);return t.state=$e.ACTIVE,Pi.push(t),++Pe.numberOfActiveRequests,++Pe.numberOfActiveRequestsEver,++qi[t.serverKey],t.requestFunction().then(ax(t)).catch(lx(t)),i}function fo(t){const i=t.state===$e.ACTIVE;if(t.state=$e.CANCELLED,++Pe.numberOfCancelledRequests,T(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--Pe.numberOfActiveRequests,--qi[t.serverKey],++Pe.numberOfCancelledActiveRequests),T(t.cancelFunction)&&t.cancelFunction()}Ie.update=function(){let t,i,e=0;const n=Pi.length;for(t=0;t<n;++t){if(i=Pi[t],i.cancelled&&fo(i),i.state!==$e.ACTIVE){++e;continue}e>0&&(Pi[t-e]=i)}Pi.length-=e;const o=gt.internalArray,s=gt.length;for(t=0;t<s;++t)Zv(o[t]);gt.resort();const r=Math.max(Ie.maximumRequests-Pi.length,0);let l=0;for(;l<r&>.length>0;){if(i=gt.pop(),i.cancelled){fo(i);continue}if(i.throttleByServer&&!Ie.serverHasOpenSlots(i.serverKey)){fo(i);continue}kv(i),++l}cx()},Ie.getServerKey=function(t){S.typeOf.string("url",t);let i=new Hi(t);i.scheme()===""&&(i=i.absoluteTo(rx),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=qi[e];return T(n)||(qi[e]=0),e},Ie.request=function(t){if(S.typeOf.object("request",t),S.typeOf.string("request.url",t.url),S.typeOf.func("request.requestFunction",t.requestFunction),Yv(t.url)||Xv(t.url))return Lc.raiseEvent(),t.state=$e.RECEIVED,t.requestFunction();if(++Pe.numberOfAttemptedRequests,T(t.serverKey)||(t.serverKey=Ie.getServerKey(t.url)),Ie.throttleRequests&&t.throttleByServer&&!Ie.serverHasOpenSlots(t.serverKey))return;if(!Ie.throttleRequests||!t.throttle)return kv(t);if(Pi.length>=Ie.maximumRequests)return;Zv(t);const i=gt.insert(t);if(T(i)){if(i===t)return;fo(i)}return Qv(t)};function cx(){Ie.debugShowStatistics&&(Pe.numberOfActiveRequests===0&&Pe.lastNumberOfActiveRequests>0&&(Pe.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Pe.numberOfAttemptedRequests}`),Pe.numberOfAttemptedRequests=0),Pe.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Pe.numberOfCancelledRequests}`),Pe.numberOfCancelledRequests=0),Pe.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Pe.numberOfCancelledActiveRequests}`),Pe.numberOfCancelledActiveRequests=0),Pe.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Pe.numberOfFailedRequests}`),Pe.numberOfFailedRequests=0)),Pe.lastNumberOfActiveRequests=Pe.numberOfActiveRequests)}Ie.clearForSpecs=function(){for(;gt.length>0;){const i=gt.pop();fo(i)}const t=Pi.length;for(let i=0;i<t;++i)fo(Pi[i]);Pi.length=0,qi={},Pe.numberOfAttemptedRequests=0,Pe.numberOfActiveRequests=0,Pe.numberOfCancelledRequests=0,Pe.numberOfCancelledActiveRequests=0,Pe.numberOfFailedRequests=0,Pe.numberOfActiveRequestsEver=0,Pe.lastNumberOfActiveRequests=0},Ie.numberOfActiveRequestsByServer=function(t){return qi[t]},Ie.requestHeap=gt;const ps={};let fs={};ps.add=function(t,i){if(!T(t))throw new G("host is required.");if(!T(i)||i<=0)throw new G("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(fs[e])||(fs[e]=!0)},ps.remove=function(t,i){if(!T(t))throw new G("host is required.");if(!T(i)||i<=0)throw new G("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(fs[e])&&delete fs[e]};function hx(t){const i=new Hi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=window.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}ps.contains=function(t){if(!T(t))throw new G("url is required.");const i=hx(t);return!!(T(i)&&T(fs[i]))},ps.clear=function(){fs={}};const Kv=(function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}})();function J(t){t=t??Ci.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),S.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=bi(t.templateValues,{}),this._queryParameters=bi(t.queryParameters,{}),this.headers=bi(t.headers,{}),this.request=t.request??new zc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function bi(t,i){return T(t)?hs(t):i}J.createIfNeeded=function(t){return t instanceof J?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new J({url:t})};let gs;J.supportsImageBitmapOptions=function(){return T(gs)?gs:typeof createImageBitmap!="function"?(gs=Promise.resolve(!1),gs):(gs=J.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=$v(i[0]),n=$v(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),gs)},Object.defineProperties(J,{isBlobSupported:{get:function(){return Kv}}}),Object.defineProperties(J.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return kS(this._url)}},isDataUri:{get:function(){return Yv(this._url)}},isBlobUri:{get:function(){return Xv(this._url)}},isCrossOriginUrl:{get:function(){return $u(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),J.prototype.toString=function(){return this.getUrlComponent(!0,!0)},J.prototype.parseUrl=function(t,i,e,n){let o=new Hi(t);const s=ux(o.query());this._queryParameters=i?Oc(s,this.queryParameters,e):s,o.search(""),o.fragment(""),T(n)&&o.scheme()===""&&(o=o.absoluteTo(Pr(n))),this._url=o.toString()};function ux(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:tx(t)}function Oc(t,i,e){if(!e)return En(t,i);const n=hs(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let s=n[o];const r=i[o];T(s)?(Array.isArray(s)||(s=n[o]=[s]),n[o]=s.concat(r)):n[o]=Array.isArray(r)?r.slice():r}return n}J.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${dx(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,s){const r=n[s];return T(r)?encodeURIComponent(r):o})),i&&T(this.proxy)&&(e=this.proxy.getURL(e)),e};function dx(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!T(t[i[0]])?`?${i[0]}`:`?${ex(t)}`}J.prototype.setQueryParameters=function(t,i){i?this._queryParameters=Oc(this._queryParameters,t,!1):this._queryParameters=Oc(t,this._queryParameters,!1)},J.prototype.appendQueryParameters=function(t){this._queryParameters=Oc(t,this._queryParameters,!0)},J.prototype.setTemplateValues=function(t,i){i?this._templateValues=En(this._templateValues,t):this._templateValues=En(t,this._templateValues)},J.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,T(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return T(t.queryParameters)&&(i._queryParameters=En(t.queryParameters,i.queryParameters)),T(t.templateValues)&&(i._templateValues=En(t.templateValues,i.templateValues)),T(t.headers)&&(i.headers=En(t.headers,i.headers)),T(t.proxy)&&(i.proxy=t.proxy),T(t.request)&&(i.request=t.request),T(t.retryCallback)&&(i.retryCallback=t.retryCallback),T(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},J.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},J.prototype.clone=function(t){return T(t)?(t._url=this._url,t._queryParameters=hs(this._queryParameters),t._templateValues=hs(this._templateValues),t.headers=hs(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new J({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:T(this.credits)?this.credits.slice():void 0})},J.prototype.getBaseUri=function(t){return QS(this.getUrlComponent(t),t)},J.prototype.appendForwardSlash=function(){this._url=ZS(this._url)},J.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},J.fetchArrayBuffer=function(t){return new J(t).fetchArrayBuffer()},J.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},J.fetchBlob=function(t){return new J(t).fetchBlob()},J.prototype.fetchImage=function(t){t=t??Ci.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(Zu(this.request),!Kv||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return Yu({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const s=this.fetchBlob();if(!T(s))return;let r,l,c,u;return J.supportsImageBitmapOptions().then(function(d){return r=d,l=r&&i,s}).then(function(d){if(!T(d))return;if(u=d,l)return J.createImageBitmapFromBlob(d,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return c=new J({url:p}),Yu({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(T(d))return d.blob=u,l||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return T(c)&&window.URL.revokeObjectURL(c.url),d.blob=u,Promise.reject(d)})};function Yu(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,s=i.request;s.url=i.url,s.requestFunction=function(){let l=!1;!i.isDataUri&&!i.isBlobUri&&(l=i.isCrossOriginUrl);const c=_r();return J._Implementations.createImage(s,l,c,e,n,o),c.promise};const r=Ie.request(s);if(T(r))return r.catch(function(l){return s.state!==$e.FAILED?Promise.reject(l):i.retryOnError(l).then(function(c){return c?(s.state=$e.UNISSUED,s.deferred=void 0,Yu({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(l)})})}J.fetchImage=function(t){return new J(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},J.prototype.fetchText=function(){return this.fetch({responseType:"text"})},J.fetchText=function(t){return new J(t).fetchText()},J.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(T(t))return t.then(function(i){if(T(i))return JSON.parse(i)})},J.fetchJson=function(t){return new J(t).fetchJson()},J.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},J.fetchXML=function(t){return new J(t).fetchXML()},J.prototype.fetchJsonp=function(t){t=t??"callback",Zu(this.request);let i;do i=`loadJsonp${N.nextRandomNumber().toString().substring(2,8)}`;while(T(window[i]));return Jv(this,t,i)};function Jv(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,s=t.url;o.url=s,o.requestFunction=function(){const l=_r();return window[e]=function(c){l.resolve(c);try{delete window[e]}catch{window[e]=void 0}},J._Implementations.loadAndExecuteScript(s,e,l),l.promise};const r=Ie.request(o);if(T(r))return r.catch(function(l){return o.state!==$e.FAILED?Promise.reject(l):t.retryOnError(l).then(function(c){return c?(o.state=$e.UNISSUED,o.deferred=void 0,Jv(t,i,e)):Promise.reject(l)})})}J.fetchJsonp=function(t){return new J(t).fetchJsonp(t.callbackParameterName)},J.prototype._makeRequest=function(t){const i=this;Zu(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const s=t.responseType,r=En(t.headers,i.headers),l=t.overrideMimeType,c=t.method,u=t.data,d=_r(),p=J._Implementations.loadWithXhr(n,s,c,u,r,d,l);return T(p)&&T(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise};const o=Ie.request(e);if(T(o))return o.then(function(s){return e.cancelFunction=void 0,s}).catch(function(s){return e.cancelFunction=void 0,e.state!==$e.FAILED?Promise.reject(s):i.retryOnError(s).then(function(r){return r?(e.state=$e.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(s)})})};function Zu(t){if(t.state===$e.ISSUED||t.state===$e.ACTIVE)throw new at("The Resource is already being fetched.");t.state=$e.UNISSUED,t.deferred=void 0}const px=/^data:(.*?)(;base64)?,(.*)$/;function Nc(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function jv(t,i){const e=Nc(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return n}function fx(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let s,r;switch(i){case"":case"text":return Nc(n,o);case"arraybuffer":return jv(n,o);case"blob":return s=jv(n,o),new Blob([s],{type:e});case"document":return r=new DOMParser,r.parseFromString(Nc(n,o),e);case"json":return JSON.parse(Nc(n,o));default:throw new G(`Unhandled responseType: ${i}`)}}J.prototype.fetch=function(t){return t=bi(t,{}),t.method="GET",this._makeRequest(t)},J.fetch=function(t){return new J(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.delete=function(t){return t=bi(t,{}),t.method="DELETE",this._makeRequest(t)},J.delete=function(t){return new J(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},J.prototype.head=function(t){return t=bi(t,{}),t.method="HEAD",this._makeRequest(t)},J.head=function(t){return new J(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.options=function(t){return t=bi(t,{}),t.method="OPTIONS",this._makeRequest(t)},J.options=function(t){return new J(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.post=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},J.post=function(t){return new J(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.put=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},J.put=function(t){return new J(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.patch=function(t,i){return S.defined("data",t),i=bi(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},J.patch=function(t){return new J(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J._Implementations={},J._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(ps.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},J._Implementations.createImage=function(t,i,e,n,o,s){const r=t.url;J.supportsImageBitmapOptions().then(function(l){if(!(l&&s)){J._Implementations.loadImageElement(r,i,e);return}const c="blob",u="GET",d=_r(),p=J._Implementations.loadWithXhr(r,c,u,void 0,void 0,d,void 0,void 0,void 0);return T(p)&&T(p.abort)&&(t.cancelFunction=function(){p.abort()}),d.promise.then(function(f){if(!T(f)){e.reject(new at(`Successfully retrieved ${r} but it contained no content.`));return}return J.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(l){e.reject(l)})},J.createImageBitmapFromBlob=function(t,i){return S.defined("options",i),S.typeOf.bool("options.flipY",i.flipY),S.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),S.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"from-image",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function gx(t,i,e,n,o,s,r){fetch(t,{method:e,headers:o}).then(async l=>{if(!l.ok){const c={};l.headers.forEach((u,d)=>{c[d]=u}),s.reject(new br(l.status,l,c));return}switch(i){case"text":s.resolve(l.text());break;case"json":s.resolve(l.json());break;default:s.resolve(new Uint8Array(await l.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new br)})}const mx=typeof XMLHttpRequest>"u";J._Implementations.loadWithXhr=function(t,i,e,n,o,s,r){const l=px.exec(t);if(l!==null){s.resolve(fx(l,i));return}if(mx){gx(t,i,e,n,o,s);return}const c=new XMLHttpRequest;if(ps.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),T(r)&&T(c.overrideMimeType)&&c.overrideMimeType(r),T(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);T(i)&&(c.responseType=i);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){s.reject(new br(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const m=c.getAllResponseHeaders().trim().split(/[\r\n]+/),g={};m.forEach(function(y){const _=y.split(": "),P=_.shift();g[P]=_.join(": ")}),s.resolve(g);return}if(c.status===204)s.resolve(void 0);else if(T(d)&&(!T(i)||p===i))s.resolve(d);else if(i==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(f){s.reject(f)}else(p===""||p==="document")&&T(c.responseXML)&&c.responseXML.hasChildNodes()?s.resolve(c.responseXML):(p===""||p==="text")&&T(c.responseText)?s.resolve(c.responseText):s.reject(new at("Invalid XMLHttpRequest response type."))},c.onerror=function(d){s.reject(new br)},c.send(n),c},J._Implementations.loadAndExecuteScript=function(t,i,e){return jS(t).catch(function(n){e.reject(n)})},J._DefaultImplementations={},J._DefaultImplementations.createImage=J._Implementations.createImage,J._DefaultImplementations.loadWithXhr=J._Implementations.loadWithXhr,J._DefaultImplementations.loadAndExecuteScript=J._Implementations.loadAndExecuteScript,J.DEFAULT=Object.freeze(new J({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function Sr(t){t=t??Ci.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=t.addNewLeapSeconds??!0,T(t.data)?ey(this,t.data):ey(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Sr.fromUrl=async function(t,i){S.defined("url",t),i=i??Ci.EMPTY_OBJECT;const e=J.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new at(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new Sr({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},Sr.NONE=Object.freeze({compute:function(t,i){return T(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new Vu(0,0,0,0,0),i}}),Sr.prototype.compute=function(t,i){if(!T(this._samples))return;if(T(i)||(i=new Vu(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,s=0;if(T(n)){const l=e[n],c=e[n+1],u=k.lessThanOrEquals(l,t),d=!T(c),p=d||k.greaterThanOrEquals(c,t);if(u&&p)return o=n,!d&&c.equals(t)&&++o,s=o+1,iy(this,e,this._samples,t,o,s,i),i}let r=wr(e,t,k.compare,this._dateColumn);return r>=0?(r<e.length-1&&e[r+1].equals(t)&&++r,o=r,s=r):(s=~r,o=s-1,o<0&&(o=0)),this._lastIndex=o,iy(this,e,this._samples,t,o,s,i),i};function vx(t,i){return k.compare(t.julianDate,i)}function ey(t,i){if(!T(i.columnNames))throw new at("Error in loaded EOP data: The columnNames property is required.");if(!T(i.samples))throw new at("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),s=i.columnNames.indexOf("ut1MinusUtcSeconds"),r=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),l=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||s<0||r<0||l<0||c<0)throw new at("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=i.samples,d=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=s,t._xCelestialPoleOffsetRadiansColumn=r,t._yCelestialPoleOffsetRadiansColumn=l,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let m=0,g=u.length;m<g;m+=t._columnCount){const y=u[m+e],_=u[m+c],P=y+Ve.MODIFIED_JULIAN_DATE_DIFFERENCE,w=new k(P,_,me.TAI);if(d.push(w),f){if(_!==p&&T(p)){const b=k.leapSeconds,x=wr(b,w,vx);if(x<0){const A=new Te(w,_);b.splice(~x,0,A)}}p=_}}}function ty(t,i,e,n,o){const s=e*n;o.xPoleWander=i[s+t._xPoleWanderRadiansColumn],o.yPoleWander=i[s+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[s+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[s+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[s+t._ut1MinusUtcSecondsColumn]}function xr(t,i,e){return i+t*(e-i)}function iy(t,i,e,n,o,s,r){const l=t._columnCount;if(s>i.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=i[o],u=i[s];if(c.equals(u)||n.equals(c))return ty(t,e,o,l,r),r;if(n.equals(u))return ty(t,e,s,l,r),r;const d=k.secondsDifference(n,c)/k.secondsDifference(u,c),p=o*l,f=s*l;let m=e[p+t._ut1MinusUtcSecondsColumn],g=e[f+t._ut1MinusUtcSecondsColumn];const y=g-m;if(y>.5||y<-.5){const _=e[p+t._taiMinusUtcSecondsColumn],P=e[f+t._taiMinusUtcSecondsColumn];_!==P&&(u.equals(n)?m=g:g-=P-_)}return r.xPoleWander=xr(d,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),r.yPoleWander=xr(d,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),r.xPoleOffset=xr(d,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=xr(d,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=xr(d,m,g),r}function et(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}et.fromQuaternion=function(t,i){if(!T(t))throw new G("quaternion is required");T(i)||(i=new et);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),s=1-2*(t.y*t.y+t.z*t.z),r=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(r,s),i.roll=Math.atan2(o,n),i.pitch=-N.asinClamped(e),i},et.fromDegrees=function(t,i,e,n){if(!T(t))throw new G("heading is required");if(!T(i))throw new G("pitch is required");if(!T(e))throw new G("roll is required");return T(n)||(n=new et),n.heading=t*N.RADIANS_PER_DEGREE,n.pitch=i*N.RADIANS_PER_DEGREE,n.roll=e*N.RADIANS_PER_DEGREE,n},et.clone=function(t,i){if(T(t))return T(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new et(t.heading,t.pitch,t.roll)},et.equals=function(t,i){return t===i||T(t)&&T(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},et.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&N.equalsEpsilon(t.heading,i.heading,e,n)&&N.equalsEpsilon(t.pitch,i.pitch,e,n)&&N.equalsEpsilon(t.roll,i.roll,e,n)},et.prototype.clone=function(t){return et.clone(this,t)},et.prototype.equals=function(t){return et.equals(this,t)},et.prototype.equalsEpsilon=function(t,i,e){return et.equalsEpsilon(this,t,i,e)},et.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const ny=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function yx(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=ny.exec(n);if(o!==null)return o[1]}}let Bc;function oy(t){return typeof document>"u"?t:(T(Bc)||(Bc=document.createElement("a")),Bc.href=t,Bc.href)}let go;function sy(){if(T(go))return go;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:T(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Go&&Go.tagName.toUpperCase()==="SCRIPT"&&Go.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Pr(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Go&&Go.tagName.toUpperCase()==="SCRIPT"&&Go.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?t=Pr("..",jt("Core/buildModuleUrl.js")):t=yx(),!T(t))throw new G("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return go=new J({url:oy(t)}),go.appendForwardSlash(),go}function wx(t){return oy(require.toUrl(`../${t}`))}function ry(t){return sy().getDerivedResource({url:t}).url}let Vc;function jt(t){return T(Vc)||(typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?Vc=wx:Vc=ry),Vc(t)}jt._cesiumScriptRegex=ny,jt._buildModuleUrlFromBaseUrl=ry,jt._clearBaseResource=function(){go=void 0},jt.setBaseUrl=function(t){go=J.DEFAULT.getDerivedResource({url:t})},jt.getCesiumBaseUrl=sy;function ay(t,i,e){this.x=t,this.y=i,this.s=e}function Qu(t){t=t??Ci.EMPTY_OBJECT,this._xysFileUrlTemplate=J.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new k(this._sampleZeroJulianEphemerisDate,0,me.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let s=0;s<=i;++s){e[s]=o,n[s]=s*this._stepSizeDays;for(let r=0;r<=i;++r)r!==s&&(e[s]*=s-r);e[s]=1/e[s]}this._work=new Array(i+1),this._coef=new Array(i+1)}const Cx=new k(0,0,me.TAI);function ku(t,i,e){const n=Cx;return n.dayNumber=i,n.secondsOfDay=e,k.daysDifference(n,t._sampleZeroDateTT)}Qu.prototype.preload=function(t,i,e,n){const o=ku(this,t,i),s=ku(this,e,n);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let l=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,u=l/this._samplesPerXysFile|0,d=[];for(let p=c;p<=u;++p)d.push(Ku(this,p));return Promise.all(d)},Qu.prototype.computeXysRadians=function(t,i,e){const n=ku(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let r=o-(s/2|0);r<0&&(r=0);let l=r+s;l>=this._totalSamples&&(l=this._totalSamples-1,r=l-s,r<0&&(r=0));let c=!1;const u=this._samples;if(T(u[r*3])||(Ku(this,r/this._samplesPerXysFile|0),c=!0),T(u[l*3])||(Ku(this,l/this._samplesPerXysFile|0),c=!0),c)return;T(e)?(e.x=0,e.y=0,e.s=0):e=new ay(0,0,0);const d=n-r*this._stepSizeDays,p=this._work,f=this._denominators,m=this._coef,g=this._xTable;let y,_;for(y=0;y<=s;++y)p[y]=d-g[y];for(y=0;y<=s;++y){for(m[y]=1,_=0;_<=s;++_)_!==y&&(m[y]*=p[_]);m[y]*=f[y];let P=(r+y)*3;e.x+=m[y]*u[P++],e.y+=m[y]*u[P++],e.s+=m[y]*u[P]}return e};function Ku(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;T(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new J({url:jt(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(s){t._chunkDownloadsInProgress[i]=!1;const r=t._samples,l=s.samples,c=i*t._samplesPerXysFile*3;for(let u=0,d=l.length;u<d;++u)r[c+u]=l[u]});return t._chunkDownloadsInProgress[i]=o,o}function Z(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Er=new F;Z.fromAxisAngle=function(t,i,e){S.typeOf.object("axis",t),S.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Er=F.normalize(t,Er);const s=Er.x*o,r=Er.y*o,l=Er.z*o,c=Math.cos(n);return T(e)?(e.x=s,e.y=r,e.z=l,e.w=c,e):new Z(s,r,l,c)};const _x=[1,2,0],Px=new Array(3);Z.fromRotationMatrix=function(t,i){S.typeOf.object("matrix",t);let e,n,o,s,r;const l=t[H.COLUMN0ROW0],c=t[H.COLUMN1ROW1],u=t[H.COLUMN2ROW2],d=l+c+u;if(d>0)e=Math.sqrt(d+1),r=.5*e,e=.5/e,n=(t[H.COLUMN1ROW2]-t[H.COLUMN2ROW1])*e,o=(t[H.COLUMN2ROW0]-t[H.COLUMN0ROW2])*e,s=(t[H.COLUMN0ROW1]-t[H.COLUMN1ROW0])*e;else{const p=_x;let f=0;c>l&&(f=1),u>l&&u>c&&(f=2);const m=p[f],g=p[m];e=Math.sqrt(t[H.getElementIndex(f,f)]-t[H.getElementIndex(m,m)]-t[H.getElementIndex(g,g)]+1);const y=Px;y[f]=.5*e,e=.5/e,r=(t[H.getElementIndex(g,m)]-t[H.getElementIndex(m,g)])*e,y[m]=(t[H.getElementIndex(m,f)]+t[H.getElementIndex(f,m)])*e,y[g]=(t[H.getElementIndex(g,f)]+t[H.getElementIndex(f,g)])*e,n=-y[0],o=-y[1],s=-y[2]}return T(i)?(i.x=n,i.y=o,i.z=s,i.w=r,i):new Z(n,o,s,r)};const ly=new Z;let cy=new Z,Ju=new Z,hy=new Z;Z.fromHeadingPitchRoll=function(t,i){return S.typeOf.object("headingPitchRoll",t),hy=Z.fromAxisAngle(F.UNIT_X,t.roll,ly),Ju=Z.fromAxisAngle(F.UNIT_Y,-t.pitch,i),i=Z.multiply(Ju,hy,Ju),cy=Z.fromAxisAngle(F.UNIT_Z,-t.heading,ly),Z.multiply(cy,i,i)};const Uc=new F,ju=new F,hi=new Z,uy=new Z,Wc=new Z;Z.packedLength=4,Z.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Z.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new Z),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Z.packedInterpolationLength=3,Z.convertPackedArrayForInterpolation=function(t,i,e,n){Z.unpack(t,e*4,Wc),Z.conjugate(Wc,Wc);for(let o=0,s=e-i+1;o<s;o++){const r=o*3;Z.unpack(t,(i+o)*4,hi),Z.multiply(hi,Wc,hi),hi.w<0&&Z.negate(hi,hi),Z.computeAxis(hi,Uc);const l=Z.computeAngle(hi);T(n)||(n=[]),n[r]=Uc.x*l,n[r+1]=Uc.y*l,n[r+2]=Uc.z*l}},Z.unpackInterpolationResult=function(t,i,e,n,o){T(o)||(o=new Z),F.fromArray(t,0,ju);const s=F.magnitude(ju);return Z.unpack(i,n*4,uy),s===0?Z.clone(Z.IDENTITY,hi):Z.fromAxisAngle(ju,s,hi),Z.multiply(hi,uy,o)},Z.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Z(t.x,t.y,t.z,t.w)},Z.conjugate=function(t,i){return S.typeOf.object("quaternion",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Z.magnitudeSquared=function(t){return S.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Z.magnitude=function(t){return Math.sqrt(Z.magnitudeSquared(t))},Z.normalize=function(t,i){S.typeOf.object("result",i);const e=1/Z.magnitude(t),n=t.x*e,o=t.y*e,s=t.z*e,r=t.w*e;return i.x=n,i.y=o,i.z=s,i.w=r,i},Z.inverse=function(t,i){S.typeOf.object("result",i);const e=Z.magnitudeSquared(t);return i=Z.conjugate(t,i),Z.multiplyByScalar(i,1/e,i)},Z.add=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Z.subtract=function(t,i,e){return S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Z.negate=function(t,i){return S.typeOf.object("quaternion",t),S.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Z.dot=function(t,i){return S.typeOf.object("left",t),S.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Z.multiply=function(t,i,e){S.typeOf.object("left",t),S.typeOf.object("right",i),S.typeOf.object("result",e);const n=t.x,o=t.y,s=t.z,r=t.w,l=i.x,c=i.y,u=i.z,d=i.w,p=r*l+n*d+o*u-s*c,f=r*c-n*u+o*d+s*l,m=r*u+n*c-o*l+s*d,g=r*d-n*l-o*c-s*u;return e.x=p,e.y=f,e.z=m,e.w=g,e},Z.multiplyByScalar=function(t,i,e){return S.typeOf.object("quaternion",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Z.divideByScalar=function(t,i,e){return S.typeOf.object("quaternion",t),S.typeOf.number("scalar",i),S.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Z.computeAxis=function(t,i){S.typeOf.object("quaternion",t),S.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<N.EPSILON6||Math.abs(e+1)<N.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Z.computeAngle=function(t){return S.typeOf.object("quaternion",t),Math.abs(t.w-1)<N.EPSILON6?0:2*Math.acos(t.w)};let ed=new Z;Z.lerp=function(t,i,e,n){return S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n),ed=Z.multiplyByScalar(i,e,ed),n=Z.multiplyByScalar(t,1-e,n),Z.add(ed,n,n)};let dy=new Z,td=new Z,id=new Z;Z.slerp=function(t,i,e,n){S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n);let o=Z.dot(t,i),s=i;if(o<0&&(o=-o,s=dy=Z.negate(i,dy)),1-o<N.EPSILON6)return Z.lerp(t,s,e,n);const r=Math.acos(o);return td=Z.multiplyByScalar(t,Math.sin((1-e)*r),td),id=Z.multiplyByScalar(s,Math.sin(e*r),id),n=Z.add(td,id,n),Z.multiplyByScalar(n,1/Math.sin(r),n)},Z.log=function(t,i){S.typeOf.object("quaternion",t),S.typeOf.object("result",i);const e=N.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),F.multiplyByScalar(t,n,i)},Z.exp=function(t,i){S.typeOf.object("cartesian",t),S.typeOf.object("result",i);const e=F.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const bx=new F,Sx=new F,Ar=new Z,ms=new Z;Z.computeInnerQuadrangle=function(t,i,e,n){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("q2",e),S.typeOf.object("result",n);const o=Z.conjugate(i,Ar);Z.multiply(o,e,ms);const s=Z.log(ms,bx);Z.multiply(o,t,ms);const r=Z.log(ms,Sx);return F.add(s,r,s),F.multiplyByScalar(s,.25,s),F.negate(s,s),Z.exp(s,Ar),Z.multiply(i,Ar,n)},Z.squad=function(t,i,e,n,o,s){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("s0",e),S.typeOf.object("s1",n),S.typeOf.number("t",o),S.typeOf.object("result",s);const r=Z.slerp(t,i,o,Ar),l=Z.slerp(e,n,o,ms);return Z.slerp(r,l,2*o*(1-o),s)};const xx=new Z,py=1.9011074535173003,Gc=lt.supportsTypedArrays()?new Float32Array(8):[],Hc=lt.supportsTypedArrays()?new Float32Array(8):[],$i=lt.supportsTypedArrays()?new Float32Array(8):[],Xi=lt.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;Gc[t]=1/(i*e),Hc[t]=i/e}Gc[7]=py/136,Hc[7]=py*8/17,Z.fastSlerp=function(t,i,e,n){S.typeOf.object("start",t),S.typeOf.object("end",i),S.typeOf.number("t",e),S.typeOf.object("result",n);let o=Z.dot(t,i),s;o>=0?s=1:(s=-1,o=-o);const r=o-1,l=1-e,c=e*e,u=l*l;for(let m=7;m>=0;--m)$i[m]=(Gc[m]*c-Hc[m])*r,Xi[m]=(Gc[m]*u-Hc[m])*r;const d=s*e*(1+$i[0]*(1+$i[1]*(1+$i[2]*(1+$i[3]*(1+$i[4]*(1+$i[5]*(1+$i[6]*(1+$i[7])))))))),p=l*(1+Xi[0]*(1+Xi[1]*(1+Xi[2]*(1+Xi[3]*(1+Xi[4]*(1+Xi[5]*(1+Xi[6]*(1+Xi[7])))))))),f=Z.multiplyByScalar(t,p,xx);return Z.multiplyByScalar(i,d,n),Z.add(f,n,n)},Z.fastSquad=function(t,i,e,n,o,s){S.typeOf.object("q0",t),S.typeOf.object("q1",i),S.typeOf.object("s0",e),S.typeOf.object("s1",n),S.typeOf.number("t",o),S.typeOf.object("result",s);const r=Z.fastSlerp(t,i,o,Ar),l=Z.fastSlerp(e,n,o,ms);return Z.fastSlerp(r,l,2*o*(1-o),s)},Z.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Z.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.IDENTITY=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(t){return Z.clone(this,t)},Z.prototype.equals=function(t){return Z.equals(this,t)},Z.prototype.equalsEpsilon=function(t,i){return Z.equalsEpsilon(this,t,i)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const de={},nd={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},vs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},od={},It={east:new F,north:new F,up:new F,west:new F,south:new F,down:new F};let An=new F,Tn=new F,Mn=new F;de.localFrameToFixedFrameGenerator=function(t,i){if(!nd.hasOwnProperty(t)||!nd[t].hasOwnProperty(i))throw new G("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=nd[t][i];let n;const o=t+i;return T(od[o])?n=od[o]:(n=function(s,r,l){if(!T(s))throw new G("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new G("origin has a NaN component");if(T(l)||(l=new $),F.equalsEpsilon(s,F.ZERO,N.EPSILON14))F.unpack(vs[t],0,An),F.unpack(vs[i],0,Tn),F.unpack(vs[e],0,Mn);else if(N.equalsEpsilon(s.x,0,N.EPSILON14)&&N.equalsEpsilon(s.y,0,N.EPSILON14)){const c=N.sign(s.z);F.unpack(vs[t],0,An),t!=="east"&&t!=="west"&&F.multiplyByScalar(An,c,An),F.unpack(vs[i],0,Tn),i!=="east"&&i!=="west"&&F.multiplyByScalar(Tn,c,Tn),F.unpack(vs[e],0,Mn),e!=="east"&&e!=="west"&&F.multiplyByScalar(Mn,c,Mn)}else{r=r??ae.default,r.geodeticSurfaceNormal(s,It.up);const c=It.up,u=It.east;u.x=-s.y,u.y=s.x,u.z=0,F.normalize(u,It.east),F.cross(c,u,It.north),F.multiplyByScalar(It.up,-1,It.down),F.multiplyByScalar(It.east,-1,It.west),F.multiplyByScalar(It.north,-1,It.south),An=It[t],Tn=It[i],Mn=It[e]}return l[0]=An.x,l[1]=An.y,l[2]=An.z,l[3]=0,l[4]=Tn.x,l[5]=Tn.y,l[6]=Tn.z,l[7]=0,l[8]=Mn.x,l[9]=Mn.y,l[10]=Mn.z,l[11]=0,l[12]=s.x,l[13]=s.y,l[14]=s.z,l[15]=1,l},od[o]=n),n},de.eastNorthUpToFixedFrame=de.localFrameToFixedFrameGenerator("east","north"),de.northEastDownToFixedFrame=de.localFrameToFixedFrameGenerator("north","east"),de.northUpEastToFixedFrame=de.localFrameToFixedFrameGenerator("north","up"),de.northWestUpToFixedFrame=de.localFrameToFixedFrameGenerator("north","west");const Ex=new Z,Ax=new F(1,1,1),Tx=new $;de.headingPitchRollToFixedFrame=function(t,i,e,n,o){S.typeOf.object("HeadingPitchRoll",i),n=n??de.eastNorthUpToFixedFrame;const s=Z.fromHeadingPitchRoll(i,Ex),r=$.fromTranslationQuaternionRotationScale(F.ZERO,s,Ax,Tx);return o=n(t,e,o),$.multiply(o,r,o)};const Mx=new $,Ix=new H;de.headingPitchRollQuaternion=function(t,i,e,n,o){S.typeOf.object("HeadingPitchRoll",i);const s=de.headingPitchRollToFixedFrame(t,i,e,n,Mx),r=$.getMatrix3(s,Ix);return Z.fromRotationMatrix(r,o)};const Dx=new F(1,1,1),Rx=new F,fy=new $,Fx=new $,zx=new H,Lx=new Z;de.fixedFrameToHeadingPitchRoll=function(t,i,e,n){S.defined("transform",t),i=i??ae.default,e=e??de.eastNorthUpToFixedFrame,T(n)||(n=new et);const o=$.getTranslation(t,Rx);if(F.equals(o,F.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let s=$.inverseTransformation(e(o,i,fy),fy),r=$.setScale(t,Dx,Fx);r=$.setTranslation(r,F.ZERO,r),s=$.multiply(s,r,s);let l=Z.fromRotationMatrix($.getMatrix3(s,zx),Lx);return l=Z.normalize(l,l),et.fromQuaternion(l,n)};const Ox=6*3600+2460+50.54841,Nx=8640184812866e-6,Bx=.093104,Vx=-62e-7,Ux=11772758384668e-32,Wx=72921158553e-15,Gx=N.TWO_PI/86400;let qc=new k;de.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=de.computeIcrfToFixedMatrix(t,i);return T(e)||(e=de.computeTemeToPseudoFixedMatrix(t,i)),e},de.computeTemeToPseudoFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");qc=k.addSeconds(t,-k.computeTaiMinusUtc(t),qc);const e=qc.dayNumber,n=qc.secondsOfDay;let o;const s=e-2451545;n>=43200?o=(s+.5)/Ve.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/Ve.DAYS_PER_JULIAN_CENTURY;const l=(Ox+o*(Nx+o*(Bx+o*Vx)))*Gx%N.TWO_PI,c=Wx+Ux*(e-24515455e-1),u=(n+Ve.SECONDS_PER_DAY*.5)%Ve.SECONDS_PER_DAY,d=l+c*u,p=Math.cos(d),f=Math.sin(d);return T(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new H(p,f,0,-f,p,0,0,0,1)},de.iau2006XysData=new Qu,de.earthOrientationParameters=Sr.NONE;const sd=32.184,Hx=2451545;de.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+sd,n=t.stop.dayNumber,o=t.stop.secondsOfDay+sd;return de.iau2006XysData.preload(i,e,n,o)},de.computeIcrfToFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.computeFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const qx=32.184,$x=2451545,$c=new et,Xx=new H,Yx=new k;de.computeMoonFixedToIcrfMatrix=function(t,i){if(!T(t))throw new G("date is required.");const e=k.addSeconds(t,qx,Yx),n=k.totalDays(e)-$x,o=N.toRadians(12.112)-N.toRadians(.052992)*n,s=N.toRadians(24.224)-N.toRadians(.105984)*n,r=N.toRadians(227.645)+N.toRadians(13.012)*n,l=N.toRadians(261.105)+N.toRadians(13.340716)*n,c=N.toRadians(358)+N.toRadians(.9856)*n;return $c.pitch=N.toRadians(180)-N.toRadians(3.878)*Math.sin(o)-N.toRadians(.12)*Math.sin(s)+N.toRadians(.07)*Math.sin(r)-N.toRadians(.017)*Math.sin(l),$c.roll=N.toRadians(66.53-90)+N.toRadians(1.543)*Math.cos(o)+N.toRadians(.24)*Math.cos(s)-N.toRadians(.028)*Math.cos(r)+N.toRadians(.007)*Math.cos(l),$c.heading=N.toRadians(244.375-90)+N.toRadians(13.17635831)*n+N.toRadians(3.558)*Math.sin(o)+N.toRadians(.121)*Math.sin(s)-N.toRadians(.064)*Math.sin(r)+N.toRadians(.016)*Math.sin(l)+N.toRadians(.025)*Math.sin(c),H.fromHeadingPitchRoll($c,Xx)},de.computeIcrfToMoonFixedMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.computeMoonFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const Zx=new ay(0,0,0),Qx=new Vu(0,0,0,0,0),rd=new H,ad=new H;de.computeFixedToIcrfMatrix=function(t,i){if(!T(t))throw new G("date is required.");T(i)||(i=new H);const e=de.earthOrientationParameters.compute(t,Qx);if(!T(e))return;const n=t.dayNumber,o=t.secondsOfDay+sd,s=de.iau2006XysData.computeXysRadians(n,o,Zx);if(!T(s))return;const r=s.x+e.xPoleOffset,l=s.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-l*l)),u=rd;u[0]=1-c*r*r,u[3]=-c*r*l,u[6]=r,u[1]=-c*r*l,u[4]=1-c*l*l,u[7]=l,u[2]=-r,u[5]=-l,u[8]=1-c*(r*r+l*l);const d=H.fromRotationZ(-s.s,ad),p=H.multiply(u,d,rd),f=t.dayNumber,m=t.secondsOfDay-k.computeTaiMinusUtc(t)+e.ut1MinusUtc,g=f-2451545,y=m/Ve.SECONDS_PER_DAY;let _=.779057273264+y+.00273781191135448*(g+y);_=_%1*N.TWO_PI;const P=H.fromRotationZ(_,ad),w=H.multiply(p,P,rd),b=Math.cos(e.xPoleWander),x=Math.cos(e.yPoleWander),A=Math.sin(e.xPoleWander),M=Math.sin(e.yPoleWander);let D=n-Hx+o/Ve.SECONDS_PER_DAY;D/=36525;const L=-47e-6*D*N.RADIANS_PER_DEGREE/3600,V=Math.cos(L),O=Math.sin(L),z=ad;return z[0]=b*V,z[1]=b*O,z[2]=A,z[3]=-x*O+M*A*V,z[4]=x*V+M*A*O,z[5]=-M*b,z[6]=-M*O-x*A*V,z[7]=M*V-x*A*O,z[8]=x*b,H.multiply(w,z,i)};const kx=new K;de.pointToWindowCoordinates=function(t,i,e,n){return n=de.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},de.pointToGLWindowCoordinates=function(t,i,e,n){if(!T(t))throw new G("modelViewProjectionMatrix is required.");if(!T(i))throw new G("viewportTransformation is required.");if(!T(e))throw new G("point is required.");T(n)||(n=new j);const o=kx;return $.multiplyByVector(t,K.fromElements(e.x,e.y,e.z,1,o),o),K.multiplyByScalar(o,1/o.w,o),$.multiplyByVector(i,o,o),j.fromCartesian4(o,n)};const Kx=new F,Jx=new F,jx=new F;de.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!T(t))throw new G("position is required.");if(!T(i))throw new G("velocity is required.");const o=(e??ae.default).geodeticSurfaceNormal(t,Kx);let s=F.cross(i,o,Jx);F.equalsEpsilon(s,F.ZERO,N.EPSILON6)&&(s=F.clone(F.UNIT_X,s));const r=F.cross(s,i,jx);return F.normalize(r,r),F.cross(i,r,s),F.negate(s,s),F.normalize(s,s),T(n)||(n=new H),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=s.x,n[4]=s.y,n[5]=s.z,n[6]=r.x,n[7]=r.y,n[8]=r.z,n};const gy=new $(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),my=new pe,ld=new F,eE=new F,tE=new H,cd=new $,vy=new $;de.basisTo2D=function(t,i,e){if(!T(t))throw new G("projection is required.");if(!T(i))throw new G("matrix is required.");if(!T(e))throw new G("result is required.");const n=$.getTranslation(i,eE),o=t.ellipsoid;let s;if(F.equals(n,F.ZERO))s=F.clone(F.ZERO,ld);else{const d=o.cartesianToCartographic(n,my);s=t.project(d,ld),F.fromElements(s.z,s.x,s.y,s)}const r=de.eastNorthUpToFixedFrame(n,o,cd),l=$.inverseTransformation(r,vy),c=$.getMatrix3(i,tE),u=$.multiplyByMatrix3(l,c,e);return $.multiply(gy,u,e),$.setTranslation(e,s,e),e},de.ellipsoidTo2DModelMatrix=function(t,i,e){if(!T(t))throw new G("projection is required.");if(!T(i))throw new G("center is required.");if(!T(e))throw new G("result is required.");const n=t.ellipsoid,o=de.eastNorthUpToFixedFrame(i,n,cd),s=$.inverseTransformation(o,vy),r=n.cartesianToCartographic(i,my),l=t.project(r,ld);F.fromElements(l.z,l.x,l.y,l);const c=$.fromTranslation(l,cd);return $.multiply(gy,s,e),$.multiply(c,e,e),e};function ne(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(ne.prototype,{width:{get:function(){return ne.computeWidth(this)}},height:{get:function(){return ne.computeHeight(this)}}}),ne.packedLength=4,ne.pack=function(t,i,e){return S.typeOf.object("value",t),S.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},ne.unpack=function(t,i,e){return S.defined("array",t),i=i??0,T(e)||(e=new ne),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},ne.computeWidth=function(t){S.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=N.TWO_PI),i-e},ne.computeHeight=function(t){return S.typeOf.object("rectangle",t),t.north-t.south},ne.fromDegrees=function(t,i,e,n,o){return t=N.toRadians(t??0),i=N.toRadians(i??0),e=N.toRadians(e??0),n=N.toRadians(n??0),T(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new ne(t,i,e,n)},ne.fromRadians=function(t,i,e,n,o){return T(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new ne(t,i,e,n)},ne.fromCartographicArray=function(t,i){S.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let c=0,u=t.length;c<u;c++){const d=t[c];e=Math.min(e,d.longitude),n=Math.max(n,d.longitude),r=Math.min(r,d.latitude),l=Math.max(l,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+N.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return n-e>s-o&&(e=o,n=s,n>N.PI&&(n=n-N.TWO_PI),e>N.PI&&(e=e-N.TWO_PI)),T(i)?(i.west=e,i.south=r,i.east=n,i.north=l,i):new ne(e,r,n,l)},ne.fromCartesianArray=function(t,i,e){S.defined("cartesians",t),i=i??ae.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,d=t.length;u<d;u++){const p=i.cartesianToCartographic(t[u]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),l=Math.min(l,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+N.TWO_PI;s=Math.min(s,f),r=Math.max(r,f)}return o-n>r-s&&(n=s,o=r,o>N.PI&&(o=o-N.TWO_PI),n>N.PI&&(n=n-N.TWO_PI)),T(e)?(e.west=n,e.south=l,e.east=o,e.north=c,e):new ne(n,l,o,c)};const iE=new F,nE=new F,oE=new F,sE=new F,rE=new F,hd=new Array(5);for(let t=0;t<hd.length;++t)hd[t]=new F;ne.fromBoundingSphere=function(t,i,e){S.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(T(i)||(i=ae.default),T(e)||(e=new ne),F.equals(n,F.ZERO))return ne.clone(ne.MAX_VALUE,e),e;const s=de.eastNorthUpToFixedFrame(n,i,iE),r=$.multiplyByPointAsVector(s,F.UNIT_X,nE);F.normalize(r,r);const l=$.multiplyByPointAsVector(s,F.UNIT_Y,oE);F.normalize(l,l),F.multiplyByScalar(l,o,l),F.multiplyByScalar(r,o,r);const c=F.negate(l,rE),u=F.negate(r,sE),d=hd;let p=d[0];return F.add(n,l,p),p=d[1],F.add(n,u,p),p=d[2],F.add(n,c,p),p=d[3],F.add(n,r,p),d[4]=n,ne.fromCartesianArray(d,i,e)},ne.clone=function(t,i){if(T(t))return T(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new ne(t.west,t.south,t.east,t.north)},ne.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},ne.prototype.clone=function(t){return ne.clone(this,t)},ne.prototype.equals=function(t){return ne.equals(this,t)},ne.equals=function(t,i){return t===i||T(t)&&T(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},ne.prototype.equalsEpsilon=function(t,i){return ne.equalsEpsilon(this,t,i)},ne._validate=function(t){S.typeOf.object("rectangle",t);const i=t.north;S.typeOf.number.greaterThanOrEquals("north",i,-N.PI_OVER_TWO),S.typeOf.number.lessThanOrEquals("north",i,N.PI_OVER_TWO);const e=t.south;S.typeOf.number.greaterThanOrEquals("south",e,-N.PI_OVER_TWO),S.typeOf.number.lessThanOrEquals("south",e,N.PI_OVER_TWO);const n=t.west;S.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),S.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;S.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),S.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ne.southwest=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new pe(t.west,t.south)},ne.northwest=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new pe(t.west,t.north)},ne.northeast=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new pe(t.east,t.north)},ne.southeast=function(t,i){return S.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new pe(t.east,t.south)},ne.center=function(t,i){S.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=N.TWO_PI);const o=N.negativePiToPi((n+e)*.5),s=(t.south+t.north)*.5;return T(i)?(i.longitude=o,i.latitude=s,i.height=0,i):new pe(o,s)},ne.intersection=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=N.TWO_PI:s<r&&n>0&&(s+=N.TWO_PI),n<o&&r<0?r+=N.TWO_PI:s<r&&o<0&&(o+=N.TWO_PI);const l=N.negativePiToPi(Math.max(o,r)),c=N.negativePiToPi(Math.min(n,s));if((t.west<t.east||i.west<i.east)&&c<=l)return;const u=Math.max(t.south,i.south),d=Math.min(t.north,i.north);if(!(u>=d))return T(e)?(e.west=l,e.south=u,e.east=c,e.north=d,e):new ne(l,u,c,d)},ne.simpleIntersection=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),s=Math.min(t.east,i.east),r=Math.min(t.north,i.north);if(!(o>=r||n>=s))return T(e)?(e.west=n,e.south=o,e.east=s,e.north=r,e):new ne(n,o,s,r)},ne.union=function(t,i,e){S.typeOf.object("rectangle",t),S.typeOf.object("otherRectangle",i),T(e)||(e=new ne);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=N.TWO_PI:s<r&&n>0&&(s+=N.TWO_PI),n<o&&r<0?r+=N.TWO_PI:s<r&&o<0&&(o+=N.TWO_PI);const l=N.negativePiToPi(Math.min(o,r)),c=N.negativePiToPi(Math.max(n,s));return e.west=l,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},ne.expand=function(t,i,e){return S.typeOf.object("rectangle",t),S.typeOf.object("cartographic",i),T(e)||(e=new ne),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},ne.contains=function(t,i){S.typeOf.object("rectangle",t),S.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let s=t.east;return s<o&&(s+=N.TWO_PI,e<0&&(e+=N.TWO_PI)),(e>o||N.equalsEpsilon(e,o,N.EPSILON14))&&(e<s||N.equalsEpsilon(e,s,N.EPSILON14))&&n>=t.south&&n<=t.north};const aE=new pe;ne.subsample=function(t,i,e,n){S.typeOf.object("rectangle",t),i=i??ae.default,e=e??0,T(n)||(n=[]);let o=0;const s=t.north,r=t.south,l=t.east,c=t.west,u=aE;u.height=e,u.longitude=c,u.latitude=s,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.latitude=r,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,s<0?u.latitude=s:r>0?u.latitude=r:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*N.PI_OVER_TWO,ne.contains(t,u)&&(n[o]=i.cartographicToCartesian(u,n[o]),o++);return u.latitude===0&&(u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++),n.length=o,n},ne.subsection=function(t,i,e,n,o,s){if(S.typeOf.object("rectangle",t),S.typeOf.number.greaterThanOrEquals("westLerp",i,0),S.typeOf.number.lessThanOrEquals("westLerp",i,1),S.typeOf.number.greaterThanOrEquals("southLerp",e,0),S.typeOf.number.lessThanOrEquals("southLerp",e,1),S.typeOf.number.greaterThanOrEquals("eastLerp",n,0),S.typeOf.number.lessThanOrEquals("eastLerp",n,1),S.typeOf.number.greaterThanOrEquals("northLerp",o,0),S.typeOf.number.lessThanOrEquals("northLerp",o,1),S.typeOf.number.lessThanOrEquals("westLerp",i,n),S.typeOf.number.lessThanOrEquals("southLerp",e,o),T(s)||(s=new ne),t.west<=t.east){const l=t.east-t.west;s.west=t.west+i*l,s.east=t.west+n*l}else{const l=N.TWO_PI+t.east-t.west;s.west=N.negativePiToPi(t.west+i*l),s.east=N.negativePiToPi(t.west+n*l)}const r=t.north-t.south;return s.south=t.south+e*r,s.north=t.south+o*r,i===1&&(s.west=t.east),n===1&&(s.east=t.east),e===1&&(s.south=t.north),o===1&&(s.north=t.north),s},ne.MAX_VALUE=Object.freeze(new ne(-Math.PI,-N.PI_OVER_TWO,Math.PI,N.PI_OVER_TWO));function ys(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(ys.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),ys.clone=function(t){if(T(t))return new ys(t._format,t._datatype,t._width,t._height,t._buffer)},ys.prototype.clone=function(){return ys.clone(this)};function yy(){if(!T(tt._canTransferArrayBuffer)){const t=pd("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return tt._canTransferArrayBuffer=!1,tt._canTransferArrayBuffer}tt._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const s=o.data.array,r=T(s)&&s[0]===i;n(r),t.terminate(),tt._canTransferArrayBuffer=r}})}return tt._canTransferArrayBuffer}const ud=new us;function dd(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new o;s.append(t),i=s.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function pd(t){const i=new Hi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let s,r;if($u(t))r=t;else if(!e){const l=jt(`${tt._workerModulePrefix}/${n}.js`);$u(l)&&(r=l)}if(r){const l=`import "${r}";`;return s=dd(l),o.type="module",new Worker(s,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const l=`
|
|
363
363
|
importScripts("${dd(CESIUM_WORKERS)}");
|
|
364
364
|
CesiumWorkers["${n}"]();
|
|
365
365
|
`;return s=dd(l),new Worker(s,o)}if(s=t,e||(s=jt(`${tt._workerModulePrefix+n}.js`)),!lt.supportsEsmWebWorkers())throw new at("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function lE(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!lt.supportsWebAssembly()){if(!T(i.fallbackModulePath))throw new at(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=jt(i.fallbackModulePath),e}e.wasmBinaryFile=jt(i.wasmBinaryFile);const n=await J.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function tt(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const cE=(t,i,e,n)=>{const o=({data:s})=>{if(s.id===i){if(T(s.error)){let r=s.error;r.name==="RuntimeError"?(r=new at(s.error.message),r.stack=s.error.stack):r.name==="DeveloperError"?(r=new G(s.error.message),r.stack=s.error.stack):r.name==="Error"&&(r=new Error(s.error.message),r.stack=s.error.stack),ud.raiseEvent(r),n(r)}else ud.raiseEvent(),e(s.result);t.removeEventListener("message",o)}};return o},hE=[];async function uE(t,i,e){const n=await Promise.resolve(yy());T(e)?n||(e.length=0):e=hE;const o=t._nextID++,s=new Promise((r,l)=>{t._worker.addEventListener("message",cE(t._worker,o,r,l))});return t._worker.postMessage({id:o,baseUrl:jt.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),s}async function dE(t,i,e){++t._activeTasks;try{const n=await uE(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}tt.prototype.scheduleTask=function(t,i){if(T(this._worker)||(this._worker=pd(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return dE(this,t,i)},tt.prototype.initWebAssemblyModule=async function(t){if(T(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=pd(this._workerPath),n=await lE(this,t),o=await Promise.resolve(yy());let s;const r=n.wasmBinary;T(r)&&o&&(s=[r]);const l=new Promise((c,u)=>{e.onmessage=function({data:d}){T(d)?c(d.result):u(new at("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},s),l};return this._webAssemblyPromise=i(),this._webAssemblyPromise},tt.prototype.isDestroyed=function(){return!1},tt.prototype.destroy=function(){return T(this._worker)&&this._worker.terminate(),rS(this)},tt.taskCompletedEvent=ud,tt._defaultWorkerModulePrefix="Workers/",tt._workerModulePrefix=tt._defaultWorkerModulePrefix,tt._canTransferArrayBuffer=void 0;function Yi(){}Yi._transcodeTaskProcessor=new tt("transcodeKTX2",Number.POSITIVE_INFINITY),Yi._readyPromise=void 0;function pE(){const t=Yi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return Yi._transcodeTaskProcessor;throw new at("KTX2 transcoder could not be initialized.")});Yi._readyPromise=t}Yi.transcode=function(t,i){return S.defined("supportedTargetFormats",i),T(Yi._readyPromise)||pE(),Yi._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let s=0;s<n;s++){const r=e[s];for(let l=0;l<o.length;l++){const c=r[o[l]];r[o[l]]=new ys(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let s=0;s<n;++s)e[s]=e[s][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let wy;Cy.setKTX2SupportedFormats=function(t,i,e,n,o,s){wy={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:s}};function Cy(t){S.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=J.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return Yi.transcode(e,wy)})}function Dt(t){this._ellipsoid=t??ae.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Dt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Dt.mercatorAngleToGeodeticLatitude=function(t){return N.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},Dt.geodeticLatitudeToMercatorAngle=function(t){t>Dt.MaximumLatitude?t=Dt.MaximumLatitude:t<-Dt.MaximumLatitude&&(t=-Dt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},Dt.MaximumLatitude=Dt.mercatorAngleToGeodeticLatitude(Math.PI),Dt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=Dt.geodeticLatitudeToMercatorAngle(t.latitude)*e,s=t.height;return T(i)?(i.x=n,i.y=o,i.z=s,i):new F(n,o,s)},Dt.prototype.unproject=function(t,i){if(!T(t))throw new G("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=Dt.mercatorAngleToGeodeticLatitude(t.y*e),s=t.z;return T(i)?(i.longitude=n,i.latitude=o,i.height=s,i):new pe(n,o,s)};const _y={};function Tr(t,i){if(!T(t))throw new G("identifier is required.");T(_y[t])||(_y[t]=!0,console.warn(i??t))}Tr.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",Tr.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Tr.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Tr.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function Py(t,i){if(!T(t)||!T(i))throw new G("identifier and message are required.");Tr(t,i)}function ws(){G.throwInstantiationError()}Object.defineProperties(ws.prototype,{rectangle:{get:G.throwInstantiationError},tileWidth:{get:G.throwInstantiationError},tileHeight:{get:G.throwInstantiationError},maximumLevel:{get:G.throwInstantiationError},minimumLevel:{get:G.throwInstantiationError},tilingScheme:{get:G.throwInstantiationError},tileDiscardPolicy:{get:G.throwInstantiationError},errorEvent:{get:G.throwInstantiationError},credit:{get:G.throwInstantiationError},proxy:{get:G.throwInstantiationError},hasAlphaChannel:{get:G.throwInstantiationError}}),ws.prototype.getTileCredits=function(t,i,e){G.throwInstantiationError()},ws.prototype.requestImage=function(t,i,e,n){G.throwInstantiationError()},ws.prototype.pickFeatures=function(t,i,e,n,o){G.throwInstantiationError()};const fE=/\.ktx2$/i;ws.loadImage=function(t,i){S.defined("url",i);const e=J.createIfNeeded(i);return fE.test(e.url)?Cy(e):T(t)&&T(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function by(t,i){return Py("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),t??i}Object.defineProperty(by,"EMPTY_OBJECT",{get:function(){return Py("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),Ci.EMPTY_OBJECT}});var Xc=3.141592653589793*3e3/180,it=3.141592653589793,Yc=6378245,Zc=.006693421622965943,Sy=function(n,o){var n=+n,o=+o,s=n-.0065,r=o-.006,l=Math.sqrt(s*s+r*r)-2e-5*Math.sin(r*Xc),c=Math.atan2(r,s)-3e-6*Math.cos(s*Xc),u=l*Math.cos(c),d=l*Math.sin(c);return[u,d]},xy=function(o,n){var n=+n,o=+o,s=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*Xc),r=Math.atan2(n,o)+3e-6*Math.cos(o*Xc),l=s*Math.cos(r)+.0065,c=s*Math.sin(r)+.006;return[l,c]},fd=function(o,n){var n=+n,o=+o;if(Ty(o,n))return[o,n];var s=Ey(o-105,n-35),r=Ay(o-105,n-35),l=n/180*it,c=Math.sin(l);c=1-Zc*c*c;var u=Math.sqrt(c);s=s*180/(Yc*(1-Zc)/(c*u)*it),r=r*180/(Yc/u*Math.cos(l)*it);var d=n+s,p=o+r;return[p,d]},gd=function(o,n){var n=+n,o=+o;if(Ty(o,n))return[o,n];var s=Ey(o-105,n-35),r=Ay(o-105,n-35),l=n/180*it,c=Math.sin(l);c=1-Zc*c*c;var u=Math.sqrt(c);s=s*180/(Yc*(1-Zc)/(c*u)*it),r=r*180/(Yc/u*Math.cos(l)*it);var d=n+s,p=o+r;return[o*2-p,n*2-d]},Ey=function(o,n){var n=+n,o=+o,s=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*it)+20*Math.sin(2*o*it))*2/3,s+=(20*Math.sin(n*it)+40*Math.sin(n/3*it))*2/3,s+=(160*Math.sin(n/12*it)+320*Math.sin(n*it/30))*2/3,s},Ay=function(o,n){var n=+n,o=+o,s=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*it)+20*Math.sin(2*o*it))*2/3,s+=(20*Math.sin(o*it)+40*Math.sin(o/3*it))*2/3,s+=(150*Math.sin(o/12*it)+300*Math.sin(o/30*it))*2/3,s},Ty=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function md(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}md.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function ui(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}ui.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},ui.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function ze(){}ze.EARTHRADIUS=637099681e-2,ze.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],ze.LLBAND=[75,60,45,30,15,0],ze.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],ze.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],ze.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,s;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,o,n,s))},ze.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,s;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,n,o,s)},ze.convertMC2LL=function(s){var i,e;i=new ui(Math.abs(s.lng),Math.abs(s.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(s,e),s=new ui(o.lng.toFixed(6),o.lat.toFixed(6));return s},ze.convertLL2MC=function(s){var i,e;s.lng=this.getLoop(s.lng,-180,180),s.lat=this.getRange(s.lat,-74,74),i=new ui(s.lng,s.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(s,e),s=new ui(o.lng.toFixed(2),o.lat.toFixed(2));return s},ze.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new ui(e,o)}},ze.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},ze.toRadians=function(t){return Math.PI*t/180},ze.toDegrees=function(t){return 180*t/Math.PI},ze.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},ze.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},ze.prototype.lngLatToMercator=function(t){return ze.convertLL2MC(t)},ze.prototype.lngLatToPoint=function(t){var i=ze.convertLL2MC(t);return new md(i.lng,i.lat)},ze.prototype.mercatorToLngLat=function(t){return ze.convertMC2LL(t)},ze.prototype.PointToLngLat=function(t){var i=new ui(t.x,t.y);return ze.convertMC2LL(i)},ze.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var s=this.getZoomUnits(i),r=Math.round((t.lng-e.lng)/s+n[Twidth]/2),l=Math.round((e.lat-t.lat)/s+n[Theight]/2);return new md(r,l)}},ze.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var s=this.getZoomUnits(i),r=e.lng+s*(t.x-n[Twidth]/2),l=e.lat-s*(t.y-n[Theight]/2),c=new ui(r,l);return this.mercatorToLngLat(c,o)}},ze.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function In(t){t=t||{},this._ellipsoid=by(t.ellipsoid,ae.WGS84);var i=!0;T(t.wgs84)&&(i=t.wgs84),this._projection=new Dt(this._ellipsoid);var e=new ze;this._projection.project=function(r){var l={};return i?(l=fd(N.toDegrees(r.longitude),N.toDegrees(r.latitude)),l=xy(l[0],l[1])):l=xy(N.toDegrees(r.longitude),N.toDegrees(r.latitude)),l[0]=Math.min(l[0],180),l[0]=Math.max(l[0],-180),l[1]=Math.min(l[1],74.000022),l[1]=Math.max(l[1],-71.988531),l=e.lngLatToPoint(new ui(l[0],l[1])),new j(l.x,l.y)},this._projection.unproject=function(r){var l=e.mercatorToLngLat(new ui(r.x,r.y));return l[0]=(l[0]+180)%360-180,i?(l=Sy(l.lng,l.lat),l=gd(l[0],l[1])):l=Sy(l.lng,l.lat),new pe(N.toRadians(l[0]),N.toRadians(l[1]))},this._rectangleSouthwestInMeters=new j(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new j(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ne(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var s=0;s<19;s++)this.levelWidth[s]=Math.pow(2,18-s)*256}Object.defineProperties(In.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),In.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},In.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},In.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(ne.southwest(t)),o=e.project(ne.northeast(t));return T(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new ne(n.x,n.y,o.x,o.y)},In.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],s=t*o,r=(t+1)*o;i=-i;var l=(i+1)*o,c=i*o;return T(n)?(n.west=s,n.south=c,n.east=r,n.north=l,n):new ne(s,c,r,l)},In.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),s=this._projection,r=s.unproject(new j(o.west,o.south)),l=s.unproject(new j(o.east,o.north));return o.west=r.longitude,o.south=r.latitude,o.east=l.longitude,o.north=l.latitude,o},In.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(ne.contains(n,t)){var o=this._projection,s=o.project(t);if(T(s)){var r=this.levelWidth[i],l=Math.floor(s.x/r),c=-Math.floor(s.y/r);return T(e)?(e.x=l,e.y=c,e):new j(l,c)}}};function Qc(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new In(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function gE(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(Qc.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),Qc.prototype.getTileCredits=function(t,i,e){},Qc.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=gE(this,t,i,e);return ws.loadImage(this,n)};class mE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,s){try{let r=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://tileser.giiiis.com/timetile/${e}/${s}/${n}/${o}.jpg`}}class vE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,s){try{let r;return this.indexTimeID!==0?r=this.buildImageUrl(this.indexTimeID,e,n,o):r=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${s}/${o}/${n}`}}const yE=document.createElement("canvas");class vd{constructor(i){v(this,"mapboxRenderer");v(this,"ready");v(this,"readyPromise");v(this,"rectangle");v(this,"tileSize");v(this,"tileWidth");v(this,"tileHeight");v(this,"maximumLevel");v(this,"minimumLevel");v(this,"tileDiscardPolicy");v(this,"credit");v(this,"proxy");v(this,"layerStyle");v(this,"hasAlphaChannel");v(this,"sourceFilter");v(this,"tilingScheme");v(this,"_destroyed",!1);v(this,"_error");v(this,"_style");v(this,"_accessToken");v(this,"_enablePickFeatures");this.ready=!1,this.tilingScheme=i.tilingScheme??new Ce.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=Ce.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new Ce.Event,this.credit=new Ce.Credit(i.credit||"",!1),this.proxy=new Ce.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],Ce.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,this._style=n,this.mapboxRenderer=new U_.BasicRenderer({style:n,canvas:yE,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new vd(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new Ce.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof Ce.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:s}=i,r=this.tileSize,l=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(s)-1,u=this.tilingScheme.getNumberOfYTilesAtLevel(s)-1;for(let d=-1;d<=1;d++){let p=n+d;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let m=o+f;m<0||m>u||l.push({source:e,z:s,x:p,y:m,left:0+d*r,top:0+f*r,size:r})}}return l}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const s=this.mapboxRenderer.getVisibleSources(n).reduce((r,l)=>r.concat(this._getTilesSpec({x:i,y:e,level:n},l)),[]);return new Promise((r,l)=>{const c=this._createTile(),u=c.getContext("2d");u&&(u.globalCompositeOperation="copy");const d=this.mapboxRenderer.renderTiles(u,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},s,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?l(void 0):o?(d.consumer.ctx=null,r(c),this.mapboxRenderer.releaseRender(d),this._resetTileCache()):r(d)})})}pickFeatures(i,e,n,o,s){var r;if(this._enablePickFeatures)return(r=this.requestImage(i,e,n,!1))==null?void 0:r.then(l=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const u=[],d=Ce.Math.toDegrees(o),p=Ce.Math.toDegrees(s);return c.forEach(f=>{const m=new Ce.ImageryLayerFeatureInfo;m.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:d,lat:p,tileZ:n});const g=Object.keys(m.data)[0];m.name=g;const y=m.data[g];y&&(m.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),u.push(m))}),l.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(l),this._resetTileCache(),u.length?u:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function wE(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function My(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:wE})}const{getStrFromEnv:kc}=a.ESSceneObject.context;function CE(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function _E(t,i){var e,n;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:Ut(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((e=i.viewer)==null?void 0:e.clock),times:t.times&&My(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&fi(t.tilingScheme),rectangle:t.rectangle&&We(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&_e(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(Ut(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&We(t.rectangle),tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const o=t.customTags&&CE(t.customTags);return console.log(Ut(t.url),"111"),new h.UrlTemplateImageryProvider({url:Ut(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&We(t.rectangle),tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:o})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&te(t.color),glowColor:t.glowColor&&te(t.glowColor),backgroundColor:t.backgroundColor&&te(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(Ut(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&We(t.rectangle),tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(Ut(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&_e(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const o=await h.GoogleEarthEnterpriseMetadata.fromUrl(Ut(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(o,{ellipsoid:t.ellipsoid&&_e(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&kc(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&_e(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&We(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&kc(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&We(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&_e(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:kc(t.url),rectangle:t.rectangle&&We(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&_e(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:Ut(t.url),rectangle:t.rectangle&&We(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&_e(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),color:t.color&&te(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:Ut(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&We(t.rectangle),tilingScheme:t.tilingScheme&&fi(t.tilingScheme),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&My(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new Qc({url:t.url&&kc(t.url),ellipsoid:t.ellipsoid&&_e(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new mE({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new vE({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await vd.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&We(t.rectangle),layerStyle:t.style,scheme:t.scheme}):void 0}}}function PE(t,i){i.type}class Iy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(s){var r={};return r=gd(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1])))},e.s_unproject=e.unproject,e.unproject=function(s){var r=e.s_unproject(s),l={};return l=fd(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),new h.Cartographic(h.Math.toRadians(l[0]),h.Math.toRadians(l[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class Dy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=fd(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),s={};return s=gd(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1]))}}}function bE(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class Dn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_innerImageryProvider",this.disposeVar(a.react(void 0)));v(this,"_layer",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o)return;const s=Xt(o);if(!s)return;const{imageriesManager:r}=s;r.add(this),this.dispose(()=>{r.has(this)&&r.delete(this)});const l=()=>{this.layer&&(this.layer=void 0)};this.dispose(l);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&PE(this.layer.imageryProvider,this.imageryProvider))};let u=!1;const d=this.disposeVar(a.createProcessingFromAsyncFunc(async(y,_)=>{if(_){if(u=!0,l(),!this.innerImageryProvider)return;const P=await y.promise(_E(this.innerImageryProvider,e));if(!P){console.error("createImageryProviderFromJson error!");return}this.layer=new h.ImageryLayer(P),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),u=!1}c()}));d.restart(void 0,!0);const p=this.disposeVar(new a.Event),f=this.disposeVar(new a.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,_=this.innerImageryProvider.rectangle&&We(this.innerImageryProvider.rectangle);(_.west<y.west||_.south<y.south||_.east>y.east||_.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,_.west)),h.Math.toDegrees(Math.max(y.south,_.south)),h.Math.toDegrees(Math.min(y.east,_.east)),h.Math.toDegrees(Math.min(y.north,_.north))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const m=this.disposeVar(a.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(m.disposableOn(()=>{d.restart(void 0,!0)}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(g.disposableOn(()=>{u||d.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:_}=e;_&&_.camera.flyTo({destination:this.rectangle&&!cu(this.rectangle)?We(this.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:y})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}v(Dn,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:a.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:a.reactArrayWithUndefined(void 0),colorToAlpha:a.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:a.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(Dn||(Dn={})),a.extendClassProps(Dn.prototype,Dn.createDefaultProps);const yd=h.ApproximateTerrainHeights,SE=h.ComponentDatatype,Si=h.defaultValue,ct=h.defined,xE=h.destroyObject,wd=h.DeveloperError,EE=h.deprecationWarning,AE=h.GeometryInstance,TE=h.GeometryInstanceAttribute,ME=h.GroundPolylineGeometry,Mr=h.DrawCommand,Ry=h.Pass,Fy=h.RenderState,IE=h.ShaderProgram,Ir=h.ShaderSource;let Cd=h._shadersPolylineShadowVolumeFS;const DE=h._shadersPolylineShadowVolumeMorphFS,RE=h._shadersPolylineShadowVolumeMorphVS;let _d=h._shadersPolylineShadowVolumeVS;const zy=h.BlendingState,Pd=h.ClassificationType,FE=h.CullFace,Ly=h.PolylineColorAppearance,zE=h.PolylineMaterialAppearance,Rn=h.Primitive,Cs=h.SceneMode,Oy=h.StencilConstants,Ny=h.StencilFunction,_s=h.StencilOperation;_d=_d.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Cd=Cd.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function xi(t){t=Si(t,Si.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;ct(i)||(i=new zE),this.appearance=i,this.show=Si(t.show,!0),this.classificationType=Si(t.classificationType,Pd.BOTH),this.debugShowBoundingVolume=Si(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Si(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Si(t.interleave,!1),releaseGeometryInstances:Si(t.releaseGeometryInstances,!0),allowPicking:Si(t.allowPicking,!0),asynchronous:Si(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const s=this._error;ct(s)?o(s):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=By(!1),this._renderState3DTiles=By(!0),this._renderStateMorph=Fy.fromCache({cull:{enabled:!0,face:FE.FRONT},depthTest:{enabled:!0},blending:zy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(xi.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return EE("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),xi.initializeTerrainHeights=function(){return yd.initialize()};function LE(t,i,e){const n=i.context,o=t._primitive,s=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(_d);r=Rn._appendShowToShader(o,r),r=Rn._appendDistanceDisplayConditionToShader(o,r),r=Rn._modifyShaderPosition(t,r,i.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(RE);l=Rn._appendShowToShader(o,l),l=Rn._appendDistanceDisplayConditionToShader(o,l),l=Rn._modifyShaderPosition(t,l,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Cd);const u=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";ct(e.material)?(p=ct(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],m=new Ir({defines:u,sources:[r]}),g=new Ir({defines:f,sources:[p,c]});t._sp=IE.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:m,fragmentShaderSource:g,attributeLocations:s});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!ct(y)){const P=new Ir({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:P,fragmentShaderSource:g,attributeLocations:s})}t._sp2D=y;let _=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!ct(_)){const P=new Ir({defines:u.concat([`MAX_TERRAIN_HEIGHT ${yd._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[l]});c=o._batchTable.getVertexShaderCallback()(DE);const w=new Ir({defines:f,sources:[p,c]});_=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:P,fragmentShaderSource:w,attributeLocations:s})}t._spMorph=_}function By(t){return Fy.fromCache({cull:{enabled:!0},blending:zy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:Ny.EQUAL,frontOperation:{fail:_s.KEEP,zFail:_s.KEEP,zPass:_s.KEEP},backFunction:Ny.EQUAL,backOperation:{fail:_s.KEEP,zFail:_s.KEEP,zPass:_s.KEEP},reference:Oy.CESIUM_3D_TILE_MASK,mask:Oy.CESIUM_3D_TILE_MASK}})}function OE(t,i,e,n,o,s){const r=t._primitive,l=r._va.length;o.length=l,s.length=l;const u=i instanceof Ly?{}:e._uniforms,d=r._batchTable.getUniformMapCallback()(u);for(let p=0;p<l;p++){const f=r._va[p];let m=o[p];ct(m)||(m=o[p]=new Mr({owner:t,primitiveType:r._primitiveType})),m.vertexArray=f,m.renderState=t._renderState,m.shaderProgram=t._sp,m.uniformMap=d,m.pass=Ry.TERRAIN_CLASSIFICATION,m.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const g=Mr.shallowClone(m,m.derivedCommands.tileset);g.renderState=t._renderState3DTiles,g.pass=Ry.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=g;const y=Mr.shallowClone(m,m.derivedCommands.color2D);y.shaderProgram=t._sp2D,m.derivedCommands.color2D=y;const _=Mr.shallowClone(g,g.derivedCommands.color2D);_.shaderProgram=t._sp2D,g.derivedCommands.color2D=_;const P=Mr.shallowClone(m,m.derivedCommands.colorMorph);P.renderState=t._renderStateMorph,P.shaderProgram=t._spMorph,P.pickId="czm_batchTable_pickColor(v_batchId)",m.derivedCommands.colorMorph=P}}function Vy(t,i,e,n,o,s,r){e.mode===Cs.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==Cs.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=s,i.cull=o,i.debugShowBoundingVolume=r,e.commandList.push(i)}function NE(t,i,e,n,o,s,r){const l=t._primitive;Rn._updateBoundingVolumes(l,i,o);let c;i.mode===Cs.SCENE3D?c=l._boundingSphereWC:i.mode===Cs.COLUMBUS_VIEW?c=l._boundingSphereCV:i.mode===Cs.SCENE2D&&ct(l._boundingSphere2D)?c=l._boundingSphere2D:ct(l._boundingSphereMorph)&&(c=l._boundingSphereMorph);const u=i.mode===Cs.MORPHING,d=t.classificationType,p=d!==Pd.CESIUM_3D_TILE,f=d!==Pd.TERRAIN&&!u;let m;const g=i.passes;if(g.render||g.pick&&l.allowPicking){const y=e.length;for(let _=0;_<y;++_){const P=c[_];p&&(m=e[_],Vy(t,m,i,o,s,P,r)),f&&(m=e[_].derivedCommands.tileset,Vy(t,m,i,o,s,P,r))}}}xi.prototype.update=function(t){if(!ct(this._primitive)&&!ct(this.geometryInstances))return;if(!yd.initialized){if(!this.asynchronous)throw new wd("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");xi.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!ct(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,r=new Array(s);let l;for(i=0;i<s;++i)if(l=o[i].attributes,!ct(l)||!ct(l.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<s;++i){const c=o[i];l={};const u=c.attributes;for(const d in u)u.hasOwnProperty(d)&&(l[d]=u[d]);ct(l.width)||(l.width=new TE({componentDatatype:SE.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,ME.setProjectionAndEllipsoid(c.geometry,t.mapProjection),r[i]=new AE({geometry:c.geometry,attributes:l,id:c.id,pickPrimitive:e})}n.geometryInstances=r,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,u,d){LE(e,u,d)},n._createCommandsFunction=function(c,u,d,p,f,m,g){OE(e,u,d,p,m,g)},n._updateAndQueueCommandsFunction=function(c,u,d,p,f,m,g,y){NE(e,u,d,p,f,m,g)},this._primitive=new Rn(n)}if(this.appearance instanceof Ly&&!this._hasPerInstanceColors)throw new wd("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&ct(this._primitive)&&this._primitive.ready&&this._completeLoad()})},xi.prototype.getGeometryInstanceAttributes=function(t){if(!ct(this._primitive))throw new wd("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},xi.isSupported=function(t){return t.frameState.context.depthTexture},xi.prototype.isDestroyed=function(){return!1},xi.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,xE(this)};class mo extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,s=8777;let r={};const l=()=>{var p,f,m,g,y;if(!e)return;let u;const d=this.shadingMode||"none";if((this.show??!0)&&!(d==="none"&&!this.enableContour)){let _;this.enableContour?(d==="elevation"?(u=BE(),_=u.materials.elevationRampMaterial.uniforms,_.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,_.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??s,r=u.materials.contourMaterial.uniforms):d==="slope"?(u=VE(),_=u.materials.slopeRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):d==="aspect"?(u=UE(),_=u.materials.aspectRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):(u=h.Material.fromType("ElevationContour"),r=u.uniforms),r.width=this.contourWidth,r.spacing=this.contourSpacing,r.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):d==="elevation"?(u=h.Material.fromType("ElevationRamp"),_=u.uniforms,_.minimumHeight=((m=this.elevationParam)==null?void 0:m.minHeight)??o,_.maximumHeight=((g=this.elevationParam)==null?void 0:g.maxHeight)??s):d==="slope"?(u=h.Material.fromType("SlopeRamp"),_=u.uniforms):d==="aspect"&&(u=h.Material.fromType("AspectRamp"),_=u.uniforms),d!=="none"&&(_.image=Uy(d),d==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(_.image=Array.isArray(this.elevationParam.color)?Uy(d,this.elevationParam.color):this.elevationParam.color))}n.material=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(l)),this.dispose(()=>n.material=void 0)}}v(mo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:a.reactJsonWithUndefined(void 0)})})(mo||(mo={})),a.extendClassProps(mo.prototype,mo.createDefaultProps);function BE(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function VE(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function UE(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const WE=[0,.045,.1,.15,.37,.54,1],GE=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],HE=[0,.2,.4,.6,.8,.9,1];function Uy(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=WE;else if(t==="slope")o=GE;else if(t==="aspect")o=HE;else throw new Error("values未赋值!");const s=n.createLinearGradient(0,0,100,0);return s.addColorStop(o[0],i!=null&&i[0]?gn(i==null?void 0:i[0]):"#000000"),s.addColorStop(o[1],i!=null&&i[1]?gn(i==null?void 0:i[1]):"#2747E0"),s.addColorStop(o[2],i!=null&&i[2]?gn(i==null?void 0:i[2]):"#D33B7D"),s.addColorStop(o[3],i!=null&&i[3]?gn(i==null?void 0:i[3]):"#D33038"),s.addColorStop(o[4],i!=null&&i[4]?gn(i==null?void 0:i[4]):"#FF9742"),s.addColorStop(o[5],i!=null&&i[5]?gn(i==null?void 0:i[5]):"#ffd700"),s.addColorStop(o[6],i!=null&&i[6]?gn(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=s,n.fillRect(0,0,100,1),e}class Ps extends a.Destroyable{constructor(e){super();v(this,"_geoPath");v(this,"_geoPolyline");v(this,"_geoCanvasPointPoi");v(this,"_player");v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_currentDistance",this.disposeVar(a.react(0)));v(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new Ae(e)),this._geoCanvasPointPoi=this.disposeVar(new vn(e)),this._player=this.disposeVar(new a.Player),this._geoPolyline.show=!1,this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.track([this._geoPath,"width"],[this,"width"])),this.dispose(a.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPath,"color"],[this,"color"])),this.dispose(a.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const s=this.granularity*Math.PI/180,r=iu(this.positions,this.arcType??"GEODESIC",s);if(r){this._geoPath.timePosRots=r.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Ps||(Ps={})),a.extendClassProps(Ps.prototype,Ps.createDefaultProps);class we extends Zt{constructor(e,n){super(e,n);v(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new a.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(s=>{s&&(this.sceneObject.position=s)})),this.d(this._smoothMoving.currentRotationChanged.don(s=>{s&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=s)})),this.d(this._smoothMoving.currentHeadingChanged.don(s=>{if(s!==void 0&&!this._smoothMoving.isRotating){const r=this.sceneObject.rotation;this.sceneObject.rotation=[s-90,r[1],r[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((s,r)=>{this.smoothMove(s,r*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((s,r,l)=>{this.smoothMoveWithRotation(s,r,l*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((s,r,l)=>{this.smoothMoveOnGround(s,r,l*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,r,l,c)=>{this.smoothMoveWithRotationOnGround(s,r,l,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const s=n.calcFlyToParam(e.position);if(!s){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=s})),this.d(e.automaticLandingEvent.don(async s=>{const r=[e.position[0],e.position[1]],l=await n.getTerrainHeight(r);l?e.position=[...r,l]:console.warn("不存在相交"),e.collision=s}));{const s=this.dv(a.createNextAnimateFrameEvent(e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(s.don(()=>this.visibleDistance(e,n))),this.d(n.cameraChanged.don(()=>this.visibleDistance(e,n)))}}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const s=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,s],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,s){const r=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,r],e,s)}visibleDistance(e,n){var s;const o=we.getInnerCzmObjects(this);if((s=n.viewer)!=null&&s.camera&&e.show&&o.length!=0){const r=a.getDistancesFromPositions([e.position,Bt(n.viewer.camera)],"NONE")[0];let l=!1;e.minVisibleDistance<e.maxVisibleDistance?l=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(l=r>e.minVisibleDistance),o.forEach(c=>{if(c instanceof Le)return;const u=e.show&&l;Reflect.has(c,"showHelper")&&(c.showHelper=u),Reflect.has(c,"enabled")&&(c.enabled=u),Reflect.has(c,"show")&&(c.show=u)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...we.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...we.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&o.position){const{position:r,flyToParam:l}=o,{distance:c,heading:u,pitch:d,flyDuration:p,hDelta:f,pDelta:m}=l;return this.flyToWithPromise(n,r,c,[u,d,0],e??p,f,m),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const r=e??1,l=[...o.rotation];return l[0]+=90,this.flyToWithPromise(n,o.position,void 0,l,r),!0}return super.flyIn(e,n)}}class mt extends Zt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class Dr extends we{constructor(e,n){super(e,n);v(this,"_lastHoverResult",this.disposeVar(a.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(a.createProcessingFromAsyncFunc(async(r,l)=>{const c=await r.promise(n.pick(l.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,l)}));this.ad(n.pointerMoveEvent.don(async r=>{!s.isRunning&&s.restart(void 0,r)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class Kc extends we{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function qE(t,i,e){const n=t,o=i,s=(o[0]-n[0]+(o[1]-n[1]))/4,r=[[n[0],0,n[1]],[o[0],0,n[1]],[o[0],0,o[1]],[n[0],0,o[1]],[0,s,0]],l=h.Math.toDegrees,c=r.map(d=>{const p=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...d),new h.Cartesian3),f=h.Cartographic.fromCartesian(p);return[l(f.longitude),l(f.latitude),f.height]});return[[[c[0],c[1],c[2],c[3],c[0]]],c[4]]}class vo extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_polylines");v(this,"_axis");n&&(this.id=n),this._polylines=this.disposeVar(new Wt(e,n)),this._axis=this.disposeVar(new Ae(e,n)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof De)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);se(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{let r=[],l;if(this.position){const c=Re({position:this.position,rotation:this.rotation});if(c){const u=qE(this.minSize,this.maxSize,c);r=u[0],l=u[1]}}this.polylines.positions=r,!(!this.position||!l)&&(this.axis.positions=[this.position,l])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"color"])),this.dispose(a.track([this.polylines,"width"],[this,"width"])),this.dispose(a.track([this.polylines,"show"],[this,"show"])),this.dispose(a.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}v(vo,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),color:a.reactArray([1,1,1,1]),width:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100])})})(vo||(vo={})),a.extendClassProps(vo.prototype,vo.createDefaultProps);class $E extends a.Destroyable{constructor(e,n,o){super();v(this,"_centerMatrix",this.disposeVar(a.react(void 0)));v(this,"_inverseCenterMatrix",this.disposeVar(a.react(void 0)));v(this,"_czmPlaneWrappers");v(this,"_czmPlaneWrappersChanged",this.disposeVar(a.createNextAnimateFrameEvent()));v(this,"_computedPlanesChanged",this.disposeVar(a.createNextAnimateFrameEvent()));this._czmClippingPlanes=n,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(s=>this.disposeVar(new YE(e,this,s)));{const s=()=>{let r,l;const c=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(c.length!==0){const u=c.map(p=>p.position),d=a.getMinMaxCorner(u);r=Re({position:d.center}),r&&(l=h.Matrix4.inverseTransformation(r,new h.Matrix4))}this.centerMatrix=r,this.inverseCenterMatrix=l};s(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(s))}{const s=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const l=h.Matrix4.toArray(this.centerMatrix),c=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:c,enabled:this._czmClippingPlanes.enabled,modelMatrix:l,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(r.disposableOn(s))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class XE extends a.Destroyable{constructor(i,e){super(),this._czmPlaneWrapper=i,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(a.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(a.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class YE extends a.Destroyable{constructor(e,n,o){super();v(this,"_sowi");v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_rotation",this.disposeVar(a.reactArray([0,0,0])));v(this,"_computedPlane",this.disposeVar(a.reactJson(void 0)));this._planesResetting=n,this._planeId=o,this._sowi=this.disposeVar(new a.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new a.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:s}=this.sowi;if(!s)return;let r;a.registerCreatedEventUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ESClippingPlane&&(r=l.czmPlane),!!r&&r instanceof vo)return new XE(this,r)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const s=()=>{const{inverseCenterMatrix:l}=this._planesResetting;if(!l)return this.computedPlane=void 0;const{position:c,rotation:u}=this;if(!c)return this.computedPlane=void 0;const d=Re({position:c,rotation:u});if(!d)return this.computedPlane=void 0;const f=h.Matrix4.multiply(l,d,new h.Matrix4),m=new h.Cartesian3(f[4],f[5],f[6]),g=new h.Cartesian3(f[12],f[13],f[14]);h.Cartesian3.normalize(m,m);let y=-h.Cartesian3.dot(m,g);const _=[m.x,m.y,m.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(a.Vector.negate(_,_),y=-y),this.computedPlane={normal:_,distance:y}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(r.disposableOn(s))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class bs extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));n&&(this.id=n),this.disposeVar(new a.ObjResettingWithEvent(this.planeIdsChanged,()=>new $E(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:a.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(bs||(bs={})),a.extendClassProps(bs.prototype,bs.createDefaultProps);let ZE=class extends a.Destroyable{constructor(i,e){super(),this._czmESClippingPlane=i,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const s=[...this._eS3DTileset.clippingPlaneIds],r=this._czmESClippingPlane.czmPlane.id;s.includes(r)&&(s.splice(s.indexOf(r),1),this._eS3DTileset.clippingPlaneIds=s)})}},QE=class extends a.Destroyable{constructor(i){if(super(),this._czmESClippingPlane=i,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=Re({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const s=xm(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:s,distance:0}],enabled:!0,modelMatrix:h.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const n=this.dv(a.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(n.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const ia=class ia extends we{constructor(e,n){super(e,n);v(this,"_innerPositionReact",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_czmPlane");v(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new vo(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer)return;const r=this._czmPlane;a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new QE(this):!c||!(c instanceof a.ES3DTileset)?void 0:new ZE(this,c)}))}),this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(je([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"showArrow"],[e,"showArrow"])),this.dispose(a.track([r,"color"],[e,"edgeColor"])),this.dispose(a.track([r,"width"],[e,"edgetWidth"]));{const l=()=>{r.minSize=[-e.width/2,-e.height/2],r.maxSize=[e.width/2,e.height/2]};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(c.disposableOn(l))}{const l=()=>{a.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};l(),this.dispose(this.sceneObject.positionChanged.disposableOn(l))}{const l=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(l))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?(kt(s,o,n,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};v(ia,"type",ia.register("ESCesiumViewer",a.ESClippingPlane.type,ia));let bd=ia;function kE(t){t.toBlob(i=>{if(!i){console.warn("canvas.toBlob error!");return}var e=new ClipboardItem({"image/png":i});navigator.clipboard.write([e]).then(function(){alert("图像已复制到剪切板")}).catch(function(n){console.error("复制到剪切板失败: ",n)})})}const Fh=class Fh extends a.Destroyable{constructor(i,e){super(),this._geoPolygonCanvas=i,this._geoPolygon=e;{const n=(r,l)=>{const{canvas:c,canvasCtx:u,canvasWidth:d}=this._geoPolygonCanvas,{toMercatorPos:p}=Fh,f=p(r),m=p(l),g=m[0]-f[0],y=m[1]-f[1],_=d>8192?8192:d;if(g<=0)return;const P=_*y/g|0;if(P<=0||P>8192)return;const{points:w}=this._geoPolygon;if(!w)throw new Error("!positions");const b=w.map(x=>{const A=p(x);return[(A[0]-f[0])*_/g,P-(A[1]-f[1])*P/y]});c.width=_,c.height=P,u.clearRect(0,0,_,P),u.beginPath();for(const x of b)u.lineTo(x[0],x[1]);u.closePath(),u.fillStyle="#FFFFFF",u.fill()},o=()=>{let r;const{canvas:l,canvasCtx:c,canvasWidth:u}=this._geoPolygonCanvas;c.clearRect(0,0,l.width,l.height);const{points:d}=this._geoPolygon;if(d&&d.length>=3){const p=a.getMinMaxCorner(d),{minPos:f,maxPos:m}=p;n(f,m),r={rect:[f[0],f[1],m[0],m[1]],height:d[0][2]}}this._geoPolygonCanvas.canvasGeoInfo=r,this.ad(a.nextAnimateFrame(()=>{this._geoPolygonCanvas.canvasChanged.emit()}))};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._geoPolygon.pointsChanged,this._geoPolygonCanvas.canvasWidthChanged));this.dispose(s.disposableOn(o))}}};v(Fh,"toMercatorPos",function(i){const[e,n,o]=i;return[e,n/Math.cos(n*Math.PI/180),o]});let Sd=Fh;const na=class na extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolygonWithId");v(this,"_canvas",document.createElement("canvas"));v(this,"_canvasCtx",this._canvas.getContext("2d"));v(this,"_canvasChanged",this.disposeVar(new a.Event));v(this,"_canvasGeoInfo",this.disposeVar(a.reactJsonWithUndefined(void 0)));this._geoPolygonWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._geoPolygonWithId,"id"],[this,"geoPolygonId"])),this.disposeVar(new a.ObjResettingWithEvent(this.geoPolygonWithId.sceneObjectChanged,()=>{const{sceneObject:o}=this.geoPolygonWithId;if(o&&o instanceof a.ESGeoPolygon)return new na.PolygonCanvasResetting(this,o)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygonWithId(){return this._geoPolygonWithId}get canvas(){return this._canvas}get canvasCtx(){return this._canvasCtx}get canvasChanged(){return this._canvasChanged}get canvasGeoInfo(){return this._canvasGeoInfo.value}set canvasGeoInfo(e){this._canvasGeoInfo.value=e}get canvasGeoInfoChanged(){return this._canvasGeoInfo.changed}};v(na,"saveCanvasToClipboard",kE),v(na,"PolygonCanvasResetting",Sd);let yo=na;(t=>{t.createDefaultProps=()=>({enabled:!0,geoPolygonId:"",canvasWidth:512})})(yo||(yo={})),a.extendClassProps(yo.prototype,yo.createDefaultProps);function KE(t,i){return class extends a.Destroyable{constructor(o,s){super();v(this,"_customShader",this.disposeVar(new h.CustomShader({uniforms:{u_discardRatio:{value:new h.Cartesian2(0,1),type:h.UniformType.VEC2},u_topColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4},u_bottomColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4}},varyings:{v_xbsjPos:h.VaryingType.VEC3,v_m:h.VaryingType.FLOAT},vertexShaderText:` // IMPORTANT: the function signature must use these parameter names. This
|
|
@@ -709,7 +709,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
709
709
|
${ky}
|
|
710
710
|
\`\`\`
|
|
711
711
|
|
|
712
|
-
`,Ky=Date.now();new Date(Ky).toISOString(),new Date(Ky+
|
|
712
|
+
`,Ky=Date.now();new Date(Ky).toISOString(),new Date(Ky+1440*60*1e3).toISOString();const va=class va extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new a.Event));v(this,"_dataSource",this.disposeVar(a.react(void 0)));this._clock=this.disposeVar(new ue(e)),this.dispose(a.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(a.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(a.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(a.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(a.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(a.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(a.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&this.dataSource&&(u!==void 0?o.flyTo(this.dataSource,{duration:u/1e3}):o.flyTo(this.dataSource))}));const s=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(s);const r=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:u}=this;this.startTime=h.JulianDate.toDate(u.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(u.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(u.clock.currentTime).getTime(),this.multiplier=u.clock.multiplier,this.clockStep=ue.getClockStep(u.clock.clockStep),this.clockRange=ue.getClockRange(u.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(r));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??va.defaults.show)};l(),this.dispose(this.showChanged.disposableOn(l));const c=this.disposeVar(a.react(void 0));{const u=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(m=>m);else return a.ESSceneObject.context.getStrFromEnv(this.uri)},d=()=>{c.value=this.data??u()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(p.disposableOn(d))}{const u=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{if(s(),!c.value)return;let m;try{m=await h.CzmlDataSource.load(c.value)}catch(g){console.error(`加载czml错误:${g}`),console.error(g)}if(m&&(f.check(),m.entities.values.forEach(g=>{h.Entity.prototype&&(m.ESSceneObjectID=n)}),o.dataSources.add(m),this._dataSource.value=m,l(),(this.autoResetClock??va.defaults.autoResetClock)&&r(),!!this.loadFun))try{this.loadFun(m)}catch(g){console.error(g)}})),d=()=>{u.isRunning&&u.cancel(),u.restart()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(c.changed,this.loadFunChanged));this.dispose(p.disposableOn(d))}{const u=()=>{if(this.loadFuncStr)try{const d=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=d}catch(d){console.error(d),this.loadFun=void 0}else this.loadFun=void 0};u(),this.dispose(this.loadFuncStrChanged.disposableOn(u))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(va,"defaults",{show:!0,allowPicking:!0,data:$A,dataMd:XA,autoResetClock:!0,clockEnabled:!1,startTime:ue.defaults.startTime,stopTime:ue.defaults.stopTime,currentTime:ue.defaults.currentTime,multiplier:ue.defaults.multiplier,clockStep:ue.defaults.clockStep,clockRange:ue.defaults.clockRange,shouldAnimate:ue.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:ky,defaultLoadFuncDocStr:YA});let _o=va;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:a.reactJsonWithUndefined(void 0),autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,loadFuncStr:void 0})})(_o||(_o={})),a.extendClassProps(_o.prototype,_o.createDefaultProps);const ya=class ya extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new _o(e,i.id));this.dispose(a.track([o,"show"],[i,"show"])),this.dispose(a.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([o,"data"],[i,"data"])),this.dispose(a.bind([o,"uri"],[i,"uri"])),this.dispose(a.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(a.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(a.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(a.bind([o,"startTime"],[i,"startTime"])),this.dispose(a.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(a.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(a.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(a.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(a.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(a.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(i.flyToEvent.disposableOn(s=>{e.actived&&o.flyTo(s)}))}};v(ya,"type",ya.register("ESCesiumViewer",a.ESCzml.type,ya));let Nd=ya;async function ZA(t,i){const e=a.fetchArrayBuffer(t+"index.bin"),n=a.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(i).keys()].map(p=>p.toString().padStart(6,"0")).map(p=>`${t}bins/R2DC${p}.bin`).map(p=>a.fetchArrayBuffer(p)),s=await Promise.all([e,n,...o]);if(s.some(p=>p===void 0)){console.warn("有数据未能解析!");return}const[r,...l]=s,c=new Uint16Array(r),[u,...d]=l.map(p=>new Float32Array(p));return{indexBuffer:c,vertexBuffer:u,propBuffers:d}}function*QA(t){const e=t.length/3|0;for(let n=0;n<e;++n)yield[t[n*3+0],t[n*3+1],t[n*3+2]]}const wa=class wa extends we{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");v(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new Fe(n,e.id)),this._czmTexture=this.ad(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:s}=this,{czmTexture:r}=this;{r.uri="",r.size=[1024,1],r.enabled=!0;const c=new a.ColorStops,u=()=>{c.value=e.colorStops??a.ESDataMesh.defaults.colorStops;const d=c.getColorsInUint8(new Uint8Array(1024*4));r.copyTexture({source:{width:1024,height:1,arrayBufferView:d}})};u(),this.dispose(e.colorStopsChanged.disposableOn(u))}this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),s.cull=!1,s.vertexShaderSource=`
|
|
713
713
|
precision highp float;
|
|
714
714
|
in vec3 a_position;
|
|
715
715
|
in vec3 a_prop;
|
|
@@ -799,7 +799,7 @@ ${Jy}
|
|
|
799
799
|
}
|
|
800
800
|
|
|
801
801
|
\`\`\`
|
|
802
|
-
`,Hd=Date.now(),bt=class bt extends a.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetClockEvent",this.disposeVar(new a.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new a.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new a.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new a.BooleanProperty([this,"autoResetClock"],"自动设置时钟",bt.defaults.autoResetClock),new a.BooleanProperty([this,"clockEnabled"],"启用",bt.defaults.clockEnabled),new a.BooleanProperty([this,"shouldAnimate"],"是否启用动画",bt.defaults.shouldAnimate),new a.DateProperty([this,"startTime"],"开始时间",bt.defaults.startTime,!0),new a.DateProperty([this,"stopTime"],"结束时间",bt.defaults.stopTime),new a.DateProperty([this,"currentTime"],"当前时间",bt.defaults.currentTime,!0),new a.NumberProperty([this,"multiplier"],"倍速",bt.defaults.multiplier),new a.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",bt.defaults.clockStep),new a.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",bt.defaults.clockRange)],general:[...e.general,new a.BooleanProperty([this,"show"],"是否显示",!0),new a.BooleanProperty([this,"collision"],"开启碰撞",!1),new a.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new a.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Jy,oT,!0),new a.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(bt,"createDefaultProps",()=>({...a.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:Hd,stopTime:Hd+
|
|
802
|
+
`,Hd=Date.now(),bt=class bt extends a.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetClockEvent",this.disposeVar(new a.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new a.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new a.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new a.BooleanProperty([this,"autoResetClock"],"自动设置时钟",bt.defaults.autoResetClock),new a.BooleanProperty([this,"clockEnabled"],"启用",bt.defaults.clockEnabled),new a.BooleanProperty([this,"shouldAnimate"],"是否启用动画",bt.defaults.shouldAnimate),new a.DateProperty([this,"startTime"],"开始时间",bt.defaults.startTime,!0),new a.DateProperty([this,"stopTime"],"结束时间",bt.defaults.stopTime),new a.DateProperty([this,"currentTime"],"当前时间",bt.defaults.currentTime,!0),new a.NumberProperty([this,"multiplier"],"倍速",bt.defaults.multiplier),new a.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",bt.defaults.clockStep),new a.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",bt.defaults.clockRange)],general:[...e.general,new a.BooleanProperty([this,"show"],"是否显示",!0),new a.BooleanProperty([this,"collision"],"开启碰撞",!1),new a.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new a.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Jy,oT,!0),new a.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(bt,"createDefaultProps",()=>({...a.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:Hd,stopTime:Hd+1440*60*1e3,currentTime:Hd,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),v(bt,"type",bt.register("ESKml",bt,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let th=bt;const er=class er extends a.ESLocalVector2D{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"折线","折线"),new a.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(er,"createDefaultProps",()=>({...a.ESLocalVector2D.createDefaultProps(),points:a.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(er,"type",er.register("ESLocalLineString",er,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let ih=er;const tr=class tr extends a.ESLocalVector{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"通用","通用"),new a.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(tr,"createDefaultProps",()=>({...a.ESLocalVector.createDefaultProps(),points:a.reactPositions(void 0),loop:!0,width:void 0,color:a.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(tr,"type",tr.register("ESLocalLineStringZ",tr,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let zr=tr;const jy=`in vec3 position;
|
|
803
803
|
in vec3 normal;
|
|
804
804
|
in vec2 st;
|
|
805
805
|
out vec3 v_normalEC;
|
|
@@ -1459,7 +1459,7 @@ ${l0}
|
|
|
1459
1459
|
#endif
|
|
1460
1460
|
|
|
1461
1461
|
czm_material material = czm_getMaterial(materialInput);
|
|
1462
|
-
`))})}return i};var UT=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=UT.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var s=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];s.forEach(function(r){var l=o.defines.indexOf(r);l!==-1&&o.defines.splice(l,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var WT=new h.Cartesian3;function m0(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(
|
|
1462
|
+
`))})}return i};var UT=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=UT.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var s=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];s.forEach(function(r){var l=o.defines.indexOf(r);l!==-1&&o.defines.splice(l,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var WT=new h.Cartesian3;function m0(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(24);n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=e.x,n[4]=i.y,n[5]=i.z,n[6]=e.x,n[7]=e.y,n[8]=i.z,n[9]=i.x,n[10]=e.y,n[11]=i.z,n[12]=i.x,n[13]=i.y,n[14]=e.z,n[15]=e.x,n[16]=i.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=i.x,n[22]=e.y,n[23]=e.z;var o=new h.GeometryAttributes;o.position=new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n});var s=new Uint16Array(36);s[0]=4,s[1]=5,s[2]=6,s[3]=4,s[4]=6,s[5]=7,s[6]=1,s[7]=0,s[8]=3,s[9]=1,s[10]=3,s[11]=2,s[12]=1,s[13]=6,s[14]=5,s[15]=1,s[16]=2,s[17]=6,s[18]=2,s[19]=3,s[20]=7,s[21]=2,s[22]=7,s[23]=6,s[24]=3,s[25]=0,s[26]=4,s[27]=3,s[28]=4,s[29]=7,s[30]=0,s[31]=1,s[32]=5,s[33]=0,s[34]=5,s[35]=4;for(var r=0;r<36;r+=3)s[r]=s[r]^s[r+2],s[r+2]=s[r]^s[r+2],s[r]=s[r]^s[r+2];var l;t&&(l=new Uint16Array(24),l[0]=0,l[1]=1,l[2]=1,l[3]=2,l[4]=2,l[5]=3,l[6]=3,l[7]=0,l[8]=4,l[9]=5,l[10]=5,l[11]=6,l[12]=6,l[13]=7,l[14]=7,l[15]=4,l[16]=0,l[17]=4,l[18]=1,l[19]=5,l[20]=2,l[21]=6,l[22]=3,l[23]=7);var c=h.Cartesian3.subtract(e,i,WT),u=h.Cartesian3.magnitude(c)*.5;return new h.Geometry({attributes:o,indices:t?l:s,primitiveType:t?h.PrimitiveType.LINES:h.PrimitiveType.TRIANGLES,boundingSphere:new h.BoundingSphere(h.Cartesian3.ZERO,u)})}var GT=`
|
|
1463
1463
|
in vec3 position3DHigh;
|
|
1464
1464
|
in vec3 position3DLow;
|
|
1465
1465
|
in vec4 color;
|
|
@@ -1480,7 +1480,7 @@ void main()
|
|
|
1480
1480
|
p.w = 1.0;
|
|
1481
1481
|
gl_Position = czm_projection * p;
|
|
1482
1482
|
}
|
|
1483
|
-
`;function Br(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=h.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const u=o._uniforms.image_0;o._uniforms.image_0=()=>{const d=this.videoTextureFunc&&this.videoTextureFunc();return d||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const d=this.alphaTextureFunc&&this.alphaTextureFunc();return d||u()}}var s=new h.MaterialAppearance({material:o,closed:!1});s._vertexFormat=h.VertexFormat.POSITION_ONLY,s.isCameraVideo=!0;var r=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:m0(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:s,asynchronous:!1,compressVertices:!1,allowPicking:!1});r.isCameraVideo=!0,Object.defineProperties(r,{_sp:{set:function(u){if(this.__sp!==u){if(u){var d=u,p=d.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=d}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=r;var l=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:GT});l.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:m0(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:l,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}Br.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const r=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),l=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(r,c.center),c.radius=l,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Bi(u._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var s=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,s),h.Matrix4.multiply(this._inverseViewMatrix,s,s),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Br.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Br.prototype.isDestroyed=function(){return!1},Br.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Rs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new a.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(a.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(s-this.fovy)<1e-5||(this.fovy=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(a.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(s-this.fovx)<1e-5||(this.fovx=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const s=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};s(),this.ad(this.czmTextureIdChanged.don(s))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new a.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new qT(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const s=e.getCameraInfo();s&&(this.position=s.position,this.rotation=s.rotation)})),this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}se(e.viewer,this.position,0,this.rotation,s)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Rs,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Rs||(Rs={})),a.extendClassProps(Rs.prototype,Rs.createDefaultProps);var ah=new h.Matrix3;function HT(t,i){const{position:e,heading:n,pitch:o,roll:s}=t,r=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var l=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,ah);return h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationY(-n,ah),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationX(o,ah),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationZ(-s,ah),h.Matrix4.multiplyByMatrix3(r,l,r),r}class qT extends a.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:s}=e;if(!s)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[r,l,c]}=e,u=h.Math.toRadians,d=h.Cartesian3.fromDegrees(...s),p=HT({position:d,heading:u(r),pitch:u(l),roll:u(c)}),{fov:f,aspectRatio:m,near:g,far:y}=e,_=new h.PerspectiveFrustum({fov:u(f),aspectRatio:m,near:g,far:y}),P=new Br({inverseViewMatrix:p,frustum:_,showHelperPrimitive:!0});this._xbsjCameraVideo=P,this.dispose(()=>P.destroy()),P.ESSceneObjectID=e.id,o.scene.primitives.add(P),this.dispose(()=>o.scene.primitives.remove(P));{const w=()=>{const b=e.getCurrentCzmTexture();if(b&&b instanceof Le)return b.texture};this.xbsjCameraVideo.videoTextureFunc=w}{const w=()=>{P.showHelperPrimitive=e.showHelperPrimitive};w(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(w))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const Ha=class Ha extends we{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Rs(n,e.id)),this._czmTexture=this.dv(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:s}=this,{czmTexture:r}=this;s.czmTextureId=r.id,this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(je([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"showHelperPrimitive"],[e,"showFrustum"])),this.d(a.track([r,"uriType"],[e,"videoStreamType"]));{const l=()=>{const u=e.fov??a.ESVideoFusion.defaults.fov,d=e.aspectRatio??a.ESVideoFusion.defaults.aspectRatio;s.fovx=h.Math.clamp(u,.001,179.9),s.aspectRatio=h.Math.clamp(d,.001,Number.MAX_SAFE_INTEGER)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(l))}{const l=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};l(),this.ad(e.farChanged.don(l)),this.d(a.track([e,"far"],[s,"far"]))}{const l=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};l(),this.ad(e.nearChanged.don(l))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{s.fovx=e.fov}));{const l=()=>{e.videoStreamUrl&&(r.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};l(),this.d(e.videoStreamUrlChanged.disposableOn(l))}{const l=()=>{r.loop=e.looping};l(),this.d(e.loopingChanged.don(l))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{s.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESVideoFusion.defaults.far;return o.position?(kt(s,o,n,o.position,r,e),!0):!1}}};v(Ha,"type",Ha.register("ESCesiumViewer",a.ESVideoFusion.type,Ha));let dp=Ha;function $T(t,i){const e=t,n=i,o=Math.cos,s=Math.sin;var r=[o(-e)*o(-n),s(-e)*o(-n),s(-n)];return r}function v0(t,i,e){return t*(-.5+e/i)}function y0(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let s=0;s<e+1;++s)for(let r=0;r<n+1;++r){const l=$T(v0(t,e,s),v0(i,n,r));o[(r*(e+1)+s)*3+0]=l[0],o[(r*(e+1)+s)*3+1]=l[1],o[(r*(e+1)+s)*3+2]=l[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function XT(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const s=o*(t+1)+n,r=o*(t+1)+n+1,l=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,u=(o*t+n)*6;e[u+0]=s,e[u+1]=r,e[u+2]=c,e[u+3]=s,e[u+4]=c,e[u+5]=l}return e}function YT(t,i,e,n){const o=t*e,s=i*n,r=new Uint16Array((t+1)*(s*2)+(i+1)*(o*2)+4*2);for(let m=0;m<t+1;++m)for(let g=0;g<s;++g){const y=m*e;r[(m*s+g)*2+0]=g*(o+1)+y,r[(m*s+g)*2+1]=(g+1)*(o+1)+y}const l=(t+1)*(s*2);for(let m=0;m<i+1;++m)for(let g=0;g<o;++g){const y=m*n;r[l+(g+m*o)*2+0]=y*(o+1)+g,r[l+(g+m*o)*2+1]=y*(o+1)+g+1}const c=(t+1)*(s*2)+(i+1)*(o*2),u=0,d=o,p=(o+1)*s,f=(o+1)*(s+1)-1;return r[c+0]=u,r[c+1]=(o+1)*(s+1),r[c+2]=d,r[c+3]=(o+1)*(s+1),r[c+4]=p,r[c+5]=(o+1)*(s+1),r[c+6]=f,r[c+7]=(o+1)*(s+1),r}var ZT=`
|
|
1483
|
+
`;function Br(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=h.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const u=o._uniforms.image_0;o._uniforms.image_0=()=>{const d=this.videoTextureFunc&&this.videoTextureFunc();return d||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const d=this.alphaTextureFunc&&this.alphaTextureFunc();return d||u()}}var s=new h.MaterialAppearance({material:o,closed:!1});s._vertexFormat=h.VertexFormat.POSITION_ONLY,s.isCameraVideo=!0;var r=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:m0(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:s,asynchronous:!1,compressVertices:!1,allowPicking:!1});r.isCameraVideo=!0,Object.defineProperties(r,{_sp:{set:function(u){if(this.__sp!==u){if(u){var d=u,p=d.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=d}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=r;var l=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:GT});l.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:m0(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:l,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}Br.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const r=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),l=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(r,c.center),c.radius=l,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Bi(u._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var s=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,s),h.Matrix4.multiply(this._inverseViewMatrix,s,s),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Br.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Br.prototype.isDestroyed=function(){return!1},Br.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Rs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new a.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(a.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(s-this.fovy)<1e-5||(this.fovy=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(a.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(s-this.fovx)<1e-5||(this.fovx=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const s=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};s(),this.ad(this.czmTextureIdChanged.don(s))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new a.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new qT(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const s=e.getCameraInfo();s&&(this.position=s.position,this.rotation=s.rotation)})),this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}se(e.viewer,this.position,0,this.rotation,s)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Rs,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Rs||(Rs={})),a.extendClassProps(Rs.prototype,Rs.createDefaultProps);var ah=new h.Matrix3;function HT(t,i){const{position:e,heading:n,pitch:o,roll:s}=t,r=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var l=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,ah);return h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationY(-n,ah),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationX(o,ah),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationZ(-s,ah),h.Matrix4.multiplyByMatrix3(r,l,r),r}class qT extends a.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:s}=e;if(!s)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[r,l,c]}=e,u=h.Math.toRadians,d=h.Cartesian3.fromDegrees(...s),p=HT({position:d,heading:u(r),pitch:u(l),roll:u(c)}),{fov:f,aspectRatio:m,near:g,far:y}=e,_=new h.PerspectiveFrustum({fov:u(f),aspectRatio:m,near:g,far:y}),P=new Br({inverseViewMatrix:p,frustum:_,showHelperPrimitive:!0});this._xbsjCameraVideo=P,this.dispose(()=>P.destroy()),P.ESSceneObjectID=e.id,o.scene.primitives.add(P),this.dispose(()=>o.scene.primitives.remove(P));{const w=()=>{const b=e.getCurrentCzmTexture();if(b&&b instanceof Le)return b.texture};this.xbsjCameraVideo.videoTextureFunc=w}{const w=()=>{P.showHelperPrimitive=e.showHelperPrimitive};w(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(w))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const Ha=class Ha extends we{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Rs(n,e.id)),this._czmTexture=this.dv(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:s}=this,{czmTexture:r}=this;s.czmTextureId=r.id,this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(je([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"showHelperPrimitive"],[e,"showFrustum"])),this.d(a.track([r,"uriType"],[e,"videoStreamType"]));{const l=()=>{const u=e.fov??a.ESVideoFusion.defaults.fov,d=e.aspectRatio??a.ESVideoFusion.defaults.aspectRatio;s.fovx=h.Math.clamp(u,.001,179.9),s.aspectRatio=h.Math.clamp(d,.001,Number.MAX_SAFE_INTEGER)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(l))}{const l=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};l(),this.ad(e.farChanged.don(l)),this.d(a.track([e,"far"],[s,"far"]))}{const l=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};l(),this.ad(e.nearChanged.don(l))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{s.fovx=e.fov}));{const l=()=>{e.videoStreamUrl&&(r.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};l(),this.d(e.videoStreamUrlChanged.disposableOn(l))}{const l=()=>{r.loop=e.looping};l(),this.d(e.loopingChanged.don(l))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{s.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESVideoFusion.defaults.far;return o.position?(kt(s,o,n,o.position,r,e),!0):!1}}};v(Ha,"type",Ha.register("ESCesiumViewer",a.ESVideoFusion.type,Ha));let dp=Ha;function $T(t,i){const e=t,n=i,o=Math.cos,s=Math.sin;var r=[o(-e)*o(-n),s(-e)*o(-n),s(-n)];return r}function v0(t,i,e){return t*(-.5+e/i)}function y0(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let s=0;s<e+1;++s)for(let r=0;r<n+1;++r){const l=$T(v0(t,e,s),v0(i,n,r));o[(r*(e+1)+s)*3+0]=l[0],o[(r*(e+1)+s)*3+1]=l[1],o[(r*(e+1)+s)*3+2]=l[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function XT(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const s=o*(t+1)+n,r=o*(t+1)+n+1,l=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,u=(o*t+n)*6;e[u+0]=s,e[u+1]=r,e[u+2]=c,e[u+3]=s,e[u+4]=c,e[u+5]=l}return e}function YT(t,i,e,n){const o=t*e,s=i*n,r=new Uint16Array((t+1)*(s*2)+(i+1)*(o*2)+8);for(let m=0;m<t+1;++m)for(let g=0;g<s;++g){const y=m*e;r[(m*s+g)*2+0]=g*(o+1)+y,r[(m*s+g)*2+1]=(g+1)*(o+1)+y}const l=(t+1)*(s*2);for(let m=0;m<i+1;++m)for(let g=0;g<o;++g){const y=m*n;r[l+(g+m*o)*2+0]=y*(o+1)+g,r[l+(g+m*o)*2+1]=y*(o+1)+g+1}const c=(t+1)*(s*2)+(i+1)*(o*2),u=0,d=o,p=(o+1)*s,f=(o+1)*(s+1)-1;return r[c+0]=u,r[c+1]=(o+1)*(s+1),r[c+2]=d,r[c+3]=(o+1)*(s+1),r[c+4]=p,r[c+5]=(o+1)*(s+1),r[c+6]=f,r[c+7]=(o+1)*(s+1),r}var ZT=`
|
|
1484
1484
|
// vtxf 使用double类型的position进行计算
|
|
1485
1485
|
// in vec3 position3DHigh;
|
|
1486
1486
|
// in vec3 position3DLow;
|
|
@@ -1854,7 +1854,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
1854
1854
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
1855
1855
|
return result;
|
|
1856
1856
|
}\`\`\`
|
|
1857
|
-
`,$n=class $n extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const m=$n.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],g=>g??m.loop,g=>g??m.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],g=>g??m.currentTime,g=>g??m.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],g=>g??m.duration,g=>g??m.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],g=>g??m.playing,g=>g??m.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],g=>g??m.speed,g=>g??m.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async m=>{this.routePaths=void 0;const g=o.value;if(g)try{const _=await(await fetch(g)).json();this.routePaths=xM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const m=()=>{s.restart()};m();const g=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(g.disposableOn(m))}{const m=()=>{const g=uu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);g&&(this.routePathCallback=g)};m(),this.dispose(this.routePathCallbackStrChanged.disposableOn(m))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new Qo),u=this.disposeVar(a.createProcessingFromAsyncFunc(async m=>{if(!l.value)return;const g=iv(r.scene.context).getTextureHandler(l.value);if(g instanceof Qo)c.reset(g);else{const y=await m.promise(g);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new WM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(m=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))se(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,m);else{const g=computeBoundingSphere(this.routePaths[0].positions);if(!g)return;const[y,_]=g;se(r,y,_*3,void 0,m)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v($n,"whiteGradientImageBase64",GM),v($n,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v($n,"routePathCallbackStrMd",HM),v($n,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v($n,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let Qi=$n;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Qi||(Qi={})),a.extendClassProps(Qi.prototype,Qi.createDefaultProps);class ki extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new Qi(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(ki,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(ki,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(ki||(ki={})),a.extendClassProps(ki.prototype,ki.createDefaultProps);const ml=class ml extends mt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new ki(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}};v(ml,"type",ml.register("ESCesiumViewer",oh.type,ml));let Wp=ml;function To(t){var i=[1/0,1/0,-1/0,-1/0];return uh(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}To.default=To;var fh={exports:{}},qM=fh.exports,I0;function $M(){return I0||(I0=1,function(t,i){(function(e,n){t.exports=n()})(qM,function(){function e(w,b,x,A,M){(function D(L,V,O,z,U){for(;z>O;){if(z-O>600){var C=z-O+1,E=V-O+1,R=Math.log(C),B=.5*Math.exp(2*R/3),W=.5*Math.sqrt(R*B*(C-B)/C)*(E-C/2<0?-1:1),Y=Math.max(O,Math.floor(V-E*B/C+W)),q=Math.min(z,Math.floor(V+(C-E)*B/C+W));D(L,V,Y,q,U)}var X=L[V],Q=O,ee=z;for(n(L,O,V),U(L[z],X)>0&&n(L,O,z);Q<ee;){for(n(L,Q,ee),Q++,ee--;U(L[Q],X)<0;)Q++;for(;U(L[ee],X)>0;)ee--}U(L[O],X)===0?n(L,O,ee):n(L,++ee,z),ee<=V&&(O=ee+1),V<=ee&&(z=ee-1)}})(w,b,x||0,A||w.length-1,M||o)}function n(w,b,x){var A=w[b];w[b]=w[x],w[x]=A}function o(w,b){return w<b?-1:w>b?1:0}var s=function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(w,b,x){if(!x)return b.indexOf(w);for(var A=0;A<b.length;A++)if(x(w,b[A]))return A;return-1}function l(w,b){c(w,0,w.children.length,b,w)}function c(w,b,x,A,M){M||(M=_(null)),M.minX=1/0,M.minY=1/0,M.maxX=-1/0,M.maxY=-1/0;for(var D=b;D<x;D++){var L=w.children[D];u(M,w.leaf?A(L):L)}return M}function u(w,b){return w.minX=Math.min(w.minX,b.minX),w.minY=Math.min(w.minY,b.minY),w.maxX=Math.max(w.maxX,b.maxX),w.maxY=Math.max(w.maxY,b.maxY),w}function d(w,b){return w.minX-b.minX}function p(w,b){return w.minY-b.minY}function f(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function m(w){return w.maxX-w.minX+(w.maxY-w.minY)}function g(w,b){return w.minX<=b.minX&&w.minY<=b.minY&&b.maxX<=w.maxX&&b.maxY<=w.maxY}function y(w,b){return b.minX<=w.maxX&&b.minY<=w.maxY&&b.maxX>=w.minX&&b.maxY>=w.minY}function _(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(w,b,x,A,M){for(var D=[b,x];D.length;)if(!((x=D.pop())-(b=D.pop())<=A)){var L=b+Math.ceil((x-b)/A/2)*A;e(w,L,b,x,M),D.push(b,L,L,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(w){var b=this.data,x=[];if(!y(w,b))return x;for(var A=this.toBBox,M=[];b;){for(var D=0;D<b.children.length;D++){var L=b.children[D],V=b.leaf?A(L):L;y(w,V)&&(b.leaf?x.push(L):g(w,V)?this._all(L,x):M.push(L))}b=M.pop()}return x},s.prototype.collides=function(w){var b=this.data;if(!y(w,b))return!1;for(var x=[];b;){for(var A=0;A<b.children.length;A++){var M=b.children[A],D=b.leaf?this.toBBox(M):M;if(y(w,D)){if(b.leaf||g(w,D))return!0;x.push(M)}}b=x.pop()}return!1},s.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var b=0;b<w.length;b++)this.insert(w[b]);return this}var x=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(w,b){if(!w)return this;for(var x,A,M,D=this.data,L=this.toBBox(w),V=[],O=[];D||V.length;){if(D||(D=V.pop(),A=V[V.length-1],x=O.pop(),M=!0),D.leaf){var z=r(w,D.children,b);if(z!==-1)return D.children.splice(z,1),V.push(D),this._condense(V),this}M||D.leaf||!g(D,L)?A?(x++,D=A.children[x],M=!1):D=null:(V.push(D),O.push(x),x=0,A=D,D=D.children[0])}return this},s.prototype.toBBox=function(w){return w},s.prototype.compareMinX=function(w,b){return w.minX-b.minX},s.prototype.compareMinY=function(w,b){return w.minY-b.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(w){return this.data=w,this},s.prototype._all=function(w,b){for(var x=[];w;)w.leaf?b.push.apply(b,w.children):x.push.apply(x,w.children),w=x.pop();return b},s.prototype._build=function(w,b,x,A){var M,D=x-b+1,L=this._maxEntries;if(D<=L)return l(M=_(w.slice(b,x+1)),this.toBBox),M;A||(A=Math.ceil(Math.log(D)/Math.log(L)),L=Math.ceil(D/Math.pow(L,A-1))),(M=_([])).leaf=!1,M.height=A;var V=Math.ceil(D/L),O=V*Math.ceil(Math.sqrt(L));P(w,b,x,O,this.compareMinX);for(var z=b;z<=x;z+=O){var U=Math.min(z+O-1,x);P(w,z,U,V,this.compareMinY);for(var C=z;C<=U;C+=V){var E=Math.min(C+V-1,U);M.children.push(this._build(w,C,E,A-1))}}return l(M,this.toBBox),M},s.prototype._chooseSubtree=function(w,b,x,A){for(;A.push(b),!b.leaf&&A.length-1!==x;){for(var M=1/0,D=1/0,L=void 0,V=0;V<b.children.length;V++){var O=b.children[V],z=f(O),U=(C=w,E=O,(Math.max(E.maxX,C.maxX)-Math.min(E.minX,C.minX))*(Math.max(E.maxY,C.maxY)-Math.min(E.minY,C.minY))-z);U<D?(D=U,M=z<M?z:M,L=O):U===D&&z<M&&(M=z,L=O)}b=L||b.children[0]}var C,E;return b},s.prototype._insert=function(w,b,x){var A=x?w:this.toBBox(w),M=[],D=this._chooseSubtree(A,this.data,b,M);for(D.children.push(w),u(D,A);b>=0&&M[b].children.length>this._maxEntries;)this._split(M,b),b--;this._adjustParentBBoxes(A,M,b)},s.prototype._split=function(w,b){var x=w[b],A=x.children.length,M=this._minEntries;this._chooseSplitAxis(x,M,A);var D=this._chooseSplitIndex(x,M,A),L=_(x.children.splice(D,x.children.length-D));L.height=x.height,L.leaf=x.leaf,l(x,this.toBBox),l(L,this.toBBox),b?w[b-1].children.push(L):this._splitRoot(x,L)},s.prototype._splitRoot=function(w,b){this.data=_([w,b]),this.data.height=w.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(w,b,x){for(var A,M,D,L,V,O,z,U=1/0,C=1/0,E=b;E<=x-b;E++){var R=c(w,0,E,this.toBBox),B=c(w,E,x,this.toBBox),W=(M=R,D=B,L=void 0,V=void 0,O=void 0,z=void 0,L=Math.max(M.minX,D.minX),V=Math.max(M.minY,D.minY),O=Math.min(M.maxX,D.maxX),z=Math.min(M.maxY,D.maxY),Math.max(0,O-L)*Math.max(0,z-V)),Y=f(R)+f(B);W<U?(U=W,A=E,C=Y<C?Y:C):W===U&&Y<C&&(C=Y,A=E)}return A||x-b},s.prototype._chooseSplitAxis=function(w,b,x){var A=w.leaf?this.compareMinX:d,M=w.leaf?this.compareMinY:p;this._allDistMargin(w,b,x,A)<this._allDistMargin(w,b,x,M)&&w.children.sort(A)},s.prototype._allDistMargin=function(w,b,x,A){w.children.sort(A);for(var M=this.toBBox,D=c(w,0,b,M),L=c(w,x-b,x,M),V=m(D)+m(L),O=b;O<x-b;O++){var z=w.children[O];u(D,w.leaf?M(z):z),V+=m(D)}for(var U=x-b-1;U>=b;U--){var C=w.children[U];u(L,w.leaf?M(C):C),V+=m(L)}return V},s.prototype._adjustParentBBoxes=function(w,b,x){for(var A=x;A>=0;A--)u(b[A],w)},s.prototype._condense=function(w){for(var b=w.length-1,x=void 0;b>=0;b--)w[b].children.length===0?b>0?(x=w[b-1].children).splice(x.indexOf(w[b]),1):this.clear():l(w[b],this.toBBox)},s})}(fh)),fh.exports}function Ct(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=hh(t),o=Ii(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&XM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(D0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)D0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function D0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function XM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function YM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return R0(t);case"FeatureCollection":return ZM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Gp(t);default:throw new Error("unknown GeoJSON type")}}function R0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=F0(t.properties),i.geometry=Gp(t.geometry),i}function F0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=F0(n):i[e]=n}),i}function ZM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return R0(e)}),i}function Gp(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return Gp(e)}),i):(i.coordinates=z0(t.coordinates),i)}function z0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return z0(e)})}function L0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=vM(t),o=[];switch(n){case"LineString":o=Hp(t);break;case"MultiLineString":case"Polygon":Mi(t).forEach(function(r){o.push(Hp(r))});break;case"MultiPolygon":Mi(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(Hp(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Mi(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ai({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Hp(t){var i=Mi(t);if(i.length===2&&!O0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&N0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,O0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return N0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function O0(t,i){return t[0]===i[0]&&t[1]===i[1]}function N0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,m=u*f-d*p;return m!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function QM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return uh(t,function(s){e+=s[0],n+=s[1],o++},!0),zn([e/o,n/o],i.properties)}function B0(t){if(!t)throw new Error("geojson is required");var i=[];return Fs(t,function(e){kM(e,i)}),Ti(i)}function kM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Mi(n);break;case"LineString":e=[Mi(n)]}e.forEach(function(o){var s=KM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function KM(t,i){var e=[];return t.reduce(function(n,o){var s=lh([n,o],i);return s.bbox=JM(n,o),e.push(s),o}),e}function JM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var gh={exports:{}},qp={},V0;function U0(){return V0||(V0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(z,U,C){C===void 0&&(C={});var E={type:"Feature"};return(C.id===0||C.id)&&(E.id=C.id),C.bbox&&(E.bbox=C.bbox),E.properties=U||{},E.geometry=z,E}t.feature=i;function e(z,U,C){switch(z){case"Point":return n(U).geometry;case"LineString":return l(U).geometry;case"Polygon":return s(U).geometry;case"MultiPoint":return p(U).geometry;case"MultiLineString":return d(U).geometry;case"MultiPolygon":return f(U).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,U,C){if(C===void 0&&(C={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!D(z[0])||!D(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,U,C)}t.point=n;function o(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return n(E,U)}),C)}t.points=o;function s(z,U,C){C===void 0&&(C={});for(var E=0,R=z;E<R.length;E++){var B=R[E];if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var W=0;W<B[B.length-1].length;W++)if(B[B.length-1][W]!==B[0][W])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,U,C)}t.polygon=s;function r(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return s(E,U)}),C)}t.polygons=r;function l(z,U,C){if(C===void 0&&(C={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,U,C)}t.lineString=l;function c(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return l(E,U)}),C)}t.lineStrings=c;function u(z,U){U===void 0&&(U={});var C={type:"FeatureCollection"};return U.id&&(C.id=U.id),U.bbox&&(C.bbox=U.bbox),C.features=z,C}t.featureCollection=u;function d(z,U,C){C===void 0&&(C={});var E={type:"MultiLineString",coordinates:z};return i(E,U,C)}t.multiLineString=d;function p(z,U,C){C===void 0&&(C={});var E={type:"MultiPoint",coordinates:z};return i(E,U,C)}t.multiPoint=p;function f(z,U,C){C===void 0&&(C={});var E={type:"MultiPolygon",coordinates:z};return i(E,U,C)}t.multiPolygon=f;function m(z,U,C){C===void 0&&(C={});var E={type:"GeometryCollection",geometries:z};return i(E,U,C)}t.geometryCollection=m;function g(z,U){if(U===void 0&&(U=0),U&&!(U>=0))throw new Error("precision must be a positive number");var C=Math.pow(10,U||0);return Math.round(z*C)/C}t.round=g;function y(z,U){U===void 0&&(U="kilometers");var C=t.factors[U];if(!C)throw new Error(U+" units is invalid");return z*C}t.radiansToLength=y;function _(z,U){U===void 0&&(U="kilometers");var C=t.factors[U];if(!C)throw new Error(U+" units is invalid");return z/C}t.lengthToRadians=_;function P(z,U){return b(_(z,U))}t.lengthToDegrees=P;function w(z){var U=z%360;return U<0&&(U+=360),U}t.bearingToAzimuth=w;function b(z){var U=z%(2*Math.PI);return U*180/Math.PI}t.radiansToDegrees=b;function x(z){var U=z%360;return U*Math.PI/180}t.degreesToRadians=x;function A(z,U,C){if(U===void 0&&(U="kilometers"),C===void 0&&(C="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,U),C)}t.convertLength=A;function M(z,U,C){if(U===void 0&&(U="meters"),C===void 0&&(C="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[U];if(!E)throw new Error("invalid original units");var R=t.areaFactors[C];if(!R)throw new Error("invalid final units");return z/E*R}t.convertArea=M;function D(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=D;function L(z){return!!z&&z.constructor===Object}t.isObject=L;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(U){if(!D(U))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function O(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=O}(qp)),qp}var Ke={},W0;function G0(){if(W0)return Ke;W0=1,Object.defineProperty(Ke,"__esModule",{value:!0});var t=U0();function i(w,b,x){if(w!==null)for(var A,M,D,L,V,O,z,U=0,C=0,E,R=w.type,B=R==="FeatureCollection",W=R==="Feature",Y=B?w.features.length:1,q=0;q<Y;q++){z=B?w.features[q].geometry:W?w.geometry:w,E=z?z.type==="GeometryCollection":!1,V=E?z.geometries.length:1;for(var X=0;X<V;X++){var Q=0,ee=0;if(L=E?z.geometries[X]:z,L!==null){O=L.coordinates;var oe=L.type;switch(U=x&&(oe==="Polygon"||oe==="MultiPolygon")?1:0,oe){case null:break;case"Point":if(b(O,C,q,Q,ee)===!1)return!1;C++,Q++;break;case"LineString":case"MultiPoint":for(A=0;A<O.length;A++){if(b(O[A],C,q,Q,ee)===!1)return!1;C++,oe==="MultiPoint"&&Q++}oe==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(A=0;A<O.length;A++){for(M=0;M<O[A].length-U;M++){if(b(O[A][M],C,q,Q,ee)===!1)return!1;C++}oe==="MultiLineString"&&Q++,oe==="Polygon"&&ee++}oe==="Polygon"&&Q++;break;case"MultiPolygon":for(A=0;A<O.length;A++){for(ee=0,M=0;M<O[A].length;M++){for(D=0;D<O[A][M].length-U;D++){if(b(O[A][M][D],C,q,Q,ee)===!1)return!1;C++}ee++}Q++}break;case"GeometryCollection":for(A=0;A<L.geometries.length;A++)if(i(L.geometries[A],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(w,b,x,A){var M=x;return i(w,function(D,L,V,O,z){L===0&&x===void 0?M=D:M=b(M,D,L,V,O,z)},A),M}function n(w,b){var x;switch(w.type){case"FeatureCollection":for(x=0;x<w.features.length&&b(w.features[x].properties,x)!==!1;x++);break;case"Feature":b(w.properties,0);break}}function o(w,b,x){var A=x;return n(w,function(M,D){D===0&&x===void 0?A=M:A=b(A,M,D)}),A}function s(w,b){if(w.type==="Feature")b(w,0);else if(w.type==="FeatureCollection")for(var x=0;x<w.features.length&&b(w.features[x],x)!==!1;x++);}function r(w,b,x){var A=x;return s(w,function(M,D){D===0&&x===void 0?A=M:A=b(A,M,D)}),A}function l(w){var b=[];return i(w,function(x){b.push(x)}),b}function c(w,b){var x,A,M,D,L,V,O,z,U,C,E=0,R=w.type==="FeatureCollection",B=w.type==="Feature",W=R?w.features.length:1;for(x=0;x<W;x++){for(V=R?w.features[x].geometry:B?w.geometry:w,z=R?w.features[x].properties:B?w.properties:{},U=R?w.features[x].bbox:B?w.bbox:void 0,C=R?w.features[x].id:B?w.id:void 0,O=V?V.type==="GeometryCollection":!1,L=O?V.geometries.length:1,M=0;M<L;M++){if(D=O?V.geometries[M]:V,D===null){if(b(null,E,z,U,C)===!1)return!1;continue}switch(D.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(D,E,z,U,C)===!1)return!1;break}case"GeometryCollection":{for(A=0;A<D.geometries.length;A++)if(b(D.geometries[A],E,z,U,C)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function u(w,b,x){var A=x;return c(w,function(M,D,L,V,O){D===0&&x===void 0?A=M:A=b(A,M,D,L,V,O)}),A}function d(w,b){c(w,function(x,A,M,D,L){var V=x===null?null:x.type;switch(V){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,M,{bbox:D,id:L}),A,0)===!1?!1:void 0}var O;switch(V){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var z=0;z<x.coordinates.length;z++){var U=x.coordinates[z],C={type:O,coordinates:U};if(b(t.feature(C,M),A,z)===!1)return!1}})}function p(w,b,x){var A=x;return d(w,function(M,D,L){D===0&&L===0&&x===void 0?A=M:A=b(A,M,D,L)}),A}function f(w,b){d(w,function(x,A,M){var D=0;if(x.geometry){var L=x.geometry.type;if(!(L==="Point"||L==="MultiPoint")){var V,O=0,z=0,U=0;if(i(x,function(C,E,R,B,W){if(V===void 0||A>O||B>z||W>U){V=C,O=A,z=B,U=W,D=0;return}var Y=t.lineString([V,C],x.properties);if(b(Y,A,M,W,D)===!1)return!1;D++,V=C})===!1)return!1}}})}function m(w,b,x){var A=x,M=!1;return f(w,function(D,L,V,O,z){M===!1&&x===void 0?A=D:A=b(A,D,L,V,O,z),M=!0}),A}function g(w,b){if(!w)throw new Error("geojson is required");d(w,function(x,A,M){if(x.geometry!==null){var D=x.geometry.type,L=x.geometry.coordinates;switch(D){case"LineString":if(b(x,A,M,0,0)===!1)return!1;break;case"Polygon":for(var V=0;V<L.length;V++)if(b(t.lineString(L[V],x.properties),A,M,V)===!1)return!1;break}}})}function y(w,b,x){var A=x;return g(w,function(M,D,L,V){D===0&&x===void 0?A=M:A=b(A,M,D,L,V)}),A}function _(w,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,A=b.multiFeatureIndex||0,M=b.geometryIndex||0,D=b.segmentIndex||0,L=b.properties,V;switch(w.type){case"FeatureCollection":x<0&&(x=w.features.length+x),L=L||w.features[x].properties,V=w.features[x].geometry;break;case"Feature":L=L||w.properties,V=w.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":V=w;break;default:throw new Error("geojson is invalid")}if(V===null)return null;var O=V.coordinates;switch(V.type){case"Point":case"MultiPoint":return null;case"LineString":return D<0&&(D=O.length+D-1),t.lineString([O[D],O[D+1]],L,b);case"Polygon":return M<0&&(M=O.length+M),D<0&&(D=O[M].length+D-1),t.lineString([O[M][D],O[M][D+1]],L,b);case"MultiLineString":return A<0&&(A=O.length+A),D<0&&(D=O[A].length+D-1),t.lineString([O[A][D],O[A][D+1]],L,b);case"MultiPolygon":return A<0&&(A=O.length+A),M<0&&(M=O[A].length+M),D<0&&(D=O[A][M].length-D-1),t.lineString([O[A][M][D],O[A][M][D+1]],L,b)}throw new Error("geojson is invalid")}function P(w,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,A=b.multiFeatureIndex||0,M=b.geometryIndex||0,D=b.coordIndex||0,L=b.properties,V;switch(w.type){case"FeatureCollection":x<0&&(x=w.features.length+x),L=L||w.features[x].properties,V=w.features[x].geometry;break;case"Feature":L=L||w.properties,V=w.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":V=w;break;default:throw new Error("geojson is invalid")}if(V===null)return null;var O=V.coordinates;switch(V.type){case"Point":return t.point(O,L,b);case"MultiPoint":return A<0&&(A=O.length+A),t.point(O[A],L,b);case"LineString":return D<0&&(D=O.length+D),t.point(O[D],L,b);case"Polygon":return M<0&&(M=O.length+M),D<0&&(D=O[M].length+D),t.point(O[M][D],L,b);case"MultiLineString":return A<0&&(A=O.length+A),D<0&&(D=O[A].length+D),t.point(O[A][D],L,b);case"MultiPolygon":return A<0&&(A=O.length+A),M<0&&(M=O[A].length+M),D<0&&(D=O[A][M].length-D),t.point(O[A][M][D],L,b)}throw new Error("geojson is invalid")}return Ke.coordAll=l,Ke.coordEach=i,Ke.coordReduce=e,Ke.featureEach=s,Ke.featureReduce=r,Ke.findPoint=P,Ke.findSegment=_,Ke.flattenEach=d,Ke.flattenReduce=p,Ke.geomEach=c,Ke.geomReduce=u,Ke.lineEach=g,Ke.lineReduce=y,Ke.propEach=n,Ke.propReduce=o,Ke.segmentEach=f,Ke.segmentReduce=m,Ke}var mh={},H0;function jM(){if(H0)return mh;H0=1,Object.defineProperty(mh,"__esModule",{value:!0});var t=G0();function i(e){var n=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){n[0]>o[0]&&(n[0]=o[0]),n[1]>o[1]&&(n[1]=o[1]),n[2]<o[0]&&(n[2]=o[0]),n[3]<o[1]&&(n[3]=o[1])}),n}return i.default=i,mh.default=i,mh}var q0;function eI(){if(q0)return gh.exports;q0=1;var t=$M(),i=U0(),e=G0(),n=jM().default,o=e.featureEach;e.coordEach,i.polygon;var s=i.featureCollection;function r(l){var c=new t(l);return c.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),t.prototype.insert.call(this,u)},c.load=function(u){var d=[];return Array.isArray(u)?u.forEach(function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),d.push(p)}):o(u,function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),d.push(p)}),t.prototype.load.call(this,d)},c.remove=function(u,d){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),t.prototype.remove.call(this,u,d)},c.clear=function(){return t.prototype.clear.call(this)},c.search=function(u){var d=t.prototype.search.call(this,this.toBBox(u));return s(d)},c.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},c.all=function(){var u=t.prototype.all.call(this);return s(u)},c.toJSON=function(){return t.prototype.toJSON.call(this)},c.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},c.toBBox=function(u){var d;if(u.bbox)d=u.bbox;else if(Array.isArray(u)&&u.length===4)d=u;else if(Array.isArray(u)&&u.length===6)d=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")d=n(u);else if(u.type==="FeatureCollection")d=n(u);else throw new Error("invalid geojson");return{minX:d[0],minY:d[1],maxX:d[2],maxY:d[3]}},c}return gh.exports=r,gh.exports.default=r,gh.exports}var tI=eI();const iI=dc(tI);function $p(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Ai(t)),i.type==="LineString"&&(i=Ai(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=$0(t,i);return o&&n.push(o),Ti(n)}var s=iI();return s.load(B0(i)),dh(B0(t),function(r){dh(s.search(r),function(l){var c=$0(r,l);if(c){var u=Mi(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ti(n)}function $0(t,i){var e=Mi(t),n=Mi(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),m=(d-c)*(s-u)-(p-u)*(o-c),g=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=m/f,_=g/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),w=s+y*(l-s);return zn([P,w])}return null}function vh(t,i,e){e===void 0&&(e={});for(var n=hh(t),o=Mi(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),nI(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function nI(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,m=u-l,g=d-c,y=p*g-f*m;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(m)>=Math.abs(g)?m>0?l<s&&s<=u:u<=s&&s<l:g>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(m)>=Math.abs(g)?m>0?l<=s&&s<u:u<s&&s<=l:g>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(m)>=Math.abs(g)?m>0?l<s&&s<u:u<s&&s<l:g>0?c<r&&r<d:d<r&&r<c}else return Math.abs(m)>=Math.abs(g)?m>0?l<=s&&s<=u:u<=s&&s<=l:g>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function oI(t,i){var e=Ii(t),n=Ii(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return sI(e,n);case"LineString":return vh(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ct(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return rI(e,n);case"LineString":return aI(e,n);case"Polygon":case"MultiPolygon":return lI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return cI(e,n);case"Polygon":case"MultiPolygon":return hI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return uI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function sI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(Y0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function rI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)Y0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function aI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!vh(t.coordinates[n],i))return!1;e||(e=vh(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function lI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Ct(t.coordinates[1],i),!n){e=!1;break}n=Ct(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function cI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!vh(t.coordinates[e],i))return!1;return!0}function hI(t,i){var e=To(i),n=To(t);if(!X0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!Ct(t.coordinates[s],i))return!1;if(o||(o=Ct(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=dI(t.coordinates[s],t.coordinates[s+1]);o=Ct(r,i,{ignoreBoundary:!0})}}return o}function uI(t,i){var e=To(t),n=To(i);if(!X0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Ct(t.coordinates[0][o],i))return!1;return!0}function X0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function Y0(t,i){return t[0]===i[0]&&t[1]===i[1]}function dI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function Z0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Di([o,s],[r,s],e),u=c*(r-o),d=i/Di([o,s],[o,l],e),p=d*(l-s),f=r-o,m=l-s,g=Math.floor(f/u),y=Math.floor(m/p),_=(f-g*u)/2,P=(m-y*p)/2,w=o+_;w<=r;){for(var b=s+P;b<=l;){var x=zn([w,b],e.properties);e.mask?oI(x,e.mask)&&n.push(x):n.push(x),b+=p}w+=u}return Ti(n)}function Xp(t,i){i===void 0&&(i={});var e=Ii(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return pI(e,i);case"MultiPolygon":return fI(e,i);default:throw new Error("invalid poly")}}function pI(t,i){i===void 0&&(i={});var e=Ii(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return Q0(n,o)}function fI(t,i){i===void 0&&(i={});var e=Ii(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(Q0(r,o))}),Ti(s)}function Q0(t,i){return t.length>1?pM(t,i):lh(t[0],i)}var Yp,k0;function K0(){if(k0)return Yp;k0=1;var t=Object.prototype.toString;return Yp=function(e){var n=t.call(e),o=n==="[object Arguments]";return o||(o=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Yp}var Zp,J0;function gI(){if(J0)return Zp;J0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=K0(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var m=f.constructor;return m&&m.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(m){var g=m!==null&&typeof m=="object",y=e.call(m)==="[object Function]",_=n(m),P=g&&e.call(m)==="[object String]",w=[];if(!g&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var b=r&&y;if(P&&m.length>0&&!i.call(m,0))for(var x=0;x<m.length;++x)w.push(String(x));if(_&&m.length>0)for(var A=0;A<m.length;++A)w.push(String(A));else for(var M in m)!(b&&M==="prototype")&&i.call(m,M)&&w.push(String(M));if(s)for(var D=p(m),L=0;L<l.length;++L)!(D&&l[L]==="constructor")&&i.call(m,l[L])&&w.push(l[L]);return w}}return Zp=t,Zp}var Qp,j0;function ew(){if(j0)return Qp;j0=1;var t=Array.prototype.slice,i=K0(),e=Object.keys,n=e?function(r){return e(r)}:gI(),o=Object.keys;return n.shim=function(){if(Object.keys){var r=function(){var l=Object.keys(arguments);return l&&l.length===arguments.length}(1,2);r||(Object.keys=function(c){return i(c)?o(t.call(c)):o(c)})}else Object.keys=n;return Object.keys||n},Qp=n,Qp}var kp,tw;function iw(){return tw||(tw=1,kp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0}),kp}var Kp,nw;function Jp(){if(nw)return Kp;nw=1;var t=iw();return Kp=function(){return t()&&!!Symbol.toStringTag},Kp}var jp,ow;function sw(){return ow||(ow=1,jp=Object),jp}var ef,rw;function aw(){return rw||(rw=1,ef=Error),ef}var tf,lw;function mI(){return lw||(lw=1,tf=EvalError),tf}var nf,cw;function vI(){return cw||(cw=1,nf=RangeError),nf}var of,hw;function yI(){return hw||(hw=1,of=ReferenceError),of}var sf,uw;function dw(){return uw||(uw=1,sf=SyntaxError),sf}var rf,pw;function Bs(){return pw||(pw=1,rf=TypeError),rf}var af,fw;function wI(){return fw||(fw=1,af=URIError),af}var lf,gw;function CI(){return gw||(gw=1,lf=Math.abs),lf}var cf,mw;function _I(){return mw||(mw=1,cf=Math.floor),cf}var hf,vw;function PI(){return vw||(vw=1,hf=Math.max),hf}var uf,yw;function bI(){return yw||(yw=1,uf=Math.min),uf}var df,ww;function SI(){return ww||(ww=1,df=Math.pow),df}var pf,Cw;function xI(){return Cw||(Cw=1,pf=Math.round),pf}var ff,_w;function EI(){return _w||(_w=1,ff=Number.isNaN||function(i){return i!==i}),ff}var gf,Pw;function AI(){if(Pw)return gf;Pw=1;var t=EI();return gf=function(e){return t(e)||e===0?e:e<0?-1:1},gf}var mf,bw;function TI(){return bw||(bw=1,mf=Object.getOwnPropertyDescriptor),mf}var vf,Sw;function Vs(){if(Sw)return vf;Sw=1;var t=TI();if(t)try{t([],"length")}catch{t=null}return vf=t,vf}var yf,xw;function yh(){if(xw)return yf;xw=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return yf=t,yf}var wf,Ew;function MI(){if(Ew)return wf;Ew=1;var t=typeof Symbol<"u"&&Symbol,i=iw();return wf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},wf}var Cf,Aw;function Tw(){return Aw||(Aw=1,Cf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Cf}var _f,Mw;function Iw(){if(Mw)return _f;Mw=1;var t=sw();return _f=t.getPrototypeOf||null,_f}var Pf,Dw;function II(){if(Dw)return Pf;Dw=1;var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,e=Math.max,n="[object Function]",o=function(c,u){for(var d=[],p=0;p<c.length;p+=1)d[p]=c[p];for(var f=0;f<u.length;f+=1)d[f+c.length]=u[f];return d},s=function(c,u){for(var d=[],p=u,f=0;p<c.length;p+=1,f+=1)d[f]=c[p];return d},r=function(l,c){for(var u="",d=0;d<l.length;d+=1)u+=l[d],d+1<l.length&&(u+=c);return u};return Pf=function(c){var u=this;if(typeof u!="function"||i.apply(u)!==n)throw new TypeError(t+u);for(var d=s(arguments,1),p,f=function(){if(this instanceof p){var P=u.apply(this,o(d,arguments));return Object(P)===P?P:this}return u.apply(c,o(d,arguments))},m=e(0,u.length-d.length),g=[],y=0;y<m;y++)g[y]="$"+y;if(p=Function("binder","return function ("+r(g,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var _=function(){};_.prototype=u.prototype,p.prototype=new _,_.prototype=null}return p},Pf}var bf,Rw;function Gr(){if(Rw)return bf;Rw=1;var t=II();return bf=Function.prototype.bind||t,bf}var Sf,Fw;function xf(){return Fw||(Fw=1,Sf=Function.prototype.call),Sf}var Ef,zw;function Af(){return zw||(zw=1,Ef=Function.prototype.apply),Ef}var Tf,Lw;function DI(){return Lw||(Lw=1,Tf=typeof Reflect<"u"&&Reflect&&Reflect.apply),Tf}var Mf,Ow;function Nw(){if(Ow)return Mf;Ow=1;var t=Gr(),i=Af(),e=xf(),n=DI();return Mf=n||t.call(e,i),Mf}var If,Bw;function Df(){if(Bw)return If;Bw=1;var t=Gr(),i=Bs(),e=xf(),n=Nw();return If=function(s){if(s.length<1||typeof s[0]!="function")throw new i("a function is required");return n(t,e,s)},If}var Rf,Vw;function RI(){if(Vw)return Rf;Vw=1;var t=Df(),i=Vs(),e;try{e=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var n=!!e&&i&&i(Object.prototype,"__proto__"),o=Object,s=o.getPrototypeOf;return Rf=n&&typeof n.get=="function"?t([n.get]):typeof s=="function"?function(l){return s(l==null?l:o(l))}:!1,Rf}var Ff,Uw;function Ww(){if(Uw)return Ff;Uw=1;var t=Tw(),i=Iw(),e=RI();return Ff=t?function(o){return t(o)}:i?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return i(o)}:e?function(o){return e(o)}:null,Ff}var zf,Gw;function Hw(){if(Gw)return zf;Gw=1;var t=Function.prototype.call,i=Object.prototype.hasOwnProperty,e=Gr();return zf=e.call(t,i),zf}var Lf,qw;function $w(){if(qw)return Lf;qw=1;var t,i=sw(),e=aw(),n=mI(),o=vI(),s=yI(),r=dw(),l=Bs(),c=wI(),u=CI(),d=_I(),p=PI(),f=bI(),m=SI(),g=xI(),y=AI(),_=Function,P=function(ge){try{return _('"use strict"; return ('+ge+").constructor;")()}catch{}},w=Vs(),b=yh(),x=function(){throw new l},A=w?function(){try{return arguments.callee,x}catch{try{return w(arguments,"callee").get}catch{return x}}}():x,M=MI()(),D=Ww(),L=Iw(),V=Tw(),O=Af(),z=xf(),U={},C=typeof Uint8Array>"u"||!D?t:D(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":M&&D?D([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&D?D(D([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!D?t:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!D?t:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&D?D(""[Symbol.iterator]()):t,"%Symbol%":M?Symbol:t,"%SyntaxError%":r,"%ThrowTypeError%":A,"%TypedArray%":C,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":z,"%Function.prototype.apply%":O,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":L,"%Math.abs%":u,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":y,"%Reflect.getPrototypeOf%":V};if(D)try{null.error}catch(ge){var R=D(D(ge));E["%Error.prototype%"]=R}var B=function ge(ie){var ce;if(ie==="%AsyncFunction%")ce=P("async function () {}");else if(ie==="%GeneratorFunction%")ce=P("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ce=P("async function* () {}");else if(ie==="%AsyncGenerator%"){var he=ge("%AsyncGeneratorFunction%");he&&(ce=he.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var Ee=ge("%AsyncGenerator%");Ee&&D&&(ce=D(Ee.prototype))}return E[ie]=ce,ce},W={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Y=Gr(),q=Hw(),X=Y.call(z,Array.prototype.concat),Q=Y.call(O,Array.prototype.splice),ee=Y.call(z,String.prototype.replace),oe=Y.call(z,String.prototype.slice),fe=Y.call(z,RegExp.prototype.exec),ve=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xe=/\\(\\)?/g,Oe=function(ie){var ce=oe(ie,0,1),he=oe(ie,-1);if(ce==="%"&&he!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(he==="%"&&ce!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Ee=[];return ee(ie,ve,function(Ne,Ot,st,Oh){Ee[Ee.length]=st?ee(Oh,xe,"$1"):Ot||Ne}),Ee},Ue=function(ie,ce){var he=ie,Ee;if(q(W,he)&&(Ee=W[he],he="%"+Ee[0]+"%"),q(E,he)){var Ne=E[he];if(Ne===U&&(Ne=B(he)),typeof Ne>"u"&&!ce)throw new l("intrinsic "+ie+" exists, but is not available. Please file an issue!");return{alias:Ee,name:he,value:Ne}}throw new r("intrinsic "+ie+" does not exist!")};return Lf=function(ie,ce){if(typeof ie!="string"||ie.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new l('"allowMissing" argument must be a boolean');if(fe(/^%?[^%]*%?$/,ie)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var he=Oe(ie),Ee=he.length>0?he[0]:"",Ne=Ue("%"+Ee+"%",ce),Ot=Ne.name,st=Ne.value,Oh=!1,am=Ne.alias;am&&(Ee=am[0],Q(he,X([0,1],am)));for(var Nh=1,Zl=!0;Nh<he.length;Nh+=1){var an=he[Nh],Bh=oe(an,0,1),Vh=oe(an,-1);if((Bh==='"'||Bh==="'"||Bh==="`"||Vh==='"'||Vh==="'"||Vh==="`")&&Bh!==Vh)throw new r("property names with quotes must have matching quotes");if((an==="constructor"||!Zl)&&(Oh=!0),Ee+="."+an,Ot="%"+Ee+"%",q(E,Ot))st=E[Ot];else if(st!=null){if(!(an in st)){if(!ce)throw new l("base intrinsic for "+ie+" exists, but the property is not available.");return}if(w&&Nh+1>=he.length){var Uh=w(st,an);Zl=!!Uh,Zl&&"get"in Uh&&!("originalValue"in Uh.get)?st=Uh.get:st=st[an]}else Zl=q(st,an),st=st[an];Zl&&!Oh&&(E[Ot]=st)}}return st},Lf}var Of,Xw;function Nf(){if(Xw)return Of;Xw=1;var t=$w(),i=Df(),e=i([t("%String.prototype.indexOf%")]);return Of=function(o,s){var r=t(o,!!s);return typeof r=="function"&&e(o,".prototype.")>-1?i([r]):r},Of}var Bf,Yw;function FI(){if(Yw)return Bf;Yw=1;var t=Jp()(),i=Nf(),e=i("Object.prototype.toString"),n=function(l){return t&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:e(l)==="[object Arguments]"},o=function(l){return n(l)?!0:l!==null&&typeof l=="object"&&"length"in l&&typeof l.length=="number"&&l.length>=0&&e(l)!=="[object Array]"&&"callee"in l&&e(l.callee)==="[object Function]"},s=function(){return n(arguments)}();return n.isLegacyArguments=o,Bf=s?n:o,Bf}var Vf,Zw;function Uf(){if(Zw)return Vf;Zw=1;var t=yh(),i=dw(),e=Bs(),n=Vs();return Vf=function(s,r,l){if(!s||typeof s!="object"&&typeof s!="function")throw new e("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,f=!!n&&n(s,r);if(t)t(s,r,{configurable:d===null&&f?f.configurable:!d,enumerable:c===null&&f?f.enumerable:!c,value:l,writable:u===null&&f?f.writable:!u});else if(p||!c&&!u&&!d)s[r]=l;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Vf}var Wf,Qw;function Gf(){if(Qw)return Wf;Qw=1;var t=yh(),i=function(){return!!t};return i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Wf=i,Wf}var Hf,kw;function Hr(){if(kw)return Hf;kw=1;var t=ew(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,n=Array.prototype.concat,o=Uf(),s=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},r=Gf()(),l=function(u,d,p,f){if(d in u){if(f===!0){if(u[d]===p)return}else if(!s(f)||!f())return}r?o(u,d,p,!0):o(u,d,p)},c=function(u,d){var p=arguments.length>2?arguments[2]:{},f=t(d);i&&(f=n.call(f,Object.getOwnPropertySymbols(d)));for(var m=0;m<f.length;m+=1)l(u,f[m],d[f[m]],p[f[m]])};return c.supportsDescriptors=!!r,Hf=c,Hf}var qf={exports:{}},$f,Kw;function zI(){if(Kw)return $f;Kw=1;var t=$w(),i=Uf(),e=Gf()(),n=Vs(),o=Bs(),s=t("%Math.floor%");return $f=function(l,c){if(typeof l!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],d=!0,p=!0;if("length"in l&&n){var f=n(l,"length");f&&!f.configurable&&(d=!1),f&&!f.writable&&(p=!1)}return(d||p||!u)&&(e?i(l,"length",c,!0,!0):i(l,"length",c)),l},$f}var Xf,Jw;function LI(){if(Jw)return Xf;Jw=1;var t=Gr(),i=Af(),e=Nw();return Xf=function(){return e(t,i,arguments)},Xf}var jw;function eC(){return jw||(jw=1,function(t){var i=zI(),e=yh(),n=Df(),o=LI();t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o}(qf)),qf.exports}var Yf,tC;function iC(){if(tC)return Yf;tC=1;var t=function(i){return i!==i};return Yf=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||t(e)&&t(n))},Yf}var Zf,nC;function oC(){if(nC)return Zf;nC=1;var t=iC();return Zf=function(){return typeof Object.is=="function"?Object.is:t},Zf}var Qf,sC;function OI(){if(sC)return Qf;sC=1;var t=oC(),i=Hr();return Qf=function(){var n=t();return i(Object,{is:n},{is:function(){return Object.is!==n}}),n},Qf}var kf,rC;function NI(){if(rC)return kf;rC=1;var t=Hr(),i=eC(),e=iC(),n=oC(),o=OI(),s=i(n(),Object);return t(s,{getPolyfill:n,implementation:e,shim:o}),kf=s,kf}var Kf,aC;function BI(){if(aC)return Kf;aC=1;var t=Nf(),i=Jp()(),e=Hw(),n=Vs(),o;if(i){var s=t("RegExp.prototype.exec"),r={},l=function(){throw r},c={toString:l,valueOf:l};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=l),o=function(f){if(!f||typeof f!="object")return!1;var m=n(f,"lastIndex"),g=m&&e(m,"value");if(!g)return!1;try{s(f,c)}catch(y){return y===r}}}else{var u=t("Object.prototype.toString"),d="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===d}}return Kf=o,Kf}var Jf,lC;function VI(){if(lC)return Jf;lC=1;var t=function(){return typeof(function(){}).name=="string"},i=Object.getOwnPropertyDescriptor;if(i)try{i([],"length")}catch{i=null}t.functionsHaveConfigurableNames=function(){if(!t()||!i)return!1;var o=i(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Jf=t,Jf}var jf,cC;function UI(){if(cC)return jf;cC=1;var t=Uf(),i=Gf()(),e=VI().functionsHaveConfigurableNames(),n=Bs();return jf=function(s,r){if(typeof s!="function")throw new n("`fn` is not a function");var l=arguments.length>2&&!!arguments[2];return(!l||e)&&(i?t(s,"name",r,!0,!0):t(s,"name",r)),s},jf}var eg,hC;function uC(){if(hC)return eg;hC=1;var t=UI(),i=Bs(),e=Object;return eg=t(function(){if(this==null||this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),eg}var tg,dC;function pC(){if(dC)return tg;dC=1;var t=uC(),i=Hr().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return tg=function(){if(i&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var s="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){s+="d"}}),Object.defineProperty(r,"sticky",{get:function(){s+="y"}}),o.get.call(r),s==="dy")return o.get}}return t},tg}var ig,fC;function WI(){if(fC)return ig;fC=1;var t=Hr().supportsDescriptors,i=pC(),e=Vs(),n=Object.defineProperty,o=aw(),s=Ww(),r=/a/;return ig=function(){if(!t||!s)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=i(),u=s(r),d=e(u,"flags");return(!d||d.get!==c)&&n(u,"flags",{configurable:!0,enumerable:!1,get:c}),c},ig}var ng,gC;function GI(){if(gC)return ng;gC=1;var t=Hr(),i=eC(),e=uC(),n=pC(),o=WI(),s=i(n());return t(s,{getPolyfill:n,implementation:e,shim:o}),ng=s,ng}var og,mC;function HI(){if(mC)return og;mC=1;var t=Nf(),i=t("Date.prototype.getDay"),e=function(l){try{return i(l),!0}catch{return!1}},n=t("Object.prototype.toString"),o="[object Date]",s=Jp()();return og=function(l){return typeof l!="object"||l===null?!1:s?e(l):n(l)===o},og}var sg,vC;function qI(){if(vC)return sg;vC=1;var t=ew(),i=FI(),e=NI(),n=BI(),o=GI(),s=HI(),r=Date.prototype.getTime;function l(p,f,m){var g=m||{};return(g.strict?e(p,f):p===f)?!0:!p||!f||typeof p!="object"&&typeof f!="object"?g.strict?e(p,f):p==f:d(p,f,g)}function c(p){return p==null}function u(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function d(p,f,m){var g,y;if(typeof p!=typeof f||c(p)||c(f)||p.prototype!==f.prototype||i(p)!==i(f))return!1;var _=n(p),P=n(f);if(_!==P)return!1;if(_||P)return p.source===f.source&&o(p)===o(f);if(s(p)&&s(f))return r.call(p)===r.call(f);var w=u(p),b=u(f);if(w!==b)return!1;if(w||b){if(p.length!==f.length)return!1;for(g=0;g<p.length;g++)if(p[g]!==f[g])return!1;return!0}if(typeof p!=typeof f)return!1;try{var x=t(p),A=t(f)}catch{return!1}if(x.length!==A.length)return!1;for(x.sort(),A.sort(),g=x.length-1;g>=0;g--)if(x[g]!=A[g])return!1;for(g=x.length-1;g>=0;g--)if(y=x[g],!l(p[y],f[y],m))return!1;return!0}return sg=l,sg}function $I(t,i){var e=!0;return Fs(t,function(n){Fs(i,function(o){if(e===!1)return!1;e=XI(n.geometry,o.geometry)})}),e}function XI(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!kI(t.coordinates,i.coordinates);case"LineString":return!yC(i,t);case"Polygon":return!Ct(t,i)}break;case"LineString":switch(i.type){case"Point":return!yC(t,i);case"LineString":return!YI(t,i);case"Polygon":return!wC(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Ct(i,t);case"LineString":return!wC(t,i);case"Polygon":return!ZI(i,t)}}return!1}function yC(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(QI(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function YI(t,i){var e=$p(t,i);return e.features.length>0}function wC(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Ct(o,t))return!0}var s=$p(i,Xp(t));return s.features.length>0}function ZI(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Ct(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(Ct(l,t))return!0}var c=$p(Xp(t),Xp(i));return c.features.length>0}function QI(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function kI(t,i){return t[0]===i[0]&&t[1]===i[1]}var rg,CC;function KI(){if(CC)return rg;CC=1;var t=qI(),i=function(s){this.precision=s&&s.precision?s.precision:17,this.direction=s&&s.direction?s.direction:!1,this.pseudoNode=s&&s.pseudoNode?s.pseudoNode:!1,this.objectComparator=s&&s.objectComparator?s.objectComparator:o};i.prototype.compare=function(s,r){if(s.type!==r.type||!n(s,r))return!1;switch(s.type){case"Point":return this.compareCoord(s.coordinates,r.coordinates);case"LineString":return this.compareLine(s.coordinates,r.coordinates,0,!1);case"Polygon":return this.comparePolygon(s,r);case"Feature":return this.compareFeature(s,r);default:if(s.type.indexOf("Multi")===0){var l=this,c=e(s),u=e(r);return c.every(function(d){return this.some(function(p){return l.compare(d,p)})},u)}}return!1};function e(s){return s.coordinates.map(function(r){return{type:s.type.replace("Multi",""),coordinates:r}})}function n(s,r){return s.hasOwnProperty("coordinates")?s.coordinates.length===r.coordinates.length:s.length===r.length}i.prototype.compareCoord=function(s,r){if(s.length!==r.length)return!1;for(var l=0;l<s.length;l++)if(s[l].toFixed(this.precision)!==r[l].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(s,r,l,c){if(!n(s,r))return!1;var u=this.pseudoNode?s:this.removePseudo(s),d=this.pseudoNode?r:this.removePseudo(r);if(!(c&&!this.compareCoord(u[0],d[0])&&(d=this.fixStartIndex(d,u),!d))){var p=this.compareCoord(u[l],d[l]);return this.direction||p?this.comparePath(u,d):this.compareCoord(u[l],d[d.length-(1+l)])?this.comparePath(u.slice().reverse(),d):!1}},i.prototype.fixStartIndex=function(s,r){for(var l,c=-1,u=0;u<s.length;u++)if(this.compareCoord(s[u],r[0])){c=u;break}return c>=0&&(l=[].concat(s.slice(c,s.length),s.slice(1,c+1))),l},i.prototype.comparePath=function(s,r){var l=this;return s.every(function(c,u){return l.compareCoord(c,this[u])},r)},i.prototype.comparePolygon=function(s,r){if(this.compareLine(s.coordinates[0],r.coordinates[0],1,!0)){var l=s.coordinates.slice(1,s.coordinates.length),c=r.coordinates.slice(1,r.coordinates.length),u=this;return l.every(function(d){return this.some(function(p){return u.compareLine(d,p,1,!0)})},c)}else return!1},i.prototype.compareFeature=function(s,r){return s.id!==r.id||!this.objectComparator(s.properties,r.properties)||!this.compareBBox(s,r)?!1:this.compare(s.geometry,r.geometry)},i.prototype.compareBBox=function(s,r){return!!(!s.bbox&&!r.bbox||s.bbox&&r.bbox&&this.compareCoord(s.bbox,r.bbox))},i.prototype.removePseudo=function(s){return s};function o(s,r){return t(s,r,{strict:!0})}return rg=i,rg}var JI=KI();const jI=dc(JI);function eD(t,i){var e=Ii(t).type,n=Ii(i).type;if(e!==n)return!1;var o=new jI({precision:6});return o.compare(L0(t),L0(i))}function tD(t,i){var e=!1;return Fs(t,function(n){Fs(i,function(o){if(e===!0)return!0;e=!$I(n.geometry,o.geometry)})}),e}/**
|
|
1857
|
+
`,$n=class $n extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const m=$n.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],g=>g??m.loop,g=>g??m.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],g=>g??m.currentTime,g=>g??m.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],g=>g??m.duration,g=>g??m.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],g=>g??m.playing,g=>g??m.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],g=>g??m.speed,g=>g??m.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async m=>{this.routePaths=void 0;const g=o.value;if(g)try{const _=await(await fetch(g)).json();this.routePaths=xM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const m=()=>{s.restart()};m();const g=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(g.disposableOn(m))}{const m=()=>{const g=uu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);g&&(this.routePathCallback=g)};m(),this.dispose(this.routePathCallbackStrChanged.disposableOn(m))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new Qo),u=this.disposeVar(a.createProcessingFromAsyncFunc(async m=>{if(!l.value)return;const g=iv(r.scene.context).getTextureHandler(l.value);if(g instanceof Qo)c.reset(g);else{const y=await m.promise(g);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new WM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(m=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))se(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,m);else{const g=computeBoundingSphere(this.routePaths[0].positions);if(!g)return;const[y,_]=g;se(r,y,_*3,void 0,m)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v($n,"whiteGradientImageBase64",GM),v($n,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v($n,"routePathCallbackStrMd",HM),v($n,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v($n,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let Qi=$n;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Qi||(Qi={})),a.extendClassProps(Qi.prototype,Qi.createDefaultProps);class ki extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new Qi(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(ki,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(ki,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(ki||(ki={})),a.extendClassProps(ki.prototype,ki.createDefaultProps);const ml=class ml extends mt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new ki(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}};v(ml,"type",ml.register("ESCesiumViewer",oh.type,ml));let Wp=ml;function To(t){var i=[1/0,1/0,-1/0,-1/0];return uh(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}To.default=To;const Ki=11102230246251565e-32,vt=134217729,qM=(3+8*Ki)*Ki;function Gp(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let m=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[m++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[m++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[m++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[m++]=l);return(s!==0||m===0)&&(o[m++]=s),m}function $M(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function Gr(t){return new Float64Array(t)}const XM=(3+16*Ki)*Ki,YM=(2+12*Ki)*Ki,ZM=(9+64*Ki)*Ki*Ki,Bs=Gr(4),I0=Gr(8),D0=Gr(12),R0=Gr(16),Ct=Gr(4);function QM(t,i,e,n,o,s,r){let l,c,u,d,p,f,m,g,y,_,P,w,b,x,A,M,D,L;const V=t-o,O=e-o,z=i-s,U=n-s;x=V*U,f=vt*V,m=f-(f-V),g=V-m,f=vt*U,y=f-(f-U),_=U-y,A=g*_-(x-m*y-g*y-m*_),M=z*O,f=vt*z,m=f-(f-z),g=z-m,f=vt*O,y=f-(f-O),_=O-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,Bs[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,Bs[1]=b-(P+p)+(p-M),L=w+P,p=L-w,Bs[2]=w-(L-p)+(P-p),Bs[3]=L;let C=$M(4,Bs),E=YM*r;if(C>=E||-C>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-O,u=e-(O+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-U,d=n-(U+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=ZM*r+qM*Math.abs(C),C+=V*d+U*l-(z*u+O*c),C>=E||-C>=E))return C;x=l*U,f=vt*l,m=f-(f-l),g=l-m,f=vt*U,y=f-(f-U),_=U-y,A=g*_-(x-m*y-g*y-m*_),M=c*O,f=vt*c,m=f-(f-c),g=c-m,f=vt*O,y=f-(f-O),_=O-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,Ct[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,Ct[1]=b-(P+p)+(p-M),L=w+P,p=L-w,Ct[2]=w-(L-p)+(P-p),Ct[3]=L;const R=Gp(4,Bs,4,Ct,I0);x=V*d,f=vt*V,m=f-(f-V),g=V-m,f=vt*d,y=f-(f-d),_=d-y,A=g*_-(x-m*y-g*y-m*_),M=z*u,f=vt*z,m=f-(f-z),g=z-m,f=vt*u,y=f-(f-u),_=u-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,Ct[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,Ct[1]=b-(P+p)+(p-M),L=w+P,p=L-w,Ct[2]=w-(L-p)+(P-p),Ct[3]=L;const B=Gp(R,I0,4,Ct,D0);x=l*d,f=vt*l,m=f-(f-l),g=l-m,f=vt*d,y=f-(f-d),_=d-y,A=g*_-(x-m*y-g*y-m*_),M=c*u,f=vt*c,m=f-(f-c),g=c-m,f=vt*u,y=f-(f-u),_=u-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,Ct[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,Ct[1]=b-(P+p)+(p-M),L=w+P,p=L-w,Ct[2]=w-(L-p)+(P-p),Ct[3]=L;const W=Gp(B,D0,4,Ct,R0);return R0[W-1]}function kM(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=XM*u?c:-QM(t,i,e,n,o,s,u)}function _t(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=hh(t),o=Ii(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&KM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(F0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)F0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function F0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function KM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function JM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return z0(t);case"FeatureCollection":return jM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Hp(t);default:throw new Error("unknown GeoJSON type")}}function z0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=L0(t.properties),i.geometry=Hp(t.geometry),i}function L0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=L0(n):i[e]=n}),i}function jM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return z0(e)}),i}function Hp(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return Hp(e)}),i):(i.coordinates=O0(t.coordinates),i)}function O0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return O0(e)})}function N0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=vM(t),o=[];switch(n){case"LineString":o=qp(t);break;case"MultiLineString":case"Polygon":Mi(t).forEach(function(r){o.push(qp(r))});break;case"MultiPolygon":Mi(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(qp(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Mi(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ai({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function qp(t){var i=Mi(t);if(i.length===2&&!B0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&V0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,B0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return V0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function B0(t,i){return t[0]===i[0]&&t[1]===i[1]}function V0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,m=u*f-d*p;return m!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function eI(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return uh(t,function(s){e+=s[0],n+=s[1],o++},!0),zn([e/o,n/o],i.properties)}function U0(t){if(!t)throw new Error("geojson is required");var i=[];return Fs(t,function(e){tI(e,i)}),Ti(i)}function tI(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Mi(n);break;case"LineString":e=[Mi(n)]}e.forEach(function(o){var s=iI(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function iI(t,i){var e=[];return t.reduce(function(n,o){var s=lh([n,o],i);return s.bbox=nI(n,o),e.push(s),o}),e}function nI(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var fh={exports:{}},gh={exports:{}},oI=gh.exports,W0;function sI(){return W0||(W0=1,(function(t,i){(function(e,n){t.exports=n()})(oI,function(){function e(w,b,x,A,M){(function D(L,V,O,z,U){for(;z>O;){if(z-O>600){var C=z-O+1,E=V-O+1,R=Math.log(C),B=.5*Math.exp(2*R/3),W=.5*Math.sqrt(R*B*(C-B)/C)*(E-C/2<0?-1:1),Y=Math.max(O,Math.floor(V-E*B/C+W)),q=Math.min(z,Math.floor(V+(C-E)*B/C+W));D(L,V,Y,q,U)}var X=L[V],Q=O,ee=z;for(n(L,O,V),U(L[z],X)>0&&n(L,O,z);Q<ee;){for(n(L,Q,ee),Q++,ee--;U(L[Q],X)<0;)Q++;for(;U(L[ee],X)>0;)ee--}U(L[O],X)===0?n(L,O,ee):n(L,++ee,z),ee<=V&&(O=ee+1),V<=ee&&(z=ee-1)}})(w,b,x||0,A||w.length-1,M||o)}function n(w,b,x){var A=w[b];w[b]=w[x],w[x]=A}function o(w,b){return w<b?-1:w>b?1:0}var s=function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(w,b,x){if(!x)return b.indexOf(w);for(var A=0;A<b.length;A++)if(x(w,b[A]))return A;return-1}function l(w,b){c(w,0,w.children.length,b,w)}function c(w,b,x,A,M){M||(M=_(null)),M.minX=1/0,M.minY=1/0,M.maxX=-1/0,M.maxY=-1/0;for(var D=b;D<x;D++){var L=w.children[D];u(M,w.leaf?A(L):L)}return M}function u(w,b){return w.minX=Math.min(w.minX,b.minX),w.minY=Math.min(w.minY,b.minY),w.maxX=Math.max(w.maxX,b.maxX),w.maxY=Math.max(w.maxY,b.maxY),w}function d(w,b){return w.minX-b.minX}function p(w,b){return w.minY-b.minY}function f(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function m(w){return w.maxX-w.minX+(w.maxY-w.minY)}function g(w,b){return w.minX<=b.minX&&w.minY<=b.minY&&b.maxX<=w.maxX&&b.maxY<=w.maxY}function y(w,b){return b.minX<=w.maxX&&b.minY<=w.maxY&&b.maxX>=w.minX&&b.maxY>=w.minY}function _(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(w,b,x,A,M){for(var D=[b,x];D.length;)if(!((x=D.pop())-(b=D.pop())<=A)){var L=b+Math.ceil((x-b)/A/2)*A;e(w,L,b,x,M),D.push(b,L,L,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(w){var b=this.data,x=[];if(!y(w,b))return x;for(var A=this.toBBox,M=[];b;){for(var D=0;D<b.children.length;D++){var L=b.children[D],V=b.leaf?A(L):L;y(w,V)&&(b.leaf?x.push(L):g(w,V)?this._all(L,x):M.push(L))}b=M.pop()}return x},s.prototype.collides=function(w){var b=this.data;if(!y(w,b))return!1;for(var x=[];b;){for(var A=0;A<b.children.length;A++){var M=b.children[A],D=b.leaf?this.toBBox(M):M;if(y(w,D)){if(b.leaf||g(w,D))return!0;x.push(M)}}b=x.pop()}return!1},s.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var b=0;b<w.length;b++)this.insert(w[b]);return this}var x=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(w,b){if(!w)return this;for(var x,A,M,D=this.data,L=this.toBBox(w),V=[],O=[];D||V.length;){if(D||(D=V.pop(),A=V[V.length-1],x=O.pop(),M=!0),D.leaf){var z=r(w,D.children,b);if(z!==-1)return D.children.splice(z,1),V.push(D),this._condense(V),this}M||D.leaf||!g(D,L)?A?(x++,D=A.children[x],M=!1):D=null:(V.push(D),O.push(x),x=0,A=D,D=D.children[0])}return this},s.prototype.toBBox=function(w){return w},s.prototype.compareMinX=function(w,b){return w.minX-b.minX},s.prototype.compareMinY=function(w,b){return w.minY-b.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(w){return this.data=w,this},s.prototype._all=function(w,b){for(var x=[];w;)w.leaf?b.push.apply(b,w.children):x.push.apply(x,w.children),w=x.pop();return b},s.prototype._build=function(w,b,x,A){var M,D=x-b+1,L=this._maxEntries;if(D<=L)return l(M=_(w.slice(b,x+1)),this.toBBox),M;A||(A=Math.ceil(Math.log(D)/Math.log(L)),L=Math.ceil(D/Math.pow(L,A-1))),(M=_([])).leaf=!1,M.height=A;var V=Math.ceil(D/L),O=V*Math.ceil(Math.sqrt(L));P(w,b,x,O,this.compareMinX);for(var z=b;z<=x;z+=O){var U=Math.min(z+O-1,x);P(w,z,U,V,this.compareMinY);for(var C=z;C<=U;C+=V){var E=Math.min(C+V-1,U);M.children.push(this._build(w,C,E,A-1))}}return l(M,this.toBBox),M},s.prototype._chooseSubtree=function(w,b,x,A){for(;A.push(b),!b.leaf&&A.length-1!==x;){for(var M=1/0,D=1/0,L=void 0,V=0;V<b.children.length;V++){var O=b.children[V],z=f(O),U=(C=w,E=O,(Math.max(E.maxX,C.maxX)-Math.min(E.minX,C.minX))*(Math.max(E.maxY,C.maxY)-Math.min(E.minY,C.minY))-z);U<D?(D=U,M=z<M?z:M,L=O):U===D&&z<M&&(M=z,L=O)}b=L||b.children[0]}var C,E;return b},s.prototype._insert=function(w,b,x){var A=x?w:this.toBBox(w),M=[],D=this._chooseSubtree(A,this.data,b,M);for(D.children.push(w),u(D,A);b>=0&&M[b].children.length>this._maxEntries;)this._split(M,b),b--;this._adjustParentBBoxes(A,M,b)},s.prototype._split=function(w,b){var x=w[b],A=x.children.length,M=this._minEntries;this._chooseSplitAxis(x,M,A);var D=this._chooseSplitIndex(x,M,A),L=_(x.children.splice(D,x.children.length-D));L.height=x.height,L.leaf=x.leaf,l(x,this.toBBox),l(L,this.toBBox),b?w[b-1].children.push(L):this._splitRoot(x,L)},s.prototype._splitRoot=function(w,b){this.data=_([w,b]),this.data.height=w.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(w,b,x){for(var A,M,D,L,V,O,z,U=1/0,C=1/0,E=b;E<=x-b;E++){var R=c(w,0,E,this.toBBox),B=c(w,E,x,this.toBBox),W=(M=R,D=B,L=void 0,V=void 0,O=void 0,z=void 0,L=Math.max(M.minX,D.minX),V=Math.max(M.minY,D.minY),O=Math.min(M.maxX,D.maxX),z=Math.min(M.maxY,D.maxY),Math.max(0,O-L)*Math.max(0,z-V)),Y=f(R)+f(B);W<U?(U=W,A=E,C=Y<C?Y:C):W===U&&Y<C&&(C=Y,A=E)}return A||x-b},s.prototype._chooseSplitAxis=function(w,b,x){var A=w.leaf?this.compareMinX:d,M=w.leaf?this.compareMinY:p;this._allDistMargin(w,b,x,A)<this._allDistMargin(w,b,x,M)&&w.children.sort(A)},s.prototype._allDistMargin=function(w,b,x,A){w.children.sort(A);for(var M=this.toBBox,D=c(w,0,b,M),L=c(w,x-b,x,M),V=m(D)+m(L),O=b;O<x-b;O++){var z=w.children[O];u(D,w.leaf?M(z):z),V+=m(D)}for(var U=x-b-1;U>=b;U--){var C=w.children[U];u(L,w.leaf?M(C):C),V+=m(L)}return V},s.prototype._adjustParentBBoxes=function(w,b,x){for(var A=x;A>=0;A--)u(b[A],w)},s.prototype._condense=function(w){for(var b=w.length-1,x=void 0;b>=0;b--)w[b].children.length===0?b>0?(x=w[b-1].children).splice(x.indexOf(w[b]),1):this.clear():l(w[b],this.toBBox)},s})})(gh)),gh.exports}var $p={},G0;function H0(){return G0||(G0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(z,U,C){C===void 0&&(C={});var E={type:"Feature"};return(C.id===0||C.id)&&(E.id=C.id),C.bbox&&(E.bbox=C.bbox),E.properties=U||{},E.geometry=z,E}t.feature=i;function e(z,U,C){switch(z){case"Point":return n(U).geometry;case"LineString":return l(U).geometry;case"Polygon":return s(U).geometry;case"MultiPoint":return p(U).geometry;case"MultiLineString":return d(U).geometry;case"MultiPolygon":return f(U).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,U,C){if(C===void 0&&(C={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!D(z[0])||!D(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,U,C)}t.point=n;function o(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return n(E,U)}),C)}t.points=o;function s(z,U,C){C===void 0&&(C={});for(var E=0,R=z;E<R.length;E++){var B=R[E];if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var W=0;W<B[B.length-1].length;W++)if(B[B.length-1][W]!==B[0][W])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,U,C)}t.polygon=s;function r(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return s(E,U)}),C)}t.polygons=r;function l(z,U,C){if(C===void 0&&(C={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,U,C)}t.lineString=l;function c(z,U,C){return C===void 0&&(C={}),u(z.map(function(E){return l(E,U)}),C)}t.lineStrings=c;function u(z,U){U===void 0&&(U={});var C={type:"FeatureCollection"};return U.id&&(C.id=U.id),U.bbox&&(C.bbox=U.bbox),C.features=z,C}t.featureCollection=u;function d(z,U,C){C===void 0&&(C={});var E={type:"MultiLineString",coordinates:z};return i(E,U,C)}t.multiLineString=d;function p(z,U,C){C===void 0&&(C={});var E={type:"MultiPoint",coordinates:z};return i(E,U,C)}t.multiPoint=p;function f(z,U,C){C===void 0&&(C={});var E={type:"MultiPolygon",coordinates:z};return i(E,U,C)}t.multiPolygon=f;function m(z,U,C){C===void 0&&(C={});var E={type:"GeometryCollection",geometries:z};return i(E,U,C)}t.geometryCollection=m;function g(z,U){if(U===void 0&&(U=0),U&&!(U>=0))throw new Error("precision must be a positive number");var C=Math.pow(10,U||0);return Math.round(z*C)/C}t.round=g;function y(z,U){U===void 0&&(U="kilometers");var C=t.factors[U];if(!C)throw new Error(U+" units is invalid");return z*C}t.radiansToLength=y;function _(z,U){U===void 0&&(U="kilometers");var C=t.factors[U];if(!C)throw new Error(U+" units is invalid");return z/C}t.lengthToRadians=_;function P(z,U){return b(_(z,U))}t.lengthToDegrees=P;function w(z){var U=z%360;return U<0&&(U+=360),U}t.bearingToAzimuth=w;function b(z){var U=z%(2*Math.PI);return U*180/Math.PI}t.radiansToDegrees=b;function x(z){var U=z%360;return U*Math.PI/180}t.degreesToRadians=x;function A(z,U,C){if(U===void 0&&(U="kilometers"),C===void 0&&(C="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,U),C)}t.convertLength=A;function M(z,U,C){if(U===void 0&&(U="meters"),C===void 0&&(C="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[U];if(!E)throw new Error("invalid original units");var R=t.areaFactors[C];if(!R)throw new Error("invalid final units");return z/E*R}t.convertArea=M;function D(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=D;function L(z){return!!z&&z.constructor===Object}t.isObject=L;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(U){if(!D(U))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function O(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=O})($p)),$p}var Ke={},q0;function $0(){if(q0)return Ke;q0=1,Object.defineProperty(Ke,"__esModule",{value:!0});var t=H0();function i(w,b,x){if(w!==null)for(var A,M,D,L,V,O,z,U=0,C=0,E,R=w.type,B=R==="FeatureCollection",W=R==="Feature",Y=B?w.features.length:1,q=0;q<Y;q++){z=B?w.features[q].geometry:W?w.geometry:w,E=z?z.type==="GeometryCollection":!1,V=E?z.geometries.length:1;for(var X=0;X<V;X++){var Q=0,ee=0;if(L=E?z.geometries[X]:z,L!==null){O=L.coordinates;var oe=L.type;switch(U=x&&(oe==="Polygon"||oe==="MultiPolygon")?1:0,oe){case null:break;case"Point":if(b(O,C,q,Q,ee)===!1)return!1;C++,Q++;break;case"LineString":case"MultiPoint":for(A=0;A<O.length;A++){if(b(O[A],C,q,Q,ee)===!1)return!1;C++,oe==="MultiPoint"&&Q++}oe==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(A=0;A<O.length;A++){for(M=0;M<O[A].length-U;M++){if(b(O[A][M],C,q,Q,ee)===!1)return!1;C++}oe==="MultiLineString"&&Q++,oe==="Polygon"&&ee++}oe==="Polygon"&&Q++;break;case"MultiPolygon":for(A=0;A<O.length;A++){for(ee=0,M=0;M<O[A].length;M++){for(D=0;D<O[A][M].length-U;D++){if(b(O[A][M][D],C,q,Q,ee)===!1)return!1;C++}ee++}Q++}break;case"GeometryCollection":for(A=0;A<L.geometries.length;A++)if(i(L.geometries[A],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(w,b,x,A){var M=x;return i(w,function(D,L,V,O,z){L===0&&x===void 0?M=D:M=b(M,D,L,V,O,z)},A),M}function n(w,b){var x;switch(w.type){case"FeatureCollection":for(x=0;x<w.features.length&&b(w.features[x].properties,x)!==!1;x++);break;case"Feature":b(w.properties,0);break}}function o(w,b,x){var A=x;return n(w,function(M,D){D===0&&x===void 0?A=M:A=b(A,M,D)}),A}function s(w,b){if(w.type==="Feature")b(w,0);else if(w.type==="FeatureCollection")for(var x=0;x<w.features.length&&b(w.features[x],x)!==!1;x++);}function r(w,b,x){var A=x;return s(w,function(M,D){D===0&&x===void 0?A=M:A=b(A,M,D)}),A}function l(w){var b=[];return i(w,function(x){b.push(x)}),b}function c(w,b){var x,A,M,D,L,V,O,z,U,C,E=0,R=w.type==="FeatureCollection",B=w.type==="Feature",W=R?w.features.length:1;for(x=0;x<W;x++){for(V=R?w.features[x].geometry:B?w.geometry:w,z=R?w.features[x].properties:B?w.properties:{},U=R?w.features[x].bbox:B?w.bbox:void 0,C=R?w.features[x].id:B?w.id:void 0,O=V?V.type==="GeometryCollection":!1,L=O?V.geometries.length:1,M=0;M<L;M++){if(D=O?V.geometries[M]:V,D===null){if(b(null,E,z,U,C)===!1)return!1;continue}switch(D.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(D,E,z,U,C)===!1)return!1;break}case"GeometryCollection":{for(A=0;A<D.geometries.length;A++)if(b(D.geometries[A],E,z,U,C)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function u(w,b,x){var A=x;return c(w,function(M,D,L,V,O){D===0&&x===void 0?A=M:A=b(A,M,D,L,V,O)}),A}function d(w,b){c(w,function(x,A,M,D,L){var V=x===null?null:x.type;switch(V){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,M,{bbox:D,id:L}),A,0)===!1?!1:void 0}var O;switch(V){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var z=0;z<x.coordinates.length;z++){var U=x.coordinates[z],C={type:O,coordinates:U};if(b(t.feature(C,M),A,z)===!1)return!1}})}function p(w,b,x){var A=x;return d(w,function(M,D,L){D===0&&L===0&&x===void 0?A=M:A=b(A,M,D,L)}),A}function f(w,b){d(w,function(x,A,M){var D=0;if(x.geometry){var L=x.geometry.type;if(!(L==="Point"||L==="MultiPoint")){var V,O=0,z=0,U=0;if(i(x,function(C,E,R,B,W){if(V===void 0||A>O||B>z||W>U){V=C,O=A,z=B,U=W,D=0;return}var Y=t.lineString([V,C],x.properties);if(b(Y,A,M,W,D)===!1)return!1;D++,V=C})===!1)return!1}}})}function m(w,b,x){var A=x,M=!1;return f(w,function(D,L,V,O,z){M===!1&&x===void 0?A=D:A=b(A,D,L,V,O,z),M=!0}),A}function g(w,b){if(!w)throw new Error("geojson is required");d(w,function(x,A,M){if(x.geometry!==null){var D=x.geometry.type,L=x.geometry.coordinates;switch(D){case"LineString":if(b(x,A,M,0,0)===!1)return!1;break;case"Polygon":for(var V=0;V<L.length;V++)if(b(t.lineString(L[V],x.properties),A,M,V)===!1)return!1;break}}})}function y(w,b,x){var A=x;return g(w,function(M,D,L,V){D===0&&x===void 0?A=M:A=b(A,M,D,L,V)}),A}function _(w,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,A=b.multiFeatureIndex||0,M=b.geometryIndex||0,D=b.segmentIndex||0,L=b.properties,V;switch(w.type){case"FeatureCollection":x<0&&(x=w.features.length+x),L=L||w.features[x].properties,V=w.features[x].geometry;break;case"Feature":L=L||w.properties,V=w.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":V=w;break;default:throw new Error("geojson is invalid")}if(V===null)return null;var O=V.coordinates;switch(V.type){case"Point":case"MultiPoint":return null;case"LineString":return D<0&&(D=O.length+D-1),t.lineString([O[D],O[D+1]],L,b);case"Polygon":return M<0&&(M=O.length+M),D<0&&(D=O[M].length+D-1),t.lineString([O[M][D],O[M][D+1]],L,b);case"MultiLineString":return A<0&&(A=O.length+A),D<0&&(D=O[A].length+D-1),t.lineString([O[A][D],O[A][D+1]],L,b);case"MultiPolygon":return A<0&&(A=O.length+A),M<0&&(M=O[A].length+M),D<0&&(D=O[A][M].length-D-1),t.lineString([O[A][M][D],O[A][M][D+1]],L,b)}throw new Error("geojson is invalid")}function P(w,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,A=b.multiFeatureIndex||0,M=b.geometryIndex||0,D=b.coordIndex||0,L=b.properties,V;switch(w.type){case"FeatureCollection":x<0&&(x=w.features.length+x),L=L||w.features[x].properties,V=w.features[x].geometry;break;case"Feature":L=L||w.properties,V=w.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":V=w;break;default:throw new Error("geojson is invalid")}if(V===null)return null;var O=V.coordinates;switch(V.type){case"Point":return t.point(O,L,b);case"MultiPoint":return A<0&&(A=O.length+A),t.point(O[A],L,b);case"LineString":return D<0&&(D=O.length+D),t.point(O[D],L,b);case"Polygon":return M<0&&(M=O.length+M),D<0&&(D=O[M].length+D),t.point(O[M][D],L,b);case"MultiLineString":return A<0&&(A=O.length+A),D<0&&(D=O[A].length+D),t.point(O[A][D],L,b);case"MultiPolygon":return A<0&&(A=O.length+A),M<0&&(M=O[A].length+M),D<0&&(D=O[A][M].length-D),t.point(O[A][M][D],L,b)}throw new Error("geojson is invalid")}return Ke.coordAll=l,Ke.coordEach=i,Ke.coordReduce=e,Ke.featureEach=s,Ke.featureReduce=r,Ke.findPoint=P,Ke.findSegment=_,Ke.flattenEach=d,Ke.flattenReduce=p,Ke.geomEach=c,Ke.geomReduce=u,Ke.lineEach=g,Ke.lineReduce=y,Ke.propEach=n,Ke.propReduce=o,Ke.segmentEach=f,Ke.segmentReduce=m,Ke}var mh={},X0;function rI(){if(X0)return mh;X0=1,Object.defineProperty(mh,"__esModule",{value:!0});var t=$0();function i(e){var n=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){n[0]>o[0]&&(n[0]=o[0]),n[1]>o[1]&&(n[1]=o[1]),n[2]<o[0]&&(n[2]=o[0]),n[3]<o[1]&&(n[3]=o[1])}),n}return i.default=i,mh.default=i,mh}var Y0;function aI(){if(Y0)return fh.exports;Y0=1;var t=sI(),i=H0(),e=$0(),n=rI().default,o=e.featureEach;e.coordEach,i.polygon;var s=i.featureCollection;function r(l){var c=new t(l);return c.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),t.prototype.insert.call(this,u)},c.load=function(u){var d=[];return Array.isArray(u)?u.forEach(function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),d.push(p)}):o(u,function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),d.push(p)}),t.prototype.load.call(this,d)},c.remove=function(u,d){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),t.prototype.remove.call(this,u,d)},c.clear=function(){return t.prototype.clear.call(this)},c.search=function(u){var d=t.prototype.search.call(this,this.toBBox(u));return s(d)},c.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},c.all=function(){var u=t.prototype.all.call(this);return s(u)},c.toJSON=function(){return t.prototype.toJSON.call(this)},c.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},c.toBBox=function(u){var d;if(u.bbox)d=u.bbox;else if(Array.isArray(u)&&u.length===4)d=u;else if(Array.isArray(u)&&u.length===6)d=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")d=n(u);else if(u.type==="FeatureCollection")d=n(u);else throw new Error("invalid geojson");return{minX:d[0],minY:d[1],maxX:d[2],maxY:d[3]}},c}return fh.exports=r,fh.exports.default=r,fh.exports}var lI=aI();const cI=dc(lI);function Xp(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Ai(t)),i.type==="LineString"&&(i=Ai(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=Z0(t,i);return o&&n.push(o),Ti(n)}var s=cI();return s.load(U0(i)),dh(U0(t),function(r){dh(s.search(r),function(l){var c=Z0(r,l);if(c){var u=Mi(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ti(n)}function Z0(t,i){var e=Mi(t),n=Mi(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),m=(d-c)*(s-u)-(p-u)*(o-c),g=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=m/f,_=g/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),w=s+y*(l-s);return zn([P,w])}return null}function vh(t,i,e){e===void 0&&(e={});for(var n=hh(t),o=Mi(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),hI(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function hI(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,m=u-l,g=d-c,y=p*g-f*m;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(m)>=Math.abs(g)?m>0?l<s&&s<=u:u<=s&&s<l:g>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(m)>=Math.abs(g)?m>0?l<=s&&s<u:u<s&&s<=l:g>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(m)>=Math.abs(g)?m>0?l<s&&s<u:u<s&&s<l:g>0?c<r&&r<d:d<r&&r<c}else return Math.abs(m)>=Math.abs(g)?m>0?l<=s&&s<=u:u<=s&&s<=l:g>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function uI(t,i){var e=Ii(t),n=Ii(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return dI(e,n);case"LineString":return vh(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return _t(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return pI(e,n);case"LineString":return fI(e,n);case"Polygon":case"MultiPolygon":return gI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return mI(e,n);case"Polygon":case"MultiPolygon":return vI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return yI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function dI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(k0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function pI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)k0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function fI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!vh(t.coordinates[n],i))return!1;e||(e=vh(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function gI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=_t(t.coordinates[1],i),!n){e=!1;break}n=_t(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function mI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!vh(t.coordinates[e],i))return!1;return!0}function vI(t,i){var e=To(i),n=To(t);if(!Q0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!_t(t.coordinates[s],i))return!1;if(o||(o=_t(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=wI(t.coordinates[s],t.coordinates[s+1]);o=_t(r,i,{ignoreBoundary:!0})}}return o}function yI(t,i){var e=To(t),n=To(i);if(!Q0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!_t(t.coordinates[0][o],i))return!1;return!0}function Q0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function k0(t,i){return t[0]===i[0]&&t[1]===i[1]}function wI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function K0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Di([o,s],[r,s],e),u=c*(r-o),d=i/Di([o,s],[o,l],e),p=d*(l-s),f=r-o,m=l-s,g=Math.floor(f/u),y=Math.floor(m/p),_=(f-g*u)/2,P=(m-y*p)/2,w=o+_;w<=r;){for(var b=s+P;b<=l;){var x=zn([w,b],e.properties);e.mask?uI(x,e.mask)&&n.push(x):n.push(x),b+=p}w+=u}return Ti(n)}function Yp(t,i){i===void 0&&(i={});var e=Ii(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return CI(e,i);case"MultiPolygon":return _I(e,i);default:throw new Error("invalid poly")}}function CI(t,i){i===void 0&&(i={});var e=Ii(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return J0(n,o)}function _I(t,i){i===void 0&&(i={});var e=Ii(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(J0(r,o))}),Ti(s)}function J0(t,i){return t.length>1?pM(t,i):lh(t[0],i)}var Zp,j0;function ew(){if(j0)return Zp;j0=1;var t=Object.prototype.toString;return Zp=function(e){var n=t.call(e),o=n==="[object Arguments]";return o||(o=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Zp}var Qp,tw;function PI(){if(tw)return Qp;tw=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=ew(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var m=f.constructor;return m&&m.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1})(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(m){var g=m!==null&&typeof m=="object",y=e.call(m)==="[object Function]",_=n(m),P=g&&e.call(m)==="[object String]",w=[];if(!g&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var b=r&&y;if(P&&m.length>0&&!i.call(m,0))for(var x=0;x<m.length;++x)w.push(String(x));if(_&&m.length>0)for(var A=0;A<m.length;++A)w.push(String(A));else for(var M in m)!(b&&M==="prototype")&&i.call(m,M)&&w.push(String(M));if(s)for(var D=p(m),L=0;L<l.length;++L)!(D&&l[L]==="constructor")&&i.call(m,l[L])&&w.push(l[L]);return w}}return Qp=t,Qp}var kp,iw;function nw(){if(iw)return kp;iw=1;var t=Array.prototype.slice,i=ew(),e=Object.keys,n=e?function(r){return e(r)}:PI(),o=Object.keys;return n.shim=function(){if(Object.keys){var r=(function(){var l=Object.keys(arguments);return l&&l.length===arguments.length})(1,2);r||(Object.keys=function(c){return i(c)?o(t.call(c)):o(c)})}else Object.keys=n;return Object.keys||n},kp=n,kp}var Kp,ow;function sw(){return ow||(ow=1,Kp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0}),Kp}var Jp,rw;function jp(){if(rw)return Jp;rw=1;var t=sw();return Jp=function(){return t()&&!!Symbol.toStringTag},Jp}var ef,aw;function lw(){return aw||(aw=1,ef=Object),ef}var tf,cw;function hw(){return cw||(cw=1,tf=Error),tf}var nf,uw;function bI(){return uw||(uw=1,nf=EvalError),nf}var of,dw;function SI(){return dw||(dw=1,of=RangeError),of}var sf,pw;function xI(){return pw||(pw=1,sf=ReferenceError),sf}var rf,fw;function gw(){return fw||(fw=1,rf=SyntaxError),rf}var af,mw;function Vs(){return mw||(mw=1,af=TypeError),af}var lf,vw;function EI(){return vw||(vw=1,lf=URIError),lf}var cf,yw;function AI(){return yw||(yw=1,cf=Math.abs),cf}var hf,ww;function TI(){return ww||(ww=1,hf=Math.floor),hf}var uf,Cw;function MI(){return Cw||(Cw=1,uf=Math.max),uf}var df,_w;function II(){return _w||(_w=1,df=Math.min),df}var pf,Pw;function DI(){return Pw||(Pw=1,pf=Math.pow),pf}var ff,bw;function RI(){return bw||(bw=1,ff=Math.round),ff}var gf,Sw;function FI(){return Sw||(Sw=1,gf=Number.isNaN||function(i){return i!==i}),gf}var mf,xw;function zI(){if(xw)return mf;xw=1;var t=FI();return mf=function(e){return t(e)||e===0?e:e<0?-1:1},mf}var vf,Ew;function LI(){return Ew||(Ew=1,vf=Object.getOwnPropertyDescriptor),vf}var yf,Aw;function Us(){if(Aw)return yf;Aw=1;var t=LI();if(t)try{t([],"length")}catch{t=null}return yf=t,yf}var wf,Tw;function yh(){if(Tw)return wf;Tw=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return wf=t,wf}var Cf,Mw;function OI(){if(Mw)return Cf;Mw=1;var t=typeof Symbol<"u"&&Symbol,i=sw();return Cf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Cf}var _f,Iw;function Dw(){return Iw||(Iw=1,_f=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),_f}var Pf,Rw;function Fw(){if(Rw)return Pf;Rw=1;var t=lw();return Pf=t.getPrototypeOf||null,Pf}var bf,zw;function NI(){if(zw)return bf;zw=1;var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,e=Math.max,n="[object Function]",o=function(c,u){for(var d=[],p=0;p<c.length;p+=1)d[p]=c[p];for(var f=0;f<u.length;f+=1)d[f+c.length]=u[f];return d},s=function(c,u){for(var d=[],p=u,f=0;p<c.length;p+=1,f+=1)d[f]=c[p];return d},r=function(l,c){for(var u="",d=0;d<l.length;d+=1)u+=l[d],d+1<l.length&&(u+=c);return u};return bf=function(c){var u=this;if(typeof u!="function"||i.apply(u)!==n)throw new TypeError(t+u);for(var d=s(arguments,1),p,f=function(){if(this instanceof p){var P=u.apply(this,o(d,arguments));return Object(P)===P?P:this}return u.apply(c,o(d,arguments))},m=e(0,u.length-d.length),g=[],y=0;y<m;y++)g[y]="$"+y;if(p=Function("binder","return function ("+r(g,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var _=function(){};_.prototype=u.prototype,p.prototype=new _,_.prototype=null}return p},bf}var Sf,Lw;function Hr(){if(Lw)return Sf;Lw=1;var t=NI();return Sf=Function.prototype.bind||t,Sf}var xf,Ow;function Ef(){return Ow||(Ow=1,xf=Function.prototype.call),xf}var Af,Nw;function Tf(){return Nw||(Nw=1,Af=Function.prototype.apply),Af}var Mf,Bw;function BI(){return Bw||(Bw=1,Mf=typeof Reflect<"u"&&Reflect&&Reflect.apply),Mf}var If,Vw;function Uw(){if(Vw)return If;Vw=1;var t=Hr(),i=Tf(),e=Ef(),n=BI();return If=n||t.call(e,i),If}var Df,Ww;function Rf(){if(Ww)return Df;Ww=1;var t=Hr(),i=Vs(),e=Ef(),n=Uw();return Df=function(s){if(s.length<1||typeof s[0]!="function")throw new i("a function is required");return n(t,e,s)},Df}var Ff,Gw;function VI(){if(Gw)return Ff;Gw=1;var t=Rf(),i=Us(),e;try{e=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var n=!!e&&i&&i(Object.prototype,"__proto__"),o=Object,s=o.getPrototypeOf;return Ff=n&&typeof n.get=="function"?t([n.get]):typeof s=="function"?function(l){return s(l==null?l:o(l))}:!1,Ff}var zf,Hw;function qw(){if(Hw)return zf;Hw=1;var t=Dw(),i=Fw(),e=VI();return zf=t?function(o){return t(o)}:i?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return i(o)}:e?function(o){return e(o)}:null,zf}var Lf,$w;function Xw(){if($w)return Lf;$w=1;var t=Function.prototype.call,i=Object.prototype.hasOwnProperty,e=Hr();return Lf=e.call(t,i),Lf}var Of,Yw;function Zw(){if(Yw)return Of;Yw=1;var t,i=lw(),e=hw(),n=bI(),o=SI(),s=xI(),r=gw(),l=Vs(),c=EI(),u=AI(),d=TI(),p=MI(),f=II(),m=DI(),g=RI(),y=zI(),_=Function,P=function(ge){try{return _('"use strict"; return ('+ge+").constructor;")()}catch{}},w=Us(),b=yh(),x=function(){throw new l},A=w?(function(){try{return arguments.callee,x}catch{try{return w(arguments,"callee").get}catch{return x}}})():x,M=OI()(),D=qw(),L=Fw(),V=Dw(),O=Tf(),z=Ef(),U={},C=typeof Uint8Array>"u"||!D?t:D(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":M&&D?D([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&D?D(D([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!D?t:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!D?t:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&D?D(""[Symbol.iterator]()):t,"%Symbol%":M?Symbol:t,"%SyntaxError%":r,"%ThrowTypeError%":A,"%TypedArray%":C,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":z,"%Function.prototype.apply%":O,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":L,"%Math.abs%":u,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":y,"%Reflect.getPrototypeOf%":V};if(D)try{null.error}catch(ge){var R=D(D(ge));E["%Error.prototype%"]=R}var B=function ge(ie){var ce;if(ie==="%AsyncFunction%")ce=P("async function () {}");else if(ie==="%GeneratorFunction%")ce=P("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ce=P("async function* () {}");else if(ie==="%AsyncGenerator%"){var he=ge("%AsyncGeneratorFunction%");he&&(ce=he.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var Ee=ge("%AsyncGenerator%");Ee&&D&&(ce=D(Ee.prototype))}return E[ie]=ce,ce},W={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Y=Hr(),q=Xw(),X=Y.call(z,Array.prototype.concat),Q=Y.call(O,Array.prototype.splice),ee=Y.call(z,String.prototype.replace),oe=Y.call(z,String.prototype.slice),fe=Y.call(z,RegExp.prototype.exec),ve=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xe=/\\(\\)?/g,Oe=function(ie){var ce=oe(ie,0,1),he=oe(ie,-1);if(ce==="%"&&he!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(he==="%"&&ce!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Ee=[];return ee(ie,ve,function(Ne,Ot,st,Oh){Ee[Ee.length]=st?ee(Oh,xe,"$1"):Ot||Ne}),Ee},Ue=function(ie,ce){var he=ie,Ee;if(q(W,he)&&(Ee=W[he],he="%"+Ee[0]+"%"),q(E,he)){var Ne=E[he];if(Ne===U&&(Ne=B(he)),typeof Ne>"u"&&!ce)throw new l("intrinsic "+ie+" exists, but is not available. Please file an issue!");return{alias:Ee,name:he,value:Ne}}throw new r("intrinsic "+ie+" does not exist!")};return Of=function(ie,ce){if(typeof ie!="string"||ie.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new l('"allowMissing" argument must be a boolean');if(fe(/^%?[^%]*%?$/,ie)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var he=Oe(ie),Ee=he.length>0?he[0]:"",Ne=Ue("%"+Ee+"%",ce),Ot=Ne.name,st=Ne.value,Oh=!1,am=Ne.alias;am&&(Ee=am[0],Q(he,X([0,1],am)));for(var Nh=1,Zl=!0;Nh<he.length;Nh+=1){var an=he[Nh],Bh=oe(an,0,1),Vh=oe(an,-1);if((Bh==='"'||Bh==="'"||Bh==="`"||Vh==='"'||Vh==="'"||Vh==="`")&&Bh!==Vh)throw new r("property names with quotes must have matching quotes");if((an==="constructor"||!Zl)&&(Oh=!0),Ee+="."+an,Ot="%"+Ee+"%",q(E,Ot))st=E[Ot];else if(st!=null){if(!(an in st)){if(!ce)throw new l("base intrinsic for "+ie+" exists, but the property is not available.");return}if(w&&Nh+1>=he.length){var Uh=w(st,an);Zl=!!Uh,Zl&&"get"in Uh&&!("originalValue"in Uh.get)?st=Uh.get:st=st[an]}else Zl=q(st,an),st=st[an];Zl&&!Oh&&(E[Ot]=st)}}return st},Of}var Nf,Qw;function Bf(){if(Qw)return Nf;Qw=1;var t=Zw(),i=Rf(),e=i([t("%String.prototype.indexOf%")]);return Nf=function(o,s){var r=t(o,!!s);return typeof r=="function"&&e(o,".prototype.")>-1?i([r]):r},Nf}var Vf,kw;function UI(){if(kw)return Vf;kw=1;var t=jp()(),i=Bf(),e=i("Object.prototype.toString"),n=function(l){return t&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:e(l)==="[object Arguments]"},o=function(l){return n(l)?!0:l!==null&&typeof l=="object"&&"length"in l&&typeof l.length=="number"&&l.length>=0&&e(l)!=="[object Array]"&&"callee"in l&&e(l.callee)==="[object Function]"},s=(function(){return n(arguments)})();return n.isLegacyArguments=o,Vf=s?n:o,Vf}var Uf,Kw;function Wf(){if(Kw)return Uf;Kw=1;var t=yh(),i=gw(),e=Vs(),n=Us();return Uf=function(s,r,l){if(!s||typeof s!="object"&&typeof s!="function")throw new e("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,f=!!n&&n(s,r);if(t)t(s,r,{configurable:d===null&&f?f.configurable:!d,enumerable:c===null&&f?f.enumerable:!c,value:l,writable:u===null&&f?f.writable:!u});else if(p||!c&&!u&&!d)s[r]=l;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Uf}var Gf,Jw;function Hf(){if(Jw)return Gf;Jw=1;var t=yh(),i=function(){return!!t};return i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Gf=i,Gf}var qf,jw;function qr(){if(jw)return qf;jw=1;var t=nw(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,n=Array.prototype.concat,o=Wf(),s=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},r=Hf()(),l=function(u,d,p,f){if(d in u){if(f===!0){if(u[d]===p)return}else if(!s(f)||!f())return}r?o(u,d,p,!0):o(u,d,p)},c=function(u,d){var p=arguments.length>2?arguments[2]:{},f=t(d);i&&(f=n.call(f,Object.getOwnPropertySymbols(d)));for(var m=0;m<f.length;m+=1)l(u,f[m],d[f[m]],p[f[m]])};return c.supportsDescriptors=!!r,qf=c,qf}var $f={exports:{}},Xf,eC;function WI(){if(eC)return Xf;eC=1;var t=Zw(),i=Wf(),e=Hf()(),n=Us(),o=Vs(),s=t("%Math.floor%");return Xf=function(l,c){if(typeof l!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],d=!0,p=!0;if("length"in l&&n){var f=n(l,"length");f&&!f.configurable&&(d=!1),f&&!f.writable&&(p=!1)}return(d||p||!u)&&(e?i(l,"length",c,!0,!0):i(l,"length",c)),l},Xf}var Yf,tC;function GI(){if(tC)return Yf;tC=1;var t=Hr(),i=Tf(),e=Uw();return Yf=function(){return e(t,i,arguments)},Yf}var iC;function nC(){return iC||(iC=1,(function(t){var i=WI(),e=yh(),n=Rf(),o=GI();t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})($f)),$f.exports}var Zf,oC;function sC(){if(oC)return Zf;oC=1;var t=function(i){return i!==i};return Zf=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||t(e)&&t(n))},Zf}var Qf,rC;function aC(){if(rC)return Qf;rC=1;var t=sC();return Qf=function(){return typeof Object.is=="function"?Object.is:t},Qf}var kf,lC;function HI(){if(lC)return kf;lC=1;var t=aC(),i=qr();return kf=function(){var n=t();return i(Object,{is:n},{is:function(){return Object.is!==n}}),n},kf}var Kf,cC;function qI(){if(cC)return Kf;cC=1;var t=qr(),i=nC(),e=sC(),n=aC(),o=HI(),s=i(n(),Object);return t(s,{getPolyfill:n,implementation:e,shim:o}),Kf=s,Kf}var Jf,hC;function $I(){if(hC)return Jf;hC=1;var t=Bf(),i=jp()(),e=Xw(),n=Us(),o;if(i){var s=t("RegExp.prototype.exec"),r={},l=function(){throw r},c={toString:l,valueOf:l};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=l),o=function(f){if(!f||typeof f!="object")return!1;var m=n(f,"lastIndex"),g=m&&e(m,"value");if(!g)return!1;try{s(f,c)}catch(y){return y===r}}}else{var u=t("Object.prototype.toString"),d="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===d}}return Jf=o,Jf}var jf,uC;function XI(){if(uC)return jf;uC=1;var t=function(){return typeof(function(){}).name=="string"},i=Object.getOwnPropertyDescriptor;if(i)try{i([],"length")}catch{i=null}t.functionsHaveConfigurableNames=function(){if(!t()||!i)return!1;var o=i(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},jf=t,jf}var eg,dC;function YI(){if(dC)return eg;dC=1;var t=Wf(),i=Hf()(),e=XI().functionsHaveConfigurableNames(),n=Vs();return eg=function(s,r){if(typeof s!="function")throw new n("`fn` is not a function");var l=arguments.length>2&&!!arguments[2];return(!l||e)&&(i?t(s,"name",r,!0,!0):t(s,"name",r)),s},eg}var tg,pC;function fC(){if(pC)return tg;pC=1;var t=YI(),i=Vs(),e=Object;return tg=t(function(){if(this==null||this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),tg}var ig,gC;function mC(){if(gC)return ig;gC=1;var t=fC(),i=qr().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return ig=function(){if(i&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var s="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){s+="d"}}),Object.defineProperty(r,"sticky",{get:function(){s+="y"}}),o.get.call(r),s==="dy")return o.get}}return t},ig}var ng,vC;function ZI(){if(vC)return ng;vC=1;var t=qr().supportsDescriptors,i=mC(),e=Us(),n=Object.defineProperty,o=hw(),s=qw(),r=/a/;return ng=function(){if(!t||!s)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=i(),u=s(r),d=e(u,"flags");return(!d||d.get!==c)&&n(u,"flags",{configurable:!0,enumerable:!1,get:c}),c},ng}var og,yC;function QI(){if(yC)return og;yC=1;var t=qr(),i=nC(),e=fC(),n=mC(),o=ZI(),s=i(n());return t(s,{getPolyfill:n,implementation:e,shim:o}),og=s,og}var sg,wC;function kI(){if(wC)return sg;wC=1;var t=Bf(),i=t("Date.prototype.getDay"),e=function(l){try{return i(l),!0}catch{return!1}},n=t("Object.prototype.toString"),o="[object Date]",s=jp()();return sg=function(l){return typeof l!="object"||l===null?!1:s?e(l):n(l)===o},sg}var rg,CC;function KI(){if(CC)return rg;CC=1;var t=nw(),i=UI(),e=qI(),n=$I(),o=QI(),s=kI(),r=Date.prototype.getTime;function l(p,f,m){var g=m||{};return(g.strict?e(p,f):p===f)?!0:!p||!f||typeof p!="object"&&typeof f!="object"?g.strict?e(p,f):p==f:d(p,f,g)}function c(p){return p==null}function u(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function d(p,f,m){var g,y;if(typeof p!=typeof f||c(p)||c(f)||p.prototype!==f.prototype||i(p)!==i(f))return!1;var _=n(p),P=n(f);if(_!==P)return!1;if(_||P)return p.source===f.source&&o(p)===o(f);if(s(p)&&s(f))return r.call(p)===r.call(f);var w=u(p),b=u(f);if(w!==b)return!1;if(w||b){if(p.length!==f.length)return!1;for(g=0;g<p.length;g++)if(p[g]!==f[g])return!1;return!0}if(typeof p!=typeof f)return!1;try{var x=t(p),A=t(f)}catch{return!1}if(x.length!==A.length)return!1;for(x.sort(),A.sort(),g=x.length-1;g>=0;g--)if(x[g]!=A[g])return!1;for(g=x.length-1;g>=0;g--)if(y=x[g],!l(p[y],f[y],m))return!1;return!0}return rg=l,rg}function JI(t,i){var e=!0;return Fs(t,function(n){Fs(i,function(o){if(e===!1)return!1;e=jI(n.geometry,o.geometry)})}),e}function jI(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!nD(t.coordinates,i.coordinates);case"LineString":return!_C(i,t);case"Polygon":return!_t(t,i)}break;case"LineString":switch(i.type){case"Point":return!_C(t,i);case"LineString":return!eD(t,i);case"Polygon":return!PC(i,t)}break;case"Polygon":switch(i.type){case"Point":return!_t(i,t);case"LineString":return!PC(t,i);case"Polygon":return!tD(i,t)}}return!1}function _C(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(iD(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function eD(t,i){var e=Xp(t,i);return e.features.length>0}function PC(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(_t(o,t))return!0}var s=Xp(i,Yp(t));return s.features.length>0}function tD(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(_t(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(_t(l,t))return!0}var c=Xp(Yp(t),Yp(i));return c.features.length>0}function iD(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function nD(t,i){return t[0]===i[0]&&t[1]===i[1]}var ag,bC;function oD(){if(bC)return ag;bC=1;var t=KI(),i=function(s){this.precision=s&&s.precision?s.precision:17,this.direction=s&&s.direction?s.direction:!1,this.pseudoNode=s&&s.pseudoNode?s.pseudoNode:!1,this.objectComparator=s&&s.objectComparator?s.objectComparator:o};i.prototype.compare=function(s,r){if(s.type!==r.type||!n(s,r))return!1;switch(s.type){case"Point":return this.compareCoord(s.coordinates,r.coordinates);case"LineString":return this.compareLine(s.coordinates,r.coordinates,0,!1);case"Polygon":return this.comparePolygon(s,r);case"Feature":return this.compareFeature(s,r);default:if(s.type.indexOf("Multi")===0){var l=this,c=e(s),u=e(r);return c.every(function(d){return this.some(function(p){return l.compare(d,p)})},u)}}return!1};function e(s){return s.coordinates.map(function(r){return{type:s.type.replace("Multi",""),coordinates:r}})}function n(s,r){return s.hasOwnProperty("coordinates")?s.coordinates.length===r.coordinates.length:s.length===r.length}i.prototype.compareCoord=function(s,r){if(s.length!==r.length)return!1;for(var l=0;l<s.length;l++)if(s[l].toFixed(this.precision)!==r[l].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(s,r,l,c){if(!n(s,r))return!1;var u=this.pseudoNode?s:this.removePseudo(s),d=this.pseudoNode?r:this.removePseudo(r);if(!(c&&!this.compareCoord(u[0],d[0])&&(d=this.fixStartIndex(d,u),!d))){var p=this.compareCoord(u[l],d[l]);return this.direction||p?this.comparePath(u,d):this.compareCoord(u[l],d[d.length-(1+l)])?this.comparePath(u.slice().reverse(),d):!1}},i.prototype.fixStartIndex=function(s,r){for(var l,c=-1,u=0;u<s.length;u++)if(this.compareCoord(s[u],r[0])){c=u;break}return c>=0&&(l=[].concat(s.slice(c,s.length),s.slice(1,c+1))),l},i.prototype.comparePath=function(s,r){var l=this;return s.every(function(c,u){return l.compareCoord(c,this[u])},r)},i.prototype.comparePolygon=function(s,r){if(this.compareLine(s.coordinates[0],r.coordinates[0],1,!0)){var l=s.coordinates.slice(1,s.coordinates.length),c=r.coordinates.slice(1,r.coordinates.length),u=this;return l.every(function(d){return this.some(function(p){return u.compareLine(d,p,1,!0)})},c)}else return!1},i.prototype.compareFeature=function(s,r){return s.id!==r.id||!this.objectComparator(s.properties,r.properties)||!this.compareBBox(s,r)?!1:this.compare(s.geometry,r.geometry)},i.prototype.compareBBox=function(s,r){return!!(!s.bbox&&!r.bbox||s.bbox&&r.bbox&&this.compareCoord(s.bbox,r.bbox))},i.prototype.removePseudo=function(s){return s};function o(s,r){return t(s,r,{strict:!0})}return ag=i,ag}var sD=oD();const rD=dc(sD);function aD(t,i){var e=Ii(t).type,n=Ii(i).type;if(e!==n)return!1;var o=new rD({precision:6});return o.compare(N0(t),N0(i))}function lD(t,i){var e=!1;return Fs(t,function(n){Fs(i,function(o){if(e===!0)return!0;e=!JI(n.geometry,o.geometry)})}),e}/**
|
|
1858
1858
|
* splaytree v3.1.2
|
|
1859
1859
|
* Fast Splay tree for Node and browser
|
|
1860
1860
|
*
|
|
@@ -1874,8 +1874,8 @@ function (result, this, instanceIndex, frameState) {
|
|
|
1874
1874
|
|
|
1875
1875
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
1876
1876
|
and limitations under the License.
|
|
1877
|
-
***************************************************************************** */function
|
|
1878
|
-
`);var s=i+(e?" ":"│ ");t.left&&lg(t.left,s,!1,n,o),t.right&&lg(t.right,s,!0,n,o)}}var cg=function(){function t(i){i===void 0&&(i=nD),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=ag(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Ln(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=On(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=On(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=On(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=On(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=On(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return rD(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&dg(i,e,0,o-1,s),this._root===null)this._root=hg(i,e,0,o),this._size=o;else{var r=aD(this.toList(),sD(i,e),s);o=this._size+o,this._root=ug({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return lg(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=_C(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=ag(e,n,l,o):r=ag(e,n,r,o),this._root=oD(r,l,o)},t.prototype.split=function(i){return _C(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return iD(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function hg(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Ln(r,l);return c.left=hg(t,i,e,s),c.right=hg(t,i,s+1,n),c}return null}function sD(t,i){for(var e=new Ln(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Ln(t[o],i[o]);return n.next=null,e.next}function rD(t){for(var i=t,e=[],n=!1,o=new Ln(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function ug(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=ug(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=ug(t,o+1,e),r}return null}function aD(t,i,e){for(var n=new Ln(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function dg(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}dg(t,i,e,l,o),dg(t,i,l+1,n,o)}}const Ki=11102230246251565e-32,vt=134217729,lD=(3+8*Ki)*Ki;function pg(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let m=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[m++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[m++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[m++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[m++]=l);return(s!==0||m===0)&&(o[m++]=s),m}function cD(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function qr(t){return new Float64Array(t)}const hD=(3+16*Ki)*Ki,uD=(2+12*Ki)*Ki,dD=(9+64*Ki)*Ki*Ki,Us=qr(4),PC=qr(8),bC=qr(12),SC=qr(16),_t=qr(4);function pD(t,i,e,n,o,s,r){let l,c,u,d,p,f,m,g,y,_,P,w,b,x,A,M,D,L;const V=t-o,O=e-o,z=i-s,U=n-s;x=V*U,f=vt*V,m=f-(f-V),g=V-m,f=vt*U,y=f-(f-U),_=U-y,A=g*_-(x-m*y-g*y-m*_),M=z*O,f=vt*z,m=f-(f-z),g=z-m,f=vt*O,y=f-(f-O),_=O-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,Us[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,Us[1]=b-(P+p)+(p-M),L=w+P,p=L-w,Us[2]=w-(L-p)+(P-p),Us[3]=L;let C=cD(4,Us),E=uD*r;if(C>=E||-C>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-O,u=e-(O+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-U,d=n-(U+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=dD*r+lD*Math.abs(C),C+=V*d+U*l-(z*u+O*c),C>=E||-C>=E))return C;x=l*U,f=vt*l,m=f-(f-l),g=l-m,f=vt*U,y=f-(f-U),_=U-y,A=g*_-(x-m*y-g*y-m*_),M=c*O,f=vt*c,m=f-(f-c),g=c-m,f=vt*O,y=f-(f-O),_=O-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,_t[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,_t[1]=b-(P+p)+(p-M),L=w+P,p=L-w,_t[2]=w-(L-p)+(P-p),_t[3]=L;const R=pg(4,Us,4,_t,PC);x=V*d,f=vt*V,m=f-(f-V),g=V-m,f=vt*d,y=f-(f-d),_=d-y,A=g*_-(x-m*y-g*y-m*_),M=z*u,f=vt*z,m=f-(f-z),g=z-m,f=vt*u,y=f-(f-u),_=u-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,_t[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,_t[1]=b-(P+p)+(p-M),L=w+P,p=L-w,_t[2]=w-(L-p)+(P-p),_t[3]=L;const B=pg(R,PC,4,_t,bC);x=l*d,f=vt*l,m=f-(f-l),g=l-m,f=vt*d,y=f-(f-d),_=d-y,A=g*_-(x-m*y-g*y-m*_),M=c*u,f=vt*c,m=f-(f-c),g=c-m,f=vt*u,y=f-(f-u),_=u-y,D=g*_-(M-m*y-g*y-m*_),P=A-D,p=A-P,_t[0]=A-(P+p)+(p-D),w=x+P,p=w-x,b=x-(w-p)+(P-p),P=b-M,p=b-P,_t[1]=b-(P+p)+(p-M),L=w+P,p=L-w,_t[2]=w-(L-p)+(P-p),_t[3]=L;const W=pg(B,bC,4,_t,SC);return SC[W-1]}function fD(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=hD*u?c:-pD(t,i,e,n,o,s,u)}const $r=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,fg=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Nn=Number.EPSILON;Nn===void 0&&(Nn=Math.pow(2,-52));const gD=Nn*Nn,xC=(t,i)=>{if(-Nn<t&&t<Nn&&-Nn<i&&i<Nn)return 0;const e=t-i;return e*e<gD*t*i?0:t<i?-1:1};class mD{constructor(){this.reset()}reset(){this.xRounder=new EC,this.yRounder=new EC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class EC{constructor(){this.tree=new cg,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&xC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&xC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const Xr=new mD,wh=(t,i)=>t.x*i.y-t.y*i.x,AC=(t,i)=>t.x*i.x+t.y*i.y,TC=(t,i,e)=>{const n=fD(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Ch=t=>Math.sqrt(AC(t,t)),vD=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return wh(o,n)/Ch(o)/Ch(n)},yD=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return AC(o,n)/Ch(o)/Ch(n)},MC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},IC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},wD=(t,i,e,n)=>{if(i.x===0)return IC(e,n,t.x);if(n.x===0)return IC(t,i,e.x);if(i.y===0)return MC(e,n,t.y);if(n.y===0)return MC(t,i,e.y);const o=wh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=wh(s,i)/o,l=wh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,m=(d+p)/2;return{x:f,y:m}};class ei{static compare(i,e){const n=ei.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Bn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:vD(this.point,i.point,s.point),cosine:yD(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let CD=0;class Bn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,m=d-c,g=r-o;if(p>f&&m<g)return 1;if(p<f&&m>g)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++CD,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=ei.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new ei(o,!0),u=new ei(s,!1);return new Bn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=fg(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=$r(e,l)&&this.comparePoint(l)===0,d=$r(n,s)&&i.comparePoint(s)===0,p=$r(e,c)&&this.comparePoint(c)===0,f=$r(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const m=wD(s,this.vector(),l,i.vector());return m===null||!$r(o,m)?null:Xr.round(m.x,m.y)}split(i){const e=[],n=i.events!==void 0,o=new ei(i,!0),s=new ei(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Bn(o,r,this.rings.slice(),this.windings.slice());return ei.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),ei.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Bn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(di.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===di.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${di.type}`)}return this._isInResult}}class DC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Xr.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Xr.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Bn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Bn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class _D{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new DC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new DC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class RC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new _D(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class _h{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let m=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){m=y;break}if(m!==null){const y=p.splice(m)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new _h(_.reverse()));continue}p.push({index:u.length,point:l.point});const g=l.getLeftmostComparator(r);c=f.sort(g)[0].otherSE;break}e.push(new _h(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;TC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];TC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];ei.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class FC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class PD{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new FC(s));else{const r=s.enclosingRing();r.poly||e.push(new FC(r)),r.poly.addInterior(s)}}return e}}class bD{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bn.compare;this.queue=i,this.tree=new cg(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=ei.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const zC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,SD=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class xD{run(i,e,n){di.type=i,Xr.reset();const o=[new RC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new RC(n[p],!1));if(di.numMultiPolys=o.length,di.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)fg(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(di.type==="intersection")for(let p=0,f=o.length;p<f;p++){const m=o[p];for(let g=p+1,y=o.length;g<y;g++)if(fg(m.bbox,o[g].bbox)===null)return[]}const s=new cg(ei.compare);for(let p=0,f=o.length;p<f;p++){const m=o[p].getSweepEvents();for(let g=0,y=m.length;g<y;g++)if(s.insert(m[g]),s.size>zC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new bD(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const m=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${m.id} [${m.leftSE.point.x}, ${m.leftSE.point.y}] -> [${m.rightSE.point.x}, ${m.rightSE.point.y}] from queue.`)}if(s.size>zC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>SD)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let m=0,g=f.length;m<g;m++){const y=f[m];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}Xr.reset();const u=_h.factory(r.segments);return new PD(u).getGeom()}}const di=new xD;var ED={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("difference",t,e)}};function Ph(t,i,e){e===void 0&&(e={});var n=Ii(t),o=Ii(i),s=ED.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?wt(s[0],e.properties):fM(s,e.properties)}function AD(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Di([o,c],[r,c],e),p=d*(r-o),f=i*2/Di([u,s],[u,l],e),m=f*(l-s),g=p/2,y=g*2,_=Math.sqrt(3)/2*m,P=r-o,w=l-s,b=3/4*y,x=_,A=(P-y)/(y-g/2),M=Math.floor(A),D=(M*b-g/2-P)/2-g/2+b/2,L=Math.floor((w-_)/_),V=(w-L*_)/2,O=L*_-w>_/2;O&&(V-=_/4);for(var z=[],U=[],C=0;C<6;C++){var E=2*Math.PI/6*C;z.push(Math.cos(E)),U.push(Math.sin(E))}for(var R=[],B=0;B<=M;B++)for(var W=0;W<=L;W++){var Y=B%2===1;if(!(W===0&&Y)&&!(W===0&&O)){var q=B*b+o-D,X=W*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)MD([q,X],p/2,m/2,JSON.parse(n),z,U).forEach(function(ee){e.mask?Ph(e.mask,ee)&&R.push(ee):R.push(ee)});else{var Q=TD([q,X],p/2,m/2,JSON.parse(n),z,U);e.mask?Ph(e.mask,Q)&&R.push(Q):R.push(Q)}}}return Ti(R)}function TD(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),wt([r],n)}function MD(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(wt([c],n))}return r}function ID(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Di([s,r],[l,r],n),d=u*(l-s),p=e/Di([s,r],[s,c],n),f=p*(c-r),m=l-s,g=c-r,y=Math.floor(m/d),_=Math.floor(g/f),P=(m-y*d)/2,w=(g-_*f)/2,b=s+P,x=0;x<y;x++){for(var A=r+w,M=0;M<_;M++){var D=wt([[[b,A],[b,A+f],[b+d,A+f],[b+d,A],[b,A]]],n.properties);n.mask?tD(n.mask,D)&&o.push(D):o.push(D),A+=f}b+=d}return Ti(o)}function DD(t,i,e){return e===void 0&&(e={}),ID(t,i,i,e)}function RD(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Di([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Di([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,m=null;c%2===0&&d%2===0?(f=wt([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=wt([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=wt([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),m=wt([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=wt([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Ph(e.mask,f)&&n.push(f),Ph(e.mask,m)&&n.push(m)):(n.push(f),n.push(m)),p+=l,d++}c++,u+=s}return Ti(n)}function FD(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(mM(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=To(t),l;switch(n){case"point":case"points":l=Z0(r,i,e);break;case"square":case"squares":l=DD(r,i,e);break;case"hex":case"hexes":l=AD(r,i,e);break;case"triangle":case"triangles":l=RD(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return dh(l,function(u){var d=0,p=0;dh(t,function(m){var g=n==="point"?u:QM(u),y=Di(g,m,e),_;if(o!==void 0&&(_=m.properties[o]),_===void 0&&(_=m.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=YM(u);f.properties[o]=d/p,c.push(f)}),Ti(c)}function zD(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const LC=(t=0)=>new Promise(i=>setTimeout(i,t));function LD(t,i){const e=Ti(t.map(c=>zn(c))),n=wt([t]);return FD(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Ct(zn(c),n))}function OD(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return or(e)}function ND(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const vl=class vl extends Gt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new ho(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const c=[...e.points,e.points[0]],u=e.sampleDistance,d=LD(c,u).map(b=>[...b,e.height]),p=Math.floor(e.extrudedHeight/u);if(p>0){const b=[...d];for(let x=1;x<=p;x++)d.push(...b.map(A=>[A[0],A[1],e.height+x*u]))}const{startTime:f,endTime:m,spanTime:g}=e,y=g*36e5,_=Math.floor((m-f)/y),P=Array(d.length).fill(0);e:for(let b=0;b<_;b++){if(await LC(),this._stopRun)break e;const x=new Date(f+b*y),A=OD(x);t:for(let M=0;M<d.length;M++){if(await LC(),this._stopRun)break t;zD(d[M],A,o.scene)||(P[M]=(P[M]*_+1)/_)}!this._stopRun&&(e.progress=Number(((b+1)/_*100).toFixed(2)))}const w=d.map((b,x)=>({position:[...b],color:ND(e.startColor,e.endColor,P[x]),pixelSize:10}));s.pointPrimitiveOptions=w},l=this.dv(a.createProcessingFromAsyncFunc(async c=>{await c.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}))}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),re(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),re(s,o,n,l,e),!0}return!1}};v(vl,"type",vl.register("ESCesiumViewer",a.ESSunshineAnalysis.type,vl));let gg=vl;const OC=(t=0)=>new Promise(i=>setTimeout(i,t)),Bo=class Bo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ae(e,n)),this._customPrimitive=this.disposeVar(new Fe(e,n)),this._geoDivPoi=this.disposeVar(new qe(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Ui(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
1877
|
+
***************************************************************************** */function cD(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Ln=(function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t})();function hD(t,i){return t>i?1:t<i?-1:0}function On(t,i,e){for(var n=new Ln(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function lg(t,i,e,n){var o=new Ln(t,i);if(e===null)return o.left=o.right=null,o;e=On(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function SC(t,i,e){var n=null,o=null;if(i){i=On(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function uD(t,i,e){return i===null?t:(t===null||(i=On(t.key,i,e),i.left=t),i)}function cg(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
|
|
1878
|
+
`);var s=i+(e?" ":"│ ");t.left&&cg(t.left,s,!1,n,o),t.right&&cg(t.right,s,!0,n,o)}}var hg=(function(){function t(i){i===void 0&&(i=hD),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=lg(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Ln(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=On(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=On(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=On(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=On(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=On(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return pD(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&pg(i,e,0,o-1,s),this._root===null)this._root=ug(i,e,0,o),this._size=o;else{var r=fD(this.toList(),dD(i,e),s);o=this._size+o,this._root=dg({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return cg(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=SC(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=lg(e,n,l,o):r=lg(e,n,r,o),this._root=uD(r,l,o)},t.prototype.split=function(i){return SC(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return cD(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function ug(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Ln(r,l);return c.left=ug(t,i,e,s),c.right=ug(t,i,s+1,n),c}return null}function dD(t,i){for(var e=new Ln(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Ln(t[o],i[o]);return n.next=null,e.next}function pD(t){for(var i=t,e=[],n=!1,o=new Ln(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function dg(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=dg(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=dg(t,o+1,e),r}return null}function fD(t,i,e){for(var n=new Ln(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function pg(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}pg(t,i,e,l,o),pg(t,i,l+1,n,o)}}const $r=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,fg=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Nn=Number.EPSILON;Nn===void 0&&(Nn=Math.pow(2,-52));const gD=Nn*Nn,xC=(t,i)=>{if(-Nn<t&&t<Nn&&-Nn<i&&i<Nn)return 0;const e=t-i;return e*e<gD*t*i?0:t<i?-1:1};class mD{constructor(){this.reset()}reset(){this.xRounder=new EC,this.yRounder=new EC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class EC{constructor(){this.tree=new hg,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&xC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&xC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const Xr=new mD,wh=(t,i)=>t.x*i.y-t.y*i.x,AC=(t,i)=>t.x*i.x+t.y*i.y,TC=(t,i,e)=>{const n=kM(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Ch=t=>Math.sqrt(AC(t,t)),vD=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return wh(o,n)/Ch(o)/Ch(n)},yD=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return AC(o,n)/Ch(o)/Ch(n)},MC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},IC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},wD=(t,i,e,n)=>{if(i.x===0)return IC(e,n,t.x);if(n.x===0)return IC(t,i,e.x);if(i.y===0)return MC(e,n,t.y);if(n.y===0)return MC(t,i,e.y);const o=wh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=wh(s,i)/o,l=wh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,m=(d+p)/2;return{x:f,y:m}};class ei{static compare(i,e){const n=ei.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Bn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:vD(this.point,i.point,s.point),cosine:yD(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let CD=0;class Bn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,m=d-c,g=r-o;if(p>f&&m<g)return 1;if(p<f&&m>g)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++CD,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=ei.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new ei(o,!0),u=new ei(s,!1);return new Bn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=fg(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=$r(e,l)&&this.comparePoint(l)===0,d=$r(n,s)&&i.comparePoint(s)===0,p=$r(e,c)&&this.comparePoint(c)===0,f=$r(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const m=wD(s,this.vector(),l,i.vector());return m===null||!$r(o,m)?null:Xr.round(m.x,m.y)}split(i){const e=[],n=i.events!==void 0,o=new ei(i,!0),s=new ei(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Bn(o,r,this.rings.slice(),this.windings.slice());return ei.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),ei.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Bn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(di.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===di.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${di.type}`)}return this._isInResult}}class DC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Xr.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Xr.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Bn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Bn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class _D{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new DC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new DC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class RC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new _D(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class _h{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let m=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){m=y;break}if(m!==null){const y=p.splice(m)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new _h(_.reverse()));continue}p.push({index:u.length,point:l.point});const g=l.getLeftmostComparator(r);c=f.sort(g)[0].otherSE;break}e.push(new _h(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;TC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];TC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];ei.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class FC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class PD{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new FC(s));else{const r=s.enclosingRing();r.poly||e.push(new FC(r)),r.poly.addInterior(s)}}return e}}class bD{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bn.compare;this.queue=i,this.tree=new hg(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=ei.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let m=0,g=f.length;m<g;m++)n.push(f[m])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const zC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,SD=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class xD{run(i,e,n){di.type=i,Xr.reset();const o=[new RC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new RC(n[p],!1));if(di.numMultiPolys=o.length,di.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)fg(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(di.type==="intersection")for(let p=0,f=o.length;p<f;p++){const m=o[p];for(let g=p+1,y=o.length;g<y;g++)if(fg(m.bbox,o[g].bbox)===null)return[]}const s=new hg(ei.compare);for(let p=0,f=o.length;p<f;p++){const m=o[p].getSweepEvents();for(let g=0,y=m.length;g<y;g++)if(s.insert(m[g]),s.size>zC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new bD(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const m=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${m.id} [${m.leftSE.point.x}, ${m.leftSE.point.y}] -> [${m.rightSE.point.x}, ${m.rightSE.point.y}] from queue.`)}if(s.size>zC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>SD)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let m=0,g=f.length;m<g;m++){const y=f[m];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}Xr.reset();const u=_h.factory(r.segments);return new PD(u).getGeom()}}const di=new xD;var ED={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return di.run("difference",t,e)}};function Ph(t,i,e){e===void 0&&(e={});var n=Ii(t),o=Ii(i),s=ED.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?wt(s[0],e.properties):fM(s,e.properties)}function AD(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Di([o,c],[r,c],e),p=d*(r-o),f=i*2/Di([u,s],[u,l],e),m=f*(l-s),g=p/2,y=g*2,_=Math.sqrt(3)/2*m,P=r-o,w=l-s,b=3/4*y,x=_,A=(P-y)/(y-g/2),M=Math.floor(A),D=(M*b-g/2-P)/2-g/2+b/2,L=Math.floor((w-_)/_),V=(w-L*_)/2,O=L*_-w>_/2;O&&(V-=_/4);for(var z=[],U=[],C=0;C<6;C++){var E=2*Math.PI/6*C;z.push(Math.cos(E)),U.push(Math.sin(E))}for(var R=[],B=0;B<=M;B++)for(var W=0;W<=L;W++){var Y=B%2===1;if(!(W===0&&Y)&&!(W===0&&O)){var q=B*b+o-D,X=W*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)MD([q,X],p/2,m/2,JSON.parse(n),z,U).forEach(function(ee){e.mask?Ph(e.mask,ee)&&R.push(ee):R.push(ee)});else{var Q=TD([q,X],p/2,m/2,JSON.parse(n),z,U);e.mask?Ph(e.mask,Q)&&R.push(Q):R.push(Q)}}}return Ti(R)}function TD(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),wt([r],n)}function MD(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(wt([c],n))}return r}function ID(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Di([s,r],[l,r],n),d=u*(l-s),p=e/Di([s,r],[s,c],n),f=p*(c-r),m=l-s,g=c-r,y=Math.floor(m/d),_=Math.floor(g/f),P=(m-y*d)/2,w=(g-_*f)/2,b=s+P,x=0;x<y;x++){for(var A=r+w,M=0;M<_;M++){var D=wt([[[b,A],[b,A+f],[b+d,A+f],[b+d,A],[b,A]]],n.properties);n.mask?lD(n.mask,D)&&o.push(D):o.push(D),A+=f}b+=d}return Ti(o)}function DD(t,i,e){return e===void 0&&(e={}),ID(t,i,i,e)}function RD(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Di([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Di([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,m=null;c%2===0&&d%2===0?(f=wt([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=wt([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=wt([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),m=wt([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=wt([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),m=wt([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Ph(e.mask,f)&&n.push(f),Ph(e.mask,m)&&n.push(m)):(n.push(f),n.push(m)),p+=l,d++}c++,u+=s}return Ti(n)}function FD(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(mM(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=To(t),l;switch(n){case"point":case"points":l=K0(r,i,e);break;case"square":case"squares":l=DD(r,i,e);break;case"hex":case"hexes":l=AD(r,i,e);break;case"triangle":case"triangles":l=RD(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return dh(l,function(u){var d=0,p=0;dh(t,function(m){var g=n==="point"?u:eI(u),y=Di(g,m,e),_;if(o!==void 0&&(_=m.properties[o]),_===void 0&&(_=m.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=JM(u);f.properties[o]=d/p,c.push(f)}),Ti(c)}function zD(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const LC=(t=0)=>new Promise(i=>setTimeout(i,t));function LD(t,i){const e=Ti(t.map(c=>zn(c))),n=wt([t]);return FD(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>_t(zn(c),n))}function OD(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return or(e)}function ND(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const vl=class vl extends Gt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new ho(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const c=[...e.points,e.points[0]],u=e.sampleDistance,d=LD(c,u).map(b=>[...b,e.height]),p=Math.floor(e.extrudedHeight/u);if(p>0){const b=[...d];for(let x=1;x<=p;x++)d.push(...b.map(A=>[A[0],A[1],e.height+x*u]))}const{startTime:f,endTime:m,spanTime:g}=e,y=g*36e5,_=Math.floor((m-f)/y),P=Array(d.length).fill(0);e:for(let b=0;b<_;b++){if(await LC(),this._stopRun)break e;const x=new Date(f+b*y),A=OD(x);t:for(let M=0;M<d.length;M++){if(await LC(),this._stopRun)break t;zD(d[M],A,o.scene)||(P[M]=(P[M]*_+1)/_)}!this._stopRun&&(e.progress=Number(((b+1)/_*100).toFixed(2)))}const w=d.map((b,x)=>({position:[...b],color:ND(e.startColor,e.endColor,P[x]),pixelSize:10}));s.pointPrimitiveOptions=w},l=this.dv(a.createProcessingFromAsyncFunc(async c=>{await c.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}))}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),re(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),re(s,o,n,l,e),!0}return!1}};v(vl,"type",vl.register("ESCesiumViewer",a.ESSunshineAnalysis.type,vl));let gg=vl;const OC=(t=0)=>new Promise(i=>setTimeout(i,t)),Bo=class Bo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ae(e,n)),this._customPrimitive=this.disposeVar(new Fe(e,n)),this._geoDivPoi=this.disposeVar(new qe(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Ui(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
1879
1879
|
uniform vec4 u_color;
|
|
1880
1880
|
void main()
|
|
1881
1881
|
{
|
|
@@ -1887,7 +1887,7 @@ void main()
|
|
|
1887
1887
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
1888
1888
|
}
|
|
1889
1889
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(a.track([this._customPrimitive,"show"],[this,"show"])),this.d(a.track([this._geoPolyline,"show"],[this,"show"])),this.d(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(a.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(a.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let s=function(u,d){const p=[];for(const f of d)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?p.push(`面积:${(u/1e6).toFixed(2)} km²`):p.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const m=u*(1/666.7);if(m>=15){const g=m/15;p.push(`面积:${g.toFixed(2)} 公顷`)}else p.push(`面积:${m.toFixed(2)} 亩`);break}return p};const r=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...s(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=no([...u].join(`
|
|
1890
|
-
`),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Qy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Bo.defaults.interpolationDistance,d=this.interpolation??Bo.defaults.interpolation,p=this.offsetHeight??Bo.defaults.offsetHeight,f=this.drillDepth??Bo.defaults.drillDepth,m=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);m.push(X)}var g=VD(m);if(isNaN(g.x)||isNaN(g.y)||isNaN(g.z)){console.warn("法向量计算错误!");return}var y=UD(m),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,g);P<0&&(g=NC(g),m.reverse());let w=h.Transforms.eastNorthUpToFixedFrame(y),b=h.Matrix4.inverseTransformation(w,new h.Matrix4);if(Math.abs(P)<.999){const q=WD(g,_);var x=NC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);b=h.Matrix4.multiply(q,A,A),w=h.Matrix4.inverse(b,new h.Matrix4)}var M=Ws(m,b),D=[],L=[],V=HD(M);if(d&&u>0){var O=GD(M);const q=Math.max(O.maxy-O.miny,O.maxx-O.minx);var z=YD(V,O,u);const X=await mg(z,w,b,g,o.scene,p,f,q);var U=ZD(M,u);const Q=await mg(U,w,b,g,o.scene,p,f,q);L.push(...X.world_cartesian),D.push(...X.local),L.push(...Q.world_cartesian),D.push(...Q.local);for(let ee=0;ee<M.length;++ee){const oe=M[ee];var C=await mg([oe],w,b,g,o.scene,p,f,q);if(C.local.length>0)D.push(...C.local),L.push(...C.world_cartesian);else{const fe=[oe.x,oe.y,oe.z+p];D.push(fe);var E=Ws([h.Cartesian3.fromArray(fe)],w);for(let ve=0;ve<E.length;++ve)L.push(E[ve])}}}else{const q=M.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));D=q,L=Ws(q,w)}var R=qD(D,V);const B=$D(L,R);this.totalArea=B;const W=[];D.forEach(q=>{const X=[q.x,q.y,q.z];X&&W.push(...X)});const Y={position:{typedArray:new Float32Array(W),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(w),this.customPrimitive.attributes=Y;const q=await BD([...R]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Bo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Mo=Bo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Mo||(Mo={})),a.extendClassProps(Mo.prototype,Mo.createDefaultProps);async function BD(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await OC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function VD(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function UD(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function NC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function WD(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function Ws(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function GD(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function HD(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function qD(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=B_.from(e).triangles;const o=[],s=wt([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;Ct([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function $D(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=XD(o)}return e}function XD(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function YD(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)kD([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function ZD(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=QD(n,o,i);e.push(...s)}return e}function QD(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function kD(t,i){var e=zn(t);if(!eD(zn(i[0]),zn(i[i.length-1])))return!1;var n=[];n.push(i);var o=wt(n);return Ct(e,o)}async function mg(t,i,e,n,o,s,r,l){var c=[];t.forEach(b=>{var x=b.clone();x.z=l,c.push(x)});var u=Ws(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],m=[];for(let b=0;b<u.length;++b){await OC();var g=u[b],y=new h.Ray(g,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(g,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var w=Ws([P],e);w.forEach(x=>{x.z+=s}),P=Ws(w,i)[0],m.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(w[0])}}}return{local:f,world:p,world_cartesian:m}}const yl=class yl extends Gt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Mo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&re(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&re(s,o,n,r.positions,e),!0):!1}};v(yl,"type",yl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,yl));let vg=yl;async function KD(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const wl=class wl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof De))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const m=document.createElement("span");p.appendChild(m),m.addEventListener("dblclick",function(){let y=m.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),KD(y)}),m.style.cursor="pointer",this.dispose(()=>p.removeChild(m));const g=document.createElement("span");d.appendChild(g),this.dispose(()=>d.removeChild(g));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{g.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",w="";const b=u.getCameraInfo();if(b){const M=(L,V)=>b.position[L].toFixed(V),D=(L,V)=>b.rotation[L].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${M(0,5)}° 纬度: ${M(1,5)}° 高度: ${M(2,2)}米 偏航角: ${D(0,2)}° 俯仰角: ${D(1,2)}° 翻滚角:${D(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const M=(D,L)=>x[D].toFixed(L);w=`鼠标位置:${M(0,5)}° ${M(1,5)}° ${M(2,2)}m`}else w="暂时无法获取鼠标位置...";m.innerText=w})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(wl,"type",wl.register("ESCesiumViewer",a.ESViewerStatusBar.type,wl));let yg=wl;const Cl=class Cl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof De))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const m=document.createElement("div");f.appendChild(m);const g=document.createElement("div");f.appendChild(g);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const w=document.createElement("div");_.appendChild(w);const b=document.createElement("span");y.appendChild(b);{const L=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(L)),L()}{const L=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(L)),L()}{const L=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(L)),L()}f.style.display="flex",m.style.fontWeight="bold",m.style.padding="0 0 0 25px";let x="EarthSDK";m.innerText=x,g.style.fontWeight="";let A="——免费开源地球可视化开发包";g.innerText=A,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",w.style.borderRight="1px solid #fff",w.style.borderLeft="1px solid #fff",w.style.borderBottom="1px solid #fff",w.style.position="absolute",w.style.height="10px",w.style.top="15px",w.style.width="75px",w.style.right=`${60/2}px`,b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const M=()=>{const L=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||L&&L>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const O=n.viewerLegend.legend.computedLengthInPixels;if(O){w.style.width=`${O}px`;const z=(135-O)/2;w.style.left=`${z}px`}}};M();const D=setInterval(()=>{M()},200);this.dispose(()=>clearInterval(D));{let L;const V=()=>{e.show?(d.style.display="block",L=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var C;let O="";const z=u.getCameraInfo();if(z){const E=(R,B)=>z.position[R].toFixed(B);O+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const U=(C=u.extensions)==null?void 0:C.cursorPositionInfo.cursorPosition;if(U){const E=(R,B)=>U[R].toFixed(B);O+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else O+="暂时无法获取鼠标位置...";b.innerText=O})),L.start()):(d.style.display="none",L.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Cl));let wg=Cl;const BC=h.Math.toDegrees,JD=new h.Cartographic;function VC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const g=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=g<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,m=h.Cartographic.fromCartesian(f,void 0,JD);return[BC(m.longitude),BC(m.latitude),m.height]}const _l=class _l extends mt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new Wt(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new Wt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[m,g,y]=u[0],_=[m,g,y+d];try{u.forEach((P,w)=>{if(w===0)return;const b=VC(_,P,o.scene);b?(p.push([P,b]),f.push([_,b])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),re(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),re(s,o,n,r,e),!0}}};v(_l,"type",_l.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,_l));let Cg=_l;class Yr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new Wt(e,n)),r=this.dv(new Wt(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const m=this.ad(new Ei(e,n));this.d(a.track([m,"show"],[this,"show"])),this.d(a.bind([m,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([m,"positions"],[this,"positions"])),this.d(a.bind([m,"depthTest"],[this,"depthTest"])),this.d(a.bind([m,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([m,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([m,"outline"],[this,"outline"])),this.d(a.bind([m,"color"],[this,"fillColor"])),this.d(a.bind([m,"fill"],[this,"filled"])),this.d(a.bind([m,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([m,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{m.flyTo(_)}));const g=()=>{m.positions=this.positions};g();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(g))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:m,maxPos:g}=a.getMinMaxCorner(this.positions),y=m[0],_=m[1],P=g[0],w=g[1],x={type:"Polygon",coordinates:[[...this.positions.map(U=>[U[0],U[1]])]]},A=[y,_,P,w],M=this.gridWidth,V=Z0(A,M,{units:"meters",mask:x}).features.map(U=>U.geometry.coordinates),O=h.Math.toRadians;return V.map(U=>new h.Cartographic(O(U[0]),O(U[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async m=>{const g=u();let y=0,_=300;const P=Math.ceil(g.length/_),w=[];do{let b=[];y===P-1?b=g.slice(y*_):b=g.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(b),A=await m.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const M=h.Math.toDegrees,D=A.filter(L=>L!=null).map(L=>[M(L.longitude),M(L.latitude),L.height]);w.push(...D)}y++}while(y<P);!w||!w.length||(this.gridPoints=w)}));let f=null;{const m=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let g=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(w=>{const b=this.positions;w[2]>b[0][2]?(g+=this.gridWidth*this.gridWidth*(w[2]-b[0][2]),y.push([w,[w[0],w[1],b[0][2]]])):(_+=this.gridWidth*this.gridWidth*(b[0][2]-w[2]),P.push([w,[w[0],w[1],b[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=Zy(this.positions),this.cutVolume=g,this.fillVolume=_,this.cutAndFillVolume=_-g,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};m(),this.d(this.gridPointsChanged.don(m)),this.d(()=>clearTimeout(f))}{const m=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};m(),this.d(this.positionsChanged.don(m))}{const m=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const g=JSON.parse(JSON.stringify(this.positions.slice(1)));g.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=g};m(),this.d(this.planeHeightChanged.don(m))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Yr||(Yr={})),a.extendClassProps(Yr.prototype,Yr.createDefaultProps);const Pl=class Pl extends Gt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Yr(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Pl));let _g=Pl;const bl=class bl extends Gt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ht(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new De.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(bl,"type",bl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,bl));let Pg=bl;const Sl=class Sl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Sl,"type",Sl.register("ESCesiumViewer",a.ESHumanPoi.type,Sl));let bg=Sl;const xl=class xl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,m;const u=(m=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:m._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(g=>g/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,m)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,m);const g=f.getProperty("layer"),y=f.getProperty("dataset"),_=g.toString(),P=y.toString(),w=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(w&&w.value.color){const x=w.value.color;return h.Color.fromCssColorString(x,m)}const b=l.filter(x=>x.dataset.toString()===P);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return h.Color.fromCssColorString(x,m)}else return h.Color.clone(h.Color.WHITE,m)}catch(g){return console.warn(g),h.Color.clone(h.Color.WHITE,m)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(i.visJson);for(let x=0;x<b.length;x++){const A=b[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const m=f.getProperty("layer"),g=f.getProperty("dataset"),y=m.toString(),_=g.toString(),P=l.find(b=>b.dataset.toString()===_&&b.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const w=l.filter(b=>b.dataset.toString()===_);return!(w.length==1&&w[0].value.visible===!1)}catch(m){return console.warn(m),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,m){return u(f,m)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v(xl,"type",xl.register("ESCesiumViewer",a.ESRtsTileset.type,xl));let Sg=xl;const El=class El extends Ss{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(El,"type",El.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,El));let xg=El;const Al=class Al extends Ss{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Al,"type",Al.register("ESCesiumViewer",a.ESMsTileset.type,Al));let Eg=Al;const Tl=class Tl extends we{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Kt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESStaticMesh.type,Tl));let Ag=Tl;const Ml=class Ml extends mt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new Hm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=le(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(re(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(re(o,n,e,n.points,i),!0):!1:!1}};v(Ml,"type",Ml.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Ml));let Tg=Ml;class jD extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new wi(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class eR extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const m=()=>{this.primitive&&(this.primitive.show=r.show)};m(),this.ad(r.showChanged.don(m))}{const m=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(m.don(p))}{const m=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(g=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:g}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=g,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),m(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
1890
|
+
`),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Qy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Bo.defaults.interpolationDistance,d=this.interpolation??Bo.defaults.interpolation,p=this.offsetHeight??Bo.defaults.offsetHeight,f=this.drillDepth??Bo.defaults.drillDepth,m=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);m.push(X)}var g=VD(m);if(isNaN(g.x)||isNaN(g.y)||isNaN(g.z)){console.warn("法向量计算错误!");return}var y=UD(m),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,g);P<0&&(g=NC(g),m.reverse());let w=h.Transforms.eastNorthUpToFixedFrame(y),b=h.Matrix4.inverseTransformation(w,new h.Matrix4);if(Math.abs(P)<.999){const q=WD(g,_);var x=NC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);b=h.Matrix4.multiply(q,A,A),w=h.Matrix4.inverse(b,new h.Matrix4)}var M=Ws(m,b),D=[],L=[],V=HD(M);if(d&&u>0){var O=GD(M);const q=Math.max(O.maxy-O.miny,O.maxx-O.minx);var z=YD(V,O,u);const X=await mg(z,w,b,g,o.scene,p,f,q);var U=ZD(M,u);const Q=await mg(U,w,b,g,o.scene,p,f,q);L.push(...X.world_cartesian),D.push(...X.local),L.push(...Q.world_cartesian),D.push(...Q.local);for(let ee=0;ee<M.length;++ee){const oe=M[ee];var C=await mg([oe],w,b,g,o.scene,p,f,q);if(C.local.length>0)D.push(...C.local),L.push(...C.world_cartesian);else{const fe=[oe.x,oe.y,oe.z+p];D.push(fe);var E=Ws([h.Cartesian3.fromArray(fe)],w);for(let ve=0;ve<E.length;++ve)L.push(E[ve])}}}else{const q=M.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));D=q,L=Ws(q,w)}var R=qD(D,V);const B=$D(L,R);this.totalArea=B;const W=[];D.forEach(q=>{const X=[q.x,q.y,q.z];X&&W.push(...X)});const Y={position:{typedArray:new Float32Array(W),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(w),this.customPrimitive.attributes=Y;const q=await BD([...R]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Bo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Mo=Bo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Mo||(Mo={})),a.extendClassProps(Mo.prototype,Mo.createDefaultProps);async function BD(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await OC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function VD(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function UD(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function NC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function WD(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function Ws(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function GD(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function HD(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function qD(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=B_.from(e).triangles;const o=[],s=wt([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;_t([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function $D(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=XD(o)}return e}function XD(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function YD(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)kD([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function ZD(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=QD(n,o,i);e.push(...s)}return e}function QD(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function kD(t,i){var e=zn(t);if(!aD(zn(i[0]),zn(i[i.length-1])))return!1;var n=[];n.push(i);var o=wt(n);return _t(e,o)}async function mg(t,i,e,n,o,s,r,l){var c=[];t.forEach(b=>{var x=b.clone();x.z=l,c.push(x)});var u=Ws(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],m=[];for(let b=0;b<u.length;++b){await OC();var g=u[b],y=new h.Ray(g,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(g,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var w=Ws([P],e);w.forEach(x=>{x.z+=s}),P=Ws(w,i)[0],m.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(w[0])}}}return{local:f,world:p,world_cartesian:m}}const yl=class yl extends Gt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Mo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&re(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&re(s,o,n,r.positions,e),!0):!1}};v(yl,"type",yl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,yl));let vg=yl;async function KD(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const wl=class wl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof De))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const m=document.createElement("span");p.appendChild(m),m.addEventListener("dblclick",function(){let y=m.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),KD(y)}),m.style.cursor="pointer",this.dispose(()=>p.removeChild(m));const g=document.createElement("span");d.appendChild(g),this.dispose(()=>d.removeChild(g));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{g.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",w="";const b=u.getCameraInfo();if(b){const M=(L,V)=>b.position[L].toFixed(V),D=(L,V)=>b.rotation[L].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${M(0,5)}° 纬度: ${M(1,5)}° 高度: ${M(2,2)}米 偏航角: ${D(0,2)}° 俯仰角: ${D(1,2)}° 翻滚角:${D(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const M=(D,L)=>x[D].toFixed(L);w=`鼠标位置:${M(0,5)}° ${M(1,5)}° ${M(2,2)}m`}else w="暂时无法获取鼠标位置...";m.innerText=w})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(wl,"type",wl.register("ESCesiumViewer",a.ESViewerStatusBar.type,wl));let yg=wl;const Cl=class Cl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof De))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const m=document.createElement("div");f.appendChild(m);const g=document.createElement("div");f.appendChild(g);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const w=document.createElement("div");_.appendChild(w);const b=document.createElement("span");y.appendChild(b);{const L=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(L)),L()}{const L=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(L)),L()}{const L=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(L)),L()}f.style.display="flex",m.style.fontWeight="bold",m.style.padding="0 0 0 25px";let x="EarthSDK";m.innerText=x,g.style.fontWeight="";let A="——免费开源地球可视化开发包";g.innerText=A,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",w.style.borderRight="1px solid #fff",w.style.borderLeft="1px solid #fff",w.style.borderBottom="1px solid #fff",w.style.position="absolute",w.style.height="10px",w.style.top="15px",w.style.width="75px",w.style.right=`${60/2}px`,b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const M=()=>{const L=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||L&&L>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const O=n.viewerLegend.legend.computedLengthInPixels;if(O){w.style.width=`${O}px`;const z=(135-O)/2;w.style.left=`${z}px`}}};M();const D=setInterval(()=>{M()},200);this.dispose(()=>clearInterval(D));{let L;const V=()=>{e.show?(d.style.display="block",L=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var C;let O="";const z=u.getCameraInfo();if(z){const E=(R,B)=>z.position[R].toFixed(B);O+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const U=(C=u.extensions)==null?void 0:C.cursorPositionInfo.cursorPosition;if(U){const E=(R,B)=>U[R].toFixed(B);O+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else O+="暂时无法获取鼠标位置...";b.innerText=O})),L.start()):(d.style.display="none",L.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Cl));let wg=Cl;const BC=h.Math.toDegrees,JD=new h.Cartographic;function VC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const g=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=g<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,m=h.Cartographic.fromCartesian(f,void 0,JD);return[BC(m.longitude),BC(m.latitude),m.height]}const _l=class _l extends mt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new Wt(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new Wt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[m,g,y]=u[0],_=[m,g,y+d];try{u.forEach((P,w)=>{if(w===0)return;const b=VC(_,P,o.scene);b?(p.push([P,b]),f.push([_,b])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),re(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),re(s,o,n,r,e),!0}}};v(_l,"type",_l.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,_l));let Cg=_l;class Yr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new Wt(e,n)),r=this.dv(new Wt(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const m=this.ad(new Ei(e,n));this.d(a.track([m,"show"],[this,"show"])),this.d(a.bind([m,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([m,"positions"],[this,"positions"])),this.d(a.bind([m,"depthTest"],[this,"depthTest"])),this.d(a.bind([m,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([m,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([m,"outline"],[this,"outline"])),this.d(a.bind([m,"color"],[this,"fillColor"])),this.d(a.bind([m,"fill"],[this,"filled"])),this.d(a.bind([m,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([m,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{m.flyTo(_)}));const g=()=>{m.positions=this.positions};g();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(g))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:m,maxPos:g}=a.getMinMaxCorner(this.positions),y=m[0],_=m[1],P=g[0],w=g[1],x={type:"Polygon",coordinates:[[...this.positions.map(U=>[U[0],U[1]])]]},A=[y,_,P,w],M=this.gridWidth,V=K0(A,M,{units:"meters",mask:x}).features.map(U=>U.geometry.coordinates),O=h.Math.toRadians;return V.map(U=>new h.Cartographic(O(U[0]),O(U[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async m=>{const g=u();let y=0,_=300;const P=Math.ceil(g.length/_),w=[];do{let b=[];y===P-1?b=g.slice(y*_):b=g.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(b),A=await m.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const M=h.Math.toDegrees,D=A.filter(L=>L!=null).map(L=>[M(L.longitude),M(L.latitude),L.height]);w.push(...D)}y++}while(y<P);!w||!w.length||(this.gridPoints=w)}));let f=null;{const m=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let g=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(w=>{const b=this.positions;w[2]>b[0][2]?(g+=this.gridWidth*this.gridWidth*(w[2]-b[0][2]),y.push([w,[w[0],w[1],b[0][2]]])):(_+=this.gridWidth*this.gridWidth*(b[0][2]-w[2]),P.push([w,[w[0],w[1],b[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=Zy(this.positions),this.cutVolume=g,this.fillVolume=_,this.cutAndFillVolume=_-g,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};m(),this.d(this.gridPointsChanged.don(m)),this.d(()=>clearTimeout(f))}{const m=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};m(),this.d(this.positionsChanged.don(m))}{const m=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const g=JSON.parse(JSON.stringify(this.positions.slice(1)));g.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=g};m(),this.d(this.planeHeightChanged.don(m))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Yr||(Yr={})),a.extendClassProps(Yr.prototype,Yr.createDefaultProps);const Pl=class Pl extends Gt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Yr(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(re(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Pl));let _g=Pl;const bl=class bl extends Gt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ht(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new De.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(bl,"type",bl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,bl));let Pg=bl;const Sl=class Sl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Sl,"type",Sl.register("ESCesiumViewer",a.ESHumanPoi.type,Sl));let bg=Sl;const xl=class xl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,m;const u=(m=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:m._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(g=>g/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,m)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,m);const g=f.getProperty("layer"),y=f.getProperty("dataset"),_=g.toString(),P=y.toString(),w=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(w&&w.value.color){const x=w.value.color;return h.Color.fromCssColorString(x,m)}const b=l.filter(x=>x.dataset.toString()===P);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return h.Color.fromCssColorString(x,m)}else return h.Color.clone(h.Color.WHITE,m)}catch(g){return console.warn(g),h.Color.clone(h.Color.WHITE,m)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(i.visJson);for(let x=0;x<b.length;x++){const A=b[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const m=f.getProperty("layer"),g=f.getProperty("dataset"),y=m.toString(),_=g.toString(),P=l.find(b=>b.dataset.toString()===_&&b.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const w=l.filter(b=>b.dataset.toString()===_);return!(w.length==1&&w[0].value.visible===!1)}catch(m){return console.warn(m),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,m){return u(f,m)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v(xl,"type",xl.register("ESCesiumViewer",a.ESRtsTileset.type,xl));let Sg=xl;const El=class El extends Ss{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(El,"type",El.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,El));let xg=El;const Al=class Al extends Ss{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Al,"type",Al.register("ESCesiumViewer",a.ESMsTileset.type,Al));let Eg=Al;const Tl=class Tl extends we{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Kt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESStaticMesh.type,Tl));let Ag=Tl;const Ml=class Ml extends mt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new Hm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=le(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(re(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(re(o,n,e,n.points,i),!0):!1:!1}};v(Ml,"type",Ml.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Ml));let Tg=Ml;class jD extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new wi(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class eR extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const m=()=>{this.primitive&&(this.primitive.show=r.show)};m(),this.ad(r.showChanged.don(m))}{const m=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(m.don(p))}{const m=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(g=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:g}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=g,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),m(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
1891
1891
|
in vec3 position3DHigh;
|
|
1892
1892
|
in vec3 position3DLow;
|
|
1893
1893
|
in vec3 normal;
|
|
@@ -2169,7 +2169,7 @@ void main (void)
|
|
|
2169
2169
|
out_FragColor = color;
|
|
2170
2170
|
// ------------------ skybox vtxf end -------------------
|
|
2171
2171
|
}
|
|
2172
|
-
`,Gn=h.Cartesian3,dz=h.defaultValue,tn=h.defined,pz=h.destroyObject,fz=h.Ellipsoid,E_=h.EllipsoidGeometry,gz=h.GeometryPipeline,Ys=h.Math,nn=h.Matrix4,mz=h.VertexFormat,vz=h.BufferUsage,yz=h.DrawCommand,wz=h.RenderState,Cz=h.ShaderProgram,A_=h.ShaderSource,_z=h.VertexArray,T_=h._shadersAtmosphereCommon,M_=h._shadersSkyAtmosphereCommon,Pz=h._shadersSkyAtmosphereVS,bz=h.Axis,Sz=h.BlendingState,xz=h.CullFace,I_=h.SceneMode,Ih=h.Transforms,Ez=h.Matrix3,D_=h.DeveloperError,Az=h.loadCubeMap,Tz=h.CubeMap;function Zs(t,i){t=dz(t,fz.WGS84),this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Gn.multiplyByScalar(t.radii,e,new Gn);this._scaleMatrix=nn.fromScale(n),this._modelMatrix=new nn,this._command=new yz({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Gn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Gn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Gn;const o=new Gn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new Ez,nn.getMatrix3(s._eunMatrix||nn.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(Zs.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Zs.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const om=new nn;Zs.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==I_.SCENE3D&&e!==I_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const g=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!tn(o.positiveX)||!tn(o.negativeX)||!tn(o.positiveY)||!tn(o.negativeY)||!tn(o.positiveZ)||!tn(o.negativeZ))throw new D_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new D_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?Az(g,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Tz({context:g,source:o}))}const s=nn.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Gn.ZERO,om),r=nn.multiplyTransformation(s,bz.Y_UP_TO_Z_UP,om),l=nn.multiply(this._scaleMatrix,r,om);nn.clone(l,this._modelMatrix);const c=t.context,u=Mz(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!tn(i)||!i.show,f=this._command;if(Ih.eastUpNorthToFixedFrame=Ih.eastUpNorthToFixedFrame||Ih.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Ih.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!tn(f.vertexArray)){const g=E_.createGeometry(new E_({radii:new Gn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:mz.POSITION_ONLY}));f.vertexArray=_z.fromGeometry({context:c,geometry:g,attributeLocations:gz.createAttributeLocations(g),bufferUsage:vz.STATIC_DRAW}),f.renderState=wz.fromCache({cull:{enabled:!0,face:xz.FRONT},blending:Sz.ALPHA_BLEND,depthMask:!1})}const m=u|p<<2|d<<3;if(m!==this._flags){this._flags=m;const g=[];u&&g.push("COLOR_CORRECT"),p&&g.push("PER_FRAGMENT_ATMOSPHERE"),d&&g.push("GLOBE_TRANSLUCENT");const y=new A_({defines:g,sources:[T_,M_,Pz]}),_=new A_({defines:g,sources:[T_,M_,uz]});this._spSkyAtmosphere=Cz.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:_}),f.shaderProgram=this._spSkyAtmosphere}if(tn(this._cubeMap))return f};function Mz(t){return!(Ys.equalsEpsilon(t.hueShift,0,Ys.EPSILON7)&&Ys.equalsEpsilon(t.saturationShift,0,Ys.EPSILON7)&&Ys.equalsEpsilon(t.brightnessShift,0,Ys.EPSILON7))}Zs.prototype.isDestroyed=function(){return!1},Zs.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),pz(this)};const nr=class nr extends a.Destroyable{constructor(e,n){super();v(this,"_navigationManager");v(this,"_envManager");v(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new ZF(s)),this._envManager=this.dv(new oz(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new nr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=x_(this._czmViewer.xbsjLocalBoxSources);if(l)return new nr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=De.latestDefaultAccessToken??De.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(gi(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,m){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(g,y)=>a.registerEventUpdate(this,g,y),p=De.defaults,f=(g,y)=>d(s[g+"Changed"],()=>{if(!Reflect.has(s,g))throw new Error(`!Reflect.has(czmViewer, ${g})`);if(!Reflect.has(p,g))throw new Error(`!Reflect.has(CzmViewer.defaults, ${g})`);y(s[g]??p[g])}),m=(g,y)=>d(s[g+"Changed"],()=>{if(!Reflect.has(s,g))throw new Error(`!Reflect.has(czmViewer, ${g})`);y(s[g])});f("splitPosition",g=>o.scene.splitPosition=g),f("resolutionScale",g=>o.resolutionScale=g),f("msaaSamples",g=>o.scene.msaaSamples=g),m("shadows",g=>o.shadows=g),f("scenePpsfxaaEnabled",g=>l.postProcessStages.fxaa.enabled=g),m("scenePpsAmbientOcclusionEnabled",g=>l.postProcessStages.ambientOcclusion.enabled=g),m("scenePpsAmbientOcclusionAmbientOcclusionOnly",g=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=g),m("scenePpsAmbientOcclusionIntensity",g=>l.postProcessStages.ambientOcclusion.uniforms.intensity=g),m("scenePpsAmbientOcclusionBias",g=>l.postProcessStages.ambientOcclusion.uniforms.bias=g),m("scenePpsAmbientOcclusionLengthCap",g=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=g),m("scenePpsAmbientOcclusionStepSize",g=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=g),m("scenePpsAmbientOcclusionBlurStepSize",g=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=g),m("scenePpsBloomEnabled",g=>l.postProcessStages.bloom.enabled=g),m("scenePpsBloomGlowOnly",g=>l.postProcessStages.bloom.uniforms.glowOnly=g),m("scenePpsBloomContrast",g=>l.postProcessStages.bloom.uniforms.contrast=g),m("scenePpsBloomBrightness",g=>l.postProcessStages.bloom.uniforms.brightness=g),m("scenePpsBloomDelta",g=>l.postProcessStages.bloom.uniforms.delta=g),m("scenePpsBloomSigma",g=>l.postProcessStages.bloom.uniforms.sigma=g),m("scenePpsBloomStepSize",g=>l.postProcessStages.bloom.uniforms.stepSize=g),f("globeShow",g=>l.globe.show=g),f("depthTestAgainstTerrain",g=>{l.globe.depthTestAgainstTerrain=g,l.globe.translucency.enabled=!g}),f("terrainOpacity",g=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(g,0,1)}),f("sceneGlobeShadows",g=>l.globe.shadows=h.ShadowMode[g]),m("sceneGlobeTerrainExaggeration",g=>l.globe.terrainExaggeration=g),m("sceneGlobeTerrainExaggerationRelativeHeight",g=>l.globe.terrainExaggerationRelativeHeight=g),m("sceneGlobeVerticalExaggeration",g=>l.globe.verticalExaggeration=g),m("sceneGlobeVerticalExaggerationRelativeHeight",g=>l.globe.verticalExaggerationRelativeHeight=g),m("sceneGlobeBackFaceCulling",g=>l.globe.backFaceCulling=g),m("sceneGlobeShowSkirts",g=>l.globe.showSkirts=g),m("sceneGlobeShowWaterEffect",g=>l.globe.showWaterEffect=g),m("sceneGlobeBaseColor",g=>l.globe.baseColor=te(g)),m("sceneGlobeCartographicLimitRectangle",g=>l.globe.cartographicLimitRectangle=We(g)),m("sceneGlobeClippingPlanes",g=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=rr(g??{enabled:!1});return}Ql(l.globe.clippingPlanes,g)}),m("sceneGlobeClippingPolygons",g=>{l.globe.clippingPolygons=g?kl(g):void 0}),f("sceneSunGlowFactor",g=>l.sun&&(l.sun.glowFactor=g)),f("moon",g=>l.moon&&(l.moon.show=g)),f("sceneMoonOnlySunLighting",g=>l.moon&&(l.moon.onlySunLighting=g)),f("sceneMoonTextureUrl",g=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(g))),m("sceneSkyBoxShow",g=>l._xbsjOriginSkyBox.show=g),f("sceneSkyBoxSources",g=>l._xbsjOriginSkyBox.sources=g&&x_(g)),m("atmosphere",g=>o.scene._xbsjOriginSkyAtmosphere.show=g),m("sceneBackgroundColor",g=>o.scene.backgroundColor=te(g)),f("sceneFogEnabled",g=>l.fog.enabled=g),f("sceneFogDensity",g=>l.fog.density=g),f("sceneFogScreenSpaceErrorFactor",g=>l.fog.screenSpaceErrorFactor=g),f("sceneFogMinimumBrightness",g=>l.fog.minimumBrightness=g),f("sceneDebugShowFramesPerSecond",g=>l.debugShowFramesPerSecond=g),f("sceneDebugShowCommands",g=>l.debugShowCommands=g),f("sceneDebugShowFrustums",g=>l.debugShowFrustums=g),f("sceneDebugShowFrustumPlanes",g=>l.debugShowFrustumPlanes=g),f("sceneDebugShowDepthFrustum",g=>l.debugShowDepthFrustum=g),f("sceneGlobeUndergroundColor",g=>u.undergroundColor=te(g)),f("sceneGlobeUndergroundColorAlphaByDistance",g=>u.undergroundColorAlphaByDistance=ln(g)),f("sceneGlobeTranslucencyEnabled",g=>u.translucency.enabled=g),f("sceneGlobeTranslucencyBackFaceAlpha",g=>u.translucency.backFaceAlpha=g),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",g=>u.translucency.backFaceAlphaByDistance=g&&ln(g)),f("sceneGlobeTranslucencyFrontFaceAlpha",g=>u.translucency.frontFaceAlpha=g),m("sceneGlobeTranslucencyFrontFaceAlphaByDistance",g=>u.translucency.frontFaceAlphaByDistance=g&&ln(g)),f("sceneGlobeTranslucencyRectangle",g=>u.translucency.rectangle=We(g)),f("sceneSplitPosition",g=>l.splitPosition=a.clamp(g,0,1)),f("sceneSsccEnableCollisionDetection",g=>l.screenSpaceCameraController.enableCollisionDetection=g),f("sceneSsccZoomFactor",g=>l.screenSpaceCameraController._zoomFactor=g);{const g=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};g(),this.d(s.showCesiumInspectorChanged.don(g))}f("cesiumInspectorWireframe",g=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=g)});{const g=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};g(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(g))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Qg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};v(nr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new Mh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),v(nr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();v(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new Zs(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let sm=nr;function Iz(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function Dz(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[Iz(r,c,l,u,d),s]}const Rz=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function Fz(t){return-Math.log2(t/Rz)}var rm=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function zz(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=rm[++e];);const n=i/rm[e-1]|0;return[n*rm[e-1],n,e]}class Lz extends a.Destroyable{constructor(){super();v(this,"_lengthInPixels",this.disposeVar(a.react(100)));v(this,"_resolution",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=zz(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class Oz extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!0)));v(this,"_resolution",this.dv(a.react(void 0)));v(this,"_center",this.dv(a.react(void 0)));v(this,"_zoom",this.dv(a.react(void 0)));v(this,"_legend",this.dv(new Lz));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(Dz(this._czmViewer));if(c){const[u,d]=c;s=u,r=Fz(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function Nz(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:Bz}=h,{ShaderDestination:Ro}=h,R_={name:"FlattenedPipelineStage"};R_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Ro.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Ro.BOTH),n.addUniform("vec4","u_flattenedBound",Ro.BOTH),n.addUniform("bool","u_flattened",Ro.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Ro.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Ro.BOTH),n.addUniform("bool","u_flattenDiscard",Ro.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=Bz(o,t.uniformMap)}};function F_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function z_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function L_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function O_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(R_),n}}F_(),z_(),L_(),O_();const Vz=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyEnabled:void 0,sceneGlobeTranslucencyBackFaceAlpha:void 0,sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlpha:void 0,sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(De.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),Uz=`
|
|
2172
|
+
`,Gn=h.Cartesian3,dz=h.defaultValue,tn=h.defined,pz=h.destroyObject,fz=h.Ellipsoid,E_=h.EllipsoidGeometry,gz=h.GeometryPipeline,Ys=h.Math,nn=h.Matrix4,mz=h.VertexFormat,vz=h.BufferUsage,yz=h.DrawCommand,wz=h.RenderState,Cz=h.ShaderProgram,A_=h.ShaderSource,_z=h.VertexArray,T_=h._shadersAtmosphereCommon,M_=h._shadersSkyAtmosphereCommon,Pz=h._shadersSkyAtmosphereVS,bz=h.Axis,Sz=h.BlendingState,xz=h.CullFace,I_=h.SceneMode,Ih=h.Transforms,Ez=h.Matrix3,D_=h.DeveloperError,Az=h.loadCubeMap,Tz=h.CubeMap;function Zs(t,i){t=dz(t,fz.WGS84),this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Gn.multiplyByScalar(t.radii,e,new Gn);this._scaleMatrix=nn.fromScale(n),this._modelMatrix=new nn,this._command=new yz({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Gn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Gn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Gn;const o=new Gn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new Ez,nn.getMatrix3(s._eunMatrix||nn.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(Zs.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Zs.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const om=new nn;Zs.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==I_.SCENE3D&&e!==I_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const g=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!tn(o.positiveX)||!tn(o.negativeX)||!tn(o.positiveY)||!tn(o.negativeY)||!tn(o.positiveZ)||!tn(o.negativeZ))throw new D_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new D_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?Az(g,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Tz({context:g,source:o}))}const s=nn.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Gn.ZERO,om),r=nn.multiplyTransformation(s,bz.Y_UP_TO_Z_UP,om),l=nn.multiply(this._scaleMatrix,r,om);nn.clone(l,this._modelMatrix);const c=t.context,u=Mz(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!tn(i)||!i.show,f=this._command;if(Ih.eastUpNorthToFixedFrame=Ih.eastUpNorthToFixedFrame||Ih.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Ih.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!tn(f.vertexArray)){const g=E_.createGeometry(new E_({radii:new Gn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:mz.POSITION_ONLY}));f.vertexArray=_z.fromGeometry({context:c,geometry:g,attributeLocations:gz.createAttributeLocations(g),bufferUsage:vz.STATIC_DRAW}),f.renderState=wz.fromCache({cull:{enabled:!0,face:xz.FRONT},blending:Sz.ALPHA_BLEND,depthMask:!1})}const m=u|p<<2|d<<3;if(m!==this._flags){this._flags=m;const g=[];u&&g.push("COLOR_CORRECT"),p&&g.push("PER_FRAGMENT_ATMOSPHERE"),d&&g.push("GLOBE_TRANSLUCENT");const y=new A_({defines:g,sources:[T_,M_,Pz]}),_=new A_({defines:g,sources:[T_,M_,uz]});this._spSkyAtmosphere=Cz.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:_}),f.shaderProgram=this._spSkyAtmosphere}if(tn(this._cubeMap))return f};function Mz(t){return!(Ys.equalsEpsilon(t.hueShift,0,Ys.EPSILON7)&&Ys.equalsEpsilon(t.saturationShift,0,Ys.EPSILON7)&&Ys.equalsEpsilon(t.brightnessShift,0,Ys.EPSILON7))}Zs.prototype.isDestroyed=function(){return!1},Zs.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),pz(this)};const nr=class nr extends a.Destroyable{constructor(e,n){super();v(this,"_navigationManager");v(this,"_envManager");v(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new ZF(s)),this._envManager=this.dv(new oz(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new nr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=x_(this._czmViewer.xbsjLocalBoxSources);if(l)return new nr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=De.latestDefaultAccessToken??De.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(gi(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,m){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(g,y)=>a.registerEventUpdate(this,g,y),p=De.defaults,f=(g,y)=>d(s[g+"Changed"],()=>{if(!Reflect.has(s,g))throw new Error(`!Reflect.has(czmViewer, ${g})`);if(!Reflect.has(p,g))throw new Error(`!Reflect.has(CzmViewer.defaults, ${g})`);y(s[g]??p[g])}),m=(g,y)=>d(s[g+"Changed"],()=>{if(!Reflect.has(s,g))throw new Error(`!Reflect.has(czmViewer, ${g})`);y(s[g])});f("splitPosition",g=>o.scene.splitPosition=g),f("resolutionScale",g=>o.resolutionScale=g),f("msaaSamples",g=>o.scene.msaaSamples=g),m("shadows",g=>o.shadows=g),f("scenePpsfxaaEnabled",g=>l.postProcessStages.fxaa.enabled=g),m("scenePpsAmbientOcclusionEnabled",g=>l.postProcessStages.ambientOcclusion.enabled=g),m("scenePpsAmbientOcclusionAmbientOcclusionOnly",g=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=g),m("scenePpsAmbientOcclusionIntensity",g=>l.postProcessStages.ambientOcclusion.uniforms.intensity=g),m("scenePpsAmbientOcclusionBias",g=>l.postProcessStages.ambientOcclusion.uniforms.bias=g),m("scenePpsAmbientOcclusionLengthCap",g=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=g),m("scenePpsAmbientOcclusionStepSize",g=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=g),m("scenePpsAmbientOcclusionBlurStepSize",g=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=g),m("scenePpsBloomEnabled",g=>l.postProcessStages.bloom.enabled=g),m("scenePpsBloomGlowOnly",g=>l.postProcessStages.bloom.uniforms.glowOnly=g),m("scenePpsBloomContrast",g=>l.postProcessStages.bloom.uniforms.contrast=g),m("scenePpsBloomBrightness",g=>l.postProcessStages.bloom.uniforms.brightness=g),m("scenePpsBloomDelta",g=>l.postProcessStages.bloom.uniforms.delta=g),m("scenePpsBloomSigma",g=>l.postProcessStages.bloom.uniforms.sigma=g),m("scenePpsBloomStepSize",g=>l.postProcessStages.bloom.uniforms.stepSize=g),f("globeShow",g=>l.globe.show=g),f("depthTestAgainstTerrain",g=>{l.globe.depthTestAgainstTerrain=g}),l.globe.translucency.enabled=!0,f("terrainOpacity",g=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(g,0,1)}),f("sceneGlobeShadows",g=>l.globe.shadows=h.ShadowMode[g]),m("sceneGlobeTerrainExaggeration",g=>l.globe.terrainExaggeration=g),m("sceneGlobeTerrainExaggerationRelativeHeight",g=>l.globe.terrainExaggerationRelativeHeight=g),m("sceneGlobeVerticalExaggeration",g=>l.globe.verticalExaggeration=g),m("sceneGlobeVerticalExaggerationRelativeHeight",g=>l.globe.verticalExaggerationRelativeHeight=g),m("sceneGlobeBackFaceCulling",g=>l.globe.backFaceCulling=g),m("sceneGlobeShowSkirts",g=>l.globe.showSkirts=g),m("sceneGlobeShowWaterEffect",g=>l.globe.showWaterEffect=g),m("sceneGlobeBaseColor",g=>l.globe.baseColor=te(g)),m("sceneGlobeCartographicLimitRectangle",g=>l.globe.cartographicLimitRectangle=We(g)),m("sceneGlobeClippingPlanes",g=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=rr(g??{enabled:!1});return}Ql(l.globe.clippingPlanes,g)}),m("sceneGlobeClippingPolygons",g=>{l.globe.clippingPolygons=g?kl(g):void 0}),f("sceneSunGlowFactor",g=>l.sun&&(l.sun.glowFactor=g)),f("moon",g=>l.moon&&(l.moon.show=g)),f("sceneMoonOnlySunLighting",g=>l.moon&&(l.moon.onlySunLighting=g)),f("sceneMoonTextureUrl",g=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(g))),m("sceneSkyBoxShow",g=>l._xbsjOriginSkyBox.show=g),f("sceneSkyBoxSources",g=>l._xbsjOriginSkyBox.sources=g&&x_(g)),m("atmosphere",g=>o.scene._xbsjOriginSkyAtmosphere.show=g),m("sceneBackgroundColor",g=>o.scene.backgroundColor=te(g)),f("sceneFogEnabled",g=>l.fog.enabled=g),f("sceneFogDensity",g=>l.fog.density=g),f("sceneFogScreenSpaceErrorFactor",g=>l.fog.screenSpaceErrorFactor=g),f("sceneFogMinimumBrightness",g=>l.fog.minimumBrightness=g),f("sceneDebugShowFramesPerSecond",g=>l.debugShowFramesPerSecond=g),f("sceneDebugShowCommands",g=>l.debugShowCommands=g),f("sceneDebugShowFrustums",g=>l.debugShowFrustums=g),f("sceneDebugShowFrustumPlanes",g=>l.debugShowFrustumPlanes=g),f("sceneDebugShowDepthFrustum",g=>l.debugShowDepthFrustum=g),f("sceneGlobeUndergroundColor",g=>u.undergroundColor=te(g)),f("sceneGlobeUndergroundColorAlphaByDistance",g=>u.undergroundColorAlphaByDistance=ln(g)),f("sceneGlobeTranslucencyEnabled",g=>u.translucency.enabled=g),f("sceneGlobeTranslucencyBackFaceAlpha",g=>u.translucency.backFaceAlpha=g),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",g=>u.translucency.backFaceAlphaByDistance=g&&ln(g)),f("sceneGlobeTranslucencyFrontFaceAlpha",g=>u.translucency.frontFaceAlpha=g),m("sceneGlobeTranslucencyFrontFaceAlphaByDistance",g=>u.translucency.frontFaceAlphaByDistance=g&&ln(g)),f("sceneGlobeTranslucencyRectangle",g=>u.translucency.rectangle=We(g)),f("sceneSplitPosition",g=>l.splitPosition=a.clamp(g,0,1)),f("sceneSsccEnableCollisionDetection",g=>l.screenSpaceCameraController.enableCollisionDetection=g),f("sceneSsccZoomFactor",g=>l.screenSpaceCameraController._zoomFactor=g);{const g=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};g(),this.d(s.showCesiumInspectorChanged.don(g))}f("cesiumInspectorWireframe",g=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=g)});{const g=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};g(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(g))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Qg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};v(nr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new Mh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),v(nr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();v(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new Zs(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let sm=nr;function Iz(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function Dz(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[Iz(r,c,l,u,d),s]}const Rz=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function Fz(t){return-Math.log2(t/Rz)}var rm=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function zz(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=rm[++e];);const n=i/rm[e-1]|0;return[n*rm[e-1],n,e]}class Lz extends a.Destroyable{constructor(){super();v(this,"_lengthInPixels",this.disposeVar(a.react(100)));v(this,"_resolution",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=zz(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class Oz extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!0)));v(this,"_resolution",this.dv(a.react(void 0)));v(this,"_center",this.dv(a.react(void 0)));v(this,"_zoom",this.dv(a.react(void 0)));v(this,"_legend",this.dv(new Lz));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(Dz(this._czmViewer));if(c){const[u,d]=c;s=u,r=Fz(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function Nz(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:Bz}=h,{ShaderDestination:Ro}=h,R_={name:"FlattenedPipelineStage"};R_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Ro.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Ro.BOTH),n.addUniform("vec4","u_flattenedBound",Ro.BOTH),n.addUniform("bool","u_flattened",Ro.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Ro.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Ro.BOTH),n.addUniform("bool","u_flattenDiscard",Ro.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=Bz(o,t.uniformMap)}};function F_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function z_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function L_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function O_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(R_),n}}F_(),z_(),L_(),O_();const Vz=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyEnabled:void 0,sceneGlobeTranslucencyBackFaceAlpha:void 0,sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlpha:void 0,sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(De.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),Uz=`
|
|
2173
2173
|
#### 示例代码1
|
|
2174
2174
|
\`\`\`
|
|
2175
2175
|
async function initCesiumViewer(container, czmViewer) {
|
|
@@ -2255,10 +2255,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2255
2255
|
`;function Gz(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2256
2256
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2257
2257
|
gitee地址:${t}
|
|
2258
|
-
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const ot=class ot extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",xh);v(this,"_moveObjectsProcess",this.ad(KC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new PR(this)),this.ad(new bR(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new AR(this)})),this._viewerLegend=this.dv(new Oz(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new sm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new xF(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Xt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],ot.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Bt(e),rotation:qo(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let s=o.positionWC;const r=h.Cartesian3.fromDegrees(...e),l=h.Cartesian3.distance(o.positionWC,r),c=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(c,c);const u=h.Transforms.rotationMatrixFromPositionVelocity(s,c,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(u,s);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),d,new h.Matrix4),m=h.Matrix4.getMatrix3(f,new h.Matrix3),g=h.Quaternion.fromRotationMatrix(m),y=h.HeadingPitchRoll.fromQuaternion(g);const _=qo(o);return{distance:l,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(_[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:_[1]-h.Math.toDegrees(y.pitch)}}flyIn(e,n,o,s="default"){var c;if(!n)return;n[0]=-n[0];const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&dr(l,r)}flyTo(e,n,o="default"){var m;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(m=this.viewer)==null?void 0:m.camera;return f&&dr(f,p)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&dr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Bt(e),rotation:qo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,ot.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Qm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Be(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=ot.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!ot.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=ot.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Et(e,n)}localPositionsToPositions(e,n){return fn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Be(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=ot.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",Wz,Uz,!0),new a.FunctionProperty([],()=>ot.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",n.sceneGlobeTranslucencyEnabled,!0),new a.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",n.sceneGlobeTranslucencyBackFaceAlpha,!0),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",n.sceneGlobeTranslucencyFrontFaceAlpha,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(ot,"type",ot.register("ESCesiumViewer",ot)),v(ot,"getCesiumIonToken",Gz),v(ot,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(ot,"latestDefaultAccessToken"),v(ot,"ObjectsToExcludeWrapper",ER),v(ot,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(ot,"getHeightsScartchCarto",new h.Cartographic);let De=ot;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...Vz()})})(De||(De={})),a.extendClassProps(De.prototype,De.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.2",e="2025-09-23T09:54:01.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="1d562b1b271a63e346761ef2eadb4f82d8a65742",l=((Date.now()-1758621241e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2258
|
+
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const ot=class ot extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",xh);v(this,"_moveObjectsProcess",this.ad(KC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new PR(this)),this.ad(new bR(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new AR(this)})),this._viewerLegend=this.dv(new Oz(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new sm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new xF(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Xt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],ot.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Bt(e),rotation:qo(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let s=o.positionWC;const r=h.Cartesian3.fromDegrees(...e),l=h.Cartesian3.distance(o.positionWC,r),c=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(c,c);const u=h.Transforms.rotationMatrixFromPositionVelocity(s,c,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(u,s);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),d,new h.Matrix4),m=h.Matrix4.getMatrix3(f,new h.Matrix3),g=h.Quaternion.fromRotationMatrix(m),y=h.HeadingPitchRoll.fromQuaternion(g);const _=qo(o);return{distance:l,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(_[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:_[1]-h.Math.toDegrees(y.pitch)}}flyIn(e,n,o,s="default"){var c;if(!n)return;n[0]=-n[0];const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&dr(l,r)}flyTo(e,n,o="default"){var m;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(m=this.viewer)==null?void 0:m.camera;return f&&dr(f,p)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&dr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Bt(e),rotation:qo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,ot.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Qm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Be(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=ot.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!ot.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=ot.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Et(e,n)}localPositionsToPositions(e,n){return fn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Be(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=ot.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",Wz,Uz,!0),new a.FunctionProperty([],()=>ot.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",n.sceneGlobeTranslucencyEnabled,!0),new a.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",n.sceneGlobeTranslucencyBackFaceAlpha,!0),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",n.sceneGlobeTranslucencyFrontFaceAlpha,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(ot,"type",ot.register("ESCesiumViewer",ot)),v(ot,"getCesiumIonToken",Gz),v(ot,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(ot,"latestDefaultAccessToken"),v(ot,"ObjectsToExcludeWrapper",ER),v(ot,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(ot,"getHeightsScartchCarto",new h.Cartographic);let De=ot;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...Vz()})})(De||(De={})),a.extendClassProps(De.prototype,De.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.4",e="2025-09-24T06:57:53.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="68cd621b33e0c85c47fbbd4116bf77c0f96320ec",l=((Date.now()-1758697073e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2259
2259
|
%c${o?o+`
|
|
2260
2260
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2261
|
-
`;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2261
|
+
`;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","68cd621b33e0c85c47fbbd4116bf77c0f96320ec")},get info(){return c},get date(){return"2025-09-24T06:57:53.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.4"},get name(){return"earthsdk3-cesium"},get commitId(){return"68cd621b33e0c85c47fbbd4116bf77c0f96320ec"},print(){console.info(this.info,`
|
|
2262
2262
|
font-size: 18px;
|
|
2263
2263
|
font-weight: 1000;
|
|
2264
2264
|
line-height: 1;
|
|
@@ -2275,4 +2275,4 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2275
2275
|
color: rgb(0, 120, 215);
|
|
2276
2276
|
padding-bottom: 2px;
|
|
2277
2277
|
padding-left: 35px;
|
|
2278
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=I.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&I.copyright.print()}catch{}W_(),I.BaseEditingWrapper=yt,I.CircularAppendEditing=$C,I.CircularAppendEditingWrapper=Vg,I.CircularInsertEditing=YC,I.CircularInsertEditingWrapper=Ug,I.CurrentPositionsCenter=ru,I.CurrentScale=su,I.CurrentSceneScalePoi=$m,I.CursorFloatDiv=nb,I.CursorInfo=ob,I.Czm3DTiles=Se,I.CzmCameraChanged=Jl,I.CzmCanvasAndDivSwitchPoi=rb,I.CzmCanvasPoi=Pu,I.CzmCircle=lo,I.CzmCircleGroundPrimitive=Pn,I.CzmCircleOutlinePrimitive=bn,I.CzmCirclePrimitive=_n,I.CzmClippingPlanes=bs,I.CzmClock=ue,I.CzmCustomPrimitive=Fe,I.CzmDivPoi=bu,I.CzmES3DTileset=Ss,I.CzmESAlarm=Ed,I.CzmESApertureEffect=Ad,I.CzmESAreaMeasurement=Td,I.CzmESBlastParticleSystem=Md,I.CzmESBoxClipping=Id,I.CzmESCameraView=Dd,I.CzmESCameraVisibleRange=Rd,I.CzmESCar=Fd,I.CzmESCityBasePoint=Ld,I.CzmESClassification=Od,I.CzmESClippingPlane=bd,I.CzmESCustomPrimitive=Tp,I.CzmESCzml=Nd,I.CzmESDataMesh=Bd,I.CzmESDirectionMeasurement=Vd,I.CzmESDistanceMeasurement=Ud,I.CzmESDynamicWater=Mp,I.CzmESEntityCluster=Ip,I.CzmESExcavate=Wd,I.CzmESFireParticleSystem=Gd,I.CzmESGeHistoryImagery=Dp,I.CzmESGeoBezierPath=qd,I.CzmESGeoDiv=$d,I.CzmESGeoDivTextPoi=Xd,I.CzmESGeoExtrudedPolygon=Pg,I.CzmESGeoJson=Yd,I.CzmESGeoLineString=Ms,I.CzmESGeoPoints=Ig,I.CzmESGeoPolygon=Gt,I.CzmESGeoPolygonImpl=Ei,I.CzmESGeoRectangle=Zd,I.CzmESGeoSmoothPolygon=Qd,I.CzmESGeoVector=mt,I.CzmESGeoWater=Rp,I.CzmESGltfModel=kd,I.CzmESHeatMap=Mg,I.CzmESHeightMeasurement=Kd,I.CzmESHuman=jd,I.CzmESHumanPoi=bg,I.CzmESImageLabel=ep,I.CzmESImageryLayer=tp,I.CzmESKml=gp,I.CzmESLabel=Dr,I.CzmESLocalCircle=mp,I.CzmESLocalLineString=vp,I.CzmESLocalLineStringZ=yp,I.CzmESLocalPolygon=wp,I.CzmESLocalPolygonZ=Cp,I.CzmESLocalRectangle=_p,I.CzmESLocalSkyBox=ip,I.CzmESLocalVector=Kc,I.CzmESLocationMeasurement=np,I.CzmESMVTLayer=Fp,I.CzmESMsTileset=Eg,I.CzmESNavigator=Pp,I.CzmESObjectWithLocation=we,I.CzmESParticleSystemPrimitive=op,I.CzmESPath=bp,I.CzmESPipeFence=zp,I.CzmESPipeline=Lp,I.CzmESPipeserTileset=Np,I.CzmESPit=Bp,I.CzmESPoi2D=sp,I.CzmESPoi3D=rp,I.CzmESPolygonFence=Sp,I.CzmESPolygonFlattenedPlane=xd,I.CzmESPolygonWithHole=Vp,I.CzmESRectangle=xp,I.CzmESRoad=Ep,I.CzmESRtsFeatureEditing=xg,I.CzmESRtsTileset=Sg,I.CzmESScale=Ap,I.CzmESSignalTransmission=Wp,I.CzmESSkylineAnalysis=Tg,I.CzmESStaticMesh=Ag,I.CzmESSubmergingAnalysis=ap,I.CzmESSunshineAnalysis=gg,I.CzmESSurfaceAreaMeasurement=vg,I.CzmESTerrainLayer=lp,I.CzmESTextLabel=cp,I.CzmESUEWidget=hp,I.CzmESUnrealActor=up,I.CzmESVideoFusion=dp,I.CzmESViewShed=pp,I.CzmESViewerStatusBar=yg,I.CzmESViewerStatusBarScale=wg,I.CzmESVisibilityAnalysis=Cg,I.CzmESVisualObject=Zt,I.CzmESVolumeMeasurement=_g,I.CzmESWidget=fp,I.CzmFlattenedPlane=Fn,I.CzmGlobeMaterial=mo,I.CzmImageModel=Gi,I.CzmImagery=Dn,I.CzmModelPrimitive=rt,I.CzmParticleSystemPrimitive=yi,I.CzmPicking=Hm,I.CzmPoint=Kt,I.CzmPointPrimitiveCollection=ho,I.CzmPoisContext=nv,I.CzmPolygon=Jo,I.CzmPolygonClipping=Is,I.CzmPolygonGroundPrimitive=Ko,I.CzmPolygonGroundPrimitiveWithHeight=ns,I.CzmPolygonPrimitive=mn,I.CzmPolygonPrimitiveWithHeight=wn,I.CzmPolygonWithHeight=Cn,I.CzmPolyline=Ae,I.CzmPolylineGroundPrimitive=ts,I.CzmPolylinePrimitive=is,I.CzmPolylines=li,I.CzmPolylinesGroundPrimitive=ko,I.CzmPolylinesPrimitive=Wt,I.CzmRectangle=wi,I.CzmSignalTransmission=ki,I.CzmTexture=Le,I.CzmView=Tt,I.CzmViewDistanceRangeControl=Zn,I.CzmWater=co,I.CzmWaterPrimitive=mr,I.DoublePointsAppendEditing=Hs,I.DoublePointsAppendEditingWrapper=Ng,I.DoublePointsModifyEditing=Do,I.DoublePointsModifyEditingWrapper=Bg,I.ESCesiumViewer=De,I.ESCustomPrimitive=nh,I.ESGeHistoryImagery=eh,I.ESGeoBezierPath=rh,I.ESGeoSmoothPolygon=Lr,I.ESKml=th,I.ESLocalLineString=ih,I.ESLocalLineStringZ=zr,I.ESMVTLayer=jc,I.ESRoad=sh,I.ESSignalTransmission=oh,I.GeoCanvasImagePoi=mi,I.GeoCanvasMenuPoi=jo,I.GeoCanvasPoi=Wi,I.GeoCanvasPointPoi=vn,I.GeoCustomDivPoi=qe,I.GeoDivSwitchPoi=ro,I.GeoDivTextPoi=vi,I.GeoPolylinePath=Ds,I.HeightModifyEditing=kC,I.HeightModifyEditingWrapper=Yg,I.ImageLabel2D=u0,I.ImageLabel3D=d0,I.ImageriesManager=f_,I.LabelManager=p_,I.LineStringAppendEditing=qC,I.LineStringAppendEditingWrapper=Wg,I.LineStringInsertEditing=XC,I.LineStringInsertEditingWrapper=Gg,I.PickingManager=g_,I.PlaceEditing=zi,I.PlaceEditingWrapper=zg,I.PolylinePath=Ps,I.ResourceHandler=Qo,I.RotationEditing=pi,I.RotationEditingWrapper=Lg,I.ScaleEditing=ji,I.ScaleEditingWrapper=Og,I.ScatterAppendEditing=ZC,I.ScatterAppendEditingWrapper=Hg,I.ScatterModifyEditing=QC,I.ScatterModifyEditingWrapper=qg,I.SharedTexturePool=tv,I.SmoothMoving=qm,I.TerrainManager=d_,I.TextLabel2D=f0,I.TextLabel3D=g0,I.ToGCJ02WebMercatorTilingScheme=Iy,I.ToWGS84WebMercatorTilingScheme=Dy,I.TranslationEditing=Ji,I.TranslationEditingWrapper=Sh,I.ViewerExtensions=m_,I.VisibilityAppendEditing=qs,I.VisibilityAppendEditingWrapper=$g,I.VisibilityModifyEditing=$s,I.VisibilityModifyEditingWrapper=Xg,I.Widget2D=yn,I.Widget3D=uc,I.WinPosFromCartesian=ec,I.XbsjGroundPolylinePrimitive=xi,I._ESEditModeInstance=xh,I.angleToHumanStr=hr,I.areaToHumanStr=oP,I.bindNorthRotation=je,I.capture=Qm,I.checkAndConvertImage=nP,I.computeCutPoint=VC,I.computeCzmModelMatrix=Re,I.computePickingInfoWithCoordinates=Yh,I.createClippingPlaneCollection=rr,I.createClippingPolygonCollection=kl,I.createGeoBoudingSphereReactFromPositions=Zm,I.createHelperLine=u1,I.createInfoPoi=fu,I.createInnerClassFromJson=hu,I.createInnerHtmlWithWhiteTextBlackBackground=no,I.createMaterialFromJson=_m,I.createMaterialRef=ai,I.createMoveObjectsProcessing=KC,I.createPolygonHierarchy=Vi,I.createTexture=to,I.createTextureFromImage=Cu,I.createTilingSchema=fi,I.czmFlyTo=dr,I.czmModelActiveAnimationsWithVisible=oc,I.czmSubscribeAndEvaluate=gi,I.defaultFlyToRotation=Qt,I.distanceToHumanStr=rc,I.extendComponentProps=sP,I.flyTo=se,I.flyWithPosition=kt,I.flyWithPositions=re,I.flyWithPrimitive=At,I.fromCartesian=H_,I.fromCartesian2=cm,I.fromCartesian3=or,I.fromCartesian4=hm,I.fromCartographic=Ho,I.fromColor=$_,I.fromDistanceDisplayCondition=Z_,I.fromEllipsoid=i1,I.fromHeadingPitchRoll=Y_,I.fromNearFarScalar=X_,I.fromQuaternion=k_,I.fromRectangle=e1,I.generateCartesianArc=zm,I.geoNeareastPointOnRhumbLine=Qn,I.geoNeareastPointOnRhumbLine2=d1,I.geoPolylineToBezierSpline=gu,I.getCameraPosition=Bt,I.getCameraRotation=qo,I.getCameraTargetPos=fm,I.getCenterAndViewDistance=mu,I.getCzmCode=j1,I.getDefaultComponentProps=rP,I.getDefaultWinPosAndDepth=C1,I.getDetailedTerrainDistance=Jm,I.getDirectionVectorFromRotation=xm,I.getDistancesAndTimePosRotsFromPositions=iu,I.getElevationMatrix=Nz,I.getEllipsoidGeodesicCenter=Kh,I.getFlyToCenterAndRotation=ac,I.getFoveatedInterpolationCallback=Gy,I.getFuncFromStr=uu,I.getGroundTerrainDistance=Km,I.getGroundTerrainDistances=km,I.getIncludedAngleFromPositions=Bm,I.getInverseModelMatrix=Om,I.getMinMaxPosition=Ym,I.getModelMatrixFromPosition=nu,I.getObjectProperties=oo,I.getPointerEventButton=Ui,I.getPolygonPointsFromHierarchy=ou,I.getQuaternion=Hh,I.getQuaternionWithXForwardZUp=dm,I.getQuaternionWithYForwardZUp=Kl,I.getResource=Ut,I.getSceneScaleForScreenPixelSize=Bi,I.getSharedTexturePool=iv,I.getTilingSchemeStr=bE,I.getViewerExtensions=Xt,I.getWinPos=Sm,I.getXbsjWaterMaterial=Um,I.hackCesium3DTileset=z_,I.hackCzmModel3DTileContent=L_,I.hackModel=F_,I.hackModelSceneGraph=O_,I.imgUrlToBase64=so,I.localPositionToPosition=pn,I.localPositionsToPositions=fn,I.merge3dTilesServer=X1,I.pickHeightPosition=jl,I.pickPosition=wm,I.pickVirtualEarth=$o,I.pickVirtualPlane=Cm,I.positionAndRotationToQuaternion=j_,I.positionFromCartesian=le,I.positionToCartesian=Be,I.positionToHumanStr=du,I.positionToLocalPosition=Nm,I.positionsToLocalPositions=Et,I.positionsToUniqueCartesians=ht,I.rectangleIsGlobal=cu,I.rpToap=sc,I.setClippingPlaneCollection=Ql,I.setCylinderGeometry=pu,I.setModelMaterial=cr,I.setRectangleGeometry=Xm,I.setViewerExtensions=em,I.toCartesian=ri,I.toCartesian2=be,I.toCartesian3=si,I.toCartesian4=Gh,I.toCartographic=q_,I.toCoefficients=lu,I.toColor=te,I.toDistanceDisplayCondition=sr,I.toEllipsoid=_e,I.toHeadingPitchRoll=um,I.toNearFarScalar=ln,I.toQuaternion=Q_,I.toRectangle=We,I.toRgbaString=gn,I.updateEnvironmentMapManager=au,I.updateMaterialFromJson=kh,I.winPosAndDepthEqual=bm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
2278
|
+
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=I.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&I.copyright.print()}catch{}W_(),I.BaseEditingWrapper=yt,I.CircularAppendEditing=$C,I.CircularAppendEditingWrapper=Vg,I.CircularInsertEditing=YC,I.CircularInsertEditingWrapper=Ug,I.CurrentPositionsCenter=ru,I.CurrentScale=su,I.CurrentSceneScalePoi=$m,I.CursorFloatDiv=nb,I.CursorInfo=ob,I.Czm3DTiles=Se,I.CzmCameraChanged=Jl,I.CzmCanvasAndDivSwitchPoi=rb,I.CzmCanvasPoi=Pu,I.CzmCircle=lo,I.CzmCircleGroundPrimitive=Pn,I.CzmCircleOutlinePrimitive=bn,I.CzmCirclePrimitive=_n,I.CzmClippingPlanes=bs,I.CzmClock=ue,I.CzmCustomPrimitive=Fe,I.CzmDivPoi=bu,I.CzmES3DTileset=Ss,I.CzmESAlarm=Ed,I.CzmESApertureEffect=Ad,I.CzmESAreaMeasurement=Td,I.CzmESBlastParticleSystem=Md,I.CzmESBoxClipping=Id,I.CzmESCameraView=Dd,I.CzmESCameraVisibleRange=Rd,I.CzmESCar=Fd,I.CzmESCityBasePoint=Ld,I.CzmESClassification=Od,I.CzmESClippingPlane=bd,I.CzmESCustomPrimitive=Tp,I.CzmESCzml=Nd,I.CzmESDataMesh=Bd,I.CzmESDirectionMeasurement=Vd,I.CzmESDistanceMeasurement=Ud,I.CzmESDynamicWater=Mp,I.CzmESEntityCluster=Ip,I.CzmESExcavate=Wd,I.CzmESFireParticleSystem=Gd,I.CzmESGeHistoryImagery=Dp,I.CzmESGeoBezierPath=qd,I.CzmESGeoDiv=$d,I.CzmESGeoDivTextPoi=Xd,I.CzmESGeoExtrudedPolygon=Pg,I.CzmESGeoJson=Yd,I.CzmESGeoLineString=Ms,I.CzmESGeoPoints=Ig,I.CzmESGeoPolygon=Gt,I.CzmESGeoPolygonImpl=Ei,I.CzmESGeoRectangle=Zd,I.CzmESGeoSmoothPolygon=Qd,I.CzmESGeoVector=mt,I.CzmESGeoWater=Rp,I.CzmESGltfModel=kd,I.CzmESHeatMap=Mg,I.CzmESHeightMeasurement=Kd,I.CzmESHuman=jd,I.CzmESHumanPoi=bg,I.CzmESImageLabel=ep,I.CzmESImageryLayer=tp,I.CzmESKml=gp,I.CzmESLabel=Dr,I.CzmESLocalCircle=mp,I.CzmESLocalLineString=vp,I.CzmESLocalLineStringZ=yp,I.CzmESLocalPolygon=wp,I.CzmESLocalPolygonZ=Cp,I.CzmESLocalRectangle=_p,I.CzmESLocalSkyBox=ip,I.CzmESLocalVector=Kc,I.CzmESLocationMeasurement=np,I.CzmESMVTLayer=Fp,I.CzmESMsTileset=Eg,I.CzmESNavigator=Pp,I.CzmESObjectWithLocation=we,I.CzmESParticleSystemPrimitive=op,I.CzmESPath=bp,I.CzmESPipeFence=zp,I.CzmESPipeline=Lp,I.CzmESPipeserTileset=Np,I.CzmESPit=Bp,I.CzmESPoi2D=sp,I.CzmESPoi3D=rp,I.CzmESPolygonFence=Sp,I.CzmESPolygonFlattenedPlane=xd,I.CzmESPolygonWithHole=Vp,I.CzmESRectangle=xp,I.CzmESRoad=Ep,I.CzmESRtsFeatureEditing=xg,I.CzmESRtsTileset=Sg,I.CzmESScale=Ap,I.CzmESSignalTransmission=Wp,I.CzmESSkylineAnalysis=Tg,I.CzmESStaticMesh=Ag,I.CzmESSubmergingAnalysis=ap,I.CzmESSunshineAnalysis=gg,I.CzmESSurfaceAreaMeasurement=vg,I.CzmESTerrainLayer=lp,I.CzmESTextLabel=cp,I.CzmESUEWidget=hp,I.CzmESUnrealActor=up,I.CzmESVideoFusion=dp,I.CzmESViewShed=pp,I.CzmESViewerStatusBar=yg,I.CzmESViewerStatusBarScale=wg,I.CzmESVisibilityAnalysis=Cg,I.CzmESVisualObject=Zt,I.CzmESVolumeMeasurement=_g,I.CzmESWidget=fp,I.CzmFlattenedPlane=Fn,I.CzmGlobeMaterial=mo,I.CzmImageModel=Gi,I.CzmImagery=Dn,I.CzmModelPrimitive=rt,I.CzmParticleSystemPrimitive=yi,I.CzmPicking=Hm,I.CzmPoint=Kt,I.CzmPointPrimitiveCollection=ho,I.CzmPoisContext=nv,I.CzmPolygon=Jo,I.CzmPolygonClipping=Is,I.CzmPolygonGroundPrimitive=Ko,I.CzmPolygonGroundPrimitiveWithHeight=ns,I.CzmPolygonPrimitive=mn,I.CzmPolygonPrimitiveWithHeight=wn,I.CzmPolygonWithHeight=Cn,I.CzmPolyline=Ae,I.CzmPolylineGroundPrimitive=ts,I.CzmPolylinePrimitive=is,I.CzmPolylines=li,I.CzmPolylinesGroundPrimitive=ko,I.CzmPolylinesPrimitive=Wt,I.CzmRectangle=wi,I.CzmSignalTransmission=ki,I.CzmTexture=Le,I.CzmView=Tt,I.CzmViewDistanceRangeControl=Zn,I.CzmWater=co,I.CzmWaterPrimitive=mr,I.DoublePointsAppendEditing=Hs,I.DoublePointsAppendEditingWrapper=Ng,I.DoublePointsModifyEditing=Do,I.DoublePointsModifyEditingWrapper=Bg,I.ESCesiumViewer=De,I.ESCustomPrimitive=nh,I.ESGeHistoryImagery=eh,I.ESGeoBezierPath=rh,I.ESGeoSmoothPolygon=Lr,I.ESKml=th,I.ESLocalLineString=ih,I.ESLocalLineStringZ=zr,I.ESMVTLayer=jc,I.ESRoad=sh,I.ESSignalTransmission=oh,I.GeoCanvasImagePoi=mi,I.GeoCanvasMenuPoi=jo,I.GeoCanvasPoi=Wi,I.GeoCanvasPointPoi=vn,I.GeoCustomDivPoi=qe,I.GeoDivSwitchPoi=ro,I.GeoDivTextPoi=vi,I.GeoPolylinePath=Ds,I.HeightModifyEditing=kC,I.HeightModifyEditingWrapper=Yg,I.ImageLabel2D=u0,I.ImageLabel3D=d0,I.ImageriesManager=f_,I.LabelManager=p_,I.LineStringAppendEditing=qC,I.LineStringAppendEditingWrapper=Wg,I.LineStringInsertEditing=XC,I.LineStringInsertEditingWrapper=Gg,I.PickingManager=g_,I.PlaceEditing=zi,I.PlaceEditingWrapper=zg,I.PolylinePath=Ps,I.ResourceHandler=Qo,I.RotationEditing=pi,I.RotationEditingWrapper=Lg,I.ScaleEditing=ji,I.ScaleEditingWrapper=Og,I.ScatterAppendEditing=ZC,I.ScatterAppendEditingWrapper=Hg,I.ScatterModifyEditing=QC,I.ScatterModifyEditingWrapper=qg,I.SharedTexturePool=tv,I.SmoothMoving=qm,I.TerrainManager=d_,I.TextLabel2D=f0,I.TextLabel3D=g0,I.ToGCJ02WebMercatorTilingScheme=Iy,I.ToWGS84WebMercatorTilingScheme=Dy,I.TranslationEditing=Ji,I.TranslationEditingWrapper=Sh,I.ViewerExtensions=m_,I.VisibilityAppendEditing=qs,I.VisibilityAppendEditingWrapper=$g,I.VisibilityModifyEditing=$s,I.VisibilityModifyEditingWrapper=Xg,I.Widget2D=yn,I.Widget3D=uc,I.WinPosFromCartesian=ec,I.XbsjGroundPolylinePrimitive=xi,I._ESEditModeInstance=xh,I.angleToHumanStr=hr,I.areaToHumanStr=oP,I.bindNorthRotation=je,I.capture=Qm,I.checkAndConvertImage=nP,I.computeCutPoint=VC,I.computeCzmModelMatrix=Re,I.computePickingInfoWithCoordinates=Yh,I.createClippingPlaneCollection=rr,I.createClippingPolygonCollection=kl,I.createGeoBoudingSphereReactFromPositions=Zm,I.createHelperLine=u1,I.createInfoPoi=fu,I.createInnerClassFromJson=hu,I.createInnerHtmlWithWhiteTextBlackBackground=no,I.createMaterialFromJson=_m,I.createMaterialRef=ai,I.createMoveObjectsProcessing=KC,I.createPolygonHierarchy=Vi,I.createTexture=to,I.createTextureFromImage=Cu,I.createTilingSchema=fi,I.czmFlyTo=dr,I.czmModelActiveAnimationsWithVisible=oc,I.czmSubscribeAndEvaluate=gi,I.defaultFlyToRotation=Qt,I.distanceToHumanStr=rc,I.extendComponentProps=sP,I.flyTo=se,I.flyWithPosition=kt,I.flyWithPositions=re,I.flyWithPrimitive=At,I.fromCartesian=H_,I.fromCartesian2=cm,I.fromCartesian3=or,I.fromCartesian4=hm,I.fromCartographic=Ho,I.fromColor=$_,I.fromDistanceDisplayCondition=Z_,I.fromEllipsoid=i1,I.fromHeadingPitchRoll=Y_,I.fromNearFarScalar=X_,I.fromQuaternion=k_,I.fromRectangle=e1,I.generateCartesianArc=zm,I.geoNeareastPointOnRhumbLine=Qn,I.geoNeareastPointOnRhumbLine2=d1,I.geoPolylineToBezierSpline=gu,I.getCameraPosition=Bt,I.getCameraRotation=qo,I.getCameraTargetPos=fm,I.getCenterAndViewDistance=mu,I.getCzmCode=j1,I.getDefaultComponentProps=rP,I.getDefaultWinPosAndDepth=C1,I.getDetailedTerrainDistance=Jm,I.getDirectionVectorFromRotation=xm,I.getDistancesAndTimePosRotsFromPositions=iu,I.getElevationMatrix=Nz,I.getEllipsoidGeodesicCenter=Kh,I.getFlyToCenterAndRotation=ac,I.getFoveatedInterpolationCallback=Gy,I.getFuncFromStr=uu,I.getGroundTerrainDistance=Km,I.getGroundTerrainDistances=km,I.getIncludedAngleFromPositions=Bm,I.getInverseModelMatrix=Om,I.getMinMaxPosition=Ym,I.getModelMatrixFromPosition=nu,I.getObjectProperties=oo,I.getPointerEventButton=Ui,I.getPolygonPointsFromHierarchy=ou,I.getQuaternion=Hh,I.getQuaternionWithXForwardZUp=dm,I.getQuaternionWithYForwardZUp=Kl,I.getResource=Ut,I.getSceneScaleForScreenPixelSize=Bi,I.getSharedTexturePool=iv,I.getTilingSchemeStr=bE,I.getViewerExtensions=Xt,I.getWinPos=Sm,I.getXbsjWaterMaterial=Um,I.hackCesium3DTileset=z_,I.hackCzmModel3DTileContent=L_,I.hackModel=F_,I.hackModelSceneGraph=O_,I.imgUrlToBase64=so,I.localPositionToPosition=pn,I.localPositionsToPositions=fn,I.merge3dTilesServer=X1,I.pickHeightPosition=jl,I.pickPosition=wm,I.pickVirtualEarth=$o,I.pickVirtualPlane=Cm,I.positionAndRotationToQuaternion=j_,I.positionFromCartesian=le,I.positionToCartesian=Be,I.positionToHumanStr=du,I.positionToLocalPosition=Nm,I.positionsToLocalPositions=Et,I.positionsToUniqueCartesians=ht,I.rectangleIsGlobal=cu,I.rpToap=sc,I.setClippingPlaneCollection=Ql,I.setCylinderGeometry=pu,I.setModelMaterial=cr,I.setRectangleGeometry=Xm,I.setViewerExtensions=em,I.toCartesian=ri,I.toCartesian2=be,I.toCartesian3=si,I.toCartesian4=Gh,I.toCartographic=q_,I.toCoefficients=lu,I.toColor=te,I.toDistanceDisplayCondition=sr,I.toEllipsoid=_e,I.toHeadingPitchRoll=um,I.toNearFarScalar=ln,I.toQuaternion=Q_,I.toRectangle=We,I.toRgbaString=gn,I.updateEnvironmentMapManager=au,I.updateMaterialFromJson=kh,I.winPosAndDepthEqual=bm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|