earthsdk3-cesium 3.5.0-beta.3 → 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.
@@ -338,13 +338,13 @@ ${H0}
338
338
  // #endif
339
339
  }
340
340
  `;o.vertexShaderSource=r,o.fragmentShaderSource=a;const s={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=s;const l=()=>{this.czmTextureId?o.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:o.uniformMap={myImage:{type:"image",uri:h.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};l(),this.dispose(this.uriChanged.disposableOn(l)),this.dispose(this.czmTextureIdChanged.disposableOn(l)),this.dispose(this.colorChanged.disposableOn(l)),this.dispose(h.bind([o,"show"],[this,"show"])),this.dispose(h.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(h.bind([o,"position"],[this,"position"]));{const c=()=>{o.pixelSize=this.pixelSize};c(),this.dispose(this.pixelSizeChanged.disposableOn(c))}this.dispose(h.track([o,"maximumScale"],[this,"maximumScale"])),this.dispose(h.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(h.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const u=()=>{const{scale:c=[1,1]}=this;o.scale=[this.useAxis.includes("X")?c[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?c[1]:1]};u(),this.dispose(this.scaleChanged.disposableOn(u));const A=()=>{const c=-(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")?c:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?f:c: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 c=()=>{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]},d={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??Xl.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:d[this.useAxis??Xl.defaults.useAxis]},A()};c(),this.d(this.useAxisChanged.don(c))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(A)),this.dispose(this.sizeChanged.disposableOn(A)),this.dispose(this.flyToEvent.disposableOn(c=>{o.flyTo(c)})),this.disposeVar(new h.ObjResettingWithEvent(this.rotationModeChanged,()=>new DD(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};z(Xl,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Gi=Xl;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:h.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:h.reactArray([1,1,1,1]),originRatioAndOffset:h.reactArray([.5,1,0,0]),viewDistanceRange:h.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Gi||(Gi={})),h.extendClassProps(Gi.prototype,Gi.createDefaultProps);class DD extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n,this._czmImageModel=e;const{customPrimitive:i,rotationMode:o}=this._czmImageModel;if(o==="WithProp")this.dispose(h.track([i,"rotation"],[this._czmImageModel,"rotation"]));else if(o==="WithCameraOnlyZ"){const r=()=>{const{rotation:a}=this._czmImageModel,s=this._czmViewer.getCameraInfo();s&&(i.rotation=[s.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1],a[2]])};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}else if(o==="WithCamera"){const r=()=>{const a=this._czmViewer.getCameraInfo();if(!a)return;const s=a.rotation;i.rotation=[s[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),s[2]]};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}}}class Is extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_primitive");z(this,"_id",this.disposeVar(h.react(h.createGuid())));i&&(this.id=i);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Dn(e.viewer))return;const a=this.disposeVar(Yn([this,"material"])),s=this.disposeVar(h.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,a.changed)),l=this.disposeVar(new h.ObjResettingWithEvent(s,()=>{if(a.value)return new RD(e,o,this,a.value)}));this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&(s.flush(),l.obj&&l.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:h.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:h.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(Is||(Is={})),h.extendClassProps(Is.prototype,Is.createDefaultProps);class RD extends h.Destroyable{constructor(e,i,o,r){super();z(this,"_boundingSphere",(()=>{const e=this._sceneObject;this._material;const i=new _.BoundingSphere;if(!e.polygonHierarchy)return;const o=Wt(e.polygonHierarchy.positions);if(o.length<3){i.radius=-1;return}return _.BoundingSphere.fromPoints(o,i),i})());this._czmViewer=e,this._viewer=i,this._sceneObject=o,this._material=r;const a=this._sceneObject,s=this._material,l=this._viewer;if(!a.polygonHierarchy)return;const u=new _.MaterialAppearance({material:s}),A=[],c=new _.GeometryInstance({geometry:new _.PolygonGeometry({vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Li(a.polygonHierarchy),stRotation:a.stRotation&&_.Math.toRadians(a.stRotation),arcType:a.arcType&&_.ArcType[a.arcType],height:a.height,extrudedHeight:a.extrudedHeight,perPositionHeight:a.perPositionHeight,closeTop:a.closeTop,closeBottom:a.closeBottom,ellipsoid:a.ellipsoid&&je(a.ellipsoid),granularity:a.granularity!==void 0?_.Math.toRadians(a.granularity):void 0}),id:this});A.push(c);const f=new _.GroundPrimitive({geometryInstances:A,appearance:u,asynchronous:!1,allowPicking:a.allowPicking,compressVertices:!1});_.GroundPrimitive.prototype&&(f.ESSceneObjectID=o.id),l.scene.primitives.add(f),this.dispose(()=>l.scene.primitives.remove(f));{const d=()=>{f.show=a.show};d(),this.dispose(a.showChanged.disposableOn(d))}this.disposeVar(new rt.ObjectsToExcludeWrapper(this._czmViewer,f))}flyTo(e){const i=this._boundingSphere;if(i&&i.radius>0){const o=Ue(i.center);o&&Fe(this._viewer,o,i.radius*4,void 0,e)}}}class UD extends h.Destroyable{constructor(e,i){super();z(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new Is(i,e.id));const o=this._groundPolygonPrimitive;{const r=()=>{const s=e.show,l=e.fill;o.show=s&&l&&e.visibleAlpha>0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.material={type:"Color",color:e.color||[1,1,1,.5]}};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(r))}this.dispose(h.track([o,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class OD extends h.Destroyable{constructor(e,i,o){super();z(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Xe(i,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0;{const a=()=>{const l=e.show,u=e.outline;if(r.show=l&&u&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const A=e.positions[0][2];r.positions=e.positions.map(c=>[c[0],c[1],A])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(h.track([r,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class LD extends h.Destroyable{constructor(e,i){super();z(this,"_innerPolygon");z(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new UD(e,i)),this._bottomPolyline=this.disposeVar(new OD(e,i,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const a=e.positionsCenter.center,s=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;Fe(i.viewer,a,s,void 0,r)}else{const a=e.positionsCenter.center;if(!e.positions)return;const s=[a[0],a[1],e.positions[0][2]],l=e.positionsCenter.radius*4;Fe(i.viewer,s,l,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Tr extends h.Destroyable{constructor(e,i){super();z(this,"_positions",this.disposeVar(h.reactPositions(void 0)));z(this,"_flyToEvent",this.disposeVar(new h.Event));z(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 r=this.disposeVar(Yn([this,"material"])),a=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(a);const s=d=>{if(!this.polygonHierarchy)return;const p=new _.MaterialAppearance({material:d}),g=[],v=new _.GeometryInstance({geometry:new _.PolygonGeometry({vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Li(this.polygonHierarchy),stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),arcType:this.arcType&&_.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&je(this.ellipsoid),granularity:this.granularity!==void 0?_.Math.toRadians(this.granularity):void 0}),id:this});g.push(v);const y=new _.Primitive({geometryInstances:g,appearance:p,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return _.Primitive.prototype&&(y.ESSceneObjectID=i),y},l=new _.BoundingSphere,u=()=>{if(a(),!this.polygonHierarchy)return;const d=Wt(this.polygonHierarchy.positions);if(d.length<3||!r.value){l.radius=-1;return}_.BoundingSphere.fromPoints(d,l),this._primitive=s(r.value),this._primitive&&o.scene.primitives.add(this._primitive)},A=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};u(),A();const c=this.disposeVar(h.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));this.dispose(c.disposableOn(()=>{u(),A()}));const f=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{A()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(e.actived&&(c.flush(),f.flush(),l.radius>0)){const p=Ue(l.center),g=this.height??0,v=this.extrudedHeight??0,y=Math.max(g,v),m=l.radius<y?y:l.radius;p&&Fe(o,p,m*4,void 0,d)}}))}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)}}z(Tr,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:h.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:h.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Tr||(Tr={})),h.extendClassProps(Tr.prototype,Tr.createDefaultProps);class $1 extends h.Destroyable{constructor(e,i,o,r){super();z(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Tr(i,e.id));const a=this._czmInnerPolygonPrimitive;{const s=()=>{const u=e.show,A=e.fill;if(a.show=u&&A&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!r?a.height=e.positions[0][2]:a.height=void 0,a.polygonHierarchy=a.show?{positions:e.positions||[]}:{positions:[]},a.material={type:"Color",color:e.color||[1,1,1,.5]},o){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");a.extrudedHeight=(a.height??0)+e.depth}};s();const l=this.disposeVar(h.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(s))}this.dispose(h.track([a,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class Y1 extends h.Destroyable{constructor(e,i,o){super();z(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Xe(i,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0,this.dispose(h.bind([r,"depthTest"],[e,"depthTest"])),this.dispose(h.bind([r,"ground"],[e,"strokeGround"]));{const a=()=>{const l=e.show,u=e.outline;if(r.show=l&&u&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const A=e.positions[0][2];r.positions=e.positions.map(c=>[c[0],c[1],A])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class zD extends h.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Jn(e,n.id));i.arcType="GEODESIC",this.dispose(h.track([i,"allowPicking"],[n,"allowPicking"])),this.dispose(h.bind([i,"depthTest"],[n,"depthTest"]));{const o=()=>{if(n.depth===void 0)throw new Error("sceneObject.depth === undefined");const a=n.show,s=n.outline;i.show=a&&s&&n.visibleAlpha>0,i.color=n.outlineColor,i.width=n.outlineWidth;let l;if(i.show&&n.positions&&n.positions.length>1){const A=n.positions[0][2];l=n.positions.map(c=>[c[0],c[1],A])}let u;if(n.positions&&n.positions.length>0?u=n.positions[0][2]:u=void 0,i.show&&l){const A=u,c=(u??0)+n.depth;i.positions=l.map(f=>[[f[0],f[1],A],[f[0],f[1],c]])}else i.positions=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(n.showChanged,n.outlineChanged,n.outlineColorChanged,n.outlineWidthChanged,n.colorChanged,n.positionsChanged,n.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class kD extends h.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Xe(e,n.id));i.arcType="GEODESIC",i.loop=!0,this.dispose(h.track([i,"allowPicking"],[n,"allowPicking"])),this.dispose(h.bind([i,"depthTest"],[n,"depthTest"]));{const o=()=>{if(n.depth===void 0)throw new Error("sceneObject.depth === undefined");const a=n.show,s=n.outline;i.show=a&&s&&n.visibleAlpha>0,i.color=n.outlineColor,i.width=n.outlineWidth;let l;if(i.show&&n.positions&&n.positions.length>1){const A=n.positions[0][2];l=n.positions.map(c=>[c[0],c[1],A])}let u;if(n.positions&&n.positions.length>0?u=n.positions[0][2]:u=void 0,i.show&&l){const A=(u??0)+n.depth;i.positions=l.map(c=>[c[0],c[1],A])}else i.positions=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(n.showChanged,n.outlineChanged,n.outlineColorChanged,n.outlineWidthChanged,n.colorChanged,n.positionsChanged,n.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class QD extends h.Destroyable{constructor(e,i){super();z(this,"_innerPolygon");z(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new $1(e,i,!0,o)),this._bottomPolyline=this.disposeVar(new Y1(e,i,o)),this.disposeVar(new zD(e,i)),this.disposeVar(new kD(e,i)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const a=e.positionsCenter.center,s=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;Fe(i.viewer,a,s,void 0,r)}else{const a=e.positionsCenter.center;if(!e.positions)return;const s=[a[0],a[1],e.positions[0][2]],l=e.positionsCenter.radius*4;Fe(i.viewer,s,l,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class VD extends h.Destroyable{constructor(e,i){super();z(this,"_innerPolygon");z(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new $1(e,i,!1,o)),this._bottomPolyline=this.disposeVar(new Y1(e,i,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const a=e.positionsCenter.center,s=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;Fe(i.viewer,a,s,void 0,r)}else{const a=e.positionsCenter.center;if(!e.positions)return;const s=[a[0],a[1],e.positions[0][2]],l=e.positionsCenter.radius*4;Fe(i.viewer,s,l,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Ir extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_polygonOrGroundPolygonResetting");z(this,"_czmViewVisibleDistanceRangeControl");z(this,"_id",this.disposeVar(h.react(h.createGuid())));z(this,"_positionsCenter");this._positionsCenter=this.ad(new jf(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new ro(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(h.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=this.disposeVar(h.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new h.ObjResettingWithEvent(o,()=>this.ground?new LD(this,e):this.depth!==void 0&&this.depth>0?new QD(this,e):new VD(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}}z(Ir,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:h.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:h.reactArray([1,1,1,.5]),positions:h.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:h.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Ir||(Ir={})),h.extendClassProps(Ir.prototype,Ir.createDefaultProps);class ul extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(Yn([this,"material"])),a=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(a);const s=(f,d)=>{const p=new _.MaterialAppearance({material:d}),g=[],v=new _.GeometryInstance({geometry:new _.RectangleGeometry({rectangle:f,height:this.height,rotation:this.rotation&&_.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});g.push(v);const y=new _.Primitive({geometryInstances:g,appearance:p,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return _.Primitive.prototype&&(y.ESSceneObjectID=i),y},l=()=>{if(a(),!this.positions)return;const f=dt(this.positions);!f||!r.value||(this._primitive=s(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};l(),u();const A=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(A.disposableOn(()=>{l(),u()}));const c=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(c.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const d=dt(this.positions),p=_.BoundingSphere.fromRectangle3D(d,void 0,this.height);if(p.radius>0){const g=Ue(p.center);g&&Fe(o,g,p.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:h.reactJsonWithUndefined(void 0),positions:h.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(ul||(ul={})),h.extendClassProps(ul.prototype,ul.createDefaultProps);const Cf=class Cf extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(Yn([this,"material"],Cf.defaults.material)),a=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(a);const s=(f,d)=>{const p=new _.MaterialAppearance({material:d}),g=[],v=new _.GeometryInstance({geometry:new _.RectangleGeometry({rectangle:f,rotation:this.rotation&&_.Math.toRadians(this.rotation),stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});g.push(v);const y=new _.GroundPrimitive({geometryInstances:g,appearance:p,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return _.GroundPrimitive.prototype&&(y.ESSceneObjectID=i),y},l=()=>{if(a(),!this.positions)return;const f=dt(this.positions);!f||!r.value||(this._primitive=s(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};l(),u();const A=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(A.disposableOn(()=>{l(),u()}));const c=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(c.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const d=dt(this.positions),p=_.BoundingSphere.fromRectangle3D(d,void 0,0);if(p.radius>0){const g=Ue(p.center);g&&Fe(o,g,p.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};z(Cf,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let _o=Cf;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:h.reactJsonWithUndefined(void 0),positions:h.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(_o||(_o={})),h.extendClassProps(_o.prototype,_o.createDefaultProps);class cl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const a=new _.Color,s=f=>{const d=new _.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),p=[],g=new _.GeometryInstance({geometry:new _.RectangleOutlineGeometry({rectangle:f,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&_.Math.toRadians(this.rotation)}),attributes:{color:this.color?_.ColorGeometryInstanceAttribute.fromColor(Be(this.color,a)):_.ColorGeometryInstanceAttribute.fromColor(new _.Color(1,1,1,1))},id:this});p.push(g);const v=new _.Primitive({geometryInstances:p,appearance:d,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return _.Primitive.prototype&&(v.ESSceneObjectID=i),v},l=()=>{if(r(),!this.positions)return;const f=dt(this.positions);f&&(this._primitive=s(f),this._primitive&&o.scene.primitives.add(this._primitive))},u=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};l(),u();const A=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(A.disposableOn(()=>{l(),u()}));const c=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(c.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const d=dt(this.positions),p=_.BoundingSphere.fromRectangle3D(d,void 0,this.height);if(p.radius>0){const g=Ue(p.center);g&&Fe(o,g,p.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:h.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:h.reactArrayWithUndefined(void 0)})})(cl||(cl={})),h.extendClassProps(cl.prototype,cl.createDefaultProps);const $l=class $l extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));if(!e.viewer)return;const r=this.ad(new ul(e,i)),a=this.ad(new _o(e,i)),s=this.ad(new cl(e,i));this.dispose(h.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(h.track([a,"allowPicking"],[this,"allowPicking"]));{const l=()=>{const A=this.show??!0,c=this.ground??!1,f=this.outline??!1;s.show=A&&!c&&f,r.show=A&&!c,s.show?s.positions=this.rectangle:s.positions=void 0,r.show?r.positions=this.rectangle:r.positions=void 0,s.rotation=r.rotation=this.rotation,r.material=this.material??$l.defaults.material,r.stRotation=this.stRotation,s.extrudedHeight=r.extrudedHeight=this.extrudedHeight,s.height=r.height=this.height,s.color=this.outlineColor,s.translucent=this.outlineTranslucent,a.show=A&&c,a.show?a.positions=this.rectangle:a.positions=void 0,a.rotation=this.rotation,a.material=this.material??$l.defaults.material,a.stRotation=this.stRotation};l();const u=this.disposeVar(h.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(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(A=>{this.ground?a.flyTo(A):r.flyTo(A)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};z($l,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let mi=$l;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:h.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:h.reactJsonWithUndefined(void 0),rectangle:h.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(mi||(mi={})),h.extendClassProps(mi.prototype,mi.createDefaultProps);const Yl=class Yl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(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 r=this.disposeVar(Yn([this,"material"])),a=(c,f)=>{if(!c||!this.radius)return;const d=new _.MaterialAppearance({material:f}),p=[],g=()=>{let E=this.granularity??Yl.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),E=E|0,E=Math.max(1,E),_.Math.toRadians(E)},v=new _.GeometryInstance({geometry:new _.CircleGeometry({center:c,height:this.height,extrudedHeight:this.extrudedHeight,radius:this.radius,stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&je(this.ellipsoid),granularity:g()}),id:this}),y=ot({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),m=ot({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!m||!y){console.warn("modelMatrix is undefined!");return}const b=_.Matrix4.inverseTransformation(y,new _.Matrix4);_.Matrix4.multiply(m,b,v.modelMatrix),p.push(v);const x=new _.Primitive({geometryInstances:p,appearance:d,asynchronous:!1,allowPicking:this.allowPicking??Yl.defaults.allowPicking,compressVertices:!1});return _.Primitive.prototype&&(x.ESSceneObjectID=i),x},s=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const c=At(this.position);!c||!r.value||(this._primitive=a(c,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},l=()=>{const c=this.show??!0;this._primitive&&(this._primitive.show=c)};s(),l();const u=this.disposeVar(h.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,r.changed,this.rotationChanged));this.dispose(u.disposableOn(()=>{s(),l()}));const A=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(A.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)Fe(o,this.position,this.radius*4,void 0,1e3);else{const c=o.scene.camera.positionCartographic.height;Fe(o,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};z(Yl,"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 Fr=Yl;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:h.reactJson({type:"Color"}),position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0})})(Fr||(Fr={})),h.extendClassProps(Fr.prototype,Fr.createDefaultProps);const Ko=class Ko extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(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 r=this.disposeVar(Yn([this,"material"],Ko.defaults.material)),a=(c,f)=>{if(!c||!this.radius)return;const d=new _.MaterialAppearance({material:f}),p=[],g=()=>{let m=this.granularity??Ko.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),m=m|0,m=Math.max(1,m),_.Math.toRadians(m)},v=new _.GeometryInstance({geometry:new _.CircleGeometry({center:c,radius:this.radius,stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),granularity:g(),vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&je(this.ellipsoid)}),id:this});p.push(v);const y=new _.GroundPrimitive({geometryInstances:p,appearance:d,asynchronous:!1,allowPicking:this.allowPicking??Ko.defaults.allowPicking,compressVertices:!1});return _.GroundPrimitive.prototype&&(y.ESSceneObjectID=i),y},s=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position||!this.radius||!r.value)return;const c=At(this.position);this._primitive=a(c,r.value),this._primitive&&o.scene.primitives.add(this._primitive)},l=()=>{const c=this.show??Ko.defaults.show;this._primitive&&(this._primitive.show=c)};s(),l();const u=this.disposeVar(h.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,r.changed));this.dispose(u.disposableOn(()=>{s(),l()}));const A=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(A.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)Fe(o,this.position,this.radius*4,void 0,1e3);else{const c=o.scene.camera.positionCartographic.height;Fe(o,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};z(Ko,"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 Mr=Ko;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:h.reactJsonWithUndefined(void 0),granularity:void 0,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0})})(Mr||(Mr={})),h.extendClassProps(Mr.prototype,Mr.createDefaultProps);const Jl=class Jl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(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 r=new _.Color,a=c=>{if(!c||!this.radius)return;const f=new _.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),d=[],p=_.ColorGeometryInstanceAttribute.fromColor(_.Color.WHITE),g=()=>{let E=this.granularity??Jl.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),E=E|0,E=Math.max(1,E),_.Math.toRadians(E)},v=new _.GeometryInstance({geometry:new _.CircleOutlineGeometry({center:c,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&je(this.ellipsoid),granularity:g(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?_.ColorGeometryInstanceAttribute.fromColor(Be(this.outlineColor,r)):p},id:this}),y=ot({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),m=ot({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!m||!y){console.warn("modelMatrix is undefined!");return}const b=_.Matrix4.inverseTransformation(y,new _.Matrix4);_.Matrix4.multiply(m,b,v.modelMatrix),d.push(v);const x=new _.Primitive({geometryInstances:d,appearance:f,asynchronous:!1,allowPicking:this.allowPicking??Jl.defaults.allowPicking,compressVertices:!1});return _.Primitive.prototype&&(x.ESSceneObjectID=i),x},s=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const c=At(this.position);c&&(this._primitive=a(c),this._primitive&&o.scene.primitives.add(this._primitive))},l=()=>{const c=this.show??!0;this._primitive&&(this._primitive.show=c)};s(),l();const u=this.disposeVar(h.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(()=>{s(),l()}));const A=this.disposeVar(h.createNextAnimateFrameEvent(this.showChanged));this.dispose(A.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const c=o.scene.camera.positionCartographic.height;Fe(o,this.position,c,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};z(Jl,"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 Dr=Jl;(t=>{t.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:h.reactArrayWithUndefined(void 0),position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(Dr||(Dr={})),h.extendClassProps(Dr.prototype,Dr.createDefaultProps);class Co extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));if(!e.viewer)return;const r=this.ad(new Fr(e,i)),a=this.ad(new Mr(e,i)),s=this.ad(new Dr(e,i));this.dispose(h.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(h.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(h.track([s,"allowPicking"],[this,"allowPicking"]));{const l=()=>{const A=this.show??!0,c=this.ground??!1,f=this.outline??!1;s.show=A&&!c&&f,r.show=A&&!c,s.show?s.position=this.position:s.position=void 0,r.show?r.position=this.position:r.position=void 0,r.rotation=s.rotation=this.rotation,s.radius=r.radius=this.radius,s.extrudedHeight=r.extrudedHeight=this.extrudedHeight,this.position&&(s.height=r.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),r.granularity=s.granularity=this.granularity,r.ellipsoid=s.ellipsoid=this.ellipsoid,r.material=this.material,r.stRotation=this.stRotation,s.outlineColor=this.outlineColor,s.translucent=this.outlineTranslucent,s.numberOfVerticalLines=this.numberOfVerticalLines,a.show=A&&c,a.show?a.position=this.position:a.position=void 0,a.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),a.granularity=1):a.granularity=this.granularity,a.rotation=this.rotation,a.ellipsoid=this.ellipsoid,a.material=this.material,a.stRotation=this.stRotation};l();const u=this.disposeVar(h.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(l)),this.dispose(this.flyToEvent.disposableOn(A=>{this.ground?a.flyTo(A):r.flyTo(A)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}z(Co,"defaults",{extrudedHeight:void 0}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:h.reactArray([1,1,1,1]),material:h.reactJson({type:"Color",color:[1,1,1,.5]}),position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:h.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0})})(Co||(Co={})),h.extendClassProps(Co.prototype,Co.createDefaultProps);class hl extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_flyToEvent",this.dv(new h.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Dn(e.viewer))return;const a=_.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(s);const l=()=>{const b={baseWaterColor:Be(this.waterColor),normalMap:a,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new _.Material({fabric:{type:"Water",uniforms:b}})},u=()=>{if(!this.points)return;const b={positions:this.points},x=new _.PolygonGeometry({polygonHierarchy:Li(b),vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new _.GeometryInstance({geometry:x,id:this})},A=()=>{if(!this.points)return;const b=new _.EllipsoidSurfaceAppearance({material:l(),aboveGround:!0}),x=u();let E;return this.ground??!1?E=new _.GroundPrimitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):E=new _.Primitive({geometryInstances:x,appearance:b,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),_.Primitive.prototype&&_.GroundPrimitive.prototype&&(E.ESSceneObjectID=i),E},c=new _.BoundingSphere,f=()=>{s(),d(c),this._primitive=A(),this._primitive&&o.scene.primitives.add(this._primitive)},d=b=>{if(!this.points)return;const x=Wt(this.points);if(x.length<3){b.radius=-1;return}_.BoundingSphere.fromPoints(x,b)},p=()=>{const b=this.show??!0;this._primitive&&(this._primitive.show=b)},g=()=>{f(),p()};g();let v=h.debounce(g,500);const y=this.dv(h.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(y.don(g));const m=this.dv(h.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(m.don(()=>{if(!this.points){s();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=u(),d(c),v&&v[0]()):g()})),this.d(this.showChanged.don(p)),this.d(this.flyToEvent.don(b=>{if(c.radius>0){const x=Ue(c.center);x&&Fe(o,x,c.radius*4,void 0,b)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:h.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:h.reactJsonWithUndefined(void 0),flowSpeed:0})})(hl||(hl={})),h.extendClassProps(hl.prototype,hl.createDefaultProps);class So extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_flyToEvent",this.dv(new h.Event));z(this,"_updateBoundingSphereEvent",this.ad(new h.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=new _.BoundingSphere,a=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(a);const s=b=>h.ESSceneObject.context.getStrFromEnv(b),l=()=>{this._primitive=new _[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:f()}),_.Primitive.prototype&&(this._primitive.ESSceneObjectID=i),o.scene.primitives.add(this._primitive)},u=()=>{var B;const b=s(this.normalMap??_.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),x={baseWaterColor:Be(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=Be(this.blendColor)),this.specularMap&&(x.specularMap=s(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:P,minPos:I}=h.getMinMaxCorner(this.points),O=h.getDistancesFromPositions([I,[P[0],P[1],I[2]]],"GEODESIC")[0],M=h.getDistancesFromPositions([I,[I[0],P[1],P[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(x.baseWaterImage=s(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(x.repeatX=O/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(x.repeatY=M/this.baseWaterImage.vDis)),x.flowSpeed=this.flowSpeed/(((B=this.baseWaterImage)==null?void 0:B.uDis)??O)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,x);return}const E=new _.EllipsoidSurfaceAppearance({material:C0(x),aboveGround:!0});this._primitive&&(this._primitive.appearance=E)},A=this.ad(h.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(A.don(u));const c=b=>{if(!this.points)return;const x=Wt(this.points);if(x.length<3){b.radius=-1;return}_.BoundingSphere.fromPoints(x,b)},f=()=>{if(!this.points||this.points.length<3)return;const{minPos:b}=h.getMinMaxCorner(this.points),[x]=An({originPosition:b},this.points),{minPos:E,maxPos:B}=h.getMinMaxCorner(x),P=B[0]-E[0],I=B[1]-E[1],O={positions:this.points},M=new _.PolygonGeometry({polygonHierarchy:Li(O),vertexFormat:_.VertexFormat.DEFAULT,stRotation:this.stRotation&&_.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x.map(T=>[_.Math.clamp(T[0]/P,0,1),_.Math.clamp(T[1]/I,0,1)]).flat())})}});return new _.GeometryInstance({id:this,geometry:M})},d=()=>{this._primitive&&(this._primitive.show=this.show??!0)},p=this.ad(h.createNextAnimateFrameEvent(this.showChanged));this.ad(p.don(d));const g=this.ad(()=>{a(),l(),d(),u(),c(r)});g();const v=this.ad(h.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(v.don(g)),this.ad(new h.ObjResettingWithEvent(this.updateBoundingSphereEvent,b=>{const x=new h.Destroyable;return b?x.ad(o.scene.preUpdate.addEventListener(()=>{const E=o.camera;o.camera.frustum.computeCullingVolume(E.position,E.direction,E.up).computeVisibility(r)===_.Intersect.OUTSIDE&&g()})):(g(),x.ad(this.pointsChanged.don(g))),x}));const y=()=>{if(!this.points||this.points.length<3){g();return}this._primitive instanceof _.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=f(),this._primitive._recomputeBoundingSpheres=!0},m=this.dv(h.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(m.don(y)),this.d(this.flyToEvent.don(b=>{if(r.radius>0){const x=Ue(r.center);x&&Fe(o,x,r.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:h.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:h.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:_.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:h.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(So||(So={})),h.extendClassProps(So.prototype,So.createDefaultProps);class Eo extends h.Destroyable{constructor(e,i){super();z(this,"pointPrimitives");z(this,"_flyToEvent",this.dv(new h.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Dn(e.viewer))return;let{pointPrimitives:a}=this;const s=()=>{a&&(a.removeAll(),o.scene.primitives.remove(a),a=void 0)};this.d(s);const l=()=>{const p=new _.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&jt.blendOptionType[this.blendOption])??_.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(v=>{p.add({show:v.show??!0,color:v.color&&Be(v.color),disableDepthTestDistance:v.disableDepthTestDistance,distanceDisplayCondition:v.distanceDisplayCondition&&Da(v.distanceDisplayCondition),outlineColor:v.outlineColor&&Be(v.outlineColor),outlineWidth:v.outlineWidth,pixelSize:v.pixelSize,position:v.position&&At(v.position),scaleByDistance:v.scaleByDistance&&ur(v.scaleByDistance),translucencyByDistance:v.translucencyByDistance&&ur(v.translucencyByDistance)})}),_.PointPrimitiveCollection.prototype&&(p.ESSceneObjectID=i)),p},u=()=>{s(),a=l(),o.scene.primitives.add(a)};u();const A=this.dv(h.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),c=()=>{a&&(a.show=this.show??!0,a.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,a.blendOption=(this.blendOption&&jt.blendOptionType[this.blendOption])??_.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(A.don(c));const f=this.dv(h.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(f.don(u));const d=new _.BoundingSphere;this.d(this.flyToEvent.don(p=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(A.flush(),f.flush(),this.pointPrimitiveOptions.length===1){const g=this.pointPrimitiveOptions[0].position;if(!g)return;const v=o.scene.camera.positionCartographic.height;Fe(o,g,v,void 0,p)}else{const g=this.pointPrimitiveOptions,v=[];g.forEach(m=>{m.position&&v.push(m.position)});const y=Wt(v);if(_.BoundingSphere.fromPoints(y,d),d.radius>0){const m=Ue(d.center);m&&Fe(o,m,d.radius*4,void 0,p)}}}))}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:h.reactArrayWithUndefined(void 0),rotation:h.reactArrayWithUndefined(void 0),scale:h.reactArrayWithUndefined(void 0),localPosition:h.reactArrayWithUndefined(void 0),localRotation:h.reactArrayWithUndefined(void 0),localScale:h.reactArrayWithUndefined(void 0),localModelMatrix:h.reactArrayWithUndefined(void 0),modelMatrix:h.reactArrayWithUndefined(void 0)})})(Eo||(Eo={})),h.extendClassProps(Eo.prototype,Eo.createDefaultProps);class ND extends h.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("!viewer");const o=ze.czmJulianDateToTimeStamp,r=ze.getClockRange,a=ze.getClockStep;{const s=()=>i.clockViewModel.startTime=_.JulianDate.fromDate(new Date(n.startTime??h.getDefaultValue(ze.defaults.startTime)));s(),this.dispose(ui(i.clockViewModel,"startTime",l=>n.startTime=o(l))),this.dispose(n.startTimeChanged.disposableOn(s))}{const s=()=>i.clockViewModel.stopTime=_.JulianDate.fromDate(new Date(n.stopTime??h.getDefaultValue(ze.defaults.stopTime)));s(),this.dispose(ui(i.clockViewModel,"stopTime",l=>n.stopTime=o(l))),this.dispose(n.stopTimeChanged.disposableOn(s))}{const s=()=>i.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(n.currentTime??h.getDefaultValue(ze.defaults.currentTime)));s(),this.dispose(ui(i.clockViewModel,"currentTime",l=>n.currentTime=o(l))),this.dispose(n.currentTimeChanged.disposableOn(s))}{const s=()=>i.clockViewModel.multiplier=n.multiplier??ze.defaults.multiplier;s(),this.dispose(ui(i.clockViewModel,"multiplier",l=>{(n.multiplier??ze.defaults.multiplier!==l)&&(n.multiplier=l)})),this.dispose(n.currentTimeChanged.disposableOn(s))}{const s=()=>i.clockViewModel.clockStep=_.ClockStep[n.clockStep??ze.defaults.clockStep];s(),this.dispose(ui(i.clockViewModel,"clockStep",l=>{const u=a(l);(n.clockStep??ze.defaults.clockStep!==u)&&(n.clockStep=u)})),this.dispose(n.clockStepChanged.disposableOn(s))}{const s=()=>i.clockViewModel.clockRange=_.ClockRange[n.clockRange??ze.defaults.clockRange];s(),this.dispose(ui(i.clockViewModel,"clockRange",l=>{const u=r(l);(n.clockRange??ze.defaults.clockRange!==u)&&(n.clockRange=u)})),this.dispose(n.clockRangeChanged.disposableOn(s))}{const s=()=>i.clockViewModel.shouldAnimate=n.shouldAnimate??ze.defaults.shouldAnimate;s(),this.dispose(ui(i.clockViewModel,"shouldAnimate",l=>{(n.shouldAnimate??ze.defaults.shouldAnimate!==l)&&(n.shouldAnimate=l)})),this.dispose(n.shouldAnimateChanged.disposableOn(s))}}}const Zo=class Zo extends h.Destroyable{constructor(n){super(),this.disposeVar(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??Zo.defaults.enabled)return new ND(this,n)}))}};z(Zo,"czmJulianDateToTimeStamp",HD),z(Zo,"getClockRange",GD),z(Zo,"getClockStep",WD),z(Zo,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let ze=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})})(ze||(ze={})),h.extendClassProps(ze.prototype,ze.createDefaultProps);function HD(t){return _.JulianDate.toDate(t).getTime()}function GD(t){if(t===_.ClockRange.CLAMPED)return"CLAMPED";if(t===_.ClockRange.LOOP_STOP)return"LOOP_STOP";if(t===_.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${t}`)}function WD(t){if(t===_.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(t===_.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(t===_.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${t}`)}function ne(t){return t!=null}function pe(t){this.name="DeveloperError",this.message=t;let n;try{throw new Error}catch(e){n=e.stack}this.stack=n}ne(Object.create)&&(pe.prototype=Object.create(Error.prototype),pe.prototype.constructor=pe),pe.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return ne(this.stack)&&(t+=`
341
- ${this.stack.toString()}`),t},pe.throwInstantiationError=function(){throw new pe("This function defines an interface and should not be called directly.")};const N={};N.typeOf={};function jD(t){return`${t} is required, actual value was undefined`}function Fs(t,n,e){return`Expected ${e} to be typeof ${n}, actual typeof was ${t}`}N.defined=function(t,n){if(!ne(n))throw new pe(jD(t))},N.typeOf.func=function(t,n){if(typeof n!="function")throw new pe(Fs(typeof n,"function",t))},N.typeOf.string=function(t,n){if(typeof n!="string")throw new pe(Fs(typeof n,"string",t))},N.typeOf.number=function(t,n){if(typeof n!="number")throw new pe(Fs(typeof n,"number",t))},N.typeOf.number.lessThan=function(t,n,e){if(N.typeOf.number(t,n),n>=e)throw new pe(`Expected ${t} to be less than ${e}, actual value was ${n}`)},N.typeOf.number.lessThanOrEquals=function(t,n,e){if(N.typeOf.number(t,n),n>e)throw new pe(`Expected ${t} to be less than or equal to ${e}, actual value was ${n}`)},N.typeOf.number.greaterThan=function(t,n,e){if(N.typeOf.number(t,n),n<=e)throw new pe(`Expected ${t} to be greater than ${e}, actual value was ${n}`)},N.typeOf.number.greaterThanOrEquals=function(t,n,e){if(N.typeOf.number(t,n),n<e)throw new pe(`Expected ${t} to be greater than or equal to ${e}, actual value was ${n}`)},N.typeOf.object=function(t,n){if(typeof n!="object")throw new pe(Fs(typeof n,"object",t))},N.typeOf.bool=function(t,n){if(typeof n!="boolean")throw new pe(Fs(typeof n,"boolean",t))},N.typeOf.bigint=function(t,n){if(typeof n!="bigint")throw new pe(Fs(typeof n,"bigint",t))},N.typeOf.number.equals=function(t,n,e,i){if(N.typeOf.number(t,e),N.typeOf.number(n,i),e!==i)throw new pe(`${t} must be equal to ${n}, the actual values are ${e} and ${i}`)};var J1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Al(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ud,eb;function qD(){if(eb)return ud;eb=1;var t=function(n){n==null&&(n=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,n.constructor==Array?this.init_by_array(n,n.length):this.init_seed(n)};return t.prototype.init_seed=function(n){for(this.mt[0]=n>>>0,this.mti=1;this.mti<this.N;this.mti++){var n=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((n&4294901760)>>>16)*1812433253<<16)+(n&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(n,e){var i,o,r;for(this.init_seed(19650218),i=1,o=0,r=this.N>e?this.N:e;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+n[o]+o,this.mt[i]>>>=0,i++,o++,i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),o>=e&&(o=0)}for(r=this.N-1;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-i,this.mt[i]>>>=0,i++,i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var n,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_seed(5489),i=0;i<this.N-this.M;i++)n=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^n>>>1^e[n&1];for(;i<this.N-1;i++)n=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^n>>>1^e[n&1];n=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^n>>>1^e[n&1],this.mti=0}return n=this.mt[this.mti++],n^=n>>>11,n^=n<<7&2636928640,n^=n<<15&4022730752,n^=n>>>18,n>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*23283064370807974e-26},t.prototype.random=function(){return this.random_int()*23283064365386963e-26},t.prototype.random_excl=function(){return(this.random_int()+.5)*23283064365386963e-26},t.prototype.random_long=function(){var n=this.random_int()>>>5,e=this.random_int()>>>6;return(n*67108864+e)*11102230246251565e-32},ud=t,ud}var KD=qD();const tb=Al(KD),he={};he.EPSILON1=.1,he.EPSILON2=.01,he.EPSILON3=.001,he.EPSILON4=1e-4,he.EPSILON5=1e-5,he.EPSILON6=1e-6,he.EPSILON7=1e-7,he.EPSILON8=1e-8,he.EPSILON9=1e-9,he.EPSILON10=1e-10,he.EPSILON11=1e-11,he.EPSILON12=1e-12,he.EPSILON13=1e-13,he.EPSILON14=1e-14,he.EPSILON15=1e-15,he.EPSILON16=1e-16,he.EPSILON17=1e-17,he.EPSILON18=1e-18,he.EPSILON19=1e-19,he.EPSILON20=1e-20,he.EPSILON21=1e-21,he.GRAVITATIONALPARAMETER=3986004418e5,he.SOLAR_RADIUS=6955e5,he.LUNAR_RADIUS=1737400,he.SIXTY_FOUR_KILOBYTES=65536,he.FOUR_GIGABYTES=4294967296,he.sign=Math.sign??function(n){return n=+n,n===0||n!==n?n:n>0?1:-1},he.signNotZero=function(t){return t<0?-1:1},he.toSNorm=function(t,n){return n=n??255,Math.round((he.clamp(t,-1,1)*.5+.5)*n)},he.fromSNorm=function(t,n){return n=n??255,he.clamp(t,0,n)/n*2-1},he.normalize=function(t,n,e){return e=Math.max(e-n,0),e===0?0:he.clamp((t-n)/e,0,1)},he.sinh=Math.sinh??function(n){return(Math.exp(n)-Math.exp(-n))/2},he.cosh=Math.cosh??function(n){return(Math.exp(n)+Math.exp(-n))/2},he.lerp=function(t,n,e){return(1-e)*t+e*n},he.PI=Math.PI,he.ONE_OVER_PI=1/Math.PI,he.PI_OVER_TWO=Math.PI/2,he.PI_OVER_THREE=Math.PI/3,he.PI_OVER_FOUR=Math.PI/4,he.PI_OVER_SIX=Math.PI/6,he.THREE_PI_OVER_TWO=3*Math.PI/2,he.TWO_PI=2*Math.PI,he.ONE_OVER_TWO_PI=1/(2*Math.PI),he.RADIANS_PER_DEGREE=Math.PI/180,he.DEGREES_PER_RADIAN=180/Math.PI,he.RADIANS_PER_ARCSECOND=he.RADIANS_PER_DEGREE/3600,he.toRadians=function(t){if(!ne(t))throw new pe("degrees is required.");return t*he.RADIANS_PER_DEGREE},he.toDegrees=function(t){if(!ne(t))throw new pe("radians is required.");return t*he.DEGREES_PER_RADIAN},he.convertLongitudeRange=function(t){if(!ne(t))throw new pe("angle is required.");const n=he.TWO_PI,e=t-Math.floor(t/n)*n;return e<-Math.PI?e+n:e>=Math.PI?e-n:e},he.clampToLatitudeRange=function(t){if(!ne(t))throw new pe("angle is required.");return he.clamp(t,-1*he.PI_OVER_TWO,he.PI_OVER_TWO)},he.negativePiToPi=function(t){if(!ne(t))throw new pe("angle is required.");return t>=-he.PI&&t<=he.PI?t:he.zeroToTwoPi(t+he.PI)-he.PI},he.zeroToTwoPi=function(t){if(!ne(t))throw new pe("angle is required.");if(t>=0&&t<=he.TWO_PI)return t;const n=he.mod(t,he.TWO_PI);return Math.abs(n)<he.EPSILON14&&Math.abs(t)>he.EPSILON14?he.TWO_PI:n},he.mod=function(t,n){if(!ne(t))throw new pe("m is required.");if(!ne(n))throw new pe("n is required.");if(n===0)throw new pe("divisor cannot be 0.");return he.sign(t)===he.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},he.equalsEpsilon=function(t,n,e,i){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");e=e??0,i=i??e;const o=Math.abs(t-n);return o<=i||o<=e*Math.max(Math.abs(t),Math.abs(n))},he.lessThan=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n<-e},he.lessThanOrEquals=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n<e},he.greaterThan=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n>e},he.greaterThanOrEquals=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n>-e};const nA=[1];he.factorial=function(t){if(typeof t!="number"||t<0)throw new pe("A number greater than or equal to 0 is required.");const n=nA.length;if(t>=n){let e=nA[n-1];for(let i=n;i<=t;i++){const o=e*i;nA.push(o),e=o}}return nA[t]},he.incrementWrap=function(t,n,e){if(e=e??0,!ne(t))throw new pe("n is required.");if(n<=e)throw new pe("maximumValue must be greater than minimumValue.");return++t,t>n&&(t=e),t},he.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new pe("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},he.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new pe("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},he.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new pe("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},he.clamp=function(t,n,e){return N.typeOf.number("value",t),N.typeOf.number("min",n),N.typeOf.number("max",e),t<n?n:t>e?e:t};let nb=new tb;he.setRandomNumberSeed=function(t){if(!ne(t))throw new pe("seed is required.");nb=new tb(t)},he.nextRandomNumber=function(){return nb.random()},he.randomBetween=function(t,n){return he.nextRandomNumber()*(n-t)+t},he.acosClamped=function(t){if(!ne(t))throw new pe("value is required.");return Math.acos(he.clamp(t,-1,1))},he.asinClamped=function(t){if(!ne(t))throw new pe("value is required.");return Math.asin(he.clamp(t,-1,1))},he.chordLength=function(t,n){if(!ne(t))throw new pe("angle is required.");if(!ne(n))throw new pe("radius is required.");return 2*n*Math.sin(t*.5)},he.logBase=function(t,n){if(!ne(t))throw new pe("number is required.");if(!ne(n))throw new pe("base is required.");return Math.log(t)/Math.log(n)},he.cbrt=Math.cbrt??function(n){const e=Math.pow(Math.abs(n),.3333333333333333);return n<0?-e:e},he.log2=Math.log2??function(n){return Math.log(n)*Math.LOG2E},he.fog=function(t,n){const e=t*n;return 1-Math.exp(-(e*e))},he.fastApproximateAtan=function(t){return N.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},he.fastApproximateAtan2=function(t,n){N.typeOf.number("x",t),N.typeOf.number("y",n);let e,i=Math.abs(t);e=Math.abs(n);const o=Math.max(i,e);e=Math.min(i,e);const r=e/o;if(isNaN(r))throw new pe("either x or y must be nonzero");return i=he.fastApproximateAtan(r),i=Math.abs(n)>Math.abs(t)?he.PI_OVER_TWO-i:i,i=t<0?he.PI-i:i,i=n<0?-i:i,i};function ae(t,n,e){this.x=t??0,this.y=n??0,this.z=e??0}ae.fromSpherical=function(t,n){N.typeOf.object("spherical",t),ne(n)||(n=new ae);const e=t.clock,i=t.cone,o=t.magnitude??1,r=o*Math.sin(i);return n.x=r*Math.cos(e),n.y=r*Math.sin(e),n.z=o*Math.cos(i),n},ae.fromElements=function(t,n,e,i){return ne(i)?(i.x=t,i.y=n,i.z=e,i):new ae(t,n,e)},ae.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new ae(t.x,t.y,t.z)},ae.fromCartesian4=ae.clone,ae.packedLength=3,ae.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e]=t.z,n},ae.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ae),e.x=t[n++],e.y=t[n++],e.z=t[n],e},ae.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*3;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 3 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)ae.pack(t[o],n,o*3);return n},ae.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new pe("array length must be a multiple of 3.");const e=t.length;ne(n)?n.length=e/3:n=new Array(e/3);for(let i=0;i<e;i+=3){const o=i/3;n[o]=ae.unpack(t,i,n[o])}return n},ae.fromArray=ae.unpack,ae.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},ae.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},ae.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e},ae.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e},ae.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y),a=he.clamp(t.z,n.z,e.z);return i.x=o,i.y=r,i.z=a,i},ae.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},ae.magnitude=function(t){return Math.sqrt(ae.magnitudeSquared(t))};const iA=new ae;ae.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),ae.subtract(t,n,iA),ae.magnitude(iA)},ae.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),ae.subtract(t,n,iA),ae.magnitudeSquared(iA)},ae.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new pe("normalized result is not a number");return n},ae.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},ae.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e},ae.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e},ae.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e},ae.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e},ae.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e},ae.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},ae.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},ae.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n};const ib=new ae;ae.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),ae.multiplyByScalar(n,e,ib),i=ae.multiplyByScalar(t,1-e,i),ae.add(ib,i,i)};const rA=new ae,cd=new ae;ae.angleBetween=function(t,n){N.typeOf.object("left",t),N.typeOf.object("right",n),ae.normalize(t,rA),ae.normalize(n,cd);const e=ae.dot(rA,cd),i=ae.magnitude(ae.cross(rA,cd,rA));return Math.atan2(i,e)};const ZD=new ae;ae.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.normalize(t,ZD);return ae.abs(e,e),e.x<=e.y?e.x<=e.z?n=ae.clone(ae.UNIT_X,n):n=ae.clone(ae.UNIT_Z,n):e.y<=e.z?n=ae.clone(ae.UNIT_Y,n):n=ae.clone(ae.UNIT_Z,n),n},ae.projectVector=function(t,n,e){N.defined("a",t),N.defined("b",n),N.defined("result",e);const i=ae.dot(t,n)/ae.dot(n,n);return ae.multiplyByScalar(n,i,e)},ae.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},ae.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]},ae.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)&&he.equalsEpsilon(t.z,n.z,e,i)},ae.cross=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t.x,o=t.y,r=t.z,a=n.x,s=n.y,l=n.z,u=o*l-r*s,A=r*a-i*l,c=i*s-o*a;return e.x=u,e.y=A,e.z=c,e},ae.midpoint=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=(t.x+n.x)*.5,e.y=(t.y+n.y)*.5,e.z=(t.z+n.z)*.5,e},ae.fromDegrees=function(t,n,e,i,o){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),t=he.toRadians(t),n=he.toRadians(n),ae.fromRadians(t,n,e,i,o)};let Hn=new ae,Ms=new ae;ae._ellipsoidRadiiSquared=new ae(40680631590769,40680631590769,40408299984661445e-3),ae.fromRadians=function(t,n,e,i,o){N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),e=e??0;const r=ne(i)?i.radiiSquared:ae._ellipsoidRadiiSquared,a=Math.cos(n);Hn.x=a*Math.cos(t),Hn.y=a*Math.sin(t),Hn.z=Math.sin(n),Hn=ae.normalize(Hn,Hn),ae.multiplyComponents(r,Hn,Ms);const s=Math.sqrt(ae.dot(Hn,Ms));return Ms=ae.divideByScalar(Ms,s,Ms),Hn=ae.multiplyByScalar(Hn,e,Hn),ne(o)||(o=new ae),ae.add(Ms,Hn,o)},ae.fromDegreesArray=function(t,n,e){if(N.defined("coordinates",t),t.length<2||t.length%2!==0)throw new pe("the number of coordinates must be a multiple of 2 and at least 2");const i=t.length;ne(e)?e.length=i/2:e=new Array(i/2);for(let o=0;o<i;o+=2){const r=t[o],a=t[o+1],s=o/2;e[s]=ae.fromDegrees(r,a,0,n,e[s])}return e},ae.fromRadiansArray=function(t,n,e){if(N.defined("coordinates",t),t.length<2||t.length%2!==0)throw new pe("the number of coordinates must be a multiple of 2 and at least 2");const i=t.length;ne(e)?e.length=i/2:e=new Array(i/2);for(let o=0;o<i;o+=2){const r=t[o],a=t[o+1],s=o/2;e[s]=ae.fromRadians(r,a,0,n,e[s])}return e},ae.fromDegreesArrayHeights=function(t,n,e){if(N.defined("coordinates",t),t.length<3||t.length%3!==0)throw new pe("the number of coordinates must be a multiple of 3 and at least 3");const i=t.length;ne(e)?e.length=i/3:e=new Array(i/3);for(let o=0;o<i;o+=3){const r=t[o],a=t[o+1],s=t[o+2],l=o/3;e[l]=ae.fromDegrees(r,a,s,n,e[l])}return e},ae.fromRadiansArrayHeights=function(t,n,e){if(N.defined("coordinates",t),t.length<3||t.length%3!==0)throw new pe("the number of coordinates must be a multiple of 3 and at least 3");const i=t.length;ne(e)?e.length=i/3:e=new Array(i/3);for(let o=0;o<i;o+=3){const r=t[o],a=t[o+1],s=t[o+2],l=o/3;e[l]=ae.fromRadians(r,a,s,n,e[l])}return e},ae.ZERO=Object.freeze(new ae(0,0,0)),ae.ONE=Object.freeze(new ae(1,1,1)),ae.UNIT_X=Object.freeze(new ae(1,0,0)),ae.UNIT_Y=Object.freeze(new ae(0,1,0)),ae.UNIT_Z=Object.freeze(new ae(0,0,1)),ae.prototype.clone=function(t){return ae.clone(this,t)},ae.prototype.equals=function(t){return ae.equals(this,t)},ae.prototype.equalsEpsilon=function(t,n,e){return ae.equalsEpsilon(this,t,n,e)},ae.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function be(t,n,e,i){this.x=t??0,this.y=n??0,this.z=e??0,this.w=i??0}be.fromElements=function(t,n,e,i,o){return ne(o)?(o.x=t,o.y=n,o.z=e,o.w=i,o):new be(t,n,e,i)},be.fromColor=function(t,n){return N.typeOf.object("color",t),ne(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new be(t.red,t.green,t.blue,t.alpha)},be.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new be(t.x,t.y,t.z,t.w)},be.packedLength=4,be.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},be.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new be),e.x=t[n++],e.y=t[n++],e.z=t[n++],e.w=t[n],e},be.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*4;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)be.pack(t[o],n,o*4);return n},be.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new pe("array length must be a multiple of 4.");const e=t.length;ne(n)?n.length=e/4:n=new Array(e/4);for(let i=0;i<e;i+=4){const o=i/4;n[o]=be.unpack(t,i,n[o])}return n},be.fromArray=be.unpack,be.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},be.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},be.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e.w=Math.min(t.w,n.w),e},be.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e.w=Math.max(t.w,n.w),e},be.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y),a=he.clamp(t.z,n.z,e.z),s=he.clamp(t.w,n.w,e.w);return i.x=o,i.y=r,i.z=a,i.w=s,i},be.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},be.magnitude=function(t){return Math.sqrt(be.magnitudeSquared(t))};const oA=new be;be.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),be.subtract(t,n,oA),be.magnitude(oA)},be.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),be.subtract(t,n,oA),be.magnitudeSquared(oA)},be.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=be.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new pe("normalized result is not a number");return n},be.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},be.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e.w=t.w*n.w,e},be.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e.w=t.w/n.w,e},be.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},be.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},be.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},be.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},be.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},be.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n};const rb=new be;be.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),be.multiplyByScalar(n,e,rb),i=be.multiplyByScalar(t,1-e,i),be.add(rb,i,i)};const XD=new be;be.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=be.normalize(t,XD);return be.abs(e,e),e.x<=e.y?e.x<=e.z?e.x<=e.w?n=be.clone(be.UNIT_X,n):n=be.clone(be.UNIT_W,n):e.z<=e.w?n=be.clone(be.UNIT_Z,n):n=be.clone(be.UNIT_W,n):e.y<=e.z?e.y<=e.w?n=be.clone(be.UNIT_Y,n):n=be.clone(be.UNIT_W,n):e.z<=e.w?n=be.clone(be.UNIT_Z,n):n=be.clone(be.UNIT_W,n),n},be.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},be.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]&&t.w===n[e+3]},be.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)&&he.equalsEpsilon(t.z,n.z,e,i)&&he.equalsEpsilon(t.w,n.w,e,i)},be.ZERO=Object.freeze(new be(0,0,0,0)),be.ONE=Object.freeze(new be(1,1,1,1)),be.UNIT_X=Object.freeze(new be(1,0,0,0)),be.UNIT_Y=Object.freeze(new be(0,1,0,0)),be.UNIT_Z=Object.freeze(new be(0,0,1,0)),be.UNIT_W=Object.freeze(new be(0,0,0,1)),be.prototype.clone=function(t){return be.clone(this,t)},be.prototype.equals=function(t){return be.equals(this,t)},be.prototype.equalsEpsilon=function(t,n,e){return be.equalsEpsilon(this,t,n,e)},be.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const hd=new Float32Array(1),Zt=new Uint8Array(hd.buffer),$D=new Uint32Array([287454020]),ob=new Uint8Array($D.buffer)[0]===68;be.packFloat=function(t,n){return N.typeOf.number("value",t),ne(n)||(n=new be),hd[0]=t,ob?(n.x=Zt[0],n.y=Zt[1],n.z=Zt[2],n.w=Zt[3]):(n.x=Zt[3],n.y=Zt[2],n.z=Zt[1],n.w=Zt[0]),n},be.unpackFloat=function(t){return N.typeOf.object("packedFloat",t),ob?(Zt[0]=t.x,Zt[1]=t.y,Zt[2]=t.z,Zt[3]=t.w):(Zt[0]=t.w,Zt[1]=t.z,Zt[2]=t.y,Zt[3]=t.x),hd[0]};const gi={};gi.EMPTY_OBJECT=Object.freeze({}),gi.EMPTY_ARRAY=Object.freeze([]);function me(t,n,e,i,o,r,a,s,l){this[0]=t??0,this[1]=i??0,this[2]=a??0,this[3]=n??0,this[4]=o??0,this[5]=s??0,this[6]=e??0,this[7]=r??0,this[8]=l??0}me.packedLength=9,me.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n},me.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new me),e[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e},me.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*9;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 9 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)me.pack(t[o],n,o*9);return n},me.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new pe("array length must be a multiple of 9.");const e=t.length;ne(n)?n.length=e/9:n=new Array(e/9);for(let i=0;i<e;i+=9){const o=i/9;n[o]=me.unpack(t,i,n[o])}return n},me.clone=function(t,n){if(ne(t))return ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new me(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},me.fromArray=me.unpack,me.fromColumnMajorArray=function(t,n){return N.defined("values",t),me.clone(t,n)},me.fromRowMajorArray=function(t,n){return N.defined("values",t),ne(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new me(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},me.fromQuaternion=function(t,n){N.typeOf.object("quaternion",t);const e=t.x*t.x,i=t.x*t.y,o=t.x*t.z,r=t.x*t.w,a=t.y*t.y,s=t.y*t.z,l=t.y*t.w,u=t.z*t.z,A=t.z*t.w,c=t.w*t.w,f=e-a-u+c,d=2*(i-A),p=2*(o+l),g=2*(i+A),v=-e+a-u+c,y=2*(s-r),m=2*(o-l),b=2*(s+r),x=-e-a+u+c;return ne(n)?(n[0]=f,n[1]=g,n[2]=m,n[3]=d,n[4]=v,n[5]=b,n[6]=p,n[7]=y,n[8]=x,n):new me(f,d,p,g,v,y,m,b,x)},me.fromHeadingPitchRoll=function(t,n){N.typeOf.object("headingPitchRoll",t);const e=Math.cos(-t.pitch),i=Math.cos(-t.heading),o=Math.cos(t.roll),r=Math.sin(-t.pitch),a=Math.sin(-t.heading),s=Math.sin(t.roll),l=e*i,u=-o*a+s*r*i,A=s*a+o*r*i,c=e*a,f=o*i+s*r*a,d=-s*i+o*r*a,p=-r,g=s*e,v=o*e;return ne(n)?(n[0]=l,n[1]=c,n[2]=p,n[3]=u,n[4]=f,n[5]=g,n[6]=A,n[7]=d,n[8]=v,n):new me(l,u,A,c,f,d,p,g,v)},me.fromScale=function(t,n){return N.typeOf.object("scale",t),ne(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new me(t.x,0,0,0,t.y,0,0,0,t.z)},me.fromUniformScale=function(t,n){return N.typeOf.number("scale",t),ne(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new me(t,0,0,0,t,0,0,0,t)},me.fromCrossProduct=function(t,n){return N.typeOf.object("vector",t),ne(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new me(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},me.fromRotationX=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=i,n[6]=0,n[7]=-i,n[8]=e,n):new me(1,0,0,0,e,-i,0,i,e)},me.fromRotationY=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=e,n[1]=0,n[2]=-i,n[3]=0,n[4]=1,n[5]=0,n[6]=i,n[7]=0,n[8]=e,n):new me(e,0,i,0,1,0,-i,0,e)},me.fromRotationZ=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=e,n[1]=i,n[2]=0,n[3]=-i,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new me(e,-i,0,i,e,0,0,0,1)},me.toArray=function(t,n){return N.typeOf.object("matrix",t),ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},me.getElementIndex=function(t,n){return N.typeOf.number.greaterThanOrEquals("row",n,0),N.typeOf.number.lessThanOrEquals("row",n,2),N.typeOf.number.greaterThanOrEquals("column",t,0),N.typeOf.number.lessThanOrEquals("column",t,2),t*3+n},me.getColumn=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("result",e);const i=n*3,o=t[i],r=t[i+1],a=t[i+2];return e.x=o,e.y=r,e.z=a,e},me.setColumn=function(t,n,e,i){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=me.clone(t,i);const o=n*3;return i[o]=e.x,i[o+1]=e.y,i[o+2]=e.z,i},me.getRow=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("result",e);const i=t[n],o=t[n+3],r=t[n+6];return e.x=i,e.y=o,e.z=r,e},me.setRow=function(t,n,e,i){return N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=me.clone(t,i),i[n]=e.x,i[n+3]=e.y,i[n+6]=e.z,i};const YD=new ae;me.setScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=me.getScale(t,YD),o=n.x/i.x,r=n.y/i.y,a=n.z/i.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*a,e};const JD=new ae;me.setUniformScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e);const i=me.getScale(t,JD),o=n/i.x,r=n/i.y,a=n/i.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*a,e};const Ad=new ae;me.getScale=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=ae.magnitude(ae.fromElements(t[0],t[1],t[2],Ad)),n.y=ae.magnitude(ae.fromElements(t[3],t[4],t[5],Ad)),n.z=ae.magnitude(ae.fromElements(t[6],t[7],t[8],Ad)),n};const sb=new ae;me.getMaximumScale=function(t){return me.getScale(t,sb),ae.maximumComponent(sb)};const eR=new ae;me.setRotation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("result",e);const i=me.getScale(t,eR);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=n[3]*i.y,e[4]=n[4]*i.y,e[5]=n[5]*i.y,e[6]=n[6]*i.z,e[7]=n[7]*i.z,e[8]=n[8]*i.z,e};const tR=new ae;me.getRotation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=me.getScale(t,tR);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[3]/e.y,n[4]=t[4]/e.y,n[5]=t[5]/e.y,n[6]=t[6]/e.z,n[7]=t[7]/e.z,n[8]=t[8]/e.z,n},me.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],r=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],s=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],l=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],u=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],A=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],c=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return e[0]=i,e[1]=o,e[2]=r,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=A,e[8]=c,e},me.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},me.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e},me.multiplyByVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[3]*o+t[6]*r,s=t[1]*i+t[4]*o+t[7]*r,l=t[2]*i+t[5]*o+t[8]*r;return e.x=a,e.y=s,e.z=l,e},me.multiplyByScalar=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},me.multiplyByScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n.x,e[1]=t[1]*n.x,e[2]=t[2]*n.x,e[3]=t[3]*n.y,e[4]=t[4]*n.y,e[5]=t[5]*n.y,e[6]=t[6]*n.z,e[7]=t[7]*n.z,e[8]=t[8]*n.z,e},me.multiplyByUniformScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},me.negate=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n},me.transpose=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[3],o=t[6],r=t[1],a=t[4],s=t[7],l=t[2],u=t[5],A=t[8];return n[0]=e,n[1]=i,n[2]=o,n[3]=r,n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=A,n};function nR(t){let n=0;for(let e=0;e<9;++e){const i=t[e];n+=i*i}return Math.sqrt(n)}const fd=[1,0,0],pd=[2,2,1];function iR(t){let n=0;for(let e=0;e<3;++e){const i=t[me.getElementIndex(pd[e],fd[e])];n+=2*i*i}return Math.sqrt(n)}function rR(t,n){const e=he.EPSILON15;let i=0,o=1;for(let u=0;u<3;++u){const A=Math.abs(t[me.getElementIndex(pd[u],fd[u])]);A>i&&(o=u,i=A)}let r=1,a=0;const s=fd[o],l=pd[o];if(Math.abs(t[me.getElementIndex(l,s)])>e){const u=t[me.getElementIndex(l,l)],A=t[me.getElementIndex(s,s)],c=t[me.getElementIndex(l,s)],f=(u-A)/2/c;let d;f<0?d=-1/(-f+Math.sqrt(1+f*f)):d=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+d*d),a=d*r}return n=me.clone(me.IDENTITY,n),n[me.getElementIndex(s,s)]=n[me.getElementIndex(l,l)]=r,n[me.getElementIndex(l,s)]=a,n[me.getElementIndex(s,l)]=-a,n}const sA=new me,ab=new me;me.computeEigenDecomposition=function(t,n){N.typeOf.object("matrix",t);const e=he.EPSILON20,i=10;let o=0,r=0;ne(n)||(n={});const a=n.unitary=me.clone(me.IDENTITY,n.unitary),s=n.diagonal=me.clone(t,n.diagonal),l=e*nR(s);for(;r<i&&iR(s)>l;)rR(s,sA),me.transpose(sA,ab),me.multiply(s,sA,s),me.multiply(ab,s,s),me.multiply(a,sA,a),++o>2&&(++r,o=0);return n},me.abs=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n},me.determinant=function(t){N.typeOf.object("matrix",t);const n=t[0],e=t[3],i=t[6],o=t[1],r=t[4],a=t[7],s=t[2],l=t[5],u=t[8];return n*(r*u-l*a)+o*(l*i-e*u)+s*(e*a-r*i)},me.inverse=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[1],o=t[2],r=t[3],a=t[4],s=t[5],l=t[6],u=t[7],A=t[8],c=me.determinant(t);if(Math.abs(c)<=he.EPSILON15)throw new pe("matrix is not invertible");n[0]=a*A-u*s,n[1]=u*o-i*A,n[2]=i*s-a*o,n[3]=l*s-r*A,n[4]=e*A-l*o,n[5]=r*o-e*s,n[6]=r*u-l*a,n[7]=l*i-e*u,n[8]=e*a-r*i;const f=1/c;return me.multiplyByScalar(n,f,n)};const oR=new me;me.inverseTranspose=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),me.inverse(me.transpose(t,oR),n)},me.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},me.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e},me.IDENTITY=Object.freeze(new me(1,0,0,0,1,0,0,0,1)),me.ZERO=Object.freeze(new me(0,0,0,0,0,0,0,0,0)),me.COLUMN0ROW0=0,me.COLUMN0ROW1=1,me.COLUMN0ROW2=2,me.COLUMN1ROW0=3,me.COLUMN1ROW1=4,me.COLUMN1ROW2=5,me.COLUMN2ROW0=6,me.COLUMN2ROW1=7,me.COLUMN2ROW2=8,Object.defineProperties(me.prototype,{length:{get:function(){return me.packedLength}}}),me.prototype.clone=function(t){return me.clone(this,t)},me.prototype.equals=function(t){return me.equals(this,t)},me.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]},me.prototype.equalsEpsilon=function(t,n){return me.equalsEpsilon(this,t,n)},me.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
341
+ ${this.stack.toString()}`),t},pe.throwInstantiationError=function(){throw new pe("This function defines an interface and should not be called directly.")};const N={};N.typeOf={};function jD(t){return`${t} is required, actual value was undefined`}function Fs(t,n,e){return`Expected ${e} to be typeof ${n}, actual typeof was ${t}`}N.defined=function(t,n){if(!ne(n))throw new pe(jD(t))},N.typeOf.func=function(t,n){if(typeof n!="function")throw new pe(Fs(typeof n,"function",t))},N.typeOf.string=function(t,n){if(typeof n!="string")throw new pe(Fs(typeof n,"string",t))},N.typeOf.number=function(t,n){if(typeof n!="number")throw new pe(Fs(typeof n,"number",t))},N.typeOf.number.lessThan=function(t,n,e){if(N.typeOf.number(t,n),n>=e)throw new pe(`Expected ${t} to be less than ${e}, actual value was ${n}`)},N.typeOf.number.lessThanOrEquals=function(t,n,e){if(N.typeOf.number(t,n),n>e)throw new pe(`Expected ${t} to be less than or equal to ${e}, actual value was ${n}`)},N.typeOf.number.greaterThan=function(t,n,e){if(N.typeOf.number(t,n),n<=e)throw new pe(`Expected ${t} to be greater than ${e}, actual value was ${n}`)},N.typeOf.number.greaterThanOrEquals=function(t,n,e){if(N.typeOf.number(t,n),n<e)throw new pe(`Expected ${t} to be greater than or equal to ${e}, actual value was ${n}`)},N.typeOf.object=function(t,n){if(typeof n!="object")throw new pe(Fs(typeof n,"object",t))},N.typeOf.bool=function(t,n){if(typeof n!="boolean")throw new pe(Fs(typeof n,"boolean",t))},N.typeOf.bigint=function(t,n){if(typeof n!="bigint")throw new pe(Fs(typeof n,"bigint",t))},N.typeOf.number.equals=function(t,n,e,i){if(N.typeOf.number(t,e),N.typeOf.number(n,i),e!==i)throw new pe(`${t} must be equal to ${n}, the actual values are ${e} and ${i}`)};var J1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Al(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ud,eb;function qD(){if(eb)return ud;eb=1;var t=function(n){n==null&&(n=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,n.constructor==Array?this.init_by_array(n,n.length):this.init_seed(n)};return t.prototype.init_seed=function(n){for(this.mt[0]=n>>>0,this.mti=1;this.mti<this.N;this.mti++){var n=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((n&4294901760)>>>16)*1812433253<<16)+(n&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(n,e){var i,o,r;for(this.init_seed(19650218),i=1,o=0,r=this.N>e?this.N:e;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+n[o]+o,this.mt[i]>>>=0,i++,o++,i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),o>=e&&(o=0)}for(r=this.N-1;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-i,this.mt[i]>>>=0,i++,i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var n,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_seed(5489),i=0;i<this.N-this.M;i++)n=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^n>>>1^e[n&1];for(;i<this.N-1;i++)n=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^n>>>1^e[n&1];n=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^n>>>1^e[n&1],this.mti=0}return n=this.mt[this.mti++],n^=n>>>11,n^=n<<7&2636928640,n^=n<<15&4022730752,n^=n>>>18,n>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*23283064370807974e-26},t.prototype.random=function(){return this.random_int()*23283064365386963e-26},t.prototype.random_excl=function(){return(this.random_int()+.5)*23283064365386963e-26},t.prototype.random_long=function(){var n=this.random_int()>>>5,e=this.random_int()>>>6;return(n*67108864+e)*11102230246251565e-32},ud=t,ud}var KD=qD();const tb=Al(KD),he={};he.EPSILON1=.1,he.EPSILON2=.01,he.EPSILON3=.001,he.EPSILON4=1e-4,he.EPSILON5=1e-5,he.EPSILON6=1e-6,he.EPSILON7=1e-7,he.EPSILON8=1e-8,he.EPSILON9=1e-9,he.EPSILON10=1e-10,he.EPSILON11=1e-11,he.EPSILON12=1e-12,he.EPSILON13=1e-13,he.EPSILON14=1e-14,he.EPSILON15=1e-15,he.EPSILON16=1e-16,he.EPSILON17=1e-17,he.EPSILON18=1e-18,he.EPSILON19=1e-19,he.EPSILON20=1e-20,he.EPSILON21=1e-21,he.GRAVITATIONALPARAMETER=3986004418e5,he.SOLAR_RADIUS=6955e5,he.LUNAR_RADIUS=1737400,he.SIXTY_FOUR_KILOBYTES=65536,he.FOUR_GIGABYTES=4294967296,he.sign=Math.sign??function(n){return n=+n,n===0||n!==n?n:n>0?1:-1},he.signNotZero=function(t){return t<0?-1:1},he.toSNorm=function(t,n){return n=n??255,Math.round((he.clamp(t,-1,1)*.5+.5)*n)},he.fromSNorm=function(t,n){return n=n??255,he.clamp(t,0,n)/n*2-1},he.normalize=function(t,n,e){return e=Math.max(e-n,0),e===0?0:he.clamp((t-n)/e,0,1)},he.sinh=Math.sinh??function(n){return(Math.exp(n)-Math.exp(-n))/2},he.cosh=Math.cosh??function(n){return(Math.exp(n)+Math.exp(-n))/2},he.lerp=function(t,n,e){return(1-e)*t+e*n},he.PI=Math.PI,he.ONE_OVER_PI=1/Math.PI,he.PI_OVER_TWO=Math.PI/2,he.PI_OVER_THREE=Math.PI/3,he.PI_OVER_FOUR=Math.PI/4,he.PI_OVER_SIX=Math.PI/6,he.THREE_PI_OVER_TWO=3*Math.PI/2,he.TWO_PI=2*Math.PI,he.ONE_OVER_TWO_PI=1/(2*Math.PI),he.RADIANS_PER_DEGREE=Math.PI/180,he.DEGREES_PER_RADIAN=180/Math.PI,he.RADIANS_PER_ARCSECOND=he.RADIANS_PER_DEGREE/3600,he.toRadians=function(t){if(!ne(t))throw new pe("degrees is required.");return t*he.RADIANS_PER_DEGREE},he.toDegrees=function(t){if(!ne(t))throw new pe("radians is required.");return t*he.DEGREES_PER_RADIAN},he.convertLongitudeRange=function(t){if(!ne(t))throw new pe("angle is required.");const n=he.TWO_PI,e=t-Math.floor(t/n)*n;return e<-Math.PI?e+n:e>=Math.PI?e-n:e},he.clampToLatitudeRange=function(t){if(!ne(t))throw new pe("angle is required.");return he.clamp(t,-1*he.PI_OVER_TWO,he.PI_OVER_TWO)},he.negativePiToPi=function(t){if(!ne(t))throw new pe("angle is required.");return t>=-he.PI&&t<=he.PI?t:he.zeroToTwoPi(t+he.PI)-he.PI},he.zeroToTwoPi=function(t){if(!ne(t))throw new pe("angle is required.");if(t>=0&&t<=he.TWO_PI)return t;const n=he.mod(t,he.TWO_PI);return Math.abs(n)<he.EPSILON14&&Math.abs(t)>he.EPSILON14?he.TWO_PI:n},he.mod=function(t,n){if(!ne(t))throw new pe("m is required.");if(!ne(n))throw new pe("n is required.");if(n===0)throw new pe("divisor cannot be 0.");return he.sign(t)===he.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},he.equalsEpsilon=function(t,n,e,i){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");e=e??0,i=i??e;const o=Math.abs(t-n);return o<=i||o<=e*Math.max(Math.abs(t),Math.abs(n))},he.lessThan=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n<-e},he.lessThanOrEquals=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n<e},he.greaterThan=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n>e},he.greaterThanOrEquals=function(t,n,e){if(!ne(t))throw new pe("first is required.");if(!ne(n))throw new pe("second is required.");if(!ne(e))throw new pe("absoluteEpsilon is required.");return t-n>-e};const nA=[1];he.factorial=function(t){if(typeof t!="number"||t<0)throw new pe("A number greater than or equal to 0 is required.");const n=nA.length;if(t>=n){let e=nA[n-1];for(let i=n;i<=t;i++){const o=e*i;nA.push(o),e=o}}return nA[t]},he.incrementWrap=function(t,n,e){if(e=e??0,!ne(t))throw new pe("n is required.");if(n<=e)throw new pe("maximumValue must be greater than minimumValue.");return++t,t>n&&(t=e),t},he.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new pe("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},he.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new pe("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},he.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new pe("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},he.clamp=function(t,n,e){return N.typeOf.number("value",t),N.typeOf.number("min",n),N.typeOf.number("max",e),t<n?n:t>e?e:t};let nb=new tb;he.setRandomNumberSeed=function(t){if(!ne(t))throw new pe("seed is required.");nb=new tb(t)},he.nextRandomNumber=function(){return nb.random()},he.randomBetween=function(t,n){return he.nextRandomNumber()*(n-t)+t},he.acosClamped=function(t){if(!ne(t))throw new pe("value is required.");return Math.acos(he.clamp(t,-1,1))},he.asinClamped=function(t){if(!ne(t))throw new pe("value is required.");return Math.asin(he.clamp(t,-1,1))},he.chordLength=function(t,n){if(!ne(t))throw new pe("angle is required.");if(!ne(n))throw new pe("radius is required.");return 2*n*Math.sin(t*.5)},he.logBase=function(t,n){if(!ne(t))throw new pe("number is required.");if(!ne(n))throw new pe("base is required.");return Math.log(t)/Math.log(n)},he.cbrt=Math.cbrt??function(n){const e=Math.pow(Math.abs(n),.3333333333333333);return n<0?-e:e},he.log2=Math.log2??function(n){return Math.log(n)*Math.LOG2E},he.fog=function(t,n){const e=t*n;return 1-Math.exp(-(e*e))},he.fastApproximateAtan=function(t){return N.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},he.fastApproximateAtan2=function(t,n){N.typeOf.number("x",t),N.typeOf.number("y",n);let e,i=Math.abs(t);e=Math.abs(n);const o=Math.max(i,e);e=Math.min(i,e);const r=e/o;if(isNaN(r))throw new pe("either x or y must be nonzero");return i=he.fastApproximateAtan(r),i=Math.abs(n)>Math.abs(t)?he.PI_OVER_TWO-i:i,i=t<0?he.PI-i:i,i=n<0?-i:i,i};function ae(t,n,e){this.x=t??0,this.y=n??0,this.z=e??0}ae.fromSpherical=function(t,n){N.typeOf.object("spherical",t),ne(n)||(n=new ae);const e=t.clock,i=t.cone,o=t.magnitude??1,r=o*Math.sin(i);return n.x=r*Math.cos(e),n.y=r*Math.sin(e),n.z=o*Math.cos(i),n},ae.fromElements=function(t,n,e,i){return ne(i)?(i.x=t,i.y=n,i.z=e,i):new ae(t,n,e)},ae.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new ae(t.x,t.y,t.z)},ae.fromCartesian4=ae.clone,ae.packedLength=3,ae.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e]=t.z,n},ae.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ae),e.x=t[n++],e.y=t[n++],e.z=t[n],e},ae.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*3;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 3 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)ae.pack(t[o],n,o*3);return n},ae.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new pe("array length must be a multiple of 3.");const e=t.length;ne(n)?n.length=e/3:n=new Array(e/3);for(let i=0;i<e;i+=3){const o=i/3;n[o]=ae.unpack(t,i,n[o])}return n},ae.fromArray=ae.unpack,ae.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},ae.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},ae.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e},ae.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e},ae.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y),a=he.clamp(t.z,n.z,e.z);return i.x=o,i.y=r,i.z=a,i},ae.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},ae.magnitude=function(t){return Math.sqrt(ae.magnitudeSquared(t))};const iA=new ae;ae.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),ae.subtract(t,n,iA),ae.magnitude(iA)},ae.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),ae.subtract(t,n,iA),ae.magnitudeSquared(iA)},ae.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new pe("normalized result is not a number");return n},ae.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},ae.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e},ae.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e},ae.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e},ae.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e},ae.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e},ae.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},ae.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},ae.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n};const ib=new ae;ae.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),ae.multiplyByScalar(n,e,ib),i=ae.multiplyByScalar(t,1-e,i),ae.add(ib,i,i)};const rA=new ae,cd=new ae;ae.angleBetween=function(t,n){N.typeOf.object("left",t),N.typeOf.object("right",n),ae.normalize(t,rA),ae.normalize(n,cd);const e=ae.dot(rA,cd),i=ae.magnitude(ae.cross(rA,cd,rA));return Math.atan2(i,e)};const ZD=new ae;ae.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.normalize(t,ZD);return ae.abs(e,e),e.x<=e.y?e.x<=e.z?n=ae.clone(ae.UNIT_X,n):n=ae.clone(ae.UNIT_Z,n):e.y<=e.z?n=ae.clone(ae.UNIT_Y,n):n=ae.clone(ae.UNIT_Z,n),n},ae.projectVector=function(t,n,e){N.defined("a",t),N.defined("b",n),N.defined("result",e);const i=ae.dot(t,n)/ae.dot(n,n);return ae.multiplyByScalar(n,i,e)},ae.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},ae.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]},ae.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)&&he.equalsEpsilon(t.z,n.z,e,i)},ae.cross=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t.x,o=t.y,r=t.z,a=n.x,s=n.y,l=n.z,u=o*l-r*s,A=r*a-i*l,c=i*s-o*a;return e.x=u,e.y=A,e.z=c,e},ae.midpoint=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=(t.x+n.x)*.5,e.y=(t.y+n.y)*.5,e.z=(t.z+n.z)*.5,e},ae.fromDegrees=function(t,n,e,i,o){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),t=he.toRadians(t),n=he.toRadians(n),ae.fromRadians(t,n,e,i,o)};let Hn=new ae,Ms=new ae;ae._ellipsoidRadiiSquared=new ae(40680631590769,40680631590769,40408299984661445e-3),ae.fromRadians=function(t,n,e,i,o){N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),e=e??0;const r=ne(i)?i.radiiSquared:ae._ellipsoidRadiiSquared,a=Math.cos(n);Hn.x=a*Math.cos(t),Hn.y=a*Math.sin(t),Hn.z=Math.sin(n),Hn=ae.normalize(Hn,Hn),ae.multiplyComponents(r,Hn,Ms);const s=Math.sqrt(ae.dot(Hn,Ms));return Ms=ae.divideByScalar(Ms,s,Ms),Hn=ae.multiplyByScalar(Hn,e,Hn),ne(o)||(o=new ae),ae.add(Ms,Hn,o)},ae.fromDegreesArray=function(t,n,e){if(N.defined("coordinates",t),t.length<2||t.length%2!==0)throw new pe("the number of coordinates must be a multiple of 2 and at least 2");const i=t.length;ne(e)?e.length=i/2:e=new Array(i/2);for(let o=0;o<i;o+=2){const r=t[o],a=t[o+1],s=o/2;e[s]=ae.fromDegrees(r,a,0,n,e[s])}return e},ae.fromRadiansArray=function(t,n,e){if(N.defined("coordinates",t),t.length<2||t.length%2!==0)throw new pe("the number of coordinates must be a multiple of 2 and at least 2");const i=t.length;ne(e)?e.length=i/2:e=new Array(i/2);for(let o=0;o<i;o+=2){const r=t[o],a=t[o+1],s=o/2;e[s]=ae.fromRadians(r,a,0,n,e[s])}return e},ae.fromDegreesArrayHeights=function(t,n,e){if(N.defined("coordinates",t),t.length<3||t.length%3!==0)throw new pe("the number of coordinates must be a multiple of 3 and at least 3");const i=t.length;ne(e)?e.length=i/3:e=new Array(i/3);for(let o=0;o<i;o+=3){const r=t[o],a=t[o+1],s=t[o+2],l=o/3;e[l]=ae.fromDegrees(r,a,s,n,e[l])}return e},ae.fromRadiansArrayHeights=function(t,n,e){if(N.defined("coordinates",t),t.length<3||t.length%3!==0)throw new pe("the number of coordinates must be a multiple of 3 and at least 3");const i=t.length;ne(e)?e.length=i/3:e=new Array(i/3);for(let o=0;o<i;o+=3){const r=t[o],a=t[o+1],s=t[o+2],l=o/3;e[l]=ae.fromRadians(r,a,s,n,e[l])}return e},ae.ZERO=Object.freeze(new ae(0,0,0)),ae.ONE=Object.freeze(new ae(1,1,1)),ae.UNIT_X=Object.freeze(new ae(1,0,0)),ae.UNIT_Y=Object.freeze(new ae(0,1,0)),ae.UNIT_Z=Object.freeze(new ae(0,0,1)),ae.prototype.clone=function(t){return ae.clone(this,t)},ae.prototype.equals=function(t){return ae.equals(this,t)},ae.prototype.equalsEpsilon=function(t,n,e){return ae.equalsEpsilon(this,t,n,e)},ae.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function be(t,n,e,i){this.x=t??0,this.y=n??0,this.z=e??0,this.w=i??0}be.fromElements=function(t,n,e,i,o){return ne(o)?(o.x=t,o.y=n,o.z=e,o.w=i,o):new be(t,n,e,i)},be.fromColor=function(t,n){return N.typeOf.object("color",t),ne(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new be(t.red,t.green,t.blue,t.alpha)},be.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new be(t.x,t.y,t.z,t.w)},be.packedLength=4,be.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},be.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new be),e.x=t[n++],e.y=t[n++],e.z=t[n++],e.w=t[n],e},be.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*4;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)be.pack(t[o],n,o*4);return n},be.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new pe("array length must be a multiple of 4.");const e=t.length;ne(n)?n.length=e/4:n=new Array(e/4);for(let i=0;i<e;i+=4){const o=i/4;n[o]=be.unpack(t,i,n[o])}return n},be.fromArray=be.unpack,be.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},be.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},be.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e.w=Math.min(t.w,n.w),e},be.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e.w=Math.max(t.w,n.w),e},be.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y),a=he.clamp(t.z,n.z,e.z),s=he.clamp(t.w,n.w,e.w);return i.x=o,i.y=r,i.z=a,i.w=s,i},be.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},be.magnitude=function(t){return Math.sqrt(be.magnitudeSquared(t))};const oA=new be;be.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),be.subtract(t,n,oA),be.magnitude(oA)},be.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),be.subtract(t,n,oA),be.magnitudeSquared(oA)},be.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=be.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new pe("normalized result is not a number");return n},be.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},be.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e.w=t.w*n.w,e},be.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e.w=t.w/n.w,e},be.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},be.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},be.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},be.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},be.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},be.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n};const rb=new be;be.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),be.multiplyByScalar(n,e,rb),i=be.multiplyByScalar(t,1-e,i),be.add(rb,i,i)};const XD=new be;be.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=be.normalize(t,XD);return be.abs(e,e),e.x<=e.y?e.x<=e.z?e.x<=e.w?n=be.clone(be.UNIT_X,n):n=be.clone(be.UNIT_W,n):e.z<=e.w?n=be.clone(be.UNIT_Z,n):n=be.clone(be.UNIT_W,n):e.y<=e.z?e.y<=e.w?n=be.clone(be.UNIT_Y,n):n=be.clone(be.UNIT_W,n):e.z<=e.w?n=be.clone(be.UNIT_Z,n):n=be.clone(be.UNIT_W,n),n},be.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},be.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]&&t.w===n[e+3]},be.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)&&he.equalsEpsilon(t.z,n.z,e,i)&&he.equalsEpsilon(t.w,n.w,e,i)},be.ZERO=Object.freeze(new be(0,0,0,0)),be.ONE=Object.freeze(new be(1,1,1,1)),be.UNIT_X=Object.freeze(new be(1,0,0,0)),be.UNIT_Y=Object.freeze(new be(0,1,0,0)),be.UNIT_Z=Object.freeze(new be(0,0,1,0)),be.UNIT_W=Object.freeze(new be(0,0,0,1)),be.prototype.clone=function(t){return be.clone(this,t)},be.prototype.equals=function(t){return be.equals(this,t)},be.prototype.equalsEpsilon=function(t,n,e){return be.equalsEpsilon(this,t,n,e)},be.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const hd=new Float32Array(1),Zt=new Uint8Array(hd.buffer),$D=new Uint32Array([287454020]),ob=new Uint8Array($D.buffer)[0]===68;be.packFloat=function(t,n){return N.typeOf.number("value",t),ne(n)||(n=new be),hd[0]=t,ob?(n.x=Zt[0],n.y=Zt[1],n.z=Zt[2],n.w=Zt[3]):(n.x=Zt[3],n.y=Zt[2],n.z=Zt[1],n.w=Zt[0]),n},be.unpackFloat=function(t){return N.typeOf.object("packedFloat",t),ob?(Zt[0]=t.x,Zt[1]=t.y,Zt[2]=t.z,Zt[3]=t.w):(Zt[0]=t.w,Zt[1]=t.z,Zt[2]=t.y,Zt[3]=t.x),hd[0]};const gi={};gi.EMPTY_OBJECT=Object.freeze({}),gi.EMPTY_ARRAY=Object.freeze([]);function me(t,n,e,i,o,r,a,s,l){this[0]=t??0,this[1]=i??0,this[2]=a??0,this[3]=n??0,this[4]=o??0,this[5]=s??0,this[6]=e??0,this[7]=r??0,this[8]=l??0}me.packedLength=9,me.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n},me.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new me),e[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e},me.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*9;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 9 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)me.pack(t[o],n,o*9);return n},me.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new pe("array length must be a multiple of 9.");const e=t.length;ne(n)?n.length=e/9:n=new Array(e/9);for(let i=0;i<e;i+=9){const o=i/9;n[o]=me.unpack(t,i,n[o])}return n},me.clone=function(t,n){if(ne(t))return ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new me(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},me.fromArray=me.unpack,me.fromColumnMajorArray=function(t,n){return N.defined("values",t),me.clone(t,n)},me.fromRowMajorArray=function(t,n){return N.defined("values",t),ne(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new me(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},me.fromQuaternion=function(t,n){N.typeOf.object("quaternion",t);const e=t.x*t.x,i=t.x*t.y,o=t.x*t.z,r=t.x*t.w,a=t.y*t.y,s=t.y*t.z,l=t.y*t.w,u=t.z*t.z,A=t.z*t.w,c=t.w*t.w,f=e-a-u+c,d=2*(i-A),p=2*(o+l),g=2*(i+A),v=-e+a-u+c,y=2*(s-r),m=2*(o-l),b=2*(s+r),x=-e-a+u+c;return ne(n)?(n[0]=f,n[1]=g,n[2]=m,n[3]=d,n[4]=v,n[5]=b,n[6]=p,n[7]=y,n[8]=x,n):new me(f,d,p,g,v,y,m,b,x)},me.fromHeadingPitchRoll=function(t,n){N.typeOf.object("headingPitchRoll",t);const e=Math.cos(-t.pitch),i=Math.cos(-t.heading),o=Math.cos(t.roll),r=Math.sin(-t.pitch),a=Math.sin(-t.heading),s=Math.sin(t.roll),l=e*i,u=-o*a+s*r*i,A=s*a+o*r*i,c=e*a,f=o*i+s*r*a,d=-s*i+o*r*a,p=-r,g=s*e,v=o*e;return ne(n)?(n[0]=l,n[1]=c,n[2]=p,n[3]=u,n[4]=f,n[5]=g,n[6]=A,n[7]=d,n[8]=v,n):new me(l,u,A,c,f,d,p,g,v)},me.fromScale=function(t,n){return N.typeOf.object("scale",t),ne(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new me(t.x,0,0,0,t.y,0,0,0,t.z)},me.fromUniformScale=function(t,n){return N.typeOf.number("scale",t),ne(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new me(t,0,0,0,t,0,0,0,t)},me.fromCrossProduct=function(t,n){return N.typeOf.object("vector",t),ne(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new me(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},me.fromRotationX=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=i,n[6]=0,n[7]=-i,n[8]=e,n):new me(1,0,0,0,e,-i,0,i,e)},me.fromRotationY=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=e,n[1]=0,n[2]=-i,n[3]=0,n[4]=1,n[5]=0,n[6]=i,n[7]=0,n[8]=e,n):new me(e,0,i,0,1,0,-i,0,e)},me.fromRotationZ=function(t,n){N.typeOf.number("angle",t);const e=Math.cos(t),i=Math.sin(t);return ne(n)?(n[0]=e,n[1]=i,n[2]=0,n[3]=-i,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new me(e,-i,0,i,e,0,0,0,1)},me.toArray=function(t,n){return N.typeOf.object("matrix",t),ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},me.getElementIndex=function(t,n){return N.typeOf.number.greaterThanOrEquals("row",n,0),N.typeOf.number.lessThanOrEquals("row",n,2),N.typeOf.number.greaterThanOrEquals("column",t,0),N.typeOf.number.lessThanOrEquals("column",t,2),t*3+n},me.getColumn=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("result",e);const i=n*3,o=t[i],r=t[i+1],a=t[i+2];return e.x=o,e.y=r,e.z=a,e},me.setColumn=function(t,n,e,i){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=me.clone(t,i);const o=n*3;return i[o]=e.x,i[o+1]=e.y,i[o+2]=e.z,i},me.getRow=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("result",e);const i=t[n],o=t[n+3],r=t[n+6];return e.x=i,e.y=o,e.z=r,e},me.setRow=function(t,n,e,i){return N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,2),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=me.clone(t,i),i[n]=e.x,i[n+3]=e.y,i[n+6]=e.z,i};const YD=new ae;me.setScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=me.getScale(t,YD),o=n.x/i.x,r=n.y/i.y,a=n.z/i.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*a,e};const JD=new ae;me.setUniformScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e);const i=me.getScale(t,JD),o=n/i.x,r=n/i.y,a=n/i.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*a,e};const Ad=new ae;me.getScale=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=ae.magnitude(ae.fromElements(t[0],t[1],t[2],Ad)),n.y=ae.magnitude(ae.fromElements(t[3],t[4],t[5],Ad)),n.z=ae.magnitude(ae.fromElements(t[6],t[7],t[8],Ad)),n};const sb=new ae;me.getMaximumScale=function(t){return me.getScale(t,sb),ae.maximumComponent(sb)};const e4=new ae;me.setRotation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("result",e);const i=me.getScale(t,e4);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=n[3]*i.y,e[4]=n[4]*i.y,e[5]=n[5]*i.y,e[6]=n[6]*i.z,e[7]=n[7]*i.z,e[8]=n[8]*i.z,e};const t4=new ae;me.getRotation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=me.getScale(t,t4);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[3]/e.y,n[4]=t[4]/e.y,n[5]=t[5]/e.y,n[6]=t[6]/e.z,n[7]=t[7]/e.z,n[8]=t[8]/e.z,n},me.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],r=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],s=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],l=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],u=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],A=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],c=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return e[0]=i,e[1]=o,e[2]=r,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=A,e[8]=c,e},me.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},me.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e},me.multiplyByVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[3]*o+t[6]*r,s=t[1]*i+t[4]*o+t[7]*r,l=t[2]*i+t[5]*o+t[8]*r;return e.x=a,e.y=s,e.z=l,e},me.multiplyByScalar=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},me.multiplyByScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n.x,e[1]=t[1]*n.x,e[2]=t[2]*n.x,e[3]=t[3]*n.y,e[4]=t[4]*n.y,e[5]=t[5]*n.y,e[6]=t[6]*n.z,e[7]=t[7]*n.z,e[8]=t[8]*n.z,e},me.multiplyByUniformScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},me.negate=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n},me.transpose=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[3],o=t[6],r=t[1],a=t[4],s=t[7],l=t[2],u=t[5],A=t[8];return n[0]=e,n[1]=i,n[2]=o,n[3]=r,n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=A,n};function n4(t){let n=0;for(let e=0;e<9;++e){const i=t[e];n+=i*i}return Math.sqrt(n)}const fd=[1,0,0],pd=[2,2,1];function i4(t){let n=0;for(let e=0;e<3;++e){const i=t[me.getElementIndex(pd[e],fd[e])];n+=2*i*i}return Math.sqrt(n)}function r4(t,n){const e=he.EPSILON15;let i=0,o=1;for(let u=0;u<3;++u){const A=Math.abs(t[me.getElementIndex(pd[u],fd[u])]);A>i&&(o=u,i=A)}let r=1,a=0;const s=fd[o],l=pd[o];if(Math.abs(t[me.getElementIndex(l,s)])>e){const u=t[me.getElementIndex(l,l)],A=t[me.getElementIndex(s,s)],c=t[me.getElementIndex(l,s)],f=(u-A)/2/c;let d;f<0?d=-1/(-f+Math.sqrt(1+f*f)):d=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+d*d),a=d*r}return n=me.clone(me.IDENTITY,n),n[me.getElementIndex(s,s)]=n[me.getElementIndex(l,l)]=r,n[me.getElementIndex(l,s)]=a,n[me.getElementIndex(s,l)]=-a,n}const sA=new me,ab=new me;me.computeEigenDecomposition=function(t,n){N.typeOf.object("matrix",t);const e=he.EPSILON20,i=10;let o=0,r=0;ne(n)||(n={});const a=n.unitary=me.clone(me.IDENTITY,n.unitary),s=n.diagonal=me.clone(t,n.diagonal),l=e*n4(s);for(;r<i&&i4(s)>l;)r4(s,sA),me.transpose(sA,ab),me.multiply(s,sA,s),me.multiply(ab,s,s),me.multiply(a,sA,a),++o>2&&(++r,o=0);return n},me.abs=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n},me.determinant=function(t){N.typeOf.object("matrix",t);const n=t[0],e=t[3],i=t[6],o=t[1],r=t[4],a=t[7],s=t[2],l=t[5],u=t[8];return n*(r*u-l*a)+o*(l*i-e*u)+s*(e*a-r*i)},me.inverse=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[1],o=t[2],r=t[3],a=t[4],s=t[5],l=t[6],u=t[7],A=t[8],c=me.determinant(t);if(Math.abs(c)<=he.EPSILON15)throw new pe("matrix is not invertible");n[0]=a*A-u*s,n[1]=u*o-i*A,n[2]=i*s-a*o,n[3]=l*s-r*A,n[4]=e*A-l*o,n[5]=r*o-e*s,n[6]=r*u-l*a,n[7]=l*i-e*u,n[8]=e*a-r*i;const f=1/c;return me.multiplyByScalar(n,f,n)};const o4=new me;me.inverseTranspose=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),me.inverse(me.transpose(t,o4),n)},me.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},me.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e},me.IDENTITY=Object.freeze(new me(1,0,0,0,1,0,0,0,1)),me.ZERO=Object.freeze(new me(0,0,0,0,0,0,0,0,0)),me.COLUMN0ROW0=0,me.COLUMN0ROW1=1,me.COLUMN0ROW2=2,me.COLUMN1ROW0=3,me.COLUMN1ROW1=4,me.COLUMN1ROW2=5,me.COLUMN2ROW0=6,me.COLUMN2ROW1=7,me.COLUMN2ROW2=8,Object.defineProperties(me.prototype,{length:{get:function(){return me.packedLength}}}),me.prototype.clone=function(t){return me.clone(this,t)},me.prototype.equals=function(t){return me.equals(this,t)},me.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]},me.prototype.equalsEpsilon=function(t,n){return me.equalsEpsilon(this,t,n)},me.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
342
342
  (${this[1]}, ${this[4]}, ${this[7]})
343
343
  (${this[2]}, ${this[5]}, ${this[8]})`};function Nt(t){this.name="RuntimeError",this.message=t;let n;try{throw new Error}catch(e){n=e.stack}this.stack=n}ne(Object.create)&&(Nt.prototype=Object.create(Error.prototype),Nt.prototype.constructor=Nt),Nt.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return ne(this.stack)&&(t+=`
344
- ${this.stack.toString()}`),t};function ge(t,n,e,i,o,r,a,s,l,u,A,c,f,d,p,g){this[0]=t??0,this[1]=o??0,this[2]=l??0,this[3]=f??0,this[4]=n??0,this[5]=r??0,this[6]=u??0,this[7]=d??0,this[8]=e??0,this[9]=a??0,this[10]=A??0,this[11]=p??0,this[12]=i??0,this[13]=s??0,this[14]=c??0,this[15]=g??0}ge.packedLength=16,ge.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n[e++]=t[9],n[e++]=t[10],n[e++]=t[11],n[e++]=t[12],n[e++]=t[13],n[e++]=t[14],n[e]=t[15],n},ge.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ge),e[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e[9]=t[n++],e[10]=t[n++],e[11]=t[n++],e[12]=t[n++],e[13]=t[n++],e[14]=t[n++],e[15]=t[n],e},ge.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*16;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)ge.pack(t[o],n,o*16);return n},ge.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!==0)throw new pe("array length must be a multiple of 16.");const e=t.length;ne(n)?n.length=e/16:n=new Array(e/16);for(let i=0;i<e;i+=16){const o=i/16;n[o]=ge.unpack(t,i,n[o])}return n},ge.clone=function(t,n){if(ne(t))return ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new ge(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])},ge.fromArray=ge.unpack,ge.fromColumnMajorArray=function(t,n){return N.defined("values",t),ge.clone(t,n)},ge.fromRowMajorArray=function(t,n){return N.defined("values",t),ne(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new ge(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])},ge.fromRotationTranslation=function(t,n,e){return N.typeOf.object("rotation",t),n=n??ae.ZERO,ne(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]=n.x,e[13]=n.y,e[14]=n.z,e[15]=1,e):new ge(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},ge.fromTranslationQuaternionRotationScale=function(t,n,e,i){N.typeOf.object("translation",t),N.typeOf.object("rotation",n),N.typeOf.object("scale",e),ne(i)||(i=new ge);const o=e.x,r=e.y,a=e.z,s=n.x*n.x,l=n.x*n.y,u=n.x*n.z,A=n.x*n.w,c=n.y*n.y,f=n.y*n.z,d=n.y*n.w,p=n.z*n.z,g=n.z*n.w,v=n.w*n.w,y=s-c-p+v,m=2*(l-g),b=2*(u+d),x=2*(l+g),E=-s+c-p+v,B=2*(f-A),P=2*(u-d),I=2*(f+A),O=-s-c+p+v;return i[0]=y*o,i[1]=x*o,i[2]=P*o,i[3]=0,i[4]=m*r,i[5]=E*r,i[6]=I*r,i[7]=0,i[8]=b*a,i[9]=B*a,i[10]=O*a,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},ge.fromTranslationRotationScale=function(t,n){return N.typeOf.object("translationRotationScale",t),ge.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)},ge.fromTranslation=function(t,n){return N.typeOf.object("translation",t),ge.fromRotationTranslation(me.IDENTITY,t,n)},ge.fromScale=function(t,n){return N.typeOf.object("scale",t),ne(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new ge(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},ge.fromUniformScale=function(t,n){return N.typeOf.number("scale",t),ne(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new ge(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},ge.fromRotation=function(t,n){return N.typeOf.object("rotation",t),ne(n)||(n=new ge),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n};const Ds=new ae,Rs=new ae,fl=new ae;ge.fromCamera=function(t,n){N.typeOf.object("camera",t);const e=t.position,i=t.direction,o=t.up;N.typeOf.object("camera.position",e),N.typeOf.object("camera.direction",i),N.typeOf.object("camera.up",o),ae.normalize(i,Ds),ae.normalize(ae.cross(Ds,o,Rs),Rs),ae.normalize(ae.cross(Rs,Ds,fl),fl);const r=Rs.x,a=Rs.y,s=Rs.z,l=Ds.x,u=Ds.y,A=Ds.z,c=fl.x,f=fl.y,d=fl.z,p=e.x,g=e.y,v=e.z,y=r*-p+a*-g+s*-v,m=c*-p+f*-g+d*-v,b=l*p+u*g+A*v;return ne(n)?(n[0]=r,n[1]=c,n[2]=-l,n[3]=0,n[4]=a,n[5]=f,n[6]=-u,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=y,n[13]=m,n[14]=b,n[15]=1,n):new ge(r,a,s,y,c,f,d,m,-l,-u,-A,b,0,0,0,1)},ge.computePerspectiveFieldOfView=function(t,n,e,i,o){N.typeOf.number.greaterThan("fovY",t,0),N.typeOf.number.lessThan("fovY",t,Math.PI),N.typeOf.number.greaterThan("near",e,0),N.typeOf.number.greaterThan("far",i,0),N.typeOf.object("result",o);const a=1/Math.tan(t*.5),s=a/n,l=(i+e)/(e-i),u=2*i*e/(e-i);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o},ge.computeOrthographicOffCenter=function(t,n,e,i,o,r,a){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.number("far",r),N.typeOf.object("result",a);let s=1/(n-t),l=1/(i-e),u=1/(r-o);const A=-(n+t)*s,c=-(i+e)*l,f=-(r+o)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=A,a[13]=c,a[14]=f,a[15]=1,a},ge.computePerspectiveOffCenter=function(t,n,e,i,o,r,a){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.number("far",r),N.typeOf.object("result",a);const s=2*o/(n-t),l=2*o/(i-e),u=(n+t)/(n-t),A=(i+e)/(i-e),c=-(r+o)/(r-o),f=-1,d=-2*r*o/(r-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=A,a[10]=c,a[11]=f,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},ge.computeInfinitePerspectiveOffCenter=function(t,n,e,i,o,r){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.object("result",r);const a=2*o/(n-t),s=2*o/(i-e),l=(n+t)/(n-t),u=(i+e)/(i-e),A=-1,c=-1,f=-2*o;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=l,r[9]=u,r[10]=A,r[11]=c,r[12]=0,r[13]=0,r[14]=f,r[15]=0,r},ge.computeViewportTransformation=function(t,n,e,i){ne(i)||(i=new ge),t=t??gi.EMPTY_OBJECT;const o=t.x??0,r=t.y??0,a=t.width??0,s=t.height??0;n=n??0,e=e??1;const l=a*.5,u=s*.5,A=(e-n)*.5,c=l,f=u,d=A,p=o+l,g=r+u,v=n+A,y=1;return i[0]=c,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=0,i[12]=p,i[13]=g,i[14]=v,i[15]=y,i},ge.computeView=function(t,n,e,i,o){return N.typeOf.object("position",t),N.typeOf.object("direction",n),N.typeOf.object("up",e),N.typeOf.object("right",i),N.typeOf.object("result",o),o[0]=i.x,o[1]=e.x,o[2]=-n.x,o[3]=0,o[4]=i.y,o[5]=e.y,o[6]=-n.y,o[7]=0,o[8]=i.z,o[9]=e.z,o[10]=-n.z,o[11]=0,o[12]=-ae.dot(i,t),o[13]=-ae.dot(e,t),o[14]=ae.dot(n,t),o[15]=1,o},ge.toArray=function(t,n){return N.typeOf.object("matrix",t),ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[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]]},ge.getElementIndex=function(t,n){return N.typeOf.number.greaterThanOrEquals("row",n,0),N.typeOf.number.lessThanOrEquals("row",n,3),N.typeOf.number.greaterThanOrEquals("column",t,0),N.typeOf.number.lessThanOrEquals("column",t,3),t*4+n},ge.getColumn=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("result",e);const i=n*4,o=t[i],r=t[i+1],a=t[i+2],s=t[i+3];return e.x=o,e.y=r,e.z=a,e.w=s,e},ge.setColumn=function(t,n,e,i){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=ge.clone(t,i);const o=n*4;return i[o]=e.x,i[o+1]=e.y,i[o+2]=e.z,i[o+3]=e.w,i},ge.getRow=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("result",e);const i=t[n],o=t[n+4],r=t[n+8],a=t[n+12];return e.x=i,e.y=o,e.z=r,e.w=a,e},ge.setRow=function(t,n,e,i){return N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=ge.clone(t,i),i[n]=e.x,i[n+4]=e.y,i[n+8]=e.z,i[n+12]=e.w,i},ge.setTranslation=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.object("translation",n),N.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]=n.x,e[13]=n.y,e[14]=n.z,e[15]=t[15],e};const sR=new ae;ge.setScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=ge.getScale(t,sR),o=n.x/i.x,r=n.y/i.y,a=n.z/i.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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const aR=new ae;ge.setUniformScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e);const i=ge.getScale(t,aR),o=n/i.x,r=n/i.y,a=n/i.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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const dd=new ae;ge.getScale=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=ae.magnitude(ae.fromElements(t[0],t[1],t[2],dd)),n.y=ae.magnitude(ae.fromElements(t[4],t[5],t[6],dd)),n.z=ae.magnitude(ae.fromElements(t[8],t[9],t[10],dd)),n};const lb=new ae;ge.getMaximumScale=function(t){return ge.getScale(t,lb),ae.maximumComponent(lb)};const lR=new ae;ge.setRotation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("result",e);const i=ge.getScale(t,lR);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=t[3],e[4]=n[3]*i.y,e[5]=n[4]*i.y,e[6]=n[5]*i.y,e[7]=t[7],e[8]=n[6]*i.z,e[9]=n[7]*i.z,e[10]=n[8]*i.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const uR=new ae;ge.getRotation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=ge.getScale(t,uR);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[4]/e.y,n[4]=t[5]/e.y,n[5]=t[6]/e.y,n[6]=t[8]/e.z,n[7]=t[9]/e.z,n[8]=t[10]/e.z,n},ge.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[3],s=t[4],l=t[5],u=t[6],A=t[7],c=t[8],f=t[9],d=t[10],p=t[11],g=t[12],v=t[13],y=t[14],m=t[15],b=n[0],x=n[1],E=n[2],B=n[3],P=n[4],I=n[5],O=n[6],M=n[7],S=n[8],T=n[9],w=n[10],C=n[11],U=n[12],F=n[13],D=n[14],R=n[15],L=i*b+s*x+c*E+g*B,k=o*b+l*x+f*E+v*B,Q=r*b+u*x+d*E+y*B,V=a*b+A*x+p*E+m*B,G=i*P+s*I+c*O+g*M,$=o*P+l*I+f*O+v*M,Y=r*P+u*I+d*O+y*M,ie=a*P+A*I+p*O+m*M,re=i*S+s*T+c*w+g*C,le=o*S+l*T+f*w+v*C,ue=r*S+u*T+d*w+y*C,te=a*S+A*T+p*w+m*C,ce=i*U+s*F+c*D+g*R,X=o*U+l*F+f*D+v*R,q=r*U+u*F+d*D+y*R,H=a*U+A*F+p*D+m*R;return e[0]=L,e[1]=k,e[2]=Q,e[3]=V,e[4]=G,e[5]=$,e[6]=Y,e[7]=ie,e[8]=re,e[9]=le,e[10]=ue,e[11]=te,e[12]=ce,e[13]=X,e[14]=q,e[15]=H,e},ge.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},ge.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e},ge.multiplyTransformation=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[4],s=t[5],l=t[6],u=t[8],A=t[9],c=t[10],f=t[12],d=t[13],p=t[14],g=n[0],v=n[1],y=n[2],m=n[4],b=n[5],x=n[6],E=n[8],B=n[9],P=n[10],I=n[12],O=n[13],M=n[14],S=i*g+a*v+u*y,T=o*g+s*v+A*y,w=r*g+l*v+c*y,C=i*m+a*b+u*x,U=o*m+s*b+A*x,F=r*m+l*b+c*x,D=i*E+a*B+u*P,R=o*E+s*B+A*P,L=r*E+l*B+c*P,k=i*I+a*O+u*M+f,Q=o*I+s*O+A*M+d,V=r*I+l*O+c*M+p;return e[0]=S,e[1]=T,e[2]=w,e[3]=0,e[4]=C,e[5]=U,e[6]=F,e[7]=0,e[8]=D,e[9]=R,e[10]=L,e[11]=0,e[12]=k,e[13]=Q,e[14]=V,e[15]=1,e},ge.multiplyByMatrix3=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("rotation",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[4],s=t[5],l=t[6],u=t[8],A=t[9],c=t[10],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8],E=i*f+a*d+u*p,B=o*f+s*d+A*p,P=r*f+l*d+c*p,I=i*g+a*v+u*y,O=o*g+s*v+A*y,M=r*g+l*v+c*y,S=i*m+a*b+u*x,T=o*m+s*b+A*x,w=r*m+l*b+c*x;return e[0]=E,e[1]=B,e[2]=P,e[3]=0,e[4]=I,e[5]=O,e[6]=M,e[7]=0,e[8]=S,e[9]=T,e[10]=w,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},ge.multiplyByTranslation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("translation",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=i*t[0]+o*t[4]+r*t[8]+t[12],s=i*t[1]+o*t[5]+r*t[9]+t[13],l=i*t[2]+o*t[6]+r*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]=a,e[13]=s,e[14]=l,e[15]=t[15],e},ge.multiplyByScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z;return i===1&&o===1&&r===1?ge.clone(t,e):(e[0]=i*t[0],e[1]=i*t[1],e[2]=i*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]=r*t[8],e[9]=r*t[9],e[10]=r*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},ge.multiplyByUniformScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3],e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},ge.multiplyByVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=n.w,s=t[0]*i+t[4]*o+t[8]*r+t[12]*a,l=t[1]*i+t[5]*o+t[9]*r+t[13]*a,u=t[2]*i+t[6]*o+t[10]*r+t[14]*a,A=t[3]*i+t[7]*o+t[11]*r+t[15]*a;return e.x=s,e.y=l,e.z=u,e.w=A,e},ge.multiplyByPointAsVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[4]*o+t[8]*r,s=t[1]*i+t[5]*o+t[9]*r,l=t[2]*i+t[6]*o+t[10]*r;return e.x=a,e.y=s,e.z=l,e},ge.multiplyByPoint=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[4]*o+t[8]*r+t[12],s=t[1]*i+t[5]*o+t[9]*r+t[13],l=t[2]*i+t[6]*o+t[10]*r+t[14];return e.x=a,e.y=s,e.z=l,e},ge.multiplyByScalar=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},ge.negate=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n},ge.transpose=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[1],i=t[2],o=t[3],r=t[6],a=t[7],s=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=i,n[9]=r,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=s,n[15]=t[15],n},ge.abs=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n},ge.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]},ge.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e&&Math.abs(t[9]-n[9])<=e&&Math.abs(t[10]-n[10])<=e&&Math.abs(t[11]-n[11])<=e&&Math.abs(t[12]-n[12])<=e&&Math.abs(t[13]-n[13])<=e&&Math.abs(t[14]-n[14])<=e&&Math.abs(t[15]-n[15])<=e},ge.getTranslation=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=t[12],n.y=t[13],n.z=t[14],n},ge.getMatrix3=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n};const cR=new me,hR=new me,AR=new be,fR=new be(0,0,0,1);ge.inverse=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[4],o=t[8],r=t[12],a=t[1],s=t[5],l=t[9],u=t[13],A=t[2],c=t[6],f=t[10],d=t[14],p=t[3],g=t[7],v=t[11],y=t[15];let m=f*y,b=d*v,x=c*y,E=d*g,B=c*v,P=f*g,I=A*y,O=d*p,M=A*v,S=f*p,T=A*g,w=c*p;const C=m*s+E*l+B*u-(b*s+x*l+P*u),U=b*a+I*l+S*u-(m*a+O*l+M*u),F=x*a+O*s+T*u-(E*a+I*s+w*u),D=P*a+M*s+w*l-(B*a+S*s+T*l),R=b*i+x*o+P*r-(m*i+E*o+B*r),L=m*e+O*o+M*r-(b*e+I*o+S*r),k=E*e+I*i+w*r-(x*e+O*i+T*r),Q=B*e+S*i+T*o-(P*e+M*i+w*o);m=o*u,b=r*l,x=i*u,E=r*s,B=i*l,P=o*s,I=e*u,O=r*a,M=e*l,S=o*a,T=e*s,w=i*a;const V=m*g+E*v+B*y-(b*g+x*v+P*y),G=b*p+I*v+S*y-(m*p+O*v+M*y),$=x*p+O*g+T*y-(E*p+I*g+w*y),Y=P*p+M*g+w*v-(B*p+S*g+T*v),ie=x*f+P*d+b*c-(B*d+m*c+E*f),re=M*d+m*A+O*f-(I*f+S*d+b*A),le=I*c+w*d+E*A-(T*d+x*A+O*c),ue=T*f+B*A+S*c-(M*c+w*f+P*A);let te=e*C+i*U+o*F+r*D;if(Math.abs(te)<he.EPSILON21){if(me.equalsEpsilon(ge.getMatrix3(t,cR),hR,he.EPSILON7)&&be.equals(ge.getRow(t,3,AR),fR))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new Nt("matrix is not invertible because its determinate is zero.")}return te=1/te,n[0]=C*te,n[1]=U*te,n[2]=F*te,n[3]=D*te,n[4]=R*te,n[5]=L*te,n[6]=k*te,n[7]=Q*te,n[8]=V*te,n[9]=G*te,n[10]=$*te,n[11]=Y*te,n[12]=ie*te,n[13]=re*te,n[14]=le*te,n[15]=ue*te,n},ge.inverseTransformation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[1],o=t[2],r=t[4],a=t[5],s=t[6],l=t[8],u=t[9],A=t[10],c=t[12],f=t[13],d=t[14],p=-e*c-i*f-o*d,g=-r*c-a*f-s*d,v=-l*c-u*f-A*d;return n[0]=e,n[1]=r,n[2]=l,n[3]=0,n[4]=i,n[5]=a,n[6]=u,n[7]=0,n[8]=o,n[9]=s,n[10]=A,n[11]=0,n[12]=p,n[13]=g,n[14]=v,n[15]=1,n};const pR=new ge;ge.inverseTranspose=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),ge.inverse(ge.transpose(t,pR),n)},ge.IDENTITY=Object.freeze(new ge(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),ge.ZERO=Object.freeze(new ge(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),ge.COLUMN0ROW0=0,ge.COLUMN0ROW1=1,ge.COLUMN0ROW2=2,ge.COLUMN0ROW3=3,ge.COLUMN1ROW0=4,ge.COLUMN1ROW1=5,ge.COLUMN1ROW2=6,ge.COLUMN1ROW3=7,ge.COLUMN2ROW0=8,ge.COLUMN2ROW1=9,ge.COLUMN2ROW2=10,ge.COLUMN2ROW3=11,ge.COLUMN3ROW0=12,ge.COLUMN3ROW1=13,ge.COLUMN3ROW2=14,ge.COLUMN3ROW3=15,Object.defineProperties(ge.prototype,{length:{get:function(){return ge.packedLength}}}),ge.prototype.clone=function(t){return ge.clone(this,t)},ge.prototype.equals=function(t){return ge.equals(this,t)},ge.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]&&t[9]===n[e+9]&&t[10]===n[e+10]&&t[11]===n[e+11]&&t[12]===n[e+12]&&t[13]===n[e+13]&&t[14]===n[e+14]&&t[15]===n[e+15]},ge.prototype.equalsEpsilon=function(t,n){return ge.equalsEpsilon(this,t,n)},ge.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
344
+ ${this.stack.toString()}`),t};function ge(t,n,e,i,o,r,a,s,l,u,A,c,f,d,p,g){this[0]=t??0,this[1]=o??0,this[2]=l??0,this[3]=f??0,this[4]=n??0,this[5]=r??0,this[6]=u??0,this[7]=d??0,this[8]=e??0,this[9]=a??0,this[10]=A??0,this[11]=p??0,this[12]=i??0,this[13]=s??0,this[14]=c??0,this[15]=g??0}ge.packedLength=16,ge.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n[e++]=t[9],n[e++]=t[10],n[e++]=t[11],n[e++]=t[12],n[e++]=t[13],n[e++]=t[14],n[e]=t[15],n},ge.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ge),e[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e[9]=t[n++],e[10]=t[n++],e[11]=t[n++],e[12]=t[n++],e[13]=t[n++],e[14]=t[n++],e[15]=t[n],e},ge.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*16;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)ge.pack(t[o],n,o*16);return n},ge.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!==0)throw new pe("array length must be a multiple of 16.");const e=t.length;ne(n)?n.length=e/16:n=new Array(e/16);for(let i=0;i<e;i+=16){const o=i/16;n[o]=ge.unpack(t,i,n[o])}return n},ge.clone=function(t,n){if(ne(t))return ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new ge(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])},ge.fromArray=ge.unpack,ge.fromColumnMajorArray=function(t,n){return N.defined("values",t),ge.clone(t,n)},ge.fromRowMajorArray=function(t,n){return N.defined("values",t),ne(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new ge(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])},ge.fromRotationTranslation=function(t,n,e){return N.typeOf.object("rotation",t),n=n??ae.ZERO,ne(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]=n.x,e[13]=n.y,e[14]=n.z,e[15]=1,e):new ge(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},ge.fromTranslationQuaternionRotationScale=function(t,n,e,i){N.typeOf.object("translation",t),N.typeOf.object("rotation",n),N.typeOf.object("scale",e),ne(i)||(i=new ge);const o=e.x,r=e.y,a=e.z,s=n.x*n.x,l=n.x*n.y,u=n.x*n.z,A=n.x*n.w,c=n.y*n.y,f=n.y*n.z,d=n.y*n.w,p=n.z*n.z,g=n.z*n.w,v=n.w*n.w,y=s-c-p+v,m=2*(l-g),b=2*(u+d),x=2*(l+g),E=-s+c-p+v,B=2*(f-A),P=2*(u-d),I=2*(f+A),O=-s-c+p+v;return i[0]=y*o,i[1]=x*o,i[2]=P*o,i[3]=0,i[4]=m*r,i[5]=E*r,i[6]=I*r,i[7]=0,i[8]=b*a,i[9]=B*a,i[10]=O*a,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},ge.fromTranslationRotationScale=function(t,n){return N.typeOf.object("translationRotationScale",t),ge.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)},ge.fromTranslation=function(t,n){return N.typeOf.object("translation",t),ge.fromRotationTranslation(me.IDENTITY,t,n)},ge.fromScale=function(t,n){return N.typeOf.object("scale",t),ne(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new ge(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},ge.fromUniformScale=function(t,n){return N.typeOf.number("scale",t),ne(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new ge(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},ge.fromRotation=function(t,n){return N.typeOf.object("rotation",t),ne(n)||(n=new ge),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n};const Ds=new ae,Rs=new ae,fl=new ae;ge.fromCamera=function(t,n){N.typeOf.object("camera",t);const e=t.position,i=t.direction,o=t.up;N.typeOf.object("camera.position",e),N.typeOf.object("camera.direction",i),N.typeOf.object("camera.up",o),ae.normalize(i,Ds),ae.normalize(ae.cross(Ds,o,Rs),Rs),ae.normalize(ae.cross(Rs,Ds,fl),fl);const r=Rs.x,a=Rs.y,s=Rs.z,l=Ds.x,u=Ds.y,A=Ds.z,c=fl.x,f=fl.y,d=fl.z,p=e.x,g=e.y,v=e.z,y=r*-p+a*-g+s*-v,m=c*-p+f*-g+d*-v,b=l*p+u*g+A*v;return ne(n)?(n[0]=r,n[1]=c,n[2]=-l,n[3]=0,n[4]=a,n[5]=f,n[6]=-u,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=y,n[13]=m,n[14]=b,n[15]=1,n):new ge(r,a,s,y,c,f,d,m,-l,-u,-A,b,0,0,0,1)},ge.computePerspectiveFieldOfView=function(t,n,e,i,o){N.typeOf.number.greaterThan("fovY",t,0),N.typeOf.number.lessThan("fovY",t,Math.PI),N.typeOf.number.greaterThan("near",e,0),N.typeOf.number.greaterThan("far",i,0),N.typeOf.object("result",o);const a=1/Math.tan(t*.5),s=a/n,l=(i+e)/(e-i),u=2*i*e/(e-i);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o},ge.computeOrthographicOffCenter=function(t,n,e,i,o,r,a){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.number("far",r),N.typeOf.object("result",a);let s=1/(n-t),l=1/(i-e),u=1/(r-o);const A=-(n+t)*s,c=-(i+e)*l,f=-(r+o)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=A,a[13]=c,a[14]=f,a[15]=1,a},ge.computePerspectiveOffCenter=function(t,n,e,i,o,r,a){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.number("far",r),N.typeOf.object("result",a);const s=2*o/(n-t),l=2*o/(i-e),u=(n+t)/(n-t),A=(i+e)/(i-e),c=-(r+o)/(r-o),f=-1,d=-2*r*o/(r-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=A,a[10]=c,a[11]=f,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},ge.computeInfinitePerspectiveOffCenter=function(t,n,e,i,o,r){N.typeOf.number("left",t),N.typeOf.number("right",n),N.typeOf.number("bottom",e),N.typeOf.number("top",i),N.typeOf.number("near",o),N.typeOf.object("result",r);const a=2*o/(n-t),s=2*o/(i-e),l=(n+t)/(n-t),u=(i+e)/(i-e),A=-1,c=-1,f=-2*o;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=l,r[9]=u,r[10]=A,r[11]=c,r[12]=0,r[13]=0,r[14]=f,r[15]=0,r},ge.computeViewportTransformation=function(t,n,e,i){ne(i)||(i=new ge),t=t??gi.EMPTY_OBJECT;const o=t.x??0,r=t.y??0,a=t.width??0,s=t.height??0;n=n??0,e=e??1;const l=a*.5,u=s*.5,A=(e-n)*.5,c=l,f=u,d=A,p=o+l,g=r+u,v=n+A,y=1;return i[0]=c,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=0,i[12]=p,i[13]=g,i[14]=v,i[15]=y,i},ge.computeView=function(t,n,e,i,o){return N.typeOf.object("position",t),N.typeOf.object("direction",n),N.typeOf.object("up",e),N.typeOf.object("right",i),N.typeOf.object("result",o),o[0]=i.x,o[1]=e.x,o[2]=-n.x,o[3]=0,o[4]=i.y,o[5]=e.y,o[6]=-n.y,o[7]=0,o[8]=i.z,o[9]=e.z,o[10]=-n.z,o[11]=0,o[12]=-ae.dot(i,t),o[13]=-ae.dot(e,t),o[14]=ae.dot(n,t),o[15]=1,o},ge.toArray=function(t,n){return N.typeOf.object("matrix",t),ne(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[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]]},ge.getElementIndex=function(t,n){return N.typeOf.number.greaterThanOrEquals("row",n,0),N.typeOf.number.lessThanOrEquals("row",n,3),N.typeOf.number.greaterThanOrEquals("column",t,0),N.typeOf.number.lessThanOrEquals("column",t,3),t*4+n},ge.getColumn=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("result",e);const i=n*4,o=t[i],r=t[i+1],a=t[i+2],s=t[i+3];return e.x=o,e.y=r,e.z=a,e.w=s,e},ge.setColumn=function(t,n,e,i){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=ge.clone(t,i);const o=n*4;return i[o]=e.x,i[o+1]=e.y,i[o+2]=e.z,i[o+3]=e.w,i},ge.getRow=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("result",e);const i=t[n],o=t[n+4],r=t[n+8],a=t[n+12];return e.x=i,e.y=o,e.z=r,e.w=a,e},ge.setRow=function(t,n,e,i){return N.typeOf.object("matrix",t),N.typeOf.number.greaterThanOrEquals("index",n,0),N.typeOf.number.lessThanOrEquals("index",n,3),N.typeOf.object("cartesian",e),N.typeOf.object("result",i),i=ge.clone(t,i),i[n]=e.x,i[n+4]=e.y,i[n+8]=e.z,i[n+12]=e.w,i},ge.setTranslation=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.object("translation",n),N.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]=n.x,e[13]=n.y,e[14]=n.z,e[15]=t[15],e};const s4=new ae;ge.setScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=ge.getScale(t,s4),o=n.x/i.x,r=n.y/i.y,a=n.z/i.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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const a4=new ae;ge.setUniformScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e);const i=ge.getScale(t,a4),o=n/i.x,r=n/i.y,a=n/i.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]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const dd=new ae;ge.getScale=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=ae.magnitude(ae.fromElements(t[0],t[1],t[2],dd)),n.y=ae.magnitude(ae.fromElements(t[4],t[5],t[6],dd)),n.z=ae.magnitude(ae.fromElements(t[8],t[9],t[10],dd)),n};const lb=new ae;ge.getMaximumScale=function(t){return ge.getScale(t,lb),ae.maximumComponent(lb)};const l4=new ae;ge.setRotation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("result",e);const i=ge.getScale(t,l4);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=t[3],e[4]=n[3]*i.y,e[5]=n[4]*i.y,e[6]=n[5]*i.y,e[7]=t[7],e[8]=n[6]*i.z,e[9]=n[7]*i.z,e[10]=n[8]*i.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const u4=new ae;ge.getRotation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=ge.getScale(t,u4);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[4]/e.y,n[4]=t[5]/e.y,n[5]=t[6]/e.y,n[6]=t[8]/e.z,n[7]=t[9]/e.z,n[8]=t[10]/e.z,n},ge.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[3],s=t[4],l=t[5],u=t[6],A=t[7],c=t[8],f=t[9],d=t[10],p=t[11],g=t[12],v=t[13],y=t[14],m=t[15],b=n[0],x=n[1],E=n[2],B=n[3],P=n[4],I=n[5],O=n[6],M=n[7],S=n[8],T=n[9],w=n[10],C=n[11],U=n[12],F=n[13],D=n[14],R=n[15],L=i*b+s*x+c*E+g*B,k=o*b+l*x+f*E+v*B,Q=r*b+u*x+d*E+y*B,V=a*b+A*x+p*E+m*B,G=i*P+s*I+c*O+g*M,$=o*P+l*I+f*O+v*M,Y=r*P+u*I+d*O+y*M,ie=a*P+A*I+p*O+m*M,re=i*S+s*T+c*w+g*C,le=o*S+l*T+f*w+v*C,ue=r*S+u*T+d*w+y*C,te=a*S+A*T+p*w+m*C,ce=i*U+s*F+c*D+g*R,X=o*U+l*F+f*D+v*R,q=r*U+u*F+d*D+y*R,H=a*U+A*F+p*D+m*R;return e[0]=L,e[1]=k,e[2]=Q,e[3]=V,e[4]=G,e[5]=$,e[6]=Y,e[7]=ie,e[8]=re,e[9]=le,e[10]=ue,e[11]=te,e[12]=ce,e[13]=X,e[14]=q,e[15]=H,e},ge.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},ge.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e},ge.multiplyTransformation=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[4],s=t[5],l=t[6],u=t[8],A=t[9],c=t[10],f=t[12],d=t[13],p=t[14],g=n[0],v=n[1],y=n[2],m=n[4],b=n[5],x=n[6],E=n[8],B=n[9],P=n[10],I=n[12],O=n[13],M=n[14],S=i*g+a*v+u*y,T=o*g+s*v+A*y,w=r*g+l*v+c*y,C=i*m+a*b+u*x,U=o*m+s*b+A*x,F=r*m+l*b+c*x,D=i*E+a*B+u*P,R=o*E+s*B+A*P,L=r*E+l*B+c*P,k=i*I+a*O+u*M+f,Q=o*I+s*O+A*M+d,V=r*I+l*O+c*M+p;return e[0]=S,e[1]=T,e[2]=w,e[3]=0,e[4]=C,e[5]=U,e[6]=F,e[7]=0,e[8]=D,e[9]=R,e[10]=L,e[11]=0,e[12]=k,e[13]=Q,e[14]=V,e[15]=1,e},ge.multiplyByMatrix3=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("rotation",n),N.typeOf.object("result",e);const i=t[0],o=t[1],r=t[2],a=t[4],s=t[5],l=t[6],u=t[8],A=t[9],c=t[10],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8],E=i*f+a*d+u*p,B=o*f+s*d+A*p,P=r*f+l*d+c*p,I=i*g+a*v+u*y,O=o*g+s*v+A*y,M=r*g+l*v+c*y,S=i*m+a*b+u*x,T=o*m+s*b+A*x,w=r*m+l*b+c*x;return e[0]=E,e[1]=B,e[2]=P,e[3]=0,e[4]=I,e[5]=O,e[6]=M,e[7]=0,e[8]=S,e[9]=T,e[10]=w,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},ge.multiplyByTranslation=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("translation",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=i*t[0]+o*t[4]+r*t[8]+t[12],s=i*t[1]+o*t[5]+r*t[9]+t[13],l=i*t[2]+o*t[6]+r*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]=a,e[13]=s,e[14]=l,e[15]=t[15],e},ge.multiplyByScale=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("scale",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z;return i===1&&o===1&&r===1?ge.clone(t,e):(e[0]=i*t[0],e[1]=i*t[1],e[2]=i*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]=r*t[8],e[9]=r*t[9],e[10]=r*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},ge.multiplyByUniformScale=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scale",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3],e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},ge.multiplyByVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=n.w,s=t[0]*i+t[4]*o+t[8]*r+t[12]*a,l=t[1]*i+t[5]*o+t[9]*r+t[13]*a,u=t[2]*i+t[6]*o+t[10]*r+t[14]*a,A=t[3]*i+t[7]*o+t[11]*r+t[15]*a;return e.x=s,e.y=l,e.z=u,e.w=A,e},ge.multiplyByPointAsVector=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[4]*o+t[8]*r,s=t[1]*i+t[5]*o+t[9]*r,l=t[2]*i+t[6]*o+t[10]*r;return e.x=a,e.y=s,e.z=l,e},ge.multiplyByPoint=function(t,n,e){N.typeOf.object("matrix",t),N.typeOf.object("cartesian",n),N.typeOf.object("result",e);const i=n.x,o=n.y,r=n.z,a=t[0]*i+t[4]*o+t[8]*r+t[12],s=t[1]*i+t[5]*o+t[9]*r+t[13],l=t[2]*i+t[6]*o+t[10]*r+t[14];return e.x=a,e.y=s,e.z=l,e},ge.multiplyByScalar=function(t,n,e){return N.typeOf.object("matrix",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},ge.negate=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n},ge.transpose=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[1],i=t[2],o=t[3],r=t[6],a=t[7],s=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=i,n[9]=r,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=s,n[15]=t[15],n},ge.abs=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n},ge.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]},ge.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e&&Math.abs(t[9]-n[9])<=e&&Math.abs(t[10]-n[10])<=e&&Math.abs(t[11]-n[11])<=e&&Math.abs(t[12]-n[12])<=e&&Math.abs(t[13]-n[13])<=e&&Math.abs(t[14]-n[14])<=e&&Math.abs(t[15]-n[15])<=e},ge.getTranslation=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n.x=t[12],n.y=t[13],n.z=t[14],n},ge.getMatrix3=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n};const c4=new me,h4=new me,A4=new be,f4=new be(0,0,0,1);ge.inverse=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[4],o=t[8],r=t[12],a=t[1],s=t[5],l=t[9],u=t[13],A=t[2],c=t[6],f=t[10],d=t[14],p=t[3],g=t[7],v=t[11],y=t[15];let m=f*y,b=d*v,x=c*y,E=d*g,B=c*v,P=f*g,I=A*y,O=d*p,M=A*v,S=f*p,T=A*g,w=c*p;const C=m*s+E*l+B*u-(b*s+x*l+P*u),U=b*a+I*l+S*u-(m*a+O*l+M*u),F=x*a+O*s+T*u-(E*a+I*s+w*u),D=P*a+M*s+w*l-(B*a+S*s+T*l),R=b*i+x*o+P*r-(m*i+E*o+B*r),L=m*e+O*o+M*r-(b*e+I*o+S*r),k=E*e+I*i+w*r-(x*e+O*i+T*r),Q=B*e+S*i+T*o-(P*e+M*i+w*o);m=o*u,b=r*l,x=i*u,E=r*s,B=i*l,P=o*s,I=e*u,O=r*a,M=e*l,S=o*a,T=e*s,w=i*a;const V=m*g+E*v+B*y-(b*g+x*v+P*y),G=b*p+I*v+S*y-(m*p+O*v+M*y),$=x*p+O*g+T*y-(E*p+I*g+w*y),Y=P*p+M*g+w*v-(B*p+S*g+T*v),ie=x*f+P*d+b*c-(B*d+m*c+E*f),re=M*d+m*A+O*f-(I*f+S*d+b*A),le=I*c+w*d+E*A-(T*d+x*A+O*c),ue=T*f+B*A+S*c-(M*c+w*f+P*A);let te=e*C+i*U+o*F+r*D;if(Math.abs(te)<he.EPSILON21){if(me.equalsEpsilon(ge.getMatrix3(t,c4),h4,he.EPSILON7)&&be.equals(ge.getRow(t,3,A4),f4))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new Nt("matrix is not invertible because its determinate is zero.")}return te=1/te,n[0]=C*te,n[1]=U*te,n[2]=F*te,n[3]=D*te,n[4]=R*te,n[5]=L*te,n[6]=k*te,n[7]=Q*te,n[8]=V*te,n[9]=G*te,n[10]=$*te,n[11]=Y*te,n[12]=ie*te,n[13]=re*te,n[14]=le*te,n[15]=ue*te,n},ge.inverseTransformation=function(t,n){N.typeOf.object("matrix",t),N.typeOf.object("result",n);const e=t[0],i=t[1],o=t[2],r=t[4],a=t[5],s=t[6],l=t[8],u=t[9],A=t[10],c=t[12],f=t[13],d=t[14],p=-e*c-i*f-o*d,g=-r*c-a*f-s*d,v=-l*c-u*f-A*d;return n[0]=e,n[1]=r,n[2]=l,n[3]=0,n[4]=i,n[5]=a,n[6]=u,n[7]=0,n[8]=o,n[9]=s,n[10]=A,n[11]=0,n[12]=p,n[13]=g,n[14]=v,n[15]=1,n};const p4=new ge;ge.inverseTranspose=function(t,n){return N.typeOf.object("matrix",t),N.typeOf.object("result",n),ge.inverse(ge.transpose(t,p4),n)},ge.IDENTITY=Object.freeze(new ge(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),ge.ZERO=Object.freeze(new ge(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),ge.COLUMN0ROW0=0,ge.COLUMN0ROW1=1,ge.COLUMN0ROW2=2,ge.COLUMN0ROW3=3,ge.COLUMN1ROW0=4,ge.COLUMN1ROW1=5,ge.COLUMN1ROW2=6,ge.COLUMN1ROW3=7,ge.COLUMN2ROW0=8,ge.COLUMN2ROW1=9,ge.COLUMN2ROW2=10,ge.COLUMN2ROW3=11,ge.COLUMN3ROW0=12,ge.COLUMN3ROW1=13,ge.COLUMN3ROW2=14,ge.COLUMN3ROW3=15,Object.defineProperties(ge.prototype,{length:{get:function(){return ge.packedLength}}}),ge.prototype.clone=function(t){return ge.clone(this,t)},ge.prototype.equals=function(t){return ge.equals(this,t)},ge.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]&&t[9]===n[e+9]&&t[10]===n[e+10]&&t[11]===n[e+11]&&t[12]===n[e+12]&&t[13]===n[e+13]&&t[14]===n[e+14]&&t[15]===n[e+15]},ge.prototype.equalsEpsilon=function(t,n){return ge.equalsEpsilon(this,t,n)},ge.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
345
345
  (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
346
346
  (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
347
- (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function dR(){return!0}function mR(t,n){n=n??"This object was destroyed, i.e., destroy() was called.";function e(){throw new pe(n)}for(const i in t)typeof t[i]=="function"&&(t[i]=e);t.isDestroyed=dR}let Rr;const mt={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},mn={};Object.defineProperties(mn,{element:{get:function(){if(mn.supportsFullscreen())return document[mt.fullscreenElement]}},changeEventName:{get:function(){if(mn.supportsFullscreen())return mt.fullscreenchange}},errorEventName:{get:function(){if(mn.supportsFullscreen())return mt.fullscreenerror}},enabled:{get:function(){if(mn.supportsFullscreen())return document[mt.fullscreenEnabled]}},fullscreen:{get:function(){if(mn.supportsFullscreen())return mn.element!==null}}}),mn.supportsFullscreen=function(){if(ne(Rr))return Rr;Rr=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return mt.requestFullscreen="requestFullscreen",mt.exitFullscreen="exitFullscreen",mt.fullscreenEnabled="fullscreenEnabled",mt.fullscreenElement="fullscreenElement",mt.fullscreenchange="fullscreenchange",mt.fullscreenerror="fullscreenerror",Rr=!0,Rr;const n=["webkit","moz","o","ms","khtml"];let e;for(let i=0,o=n.length;i<o;++i){const r=n[i];e=`${r}RequestFullscreen`,typeof t[e]=="function"?(mt.requestFullscreen=e,Rr=!0):(e=`${r}RequestFullScreen`,typeof t[e]=="function"&&(mt.requestFullscreen=e,Rr=!0)),e=`${r}ExitFullscreen`,typeof document[e]=="function"?mt.exitFullscreen=e:(e=`${r}CancelFullScreen`,typeof document[e]=="function"&&(mt.exitFullscreen=e)),e=`${r}FullscreenEnabled`,document[e]!==void 0?mt.fullscreenEnabled=e:(e=`${r}FullScreenEnabled`,document[e]!==void 0&&(mt.fullscreenEnabled=e)),e=`${r}FullscreenElement`,document[e]!==void 0?mt.fullscreenElement=e:(e=`${r}FullScreenElement`,document[e]!==void 0&&(mt.fullscreenElement=e)),e=`${r}fullscreenchange`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenChange"),mt.fullscreenchange=e),e=`${r}fullscreenerror`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenError"),mt.fullscreenerror=e)}return Rr},mn.requestFullscreen=function(t,n){mn.supportsFullscreen()&&t[mt.requestFullscreen]({vrDisplay:n})},mn.exitFullscreen=function(){mn.supportsFullscreen()&&document[mt.exitFullscreen]()},mn._names=mt;let Xt;typeof navigator<"u"?Xt=navigator:Xt={};function Po(t){const n=t.split(".");for(let e=0,i=n.length;e<i;++e)n[e]=parseInt(n[e],10);return n}let aA,ub;function md(){if(!ne(aA)&&(aA=!1,!hA())){const t=/ Chrome\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(aA=!0,ub=Po(t[1]))}return aA}function gR(){return md()&&ub}let lA,cb;function hb(){if(!ne(lA)&&(lA=!1,!md()&&!hA()&&/ Safari\/[\.0-9]+/.test(Xt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(lA=!0,cb=Po(t[1]))}return lA}function yR(){return hb()&&cb}let uA,gd;function Ab(){if(!ne(uA)){uA=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Xt.userAgent);t!==null&&(uA=!0,gd=Po(t[1]),gd.isNightly=!!t[2])}return uA}function vR(){return Ab()&&gd}let pl,yd;function fb(){if(!ne(pl)){pl=!1;let t;Xt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Xt.userAgent),t!==null&&(pl=!0,yd=Po(t[1]))):Xt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Xt.userAgent),t!==null&&(pl=!0,yd=Po(t[1])))}return pl}function wR(){return fb()&&yd}let cA,pb;function hA(){if(!ne(cA)){cA=!1;const t=/ Edg\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(cA=!0,pb=Po(t[1]))}return cA}function bR(){return hA()&&pb}let AA,vd;function fA(){if(!ne(AA)){AA=!1;const t=/Firefox\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(AA=!0,vd=Po(t[1]))}return AA}let wd;function xR(){return ne(wd)||(wd=/Windows/i.test(Xt.appVersion)),wd}let bd;function _R(){return ne(bd)||(bd=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),bd}function CR(){return fA()&&vd}let xd;function SR(){return ne(xd)||(xd=!fA()&&typeof PointerEvent<"u"&&(!ne(Xt.pointerEnabled)||Xt.pointerEnabled)),xd}let db,pA;function mb(){if(!ne(pA)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const n=t.style.imageRendering;pA=ne(n)&&n!=="",pA&&(db=n)}return pA}function ER(){return mb()?db:void 0}function $t(){if(!$t.initialized)throw new pe("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return $t._result}$t._promise=void 0,$t._result=void 0,$t.initialize=function(){return ne($t._promise)||($t._promise=new Promise(t=>{const n=new Image;n.onload=function(){$t._result=n.width>0&&n.height>0,t($t._result)},n.onerror=function(){$t._result=!1,t($t._result)},n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),$t._promise},Object.defineProperties($t,{initialized:{get:function(){return ne($t._result)}}});const Us=[];typeof ArrayBuffer<"u"&&(Us.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Us.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Us.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Us.push(BigInt64Array),typeof BigUint64Array<"u"&&Us.push(BigUint64Array));const Ht={isChrome:md,chromeVersion:gR,isSafari:hb,safariVersion:yR,isWebkit:Ab,webkitVersion:vR,isInternetExplorer:fb,internetExplorerVersion:wR,isEdge:hA,edgeVersion:bR,isFirefox:fA,firefoxVersion:CR,isWindows:xR,isIPadOrIOS:_R,hardwareConcurrency:Xt.hardwareConcurrency??3,supportsPointerEvents:SR,supportsImageRenderingPixelated:mb,supportsWebP:$t,imageRenderingValue:ER,typedArrayTypes:Us};Ht.supportsBasis=function(t){return Ht.supportsWebAssembly()&&t.context.supportsBasis},Ht.supportsFullscreen=function(){return mn.supportsFullscreen()},Ht.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},Ht.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},Ht.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},Ht.supportsBigInt=function(){return typeof BigInt<"u"},Ht.supportsWebWorkers=function(){return typeof Worker<"u"},Ht.supportsWebAssembly=function(){return typeof WebAssembly<"u"},Ht.supportsWebgl2=function(t){return N.defined("scene",t),t.context.webgl2},Ht.supportsEsmWebWorkers=function(){return!fA()||parseInt(vd)>=114};function _e(t,n){this.x=t??0,this.y=n??0}_e.fromElements=function(t,n,e){return ne(e)?(e.x=t,e.y=n,e):new _e(t,n)},_e.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n):new _e(t.x,t.y)},_e.fromCartesian3=_e.clone,_e.fromCartesian4=_e.clone,_e.packedLength=2,_e.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e]=t.y,n},_e.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new _e),e.x=t[n++],e.y=t[n],e},_e.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*2;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 2 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)_e.pack(t[o],n,o*2);return n},_e.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new pe("array length must be a multiple of 2.");const e=t.length;ne(n)?n.length=e/2:n=new Array(e/2);for(let i=0;i<e;i+=2){const o=i/2;n[o]=_e.unpack(t,i,n[o])}return n},_e.fromArray=_e.unpack,_e.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y)},_e.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y)},_e.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e},_e.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e},_e.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y);return i.x=o,i.y=r,i},_e.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},_e.magnitude=function(t){return Math.sqrt(_e.magnitudeSquared(t))};const dA=new _e;_e.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.subtract(t,n,dA),_e.magnitude(dA)},_e.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.subtract(t,n,dA),_e.magnitudeSquared(dA)},_e.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=_e.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,isNaN(n.x)||isNaN(n.y))throw new pe("normalized result is not a number");return n},_e.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y},_e.cross=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.y-t.y*n.x},_e.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e},_e.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e},_e.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e},_e.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e},_e.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e},_e.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e},_e.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n},_e.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n};const gb=new _e;_e.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),_e.multiplyByScalar(n,e,gb),i=_e.multiplyByScalar(t,1-e,i),_e.add(gb,i,i)};const yb=new _e,vb=new _e;_e.angleBetween=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.normalize(t,yb),_e.normalize(n,vb),he.acosClamped(_e.dot(yb,vb))};const PR=new _e;_e.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=_e.normalize(t,PR);return _e.abs(e,e),e.x<=e.y?n=_e.clone(_e.UNIT_X,n):n=_e.clone(_e.UNIT_Y,n),n},_e.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y},_e.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]},_e.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)},_e.ZERO=Object.freeze(new _e(0,0)),_e.ONE=Object.freeze(new _e(1,1)),_e.UNIT_X=Object.freeze(new _e(1,0)),_e.UNIT_Y=Object.freeze(new _e(0,1)),_e.prototype.clone=function(t){return _e.clone(this,t)},_e.prototype.equals=function(t){return _e.equals(this,t)},_e.prototype.equalsEpsilon=function(t,n,e){return _e.equalsEpsilon(this,t,n,e)},_e.prototype.toString=function(){return`(${this.x}, ${this.y})`};const BR=new ae,TR=new ae;function wb(t,n,e,i,o){if(!ne(t))throw new pe("cartesian is required.");if(!ne(n))throw new pe("oneOverRadii is required.");if(!ne(e))throw new pe("oneOverRadiiSquared is required.");if(!ne(i))throw new pe("centerToleranceSquared is required.");const r=t.x,a=t.y,s=t.z,l=n.x,u=n.y,A=n.z,c=r*r*l*l,f=a*a*u*u,d=s*s*A*A,p=c+f+d,g=Math.sqrt(1/p),v=ae.multiplyByScalar(t,g,BR);if(p<i)return isFinite(g)?ae.clone(v,o):void 0;const y=e.x,m=e.y,b=e.z,x=TR;x.x=v.x*y*2,x.y=v.y*m*2,x.z=v.z*b*2;let E=(1-g)*ae.magnitude(t)/(.5*ae.magnitude(x)),B=0,P,I,O,M,S,T,w,C,U,F,D;do{E-=B,O=1/(1+E*y),M=1/(1+E*m),S=1/(1+E*b),T=O*O,w=M*M,C=S*S,U=T*O,F=w*M,D=C*S,P=c*T+f*w+d*C-1,I=c*U*y+f*F*m+d*D*b;const R=-2*I;B=P/R}while(Math.abs(P)>he.EPSILON12);return ne(o)?(o.x=r*O,o.y=a*M,o.z=s*S,o):new ae(r*O,a*M,s*S)}function Qe(t,n,e){this.longitude=t??0,this.latitude=n??0,this.height=e??0}Qe.fromRadians=function(t,n,e,i){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),e=e??0,ne(i)?(i.longitude=t,i.latitude=n,i.height=e,i):new Qe(t,n,e)},Qe.fromDegrees=function(t,n,e,i){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),t=he.toRadians(t),n=he.toRadians(n),Qe.fromRadians(t,n,e,i)};const IR=new ae,FR=new ae,MR=new ae;Qe._ellipsoidOneOverRadii=new ae(1567855942887398e-22,1567855942887398e-22,1573130351105623e-22),Qe._ellipsoidOneOverRadiiSquared=new ae(2458172257647332e-29,2458172257647332e-29,24747391015697002e-30),Qe._ellipsoidCenterToleranceSquared=he.EPSILON1,Qe.fromCartesian=function(t,n,e){const i=ne(n)?n.oneOverRadii:Qe._ellipsoidOneOverRadii,o=ne(n)?n.oneOverRadiiSquared:Qe._ellipsoidOneOverRadiiSquared,r=ne(n)?n._centerToleranceSquared:Qe._ellipsoidCenterToleranceSquared,a=wb(t,i,o,r,FR);if(!ne(a))return;let s=ae.multiplyComponents(a,o,IR);s=ae.normalize(s,s);const l=ae.subtract(t,a,MR),u=Math.atan2(s.y,s.x),A=Math.asin(s.z),c=he.sign(ae.dot(l,t))*ae.magnitude(l);return ne(e)?(e.longitude=u,e.latitude=A,e.height=c,e):new Qe(u,A,c)},Qe.toCartesian=function(t,n,e){return N.defined("cartographic",t),ae.fromRadians(t.longitude,t.latitude,t.height,n,e)},Qe.clone=function(t,n){if(ne(t))return ne(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Qe(t.longitude,t.latitude,t.height)},Qe.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},Qe.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.longitude-n.longitude)<=e&&Math.abs(t.latitude-n.latitude)<=e&&Math.abs(t.height-n.height)<=e},Qe.ZERO=Object.freeze(new Qe(0,0,0)),Qe.prototype.clone=function(t){return Qe.clone(this,t)},Qe.prototype.equals=function(t){return Qe.equals(this,t)},Qe.prototype.equalsEpsilon=function(t,n){return Qe.equalsEpsilon(this,t,n)},Qe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function bb(t,n,e,i){n=n??0,e=e??0,i=i??0,N.typeOf.number.greaterThanOrEquals("x",n,0),N.typeOf.number.greaterThanOrEquals("y",e,0),N.typeOf.number.greaterThanOrEquals("z",i,0),t._radii=new ae(n,e,i),t._radiiSquared=new ae(n*n,e*e,i*i),t._radiiToTheFourth=new ae(n*n*n*n,e*e*e*e,i*i*i*i),t._oneOverRadii=new ae(n===0?0:1/n,e===0?0:1/e,i===0?0:1/i),t._oneOverRadiiSquared=new ae(n===0?0:1/(n*n),e===0?0:1/(e*e),i===0?0:1/(i*i)),t._minimumRadius=Math.min(n,e,i),t._maximumRadius=Math.max(n,e,i),t._centerToleranceSquared=he.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function De(t,n,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,bb(this,t,n,e)}Object.defineProperties(De.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}}}),De.clone=function(t,n){if(!ne(t))return;const e=t._radii;return ne(n)?(ae.clone(e,n._radii),ae.clone(t._radiiSquared,n._radiiSquared),ae.clone(t._radiiToTheFourth,n._radiiToTheFourth),ae.clone(t._oneOverRadii,n._oneOverRadii),ae.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new De(e.x,e.y,e.z)},De.fromCartesian3=function(t,n){return ne(n)||(n=new De),ne(t)&&bb(n,t.x,t.y,t.z),n},De.WGS84=Object.freeze(new De(6378137,6378137,6356752314245179e-9)),De.UNIT_SPHERE=Object.freeze(new De(1,1,1)),De.MOON=Object.freeze(new De(he.LUNAR_RADIUS,he.LUNAR_RADIUS,he.LUNAR_RADIUS)),De.MARS=Object.freeze(new De(3396190,3396190,3376200)),De._default=De.WGS84,Object.defineProperties(De,{default:{get:function(){return De._default},set:function(t){N.typeOf.object("value",t),De._default=t,ae._ellipsoidRadiiSquared=t.radiiSquared,Qe._ellipsoidOneOverRadii=t.oneOverRadii,Qe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,Qe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),De.prototype.clone=function(t){return De.clone(this,t)},De.packedLength=ae.packedLength,De.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,ae.pack(t._radii,n,e),n},De.unpack=function(t,n,e){N.defined("array",t),n=n??0;const i=ae.unpack(t,n);return De.fromCartesian3(i,e)},De.prototype.geocentricSurfaceNormal=ae.normalize,De.prototype.geodeticSurfaceNormalCartographic=function(t,n){N.typeOf.object("cartographic",t);const e=t.longitude,i=t.latitude,o=Math.cos(i),r=o*Math.cos(e),a=o*Math.sin(e),s=Math.sin(i);return ne(n)||(n=new ae),n.x=r,n.y=a,n.z=s,ae.normalize(n,n)},De.prototype.geodeticSurfaceNormal=function(t,n){if(N.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new pe("cartesian has a NaN component");if(!ae.equalsEpsilon(t,ae.ZERO,he.EPSILON14))return ne(n)||(n=new ae),n=ae.multiplyComponents(t,this._oneOverRadiiSquared,n),ae.normalize(n,n)};const DR=new ae,RR=new ae;De.prototype.cartographicToCartesian=function(t,n){const e=DR,i=RR;this.geodeticSurfaceNormalCartographic(t,e),ae.multiplyComponents(this._radiiSquared,e,i);const o=Math.sqrt(ae.dot(e,i));return ae.divideByScalar(i,o,i),ae.multiplyByScalar(e,t.height,e),ne(n)||(n=new ae),ae.add(i,e,n)},De.prototype.cartographicArrayToCartesianArray=function(t,n){N.defined("cartographics",t);const e=t.length;ne(n)?n.length=e:n=new Array(e);for(let i=0;i<e;i++)n[i]=this.cartographicToCartesian(t[i],n[i]);return n};const UR=new ae,OR=new ae,LR=new ae;De.prototype.cartesianToCartographic=function(t,n){const e=this.scaleToGeodeticSurface(t,OR);if(!ne(e))return;const i=this.geodeticSurfaceNormal(e,UR),o=ae.subtract(t,e,LR),r=Math.atan2(i.y,i.x),a=Math.asin(i.z),s=he.sign(ae.dot(o,t))*ae.magnitude(o);return ne(n)?(n.longitude=r,n.latitude=a,n.height=s,n):new Qe(r,a,s)},De.prototype.cartesianArrayToCartographicArray=function(t,n){N.defined("cartesians",t);const e=t.length;ne(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.cartesianToCartographic(t[i],n[i]);return n},De.prototype.scaleToGeodeticSurface=function(t,n){return wb(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)},De.prototype.scaleToGeocentricSurface=function(t,n){N.typeOf.object("cartesian",t),ne(n)||(n=new ae);const e=t.x,i=t.y,o=t.z,r=this._oneOverRadiiSquared,a=1/Math.sqrt(e*e*r.x+i*i*r.y+o*o*r.z);return ae.multiplyByScalar(t,a,n)},De.prototype.transformPositionToScaledSpace=function(t,n){return ne(n)||(n=new ae),ae.multiplyComponents(t,this._oneOverRadii,n)},De.prototype.transformPositionFromScaledSpace=function(t,n){return ne(n)||(n=new ae),ae.multiplyComponents(t,this._radii,n)},De.prototype.equals=function(t){return this===t||ne(t)&&ae.equals(this._radii,t._radii)},De.prototype.toString=function(){return this._radii.toString()},De.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,e){if(N.typeOf.object("position",t),!he.equalsEpsilon(this._radii.x,this._radii.y,he.EPSILON15))throw new pe("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");N.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),n=n??0;const i=this._squaredXOverSquaredZ;if(ne(e)||(e=new ae),e.x=0,e.y=0,e.z=t.z*(1-i),!(Math.abs(e.z)>=this._radii.z-n))return e};const zR=new ae;De.prototype.getLocalCurvature=function(t,n){N.typeOf.object("surfacePosition",t),ne(n)||(n=new _e);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,zR),i=ae.distance(t,e),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return _e.fromElements(1/i,1/r,n)};const kR=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],QR=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xb(t,n,e){N.typeOf.number("a",t),N.typeOf.number("b",n),N.typeOf.func("func",e);const i=.5*(n+t),o=.5*(n-t);let r=0;for(let a=0;a<5;a++){const s=o*kR[a];r+=QR[a]*(e(i+s)+e(i-s))}return r*=o,r}De.prototype.surfaceArea=function(t){N.typeOf.object("rectangle",t);const n=t.west;let e=t.east;const i=t.south,o=t.north;for(;e<n;)e+=he.TWO_PI;const r=this._radiiSquared,a=r.x,s=r.y,l=r.z,u=a*s;return xb(i,o,function(A){const c=Math.cos(A),f=Math.sin(A);return Math.cos(A)*xb(n,e,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.sqrt(u*f*f+l*(s*p*p+a*g*g)*c*c)})})};function dl(t,n,e){N.defined("array",t),N.defined("itemToFind",n),N.defined("comparator",e);let i=0,o=t.length-1,r,a;for(;i<=o;){if(r=~~((i+o)/2),a=e(t[r],n),a<0){i=r+1;continue}if(a>0){o=r-1;continue}return r}return~(o+1)}function _d(t,n,e,i,o){this.xPoleWander=t,this.yPoleWander=n,this.xPoleOffset=e,this.yPoleOffset=i,this.ut1MinusUtc=o}function Cd(t){if(t===null||isNaN(t))throw new pe("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const _b=[31,28,31,30,31,30,31,31,30,31,30,31];function Sd(t,n,e,i,o,r,a,s){t=t??1,n=n??1,e=e??1,i=i??0,o=o??0,r=r??0,a=a??0,s=s??!1,g(),v(),this.year=t,this.month=n,this.day=e,this.hour=i,this.minute=o,this.second=r,this.millisecond=a,this.isLeapSecond=s;function g(){N.typeOf.number.greaterThanOrEquals("Year",t,1),N.typeOf.number.lessThanOrEquals("Year",t,9999),N.typeOf.number.greaterThanOrEquals("Month",n,1),N.typeOf.number.lessThanOrEquals("Month",n,12),N.typeOf.number.greaterThanOrEquals("Day",e,1),N.typeOf.number.lessThanOrEquals("Day",e,31),N.typeOf.number.greaterThanOrEquals("Hour",i,0),N.typeOf.number.lessThanOrEquals("Hour",i,23),N.typeOf.number.greaterThanOrEquals("Minute",o,0),N.typeOf.number.lessThanOrEquals("Minute",o,59),N.typeOf.bool("IsLeapSecond",s),N.typeOf.number.greaterThanOrEquals("Second",r,0),N.typeOf.number.lessThanOrEquals("Second",r,s?60:59),N.typeOf.number.greaterThanOrEquals("Millisecond",a,0),N.typeOf.number.lessThan("Millisecond",a,1e3)}function v(){const y=n===2&&Cd(t)?_b[n-1]+1:_b[n-1];if(e>y)throw new pe("Month and Day represents invalid date")}}function Ye(t,n){this.julianDate=t,this.offset=n}const pt=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}),Ve=Object.freeze({UTC:0,TAI:1}),Cb=new Sd,mA=[31,28,31,30,31,30,31,31,30,31,30,31],gA=29;function Ed(t,n){return we.compare(t.julianDate,n.julianDate)}const Os=new Ye;function yA(t){Os.julianDate=t;const n=we.leapSeconds;let e=dl(n,Os,Ed);e<0&&(e=~e),e>=n.length&&(e=n.length-1);let i=n[e].offset;e>0&&we.secondsDifference(n[e].julianDate,t)>i&&(e--,i=n[e].offset),we.addSeconds(t,i,t)}function Sb(t,n){Os.julianDate=t;const e=we.leapSeconds;let i=dl(e,Os,Ed);if(i<0&&(i=~i),i===0)return we.addSeconds(t,-e[0].offset,n);if(i>=e.length)return we.addSeconds(t,-e[i-1].offset,n);const o=we.secondsDifference(e[i].julianDate,t);if(o===0)return we.addSeconds(t,-e[i].offset,n);if(!(o<=1))return we.addSeconds(t,-e[--i].offset,n)}function Ur(t,n,e){const i=n/pt.SECONDS_PER_DAY|0;return t+=i,n-=pt.SECONDS_PER_DAY*i,n<0&&(t--,n+=pt.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=n,e}function Pd(t,n,e,i,o,r,a){const s=(n-14)/12|0,l=t+4800+s;let u=(1461*l/4|0)+(367*(n-2-12*s)/12|0)-(3*((l+100)/100|0)/4|0)+e-32075;i=i-12,i<0&&(i+=24);const A=r+(i*pt.SECONDS_PER_HOUR+o*pt.SECONDS_PER_MINUTE+a*pt.SECONDS_PER_MILLISECOND);return A>=43200&&(u-=1),[u,A]}const VR=/^(\d{4})$/,NR=/^(\d{4})-(\d{2})$/,HR=/^(\d{4})-?(\d{3})$/,GR=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,WR=/^(\d{4})-?(\d{2})-?(\d{2})$/,Bd=/([Z+\-])?(\d{2})?:?(\d{2})?$/,jR=/^(\d{2})(\.\d+)?/.source+Bd.source,qR=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Bd.source,KR=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Bd.source,ni="Invalid ISO 8601 date.";function we(t,n,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,e=e??Ve.UTC;const i=t|0;n=n+(t-i)*pt.SECONDS_PER_DAY,Ur(i,n,this),e===Ve.UTC&&yA(this)}we.fromGregorianDate=function(t,n){if(!(t instanceof Sd))throw new pe("date must be a valid GregorianDate.");const e=Pd(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return ne(n)?(Ur(e[0],e[1],n),yA(n),n):new we(e[0],e[1],Ve.UTC)},we.fromDate=function(t,n){if(!(t instanceof Date)||isNaN(t.getTime()))throw new pe("date must be a valid JavaScript Date.");const e=Pd(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return ne(n)?(Ur(e[0],e[1],n),yA(n),n):new we(e[0],e[1],Ve.UTC)},we.fromIso8601=function(t,n){if(typeof t!="string")throw new pe(ni);t=t.replace(",",".");let e=t.split("T"),i,o=1,r=1,a=0,s=0,l=0,u=0;const A=e[0],c=e[1];let f,d;if(!ne(A))throw new pe(ni);let p;if(e=A.match(WR),e!==null){if(p=A.split("-").length-1,p>0&&p!==2)throw new pe(ni);i=+e[1],o=+e[2],r=+e[3]}else if(e=A.match(NR),e!==null)i=+e[1],o=+e[2];else if(e=A.match(VR),e!==null)i=+e[1];else{let m;if(e=A.match(HR),e!==null){if(i=+e[1],m=+e[2],d=Cd(i),m<1||d&&m>366||!d&&m>365)throw new pe(ni)}else if(e=A.match(GR),e!==null){i=+e[1];const b=+e[2],x=+e[3]||0;if(p=A.split("-").length-1,p>0&&(!ne(e[3])&&p!==1||ne(e[3])&&p!==2))throw new pe(ni);const E=new Date(Date.UTC(i,0,4));m=b*7+x-E.getUTCDay()-3}else throw new pe(ni);f=new Date(Date.UTC(i,0,1)),f.setUTCDate(m),o=f.getUTCMonth()+1,r=f.getUTCDate()}if(d=Cd(i),o<1||o>12||r<1||(o!==2||!d)&&r>mA[o-1]||d&&o===2&&r>gA)throw new pe(ni);let g;if(ne(c)){if(e=c.match(KR),e!==null){if(p=c.split(":").length-1,p>0&&p!==2&&p!==3)throw new pe(ni);a=+e[1],s=+e[2],l=+e[3],u=+(e[4]||0)*1e3,g=5}else if(e=c.match(qR),e!==null){if(p=c.split(":").length-1,p>2)throw new pe(ni);a=+e[1],s=+e[2],l=+(e[3]||0)*60,g=4}else if(e=c.match(jR),e!==null)a=+e[1],s=+(e[2]||0)*60,g=3;else throw new pe(ni);if(s>=60||l>=61||a>24||a===24&&(s>0||l>0||u>0))throw new pe(ni);const m=e[g],b=+e[g+1],x=+(e[g+2]||0);switch(m){case"+":a=a-b,s=s-x;break;case"-":a=a+b,s=s+x;break;case"Z":break;default:s=s+new Date(Date.UTC(i,o-1,r,a,s)).getTimezoneOffset();break}}const v=l===60;for(v&&l--;s>=60;)s-=60,a++;for(;a>=24;)a-=24,r++;for(f=d&&o===2?gA:mA[o-1];r>f;)r-=f,o++,o>12&&(o-=12,i++),f=d&&o===2?gA:mA[o-1];for(;s<0;)s+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),f=d&&o===2?gA:mA[o-1],r+=f;const y=Pd(i,o,r,a,s,l,u);return ne(n)?(Ur(y[0],y[1],n),yA(n)):n=new we(y[0],y[1],Ve.UTC),v&&we.addSeconds(n,1,n),n},we.now=function(t){return we.fromDate(new Date,t)};const vA=new we(0,0,Ve.TAI);we.toGregorianDate=function(t,n){if(!ne(t))throw new pe("julianDate is required.");let e=!1,i=Sb(t,vA);ne(i)||(we.addSeconds(t,-1,vA),i=Sb(vA,vA),e=!0);let o=i.dayNumber;const r=i.secondsOfDay;r>=43200&&(o+=1);let a=o+68569|0;const s=4*a/146097|0;a=a-((146097*s+3)/4|0)|0;const l=4e3*(a+1)/1461001|0;a=a-(1461*l/4|0)+31|0;const u=80*a/2447|0,A=a-(2447*u/80|0)|0;a=u/11|0;const c=u+2-12*a|0,f=100*(s-49)+l+a|0;let d=r/pt.SECONDS_PER_HOUR|0,p=r-d*pt.SECONDS_PER_HOUR;const g=p/pt.SECONDS_PER_MINUTE|0;p=p-g*pt.SECONDS_PER_MINUTE;let v=p|0;const y=(p-v)/pt.SECONDS_PER_MILLISECOND;return d+=12,d>23&&(d-=24),e&&(v+=1),ne(n)?(n.year=f,n.month=c,n.day=A,n.hour=d,n.minute=g,n.second=v,n.millisecond=y,n.isLeapSecond=e,n):new Sd(f,c,A,d,g,v,y,e)},we.toDate=function(t){if(!ne(t))throw new pe("julianDate is required.");const n=we.toGregorianDate(t,Cb);let e=n.second;return n.isLeapSecond&&(e-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,e,n.millisecond))},we.toIso8601=function(t,n){if(!ne(t))throw new pe("julianDate is required.");const e=we.toGregorianDate(t,Cb);let i=e.year,o=e.month,r=e.day,a=e.hour;const s=e.minute,l=e.second,u=e.millisecond;i===1e4&&o===1&&r===1&&a===0&&s===0&&l===0&&u===0&&(i=9999,o=12,r=31,a=24);let A;if(!ne(n)&&u!==0){const c=u*.01;return A=c<1e-6?c.toFixed(20).replace(".","").replace(/0+$/,""):c.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${A}Z`}return!ne(n)||n===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(A=(u*.01).toFixed(n).replace(".","").slice(0,n),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${A}Z`)},we.clone=function(t,n){if(ne(t))return ne(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new we(t.dayNumber,t.secondsOfDay,Ve.TAI)},we.compare=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");const e=t.dayNumber-n.dayNumber;return e!==0?e:t.secondsOfDay-n.secondsOfDay},we.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay},we.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(we.secondsDifference(t,n))<=e},we.totalDays=function(t){if(!ne(t))throw new pe("julianDate is required.");return t.dayNumber+t.secondsOfDay/pt.SECONDS_PER_DAY},we.secondsDifference=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");return(t.dayNumber-n.dayNumber)*pt.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)},we.daysDifference=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");const e=t.dayNumber-n.dayNumber,i=(t.secondsOfDay-n.secondsOfDay)/pt.SECONDS_PER_DAY;return e+i},we.computeTaiMinusUtc=function(t){Os.julianDate=t;const n=we.leapSeconds;let e=dl(n,Os,Ed);return e<0&&(e=~e,--e,e<0&&(e=0)),n[e].offset},we.addSeconds=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("seconds is required.");if(!ne(e))throw new pe("result is required.");return Ur(t.dayNumber,t.secondsOfDay+n,e)},we.addMinutes=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("minutes is required.");if(!ne(e))throw new pe("result is required.");const i=t.secondsOfDay+n*pt.SECONDS_PER_MINUTE;return Ur(t.dayNumber,i,e)},we.addHours=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("hours is required.");if(!ne(e))throw new pe("result is required.");const i=t.secondsOfDay+n*pt.SECONDS_PER_HOUR;return Ur(t.dayNumber,i,e)},we.addDays=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("days is required.");if(!ne(e))throw new pe("result is required.");const i=t.dayNumber+n;return Ur(i,t.secondsOfDay,e)},we.lessThan=function(t,n){return we.compare(t,n)<0},we.lessThanOrEquals=function(t,n){return we.compare(t,n)<=0},we.greaterThan=function(t,n){return we.compare(t,n)>0},we.greaterThanOrEquals=function(t,n){return we.compare(t,n)>=0},we.prototype.clone=function(t){return we.clone(this,t)},we.prototype.equals=function(t){return we.equals(this,t)},we.prototype.equalsEpsilon=function(t,n){return we.equalsEpsilon(this,t,n)},we.prototype.toString=function(){return we.toIso8601(this)},we.leapSeconds=[new Ye(new we(2441317,43210,Ve.TAI),10),new Ye(new we(2441499,43211,Ve.TAI),11),new Ye(new we(2441683,43212,Ve.TAI),12),new Ye(new we(2442048,43213,Ve.TAI),13),new Ye(new we(2442413,43214,Ve.TAI),14),new Ye(new we(2442778,43215,Ve.TAI),15),new Ye(new we(2443144,43216,Ve.TAI),16),new Ye(new we(2443509,43217,Ve.TAI),17),new Ye(new we(2443874,43218,Ve.TAI),18),new Ye(new we(2444239,43219,Ve.TAI),19),new Ye(new we(2444786,43220,Ve.TAI),20),new Ye(new we(2445151,43221,Ve.TAI),21),new Ye(new we(2445516,43222,Ve.TAI),22),new Ye(new we(2446247,43223,Ve.TAI),23),new Ye(new we(2447161,43224,Ve.TAI),24),new Ye(new we(2447892,43225,Ve.TAI),25),new Ye(new we(2448257,43226,Ve.TAI),26),new Ye(new we(2448804,43227,Ve.TAI),27),new Ye(new we(2449169,43228,Ve.TAI),28),new Ye(new we(2449534,43229,Ve.TAI),29),new Ye(new we(2450083,43230,Ve.TAI),30),new Ye(new we(2450630,43231,Ve.TAI),31),new Ye(new we(2451179,43232,Ve.TAI),32),new Ye(new we(2453736,43233,Ve.TAI),33),new Ye(new we(2454832,43234,Ve.TAI),34),new Ye(new we(2456109,43235,Ve.TAI),35),new Ye(new we(2457204,43236,Ve.TAI),36),new Ye(new we(2457754,43237,Ve.TAI),37)];var wA={exports:{}},ml={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var ZR=ml.exports,Eb;function XR(){return Eb||(Eb=1,(function(t,n){(function(e){var i=n&&!n.nodeType&&n,o=t&&!t.nodeType&&t,r=typeof J1=="object"&&J1;(r.global===r||r.window===r||r.self===r)&&(e=r);var a,s=2147483647,l=36,u=1,A=26,c=38,f=700,d=72,p=128,g="-",v=/^xn--/,y=/[^\x20-\x7E]/,m=/[\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=l-u,E=Math.floor,B=String.fromCharCode,P;function I(k){throw new RangeError(b[k])}function O(k,Q){for(var V=k.length,G=[];V--;)G[V]=Q(k[V]);return G}function M(k,Q){var V=k.split("@"),G="";V.length>1&&(G=V[0]+"@",k=V[1]),k=k.replace(m,".");var $=k.split("."),Y=O($,Q).join(".");return G+Y}function S(k){for(var Q=[],V=0,G=k.length,$,Y;V<G;)$=k.charCodeAt(V++),$>=55296&&$<=56319&&V<G?(Y=k.charCodeAt(V++),(Y&64512)==56320?Q.push((("use strict";1023)<<10)+(Y&1023)+65536):(Q.push($),V--)):Q.push($);return Q}function T(k){return O(k,function(Q){var V="";return Q>65535&&(Q-=65536,V+=B(Q>>>10&1023|55296),Q=56320|Q&1023),V+=B(Q),V}).join("")}function w(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function C(k,Q){return k+22+75*(k<26)-((Q!=0)<<5)}function U(k,Q,V){var G=0;for(k=V?E(k/f):k>>1,k+=E(k/Q);k>x*A>>1;G+=l)k=E(k/x);return E(G+(x+1)*k/(k+c))}function F(k){var Q=[],V=k.length,G,$=0,Y=p,ie=d,re,le,ue,te,ce,X,q,H,Z;for(re=k.lastIndexOf(g),re<0&&(re=0),le=0;le<re;++le)k.charCodeAt(le)>=128&&I("not-basic"),Q.push(k.charCodeAt(le));for(ue=re>0?re+1:0;ue<V;){for(te=$,ce=1,X=l;ue>=V&&I("invalid-input"),q=w(k.charCodeAt(ue++)),(q>=l||q>E((s-$)/ce))&&I("overflow"),$+=q*ce,H=X<=ie?u:X>=ie+A?A:X-ie,!(q<H);X+=l)Z=l-H,ce>E(s/Z)&&I("overflow"),ce*=Z;G=Q.length+1,ie=U($-te,G,te==0),E($/G)>s-Y&&I("overflow"),Y+=E($/G),$%=G,Q.splice($++,0,Y)}return T(Q)}function D(k){var Q,V,G,$,Y,ie,re,le,ue,te,ce,X=[],q,H,Z,K;for(k=S(k),q=k.length,Q=p,V=0,Y=d,ie=0;ie<q;++ie)ce=k[ie],ce<128&&X.push(B(ce));for(G=$=X.length,"use strict";&X.push(g);G<q;){for(re=s,ie=0;ie<q;++ie)ce=k[ie],ce>=Q&&ce<re&&(re=ce);for(H=G+1,re-Q>E((s-V)/H)&&I("overflow"),V+=(re-Q)*H,Q=re,ie=0;ie<q;++ie)if(ce=k[ie],ce<Q&&++V>s&&I("overflow"),ce==Q){for(le=V,ue=l;te=ue<=Y?u:ue>=Y+A?A:ue-Y,!(le<te);ue+=l)K=le-te,Z=l-te,X.push(B(C(te+K%Z,0))),le=E(K/Z);X.push(B(C(le,0))),Y=U(V,H,G==$),V=0,++G}++V,++Q}return X.join("")}function R(k){return M(k,function(Q){return v.test(Q)?F(Q.slice(4).toLowerCase()):Q})}function L(k){return M(k,function(Q){return y.test(Q)?"xn--"+D(Q):Q})}if(a={version:"1.3.2",ucs2:{decode:S,encode:T},decode:F,encode:D,toASCII:L,toUnicode:R},i&&o)if(t.exports==i)o.exports=a;else for(P in a)a.hasOwnProperty(P)&&(i[P]=a[P]);else e.punycode=a})(ZR)})(ml,ml.exports)),ml.exports}var bA={exports:{}};/*!
347
+ (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function d4(){return!0}function m4(t,n){n=n??"This object was destroyed, i.e., destroy() was called.";function e(){throw new pe(n)}for(const i in t)typeof t[i]=="function"&&(t[i]=e);t.isDestroyed=d4}let Rr;const mt={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},mn={};Object.defineProperties(mn,{element:{get:function(){if(mn.supportsFullscreen())return document[mt.fullscreenElement]}},changeEventName:{get:function(){if(mn.supportsFullscreen())return mt.fullscreenchange}},errorEventName:{get:function(){if(mn.supportsFullscreen())return mt.fullscreenerror}},enabled:{get:function(){if(mn.supportsFullscreen())return document[mt.fullscreenEnabled]}},fullscreen:{get:function(){if(mn.supportsFullscreen())return mn.element!==null}}}),mn.supportsFullscreen=function(){if(ne(Rr))return Rr;Rr=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return mt.requestFullscreen="requestFullscreen",mt.exitFullscreen="exitFullscreen",mt.fullscreenEnabled="fullscreenEnabled",mt.fullscreenElement="fullscreenElement",mt.fullscreenchange="fullscreenchange",mt.fullscreenerror="fullscreenerror",Rr=!0,Rr;const n=["webkit","moz","o","ms","khtml"];let e;for(let i=0,o=n.length;i<o;++i){const r=n[i];e=`${r}RequestFullscreen`,typeof t[e]=="function"?(mt.requestFullscreen=e,Rr=!0):(e=`${r}RequestFullScreen`,typeof t[e]=="function"&&(mt.requestFullscreen=e,Rr=!0)),e=`${r}ExitFullscreen`,typeof document[e]=="function"?mt.exitFullscreen=e:(e=`${r}CancelFullScreen`,typeof document[e]=="function"&&(mt.exitFullscreen=e)),e=`${r}FullscreenEnabled`,document[e]!==void 0?mt.fullscreenEnabled=e:(e=`${r}FullScreenEnabled`,document[e]!==void 0&&(mt.fullscreenEnabled=e)),e=`${r}FullscreenElement`,document[e]!==void 0?mt.fullscreenElement=e:(e=`${r}FullScreenElement`,document[e]!==void 0&&(mt.fullscreenElement=e)),e=`${r}fullscreenchange`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenChange"),mt.fullscreenchange=e),e=`${r}fullscreenerror`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenError"),mt.fullscreenerror=e)}return Rr},mn.requestFullscreen=function(t,n){mn.supportsFullscreen()&&t[mt.requestFullscreen]({vrDisplay:n})},mn.exitFullscreen=function(){mn.supportsFullscreen()&&document[mt.exitFullscreen]()},mn._names=mt;let Xt;typeof navigator<"u"?Xt=navigator:Xt={};function Po(t){const n=t.split(".");for(let e=0,i=n.length;e<i;++e)n[e]=parseInt(n[e],10);return n}let aA,ub;function md(){if(!ne(aA)&&(aA=!1,!hA())){const t=/ Chrome\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(aA=!0,ub=Po(t[1]))}return aA}function g4(){return md()&&ub}let lA,cb;function hb(){if(!ne(lA)&&(lA=!1,!md()&&!hA()&&/ Safari\/[\.0-9]+/.test(Xt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(lA=!0,cb=Po(t[1]))}return lA}function y4(){return hb()&&cb}let uA,gd;function Ab(){if(!ne(uA)){uA=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Xt.userAgent);t!==null&&(uA=!0,gd=Po(t[1]),gd.isNightly=!!t[2])}return uA}function v4(){return Ab()&&gd}let pl,yd;function fb(){if(!ne(pl)){pl=!1;let t;Xt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Xt.userAgent),t!==null&&(pl=!0,yd=Po(t[1]))):Xt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Xt.userAgent),t!==null&&(pl=!0,yd=Po(t[1])))}return pl}function w4(){return fb()&&yd}let cA,pb;function hA(){if(!ne(cA)){cA=!1;const t=/ Edg\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(cA=!0,pb=Po(t[1]))}return cA}function b4(){return hA()&&pb}let AA,vd;function fA(){if(!ne(AA)){AA=!1;const t=/Firefox\/([\.0-9]+)/.exec(Xt.userAgent);t!==null&&(AA=!0,vd=Po(t[1]))}return AA}let wd;function x4(){return ne(wd)||(wd=/Windows/i.test(Xt.appVersion)),wd}let bd;function _4(){return ne(bd)||(bd=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),bd}function C4(){return fA()&&vd}let xd;function S4(){return ne(xd)||(xd=!fA()&&typeof PointerEvent<"u"&&(!ne(Xt.pointerEnabled)||Xt.pointerEnabled)),xd}let db,pA;function mb(){if(!ne(pA)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const n=t.style.imageRendering;pA=ne(n)&&n!=="",pA&&(db=n)}return pA}function E4(){return mb()?db:void 0}function $t(){if(!$t.initialized)throw new pe("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return $t._result}$t._promise=void 0,$t._result=void 0,$t.initialize=function(){return ne($t._promise)||($t._promise=new Promise(t=>{const n=new Image;n.onload=function(){$t._result=n.width>0&&n.height>0,t($t._result)},n.onerror=function(){$t._result=!1,t($t._result)},n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),$t._promise},Object.defineProperties($t,{initialized:{get:function(){return ne($t._result)}}});const Us=[];typeof ArrayBuffer<"u"&&(Us.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Us.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Us.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Us.push(BigInt64Array),typeof BigUint64Array<"u"&&Us.push(BigUint64Array));const Ht={isChrome:md,chromeVersion:g4,isSafari:hb,safariVersion:y4,isWebkit:Ab,webkitVersion:v4,isInternetExplorer:fb,internetExplorerVersion:w4,isEdge:hA,edgeVersion:b4,isFirefox:fA,firefoxVersion:C4,isWindows:x4,isIPadOrIOS:_4,hardwareConcurrency:Xt.hardwareConcurrency??3,supportsPointerEvents:S4,supportsImageRenderingPixelated:mb,supportsWebP:$t,imageRenderingValue:E4,typedArrayTypes:Us};Ht.supportsBasis=function(t){return Ht.supportsWebAssembly()&&t.context.supportsBasis},Ht.supportsFullscreen=function(){return mn.supportsFullscreen()},Ht.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},Ht.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},Ht.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},Ht.supportsBigInt=function(){return typeof BigInt<"u"},Ht.supportsWebWorkers=function(){return typeof Worker<"u"},Ht.supportsWebAssembly=function(){return typeof WebAssembly<"u"},Ht.supportsWebgl2=function(t){return N.defined("scene",t),t.context.webgl2},Ht.supportsEsmWebWorkers=function(){return!fA()||parseInt(vd)>=114};function _e(t,n){this.x=t??0,this.y=n??0}_e.fromElements=function(t,n,e){return ne(e)?(e.x=t,e.y=n,e):new _e(t,n)},_e.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n):new _e(t.x,t.y)},_e.fromCartesian3=_e.clone,_e.fromCartesian4=_e.clone,_e.packedLength=2,_e.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e]=t.y,n},_e.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new _e),e.x=t[n++],e.y=t[n],e},_e.packArray=function(t,n){N.defined("array",t);const e=t.length,i=e*2;if(!ne(n))n=new Array(i);else{if(!Array.isArray(n)&&n.length!==i)throw new pe("If result is a typed array, it must have exactly array.length * 2 elements");n.length!==i&&(n.length=i)}for(let o=0;o<e;++o)_e.pack(t[o],n,o*2);return n},_e.unpackArray=function(t,n){if(N.defined("array",t),N.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new pe("array length must be a multiple of 2.");const e=t.length;ne(n)?n.length=e/2:n=new Array(e/2);for(let i=0;i<e;i+=2){const o=i/2;n[o]=_e.unpack(t,i,n[o])}return n},_e.fromArray=_e.unpack,_e.maximumComponent=function(t){return N.typeOf.object("cartesian",t),Math.max(t.x,t.y)},_e.minimumComponent=function(t){return N.typeOf.object("cartesian",t),Math.min(t.x,t.y)},_e.minimumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e},_e.maximumByComponent=function(t,n,e){return N.typeOf.object("first",t),N.typeOf.object("second",n),N.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e},_e.clamp=function(t,n,e,i){N.typeOf.object("value",t),N.typeOf.object("min",n),N.typeOf.object("max",e),N.typeOf.object("result",i);const o=he.clamp(t.x,n.x,e.x),r=he.clamp(t.y,n.y,e.y);return i.x=o,i.y=r,i},_e.magnitudeSquared=function(t){return N.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},_e.magnitude=function(t){return Math.sqrt(_e.magnitudeSquared(t))};const dA=new _e;_e.distance=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.subtract(t,n,dA),_e.magnitude(dA)},_e.distanceSquared=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.subtract(t,n,dA),_e.magnitudeSquared(dA)},_e.normalize=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=_e.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,isNaN(n.x)||isNaN(n.y))throw new pe("normalized result is not a number");return n},_e.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y},_e.cross=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.y-t.y*n.x},_e.multiplyComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e},_e.divideComponents=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e},_e.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e},_e.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e},_e.multiplyByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e},_e.divideByScalar=function(t,n,e){return N.typeOf.object("cartesian",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e},_e.negate=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n},_e.abs=function(t,n){return N.typeOf.object("cartesian",t),N.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n};const gb=new _e;_e.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),_e.multiplyByScalar(n,e,gb),i=_e.multiplyByScalar(t,1-e,i),_e.add(gb,i,i)};const yb=new _e,vb=new _e;_e.angleBetween=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),_e.normalize(t,yb),_e.normalize(n,vb),he.acosClamped(_e.dot(yb,vb))};const P4=new _e;_e.mostOrthogonalAxis=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=_e.normalize(t,P4);return _e.abs(e,e),e.x<=e.y?n=_e.clone(_e.UNIT_X,n):n=_e.clone(_e.UNIT_Y,n),n},_e.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y},_e.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]},_e.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.x,n.x,e,i)&&he.equalsEpsilon(t.y,n.y,e,i)},_e.ZERO=Object.freeze(new _e(0,0)),_e.ONE=Object.freeze(new _e(1,1)),_e.UNIT_X=Object.freeze(new _e(1,0)),_e.UNIT_Y=Object.freeze(new _e(0,1)),_e.prototype.clone=function(t){return _e.clone(this,t)},_e.prototype.equals=function(t){return _e.equals(this,t)},_e.prototype.equalsEpsilon=function(t,n,e){return _e.equalsEpsilon(this,t,n,e)},_e.prototype.toString=function(){return`(${this.x}, ${this.y})`};const B4=new ae,T4=new ae;function wb(t,n,e,i,o){if(!ne(t))throw new pe("cartesian is required.");if(!ne(n))throw new pe("oneOverRadii is required.");if(!ne(e))throw new pe("oneOverRadiiSquared is required.");if(!ne(i))throw new pe("centerToleranceSquared is required.");const r=t.x,a=t.y,s=t.z,l=n.x,u=n.y,A=n.z,c=r*r*l*l,f=a*a*u*u,d=s*s*A*A,p=c+f+d,g=Math.sqrt(1/p),v=ae.multiplyByScalar(t,g,B4);if(p<i)return isFinite(g)?ae.clone(v,o):void 0;const y=e.x,m=e.y,b=e.z,x=T4;x.x=v.x*y*2,x.y=v.y*m*2,x.z=v.z*b*2;let E=(1-g)*ae.magnitude(t)/(.5*ae.magnitude(x)),B=0,P,I,O,M,S,T,w,C,U,F,D;do{E-=B,O=1/(1+E*y),M=1/(1+E*m),S=1/(1+E*b),T=O*O,w=M*M,C=S*S,U=T*O,F=w*M,D=C*S,P=c*T+f*w+d*C-1,I=c*U*y+f*F*m+d*D*b;const R=-2*I;B=P/R}while(Math.abs(P)>he.EPSILON12);return ne(o)?(o.x=r*O,o.y=a*M,o.z=s*S,o):new ae(r*O,a*M,s*S)}function Qe(t,n,e){this.longitude=t??0,this.latitude=n??0,this.height=e??0}Qe.fromRadians=function(t,n,e,i){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),e=e??0,ne(i)?(i.longitude=t,i.latitude=n,i.height=e,i):new Qe(t,n,e)},Qe.fromDegrees=function(t,n,e,i){return N.typeOf.number("longitude",t),N.typeOf.number("latitude",n),t=he.toRadians(t),n=he.toRadians(n),Qe.fromRadians(t,n,e,i)};const I4=new ae,F4=new ae,M4=new ae;Qe._ellipsoidOneOverRadii=new ae(1567855942887398e-22,1567855942887398e-22,1573130351105623e-22),Qe._ellipsoidOneOverRadiiSquared=new ae(2458172257647332e-29,2458172257647332e-29,24747391015697002e-30),Qe._ellipsoidCenterToleranceSquared=he.EPSILON1,Qe.fromCartesian=function(t,n,e){const i=ne(n)?n.oneOverRadii:Qe._ellipsoidOneOverRadii,o=ne(n)?n.oneOverRadiiSquared:Qe._ellipsoidOneOverRadiiSquared,r=ne(n)?n._centerToleranceSquared:Qe._ellipsoidCenterToleranceSquared,a=wb(t,i,o,r,F4);if(!ne(a))return;let s=ae.multiplyComponents(a,o,I4);s=ae.normalize(s,s);const l=ae.subtract(t,a,M4),u=Math.atan2(s.y,s.x),A=Math.asin(s.z),c=he.sign(ae.dot(l,t))*ae.magnitude(l);return ne(e)?(e.longitude=u,e.latitude=A,e.height=c,e):new Qe(u,A,c)},Qe.toCartesian=function(t,n,e){return N.defined("cartographic",t),ae.fromRadians(t.longitude,t.latitude,t.height,n,e)},Qe.clone=function(t,n){if(ne(t))return ne(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Qe(t.longitude,t.latitude,t.height)},Qe.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},Qe.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.longitude-n.longitude)<=e&&Math.abs(t.latitude-n.latitude)<=e&&Math.abs(t.height-n.height)<=e},Qe.ZERO=Object.freeze(new Qe(0,0,0)),Qe.prototype.clone=function(t){return Qe.clone(this,t)},Qe.prototype.equals=function(t){return Qe.equals(this,t)},Qe.prototype.equalsEpsilon=function(t,n){return Qe.equalsEpsilon(this,t,n)},Qe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function bb(t,n,e,i){n=n??0,e=e??0,i=i??0,N.typeOf.number.greaterThanOrEquals("x",n,0),N.typeOf.number.greaterThanOrEquals("y",e,0),N.typeOf.number.greaterThanOrEquals("z",i,0),t._radii=new ae(n,e,i),t._radiiSquared=new ae(n*n,e*e,i*i),t._radiiToTheFourth=new ae(n*n*n*n,e*e*e*e,i*i*i*i),t._oneOverRadii=new ae(n===0?0:1/n,e===0?0:1/e,i===0?0:1/i),t._oneOverRadiiSquared=new ae(n===0?0:1/(n*n),e===0?0:1/(e*e),i===0?0:1/(i*i)),t._minimumRadius=Math.min(n,e,i),t._maximumRadius=Math.max(n,e,i),t._centerToleranceSquared=he.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function De(t,n,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,bb(this,t,n,e)}Object.defineProperties(De.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}}}),De.clone=function(t,n){if(!ne(t))return;const e=t._radii;return ne(n)?(ae.clone(e,n._radii),ae.clone(t._radiiSquared,n._radiiSquared),ae.clone(t._radiiToTheFourth,n._radiiToTheFourth),ae.clone(t._oneOverRadii,n._oneOverRadii),ae.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new De(e.x,e.y,e.z)},De.fromCartesian3=function(t,n){return ne(n)||(n=new De),ne(t)&&bb(n,t.x,t.y,t.z),n},De.WGS84=Object.freeze(new De(6378137,6378137,6356752314245179e-9)),De.UNIT_SPHERE=Object.freeze(new De(1,1,1)),De.MOON=Object.freeze(new De(he.LUNAR_RADIUS,he.LUNAR_RADIUS,he.LUNAR_RADIUS)),De.MARS=Object.freeze(new De(3396190,3396190,3376200)),De._default=De.WGS84,Object.defineProperties(De,{default:{get:function(){return De._default},set:function(t){N.typeOf.object("value",t),De._default=t,ae._ellipsoidRadiiSquared=t.radiiSquared,Qe._ellipsoidOneOverRadii=t.oneOverRadii,Qe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,Qe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),De.prototype.clone=function(t){return De.clone(this,t)},De.packedLength=ae.packedLength,De.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,ae.pack(t._radii,n,e),n},De.unpack=function(t,n,e){N.defined("array",t),n=n??0;const i=ae.unpack(t,n);return De.fromCartesian3(i,e)},De.prototype.geocentricSurfaceNormal=ae.normalize,De.prototype.geodeticSurfaceNormalCartographic=function(t,n){N.typeOf.object("cartographic",t);const e=t.longitude,i=t.latitude,o=Math.cos(i),r=o*Math.cos(e),a=o*Math.sin(e),s=Math.sin(i);return ne(n)||(n=new ae),n.x=r,n.y=a,n.z=s,ae.normalize(n,n)},De.prototype.geodeticSurfaceNormal=function(t,n){if(N.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new pe("cartesian has a NaN component");if(!ae.equalsEpsilon(t,ae.ZERO,he.EPSILON14))return ne(n)||(n=new ae),n=ae.multiplyComponents(t,this._oneOverRadiiSquared,n),ae.normalize(n,n)};const D4=new ae,R4=new ae;De.prototype.cartographicToCartesian=function(t,n){const e=D4,i=R4;this.geodeticSurfaceNormalCartographic(t,e),ae.multiplyComponents(this._radiiSquared,e,i);const o=Math.sqrt(ae.dot(e,i));return ae.divideByScalar(i,o,i),ae.multiplyByScalar(e,t.height,e),ne(n)||(n=new ae),ae.add(i,e,n)},De.prototype.cartographicArrayToCartesianArray=function(t,n){N.defined("cartographics",t);const e=t.length;ne(n)?n.length=e:n=new Array(e);for(let i=0;i<e;i++)n[i]=this.cartographicToCartesian(t[i],n[i]);return n};const U4=new ae,O4=new ae,L4=new ae;De.prototype.cartesianToCartographic=function(t,n){const e=this.scaleToGeodeticSurface(t,O4);if(!ne(e))return;const i=this.geodeticSurfaceNormal(e,U4),o=ae.subtract(t,e,L4),r=Math.atan2(i.y,i.x),a=Math.asin(i.z),s=he.sign(ae.dot(o,t))*ae.magnitude(o);return ne(n)?(n.longitude=r,n.latitude=a,n.height=s,n):new Qe(r,a,s)},De.prototype.cartesianArrayToCartographicArray=function(t,n){N.defined("cartesians",t);const e=t.length;ne(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.cartesianToCartographic(t[i],n[i]);return n},De.prototype.scaleToGeodeticSurface=function(t,n){return wb(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)},De.prototype.scaleToGeocentricSurface=function(t,n){N.typeOf.object("cartesian",t),ne(n)||(n=new ae);const e=t.x,i=t.y,o=t.z,r=this._oneOverRadiiSquared,a=1/Math.sqrt(e*e*r.x+i*i*r.y+o*o*r.z);return ae.multiplyByScalar(t,a,n)},De.prototype.transformPositionToScaledSpace=function(t,n){return ne(n)||(n=new ae),ae.multiplyComponents(t,this._oneOverRadii,n)},De.prototype.transformPositionFromScaledSpace=function(t,n){return ne(n)||(n=new ae),ae.multiplyComponents(t,this._radii,n)},De.prototype.equals=function(t){return this===t||ne(t)&&ae.equals(this._radii,t._radii)},De.prototype.toString=function(){return this._radii.toString()},De.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,e){if(N.typeOf.object("position",t),!he.equalsEpsilon(this._radii.x,this._radii.y,he.EPSILON15))throw new pe("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");N.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),n=n??0;const i=this._squaredXOverSquaredZ;if(ne(e)||(e=new ae),e.x=0,e.y=0,e.z=t.z*(1-i),!(Math.abs(e.z)>=this._radii.z-n))return e};const z4=new ae;De.prototype.getLocalCurvature=function(t,n){N.typeOf.object("surfacePosition",t),ne(n)||(n=new _e);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,z4),i=ae.distance(t,e),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return _e.fromElements(1/i,1/r,n)};const k4=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Q4=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xb(t,n,e){N.typeOf.number("a",t),N.typeOf.number("b",n),N.typeOf.func("func",e);const i=.5*(n+t),o=.5*(n-t);let r=0;for(let a=0;a<5;a++){const s=o*k4[a];r+=Q4[a]*(e(i+s)+e(i-s))}return r*=o,r}De.prototype.surfaceArea=function(t){N.typeOf.object("rectangle",t);const n=t.west;let e=t.east;const i=t.south,o=t.north;for(;e<n;)e+=he.TWO_PI;const r=this._radiiSquared,a=r.x,s=r.y,l=r.z,u=a*s;return xb(i,o,function(A){const c=Math.cos(A),f=Math.sin(A);return Math.cos(A)*xb(n,e,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.sqrt(u*f*f+l*(s*p*p+a*g*g)*c*c)})})};function dl(t,n,e){N.defined("array",t),N.defined("itemToFind",n),N.defined("comparator",e);let i=0,o=t.length-1,r,a;for(;i<=o;){if(r=~~((i+o)/2),a=e(t[r],n),a<0){i=r+1;continue}if(a>0){o=r-1;continue}return r}return~(o+1)}function _d(t,n,e,i,o){this.xPoleWander=t,this.yPoleWander=n,this.xPoleOffset=e,this.yPoleOffset=i,this.ut1MinusUtc=o}function Cd(t){if(t===null||isNaN(t))throw new pe("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const _b=[31,28,31,30,31,30,31,31,30,31,30,31];function Sd(t,n,e,i,o,r,a,s){t=t??1,n=n??1,e=e??1,i=i??0,o=o??0,r=r??0,a=a??0,s=s??!1,g(),v(),this.year=t,this.month=n,this.day=e,this.hour=i,this.minute=o,this.second=r,this.millisecond=a,this.isLeapSecond=s;function g(){N.typeOf.number.greaterThanOrEquals("Year",t,1),N.typeOf.number.lessThanOrEquals("Year",t,9999),N.typeOf.number.greaterThanOrEquals("Month",n,1),N.typeOf.number.lessThanOrEquals("Month",n,12),N.typeOf.number.greaterThanOrEquals("Day",e,1),N.typeOf.number.lessThanOrEquals("Day",e,31),N.typeOf.number.greaterThanOrEquals("Hour",i,0),N.typeOf.number.lessThanOrEquals("Hour",i,23),N.typeOf.number.greaterThanOrEquals("Minute",o,0),N.typeOf.number.lessThanOrEquals("Minute",o,59),N.typeOf.bool("IsLeapSecond",s),N.typeOf.number.greaterThanOrEquals("Second",r,0),N.typeOf.number.lessThanOrEquals("Second",r,s?60:59),N.typeOf.number.greaterThanOrEquals("Millisecond",a,0),N.typeOf.number.lessThan("Millisecond",a,1e3)}function v(){const y=n===2&&Cd(t)?_b[n-1]+1:_b[n-1];if(e>y)throw new pe("Month and Day represents invalid date")}}function Ye(t,n){this.julianDate=t,this.offset=n}const pt=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}),Ve=Object.freeze({UTC:0,TAI:1}),Cb=new Sd,mA=[31,28,31,30,31,30,31,31,30,31,30,31],gA=29;function Ed(t,n){return we.compare(t.julianDate,n.julianDate)}const Os=new Ye;function yA(t){Os.julianDate=t;const n=we.leapSeconds;let e=dl(n,Os,Ed);e<0&&(e=~e),e>=n.length&&(e=n.length-1);let i=n[e].offset;e>0&&we.secondsDifference(n[e].julianDate,t)>i&&(e--,i=n[e].offset),we.addSeconds(t,i,t)}function Sb(t,n){Os.julianDate=t;const e=we.leapSeconds;let i=dl(e,Os,Ed);if(i<0&&(i=~i),i===0)return we.addSeconds(t,-e[0].offset,n);if(i>=e.length)return we.addSeconds(t,-e[i-1].offset,n);const o=we.secondsDifference(e[i].julianDate,t);if(o===0)return we.addSeconds(t,-e[i].offset,n);if(!(o<=1))return we.addSeconds(t,-e[--i].offset,n)}function Ur(t,n,e){const i=n/pt.SECONDS_PER_DAY|0;return t+=i,n-=pt.SECONDS_PER_DAY*i,n<0&&(t--,n+=pt.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=n,e}function Pd(t,n,e,i,o,r,a){const s=(n-14)/12|0,l=t+4800+s;let u=(1461*l/4|0)+(367*(n-2-12*s)/12|0)-(3*((l+100)/100|0)/4|0)+e-32075;i=i-12,i<0&&(i+=24);const A=r+(i*pt.SECONDS_PER_HOUR+o*pt.SECONDS_PER_MINUTE+a*pt.SECONDS_PER_MILLISECOND);return A>=43200&&(u-=1),[u,A]}const V4=/^(\d{4})$/,N4=/^(\d{4})-(\d{2})$/,H4=/^(\d{4})-?(\d{3})$/,G4=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,W4=/^(\d{4})-?(\d{2})-?(\d{2})$/,Bd=/([Z+\-])?(\d{2})?:?(\d{2})?$/,j4=/^(\d{2})(\.\d+)?/.source+Bd.source,q4=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Bd.source,K4=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Bd.source,ni="Invalid ISO 8601 date.";function we(t,n,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,e=e??Ve.UTC;const i=t|0;n=n+(t-i)*pt.SECONDS_PER_DAY,Ur(i,n,this),e===Ve.UTC&&yA(this)}we.fromGregorianDate=function(t,n){if(!(t instanceof Sd))throw new pe("date must be a valid GregorianDate.");const e=Pd(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return ne(n)?(Ur(e[0],e[1],n),yA(n),n):new we(e[0],e[1],Ve.UTC)},we.fromDate=function(t,n){if(!(t instanceof Date)||isNaN(t.getTime()))throw new pe("date must be a valid JavaScript Date.");const e=Pd(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return ne(n)?(Ur(e[0],e[1],n),yA(n),n):new we(e[0],e[1],Ve.UTC)},we.fromIso8601=function(t,n){if(typeof t!="string")throw new pe(ni);t=t.replace(",",".");let e=t.split("T"),i,o=1,r=1,a=0,s=0,l=0,u=0;const A=e[0],c=e[1];let f,d;if(!ne(A))throw new pe(ni);let p;if(e=A.match(W4),e!==null){if(p=A.split("-").length-1,p>0&&p!==2)throw new pe(ni);i=+e[1],o=+e[2],r=+e[3]}else if(e=A.match(N4),e!==null)i=+e[1],o=+e[2];else if(e=A.match(V4),e!==null)i=+e[1];else{let m;if(e=A.match(H4),e!==null){if(i=+e[1],m=+e[2],d=Cd(i),m<1||d&&m>366||!d&&m>365)throw new pe(ni)}else if(e=A.match(G4),e!==null){i=+e[1];const b=+e[2],x=+e[3]||0;if(p=A.split("-").length-1,p>0&&(!ne(e[3])&&p!==1||ne(e[3])&&p!==2))throw new pe(ni);const E=new Date(Date.UTC(i,0,4));m=b*7+x-E.getUTCDay()-3}else throw new pe(ni);f=new Date(Date.UTC(i,0,1)),f.setUTCDate(m),o=f.getUTCMonth()+1,r=f.getUTCDate()}if(d=Cd(i),o<1||o>12||r<1||(o!==2||!d)&&r>mA[o-1]||d&&o===2&&r>gA)throw new pe(ni);let g;if(ne(c)){if(e=c.match(K4),e!==null){if(p=c.split(":").length-1,p>0&&p!==2&&p!==3)throw new pe(ni);a=+e[1],s=+e[2],l=+e[3],u=+(e[4]||0)*1e3,g=5}else if(e=c.match(q4),e!==null){if(p=c.split(":").length-1,p>2)throw new pe(ni);a=+e[1],s=+e[2],l=+(e[3]||0)*60,g=4}else if(e=c.match(j4),e!==null)a=+e[1],s=+(e[2]||0)*60,g=3;else throw new pe(ni);if(s>=60||l>=61||a>24||a===24&&(s>0||l>0||u>0))throw new pe(ni);const m=e[g],b=+e[g+1],x=+(e[g+2]||0);switch(m){case"+":a=a-b,s=s-x;break;case"-":a=a+b,s=s+x;break;case"Z":break;default:s=s+new Date(Date.UTC(i,o-1,r,a,s)).getTimezoneOffset();break}}const v=l===60;for(v&&l--;s>=60;)s-=60,a++;for(;a>=24;)a-=24,r++;for(f=d&&o===2?gA:mA[o-1];r>f;)r-=f,o++,o>12&&(o-=12,i++),f=d&&o===2?gA:mA[o-1];for(;s<0;)s+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),f=d&&o===2?gA:mA[o-1],r+=f;const y=Pd(i,o,r,a,s,l,u);return ne(n)?(Ur(y[0],y[1],n),yA(n)):n=new we(y[0],y[1],Ve.UTC),v&&we.addSeconds(n,1,n),n},we.now=function(t){return we.fromDate(new Date,t)};const vA=new we(0,0,Ve.TAI);we.toGregorianDate=function(t,n){if(!ne(t))throw new pe("julianDate is required.");let e=!1,i=Sb(t,vA);ne(i)||(we.addSeconds(t,-1,vA),i=Sb(vA,vA),e=!0);let o=i.dayNumber;const r=i.secondsOfDay;r>=43200&&(o+=1);let a=o+68569|0;const s=4*a/146097|0;a=a-((146097*s+3)/4|0)|0;const l=4e3*(a+1)/1461001|0;a=a-(1461*l/4|0)+31|0;const u=80*a/2447|0,A=a-(2447*u/80|0)|0;a=u/11|0;const c=u+2-12*a|0,f=100*(s-49)+l+a|0;let d=r/pt.SECONDS_PER_HOUR|0,p=r-d*pt.SECONDS_PER_HOUR;const g=p/pt.SECONDS_PER_MINUTE|0;p=p-g*pt.SECONDS_PER_MINUTE;let v=p|0;const y=(p-v)/pt.SECONDS_PER_MILLISECOND;return d+=12,d>23&&(d-=24),e&&(v+=1),ne(n)?(n.year=f,n.month=c,n.day=A,n.hour=d,n.minute=g,n.second=v,n.millisecond=y,n.isLeapSecond=e,n):new Sd(f,c,A,d,g,v,y,e)},we.toDate=function(t){if(!ne(t))throw new pe("julianDate is required.");const n=we.toGregorianDate(t,Cb);let e=n.second;return n.isLeapSecond&&(e-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,e,n.millisecond))},we.toIso8601=function(t,n){if(!ne(t))throw new pe("julianDate is required.");const e=we.toGregorianDate(t,Cb);let i=e.year,o=e.month,r=e.day,a=e.hour;const s=e.minute,l=e.second,u=e.millisecond;i===1e4&&o===1&&r===1&&a===0&&s===0&&l===0&&u===0&&(i=9999,o=12,r=31,a=24);let A;if(!ne(n)&&u!==0){const c=u*.01;return A=c<1e-6?c.toFixed(20).replace(".","").replace(/0+$/,""):c.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${A}Z`}return!ne(n)||n===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(A=(u*.01).toFixed(n).replace(".","").slice(0,n),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${A}Z`)},we.clone=function(t,n){if(ne(t))return ne(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new we(t.dayNumber,t.secondsOfDay,Ve.TAI)},we.compare=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");const e=t.dayNumber-n.dayNumber;return e!==0?e:t.secondsOfDay-n.secondsOfDay},we.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay},we.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(we.secondsDifference(t,n))<=e},we.totalDays=function(t){if(!ne(t))throw new pe("julianDate is required.");return t.dayNumber+t.secondsOfDay/pt.SECONDS_PER_DAY},we.secondsDifference=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");return(t.dayNumber-n.dayNumber)*pt.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)},we.daysDifference=function(t,n){if(!ne(t))throw new pe("left is required.");if(!ne(n))throw new pe("right is required.");const e=t.dayNumber-n.dayNumber,i=(t.secondsOfDay-n.secondsOfDay)/pt.SECONDS_PER_DAY;return e+i},we.computeTaiMinusUtc=function(t){Os.julianDate=t;const n=we.leapSeconds;let e=dl(n,Os,Ed);return e<0&&(e=~e,--e,e<0&&(e=0)),n[e].offset},we.addSeconds=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("seconds is required.");if(!ne(e))throw new pe("result is required.");return Ur(t.dayNumber,t.secondsOfDay+n,e)},we.addMinutes=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("minutes is required.");if(!ne(e))throw new pe("result is required.");const i=t.secondsOfDay+n*pt.SECONDS_PER_MINUTE;return Ur(t.dayNumber,i,e)},we.addHours=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("hours is required.");if(!ne(e))throw new pe("result is required.");const i=t.secondsOfDay+n*pt.SECONDS_PER_HOUR;return Ur(t.dayNumber,i,e)},we.addDays=function(t,n,e){if(!ne(t))throw new pe("julianDate is required.");if(!ne(n))throw new pe("days is required.");if(!ne(e))throw new pe("result is required.");const i=t.dayNumber+n;return Ur(i,t.secondsOfDay,e)},we.lessThan=function(t,n){return we.compare(t,n)<0},we.lessThanOrEquals=function(t,n){return we.compare(t,n)<=0},we.greaterThan=function(t,n){return we.compare(t,n)>0},we.greaterThanOrEquals=function(t,n){return we.compare(t,n)>=0},we.prototype.clone=function(t){return we.clone(this,t)},we.prototype.equals=function(t){return we.equals(this,t)},we.prototype.equalsEpsilon=function(t,n){return we.equalsEpsilon(this,t,n)},we.prototype.toString=function(){return we.toIso8601(this)},we.leapSeconds=[new Ye(new we(2441317,43210,Ve.TAI),10),new Ye(new we(2441499,43211,Ve.TAI),11),new Ye(new we(2441683,43212,Ve.TAI),12),new Ye(new we(2442048,43213,Ve.TAI),13),new Ye(new we(2442413,43214,Ve.TAI),14),new Ye(new we(2442778,43215,Ve.TAI),15),new Ye(new we(2443144,43216,Ve.TAI),16),new Ye(new we(2443509,43217,Ve.TAI),17),new Ye(new we(2443874,43218,Ve.TAI),18),new Ye(new we(2444239,43219,Ve.TAI),19),new Ye(new we(2444786,43220,Ve.TAI),20),new Ye(new we(2445151,43221,Ve.TAI),21),new Ye(new we(2445516,43222,Ve.TAI),22),new Ye(new we(2446247,43223,Ve.TAI),23),new Ye(new we(2447161,43224,Ve.TAI),24),new Ye(new we(2447892,43225,Ve.TAI),25),new Ye(new we(2448257,43226,Ve.TAI),26),new Ye(new we(2448804,43227,Ve.TAI),27),new Ye(new we(2449169,43228,Ve.TAI),28),new Ye(new we(2449534,43229,Ve.TAI),29),new Ye(new we(2450083,43230,Ve.TAI),30),new Ye(new we(2450630,43231,Ve.TAI),31),new Ye(new we(2451179,43232,Ve.TAI),32),new Ye(new we(2453736,43233,Ve.TAI),33),new Ye(new we(2454832,43234,Ve.TAI),34),new Ye(new we(2456109,43235,Ve.TAI),35),new Ye(new we(2457204,43236,Ve.TAI),36),new Ye(new we(2457754,43237,Ve.TAI),37)];var wA={exports:{}},ml={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var Z4=ml.exports,Eb;function X4(){return Eb||(Eb=1,(function(t,n){(function(e){var i=n&&!n.nodeType&&n,o=t&&!t.nodeType&&t,r=typeof J1=="object"&&J1;(r.global===r||r.window===r||r.self===r)&&(e=r);var a,s=2147483647,l=36,u=1,A=26,c=38,f=700,d=72,p=128,g="-",v=/^xn--/,y=/[^\x20-\x7E]/,m=/[\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=l-u,E=Math.floor,B=String.fromCharCode,P;function I(k){throw new RangeError(b[k])}function O(k,Q){for(var V=k.length,G=[];V--;)G[V]=Q(k[V]);return G}function M(k,Q){var V=k.split("@"),G="";V.length>1&&(G=V[0]+"@",k=V[1]),k=k.replace(m,".");var $=k.split("."),Y=O($,Q).join(".");return G+Y}function S(k){for(var Q=[],V=0,G=k.length,$,Y;V<G;)$=k.charCodeAt(V++),$>=55296&&$<=56319&&V<G?(Y=k.charCodeAt(V++),(Y&64512)==56320?Q.push((("use strict";1023)<<10)+(Y&1023)+65536):(Q.push($),V--)):Q.push($);return Q}function T(k){return O(k,function(Q){var V="";return Q>65535&&(Q-=65536,V+=B(Q>>>10&1023|55296),Q=56320|Q&1023),V+=B(Q),V}).join("")}function w(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function C(k,Q){return k+22+75*(k<26)-((Q!=0)<<5)}function U(k,Q,V){var G=0;for(k=V?E(k/f):k>>1,k+=E(k/Q);k>x*A>>1;G+=l)k=E(k/x);return E(G+(x+1)*k/(k+c))}function F(k){var Q=[],V=k.length,G,$=0,Y=p,ie=d,re,le,ue,te,ce,X,q,H,Z;for(re=k.lastIndexOf(g),re<0&&(re=0),le=0;le<re;++le)k.charCodeAt(le)>=128&&I("not-basic"),Q.push(k.charCodeAt(le));for(ue=re>0?re+1:0;ue<V;){for(te=$,ce=1,X=l;ue>=V&&I("invalid-input"),q=w(k.charCodeAt(ue++)),(q>=l||q>E((s-$)/ce))&&I("overflow"),$+=q*ce,H=X<=ie?u:X>=ie+A?A:X-ie,!(q<H);X+=l)Z=l-H,ce>E(s/Z)&&I("overflow"),ce*=Z;G=Q.length+1,ie=U($-te,G,te==0),E($/G)>s-Y&&I("overflow"),Y+=E($/G),$%=G,Q.splice($++,0,Y)}return T(Q)}function D(k){var Q,V,G,$,Y,ie,re,le,ue,te,ce,X=[],q,H,Z,K;for(k=S(k),q=k.length,Q=p,V=0,Y=d,ie=0;ie<q;++ie)ce=k[ie],ce<128&&X.push(B(ce));for(G=$=X.length,"use strict";&X.push(g);G<q;){for(re=s,ie=0;ie<q;++ie)ce=k[ie],ce>=Q&&ce<re&&(re=ce);for(H=G+1,re-Q>E((s-V)/H)&&I("overflow"),V+=(re-Q)*H,Q=re,ie=0;ie<q;++ie)if(ce=k[ie],ce<Q&&++V>s&&I("overflow"),ce==Q){for(le=V,ue=l;te=ue<=Y?u:ue>=Y+A?A:ue-Y,!(le<te);ue+=l)K=le-te,Z=l-te,X.push(B(C(te+K%Z,0))),le=E(K/Z);X.push(B(C(le,0))),Y=U(V,H,G==$),V=0,++G}++V,++Q}return X.join("")}function R(k){return M(k,function(Q){return v.test(Q)?F(Q.slice(4).toLowerCase()):Q})}function L(k){return M(k,function(Q){return y.test(Q)?"xn--"+D(Q):Q})}if(a={version:"1.3.2",ucs2:{decode:S,encode:T},decode:F,encode:D,toASCII:L,toUnicode:R},i&&o)if(t.exports==i)o.exports=a;else for(P in a)a.hasOwnProperty(P)&&(i[P]=a[P]);else e.punycode=a})(Z4)})(ml,ml.exports)),ml.exports}var bA={exports:{}};/*!
348
348
  * URI.js - Mutating URLs
349
349
  * IPv6 Support
350
350
  *
@@ -356,7 +356,7 @@ ${this.stack.toString()}`),t};function ge(t,n,e,i,o,r,a,s,l,u,A,c,f,d,p,g){this[
356
356
  * Licensed under
357
357
  * MIT License http://www.opensource.org/licenses/mit-license
358
358
  *
359
- */var $R=bA.exports,Pb;function YR(){return Pb||(Pb=1,(function(t){(function(n,e){t.exports?t.exports=e():n.IPv6=e(n)})($R,function(n){var e=n&&n.IPv6;function i(r){var a=r.toLowerCase(),s=a.split(":"),l=s.length,u=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[l-1]===""&&s[l-2]===""&&s.pop(),l=s.length,s[l-1].indexOf(".")!==-1&&(u=7);var A;for(A=0;A<l&&s[A]!=="";A++);if(A<u)for(s.splice(A,1,"0000");s.length<u;)s.splice(A,0,"0000");for(var c,f=0;f<u;f++){c=s[f].split("");for(var d=0;d<3&&(c[0]==="0"&&c.length>1);d++)c.splice(0,1);s[f]=c.join("")}var p=-1,g=0,v=0,y=-1,m=!1;for(f=0;f<u;f++)m?s[f]==="0"?v+=1:(m=!1,v>g&&(p=y,g=v)):s[f]==="0"&&(m=!0,y=f,v=1);v>g&&(p=y,g=v),g>1&&s.splice(p,g,""),l=s.length;var b="";for(s[0]===""&&(b=":"),f=0;f<l&&(b+=s[f],f!==l-1);f++)b+=":";return s[l-1]===""&&(b+=":"),b}function o(){return n.IPv6===this&&(n.IPv6=e),this}return{best:i,noConflict:o}})})(bA)),bA.exports}var xA={exports:{}};/*!
359
+ */var $4=bA.exports,Pb;function Y4(){return Pb||(Pb=1,(function(t){(function(n,e){t.exports?t.exports=e():n.IPv6=e(n)})($4,function(n){var e=n&&n.IPv6;function i(r){var a=r.toLowerCase(),s=a.split(":"),l=s.length,u=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[l-1]===""&&s[l-2]===""&&s.pop(),l=s.length,s[l-1].indexOf(".")!==-1&&(u=7);var A;for(A=0;A<l&&s[A]!=="";A++);if(A<u)for(s.splice(A,1,"0000");s.length<u;)s.splice(A,0,"0000");for(var c,f=0;f<u;f++){c=s[f].split("");for(var d=0;d<3&&(c[0]==="0"&&c.length>1);d++)c.splice(0,1);s[f]=c.join("")}var p=-1,g=0,v=0,y=-1,m=!1;for(f=0;f<u;f++)m?s[f]==="0"?v+=1:(m=!1,v>g&&(p=y,g=v)):s[f]==="0"&&(m=!0,y=f,v=1);v>g&&(p=y,g=v),g>1&&s.splice(p,g,""),l=s.length;var b="";for(s[0]===""&&(b=":"),f=0;f<l&&(b+=s[f],f!==l-1);f++)b+=":";return s[l-1]===""&&(b+=":"),b}function o(){return n.IPv6===this&&(n.IPv6=e),this}return{best:i,noConflict:o}})})(bA)),bA.exports}var xA={exports:{}};/*!
360
360
  * URI.js - Mutating URLs
361
361
  * Second Level Domain (SLD) Support
362
362
  *
@@ -368,7 +368,7 @@ ${this.stack.toString()}`),t};function ge(t,n,e,i,o,r,a,s,l,u,A,c,f,d,p,g){this[
368
368
  * Licensed under
369
369
  * MIT License http://www.opensource.org/licenses/mit-license
370
370
  *
371
- */var JR=xA.exports,Bb;function e4(){return Bb||(Bb=1,(function(t){(function(n,e){t.exports?t.exports=e():n.SecondLevelDomains=e(n)})(JR,function(n){var e=n&&n.SecondLevelDomains,i={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 r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var a=o.lastIndexOf(".",r-1);if(a<=0||a>=r-1)return!1;var s=i.list[o.slice(r+1)];return s?s.indexOf(" "+o.slice(a+1,r)+" ")>=0:!1},is:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var a=o.lastIndexOf(".",r-1);if(a>=0)return!1;var s=i.list[o.slice(r+1)];return s?s.indexOf(" "+o.slice(0,r)+" ")>=0:!1},get:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return null;var a=o.lastIndexOf(".",r-1);if(a<=0||a>=r-1)return null;var s=i.list[o.slice(r+1)];return!s||s.indexOf(" "+o.slice(a+1,r)+" ")<0?null:o.slice(a+1)},noConflict:function(){return n.SecondLevelDomains===this&&(n.SecondLevelDomains=e),this}};return i})})(xA)),xA.exports}/*!
371
+ */var J4=xA.exports,Bb;function eR(){return Bb||(Bb=1,(function(t){(function(n,e){t.exports?t.exports=e():n.SecondLevelDomains=e(n)})(J4,function(n){var e=n&&n.SecondLevelDomains,i={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 r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var a=o.lastIndexOf(".",r-1);if(a<=0||a>=r-1)return!1;var s=i.list[o.slice(r+1)];return s?s.indexOf(" "+o.slice(a+1,r)+" ")>=0:!1},is:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var a=o.lastIndexOf(".",r-1);if(a>=0)return!1;var s=i.list[o.slice(r+1)];return s?s.indexOf(" "+o.slice(0,r)+" ")>=0:!1},get:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return null;var a=o.lastIndexOf(".",r-1);if(a<=0||a>=r-1)return null;var s=i.list[o.slice(r+1)];return!s||s.indexOf(" "+o.slice(a+1,r)+" ")<0?null:o.slice(a+1)},noConflict:function(){return n.SecondLevelDomains===this&&(n.SecondLevelDomains=e),this}};return i})})(xA)),xA.exports}/*!
372
372
  * URI.js - Mutating URLs
373
373
  *
374
374
  * Version: 1.19.11
@@ -379,11 +379,11 @@ ${this.stack.toString()}`),t};function ge(t,n,e,i,o,r,a,s,l,u,A,c,f,d,p,g){this[
379
379
  * Licensed under
380
380
  * MIT License http://www.opensource.org/licenses/mit-license
381
381
  *
382
- */var t4=wA.exports,Tb;function n4(){return Tb||(Tb=1,(function(t){(function(n,e){t.exports?t.exports=e(XR(),YR(),e4()):n.URI=e(n.punycode,n.IPv6,n.SecondLevelDomains,n)})(t4,function(n,e,i,o){var r=o&&o.URI;function a(w,C){var U=arguments.length>=1,F=arguments.length>=2;if(!(this instanceof a))return U?F?new a(w,C):new a(w):new a;if(w===void 0){if(U)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&U)throw new TypeError("null is not a valid argument for URI");return this.href(w),C!==void 0?this.absoluteTo(C):this}function s(w){return/^[0-9]+$/.test(w)}a.version="1.19.11";var l=a.prototype,u=Object.prototype.hasOwnProperty;function A(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function f(w){return c(w)==="Array"}function d(w,C){var U={},F,D;if(c(C)==="RegExp")U=null;else if(f(C))for(F=0,D=C.length;F<D;F++)U[C[F]]=!0;else U[C]=!0;for(F=0,D=w.length;F<D;F++){var R=U&&U[w[F]]!==void 0||!U&&C.test(w[F]);R&&(w.splice(F,1),D--,F--)}return w}function p(w,C){var U,F;if(f(C)){for(U=0,F=C.length;U<F;U++)if(!p(w,C[U]))return!1;return!0}var D=c(C);for(U=0,F=w.length;U<F;U++)if(D==="RegExp"){if(typeof w[U]=="string"&&w[U].match(C))return!0}else if(w[U]===C)return!0;return!1}function g(w,C){if(!f(w)||!f(C)||w.length!==C.length)return!1;w.sort(),C.sort();for(var U=0,F=w.length;U<F;U++)if(w[U]!==C[U])return!1;return!0}function v(w){var C=/^\/+|\/+$/g;return w.replace(C,"")}a._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:a.preventInvalidHostname,duplicateQueryParameters:a.duplicateQueryParameters,escapeQuerySpace:a.escapeQuerySpace}},a.preventInvalidHostname=!1,a.duplicateQueryParameters=!1,a.escapeQuerySpace=!0,a.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,a.idn_expression=/[^a-z0-9\._-]/i,a.punycode_expression=/(xn--)/i,a.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,a.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*$/,a.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,a.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},a.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,a.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},a.hostProtocols=["http","https"],a.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,a.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"},a.getDomAttribute=function(w){if(!(!w||!w.nodeName)){var C=w.nodeName.toLowerCase();if(!(C==="input"&&w.type!=="image"))return a.domAttributes[C]}};function y(w){return escape(w)}function m(w){return encodeURIComponent(w).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}a.encode=m,a.decode=decodeURIComponent,a.iso8859=function(){a.encode=escape,a.decode=unescape},a.unicode=function(){a.encode=m,a.decode=decodeURIComponent},a.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"}}}},a.encodeQuery=function(w,C){var U=a.encode(w+"");return C===void 0&&(C=a.escapeQuerySpace),C?U.replace(/%20/g,"+"):U},a.decodeQuery=function(w,C){w+="",C===void 0&&(C=a.escapeQuerySpace);try{return a.decode(C?w.replace(/\+/g,"%20"):w)}catch{return w}};var b={encode:"encode",decode:"decode"},x,E=function(w,C){return function(U){try{return a[C](U+"").replace(a.characters[w][C].expression,function(F){return a.characters[w][C].map[F]})}catch{return U}}};for(x in b)a[x+"PathSegment"]=E("pathname",b[x]),a[x+"UrnPathSegment"]=E("urnpath",b[x]);var B=function(w,C,U){return function(F){var D;U?D=function(Q){return a[C](a[U](Q))}:D=a[C];for(var R=(F+"").split(w),L=0,k=R.length;L<k;L++)R[L]=D(R[L]);return R.join(w)}};a.decodePath=B("/","decodePathSegment"),a.decodeUrnPath=B(":","decodeUrnPathSegment"),a.recodePath=B("/","encodePathSegment","decode"),a.recodeUrnPath=B(":","encodeUrnPathSegment","decode"),a.encodeReserved=E("reserved","encode"),a.parse=function(w,C){var U;return C||(C={preventInvalidHostname:a.preventInvalidHostname}),w=w.replace(a.leading_whitespace_expression,""),w=w.replace(a.ascii_tab_whitespace,""),U=w.indexOf("#"),U>-1&&(C.fragment=w.substring(U+1)||null,w=w.substring(0,U)),U=w.indexOf("?"),U>-1&&(C.query=w.substring(U+1)||null,w=w.substring(0,U)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(C.protocol=null,w=w.substring(2),w=a.parseAuthority(w,C)):(U=w.indexOf(":"),U>-1&&(C.protocol=w.substring(0,U)||null,C.protocol&&!C.protocol.match(a.protocol_expression)?C.protocol=void 0:w.substring(U+1,U+3).replace(/\\/g,"/")==="//"?(w=w.substring(U+3),w=a.parseAuthority(w,C)):(w=w.substring(U+1),C.urn=!0))),C.path=w,C},a.parseHost=function(w,C){w||(w=""),w=w.replace(/\\/g,"/");var U=w.indexOf("/"),F,D;if(U===-1&&(U=w.length),w.charAt(0)==="[")F=w.indexOf("]"),C.hostname=w.substring(1,F)||null,C.port=w.substring(F+2,U)||null,C.port==="/"&&(C.port=null);else{var R=w.indexOf(":"),L=w.indexOf("/"),k=w.indexOf(":",R+1);k!==-1&&(L===-1||k<L)?(C.hostname=w.substring(0,U)||null,C.port=null):(D=w.substring(0,U).split(":"),C.hostname=D[0]||null,C.port=D[1]||null)}return C.hostname&&w.substring(U).charAt(0)!=="/"&&(U++,w="/"+w),C.preventInvalidHostname&&a.ensureValidHostname(C.hostname,C.protocol),C.port&&a.ensureValidPort(C.port),w.substring(U)||"/"},a.parseAuthority=function(w,C){return w=a.parseUserinfo(w,C),a.parseHost(w,C)},a.parseUserinfo=function(w,C){var U=w,F=w.indexOf("\\");F!==-1&&(w=w.replace(/\\/g,"/"));var D=w.indexOf("/"),R=w.lastIndexOf("@",D>-1?D:w.length-1),L;return R>-1&&(D===-1||R<D)?(L=w.substring(0,R).split(":"),C.username=L[0]?a.decode(L[0]):null,L.shift(),C.password=L[0]?a.decode(L.join(":")):null,w=U.substring(R+1)):(C.username=null,C.password=null),w},a.parseQuery=function(w,C){if(!w)return{};if(w=w.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!w)return{};for(var U={},F=w.split("&"),D=F.length,R,L,k,Q=0;Q<D;Q++)R=F[Q].split("="),L=a.decodeQuery(R.shift(),C),k=R.length?a.decodeQuery(R.join("="),C):null,L!=="__proto__"&&(u.call(U,L)?((typeof U[L]=="string"||U[L]===null)&&(U[L]=[U[L]]),U[L].push(k)):U[L]=k);return U},a.build=function(w){var C="",U=!1;return w.protocol&&(C+=w.protocol+":"),!w.urn&&(C||w.hostname)&&(C+="//",U=!0),C+=a.buildAuthority(w)||"",typeof w.path=="string"&&(w.path.charAt(0)!=="/"&&U&&(C+="/"),C+=w.path),typeof w.query=="string"&&w.query&&(C+="?"+w.query),typeof w.fragment=="string"&&w.fragment&&(C+="#"+w.fragment),C},a.buildHost=function(w){var C="";if(w.hostname)a.ip6_expression.test(w.hostname)?C+="["+w.hostname+"]":C+=w.hostname;else return"";return w.port&&(C+=":"+w.port),C},a.buildAuthority=function(w){return a.buildUserinfo(w)+a.buildHost(w)},a.buildUserinfo=function(w){var C="";return w.username&&(C+=a.encode(w.username)),w.password&&(C+=":"+a.encode(w.password)),C&&(C+="@"),C},a.buildQuery=function(w,C,U){var F="",D,R,L,k;for(R in w)if(R!=="__proto__"&&u.call(w,R))if(f(w[R]))for(D={},L=0,k=w[R].length;L<k;L++)w[R][L]!==void 0&&D[w[R][L]+""]===void 0&&(F+="&"+a.buildQueryParameter(R,w[R][L],U),C!==!0&&(D[w[R][L]+""]=!0));else w[R]!==void 0&&(F+="&"+a.buildQueryParameter(R,w[R],U));return F.substring(1)},a.buildQueryParameter=function(w,C,U){return a.encodeQuery(w,U)+(C!==null?"="+a.encodeQuery(C,U):"")},a.addQuery=function(w,C,U){if(typeof C=="object")for(var F in C)u.call(C,F)&&a.addQuery(w,F,C[F]);else if(typeof C=="string"){if(w[C]===void 0){w[C]=U;return}else typeof w[C]=="string"&&(w[C]=[w[C]]);f(U)||(U=[U]),w[C]=(w[C]||[]).concat(U)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(w,C,U){if(typeof C=="object")for(var F in C)u.call(C,F)&&a.setQuery(w,F,C[F]);else if(typeof C=="string")w[C]=U===void 0?null:U;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(w,C,U){var F,D,R;if(f(C))for(F=0,D=C.length;F<D;F++)w[C[F]]=void 0;else if(c(C)==="RegExp")for(R in w)C.test(R)&&(w[R]=void 0);else if(typeof C=="object")for(R in C)u.call(C,R)&&a.removeQuery(w,R,C[R]);else if(typeof C=="string")U!==void 0?c(U)==="RegExp"?!f(w[C])&&U.test(w[C])?w[C]=void 0:w[C]=d(w[C],U):w[C]===String(U)&&(!f(U)||U.length===1)?w[C]=void 0:f(w[C])&&(w[C]=d(w[C],U)):w[C]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(w,C,U,F){switch(c(C)){case"String":break;case"RegExp":for(var D in w)if(u.call(w,D)&&C.test(D)&&(U===void 0||a.hasQuery(w,D,U)))return!0;return!1;case"Object":for(var R in C)if(u.call(C,R)&&!a.hasQuery(w,R,C[R]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(U)){case"Undefined":return C in w;case"Boolean":var L=!!(f(w[C])?w[C].length:w[C]);return U===L;case"Function":return!!U(w[C],C,w);case"Array":if(!f(w[C]))return!1;var k=F?p:g;return k(w[C],U);case"RegExp":return f(w[C])?F?p(w[C],U):!1:!!(w[C]&&w[C].match(U));case"Number":U=String(U);case"String":return f(w[C])?F?p(w[C],U):!1:w[C]===U;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var w=[],C=[],U=0,F=0;F<arguments.length;F++){var D=new a(arguments[F]);w.push(D);for(var R=D.segment(),L=0;L<R.length;L++)typeof R[L]=="string"&&C.push(R[L]),R[L]&&U++}if(!C.length||!U)return new a("");var k=new a("").segment(C);return(w[0].path()===""||w[0].path().slice(0,1)==="/")&&k.path("/"+k.path()),k.normalize()},a.commonPath=function(w,C){var U=Math.min(w.length,C.length),F;for(F=0;F<U;F++)if(w.charAt(F)!==C.charAt(F)){F--;break}return F<1?w.charAt(0)===C.charAt(0)&&w.charAt(0)==="/"?"/":"":((w.charAt(F)!=="/"||C.charAt(F)!=="/")&&(F=w.substring(0,F).lastIndexOf("/")),w.substring(0,F+1))},a.withinString=function(w,C,U){U||(U={});var F=U.start||a.findUri.start,D=U.end||a.findUri.end,R=U.trim||a.findUri.trim,L=U.parens||a.findUri.parens,k=/[a-z0-9-]=["']?$/i;for(F.lastIndex=0;;){var Q=F.exec(w);if(!Q)break;var V=Q.index;if(U.ignoreHtml){var G=w.slice(Math.max(V-3,0),V);if(G&&k.test(G))continue}for(var $=V+w.slice(V).search(D),Y=w.slice(V,$),ie=-1;;){var re=L.exec(Y);if(!re)break;var le=re.index+re[0].length;ie=Math.max(ie,le)}if(ie>-1?Y=Y.slice(0,ie)+Y.slice(ie).replace(R,""):Y=Y.replace(R,""),!(Y.length<=Q[0].length)&&!(U.ignore&&U.ignore.test(Y))){$=V+Y.length;var ue=C(Y,V,$,w);if(ue===void 0){F.lastIndex=$;continue}ue=String(ue),w=w.slice(0,V)+ue+w.slice($),F.lastIndex=V+ue.length}}return F.lastIndex=0,w},a.ensureValidHostname=function(w,C){var U=!!w,F=!!C,D=!1;if(F&&(D=p(a.hostProtocols,C)),D&&!U)throw new TypeError("Hostname cannot be empty, if protocol is "+C);if(w&&w.match(a.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(n.toASCII(w).match(a.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},a.ensureValidPort=function(w){if(w){var C=Number(w);if(!(s(C)&&C>0&&C<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},a.noConflict=function(w){if(w){var C={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(C.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(C.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(C.SecondLevelDomains=o.SecondLevelDomains.noConflict()),C}else o.URI===this&&(o.URI=r);return this},l.build=function(w){return w===!0?this._deferred_build=!0:(w===void 0||this._deferred_build)&&(this._string=a.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new a(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function P(w){return function(C,U){return C===void 0?this._parts[w]||"":(this._parts[w]=C||null,this.build(!U),this)}}function I(w,C){return function(U,F){return U===void 0?this._parts[w]||"":(U!==null&&(U=U+"",U.charAt(0)===C&&(U=U.substring(1))),this._parts[w]=U,this.build(!F),this)}}l.protocol=P("protocol"),l.username=P("username"),l.password=P("password"),l.hostname=P("hostname"),l.port=P("port"),l.query=I("query","?"),l.fragment=I("fragment","#"),l.search=function(w,C){var U=this.query(w,C);return typeof U=="string"&&U.length?"?"+U:U},l.hash=function(w,C){var U=this.fragment(w,C);return typeof U=="string"&&U.length?"#"+U:U},l.pathname=function(w,C){if(w===void 0||w===!0){var U=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?a.decodeUrnPath:a.decodePath)(U):U}else return this._parts.urn?this._parts.path=w?a.recodeUrnPath(w):"":this._parts.path=w?a.recodePath(w):"/",this.build(!C),this},l.path=l.pathname,l.href=function(w,C){var U;if(w===void 0)return this.toString();this._string="",this._parts=a._parts();var F=w instanceof a,D=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var R=a.getDomAttribute(w);w=w[R]||"",D=!1}if(!F&&D&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=a.parse(String(w),this._parts);else if(F||D){var L=F?w._parts:w;for(U in L)U!=="query"&&u.call(this._parts,U)&&(this._parts[U]=L[U]);L.query&&this.query(L.query,!1)}else throw new TypeError("invalid input");return this.build(!C),this},l.is=function(w){var C=!1,U=!1,F=!1,D=!1,R=!1,L=!1,k=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,U=a.ip4_expression.test(this._parts.hostname),F=a.ip6_expression.test(this._parts.hostname),C=U||F,D=!C,R=D&&i&&i.has(this._parts.hostname),L=D&&a.idn_expression.test(this._parts.hostname),k=D&&a.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return D;case"sld":return R;case"ip":return C;case"ip4":case"ipv4":case"inet4":return U;case"ip6":case"ipv6":case"inet6":return F;case"idn":return L;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return k}return null};var O=l.protocol,M=l.port,S=l.hostname;l.protocol=function(w,C){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(a.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,w,C)},l.scheme=l.protocol,l.port=function(w,C){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),a.ensureValidPort(w))),M.call(this,w,C))},l.hostname=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var U={preventInvalidHostname:this._parts.preventInvalidHostname},F=a.parseHost(w,U);if(F!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=U.hostname,this._parts.preventInvalidHostname&&a.ensureValidHostname(w,this._parts.protocol)}return S.call(this,w,C)},l.origin=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var U=this.protocol(),F=this.authority();return F?(U?U+"://":"")+this.authority():""}else{var D=a(w);return this.protocol(D.protocol()).authority(D.authority()).build(!C),this}},l.host=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?a.buildHost(this._parts):"";var U=a.parseHost(w,this._parts);if(U!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!C),this},l.authority=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?a.buildAuthority(this._parts):"";var U=a.parseAuthority(w,this._parts);if(U!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!C),this},l.userinfo=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var U=a.buildUserinfo(this._parts);return U&&U.substring(0,U.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),a.parseUserinfo(w,this._parts),this.build(!C),this},l.resource=function(w,C){var U;return w===void 0?this.path()+this.search()+this.hash():(U=a.parse(w),this._parts.path=U.path,this._parts.query=U.query,this._parts.fragment=U.fragment,this.build(!C),this)},l.subdomain=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,U)||""}else{var F=this._parts.hostname.length-this.domain().length,D=this._parts.hostname.substring(0,F),R=new RegExp("^"+A(D));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&a.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(R,w),this.build(!C),this}},l.domain=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(C=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.match(/\./g);if(U&&U.length<2)return this._parts.hostname;var F=this._parts.hostname.length-this.tld(C).length-1;return F=this._parts.hostname.lastIndexOf(".",F-1)+1,this._parts.hostname.substring(F)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(a.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var D=new RegExp(A(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(D,w)}return this.build(!C),this}},l.tld=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(C=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.lastIndexOf("."),F=this._parts.hostname.substring(U+1);return C!==!0&&i&&i.list[F.toLowerCase()]&&i.get(this._parts.hostname)||F}else{var D;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(i&&i.is(w))D=new RegExp(A(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(D,w);else throw new TypeError('TLD "'+w+'" 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");D=new RegExp(A(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(D,w)}else throw new TypeError("cannot set TLD empty");return this.build(!C),this}},l.directory=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var U=this._parts.path.length-this.filename().length-1,F=this._parts.path.substring(0,U)||(this._parts.hostname?"/":"");return w?a.decodePath(F):F}else{var D=this._parts.path.length-this.filename().length,R=this._parts.path.substring(0,D),L=new RegExp("^"+A(R));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=a.recodePath(w),this._parts.path=this._parts.path.replace(L,w),this.build(!C),this}},l.filename=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var U=this._parts.path.lastIndexOf("/"),F=this._parts.path.substring(U+1);return w?a.decodePathSegment(F):F}else{var D=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(D=!0);var R=new RegExp(A(this.filename())+"$");return w=a.recodePath(w),this._parts.path=this._parts.path.replace(R,w),D?this.normalizePath(C):this.build(!C),this}},l.suffix=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var U=this.filename(),F=U.lastIndexOf("."),D,R;return F===-1?"":(D=U.substring(F+1),R=/^[a-z0-9%]+$/i.test(D)?D:"",w?a.decodePathSegment(R):R)}else{w.charAt(0)==="."&&(w=w.substring(1));var L=this.suffix(),k;if(L)w?k=new RegExp(A(L)+"$"):k=new RegExp(A("."+L)+"$");else{if(!w)return this;this._parts.path+="."+a.recodePath(w)}return k&&(w=a.recodePath(w),this._parts.path=this._parts.path.replace(k,w)),this.build(!C),this}},l.segment=function(w,C,U){var F=this._parts.urn?":":"/",D=this.path(),R=D.substring(0,1)==="/",L=D.split(F);if(w!==void 0&&typeof w!="number"&&(U=C,C=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(R&&L.shift(),w<0&&(w=Math.max(L.length+w,0)),C===void 0)return w===void 0?L:L[w];if(w===null||L[w]===void 0)if(f(C)){L=[];for(var k=0,Q=C.length;k<Q;k++)!C[k].length&&(!L.length||!L[L.length-1].length)||(L.length&&!L[L.length-1].length&&L.pop(),L.push(v(C[k])))}else(C||typeof C=="string")&&(C=v(C),L[L.length-1]===""?L[L.length-1]=C:L.push(C));else C?L[w]=v(C):L.splice(w,1);return R&&L.unshift(""),this.path(L.join(F),U)},l.segmentCoded=function(w,C,U){var F,D,R;if(typeof w!="number"&&(U=C,C=w,w=void 0),C===void 0){if(F=this.segment(w,C,U),!f(F))F=F!==void 0?a.decode(F):void 0;else for(D=0,R=F.length;D<R;D++)F[D]=a.decode(F[D]);return F}if(!f(C))C=typeof C=="string"||C instanceof String?a.encode(C):C;else for(D=0,R=C.length;D<R;D++)C[D]=a.encode(C[D]);return this.segment(w,C,U)};var T=l.query;return l.query=function(w,C){if(w===!0)return a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="function"){var U=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace),F=w.call(this,U);return this._parts.query=a.buildQuery(F||U,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!C),this}else return w!==void 0&&typeof w!="string"?(this._parts.query=a.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!C),this):T.call(this,w,C)},l.setQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="string"||w instanceof String)F[w]=C!==void 0?C:null;else if(typeof w=="object")for(var D in w)u.call(w,D)&&(F[D]=w[D]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.addQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(F,w,C===void 0?null:C),this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.removeQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(F,w,C),this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.hasQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(F,w,C,U)},l.setSearch=l.setQuery,l.addSearch=l.addQuery,l.removeSearch=l.removeQuery,l.hasSearch=l.hasQuery,l.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()},l.normalizeProtocol=function(w){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!w)),this},l.normalizeHostname=function(w){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.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(!w)),this},l.normalizePort=function(w){return typeof this._parts.protocol=="string"&&this._parts.port===a.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!w)),this},l.normalizePath=function(w){var C=this._parts.path;if(!C)return this;if(this._parts.urn)return this._parts.path=a.recodeUrnPath(this._parts.path),this.build(!w),this;if(this._parts.path==="/")return this;C=a.recodePath(C);var U,F="",D,R;for(C.charAt(0)!=="/"&&(U=!0,C="/"+C),(C.slice(-3)==="/.."||C.slice(-2)==="/.")&&(C+="/"),C=C.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),U&&(F=C.substring(1).match(/^(\.\.\/)+/)||"",F&&(F=F[0]));D=C.search(/\/\.\.(\/|$)/),D!==-1;){if(D===0){C=C.substring(3);continue}R=C.substring(0,D).lastIndexOf("/"),R===-1&&(R=D),C=C.substring(0,R)+C.substring(D+3)}return U&&this.is("relative")&&(C=F+C.substring(1)),this._parts.path=C,this.build(!w),this},l.normalizePathname=l.normalizePath,l.normalizeQuery=function(w){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(a.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!w)),this},l.normalizeFragment=function(w){return this._parts.fragment||(this._parts.fragment=null,this.build(!w)),this},l.normalizeSearch=l.normalizeQuery,l.normalizeHash=l.normalizeFragment,l.iso8859=function(){var w=a.encode,C=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=w,a.decode=C}return this},l.unicode=function(){var w=a.encode,C=a.decode;a.encode=m,a.decode=unescape;try{this.normalize()}finally{a.encode=w,a.decode=C}return this},l.readable=function(){var w=this.clone();w.username("").password("").normalize();var C="";if(w._parts.protocol&&(C+=w._parts.protocol+"://"),w._parts.hostname&&(w.is("punycode")&&n?(C+=n.toUnicode(w._parts.hostname),w._parts.port&&(C+=":"+w._parts.port)):C+=w.host()),w._parts.hostname&&w._parts.path&&w._parts.path.charAt(0)!=="/"&&(C+="/"),C+=w.path(!0),w._parts.query){for(var U="",F=0,D=w._parts.query.split("&"),R=D.length;F<R;F++){var L=(D[F]||"").split("=");U+="&"+a.decodeQuery(L[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),L[1]!==void 0&&(U+="="+a.decodeQuery(L[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}C+="?"+U.substring(1)}return C+=a.decodeQuery(w.hash(),!0),C},l.absoluteTo=function(w){var C=this.clone(),U=["protocol","username","password","hostname","port"],F,D,R;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w instanceof a||(w=new a(w)),C._parts.protocol||(C._parts.protocol=w._parts.protocol,this._parts.hostname))return C;for(D=0;R=U[D];D++)C._parts[R]=w._parts[R];return C._parts.path?(C._parts.path.substring(-2)===".."&&(C._parts.path+="/"),C.path().charAt(0)!=="/"&&(F=w.directory(),F=F||(w.path().indexOf("/")===0?"/":""),C._parts.path=(F?F+"/":"")+C._parts.path,C.normalizePath())):(C._parts.path=w._parts.path,C._parts.query||(C._parts.query=w._parts.query)),C.build(),C},l.relativeTo=function(w){var C=this.clone().normalize(),U,F,D,R,L;if(C._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w=new a(w).normalize(),U=C._parts,F=w._parts,R=C.path(),L=w.path(),R.charAt(0)!=="/")throw new Error("URI is already relative");if(L.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(U.protocol===F.protocol&&(U.protocol=null),U.username!==F.username||U.password!==F.password||U.protocol!==null||U.username!==null||U.password!==null)return C.build();if(U.hostname===F.hostname&&U.port===F.port)U.hostname=null,U.port=null;else return C.build();if(R===L)return U.path="",C.build();if(D=a.commonPath(R,L),!D)return C.build();var k=F.path.substring(D.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return U.path=k+U.path.substring(D.length)||"./",C.build()},l.equals=function(w){var C=this.clone(),U=new a(w),F={},D={},R={},L,k,Q;if(C.normalize(),U.normalize(),C.toString()===U.toString())return!0;if(L=C.query(),k=U.query(),C.query(""),U.query(""),C.toString()!==U.toString()||L.length!==k.length)return!1;F=a.parseQuery(L,this._parts.escapeQuerySpace),D=a.parseQuery(k,this._parts.escapeQuerySpace);for(Q in F)if(u.call(F,Q)){if(f(F[Q])){if(!g(F[Q],D[Q]))return!1}else if(F[Q]!==D[Q])return!1;R[Q]=!0}for(Q in D)if(u.call(D,Q)&&!R[Q])return!1;return!0},l.preventInvalidHostname=function(w){return this._parts.preventInvalidHostname=!!w,this},l.duplicateQueryParameters=function(w){return this._parts.duplicateQueryParameters=!!w,this},l.escapeQuerySpace=function(w){return this._parts.escapeQuerySpace=!!w,this},a})})(wA)),wA.exports}var i4=n4();const Wi=Al(i4);function r4(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function Ls(t,n){if(t===null||typeof t!="object")return t;n=n??!1;const e=new t.constructor;for(const i in t)if(t.hasOwnProperty(i)){let o=t[i];n&&(o=Ls(o,n)),e[i]=o}return e}function Or(t,n,e){e=e??!1;const i={},o=ne(t),r=ne(n);let a,s,l;if(o)for(a in t)t.hasOwnProperty(a)&&(s=t[a],r&&e&&typeof s=="object"&&n.hasOwnProperty(a)?(l=n[a],typeof l=="object"?i[a]=Or(s,l,e):i[a]=s):i[a]=s);if(r)for(a in n)n.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(l=n[a],i[a]=l);return i}function gl(){let t,n;const e=new Promise(function(i,o){t=i,n=o});return{resolve:t,reject:n,promise:e}}function yl(t,n){let e;return typeof document<"u"&&(e=document),yl._implementation(t,n,e)}yl._implementation=function(t,n,e){if(!ne(t))throw new pe("relative uri is required.");if(!ne(n)){if(typeof e>"u")return t;n=e.baseURI??e.location.href}const i=new Wi(t);return i.scheme()!==""?i.toString():i.absoluteTo(n).toString()};function o4(t,n){if(!ne(t))throw new pe("uri is required.");let e="";const i=t.lastIndexOf("/");return i!==-1&&(e=t.substring(0,i+1)),n&&(t=new Wi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function s4(t){if(!ne(t))throw new pe("uri is required.");const n=new Wi(t);n.normalize();let e=n.path(),i=e.lastIndexOf("/");return i!==-1&&(e=e.substr(i+1)),i=e.lastIndexOf("."),i===-1?e="":e=e.substr(i+1),e}const Ib={};function Fb(t,n,e){ne(n)||(n=t.width),ne(e)||(e=t.height);let i=Ib[n];ne(i)||(i={},Ib[n]=i);let o=i[e];if(!ne(o)){const r=document.createElement("canvas");r.width=n,r.height=e,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[e]=o}return o.drawImage(t,0,0,n,e),o.getImageData(0,0,n,e).data}const a4=/^blob:/i;function Mb(t){return N.typeOf.string("uri",t),a4.test(t)}let yi;function Td(t){ne(yi)||(yi=document.createElement("a")),yi.href=window.location.href;const n=yi.host,e=yi.protocol;return yi.href=t,yi.href=yi.href,e!==yi.protocol||n!==yi.host}const l4=/^data:/i;function Db(t){return N.typeOf.string("uri",t),l4.test(t)}function u4(t){const n=document.createElement("script");return n.async=!0,n.src=t,new Promise((e,i)=>{window.crossOriginIsolated&&n.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];n.onload=function(){n.onload=void 0,o.removeChild(n),e()},n.onerror=function(r){i(r)},o.appendChild(n)})}function c4(t){if(!ne(t))throw new pe("obj is required.");let n="";for(const e in t)if(t.hasOwnProperty(e)){const i=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(i))for(let r=0,a=i.length;r<a;++r)n+=`${o+encodeURIComponent(i[r])}&`;else n+=`${o+encodeURIComponent(i)}&`}return n=n.slice(0,-1),n}function h4(t){if(!ne(t))throw new pe("queryString is required.");const n={};if(t==="")return n;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=e.length;i<o;++i){const r=e[i].split("="),a=decodeURIComponent(r[0]);let s=r[1];ne(s)?s=decodeURIComponent(s):s="";const l=n[a];typeof l=="string"?n[a]=[l,s]:Array.isArray(l)?l.push(s):n[a]=s}return n}const vt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),A4=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function _A(t){t=t??gi.EMPTY_OBJECT;const n=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=n,this.type=t.type??A4.OTHER,this.serverKey=t.serverKey,this.state=vt.UNISSUED,this.deferred=void 0,this.cancelled=!1}_A.prototype.cancel=function(){this.cancelled=!0},_A.prototype.clone=function(t){return ne(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=vt.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new _A(this)};function f4(t){const n={};if(!t)return n;const e=t.split(`\r
383
- `);for(let i=0;i<e.length;++i){const o=e[i],r=o.indexOf(": ");if(r>0){const a=o.substring(0,r),s=o.substring(r+2);n[a]=s}}return n}function vl(t,n,e){this.statusCode=t,this.response=n,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=f4(this.responseHeaders))}vl.prototype.toString=function(){let t="Request has failed.";return ne(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function zs(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(zs.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),zs.prototype.addEventListener=function(t,n){N.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(n);const e=this;return function(){e.removeEventListener(t,n)}},zs.prototype.removeEventListener=function(t,n){N.typeOf.func("listener",t);const e=this._listeners,i=this._scopes;let o=-1;for(let r=0;r<e.length;r++)if(e[r]===t&&i[r]===n){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,i[o]=void 0):(e.splice(o,1),i.splice(o,1)),!0):!1};function p4(t,n){return n-t}zs.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const n=this._listeners,e=this._scopes;let i=n.length;for(t=0;t<i;t++){const r=n[t];ne(r)&&n[t].apply(e[t],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(p4),t=0;t<i;t++){const r=o[t];n.splice(r,1),e.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};function Bo(t){N.typeOf.object("options",t),N.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Bo.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){N.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const n=this._length;if(t<n){const e=this._array;for(let i=t;i<n;++i)e[i]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Id(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}Bo.prototype.reserve=function(t){t=t??this._length,this._array.length=t},Bo.prototype.heapify=function(t){t=t??0;const n=this._length,e=this._comparator,i=this._array;let o=-1,r=!0;for(;r;){const a=2*(t+1),s=a-1;s<n&&e(i[s],i[t])<0?o=s:o=t,a<n&&e(i[a],i[o])<0&&(o=a),o!==t?(Id(i,o,t),t=o):r=!1}},Bo.prototype.resort=function(){const t=this._length;for(let n=Math.ceil(t/2);n>=0;--n)this.heapify(n)},Bo.prototype.insert=function(t){N.defined("element",t);const n=this._array,e=this._comparator,i=this._maximumLength;let o=this._length++;for(o<n.length?n[o]=t:n.push(t);o!==0;){const a=Math.floor((o-1)/2);if(e(n[o],n[a])<0)Id(n,o,a),o=a;else break}let r;return ne(i)&&this._length>i&&(r=n[i],this._length=i),r},Bo.prototype.pop=function(t){if(t=t??0,this._length===0)return;N.typeOf.number.lessThan("index",t,this._length);const n=this._array,e=n[t];return Id(n,t,--this._length),this.heapify(t),n[this._length]=void 0,e};function d4(t,n){return t.priority-n.priority}const qe={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ks=20;const Yt=new Bo({comparator:d4});Yt.maximumLength=ks,Yt.reserve(ks);const vi=[];let ji={};const m4=typeof document<"u"?new Wi(document.location.href):new Wi,CA=new zs;function it(){}it.maximumRequests=50,it.maximumRequestsPerServer=18,it.requestsByServer={},it.throttleRequests=!0,it.debugShowStatistics=!1,it.requestCompletedEvent=CA,Object.defineProperties(it,{statistics:{get:function(){return qe}},priorityHeapLength:{get:function(){return ks},set:function(t){if(t<ks)for(;Yt.length>t;){const n=Yt.pop();To(n)}ks=t,Yt.maximumLength=t,Yt.reserve(t)}}});function Rb(t){ne(t.priorityFunction)&&(t.priority=t.priorityFunction())}it.serverHasOpenSlots=function(t,n){n=n??1;const e=it.requestsByServer[t]??it.maximumRequestsPerServer;return ji[t]+n<=e},it.heapHasOpenSlots=function(t){return Yt.length+t<=ks};function Ub(t){return t.state===vt.UNISSUED&&(t.state=vt.ISSUED,t.deferred=gl()),t.deferred.promise}function g4(t){return function(n){if(t.state===vt.CANCELLED)return;const e=t.deferred;--qe.numberOfActiveRequests,--ji[t.serverKey],CA.raiseEvent(),t.state=vt.RECEIVED,t.deferred=void 0,e.resolve(n)}}function y4(t){return function(n){t.state!==vt.CANCELLED&&(++qe.numberOfFailedRequests,--qe.numberOfActiveRequests,--ji[t.serverKey],CA.raiseEvent(n),t.state=vt.FAILED,t.deferred.reject(n))}}function Ob(t){const n=Ub(t);return t.state=vt.ACTIVE,vi.push(t),++qe.numberOfActiveRequests,++qe.numberOfActiveRequestsEver,++ji[t.serverKey],t.requestFunction().then(g4(t)).catch(y4(t)),n}function To(t){const n=t.state===vt.ACTIVE;if(t.state=vt.CANCELLED,++qe.numberOfCancelledRequests,ne(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}n&&(--qe.numberOfActiveRequests,--ji[t.serverKey],++qe.numberOfCancelledActiveRequests),ne(t.cancelFunction)&&t.cancelFunction()}it.update=function(){let t,n,e=0;const i=vi.length;for(t=0;t<i;++t){if(n=vi[t],n.cancelled&&To(n),n.state!==vt.ACTIVE){++e;continue}e>0&&(vi[t-e]=n)}vi.length-=e;const o=Yt.internalArray,r=Yt.length;for(t=0;t<r;++t)Rb(o[t]);Yt.resort();const a=Math.max(it.maximumRequests-vi.length,0);let s=0;for(;s<a&&Yt.length>0;){if(n=Yt.pop(),n.cancelled){To(n);continue}if(n.throttleByServer&&!it.serverHasOpenSlots(n.serverKey)){To(n);continue}Ob(n),++s}v4()},it.getServerKey=function(t){N.typeOf.string("url",t);let n=new Wi(t);n.scheme()===""&&(n=n.absoluteTo(m4),n.normalize());let e=n.authority();/:/.test(e)||(e=`${e}:${n.scheme()==="https"?"443":"80"}`);const i=ji[e];return ne(i)||(ji[e]=0),e},it.request=function(t){if(N.typeOf.object("request",t),N.typeOf.string("request.url",t.url),N.typeOf.func("request.requestFunction",t.requestFunction),Db(t.url)||Mb(t.url))return CA.raiseEvent(),t.state=vt.RECEIVED,t.requestFunction();if(++qe.numberOfAttemptedRequests,ne(t.serverKey)||(t.serverKey=it.getServerKey(t.url)),it.throttleRequests&&t.throttleByServer&&!it.serverHasOpenSlots(t.serverKey))return;if(!it.throttleRequests||!t.throttle)return Ob(t);if(vi.length>=it.maximumRequests)return;Rb(t);const n=Yt.insert(t);if(ne(n)){if(n===t)return;To(n)}return Ub(t)};function v4(){it.debugShowStatistics&&(qe.numberOfActiveRequests===0&&qe.lastNumberOfActiveRequests>0&&(qe.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${qe.numberOfAttemptedRequests}`),qe.numberOfAttemptedRequests=0),qe.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${qe.numberOfCancelledRequests}`),qe.numberOfCancelledRequests=0),qe.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${qe.numberOfCancelledActiveRequests}`),qe.numberOfCancelledActiveRequests=0),qe.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${qe.numberOfFailedRequests}`),qe.numberOfFailedRequests=0)),qe.lastNumberOfActiveRequests=qe.numberOfActiveRequests)}it.clearForSpecs=function(){for(;Yt.length>0;){const n=Yt.pop();To(n)}const t=vi.length;for(let n=0;n<t;++n)To(vi[n]);vi.length=0,ji={},qe.numberOfAttemptedRequests=0,qe.numberOfActiveRequests=0,qe.numberOfCancelledRequests=0,qe.numberOfCancelledActiveRequests=0,qe.numberOfFailedRequests=0,qe.numberOfActiveRequestsEver=0,qe.lastNumberOfActiveRequests=0},it.numberOfActiveRequestsByServer=function(t){return ji[t]},it.requestHeap=Yt;const Qs={};let Vs={};Qs.add=function(t,n){if(!ne(t))throw new pe("host is required.");if(!ne(n)||n<=0)throw new pe("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${n}`;ne(Vs[e])||(Vs[e]=!0)},Qs.remove=function(t,n){if(!ne(t))throw new pe("host is required.");if(!ne(n)||n<=0)throw new pe("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${n}`;ne(Vs[e])&&delete Vs[e]};function w4(t){const n=new Wi(t);n.normalize();let e=n.authority();if(e.length!==0){if(n.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let i=n.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")e+=":80";else if(i==="https")e+=":443";else return}return e}}Qs.contains=function(t){if(!ne(t))throw new pe("url is required.");const n=w4(t);return!!(ne(n)&&ne(Vs[n]))},Qs.clear=function(){Vs={}};const Lb=(function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}})();function xe(t){t=t??gi.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),N.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=wi(t.templateValues,{}),this._queryParameters=wi(t.queryParameters,{}),this.headers=wi(t.headers,{}),this.request=t.request??new _A,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 wi(t,n){return ne(t)?Ls(t):n}xe.createIfNeeded=function(t){return t instanceof xe?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new xe({url:t})};let Ns;xe.supportsImageBitmapOptions=function(){return ne(Ns)?Ns:typeof createImageBitmap!="function"?(Ns=Promise.resolve(!1),Ns):(Ns=xe.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(n){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(n,e),createImageBitmap(n)])}).then(function(n){const e=Fb(n[0]),i=Fb(n[1]);return e[1]!==i[1]}).catch(function(){return!1}),Ns)},Object.defineProperties(xe,{isBlobSupported:{get:function(){return Lb}}}),Object.defineProperties(xe.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 s4(this._url)}},isDataUri:{get:function(){return Db(this._url)}},isBlobUri:{get:function(){return Mb(this._url)}},isCrossOriginUrl:{get:function(){return Td(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),xe.prototype.toString=function(){return this.getUrlComponent(!0,!0)},xe.prototype.parseUrl=function(t,n,e,i){let o=new Wi(t);const r=b4(o.query());this._queryParameters=n?SA(r,this.queryParameters,e):r,o.search(""),o.fragment(""),ne(i)&&o.scheme()===""&&(o=o.absoluteTo(yl(i))),this._url=o.toString()};function b4(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:h4(t)}function SA(t,n,e){if(!e)return Or(t,n);const i=Ls(t,!0);for(const o in n)if(n.hasOwnProperty(o)){let r=i[o];const a=n[o];ne(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}xe.prototype.getUrlComponent=function(t,n){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${x4(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(e=e.replace(/{(.*?)}/g,function(o,r){const a=i[r];return ne(a)?encodeURIComponent(a):o})),n&&ne(this.proxy)&&(e=this.proxy.getURL(e)),e};function x4(t){const n=Object.keys(t);return n.length===0?"":n.length===1&&!ne(t[n[0]])?`?${n[0]}`:`?${c4(t)}`}xe.prototype.setQueryParameters=function(t,n){n?this._queryParameters=SA(this._queryParameters,t,!1):this._queryParameters=SA(t,this._queryParameters,!1)},xe.prototype.appendQueryParameters=function(t){this._queryParameters=SA(t,this._queryParameters,!0)},xe.prototype.setTemplateValues=function(t,n){n?this._templateValues=Or(this._templateValues,t):this._templateValues=Or(t,this._templateValues)},xe.prototype.getDerivedResource=function(t){const n=this.clone();if(n._retryCount=0,ne(t.url)){const e=t.preserveQueryParameters??!1;n.parseUrl(t.url,!0,e,this._url)}return ne(t.queryParameters)&&(n._queryParameters=Or(t.queryParameters,n.queryParameters)),ne(t.templateValues)&&(n._templateValues=Or(t.templateValues,n.templateValues)),ne(t.headers)&&(n.headers=Or(t.headers,n.headers)),ne(t.proxy)&&(n.proxy=t.proxy),ne(t.request)&&(n.request=t.request),ne(t.retryCallback)&&(n.retryCallback=t.retryCallback),ne(t.retryAttempts)&&(n.retryAttempts=t.retryAttempts),n},xe.prototype.retryOnError=function(t){const n=this.retryCallback;if(typeof n!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(n(this,t)).then(function(i){return++e._retryCount,i})},xe.prototype.clone=function(t){return ne(t)?(t._url=this._url,t._queryParameters=Ls(this._queryParameters),t._templateValues=Ls(this._templateValues),t.headers=Ls(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new xe({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:ne(this.credits)?this.credits.slice():void 0})},xe.prototype.getBaseUri=function(t){return o4(this.getUrlComponent(t),t)},xe.prototype.appendForwardSlash=function(){this._url=r4(this._url)},xe.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},xe.fetchArrayBuffer=function(t){return new xe(t).fetchArrayBuffer()},xe.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},xe.fetchBlob=function(t){return new xe(t).fetchBlob()},xe.prototype.fetchImage=function(t){t=t??gi.EMPTY_OBJECT;const n=t.preferImageBitmap??!1,e=t.preferBlob??!1,i=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(Md(this.request),!Lb||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return Fd({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:n});const r=this.fetchBlob();if(!ne(r))return;let a,s,l,u;return xe.supportsImageBitmapOptions().then(function(A){return a=A,s=a&&n,r}).then(function(A){if(!ne(A))return;if(u=A,s)return xe.createImageBitmapFromBlob(A,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const c=window.URL.createObjectURL(A);return l=new xe({url:c}),Fd({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(A){if(ne(A))return A.blob=u,s||window.URL.revokeObjectURL(l.url),A}).catch(function(A){return ne(l)&&window.URL.revokeObjectURL(l.url),A.blob=u,Promise.reject(A)})};function Fd(t){const n=t.resource,e=t.flipY,i=t.skipColorSpaceConversion,o=t.preferImageBitmap,r=n.request;r.url=n.url,r.requestFunction=function(){let s=!1;!n.isDataUri&&!n.isBlobUri&&(s=n.isCrossOriginUrl);const l=gl();return xe._Implementations.createImage(r,s,l,e,i,o),l.promise};const a=it.request(r);if(ne(a))return a.catch(function(s){return r.state!==vt.FAILED?Promise.reject(s):n.retryOnError(s).then(function(l){return l?(r.state=vt.UNISSUED,r.deferred=void 0,Fd({resource:n,flipY:e,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(s)})})}xe.fetchImage=function(t){return new xe(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},xe.prototype.fetchText=function(){return this.fetch({responseType:"text"})},xe.fetchText=function(t){return new xe(t).fetchText()},xe.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(ne(t))return t.then(function(n){if(ne(n))return JSON.parse(n)})},xe.fetchJson=function(t){return new xe(t).fetchJson()},xe.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},xe.fetchXML=function(t){return new xe(t).fetchXML()},xe.prototype.fetchJsonp=function(t){t=t??"callback",Md(this.request);let n;do n=`loadJsonp${he.nextRandomNumber().toString().substring(2,8)}`;while(ne(window[n]));return zb(this,t,n)};function zb(t,n,e){const i={};i[n]=e,t.setQueryParameters(i);const o=t.request,r=t.url;o.url=r,o.requestFunction=function(){const s=gl();return window[e]=function(l){s.resolve(l);try{delete window[e]}catch{window[e]=void 0}},xe._Implementations.loadAndExecuteScript(r,e,s),s.promise};const a=it.request(o);if(ne(a))return a.catch(function(s){return o.state!==vt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(l){return l?(o.state=vt.UNISSUED,o.deferred=void 0,zb(t,n,e)):Promise.reject(s)})})}xe.fetchJsonp=function(t){return new xe(t).fetchJsonp(t.callbackParameterName)},xe.prototype._makeRequest=function(t){const n=this;Md(n.request);const e=n.request,i=n.url;e.url=i,e.requestFunction=function(){const r=t.responseType,a=Or(t.headers,n.headers),s=t.overrideMimeType,l=t.method,u=t.data,A=gl(),c=xe._Implementations.loadWithXhr(i,r,l,u,a,A,s);return ne(c)&&ne(c.abort)&&(e.cancelFunction=function(){c.abort()}),A.promise};const o=it.request(e);if(ne(o))return o.then(function(r){return e.cancelFunction=void 0,r}).catch(function(r){return e.cancelFunction=void 0,e.state!==vt.FAILED?Promise.reject(r):n.retryOnError(r).then(function(a){return a?(e.state=vt.UNISSUED,e.deferred=void 0,n.fetch(t)):Promise.reject(r)})})};function Md(t){if(t.state===vt.ISSUED||t.state===vt.ACTIVE)throw new Nt("The Resource is already being fetched.");t.state=vt.UNISSUED,t.deferred=void 0}const _4=/^data:(.*?)(;base64)?,(.*)$/;function EA(t,n){const e=decodeURIComponent(n);return t?atob(e):e}function kb(t,n){const e=EA(t,n),i=new ArrayBuffer(e.length),o=new Uint8Array(i);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);return i}function C4(t,n){n=n??"";const e=t[1],i=!!t[2],o=t[3];let r,a;switch(n){case"":case"text":return EA(i,o);case"arraybuffer":return kb(i,o);case"blob":return r=kb(i,o),new Blob([r],{type:e});case"document":return a=new DOMParser,a.parseFromString(EA(i,o),e);case"json":return JSON.parse(EA(i,o));default:throw new pe(`Unhandled responseType: ${n}`)}}xe.prototype.fetch=function(t){return t=wi(t,{}),t.method="GET",this._makeRequest(t)},xe.fetch=function(t){return new xe(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.delete=function(t){return t=wi(t,{}),t.method="DELETE",this._makeRequest(t)},xe.delete=function(t){return new xe(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},xe.prototype.head=function(t){return t=wi(t,{}),t.method="HEAD",this._makeRequest(t)},xe.head=function(t){return new xe(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.options=function(t){return t=wi(t,{}),t.method="OPTIONS",this._makeRequest(t)},xe.options=function(t){return new xe(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.post=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="POST",n.data=t,this._makeRequest(n)},xe.post=function(t){return new xe(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.put=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="PUT",n.data=t,this._makeRequest(n)},xe.put=function(t){return new xe(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.patch=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="PATCH",n.data=t,this._makeRequest(n)},xe.patch=function(t){return new xe(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe._Implementations={},xe._Implementations.loadImageElement=function(t,n,e){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),e.resolve(i)},i.onerror=function(o){e.reject(o)},n&&(Qs.contains(t)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=t},xe._Implementations.createImage=function(t,n,e,i,o,r){const a=t.url;xe.supportsImageBitmapOptions().then(function(s){if(!(s&&r)){xe._Implementations.loadImageElement(a,n,e);return}const l="blob",u="GET",A=gl(),c=xe._Implementations.loadWithXhr(a,l,u,void 0,void 0,A,void 0,void 0,void 0);return ne(c)&&ne(c.abort)&&(t.cancelFunction=function(){c.abort()}),A.promise.then(function(f){if(!ne(f)){e.reject(new Nt(`Successfully retrieved ${a} but it contained no content.`));return}return xe.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(s){e.reject(s)})},xe.createImageBitmapFromBlob=function(t,n){return N.defined("options",n),N.typeOf.bool("options.flipY",n.flipY),N.typeOf.bool("options.premultiplyAlpha",n.premultiplyAlpha),N.typeOf.bool("options.skipColorSpaceConversion",n.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:n.flipY?"flipY":"from-image",premultiplyAlpha:n.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:n.skipColorSpaceConversion?"none":"default"})};function S4(t,n,e,i,o,r,a){fetch(t,{method:e,headers:o}).then(async s=>{if(!s.ok){const l={};s.headers.forEach((u,A)=>{l[A]=u}),r.reject(new vl(s.status,s,l));return}switch(n){case"text":r.resolve(s.text());break;case"json":r.resolve(s.json());break;default:r.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new vl)})}const E4=typeof XMLHttpRequest>"u";xe._Implementations.loadWithXhr=function(t,n,e,i,o,r,a){const s=_4.exec(t);if(s!==null){r.resolve(C4(s,n));return}if(E4){S4(t,n,e,i,o,r);return}const l=new XMLHttpRequest;if(Qs.contains(t)&&(l.withCredentials=!0),l.open(e,t,!0),ne(a)&&ne(l.overrideMimeType)&&l.overrideMimeType(a),ne(o))for(const A in o)o.hasOwnProperty(A)&&l.setRequestHeader(A,o[A]);ne(n)&&(l.responseType=n);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new vl(l.status,l.response,l.getAllResponseHeaders()));return}const A=l.response,c=l.responseType;if(e==="HEAD"||e==="OPTIONS"){const d=l.getAllResponseHeaders().trim().split(/[\r\n]+/),p={};d.forEach(function(g){const v=g.split(": "),y=v.shift();p[y]=v.join(": ")}),r.resolve(p);return}if(l.status===204)r.resolve(void 0);else if(ne(A)&&(!ne(n)||c===n))r.resolve(A);else if(n==="json"&&typeof A=="string")try{r.resolve(JSON.parse(A))}catch(f){r.reject(f)}else(c===""||c==="document")&&ne(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(c===""||c==="text")&&ne(l.responseText)?r.resolve(l.responseText):r.reject(new Nt("Invalid XMLHttpRequest response type."))},l.onerror=function(A){r.reject(new vl)},l.send(i),l},xe._Implementations.loadAndExecuteScript=function(t,n,e){return u4(t).catch(function(i){e.reject(i)})},xe._DefaultImplementations={},xe._DefaultImplementations.createImage=xe._Implementations.createImage,xe._DefaultImplementations.loadWithXhr=xe._Implementations.loadWithXhr,xe._DefaultImplementations.loadAndExecuteScript=xe._Implementations.loadAndExecuteScript,xe.DEFAULT=Object.freeze(new xe({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function wl(t){t=t??gi.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,ne(t.data)?Qb(this,t.data):Qb(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}wl.fromUrl=async function(t,n){N.defined("url",t),n=n??gi.EMPTY_OBJECT;const e=xe.createIfNeeded(t);let i;try{i=await e.fetchJson()}catch{throw new Nt(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new wl({addNewLeapSeconds:n.addNewLeapSeconds,data:i})},wl.NONE=Object.freeze({compute:function(t,n){return ne(n)?(n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0):n=new _d(0,0,0,0,0),n}}),wl.prototype.compute=function(t,n){if(!ne(this._samples))return;if(ne(n)||(n=new _d(0,0,0,0,0)),this._samples.length===0)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;const e=this._dates,i=this._lastIndex;let o=0,r=0;if(ne(i)){const s=e[i],l=e[i+1],u=we.lessThanOrEquals(s,t),A=!ne(l),c=A||we.greaterThanOrEquals(l,t);if(u&&c)return o=i,!A&&l.equals(t)&&++o,r=o+1,Nb(this,e,this._samples,t,o,r,n),n}let a=dl(e,t,we.compare,this._dateColumn);return a>=0?(a<e.length-1&&e[a+1].equals(t)&&++a,o=a,r=a):(r=~a,o=r-1,o<0&&(o=0)),this._lastIndex=o,Nb(this,e,this._samples,t,o,r,n),n};function P4(t,n){return we.compare(t.julianDate,n)}function Qb(t,n){if(!ne(n.columnNames))throw new Nt("Error in loaded EOP data: The columnNames property is required.");if(!ne(n.samples))throw new Nt("Error in loaded EOP data: The samples property is required.");const e=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),o=n.columnNames.indexOf("yPoleWanderRadians"),r=n.columnNames.indexOf("ut1MinusUtcSeconds"),a=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=n.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||i<0||o<0||r<0||a<0||s<0||l<0)throw new Nt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=n.samples,A=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=i,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=r,t._xCelestialPoleOffsetRadiansColumn=a,t._yCelestialPoleOffsetRadiansColumn=s,t._taiMinusUtcSecondsColumn=l,t._columnCount=n.columnNames.length,t._lastIndex=void 0;let c;const f=t._addNewLeapSeconds;for(let d=0,p=u.length;d<p;d+=t._columnCount){const g=u[d+e],v=u[d+l],y=g+pt.MODIFIED_JULIAN_DATE_DIFFERENCE,m=new we(y,v,Ve.TAI);if(A.push(m),f){if(v!==c&&ne(c)){const b=we.leapSeconds,x=dl(b,m,P4);if(x<0){const E=new Ye(m,v);b.splice(~x,0,E)}}c=v}}}function Vb(t,n,e,i,o){const r=e*i;o.xPoleWander=n[r+t._xPoleWanderRadiansColumn],o.yPoleWander=n[r+t._yPoleWanderRadiansColumn],o.xPoleOffset=n[r+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=n[r+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=n[r+t._ut1MinusUtcSecondsColumn]}function bl(t,n,e){return n+t*(e-n)}function Nb(t,n,e,i,o,r,a){const s=t._columnCount;if(r>n.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;const l=n[o],u=n[r];if(l.equals(u)||i.equals(l))return Vb(t,e,o,s,a),a;if(i.equals(u))return Vb(t,e,r,s,a),a;const A=we.secondsDifference(i,l)/we.secondsDifference(u,l),c=o*s,f=r*s;let d=e[c+t._ut1MinusUtcSecondsColumn],p=e[f+t._ut1MinusUtcSecondsColumn];const g=p-d;if(g>.5||g<-.5){const v=e[c+t._taiMinusUtcSecondsColumn],y=e[f+t._taiMinusUtcSecondsColumn];v!==y&&(u.equals(i)?d=p:p-=y-v)}return a.xPoleWander=bl(A,e[c+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),a.yPoleWander=bl(A,e[c+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),a.xPoleOffset=bl(A,e[c+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=bl(A,e[c+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=bl(A,d,p),a}function Rt(t,n,e){this.heading=t??0,this.pitch=n??0,this.roll=e??0}Rt.fromQuaternion=function(t,n){if(!ne(t))throw new pe("quaternion is required");ne(n)||(n=new Rt);const e=2*(t.w*t.y-t.z*t.x),i=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),r=1-2*(t.y*t.y+t.z*t.z),a=2*(t.w*t.z+t.x*t.y);return n.heading=-Math.atan2(a,r),n.roll=Math.atan2(o,i),n.pitch=-he.asinClamped(e),n},Rt.fromDegrees=function(t,n,e,i){if(!ne(t))throw new pe("heading is required");if(!ne(n))throw new pe("pitch is required");if(!ne(e))throw new pe("roll is required");return ne(i)||(i=new Rt),i.heading=t*he.RADIANS_PER_DEGREE,i.pitch=n*he.RADIANS_PER_DEGREE,i.roll=e*he.RADIANS_PER_DEGREE,i},Rt.clone=function(t,n){if(ne(t))return ne(n)?(n.heading=t.heading,n.pitch=t.pitch,n.roll=t.roll,n):new Rt(t.heading,t.pitch,t.roll)},Rt.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.heading===n.heading&&t.pitch===n.pitch&&t.roll===n.roll},Rt.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.heading,n.heading,e,i)&&he.equalsEpsilon(t.pitch,n.pitch,e,i)&&he.equalsEpsilon(t.roll,n.roll,e,i)},Rt.prototype.clone=function(t){return Rt.clone(this,t)},Rt.prototype.equals=function(t){return Rt.equals(this,t)},Rt.prototype.equalsEpsilon=function(t,n,e){return Rt.equalsEpsilon(this,t,n,e)},Rt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Hb=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function B4(){const t=document.getElementsByTagName("script");for(let n=0,e=t.length;n<e;++n){const i=t[n].getAttribute("src"),o=Hb.exec(i);if(o!==null)return o[1]}}let PA;function Gb(t){return typeof document>"u"?t:(ne(PA)||(PA=document.createElement("a")),PA.href=t,PA.href)}let Io;function Wb(){if(ne(Io))return Io;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:ne(is&&is.tagName.toUpperCase()==="SCRIPT"&&is.src||new URL("earthsdk3-cesium.iife.js",document.baseURI).href)?t=yl(".",is&&is.tagName.toUpperCase()==="SCRIPT"&&is.src||new URL("earthsdk3-cesium.iife.js",document.baseURI).href):typeof define=="object"&&ne(define.amd)&&!define.amd.toUrlUndefined&&ne(require.toUrl)?t=yl("..",Gn("Core/buildModuleUrl.js")):t=B4(),!ne(t))throw new pe("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Io=new xe({url:Gb(t)}),Io.appendForwardSlash(),Io}function T4(t){return Gb(require.toUrl(`../${t}`))}function jb(t){return Wb().getDerivedResource({url:t}).url}let BA;function Gn(t){return ne(BA)||(typeof define=="object"&&ne(define.amd)&&!define.amd.toUrlUndefined&&ne(require.toUrl)?BA=T4:BA=jb),BA(t)}Gn._cesiumScriptRegex=Hb,Gn._buildModuleUrlFromBaseUrl=jb,Gn._clearBaseResource=function(){Io=void 0},Gn.setBaseUrl=function(t){Io=xe.DEFAULT.getDerivedResource({url:t})},Gn.getCesiumBaseUrl=Wb;function qb(t,n,e){this.x=t,this.y=n,this.s=e}function Dd(t){t=t??gi.EMPTY_OBJECT,this._xysFileUrlTemplate=xe.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new we(this._sampleZeroJulianEphemerisDate,0,Ve.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 n=this._interpolationOrder,e=this._denominators=new Array(n+1),i=this._xTable=new Array(n+1),o=Math.pow(this._stepSizeDays,n);for(let r=0;r<=n;++r){e[r]=o,i[r]=r*this._stepSizeDays;for(let a=0;a<=n;++a)a!==r&&(e[r]*=r-a);e[r]=1/e[r]}this._work=new Array(n+1),this._coef=new Array(n+1)}const I4=new we(0,0,Ve.TAI);function Rd(t,n,e){const i=I4;return i.dayNumber=n,i.secondsOfDay=e,we.daysDifference(i,t._sampleZeroDateTT)}Dd.prototype.preload=function(t,n,e,i){const o=Rd(this,t,n),r=Rd(this,e,i);let a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);const l=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,A=[];for(let c=l;c<=u;++c)A.push(Ud(this,c));return Promise.all(A)},Dd.prototype.computeXysRadians=function(t,n,e){const i=Rd(this,t,n);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const r=this._interpolationOrder;let a=o-(r/2|0);a<0&&(a=0);let s=a+r;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-r,a<0&&(a=0));let l=!1;const u=this._samples;if(ne(u[a*3])||(Ud(this,a/this._samplesPerXysFile|0),l=!0),ne(u[s*3])||(Ud(this,s/this._samplesPerXysFile|0),l=!0),l)return;ne(e)?(e.x=0,e.y=0,e.s=0):e=new qb(0,0,0);const A=i-a*this._stepSizeDays,c=this._work,f=this._denominators,d=this._coef,p=this._xTable;let g,v;for(g=0;g<=r;++g)c[g]=A-p[g];for(g=0;g<=r;++g){for(d[g]=1,v=0;v<=r;++v)v!==g&&(d[g]*=c[v]);d[g]*=f[g];let y=(a+g)*3;e.x+=d[g]*u[y++],e.y+=d[g]*u[y++],e.s+=d[g]*u[y]}return e};function Ud(t,n){if(t._chunkDownloadsInProgress[n])return t._chunkDownloadsInProgress[n];let e;const i=t._xysFileUrlTemplate;ne(i)?e=i.getDerivedResource({templateValues:{0:n}}):e=new xe({url:Gn(`Assets/IAU2006_XYS/IAU2006_XYS_${n}.json`)});const o=e.fetchJson().then(function(r){t._chunkDownloadsInProgress[n]=!1;const a=t._samples,s=r.samples,l=n*t._samplesPerXysFile*3;for(let u=0,A=s.length;u<A;++u)a[l+u]=s[u]});return t._chunkDownloadsInProgress[n]=o,o}function ve(t,n,e,i){this.x=t??0,this.y=n??0,this.z=e??0,this.w=i??0}let xl=new ae;ve.fromAxisAngle=function(t,n,e){N.typeOf.object("axis",t),N.typeOf.number("angle",n);const i=n/2,o=Math.sin(i);xl=ae.normalize(t,xl);const r=xl.x*o,a=xl.y*o,s=xl.z*o,l=Math.cos(i);return ne(e)?(e.x=r,e.y=a,e.z=s,e.w=l,e):new ve(r,a,s,l)};const F4=[1,2,0],M4=new Array(3);ve.fromRotationMatrix=function(t,n){N.typeOf.object("matrix",t);let e,i,o,r,a;const s=t[me.COLUMN0ROW0],l=t[me.COLUMN1ROW1],u=t[me.COLUMN2ROW2],A=s+l+u;if(A>0)e=Math.sqrt(A+1),a=.5*e,e=.5/e,i=(t[me.COLUMN1ROW2]-t[me.COLUMN2ROW1])*e,o=(t[me.COLUMN2ROW0]-t[me.COLUMN0ROW2])*e,r=(t[me.COLUMN0ROW1]-t[me.COLUMN1ROW0])*e;else{const c=F4;let f=0;l>s&&(f=1),u>s&&u>l&&(f=2);const d=c[f],p=c[d];e=Math.sqrt(t[me.getElementIndex(f,f)]-t[me.getElementIndex(d,d)]-t[me.getElementIndex(p,p)]+1);const g=M4;g[f]=.5*e,e=.5/e,a=(t[me.getElementIndex(p,d)]-t[me.getElementIndex(d,p)])*e,g[d]=(t[me.getElementIndex(d,f)]+t[me.getElementIndex(f,d)])*e,g[p]=(t[me.getElementIndex(p,f)]+t[me.getElementIndex(f,p)])*e,i=-g[0],o=-g[1],r=-g[2]}return ne(n)?(n.x=i,n.y=o,n.z=r,n.w=a,n):new ve(i,o,r,a)};const Kb=new ve;let Zb=new ve,Od=new ve,Xb=new ve;ve.fromHeadingPitchRoll=function(t,n){return N.typeOf.object("headingPitchRoll",t),Xb=ve.fromAxisAngle(ae.UNIT_X,t.roll,Kb),Od=ve.fromAxisAngle(ae.UNIT_Y,-t.pitch,n),n=ve.multiply(Od,Xb,Od),Zb=ve.fromAxisAngle(ae.UNIT_Z,-t.heading,Kb),ve.multiply(Zb,n,n)};const TA=new ae,Ld=new ae,ii=new ve,$b=new ve,IA=new ve;ve.packedLength=4,ve.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},ve.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ve),e.x=t[n],e.y=t[n+1],e.z=t[n+2],e.w=t[n+3],e},ve.packedInterpolationLength=3,ve.convertPackedArrayForInterpolation=function(t,n,e,i){ve.unpack(t,e*4,IA),ve.conjugate(IA,IA);for(let o=0,r=e-n+1;o<r;o++){const a=o*3;ve.unpack(t,(n+o)*4,ii),ve.multiply(ii,IA,ii),ii.w<0&&ve.negate(ii,ii),ve.computeAxis(ii,TA);const s=ve.computeAngle(ii);ne(i)||(i=[]),i[a]=TA.x*s,i[a+1]=TA.y*s,i[a+2]=TA.z*s}},ve.unpackInterpolationResult=function(t,n,e,i,o){ne(o)||(o=new ve),ae.fromArray(t,0,Ld);const r=ae.magnitude(Ld);return ve.unpack(n,i*4,$b),r===0?ve.clone(ve.IDENTITY,ii):ve.fromAxisAngle(Ld,r,ii),ve.multiply(ii,$b,o)},ve.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new ve(t.x,t.y,t.z,t.w)},ve.conjugate=function(t,n){return N.typeOf.object("quaternion",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=t.w,n},ve.magnitudeSquared=function(t){return N.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},ve.magnitude=function(t){return Math.sqrt(ve.magnitudeSquared(t))},ve.normalize=function(t,n){N.typeOf.object("result",n);const e=1/ve.magnitude(t),i=t.x*e,o=t.y*e,r=t.z*e,a=t.w*e;return n.x=i,n.y=o,n.z=r,n.w=a,n},ve.inverse=function(t,n){N.typeOf.object("result",n);const e=ve.magnitudeSquared(t);return n=ve.conjugate(t,n),ve.multiplyByScalar(n,1/e,n)},ve.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},ve.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},ve.negate=function(t,n){return N.typeOf.object("quaternion",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},ve.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},ve.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t.x,o=t.y,r=t.z,a=t.w,s=n.x,l=n.y,u=n.z,A=n.w,c=a*s+i*A+o*u-r*l,f=a*l-i*u+o*A+r*s,d=a*u+i*l-o*s+r*A,p=a*A-i*s-o*l-r*u;return e.x=c,e.y=f,e.z=d,e.w=p,e},ve.multiplyByScalar=function(t,n,e){return N.typeOf.object("quaternion",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},ve.divideByScalar=function(t,n,e){return N.typeOf.object("quaternion",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},ve.computeAxis=function(t,n){N.typeOf.object("quaternion",t),N.typeOf.object("result",n);const e=t.w;if(Math.abs(e-1)<he.EPSILON6||Math.abs(e+1)<he.EPSILON6)return n.x=1,n.y=n.z=0,n;const i=1/Math.sqrt(1-e*e);return n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n},ve.computeAngle=function(t){return N.typeOf.object("quaternion",t),Math.abs(t.w-1)<he.EPSILON6?0:2*Math.acos(t.w)};let zd=new ve;ve.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),zd=ve.multiplyByScalar(n,e,zd),i=ve.multiplyByScalar(t,1-e,i),ve.add(zd,i,i)};let Yb=new ve,kd=new ve,Qd=new ve;ve.slerp=function(t,n,e,i){N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i);let o=ve.dot(t,n),r=n;if(o<0&&(o=-o,r=Yb=ve.negate(n,Yb)),1-o<he.EPSILON6)return ve.lerp(t,r,e,i);const a=Math.acos(o);return kd=ve.multiplyByScalar(t,Math.sin((1-e)*a),kd),Qd=ve.multiplyByScalar(r,Math.sin(e*a),Qd),i=ve.add(kd,Qd,i),ve.multiplyByScalar(i,1/Math.sin(a),i)},ve.log=function(t,n){N.typeOf.object("quaternion",t),N.typeOf.object("result",n);const e=he.acosClamped(t.w);let i=0;return e!==0&&(i=e/Math.sin(e)),ae.multiplyByScalar(t,i,n)},ve.exp=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.magnitude(t);let i=0;return e!==0&&(i=Math.sin(e)/e),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(e),n};const D4=new ae,R4=new ae,_l=new ve,Hs=new ve;ve.computeInnerQuadrangle=function(t,n,e,i){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("q2",e),N.typeOf.object("result",i);const o=ve.conjugate(n,_l);ve.multiply(o,e,Hs);const r=ve.log(Hs,D4);ve.multiply(o,t,Hs);const a=ve.log(Hs,R4);return ae.add(r,a,r),ae.multiplyByScalar(r,.25,r),ae.negate(r,r),ve.exp(r,_l),ve.multiply(n,_l,i)},ve.squad=function(t,n,e,i,o,r){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("s0",e),N.typeOf.object("s1",i),N.typeOf.number("t",o),N.typeOf.object("result",r);const a=ve.slerp(t,n,o,_l),s=ve.slerp(e,i,o,Hs);return ve.slerp(a,s,2*o*(1-o),r)};const U4=new ve,Jb=1.9011074535173003,FA=Ht.supportsTypedArrays()?new Float32Array(8):[],MA=Ht.supportsTypedArrays()?new Float32Array(8):[],qi=Ht.supportsTypedArrays()?new Float32Array(8):[],Ki=Ht.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const n=t+1,e=2*n+1;FA[t]=1/(n*e),MA[t]=n/e}FA[7]=Jb/136,MA[7]=Jb*8/17,ve.fastSlerp=function(t,n,e,i){N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i);let o=ve.dot(t,n),r;o>=0?r=1:(r=-1,o=-o);const a=o-1,s=1-e,l=e*e,u=s*s;for(let d=7;d>=0;--d)qi[d]=(FA[d]*l-MA[d])*a,Ki[d]=(FA[d]*u-MA[d])*a;const A=r*e*(1+qi[0]*(1+qi[1]*(1+qi[2]*(1+qi[3]*(1+qi[4]*(1+qi[5]*(1+qi[6]*(1+qi[7])))))))),c=s*(1+Ki[0]*(1+Ki[1]*(1+Ki[2]*(1+Ki[3]*(1+Ki[4]*(1+Ki[5]*(1+Ki[6]*(1+Ki[7])))))))),f=ve.multiplyByScalar(t,c,U4);return ve.multiplyByScalar(n,A,i),ve.add(f,i,i)},ve.fastSquad=function(t,n,e,i,o,r){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("s0",e),N.typeOf.object("s1",i),N.typeOf.number("t",o),N.typeOf.object("result",r);const a=ve.fastSlerp(t,n,o,_l),s=ve.fastSlerp(e,i,o,Hs);return ve.fastSlerp(a,s,2*o*(1-o),r)},ve.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},ve.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.x-n.x)<=e&&Math.abs(t.y-n.y)<=e&&Math.abs(t.z-n.z)<=e&&Math.abs(t.w-n.w)<=e},ve.ZERO=Object.freeze(new ve(0,0,0,0)),ve.IDENTITY=Object.freeze(new ve(0,0,0,1)),ve.prototype.clone=function(t){return ve.clone(this,t)},ve.prototype.equals=function(t){return ve.equals(this,t)},ve.prototype.equalsEpsilon=function(t,n){return ve.equalsEpsilon(this,t,n)},ve.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const ke={},Vd={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"}},Gs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Nd={},gn={east:new ae,north:new ae,up:new ae,west:new ae,south:new ae,down:new ae};let Lr=new ae,zr=new ae,kr=new ae;ke.localFrameToFixedFrameGenerator=function(t,n){if(!Vd.hasOwnProperty(t)||!Vd[t].hasOwnProperty(n))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=Vd[t][n];let i;const o=t+n;return ne(Nd[o])?i=Nd[o]:(i=function(r,a,s){if(!ne(r))throw new pe("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new pe("origin has a NaN component");if(ne(s)||(s=new ge),ae.equalsEpsilon(r,ae.ZERO,he.EPSILON14))ae.unpack(Gs[t],0,Lr),ae.unpack(Gs[n],0,zr),ae.unpack(Gs[e],0,kr);else if(he.equalsEpsilon(r.x,0,he.EPSILON14)&&he.equalsEpsilon(r.y,0,he.EPSILON14)){const l=he.sign(r.z);ae.unpack(Gs[t],0,Lr),t!=="east"&&t!=="west"&&ae.multiplyByScalar(Lr,l,Lr),ae.unpack(Gs[n],0,zr),n!=="east"&&n!=="west"&&ae.multiplyByScalar(zr,l,zr),ae.unpack(Gs[e],0,kr),e!=="east"&&e!=="west"&&ae.multiplyByScalar(kr,l,kr)}else{a=a??De.default,a.geodeticSurfaceNormal(r,gn.up);const l=gn.up,u=gn.east;u.x=-r.y,u.y=r.x,u.z=0,ae.normalize(u,gn.east),ae.cross(l,u,gn.north),ae.multiplyByScalar(gn.up,-1,gn.down),ae.multiplyByScalar(gn.east,-1,gn.west),ae.multiplyByScalar(gn.north,-1,gn.south),Lr=gn[t],zr=gn[n],kr=gn[e]}return s[0]=Lr.x,s[1]=Lr.y,s[2]=Lr.z,s[3]=0,s[4]=zr.x,s[5]=zr.y,s[6]=zr.z,s[7]=0,s[8]=kr.x,s[9]=kr.y,s[10]=kr.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},Nd[o]=i),i},ke.eastNorthUpToFixedFrame=ke.localFrameToFixedFrameGenerator("east","north"),ke.northEastDownToFixedFrame=ke.localFrameToFixedFrameGenerator("north","east"),ke.northUpEastToFixedFrame=ke.localFrameToFixedFrameGenerator("north","up"),ke.northWestUpToFixedFrame=ke.localFrameToFixedFrameGenerator("north","west");const O4=new ve,L4=new ae(1,1,1),z4=new ge;ke.headingPitchRollToFixedFrame=function(t,n,e,i,o){N.typeOf.object("HeadingPitchRoll",n),i=i??ke.eastNorthUpToFixedFrame;const r=ve.fromHeadingPitchRoll(n,O4),a=ge.fromTranslationQuaternionRotationScale(ae.ZERO,r,L4,z4);return o=i(t,e,o),ge.multiply(o,a,o)};const k4=new ge,Q4=new me;ke.headingPitchRollQuaternion=function(t,n,e,i,o){N.typeOf.object("HeadingPitchRoll",n);const r=ke.headingPitchRollToFixedFrame(t,n,e,i,k4),a=ge.getMatrix3(r,Q4);return ve.fromRotationMatrix(a,o)};const V4=new ae(1,1,1),N4=new ae,ex=new ge,H4=new ge,G4=new me,W4=new ve;ke.fixedFrameToHeadingPitchRoll=function(t,n,e,i){N.defined("transform",t),n=n??De.default,e=e??ke.eastNorthUpToFixedFrame,ne(i)||(i=new Rt);const o=ge.getTranslation(t,N4);if(ae.equals(o,ae.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=ge.inverseTransformation(e(o,n,ex),ex),a=ge.setScale(t,V4,H4);a=ge.setTranslation(a,ae.ZERO,a),r=ge.multiply(r,a,r);let s=ve.fromRotationMatrix(ge.getMatrix3(r,G4),W4);return s=ve.normalize(s,s),Rt.fromQuaternion(s,i)};const j4=6*3600+2460+50.54841,q4=8640184812866e-6,K4=.093104,Z4=-62e-7,X4=11772758384668e-32,$4=72921158553e-15,Y4=he.TWO_PI/86400;let DA=new we;ke.computeIcrfToCentralBodyFixedMatrix=function(t,n){let e=ke.computeIcrfToFixedMatrix(t,n);return ne(e)||(e=ke.computeTemeToPseudoFixedMatrix(t,n)),e},ke.computeTemeToPseudoFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");DA=we.addSeconds(t,-we.computeTaiMinusUtc(t),DA);const e=DA.dayNumber,i=DA.secondsOfDay;let o;const r=e-2451545;i>=43200?o=(r+.5)/pt.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/pt.DAYS_PER_JULIAN_CENTURY;const s=(j4+o*(q4+o*(K4+o*Z4)))*Y4%he.TWO_PI,l=$4+X4*(e-24515455e-1),u=(i+pt.SECONDS_PER_DAY*.5)%pt.SECONDS_PER_DAY,A=s+l*u,c=Math.cos(A),f=Math.sin(A);return ne(n)?(n[0]=c,n[1]=-f,n[2]=0,n[3]=f,n[4]=c,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new me(c,f,0,-f,c,0,0,0,1)},ke.iau2006XysData=new Dd,ke.earthOrientationParameters=wl.NONE;const Hd=32.184,J4=2451545;ke.preloadIcrfFixed=function(t){const n=t.start.dayNumber,e=t.start.secondsOfDay+Hd,i=t.stop.dayNumber,o=t.stop.secondsOfDay+Hd;return ke.iau2006XysData.preload(n,e,i,o)},ke.computeIcrfToFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.computeFixedToIcrfMatrix(t,n);if(ne(e))return me.transpose(e,n)};const e5=32.184,t5=2451545,RA=new Rt,n5=new me,i5=new we;ke.computeMoonFixedToIcrfMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");const e=we.addSeconds(t,e5,i5),i=we.totalDays(e)-t5,o=he.toRadians(12.112)-he.toRadians(.052992)*i,r=he.toRadians(24.224)-he.toRadians(.105984)*i,a=he.toRadians(227.645)+he.toRadians(13.012)*i,s=he.toRadians(261.105)+he.toRadians(13.340716)*i,l=he.toRadians(358)+he.toRadians(.9856)*i;return RA.pitch=he.toRadians(180)-he.toRadians(3.878)*Math.sin(o)-he.toRadians(.12)*Math.sin(r)+he.toRadians(.07)*Math.sin(a)-he.toRadians(.017)*Math.sin(s),RA.roll=he.toRadians(-23.47)+he.toRadians(1.543)*Math.cos(o)+he.toRadians(.24)*Math.cos(r)-he.toRadians(.028)*Math.cos(a)+he.toRadians(.007)*Math.cos(s),RA.heading=he.toRadians(154.375)+he.toRadians(13.17635831)*i+he.toRadians(3.558)*Math.sin(o)+he.toRadians(.121)*Math.sin(r)-he.toRadians(.064)*Math.sin(a)+he.toRadians(.016)*Math.sin(s)+he.toRadians(.025)*Math.sin(l),me.fromHeadingPitchRoll(RA,n5)},ke.computeIcrfToMoonFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.computeMoonFixedToIcrfMatrix(t,n);if(ne(e))return me.transpose(e,n)};const r5=new qb(0,0,0),o5=new _d(0,0,0,0,0),Gd=new me,Wd=new me;ke.computeFixedToIcrfMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.earthOrientationParameters.compute(t,o5);if(!ne(e))return;const i=t.dayNumber,o=t.secondsOfDay+Hd,r=ke.iau2006XysData.computeXysRadians(i,o,r5);if(!ne(r))return;const a=r.x+e.xPoleOffset,s=r.y+e.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-s*s)),u=Gd;u[0]=1-l*a*a,u[3]=-l*a*s,u[6]=a,u[1]=-l*a*s,u[4]=1-l*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-l*(a*a+s*s);const A=me.fromRotationZ(-r.s,Wd),c=me.multiply(u,A,Gd),f=t.dayNumber,d=t.secondsOfDay-we.computeTaiMinusUtc(t)+e.ut1MinusUtc,p=f-2451545,g=d/pt.SECONDS_PER_DAY;let v=.779057273264+g+.00273781191135448*(p+g);v=v%1*he.TWO_PI;const y=me.fromRotationZ(v,Wd),m=me.multiply(c,y,Gd),b=Math.cos(e.xPoleWander),x=Math.cos(e.yPoleWander),E=Math.sin(e.xPoleWander),B=Math.sin(e.yPoleWander);let P=i-J4+o/pt.SECONDS_PER_DAY;P/=36525;const I=-47e-6*P*he.RADIANS_PER_DEGREE/3600,O=Math.cos(I),M=Math.sin(I),S=Wd;return S[0]=b*O,S[1]=b*M,S[2]=E,S[3]=-x*M+B*E*O,S[4]=x*O+B*E*M,S[5]=-B*b,S[6]=-B*M-x*E*O,S[7]=B*O-x*E*M,S[8]=x*b,me.multiply(m,S,n)};const s5=new be;ke.pointToWindowCoordinates=function(t,n,e,i){return i=ke.pointToGLWindowCoordinates(t,n,e,i),i.y=2*n[5]-i.y,i},ke.pointToGLWindowCoordinates=function(t,n,e,i){if(!ne(t))throw new pe("modelViewProjectionMatrix is required.");if(!ne(n))throw new pe("viewportTransformation is required.");if(!ne(e))throw new pe("point is required.");ne(i)||(i=new _e);const o=s5;return ge.multiplyByVector(t,be.fromElements(e.x,e.y,e.z,1,o),o),be.multiplyByScalar(o,1/o.w,o),ge.multiplyByVector(n,o,o),_e.fromCartesian4(o,i)};const a5=new ae,l5=new ae,u5=new ae;ke.rotationMatrixFromPositionVelocity=function(t,n,e,i){if(!ne(t))throw new pe("position is required.");if(!ne(n))throw new pe("velocity is required.");const o=(e??De.default).geodeticSurfaceNormal(t,a5);let r=ae.cross(n,o,l5);ae.equalsEpsilon(r,ae.ZERO,he.EPSILON6)&&(r=ae.clone(ae.UNIT_X,r));const a=ae.cross(r,n,u5);return ae.normalize(a,a),ae.cross(n,a,r),ae.negate(r,r),ae.normalize(r,r),ne(i)||(i=new me),i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};const tx=new ge(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),nx=new Qe,jd=new ae,c5=new ae,h5=new me,qd=new ge,ix=new ge;ke.basisTo2D=function(t,n,e){if(!ne(t))throw new pe("projection is required.");if(!ne(n))throw new pe("matrix is required.");if(!ne(e))throw new pe("result is required.");const i=ge.getTranslation(n,c5),o=t.ellipsoid;let r;if(ae.equals(i,ae.ZERO))r=ae.clone(ae.ZERO,jd);else{const A=o.cartesianToCartographic(i,nx);r=t.project(A,jd),ae.fromElements(r.z,r.x,r.y,r)}const a=ke.eastNorthUpToFixedFrame(i,o,qd),s=ge.inverseTransformation(a,ix),l=ge.getMatrix3(n,h5),u=ge.multiplyByMatrix3(s,l,e);return ge.multiply(tx,u,e),ge.setTranslation(e,r,e),e},ke.ellipsoidTo2DModelMatrix=function(t,n,e){if(!ne(t))throw new pe("projection is required.");if(!ne(n))throw new pe("center is required.");if(!ne(e))throw new pe("result is required.");const i=t.ellipsoid,o=ke.eastNorthUpToFixedFrame(n,i,qd),r=ge.inverseTransformation(o,ix),a=i.cartesianToCartographic(n,nx),s=t.project(a,jd);ae.fromElements(s.z,s.x,s.y,s);const l=ge.fromTranslation(s,qd);return ge.multiply(tx,r,e),ge.multiply(l,e,e),e};function Te(t,n,e,i){this.west=t??0,this.south=n??0,this.east=e??0,this.north=i??0}Object.defineProperties(Te.prototype,{width:{get:function(){return Te.computeWidth(this)}},height:{get:function(){return Te.computeHeight(this)}}}),Te.packedLength=4,Te.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.west,n[e++]=t.south,n[e++]=t.east,n[e]=t.north,n},Te.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new Te),e.west=t[n++],e.south=t[n++],e.east=t[n++],e.north=t[n],e},Te.computeWidth=function(t){N.typeOf.object("rectangle",t);let n=t.east;const e=t.west;return n<e&&(n+=he.TWO_PI),n-e},Te.computeHeight=function(t){return N.typeOf.object("rectangle",t),t.north-t.south},Te.fromDegrees=function(t,n,e,i,o){return t=he.toRadians(t??0),n=he.toRadians(n??0),e=he.toRadians(e??0),i=he.toRadians(i??0),ne(o)?(o.west=t,o.south=n,o.east=e,o.north=i,o):new Te(t,n,e,i)},Te.fromRadians=function(t,n,e,i,o){return ne(o)?(o.west=t??0,o.south=n??0,o.east=e??0,o.north=i??0,o):new Te(t,n,e,i)},Te.fromCartographicArray=function(t,n){N.defined("cartographics",t);let e=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let l=0,u=t.length;l<u;l++){const A=t[l];e=Math.min(e,A.longitude),i=Math.max(i,A.longitude),a=Math.min(a,A.latitude),s=Math.max(s,A.latitude);const c=A.longitude>=0?A.longitude:A.longitude+he.TWO_PI;o=Math.min(o,c),r=Math.max(r,c)}return i-e>r-o&&(e=o,i=r,i>he.PI&&(i=i-he.TWO_PI),e>he.PI&&(e=e-he.TWO_PI)),ne(n)?(n.west=e,n.south=a,n.east=i,n.north=s,n):new Te(e,a,i,s)},Te.fromCartesianArray=function(t,n,e){N.defined("cartesians",t),n=n??De.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,A=t.length;u<A;u++){const c=n.cartesianToCartographic(t[u]);i=Math.min(i,c.longitude),o=Math.max(o,c.longitude),s=Math.min(s,c.latitude),l=Math.max(l,c.latitude);const f=c.longitude>=0?c.longitude:c.longitude+he.TWO_PI;r=Math.min(r,f),a=Math.max(a,f)}return o-i>a-r&&(i=r,o=a,o>he.PI&&(o=o-he.TWO_PI),i>he.PI&&(i=i-he.TWO_PI)),ne(e)?(e.west=i,e.south=s,e.east=o,e.north=l,e):new Te(i,s,o,l)};const A5=new ae,f5=new ae,p5=new ae,d5=new ae,m5=new ae,Kd=new Array(5);for(let t=0;t<Kd.length;++t)Kd[t]=new ae;Te.fromBoundingSphere=function(t,n,e){N.typeOf.object("boundingSphere",t);const i=t.center,o=t.radius;if(ne(n)||(n=De.default),ne(e)||(e=new Te),ae.equals(i,ae.ZERO))return Te.clone(Te.MAX_VALUE,e),e;const r=ke.eastNorthUpToFixedFrame(i,n,A5),a=ge.multiplyByPointAsVector(r,ae.UNIT_X,f5);ae.normalize(a,a);const s=ge.multiplyByPointAsVector(r,ae.UNIT_Y,p5);ae.normalize(s,s),ae.multiplyByScalar(s,o,s),ae.multiplyByScalar(a,o,a);const l=ae.negate(s,m5),u=ae.negate(a,d5),A=Kd;let c=A[0];return ae.add(i,s,c),c=A[1],ae.add(i,u,c),c=A[2],ae.add(i,l,c),c=A[3],ae.add(i,a,c),A[4]=i,Te.fromCartesianArray(A,n,e)},Te.clone=function(t,n){if(ne(t))return ne(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new Te(t.west,t.south,t.east,t.north)},Te.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.west-n.west)<=e&&Math.abs(t.south-n.south)<=e&&Math.abs(t.east-n.east)<=e&&Math.abs(t.north-n.north)<=e},Te.prototype.clone=function(t){return Te.clone(this,t)},Te.prototype.equals=function(t){return Te.equals(this,t)},Te.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north},Te.prototype.equalsEpsilon=function(t,n){return Te.equalsEpsilon(this,t,n)},Te._validate=function(t){N.typeOf.object("rectangle",t);const n=t.north;N.typeOf.number.greaterThanOrEquals("north",n,-he.PI_OVER_TWO),N.typeOf.number.lessThanOrEquals("north",n,he.PI_OVER_TWO);const e=t.south;N.typeOf.number.greaterThanOrEquals("south",e,-he.PI_OVER_TWO),N.typeOf.number.lessThanOrEquals("south",e,he.PI_OVER_TWO);const i=t.west;N.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),N.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=t.east;N.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),N.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Te.southwest=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new Qe(t.west,t.south)},Te.northwest=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new Qe(t.west,t.north)},Te.northeast=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new Qe(t.east,t.north)},Te.southeast=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new Qe(t.east,t.south)},Te.center=function(t,n){N.typeOf.object("rectangle",t);let e=t.east;const i=t.west;e<i&&(e+=he.TWO_PI);const o=he.negativePiToPi((i+e)*.5),r=(t.south+t.north)*.5;return ne(n)?(n.longitude=o,n.latitude=r,n.height=0,n):new Qe(o,r)},Te.intersection=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n);let i=t.east,o=t.west,r=n.east,a=n.west;i<o&&r>0?i+=he.TWO_PI:r<a&&i>0&&(r+=he.TWO_PI),i<o&&a<0?a+=he.TWO_PI:r<a&&o<0&&(o+=he.TWO_PI);const s=he.negativePiToPi(Math.max(o,a)),l=he.negativePiToPi(Math.min(i,r));if((t.west<t.east||n.west<n.east)&&l<=s)return;const u=Math.max(t.south,n.south),A=Math.min(t.north,n.north);if(!(u>=A))return ne(e)?(e.west=s,e.south=u,e.east=l,e.north=A,e):new Te(s,u,l,A)},Te.simpleIntersection=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n);const i=Math.max(t.west,n.west),o=Math.max(t.south,n.south),r=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||i>=r))return ne(e)?(e.west=i,e.south=o,e.east=r,e.north=a,e):new Te(i,o,r,a)},Te.union=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n),ne(e)||(e=new Te);let i=t.east,o=t.west,r=n.east,a=n.west;i<o&&r>0?i+=he.TWO_PI:r<a&&i>0&&(r+=he.TWO_PI),i<o&&a<0?a+=he.TWO_PI:r<a&&o<0&&(o+=he.TWO_PI);const s=he.negativePiToPi(Math.min(o,a)),l=he.negativePiToPi(Math.max(i,r));return e.west=s,e.south=Math.min(t.south,n.south),e.east=l,e.north=Math.max(t.north,n.north),e},Te.expand=function(t,n,e){return N.typeOf.object("rectangle",t),N.typeOf.object("cartographic",n),ne(e)||(e=new Te),e.west=Math.min(t.west,n.longitude),e.south=Math.min(t.south,n.latitude),e.east=Math.max(t.east,n.longitude),e.north=Math.max(t.north,n.latitude),e},Te.contains=function(t,n){N.typeOf.object("rectangle",t),N.typeOf.object("cartographic",n);let e=n.longitude;const i=n.latitude,o=t.west;let r=t.east;return r<o&&(r+=he.TWO_PI,e<0&&(e+=he.TWO_PI)),(e>o||he.equalsEpsilon(e,o,he.EPSILON14))&&(e<r||he.equalsEpsilon(e,r,he.EPSILON14))&&i>=t.south&&i<=t.north};const g5=new Qe;Te.subsample=function(t,n,e,i){N.typeOf.object("rectangle",t),n=n??De.default,e=e??0,ne(i)||(i=[]);let o=0;const r=t.north,a=t.south,s=t.east,l=t.west,u=g5;u.height=e,u.longitude=l,u.latitude=r,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=n.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:a>0?u.latitude=a:u.latitude=0;for(let A=1;A<8;++A)u.longitude=-Math.PI+A*he.PI_OVER_TWO,Te.contains(t,u)&&(i[o]=n.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=n.cartographicToCartesian(u,i[o]),o++),i.length=o,i},Te.subsection=function(t,n,e,i,o,r){if(N.typeOf.object("rectangle",t),N.typeOf.number.greaterThanOrEquals("westLerp",n,0),N.typeOf.number.lessThanOrEquals("westLerp",n,1),N.typeOf.number.greaterThanOrEquals("southLerp",e,0),N.typeOf.number.lessThanOrEquals("southLerp",e,1),N.typeOf.number.greaterThanOrEquals("eastLerp",i,0),N.typeOf.number.lessThanOrEquals("eastLerp",i,1),N.typeOf.number.greaterThanOrEquals("northLerp",o,0),N.typeOf.number.lessThanOrEquals("northLerp",o,1),N.typeOf.number.lessThanOrEquals("westLerp",n,i),N.typeOf.number.lessThanOrEquals("southLerp",e,o),ne(r)||(r=new Te),t.west<=t.east){const s=t.east-t.west;r.west=t.west+n*s,r.east=t.west+i*s}else{const s=he.TWO_PI+t.east-t.west;r.west=he.negativePiToPi(t.west+n*s),r.east=he.negativePiToPi(t.west+i*s)}const a=t.north-t.south;return r.south=t.south+e*a,r.north=t.south+o*a,n===1&&(r.west=t.east),i===1&&(r.east=t.east),e===1&&(r.south=t.north),o===1&&(r.north=t.north),r},Te.MAX_VALUE=Object.freeze(new Te(-Math.PI,-he.PI_OVER_TWO,Math.PI,he.PI_OVER_TWO));function Ws(t,n,e,i,o){this._format=t,this._datatype=n,this._width=e,this._height=i,this._buffer=o}Object.defineProperties(Ws.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}}}),Ws.clone=function(t){if(ne(t))return new Ws(t._format,t._datatype,t._width,t._height,t._buffer)},Ws.prototype.clone=function(){return Ws.clone(this)};function rx(){if(!ne(Ut._canTransferArrayBuffer)){const t=$d("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const n=99,e=new Int8Array([n]);try{t.postMessage({array:e},[e.buffer])}catch{return Ut._canTransferArrayBuffer=!1,Ut._canTransferArrayBuffer}Ut._canTransferArrayBuffer=new Promise(i=>{t.onmessage=function(o){const r=o.data.array,a=ne(r)&&r[0]===n;i(a),t.terminate(),Ut._canTransferArrayBuffer=a}})}return Ut._canTransferArrayBuffer}const Zd=new zs;function Xd(t){let n;try{n=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(t),n=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(n)}function $d(t){const n=new Wi(t),e=n.scheme().length!==0&&n.fragment().length===0,i=t.replace(/\.js$/,""),o={};let r,a;if(Td(t))a=t;else if(!e){const s=Gn(`${Ut._workerModulePrefix}/${i}.js`);Td(s)&&(a=s)}if(a){const s=`import "${a}";`;return r=Xd(s),o.type="module",new Worker(r,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const s=`
382
+ */var tR=wA.exports,Tb;function nR(){return Tb||(Tb=1,(function(t){(function(n,e){t.exports?t.exports=e(X4(),Y4(),eR()):n.URI=e(n.punycode,n.IPv6,n.SecondLevelDomains,n)})(tR,function(n,e,i,o){var r=o&&o.URI;function a(w,C){var U=arguments.length>=1,F=arguments.length>=2;if(!(this instanceof a))return U?F?new a(w,C):new a(w):new a;if(w===void 0){if(U)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&U)throw new TypeError("null is not a valid argument for URI");return this.href(w),C!==void 0?this.absoluteTo(C):this}function s(w){return/^[0-9]+$/.test(w)}a.version="1.19.11";var l=a.prototype,u=Object.prototype.hasOwnProperty;function A(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function f(w){return c(w)==="Array"}function d(w,C){var U={},F,D;if(c(C)==="RegExp")U=null;else if(f(C))for(F=0,D=C.length;F<D;F++)U[C[F]]=!0;else U[C]=!0;for(F=0,D=w.length;F<D;F++){var R=U&&U[w[F]]!==void 0||!U&&C.test(w[F]);R&&(w.splice(F,1),D--,F--)}return w}function p(w,C){var U,F;if(f(C)){for(U=0,F=C.length;U<F;U++)if(!p(w,C[U]))return!1;return!0}var D=c(C);for(U=0,F=w.length;U<F;U++)if(D==="RegExp"){if(typeof w[U]=="string"&&w[U].match(C))return!0}else if(w[U]===C)return!0;return!1}function g(w,C){if(!f(w)||!f(C)||w.length!==C.length)return!1;w.sort(),C.sort();for(var U=0,F=w.length;U<F;U++)if(w[U]!==C[U])return!1;return!0}function v(w){var C=/^\/+|\/+$/g;return w.replace(C,"")}a._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:a.preventInvalidHostname,duplicateQueryParameters:a.duplicateQueryParameters,escapeQuerySpace:a.escapeQuerySpace}},a.preventInvalidHostname=!1,a.duplicateQueryParameters=!1,a.escapeQuerySpace=!0,a.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,a.idn_expression=/[^a-z0-9\._-]/i,a.punycode_expression=/(xn--)/i,a.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,a.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*$/,a.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,a.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},a.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,a.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},a.hostProtocols=["http","https"],a.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,a.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"},a.getDomAttribute=function(w){if(!(!w||!w.nodeName)){var C=w.nodeName.toLowerCase();if(!(C==="input"&&w.type!=="image"))return a.domAttributes[C]}};function y(w){return escape(w)}function m(w){return encodeURIComponent(w).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}a.encode=m,a.decode=decodeURIComponent,a.iso8859=function(){a.encode=escape,a.decode=unescape},a.unicode=function(){a.encode=m,a.decode=decodeURIComponent},a.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"}}}},a.encodeQuery=function(w,C){var U=a.encode(w+"");return C===void 0&&(C=a.escapeQuerySpace),C?U.replace(/%20/g,"+"):U},a.decodeQuery=function(w,C){w+="",C===void 0&&(C=a.escapeQuerySpace);try{return a.decode(C?w.replace(/\+/g,"%20"):w)}catch{return w}};var b={encode:"encode",decode:"decode"},x,E=function(w,C){return function(U){try{return a[C](U+"").replace(a.characters[w][C].expression,function(F){return a.characters[w][C].map[F]})}catch{return U}}};for(x in b)a[x+"PathSegment"]=E("pathname",b[x]),a[x+"UrnPathSegment"]=E("urnpath",b[x]);var B=function(w,C,U){return function(F){var D;U?D=function(Q){return a[C](a[U](Q))}:D=a[C];for(var R=(F+"").split(w),L=0,k=R.length;L<k;L++)R[L]=D(R[L]);return R.join(w)}};a.decodePath=B("/","decodePathSegment"),a.decodeUrnPath=B(":","decodeUrnPathSegment"),a.recodePath=B("/","encodePathSegment","decode"),a.recodeUrnPath=B(":","encodeUrnPathSegment","decode"),a.encodeReserved=E("reserved","encode"),a.parse=function(w,C){var U;return C||(C={preventInvalidHostname:a.preventInvalidHostname}),w=w.replace(a.leading_whitespace_expression,""),w=w.replace(a.ascii_tab_whitespace,""),U=w.indexOf("#"),U>-1&&(C.fragment=w.substring(U+1)||null,w=w.substring(0,U)),U=w.indexOf("?"),U>-1&&(C.query=w.substring(U+1)||null,w=w.substring(0,U)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(C.protocol=null,w=w.substring(2),w=a.parseAuthority(w,C)):(U=w.indexOf(":"),U>-1&&(C.protocol=w.substring(0,U)||null,C.protocol&&!C.protocol.match(a.protocol_expression)?C.protocol=void 0:w.substring(U+1,U+3).replace(/\\/g,"/")==="//"?(w=w.substring(U+3),w=a.parseAuthority(w,C)):(w=w.substring(U+1),C.urn=!0))),C.path=w,C},a.parseHost=function(w,C){w||(w=""),w=w.replace(/\\/g,"/");var U=w.indexOf("/"),F,D;if(U===-1&&(U=w.length),w.charAt(0)==="[")F=w.indexOf("]"),C.hostname=w.substring(1,F)||null,C.port=w.substring(F+2,U)||null,C.port==="/"&&(C.port=null);else{var R=w.indexOf(":"),L=w.indexOf("/"),k=w.indexOf(":",R+1);k!==-1&&(L===-1||k<L)?(C.hostname=w.substring(0,U)||null,C.port=null):(D=w.substring(0,U).split(":"),C.hostname=D[0]||null,C.port=D[1]||null)}return C.hostname&&w.substring(U).charAt(0)!=="/"&&(U++,w="/"+w),C.preventInvalidHostname&&a.ensureValidHostname(C.hostname,C.protocol),C.port&&a.ensureValidPort(C.port),w.substring(U)||"/"},a.parseAuthority=function(w,C){return w=a.parseUserinfo(w,C),a.parseHost(w,C)},a.parseUserinfo=function(w,C){var U=w,F=w.indexOf("\\");F!==-1&&(w=w.replace(/\\/g,"/"));var D=w.indexOf("/"),R=w.lastIndexOf("@",D>-1?D:w.length-1),L;return R>-1&&(D===-1||R<D)?(L=w.substring(0,R).split(":"),C.username=L[0]?a.decode(L[0]):null,L.shift(),C.password=L[0]?a.decode(L.join(":")):null,w=U.substring(R+1)):(C.username=null,C.password=null),w},a.parseQuery=function(w,C){if(!w)return{};if(w=w.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!w)return{};for(var U={},F=w.split("&"),D=F.length,R,L,k,Q=0;Q<D;Q++)R=F[Q].split("="),L=a.decodeQuery(R.shift(),C),k=R.length?a.decodeQuery(R.join("="),C):null,L!=="__proto__"&&(u.call(U,L)?((typeof U[L]=="string"||U[L]===null)&&(U[L]=[U[L]]),U[L].push(k)):U[L]=k);return U},a.build=function(w){var C="",U=!1;return w.protocol&&(C+=w.protocol+":"),!w.urn&&(C||w.hostname)&&(C+="//",U=!0),C+=a.buildAuthority(w)||"",typeof w.path=="string"&&(w.path.charAt(0)!=="/"&&U&&(C+="/"),C+=w.path),typeof w.query=="string"&&w.query&&(C+="?"+w.query),typeof w.fragment=="string"&&w.fragment&&(C+="#"+w.fragment),C},a.buildHost=function(w){var C="";if(w.hostname)a.ip6_expression.test(w.hostname)?C+="["+w.hostname+"]":C+=w.hostname;else return"";return w.port&&(C+=":"+w.port),C},a.buildAuthority=function(w){return a.buildUserinfo(w)+a.buildHost(w)},a.buildUserinfo=function(w){var C="";return w.username&&(C+=a.encode(w.username)),w.password&&(C+=":"+a.encode(w.password)),C&&(C+="@"),C},a.buildQuery=function(w,C,U){var F="",D,R,L,k;for(R in w)if(R!=="__proto__"&&u.call(w,R))if(f(w[R]))for(D={},L=0,k=w[R].length;L<k;L++)w[R][L]!==void 0&&D[w[R][L]+""]===void 0&&(F+="&"+a.buildQueryParameter(R,w[R][L],U),C!==!0&&(D[w[R][L]+""]=!0));else w[R]!==void 0&&(F+="&"+a.buildQueryParameter(R,w[R],U));return F.substring(1)},a.buildQueryParameter=function(w,C,U){return a.encodeQuery(w,U)+(C!==null?"="+a.encodeQuery(C,U):"")},a.addQuery=function(w,C,U){if(typeof C=="object")for(var F in C)u.call(C,F)&&a.addQuery(w,F,C[F]);else if(typeof C=="string"){if(w[C]===void 0){w[C]=U;return}else typeof w[C]=="string"&&(w[C]=[w[C]]);f(U)||(U=[U]),w[C]=(w[C]||[]).concat(U)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(w,C,U){if(typeof C=="object")for(var F in C)u.call(C,F)&&a.setQuery(w,F,C[F]);else if(typeof C=="string")w[C]=U===void 0?null:U;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(w,C,U){var F,D,R;if(f(C))for(F=0,D=C.length;F<D;F++)w[C[F]]=void 0;else if(c(C)==="RegExp")for(R in w)C.test(R)&&(w[R]=void 0);else if(typeof C=="object")for(R in C)u.call(C,R)&&a.removeQuery(w,R,C[R]);else if(typeof C=="string")U!==void 0?c(U)==="RegExp"?!f(w[C])&&U.test(w[C])?w[C]=void 0:w[C]=d(w[C],U):w[C]===String(U)&&(!f(U)||U.length===1)?w[C]=void 0:f(w[C])&&(w[C]=d(w[C],U)):w[C]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(w,C,U,F){switch(c(C)){case"String":break;case"RegExp":for(var D in w)if(u.call(w,D)&&C.test(D)&&(U===void 0||a.hasQuery(w,D,U)))return!0;return!1;case"Object":for(var R in C)if(u.call(C,R)&&!a.hasQuery(w,R,C[R]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(U)){case"Undefined":return C in w;case"Boolean":var L=!!(f(w[C])?w[C].length:w[C]);return U===L;case"Function":return!!U(w[C],C,w);case"Array":if(!f(w[C]))return!1;var k=F?p:g;return k(w[C],U);case"RegExp":return f(w[C])?F?p(w[C],U):!1:!!(w[C]&&w[C].match(U));case"Number":U=String(U);case"String":return f(w[C])?F?p(w[C],U):!1:w[C]===U;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var w=[],C=[],U=0,F=0;F<arguments.length;F++){var D=new a(arguments[F]);w.push(D);for(var R=D.segment(),L=0;L<R.length;L++)typeof R[L]=="string"&&C.push(R[L]),R[L]&&U++}if(!C.length||!U)return new a("");var k=new a("").segment(C);return(w[0].path()===""||w[0].path().slice(0,1)==="/")&&k.path("/"+k.path()),k.normalize()},a.commonPath=function(w,C){var U=Math.min(w.length,C.length),F;for(F=0;F<U;F++)if(w.charAt(F)!==C.charAt(F)){F--;break}return F<1?w.charAt(0)===C.charAt(0)&&w.charAt(0)==="/"?"/":"":((w.charAt(F)!=="/"||C.charAt(F)!=="/")&&(F=w.substring(0,F).lastIndexOf("/")),w.substring(0,F+1))},a.withinString=function(w,C,U){U||(U={});var F=U.start||a.findUri.start,D=U.end||a.findUri.end,R=U.trim||a.findUri.trim,L=U.parens||a.findUri.parens,k=/[a-z0-9-]=["']?$/i;for(F.lastIndex=0;;){var Q=F.exec(w);if(!Q)break;var V=Q.index;if(U.ignoreHtml){var G=w.slice(Math.max(V-3,0),V);if(G&&k.test(G))continue}for(var $=V+w.slice(V).search(D),Y=w.slice(V,$),ie=-1;;){var re=L.exec(Y);if(!re)break;var le=re.index+re[0].length;ie=Math.max(ie,le)}if(ie>-1?Y=Y.slice(0,ie)+Y.slice(ie).replace(R,""):Y=Y.replace(R,""),!(Y.length<=Q[0].length)&&!(U.ignore&&U.ignore.test(Y))){$=V+Y.length;var ue=C(Y,V,$,w);if(ue===void 0){F.lastIndex=$;continue}ue=String(ue),w=w.slice(0,V)+ue+w.slice($),F.lastIndex=V+ue.length}}return F.lastIndex=0,w},a.ensureValidHostname=function(w,C){var U=!!w,F=!!C,D=!1;if(F&&(D=p(a.hostProtocols,C)),D&&!U)throw new TypeError("Hostname cannot be empty, if protocol is "+C);if(w&&w.match(a.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(n.toASCII(w).match(a.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},a.ensureValidPort=function(w){if(w){var C=Number(w);if(!(s(C)&&C>0&&C<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},a.noConflict=function(w){if(w){var C={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(C.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(C.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(C.SecondLevelDomains=o.SecondLevelDomains.noConflict()),C}else o.URI===this&&(o.URI=r);return this},l.build=function(w){return w===!0?this._deferred_build=!0:(w===void 0||this._deferred_build)&&(this._string=a.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new a(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function P(w){return function(C,U){return C===void 0?this._parts[w]||"":(this._parts[w]=C||null,this.build(!U),this)}}function I(w,C){return function(U,F){return U===void 0?this._parts[w]||"":(U!==null&&(U=U+"",U.charAt(0)===C&&(U=U.substring(1))),this._parts[w]=U,this.build(!F),this)}}l.protocol=P("protocol"),l.username=P("username"),l.password=P("password"),l.hostname=P("hostname"),l.port=P("port"),l.query=I("query","?"),l.fragment=I("fragment","#"),l.search=function(w,C){var U=this.query(w,C);return typeof U=="string"&&U.length?"?"+U:U},l.hash=function(w,C){var U=this.fragment(w,C);return typeof U=="string"&&U.length?"#"+U:U},l.pathname=function(w,C){if(w===void 0||w===!0){var U=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?a.decodeUrnPath:a.decodePath)(U):U}else return this._parts.urn?this._parts.path=w?a.recodeUrnPath(w):"":this._parts.path=w?a.recodePath(w):"/",this.build(!C),this},l.path=l.pathname,l.href=function(w,C){var U;if(w===void 0)return this.toString();this._string="",this._parts=a._parts();var F=w instanceof a,D=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var R=a.getDomAttribute(w);w=w[R]||"",D=!1}if(!F&&D&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=a.parse(String(w),this._parts);else if(F||D){var L=F?w._parts:w;for(U in L)U!=="query"&&u.call(this._parts,U)&&(this._parts[U]=L[U]);L.query&&this.query(L.query,!1)}else throw new TypeError("invalid input");return this.build(!C),this},l.is=function(w){var C=!1,U=!1,F=!1,D=!1,R=!1,L=!1,k=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,U=a.ip4_expression.test(this._parts.hostname),F=a.ip6_expression.test(this._parts.hostname),C=U||F,D=!C,R=D&&i&&i.has(this._parts.hostname),L=D&&a.idn_expression.test(this._parts.hostname),k=D&&a.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return D;case"sld":return R;case"ip":return C;case"ip4":case"ipv4":case"inet4":return U;case"ip6":case"ipv6":case"inet6":return F;case"idn":return L;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return k}return null};var O=l.protocol,M=l.port,S=l.hostname;l.protocol=function(w,C){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(a.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,w,C)},l.scheme=l.protocol,l.port=function(w,C){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),a.ensureValidPort(w))),M.call(this,w,C))},l.hostname=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var U={preventInvalidHostname:this._parts.preventInvalidHostname},F=a.parseHost(w,U);if(F!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=U.hostname,this._parts.preventInvalidHostname&&a.ensureValidHostname(w,this._parts.protocol)}return S.call(this,w,C)},l.origin=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var U=this.protocol(),F=this.authority();return F?(U?U+"://":"")+this.authority():""}else{var D=a(w);return this.protocol(D.protocol()).authority(D.authority()).build(!C),this}},l.host=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?a.buildHost(this._parts):"";var U=a.parseHost(w,this._parts);if(U!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!C),this},l.authority=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?a.buildAuthority(this._parts):"";var U=a.parseAuthority(w,this._parts);if(U!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!C),this},l.userinfo=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var U=a.buildUserinfo(this._parts);return U&&U.substring(0,U.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),a.parseUserinfo(w,this._parts),this.build(!C),this},l.resource=function(w,C){var U;return w===void 0?this.path()+this.search()+this.hash():(U=a.parse(w),this._parts.path=U.path,this._parts.query=U.query,this._parts.fragment=U.fragment,this.build(!C),this)},l.subdomain=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,U)||""}else{var F=this._parts.hostname.length-this.domain().length,D=this._parts.hostname.substring(0,F),R=new RegExp("^"+A(D));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&a.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(R,w),this.build(!C),this}},l.domain=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(C=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.match(/\./g);if(U&&U.length<2)return this._parts.hostname;var F=this._parts.hostname.length-this.tld(C).length-1;return F=this._parts.hostname.lastIndexOf(".",F-1)+1,this._parts.hostname.substring(F)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(a.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var D=new RegExp(A(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(D,w)}return this.build(!C),this}},l.tld=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(C=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var U=this._parts.hostname.lastIndexOf("."),F=this._parts.hostname.substring(U+1);return C!==!0&&i&&i.list[F.toLowerCase()]&&i.get(this._parts.hostname)||F}else{var D;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(i&&i.is(w))D=new RegExp(A(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(D,w);else throw new TypeError('TLD "'+w+'" 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");D=new RegExp(A(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(D,w)}else throw new TypeError("cannot set TLD empty");return this.build(!C),this}},l.directory=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var U=this._parts.path.length-this.filename().length-1,F=this._parts.path.substring(0,U)||(this._parts.hostname?"/":"");return w?a.decodePath(F):F}else{var D=this._parts.path.length-this.filename().length,R=this._parts.path.substring(0,D),L=new RegExp("^"+A(R));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=a.recodePath(w),this._parts.path=this._parts.path.replace(L,w),this.build(!C),this}},l.filename=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var U=this._parts.path.lastIndexOf("/"),F=this._parts.path.substring(U+1);return w?a.decodePathSegment(F):F}else{var D=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(D=!0);var R=new RegExp(A(this.filename())+"$");return w=a.recodePath(w),this._parts.path=this._parts.path.replace(R,w),D?this.normalizePath(C):this.build(!C),this}},l.suffix=function(w,C){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var U=this.filename(),F=U.lastIndexOf("."),D,R;return F===-1?"":(D=U.substring(F+1),R=/^[a-z0-9%]+$/i.test(D)?D:"",w?a.decodePathSegment(R):R)}else{w.charAt(0)==="."&&(w=w.substring(1));var L=this.suffix(),k;if(L)w?k=new RegExp(A(L)+"$"):k=new RegExp(A("."+L)+"$");else{if(!w)return this;this._parts.path+="."+a.recodePath(w)}return k&&(w=a.recodePath(w),this._parts.path=this._parts.path.replace(k,w)),this.build(!C),this}},l.segment=function(w,C,U){var F=this._parts.urn?":":"/",D=this.path(),R=D.substring(0,1)==="/",L=D.split(F);if(w!==void 0&&typeof w!="number"&&(U=C,C=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(R&&L.shift(),w<0&&(w=Math.max(L.length+w,0)),C===void 0)return w===void 0?L:L[w];if(w===null||L[w]===void 0)if(f(C)){L=[];for(var k=0,Q=C.length;k<Q;k++)!C[k].length&&(!L.length||!L[L.length-1].length)||(L.length&&!L[L.length-1].length&&L.pop(),L.push(v(C[k])))}else(C||typeof C=="string")&&(C=v(C),L[L.length-1]===""?L[L.length-1]=C:L.push(C));else C?L[w]=v(C):L.splice(w,1);return R&&L.unshift(""),this.path(L.join(F),U)},l.segmentCoded=function(w,C,U){var F,D,R;if(typeof w!="number"&&(U=C,C=w,w=void 0),C===void 0){if(F=this.segment(w,C,U),!f(F))F=F!==void 0?a.decode(F):void 0;else for(D=0,R=F.length;D<R;D++)F[D]=a.decode(F[D]);return F}if(!f(C))C=typeof C=="string"||C instanceof String?a.encode(C):C;else for(D=0,R=C.length;D<R;D++)C[D]=a.encode(C[D]);return this.segment(w,C,U)};var T=l.query;return l.query=function(w,C){if(w===!0)return a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="function"){var U=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace),F=w.call(this,U);return this._parts.query=a.buildQuery(F||U,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!C),this}else return w!==void 0&&typeof w!="string"?(this._parts.query=a.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!C),this):T.call(this,w,C)},l.setQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="string"||w instanceof String)F[w]=C!==void 0?C:null;else if(typeof w=="object")for(var D in w)u.call(w,D)&&(F[D]=w[D]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.addQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(F,w,C===void 0?null:C),this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.removeQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(F,w,C),this._parts.query=a.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(U=C),this.build(!U),this},l.hasQuery=function(w,C,U){var F=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(F,w,C,U)},l.setSearch=l.setQuery,l.addSearch=l.addQuery,l.removeSearch=l.removeQuery,l.hasSearch=l.hasQuery,l.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()},l.normalizeProtocol=function(w){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!w)),this},l.normalizeHostname=function(w){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.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(!w)),this},l.normalizePort=function(w){return typeof this._parts.protocol=="string"&&this._parts.port===a.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!w)),this},l.normalizePath=function(w){var C=this._parts.path;if(!C)return this;if(this._parts.urn)return this._parts.path=a.recodeUrnPath(this._parts.path),this.build(!w),this;if(this._parts.path==="/")return this;C=a.recodePath(C);var U,F="",D,R;for(C.charAt(0)!=="/"&&(U=!0,C="/"+C),(C.slice(-3)==="/.."||C.slice(-2)==="/.")&&(C+="/"),C=C.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),U&&(F=C.substring(1).match(/^(\.\.\/)+/)||"",F&&(F=F[0]));D=C.search(/\/\.\.(\/|$)/),D!==-1;){if(D===0){C=C.substring(3);continue}R=C.substring(0,D).lastIndexOf("/"),R===-1&&(R=D),C=C.substring(0,R)+C.substring(D+3)}return U&&this.is("relative")&&(C=F+C.substring(1)),this._parts.path=C,this.build(!w),this},l.normalizePathname=l.normalizePath,l.normalizeQuery=function(w){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(a.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!w)),this},l.normalizeFragment=function(w){return this._parts.fragment||(this._parts.fragment=null,this.build(!w)),this},l.normalizeSearch=l.normalizeQuery,l.normalizeHash=l.normalizeFragment,l.iso8859=function(){var w=a.encode,C=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=w,a.decode=C}return this},l.unicode=function(){var w=a.encode,C=a.decode;a.encode=m,a.decode=unescape;try{this.normalize()}finally{a.encode=w,a.decode=C}return this},l.readable=function(){var w=this.clone();w.username("").password("").normalize();var C="";if(w._parts.protocol&&(C+=w._parts.protocol+"://"),w._parts.hostname&&(w.is("punycode")&&n?(C+=n.toUnicode(w._parts.hostname),w._parts.port&&(C+=":"+w._parts.port)):C+=w.host()),w._parts.hostname&&w._parts.path&&w._parts.path.charAt(0)!=="/"&&(C+="/"),C+=w.path(!0),w._parts.query){for(var U="",F=0,D=w._parts.query.split("&"),R=D.length;F<R;F++){var L=(D[F]||"").split("=");U+="&"+a.decodeQuery(L[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),L[1]!==void 0&&(U+="="+a.decodeQuery(L[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}C+="?"+U.substring(1)}return C+=a.decodeQuery(w.hash(),!0),C},l.absoluteTo=function(w){var C=this.clone(),U=["protocol","username","password","hostname","port"],F,D,R;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w instanceof a||(w=new a(w)),C._parts.protocol||(C._parts.protocol=w._parts.protocol,this._parts.hostname))return C;for(D=0;R=U[D];D++)C._parts[R]=w._parts[R];return C._parts.path?(C._parts.path.substring(-2)===".."&&(C._parts.path+="/"),C.path().charAt(0)!=="/"&&(F=w.directory(),F=F||(w.path().indexOf("/")===0?"/":""),C._parts.path=(F?F+"/":"")+C._parts.path,C.normalizePath())):(C._parts.path=w._parts.path,C._parts.query||(C._parts.query=w._parts.query)),C.build(),C},l.relativeTo=function(w){var C=this.clone().normalize(),U,F,D,R,L;if(C._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w=new a(w).normalize(),U=C._parts,F=w._parts,R=C.path(),L=w.path(),R.charAt(0)!=="/")throw new Error("URI is already relative");if(L.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(U.protocol===F.protocol&&(U.protocol=null),U.username!==F.username||U.password!==F.password||U.protocol!==null||U.username!==null||U.password!==null)return C.build();if(U.hostname===F.hostname&&U.port===F.port)U.hostname=null,U.port=null;else return C.build();if(R===L)return U.path="",C.build();if(D=a.commonPath(R,L),!D)return C.build();var k=F.path.substring(D.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return U.path=k+U.path.substring(D.length)||"./",C.build()},l.equals=function(w){var C=this.clone(),U=new a(w),F={},D={},R={},L,k,Q;if(C.normalize(),U.normalize(),C.toString()===U.toString())return!0;if(L=C.query(),k=U.query(),C.query(""),U.query(""),C.toString()!==U.toString()||L.length!==k.length)return!1;F=a.parseQuery(L,this._parts.escapeQuerySpace),D=a.parseQuery(k,this._parts.escapeQuerySpace);for(Q in F)if(u.call(F,Q)){if(f(F[Q])){if(!g(F[Q],D[Q]))return!1}else if(F[Q]!==D[Q])return!1;R[Q]=!0}for(Q in D)if(u.call(D,Q)&&!R[Q])return!1;return!0},l.preventInvalidHostname=function(w){return this._parts.preventInvalidHostname=!!w,this},l.duplicateQueryParameters=function(w){return this._parts.duplicateQueryParameters=!!w,this},l.escapeQuerySpace=function(w){return this._parts.escapeQuerySpace=!!w,this},a})})(wA)),wA.exports}var iR=nR();const Wi=Al(iR);function rR(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function Ls(t,n){if(t===null||typeof t!="object")return t;n=n??!1;const e=new t.constructor;for(const i in t)if(t.hasOwnProperty(i)){let o=t[i];n&&(o=Ls(o,n)),e[i]=o}return e}function Or(t,n,e){e=e??!1;const i={},o=ne(t),r=ne(n);let a,s,l;if(o)for(a in t)t.hasOwnProperty(a)&&(s=t[a],r&&e&&typeof s=="object"&&n.hasOwnProperty(a)?(l=n[a],typeof l=="object"?i[a]=Or(s,l,e):i[a]=s):i[a]=s);if(r)for(a in n)n.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(l=n[a],i[a]=l);return i}function gl(){let t,n;const e=new Promise(function(i,o){t=i,n=o});return{resolve:t,reject:n,promise:e}}function yl(t,n){let e;return typeof document<"u"&&(e=document),yl._implementation(t,n,e)}yl._implementation=function(t,n,e){if(!ne(t))throw new pe("relative uri is required.");if(!ne(n)){if(typeof e>"u")return t;n=e.baseURI??e.location.href}const i=new Wi(t);return i.scheme()!==""?i.toString():i.absoluteTo(n).toString()};function oR(t,n){if(!ne(t))throw new pe("uri is required.");let e="";const i=t.lastIndexOf("/");return i!==-1&&(e=t.substring(0,i+1)),n&&(t=new Wi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function sR(t){if(!ne(t))throw new pe("uri is required.");const n=new Wi(t);n.normalize();let e=n.path(),i=e.lastIndexOf("/");return i!==-1&&(e=e.substr(i+1)),i=e.lastIndexOf("."),i===-1?e="":e=e.substr(i+1),e}const Ib={};function Fb(t,n,e){ne(n)||(n=t.width),ne(e)||(e=t.height);let i=Ib[n];ne(i)||(i={},Ib[n]=i);let o=i[e];if(!ne(o)){const r=document.createElement("canvas");r.width=n,r.height=e,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[e]=o}return o.drawImage(t,0,0,n,e),o.getImageData(0,0,n,e).data}const aR=/^blob:/i;function Mb(t){return N.typeOf.string("uri",t),aR.test(t)}let yi;function Td(t){ne(yi)||(yi=document.createElement("a")),yi.href=window.location.href;const n=yi.host,e=yi.protocol;return yi.href=t,yi.href=yi.href,e!==yi.protocol||n!==yi.host}const lR=/^data:/i;function Db(t){return N.typeOf.string("uri",t),lR.test(t)}function uR(t){const n=document.createElement("script");return n.async=!0,n.src=t,new Promise((e,i)=>{window.crossOriginIsolated&&n.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];n.onload=function(){n.onload=void 0,o.removeChild(n),e()},n.onerror=function(r){i(r)},o.appendChild(n)})}function cR(t){if(!ne(t))throw new pe("obj is required.");let n="";for(const e in t)if(t.hasOwnProperty(e)){const i=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(i))for(let r=0,a=i.length;r<a;++r)n+=`${o+encodeURIComponent(i[r])}&`;else n+=`${o+encodeURIComponent(i)}&`}return n=n.slice(0,-1),n}function hR(t){if(!ne(t))throw new pe("queryString is required.");const n={};if(t==="")return n;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=e.length;i<o;++i){const r=e[i].split("="),a=decodeURIComponent(r[0]);let s=r[1];ne(s)?s=decodeURIComponent(s):s="";const l=n[a];typeof l=="string"?n[a]=[l,s]:Array.isArray(l)?l.push(s):n[a]=s}return n}const vt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),AR=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function _A(t){t=t??gi.EMPTY_OBJECT;const n=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=n,this.type=t.type??AR.OTHER,this.serverKey=t.serverKey,this.state=vt.UNISSUED,this.deferred=void 0,this.cancelled=!1}_A.prototype.cancel=function(){this.cancelled=!0},_A.prototype.clone=function(t){return ne(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=vt.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new _A(this)};function fR(t){const n={};if(!t)return n;const e=t.split(`\r
383
+ `);for(let i=0;i<e.length;++i){const o=e[i],r=o.indexOf(": ");if(r>0){const a=o.substring(0,r),s=o.substring(r+2);n[a]=s}}return n}function vl(t,n,e){this.statusCode=t,this.response=n,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=fR(this.responseHeaders))}vl.prototype.toString=function(){let t="Request has failed.";return ne(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function zs(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(zs.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),zs.prototype.addEventListener=function(t,n){N.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(n);const e=this;return function(){e.removeEventListener(t,n)}},zs.prototype.removeEventListener=function(t,n){N.typeOf.func("listener",t);const e=this._listeners,i=this._scopes;let o=-1;for(let r=0;r<e.length;r++)if(e[r]===t&&i[r]===n){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,i[o]=void 0):(e.splice(o,1),i.splice(o,1)),!0):!1};function pR(t,n){return n-t}zs.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const n=this._listeners,e=this._scopes;let i=n.length;for(t=0;t<i;t++){const r=n[t];ne(r)&&n[t].apply(e[t],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(pR),t=0;t<i;t++){const r=o[t];n.splice(r,1),e.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};function Bo(t){N.typeOf.object("options",t),N.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Bo.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){N.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const n=this._length;if(t<n){const e=this._array;for(let i=t;i<n;++i)e[i]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Id(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}Bo.prototype.reserve=function(t){t=t??this._length,this._array.length=t},Bo.prototype.heapify=function(t){t=t??0;const n=this._length,e=this._comparator,i=this._array;let o=-1,r=!0;for(;r;){const a=2*(t+1),s=a-1;s<n&&e(i[s],i[t])<0?o=s:o=t,a<n&&e(i[a],i[o])<0&&(o=a),o!==t?(Id(i,o,t),t=o):r=!1}},Bo.prototype.resort=function(){const t=this._length;for(let n=Math.ceil(t/2);n>=0;--n)this.heapify(n)},Bo.prototype.insert=function(t){N.defined("element",t);const n=this._array,e=this._comparator,i=this._maximumLength;let o=this._length++;for(o<n.length?n[o]=t:n.push(t);o!==0;){const a=Math.floor((o-1)/2);if(e(n[o],n[a])<0)Id(n,o,a),o=a;else break}let r;return ne(i)&&this._length>i&&(r=n[i],this._length=i),r},Bo.prototype.pop=function(t){if(t=t??0,this._length===0)return;N.typeOf.number.lessThan("index",t,this._length);const n=this._array,e=n[t];return Id(n,t,--this._length),this.heapify(t),n[this._length]=void 0,e};function dR(t,n){return t.priority-n.priority}const qe={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ks=20;const Yt=new Bo({comparator:dR});Yt.maximumLength=ks,Yt.reserve(ks);const vi=[];let ji={};const mR=typeof document<"u"?new Wi(document.location.href):new Wi,CA=new zs;function it(){}it.maximumRequests=50,it.maximumRequestsPerServer=18,it.requestsByServer={},it.throttleRequests=!0,it.debugShowStatistics=!1,it.requestCompletedEvent=CA,Object.defineProperties(it,{statistics:{get:function(){return qe}},priorityHeapLength:{get:function(){return ks},set:function(t){if(t<ks)for(;Yt.length>t;){const n=Yt.pop();To(n)}ks=t,Yt.maximumLength=t,Yt.reserve(t)}}});function Rb(t){ne(t.priorityFunction)&&(t.priority=t.priorityFunction())}it.serverHasOpenSlots=function(t,n){n=n??1;const e=it.requestsByServer[t]??it.maximumRequestsPerServer;return ji[t]+n<=e},it.heapHasOpenSlots=function(t){return Yt.length+t<=ks};function Ub(t){return t.state===vt.UNISSUED&&(t.state=vt.ISSUED,t.deferred=gl()),t.deferred.promise}function gR(t){return function(n){if(t.state===vt.CANCELLED)return;const e=t.deferred;--qe.numberOfActiveRequests,--ji[t.serverKey],CA.raiseEvent(),t.state=vt.RECEIVED,t.deferred=void 0,e.resolve(n)}}function yR(t){return function(n){t.state!==vt.CANCELLED&&(++qe.numberOfFailedRequests,--qe.numberOfActiveRequests,--ji[t.serverKey],CA.raiseEvent(n),t.state=vt.FAILED,t.deferred.reject(n))}}function Ob(t){const n=Ub(t);return t.state=vt.ACTIVE,vi.push(t),++qe.numberOfActiveRequests,++qe.numberOfActiveRequestsEver,++ji[t.serverKey],t.requestFunction().then(gR(t)).catch(yR(t)),n}function To(t){const n=t.state===vt.ACTIVE;if(t.state=vt.CANCELLED,++qe.numberOfCancelledRequests,ne(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}n&&(--qe.numberOfActiveRequests,--ji[t.serverKey],++qe.numberOfCancelledActiveRequests),ne(t.cancelFunction)&&t.cancelFunction()}it.update=function(){let t,n,e=0;const i=vi.length;for(t=0;t<i;++t){if(n=vi[t],n.cancelled&&To(n),n.state!==vt.ACTIVE){++e;continue}e>0&&(vi[t-e]=n)}vi.length-=e;const o=Yt.internalArray,r=Yt.length;for(t=0;t<r;++t)Rb(o[t]);Yt.resort();const a=Math.max(it.maximumRequests-vi.length,0);let s=0;for(;s<a&&Yt.length>0;){if(n=Yt.pop(),n.cancelled){To(n);continue}if(n.throttleByServer&&!it.serverHasOpenSlots(n.serverKey)){To(n);continue}Ob(n),++s}vR()},it.getServerKey=function(t){N.typeOf.string("url",t);let n=new Wi(t);n.scheme()===""&&(n=n.absoluteTo(mR),n.normalize());let e=n.authority();/:/.test(e)||(e=`${e}:${n.scheme()==="https"?"443":"80"}`);const i=ji[e];return ne(i)||(ji[e]=0),e},it.request=function(t){if(N.typeOf.object("request",t),N.typeOf.string("request.url",t.url),N.typeOf.func("request.requestFunction",t.requestFunction),Db(t.url)||Mb(t.url))return CA.raiseEvent(),t.state=vt.RECEIVED,t.requestFunction();if(++qe.numberOfAttemptedRequests,ne(t.serverKey)||(t.serverKey=it.getServerKey(t.url)),it.throttleRequests&&t.throttleByServer&&!it.serverHasOpenSlots(t.serverKey))return;if(!it.throttleRequests||!t.throttle)return Ob(t);if(vi.length>=it.maximumRequests)return;Rb(t);const n=Yt.insert(t);if(ne(n)){if(n===t)return;To(n)}return Ub(t)};function vR(){it.debugShowStatistics&&(qe.numberOfActiveRequests===0&&qe.lastNumberOfActiveRequests>0&&(qe.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${qe.numberOfAttemptedRequests}`),qe.numberOfAttemptedRequests=0),qe.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${qe.numberOfCancelledRequests}`),qe.numberOfCancelledRequests=0),qe.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${qe.numberOfCancelledActiveRequests}`),qe.numberOfCancelledActiveRequests=0),qe.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${qe.numberOfFailedRequests}`),qe.numberOfFailedRequests=0)),qe.lastNumberOfActiveRequests=qe.numberOfActiveRequests)}it.clearForSpecs=function(){for(;Yt.length>0;){const n=Yt.pop();To(n)}const t=vi.length;for(let n=0;n<t;++n)To(vi[n]);vi.length=0,ji={},qe.numberOfAttemptedRequests=0,qe.numberOfActiveRequests=0,qe.numberOfCancelledRequests=0,qe.numberOfCancelledActiveRequests=0,qe.numberOfFailedRequests=0,qe.numberOfActiveRequestsEver=0,qe.lastNumberOfActiveRequests=0},it.numberOfActiveRequestsByServer=function(t){return ji[t]},it.requestHeap=Yt;const Qs={};let Vs={};Qs.add=function(t,n){if(!ne(t))throw new pe("host is required.");if(!ne(n)||n<=0)throw new pe("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${n}`;ne(Vs[e])||(Vs[e]=!0)},Qs.remove=function(t,n){if(!ne(t))throw new pe("host is required.");if(!ne(n)||n<=0)throw new pe("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${n}`;ne(Vs[e])&&delete Vs[e]};function wR(t){const n=new Wi(t);n.normalize();let e=n.authority();if(e.length!==0){if(n.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let i=n.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")e+=":80";else if(i==="https")e+=":443";else return}return e}}Qs.contains=function(t){if(!ne(t))throw new pe("url is required.");const n=wR(t);return!!(ne(n)&&ne(Vs[n]))},Qs.clear=function(){Vs={}};const Lb=(function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}})();function xe(t){t=t??gi.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),N.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=wi(t.templateValues,{}),this._queryParameters=wi(t.queryParameters,{}),this.headers=wi(t.headers,{}),this.request=t.request??new _A,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 wi(t,n){return ne(t)?Ls(t):n}xe.createIfNeeded=function(t){return t instanceof xe?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new xe({url:t})};let Ns;xe.supportsImageBitmapOptions=function(){return ne(Ns)?Ns:typeof createImageBitmap!="function"?(Ns=Promise.resolve(!1),Ns):(Ns=xe.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(n){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(n,e),createImageBitmap(n)])}).then(function(n){const e=Fb(n[0]),i=Fb(n[1]);return e[1]!==i[1]}).catch(function(){return!1}),Ns)},Object.defineProperties(xe,{isBlobSupported:{get:function(){return Lb}}}),Object.defineProperties(xe.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 sR(this._url)}},isDataUri:{get:function(){return Db(this._url)}},isBlobUri:{get:function(){return Mb(this._url)}},isCrossOriginUrl:{get:function(){return Td(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),xe.prototype.toString=function(){return this.getUrlComponent(!0,!0)},xe.prototype.parseUrl=function(t,n,e,i){let o=new Wi(t);const r=bR(o.query());this._queryParameters=n?SA(r,this.queryParameters,e):r,o.search(""),o.fragment(""),ne(i)&&o.scheme()===""&&(o=o.absoluteTo(yl(i))),this._url=o.toString()};function bR(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:hR(t)}function SA(t,n,e){if(!e)return Or(t,n);const i=Ls(t,!0);for(const o in n)if(n.hasOwnProperty(o)){let r=i[o];const a=n[o];ne(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}xe.prototype.getUrlComponent=function(t,n){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${xR(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(e=e.replace(/{(.*?)}/g,function(o,r){const a=i[r];return ne(a)?encodeURIComponent(a):o})),n&&ne(this.proxy)&&(e=this.proxy.getURL(e)),e};function xR(t){const n=Object.keys(t);return n.length===0?"":n.length===1&&!ne(t[n[0]])?`?${n[0]}`:`?${cR(t)}`}xe.prototype.setQueryParameters=function(t,n){n?this._queryParameters=SA(this._queryParameters,t,!1):this._queryParameters=SA(t,this._queryParameters,!1)},xe.prototype.appendQueryParameters=function(t){this._queryParameters=SA(t,this._queryParameters,!0)},xe.prototype.setTemplateValues=function(t,n){n?this._templateValues=Or(this._templateValues,t):this._templateValues=Or(t,this._templateValues)},xe.prototype.getDerivedResource=function(t){const n=this.clone();if(n._retryCount=0,ne(t.url)){const e=t.preserveQueryParameters??!1;n.parseUrl(t.url,!0,e,this._url)}return ne(t.queryParameters)&&(n._queryParameters=Or(t.queryParameters,n.queryParameters)),ne(t.templateValues)&&(n._templateValues=Or(t.templateValues,n.templateValues)),ne(t.headers)&&(n.headers=Or(t.headers,n.headers)),ne(t.proxy)&&(n.proxy=t.proxy),ne(t.request)&&(n.request=t.request),ne(t.retryCallback)&&(n.retryCallback=t.retryCallback),ne(t.retryAttempts)&&(n.retryAttempts=t.retryAttempts),n},xe.prototype.retryOnError=function(t){const n=this.retryCallback;if(typeof n!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(n(this,t)).then(function(i){return++e._retryCount,i})},xe.prototype.clone=function(t){return ne(t)?(t._url=this._url,t._queryParameters=Ls(this._queryParameters),t._templateValues=Ls(this._templateValues),t.headers=Ls(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new xe({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:ne(this.credits)?this.credits.slice():void 0})},xe.prototype.getBaseUri=function(t){return oR(this.getUrlComponent(t),t)},xe.prototype.appendForwardSlash=function(){this._url=rR(this._url)},xe.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},xe.fetchArrayBuffer=function(t){return new xe(t).fetchArrayBuffer()},xe.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},xe.fetchBlob=function(t){return new xe(t).fetchBlob()},xe.prototype.fetchImage=function(t){t=t??gi.EMPTY_OBJECT;const n=t.preferImageBitmap??!1,e=t.preferBlob??!1,i=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(Md(this.request),!Lb||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return Fd({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:n});const r=this.fetchBlob();if(!ne(r))return;let a,s,l,u;return xe.supportsImageBitmapOptions().then(function(A){return a=A,s=a&&n,r}).then(function(A){if(!ne(A))return;if(u=A,s)return xe.createImageBitmapFromBlob(A,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const c=window.URL.createObjectURL(A);return l=new xe({url:c}),Fd({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(A){if(ne(A))return A.blob=u,s||window.URL.revokeObjectURL(l.url),A}).catch(function(A){return ne(l)&&window.URL.revokeObjectURL(l.url),A.blob=u,Promise.reject(A)})};function Fd(t){const n=t.resource,e=t.flipY,i=t.skipColorSpaceConversion,o=t.preferImageBitmap,r=n.request;r.url=n.url,r.requestFunction=function(){let s=!1;!n.isDataUri&&!n.isBlobUri&&(s=n.isCrossOriginUrl);const l=gl();return xe._Implementations.createImage(r,s,l,e,i,o),l.promise};const a=it.request(r);if(ne(a))return a.catch(function(s){return r.state!==vt.FAILED?Promise.reject(s):n.retryOnError(s).then(function(l){return l?(r.state=vt.UNISSUED,r.deferred=void 0,Fd({resource:n,flipY:e,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(s)})})}xe.fetchImage=function(t){return new xe(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},xe.prototype.fetchText=function(){return this.fetch({responseType:"text"})},xe.fetchText=function(t){return new xe(t).fetchText()},xe.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(ne(t))return t.then(function(n){if(ne(n))return JSON.parse(n)})},xe.fetchJson=function(t){return new xe(t).fetchJson()},xe.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},xe.fetchXML=function(t){return new xe(t).fetchXML()},xe.prototype.fetchJsonp=function(t){t=t??"callback",Md(this.request);let n;do n=`loadJsonp${he.nextRandomNumber().toString().substring(2,8)}`;while(ne(window[n]));return zb(this,t,n)};function zb(t,n,e){const i={};i[n]=e,t.setQueryParameters(i);const o=t.request,r=t.url;o.url=r,o.requestFunction=function(){const s=gl();return window[e]=function(l){s.resolve(l);try{delete window[e]}catch{window[e]=void 0}},xe._Implementations.loadAndExecuteScript(r,e,s),s.promise};const a=it.request(o);if(ne(a))return a.catch(function(s){return o.state!==vt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(l){return l?(o.state=vt.UNISSUED,o.deferred=void 0,zb(t,n,e)):Promise.reject(s)})})}xe.fetchJsonp=function(t){return new xe(t).fetchJsonp(t.callbackParameterName)},xe.prototype._makeRequest=function(t){const n=this;Md(n.request);const e=n.request,i=n.url;e.url=i,e.requestFunction=function(){const r=t.responseType,a=Or(t.headers,n.headers),s=t.overrideMimeType,l=t.method,u=t.data,A=gl(),c=xe._Implementations.loadWithXhr(i,r,l,u,a,A,s);return ne(c)&&ne(c.abort)&&(e.cancelFunction=function(){c.abort()}),A.promise};const o=it.request(e);if(ne(o))return o.then(function(r){return e.cancelFunction=void 0,r}).catch(function(r){return e.cancelFunction=void 0,e.state!==vt.FAILED?Promise.reject(r):n.retryOnError(r).then(function(a){return a?(e.state=vt.UNISSUED,e.deferred=void 0,n.fetch(t)):Promise.reject(r)})})};function Md(t){if(t.state===vt.ISSUED||t.state===vt.ACTIVE)throw new Nt("The Resource is already being fetched.");t.state=vt.UNISSUED,t.deferred=void 0}const _R=/^data:(.*?)(;base64)?,(.*)$/;function EA(t,n){const e=decodeURIComponent(n);return t?atob(e):e}function kb(t,n){const e=EA(t,n),i=new ArrayBuffer(e.length),o=new Uint8Array(i);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);return i}function CR(t,n){n=n??"";const e=t[1],i=!!t[2],o=t[3];let r,a;switch(n){case"":case"text":return EA(i,o);case"arraybuffer":return kb(i,o);case"blob":return r=kb(i,o),new Blob([r],{type:e});case"document":return a=new DOMParser,a.parseFromString(EA(i,o),e);case"json":return JSON.parse(EA(i,o));default:throw new pe(`Unhandled responseType: ${n}`)}}xe.prototype.fetch=function(t){return t=wi(t,{}),t.method="GET",this._makeRequest(t)},xe.fetch=function(t){return new xe(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.delete=function(t){return t=wi(t,{}),t.method="DELETE",this._makeRequest(t)},xe.delete=function(t){return new xe(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},xe.prototype.head=function(t){return t=wi(t,{}),t.method="HEAD",this._makeRequest(t)},xe.head=function(t){return new xe(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.options=function(t){return t=wi(t,{}),t.method="OPTIONS",this._makeRequest(t)},xe.options=function(t){return new xe(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.post=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="POST",n.data=t,this._makeRequest(n)},xe.post=function(t){return new xe(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.put=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="PUT",n.data=t,this._makeRequest(n)},xe.put=function(t){return new xe(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe.prototype.patch=function(t,n){return N.defined("data",t),n=wi(n,{}),n.method="PATCH",n.data=t,this._makeRequest(n)},xe.patch=function(t){return new xe(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},xe._Implementations={},xe._Implementations.loadImageElement=function(t,n,e){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),e.resolve(i)},i.onerror=function(o){e.reject(o)},n&&(Qs.contains(t)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=t},xe._Implementations.createImage=function(t,n,e,i,o,r){const a=t.url;xe.supportsImageBitmapOptions().then(function(s){if(!(s&&r)){xe._Implementations.loadImageElement(a,n,e);return}const l="blob",u="GET",A=gl(),c=xe._Implementations.loadWithXhr(a,l,u,void 0,void 0,A,void 0,void 0,void 0);return ne(c)&&ne(c.abort)&&(t.cancelFunction=function(){c.abort()}),A.promise.then(function(f){if(!ne(f)){e.reject(new Nt(`Successfully retrieved ${a} but it contained no content.`));return}return xe.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(s){e.reject(s)})},xe.createImageBitmapFromBlob=function(t,n){return N.defined("options",n),N.typeOf.bool("options.flipY",n.flipY),N.typeOf.bool("options.premultiplyAlpha",n.premultiplyAlpha),N.typeOf.bool("options.skipColorSpaceConversion",n.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:n.flipY?"flipY":"from-image",premultiplyAlpha:n.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:n.skipColorSpaceConversion?"none":"default"})};function SR(t,n,e,i,o,r,a){fetch(t,{method:e,headers:o}).then(async s=>{if(!s.ok){const l={};s.headers.forEach((u,A)=>{l[A]=u}),r.reject(new vl(s.status,s,l));return}switch(n){case"text":r.resolve(s.text());break;case"json":r.resolve(s.json());break;default:r.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new vl)})}const ER=typeof XMLHttpRequest>"u";xe._Implementations.loadWithXhr=function(t,n,e,i,o,r,a){const s=_R.exec(t);if(s!==null){r.resolve(CR(s,n));return}if(ER){SR(t,n,e,i,o,r);return}const l=new XMLHttpRequest;if(Qs.contains(t)&&(l.withCredentials=!0),l.open(e,t,!0),ne(a)&&ne(l.overrideMimeType)&&l.overrideMimeType(a),ne(o))for(const A in o)o.hasOwnProperty(A)&&l.setRequestHeader(A,o[A]);ne(n)&&(l.responseType=n);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new vl(l.status,l.response,l.getAllResponseHeaders()));return}const A=l.response,c=l.responseType;if(e==="HEAD"||e==="OPTIONS"){const d=l.getAllResponseHeaders().trim().split(/[\r\n]+/),p={};d.forEach(function(g){const v=g.split(": "),y=v.shift();p[y]=v.join(": ")}),r.resolve(p);return}if(l.status===204)r.resolve(void 0);else if(ne(A)&&(!ne(n)||c===n))r.resolve(A);else if(n==="json"&&typeof A=="string")try{r.resolve(JSON.parse(A))}catch(f){r.reject(f)}else(c===""||c==="document")&&ne(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(c===""||c==="text")&&ne(l.responseText)?r.resolve(l.responseText):r.reject(new Nt("Invalid XMLHttpRequest response type."))},l.onerror=function(A){r.reject(new vl)},l.send(i),l},xe._Implementations.loadAndExecuteScript=function(t,n,e){return uR(t).catch(function(i){e.reject(i)})},xe._DefaultImplementations={},xe._DefaultImplementations.createImage=xe._Implementations.createImage,xe._DefaultImplementations.loadWithXhr=xe._Implementations.loadWithXhr,xe._DefaultImplementations.loadAndExecuteScript=xe._Implementations.loadAndExecuteScript,xe.DEFAULT=Object.freeze(new xe({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function wl(t){t=t??gi.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,ne(t.data)?Qb(this,t.data):Qb(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}wl.fromUrl=async function(t,n){N.defined("url",t),n=n??gi.EMPTY_OBJECT;const e=xe.createIfNeeded(t);let i;try{i=await e.fetchJson()}catch{throw new Nt(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new wl({addNewLeapSeconds:n.addNewLeapSeconds,data:i})},wl.NONE=Object.freeze({compute:function(t,n){return ne(n)?(n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0):n=new _d(0,0,0,0,0),n}}),wl.prototype.compute=function(t,n){if(!ne(this._samples))return;if(ne(n)||(n=new _d(0,0,0,0,0)),this._samples.length===0)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;const e=this._dates,i=this._lastIndex;let o=0,r=0;if(ne(i)){const s=e[i],l=e[i+1],u=we.lessThanOrEquals(s,t),A=!ne(l),c=A||we.greaterThanOrEquals(l,t);if(u&&c)return o=i,!A&&l.equals(t)&&++o,r=o+1,Nb(this,e,this._samples,t,o,r,n),n}let a=dl(e,t,we.compare,this._dateColumn);return a>=0?(a<e.length-1&&e[a+1].equals(t)&&++a,o=a,r=a):(r=~a,o=r-1,o<0&&(o=0)),this._lastIndex=o,Nb(this,e,this._samples,t,o,r,n),n};function PR(t,n){return we.compare(t.julianDate,n)}function Qb(t,n){if(!ne(n.columnNames))throw new Nt("Error in loaded EOP data: The columnNames property is required.");if(!ne(n.samples))throw new Nt("Error in loaded EOP data: The samples property is required.");const e=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),o=n.columnNames.indexOf("yPoleWanderRadians"),r=n.columnNames.indexOf("ut1MinusUtcSeconds"),a=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=n.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||i<0||o<0||r<0||a<0||s<0||l<0)throw new Nt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=n.samples,A=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=i,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=r,t._xCelestialPoleOffsetRadiansColumn=a,t._yCelestialPoleOffsetRadiansColumn=s,t._taiMinusUtcSecondsColumn=l,t._columnCount=n.columnNames.length,t._lastIndex=void 0;let c;const f=t._addNewLeapSeconds;for(let d=0,p=u.length;d<p;d+=t._columnCount){const g=u[d+e],v=u[d+l],y=g+pt.MODIFIED_JULIAN_DATE_DIFFERENCE,m=new we(y,v,Ve.TAI);if(A.push(m),f){if(v!==c&&ne(c)){const b=we.leapSeconds,x=dl(b,m,PR);if(x<0){const E=new Ye(m,v);b.splice(~x,0,E)}}c=v}}}function Vb(t,n,e,i,o){const r=e*i;o.xPoleWander=n[r+t._xPoleWanderRadiansColumn],o.yPoleWander=n[r+t._yPoleWanderRadiansColumn],o.xPoleOffset=n[r+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=n[r+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=n[r+t._ut1MinusUtcSecondsColumn]}function bl(t,n,e){return n+t*(e-n)}function Nb(t,n,e,i,o,r,a){const s=t._columnCount;if(r>n.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;const l=n[o],u=n[r];if(l.equals(u)||i.equals(l))return Vb(t,e,o,s,a),a;if(i.equals(u))return Vb(t,e,r,s,a),a;const A=we.secondsDifference(i,l)/we.secondsDifference(u,l),c=o*s,f=r*s;let d=e[c+t._ut1MinusUtcSecondsColumn],p=e[f+t._ut1MinusUtcSecondsColumn];const g=p-d;if(g>.5||g<-.5){const v=e[c+t._taiMinusUtcSecondsColumn],y=e[f+t._taiMinusUtcSecondsColumn];v!==y&&(u.equals(i)?d=p:p-=y-v)}return a.xPoleWander=bl(A,e[c+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),a.yPoleWander=bl(A,e[c+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),a.xPoleOffset=bl(A,e[c+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=bl(A,e[c+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=bl(A,d,p),a}function Rt(t,n,e){this.heading=t??0,this.pitch=n??0,this.roll=e??0}Rt.fromQuaternion=function(t,n){if(!ne(t))throw new pe("quaternion is required");ne(n)||(n=new Rt);const e=2*(t.w*t.y-t.z*t.x),i=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),r=1-2*(t.y*t.y+t.z*t.z),a=2*(t.w*t.z+t.x*t.y);return n.heading=-Math.atan2(a,r),n.roll=Math.atan2(o,i),n.pitch=-he.asinClamped(e),n},Rt.fromDegrees=function(t,n,e,i){if(!ne(t))throw new pe("heading is required");if(!ne(n))throw new pe("pitch is required");if(!ne(e))throw new pe("roll is required");return ne(i)||(i=new Rt),i.heading=t*he.RADIANS_PER_DEGREE,i.pitch=n*he.RADIANS_PER_DEGREE,i.roll=e*he.RADIANS_PER_DEGREE,i},Rt.clone=function(t,n){if(ne(t))return ne(n)?(n.heading=t.heading,n.pitch=t.pitch,n.roll=t.roll,n):new Rt(t.heading,t.pitch,t.roll)},Rt.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.heading===n.heading&&t.pitch===n.pitch&&t.roll===n.roll},Rt.equalsEpsilon=function(t,n,e,i){return t===n||ne(t)&&ne(n)&&he.equalsEpsilon(t.heading,n.heading,e,i)&&he.equalsEpsilon(t.pitch,n.pitch,e,i)&&he.equalsEpsilon(t.roll,n.roll,e,i)},Rt.prototype.clone=function(t){return Rt.clone(this,t)},Rt.prototype.equals=function(t){return Rt.equals(this,t)},Rt.prototype.equalsEpsilon=function(t,n,e){return Rt.equalsEpsilon(this,t,n,e)},Rt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Hb=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function BR(){const t=document.getElementsByTagName("script");for(let n=0,e=t.length;n<e;++n){const i=t[n].getAttribute("src"),o=Hb.exec(i);if(o!==null)return o[1]}}let PA;function Gb(t){return typeof document>"u"?t:(ne(PA)||(PA=document.createElement("a")),PA.href=t,PA.href)}let Io;function Wb(){if(ne(Io))return Io;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:ne(is&&is.tagName.toUpperCase()==="SCRIPT"&&is.src||new URL("earthsdk3-cesium.iife.js",document.baseURI).href)?t=yl(".",is&&is.tagName.toUpperCase()==="SCRIPT"&&is.src||new URL("earthsdk3-cesium.iife.js",document.baseURI).href):typeof define=="object"&&ne(define.amd)&&!define.amd.toUrlUndefined&&ne(require.toUrl)?t=yl("..",Gn("Core/buildModuleUrl.js")):t=BR(),!ne(t))throw new pe("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Io=new xe({url:Gb(t)}),Io.appendForwardSlash(),Io}function TR(t){return Gb(require.toUrl(`../${t}`))}function jb(t){return Wb().getDerivedResource({url:t}).url}let BA;function Gn(t){return ne(BA)||(typeof define=="object"&&ne(define.amd)&&!define.amd.toUrlUndefined&&ne(require.toUrl)?BA=TR:BA=jb),BA(t)}Gn._cesiumScriptRegex=Hb,Gn._buildModuleUrlFromBaseUrl=jb,Gn._clearBaseResource=function(){Io=void 0},Gn.setBaseUrl=function(t){Io=xe.DEFAULT.getDerivedResource({url:t})},Gn.getCesiumBaseUrl=Wb;function qb(t,n,e){this.x=t,this.y=n,this.s=e}function Dd(t){t=t??gi.EMPTY_OBJECT,this._xysFileUrlTemplate=xe.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new we(this._sampleZeroJulianEphemerisDate,0,Ve.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 n=this._interpolationOrder,e=this._denominators=new Array(n+1),i=this._xTable=new Array(n+1),o=Math.pow(this._stepSizeDays,n);for(let r=0;r<=n;++r){e[r]=o,i[r]=r*this._stepSizeDays;for(let a=0;a<=n;++a)a!==r&&(e[r]*=r-a);e[r]=1/e[r]}this._work=new Array(n+1),this._coef=new Array(n+1)}const IR=new we(0,0,Ve.TAI);function Rd(t,n,e){const i=IR;return i.dayNumber=n,i.secondsOfDay=e,we.daysDifference(i,t._sampleZeroDateTT)}Dd.prototype.preload=function(t,n,e,i){const o=Rd(this,t,n),r=Rd(this,e,i);let a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);const l=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,A=[];for(let c=l;c<=u;++c)A.push(Ud(this,c));return Promise.all(A)},Dd.prototype.computeXysRadians=function(t,n,e){const i=Rd(this,t,n);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const r=this._interpolationOrder;let a=o-(r/2|0);a<0&&(a=0);let s=a+r;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-r,a<0&&(a=0));let l=!1;const u=this._samples;if(ne(u[a*3])||(Ud(this,a/this._samplesPerXysFile|0),l=!0),ne(u[s*3])||(Ud(this,s/this._samplesPerXysFile|0),l=!0),l)return;ne(e)?(e.x=0,e.y=0,e.s=0):e=new qb(0,0,0);const A=i-a*this._stepSizeDays,c=this._work,f=this._denominators,d=this._coef,p=this._xTable;let g,v;for(g=0;g<=r;++g)c[g]=A-p[g];for(g=0;g<=r;++g){for(d[g]=1,v=0;v<=r;++v)v!==g&&(d[g]*=c[v]);d[g]*=f[g];let y=(a+g)*3;e.x+=d[g]*u[y++],e.y+=d[g]*u[y++],e.s+=d[g]*u[y]}return e};function Ud(t,n){if(t._chunkDownloadsInProgress[n])return t._chunkDownloadsInProgress[n];let e;const i=t._xysFileUrlTemplate;ne(i)?e=i.getDerivedResource({templateValues:{0:n}}):e=new xe({url:Gn(`Assets/IAU2006_XYS/IAU2006_XYS_${n}.json`)});const o=e.fetchJson().then(function(r){t._chunkDownloadsInProgress[n]=!1;const a=t._samples,s=r.samples,l=n*t._samplesPerXysFile*3;for(let u=0,A=s.length;u<A;++u)a[l+u]=s[u]});return t._chunkDownloadsInProgress[n]=o,o}function ve(t,n,e,i){this.x=t??0,this.y=n??0,this.z=e??0,this.w=i??0}let xl=new ae;ve.fromAxisAngle=function(t,n,e){N.typeOf.object("axis",t),N.typeOf.number("angle",n);const i=n/2,o=Math.sin(i);xl=ae.normalize(t,xl);const r=xl.x*o,a=xl.y*o,s=xl.z*o,l=Math.cos(i);return ne(e)?(e.x=r,e.y=a,e.z=s,e.w=l,e):new ve(r,a,s,l)};const FR=[1,2,0],MR=new Array(3);ve.fromRotationMatrix=function(t,n){N.typeOf.object("matrix",t);let e,i,o,r,a;const s=t[me.COLUMN0ROW0],l=t[me.COLUMN1ROW1],u=t[me.COLUMN2ROW2],A=s+l+u;if(A>0)e=Math.sqrt(A+1),a=.5*e,e=.5/e,i=(t[me.COLUMN1ROW2]-t[me.COLUMN2ROW1])*e,o=(t[me.COLUMN2ROW0]-t[me.COLUMN0ROW2])*e,r=(t[me.COLUMN0ROW1]-t[me.COLUMN1ROW0])*e;else{const c=FR;let f=0;l>s&&(f=1),u>s&&u>l&&(f=2);const d=c[f],p=c[d];e=Math.sqrt(t[me.getElementIndex(f,f)]-t[me.getElementIndex(d,d)]-t[me.getElementIndex(p,p)]+1);const g=MR;g[f]=.5*e,e=.5/e,a=(t[me.getElementIndex(p,d)]-t[me.getElementIndex(d,p)])*e,g[d]=(t[me.getElementIndex(d,f)]+t[me.getElementIndex(f,d)])*e,g[p]=(t[me.getElementIndex(p,f)]+t[me.getElementIndex(f,p)])*e,i=-g[0],o=-g[1],r=-g[2]}return ne(n)?(n.x=i,n.y=o,n.z=r,n.w=a,n):new ve(i,o,r,a)};const Kb=new ve;let Zb=new ve,Od=new ve,Xb=new ve;ve.fromHeadingPitchRoll=function(t,n){return N.typeOf.object("headingPitchRoll",t),Xb=ve.fromAxisAngle(ae.UNIT_X,t.roll,Kb),Od=ve.fromAxisAngle(ae.UNIT_Y,-t.pitch,n),n=ve.multiply(Od,Xb,Od),Zb=ve.fromAxisAngle(ae.UNIT_Z,-t.heading,Kb),ve.multiply(Zb,n,n)};const TA=new ae,Ld=new ae,ii=new ve,$b=new ve,IA=new ve;ve.packedLength=4,ve.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},ve.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new ve),e.x=t[n],e.y=t[n+1],e.z=t[n+2],e.w=t[n+3],e},ve.packedInterpolationLength=3,ve.convertPackedArrayForInterpolation=function(t,n,e,i){ve.unpack(t,e*4,IA),ve.conjugate(IA,IA);for(let o=0,r=e-n+1;o<r;o++){const a=o*3;ve.unpack(t,(n+o)*4,ii),ve.multiply(ii,IA,ii),ii.w<0&&ve.negate(ii,ii),ve.computeAxis(ii,TA);const s=ve.computeAngle(ii);ne(i)||(i=[]),i[a]=TA.x*s,i[a+1]=TA.y*s,i[a+2]=TA.z*s}},ve.unpackInterpolationResult=function(t,n,e,i,o){ne(o)||(o=new ve),ae.fromArray(t,0,Ld);const r=ae.magnitude(Ld);return ve.unpack(n,i*4,$b),r===0?ve.clone(ve.IDENTITY,ii):ve.fromAxisAngle(Ld,r,ii),ve.multiply(ii,$b,o)},ve.clone=function(t,n){if(ne(t))return ne(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new ve(t.x,t.y,t.z,t.w)},ve.conjugate=function(t,n){return N.typeOf.object("quaternion",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=t.w,n},ve.magnitudeSquared=function(t){return N.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},ve.magnitude=function(t){return Math.sqrt(ve.magnitudeSquared(t))},ve.normalize=function(t,n){N.typeOf.object("result",n);const e=1/ve.magnitude(t),i=t.x*e,o=t.y*e,r=t.z*e,a=t.w*e;return n.x=i,n.y=o,n.z=r,n.w=a,n},ve.inverse=function(t,n){N.typeOf.object("result",n);const e=ve.magnitudeSquared(t);return n=ve.conjugate(t,n),ve.multiplyByScalar(n,1/e,n)},ve.add=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},ve.subtract=function(t,n,e){return N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},ve.negate=function(t,n){return N.typeOf.object("quaternion",t),N.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},ve.dot=function(t,n){return N.typeOf.object("left",t),N.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},ve.multiply=function(t,n,e){N.typeOf.object("left",t),N.typeOf.object("right",n),N.typeOf.object("result",e);const i=t.x,o=t.y,r=t.z,a=t.w,s=n.x,l=n.y,u=n.z,A=n.w,c=a*s+i*A+o*u-r*l,f=a*l-i*u+o*A+r*s,d=a*u+i*l-o*s+r*A,p=a*A-i*s-o*l-r*u;return e.x=c,e.y=f,e.z=d,e.w=p,e},ve.multiplyByScalar=function(t,n,e){return N.typeOf.object("quaternion",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},ve.divideByScalar=function(t,n,e){return N.typeOf.object("quaternion",t),N.typeOf.number("scalar",n),N.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},ve.computeAxis=function(t,n){N.typeOf.object("quaternion",t),N.typeOf.object("result",n);const e=t.w;if(Math.abs(e-1)<he.EPSILON6||Math.abs(e+1)<he.EPSILON6)return n.x=1,n.y=n.z=0,n;const i=1/Math.sqrt(1-e*e);return n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n},ve.computeAngle=function(t){return N.typeOf.object("quaternion",t),Math.abs(t.w-1)<he.EPSILON6?0:2*Math.acos(t.w)};let zd=new ve;ve.lerp=function(t,n,e,i){return N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i),zd=ve.multiplyByScalar(n,e,zd),i=ve.multiplyByScalar(t,1-e,i),ve.add(zd,i,i)};let Yb=new ve,kd=new ve,Qd=new ve;ve.slerp=function(t,n,e,i){N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i);let o=ve.dot(t,n),r=n;if(o<0&&(o=-o,r=Yb=ve.negate(n,Yb)),1-o<he.EPSILON6)return ve.lerp(t,r,e,i);const a=Math.acos(o);return kd=ve.multiplyByScalar(t,Math.sin((1-e)*a),kd),Qd=ve.multiplyByScalar(r,Math.sin(e*a),Qd),i=ve.add(kd,Qd,i),ve.multiplyByScalar(i,1/Math.sin(a),i)},ve.log=function(t,n){N.typeOf.object("quaternion",t),N.typeOf.object("result",n);const e=he.acosClamped(t.w);let i=0;return e!==0&&(i=e/Math.sin(e)),ae.multiplyByScalar(t,i,n)},ve.exp=function(t,n){N.typeOf.object("cartesian",t),N.typeOf.object("result",n);const e=ae.magnitude(t);let i=0;return e!==0&&(i=Math.sin(e)/e),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(e),n};const DR=new ae,RR=new ae,_l=new ve,Hs=new ve;ve.computeInnerQuadrangle=function(t,n,e,i){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("q2",e),N.typeOf.object("result",i);const o=ve.conjugate(n,_l);ve.multiply(o,e,Hs);const r=ve.log(Hs,DR);ve.multiply(o,t,Hs);const a=ve.log(Hs,RR);return ae.add(r,a,r),ae.multiplyByScalar(r,.25,r),ae.negate(r,r),ve.exp(r,_l),ve.multiply(n,_l,i)},ve.squad=function(t,n,e,i,o,r){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("s0",e),N.typeOf.object("s1",i),N.typeOf.number("t",o),N.typeOf.object("result",r);const a=ve.slerp(t,n,o,_l),s=ve.slerp(e,i,o,Hs);return ve.slerp(a,s,2*o*(1-o),r)};const UR=new ve,Jb=1.9011074535173003,FA=Ht.supportsTypedArrays()?new Float32Array(8):[],MA=Ht.supportsTypedArrays()?new Float32Array(8):[],qi=Ht.supportsTypedArrays()?new Float32Array(8):[],Ki=Ht.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const n=t+1,e=2*n+1;FA[t]=1/(n*e),MA[t]=n/e}FA[7]=Jb/136,MA[7]=Jb*8/17,ve.fastSlerp=function(t,n,e,i){N.typeOf.object("start",t),N.typeOf.object("end",n),N.typeOf.number("t",e),N.typeOf.object("result",i);let o=ve.dot(t,n),r;o>=0?r=1:(r=-1,o=-o);const a=o-1,s=1-e,l=e*e,u=s*s;for(let d=7;d>=0;--d)qi[d]=(FA[d]*l-MA[d])*a,Ki[d]=(FA[d]*u-MA[d])*a;const A=r*e*(1+qi[0]*(1+qi[1]*(1+qi[2]*(1+qi[3]*(1+qi[4]*(1+qi[5]*(1+qi[6]*(1+qi[7])))))))),c=s*(1+Ki[0]*(1+Ki[1]*(1+Ki[2]*(1+Ki[3]*(1+Ki[4]*(1+Ki[5]*(1+Ki[6]*(1+Ki[7])))))))),f=ve.multiplyByScalar(t,c,UR);return ve.multiplyByScalar(n,A,i),ve.add(f,i,i)},ve.fastSquad=function(t,n,e,i,o,r){N.typeOf.object("q0",t),N.typeOf.object("q1",n),N.typeOf.object("s0",e),N.typeOf.object("s1",i),N.typeOf.number("t",o),N.typeOf.object("result",r);const a=ve.fastSlerp(t,n,o,_l),s=ve.fastSlerp(e,i,o,Hs);return ve.fastSlerp(a,s,2*o*(1-o),r)},ve.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},ve.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.x-n.x)<=e&&Math.abs(t.y-n.y)<=e&&Math.abs(t.z-n.z)<=e&&Math.abs(t.w-n.w)<=e},ve.ZERO=Object.freeze(new ve(0,0,0,0)),ve.IDENTITY=Object.freeze(new ve(0,0,0,1)),ve.prototype.clone=function(t){return ve.clone(this,t)},ve.prototype.equals=function(t){return ve.equals(this,t)},ve.prototype.equalsEpsilon=function(t,n){return ve.equalsEpsilon(this,t,n)},ve.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const ke={},Vd={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"}},Gs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Nd={},gn={east:new ae,north:new ae,up:new ae,west:new ae,south:new ae,down:new ae};let Lr=new ae,zr=new ae,kr=new ae;ke.localFrameToFixedFrameGenerator=function(t,n){if(!Vd.hasOwnProperty(t)||!Vd[t].hasOwnProperty(n))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=Vd[t][n];let i;const o=t+n;return ne(Nd[o])?i=Nd[o]:(i=function(r,a,s){if(!ne(r))throw new pe("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new pe("origin has a NaN component");if(ne(s)||(s=new ge),ae.equalsEpsilon(r,ae.ZERO,he.EPSILON14))ae.unpack(Gs[t],0,Lr),ae.unpack(Gs[n],0,zr),ae.unpack(Gs[e],0,kr);else if(he.equalsEpsilon(r.x,0,he.EPSILON14)&&he.equalsEpsilon(r.y,0,he.EPSILON14)){const l=he.sign(r.z);ae.unpack(Gs[t],0,Lr),t!=="east"&&t!=="west"&&ae.multiplyByScalar(Lr,l,Lr),ae.unpack(Gs[n],0,zr),n!=="east"&&n!=="west"&&ae.multiplyByScalar(zr,l,zr),ae.unpack(Gs[e],0,kr),e!=="east"&&e!=="west"&&ae.multiplyByScalar(kr,l,kr)}else{a=a??De.default,a.geodeticSurfaceNormal(r,gn.up);const l=gn.up,u=gn.east;u.x=-r.y,u.y=r.x,u.z=0,ae.normalize(u,gn.east),ae.cross(l,u,gn.north),ae.multiplyByScalar(gn.up,-1,gn.down),ae.multiplyByScalar(gn.east,-1,gn.west),ae.multiplyByScalar(gn.north,-1,gn.south),Lr=gn[t],zr=gn[n],kr=gn[e]}return s[0]=Lr.x,s[1]=Lr.y,s[2]=Lr.z,s[3]=0,s[4]=zr.x,s[5]=zr.y,s[6]=zr.z,s[7]=0,s[8]=kr.x,s[9]=kr.y,s[10]=kr.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},Nd[o]=i),i},ke.eastNorthUpToFixedFrame=ke.localFrameToFixedFrameGenerator("east","north"),ke.northEastDownToFixedFrame=ke.localFrameToFixedFrameGenerator("north","east"),ke.northUpEastToFixedFrame=ke.localFrameToFixedFrameGenerator("north","up"),ke.northWestUpToFixedFrame=ke.localFrameToFixedFrameGenerator("north","west");const OR=new ve,LR=new ae(1,1,1),zR=new ge;ke.headingPitchRollToFixedFrame=function(t,n,e,i,o){N.typeOf.object("HeadingPitchRoll",n),i=i??ke.eastNorthUpToFixedFrame;const r=ve.fromHeadingPitchRoll(n,OR),a=ge.fromTranslationQuaternionRotationScale(ae.ZERO,r,LR,zR);return o=i(t,e,o),ge.multiply(o,a,o)};const kR=new ge,QR=new me;ke.headingPitchRollQuaternion=function(t,n,e,i,o){N.typeOf.object("HeadingPitchRoll",n);const r=ke.headingPitchRollToFixedFrame(t,n,e,i,kR),a=ge.getMatrix3(r,QR);return ve.fromRotationMatrix(a,o)};const VR=new ae(1,1,1),NR=new ae,ex=new ge,HR=new ge,GR=new me,WR=new ve;ke.fixedFrameToHeadingPitchRoll=function(t,n,e,i){N.defined("transform",t),n=n??De.default,e=e??ke.eastNorthUpToFixedFrame,ne(i)||(i=new Rt);const o=ge.getTranslation(t,NR);if(ae.equals(o,ae.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=ge.inverseTransformation(e(o,n,ex),ex),a=ge.setScale(t,VR,HR);a=ge.setTranslation(a,ae.ZERO,a),r=ge.multiply(r,a,r);let s=ve.fromRotationMatrix(ge.getMatrix3(r,GR),WR);return s=ve.normalize(s,s),Rt.fromQuaternion(s,i)};const jR=6*3600+2460+50.54841,qR=8640184812866e-6,KR=.093104,ZR=-62e-7,XR=11772758384668e-32,$R=72921158553e-15,YR=he.TWO_PI/86400;let DA=new we;ke.computeIcrfToCentralBodyFixedMatrix=function(t,n){let e=ke.computeIcrfToFixedMatrix(t,n);return ne(e)||(e=ke.computeTemeToPseudoFixedMatrix(t,n)),e},ke.computeTemeToPseudoFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");DA=we.addSeconds(t,-we.computeTaiMinusUtc(t),DA);const e=DA.dayNumber,i=DA.secondsOfDay;let o;const r=e-2451545;i>=43200?o=(r+.5)/pt.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/pt.DAYS_PER_JULIAN_CENTURY;const s=(jR+o*(qR+o*(KR+o*ZR)))*YR%he.TWO_PI,l=$R+XR*(e-24515455e-1),u=(i+pt.SECONDS_PER_DAY*.5)%pt.SECONDS_PER_DAY,A=s+l*u,c=Math.cos(A),f=Math.sin(A);return ne(n)?(n[0]=c,n[1]=-f,n[2]=0,n[3]=f,n[4]=c,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new me(c,f,0,-f,c,0,0,0,1)},ke.iau2006XysData=new Dd,ke.earthOrientationParameters=wl.NONE;const Hd=32.184,JR=2451545;ke.preloadIcrfFixed=function(t){const n=t.start.dayNumber,e=t.start.secondsOfDay+Hd,i=t.stop.dayNumber,o=t.stop.secondsOfDay+Hd;return ke.iau2006XysData.preload(n,e,i,o)},ke.computeIcrfToFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.computeFixedToIcrfMatrix(t,n);if(ne(e))return me.transpose(e,n)};const e5=32.184,t5=2451545,RA=new Rt,n5=new me,i5=new we;ke.computeMoonFixedToIcrfMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");const e=we.addSeconds(t,e5,i5),i=we.totalDays(e)-t5,o=he.toRadians(12.112)-he.toRadians(.052992)*i,r=he.toRadians(24.224)-he.toRadians(.105984)*i,a=he.toRadians(227.645)+he.toRadians(13.012)*i,s=he.toRadians(261.105)+he.toRadians(13.340716)*i,l=he.toRadians(358)+he.toRadians(.9856)*i;return RA.pitch=he.toRadians(180)-he.toRadians(3.878)*Math.sin(o)-he.toRadians(.12)*Math.sin(r)+he.toRadians(.07)*Math.sin(a)-he.toRadians(.017)*Math.sin(s),RA.roll=he.toRadians(-23.47)+he.toRadians(1.543)*Math.cos(o)+he.toRadians(.24)*Math.cos(r)-he.toRadians(.028)*Math.cos(a)+he.toRadians(.007)*Math.cos(s),RA.heading=he.toRadians(154.375)+he.toRadians(13.17635831)*i+he.toRadians(3.558)*Math.sin(o)+he.toRadians(.121)*Math.sin(r)-he.toRadians(.064)*Math.sin(a)+he.toRadians(.016)*Math.sin(s)+he.toRadians(.025)*Math.sin(l),me.fromHeadingPitchRoll(RA,n5)},ke.computeIcrfToMoonFixedMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.computeMoonFixedToIcrfMatrix(t,n);if(ne(e))return me.transpose(e,n)};const r5=new qb(0,0,0),o5=new _d(0,0,0,0,0),Gd=new me,Wd=new me;ke.computeFixedToIcrfMatrix=function(t,n){if(!ne(t))throw new pe("date is required.");ne(n)||(n=new me);const e=ke.earthOrientationParameters.compute(t,o5);if(!ne(e))return;const i=t.dayNumber,o=t.secondsOfDay+Hd,r=ke.iau2006XysData.computeXysRadians(i,o,r5);if(!ne(r))return;const a=r.x+e.xPoleOffset,s=r.y+e.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-s*s)),u=Gd;u[0]=1-l*a*a,u[3]=-l*a*s,u[6]=a,u[1]=-l*a*s,u[4]=1-l*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-l*(a*a+s*s);const A=me.fromRotationZ(-r.s,Wd),c=me.multiply(u,A,Gd),f=t.dayNumber,d=t.secondsOfDay-we.computeTaiMinusUtc(t)+e.ut1MinusUtc,p=f-2451545,g=d/pt.SECONDS_PER_DAY;let v=.779057273264+g+.00273781191135448*(p+g);v=v%1*he.TWO_PI;const y=me.fromRotationZ(v,Wd),m=me.multiply(c,y,Gd),b=Math.cos(e.xPoleWander),x=Math.cos(e.yPoleWander),E=Math.sin(e.xPoleWander),B=Math.sin(e.yPoleWander);let P=i-JR+o/pt.SECONDS_PER_DAY;P/=36525;const I=-47e-6*P*he.RADIANS_PER_DEGREE/3600,O=Math.cos(I),M=Math.sin(I),S=Wd;return S[0]=b*O,S[1]=b*M,S[2]=E,S[3]=-x*M+B*E*O,S[4]=x*O+B*E*M,S[5]=-B*b,S[6]=-B*M-x*E*O,S[7]=B*O-x*E*M,S[8]=x*b,me.multiply(m,S,n)};const s5=new be;ke.pointToWindowCoordinates=function(t,n,e,i){return i=ke.pointToGLWindowCoordinates(t,n,e,i),i.y=2*n[5]-i.y,i},ke.pointToGLWindowCoordinates=function(t,n,e,i){if(!ne(t))throw new pe("modelViewProjectionMatrix is required.");if(!ne(n))throw new pe("viewportTransformation is required.");if(!ne(e))throw new pe("point is required.");ne(i)||(i=new _e);const o=s5;return ge.multiplyByVector(t,be.fromElements(e.x,e.y,e.z,1,o),o),be.multiplyByScalar(o,1/o.w,o),ge.multiplyByVector(n,o,o),_e.fromCartesian4(o,i)};const a5=new ae,l5=new ae,u5=new ae;ke.rotationMatrixFromPositionVelocity=function(t,n,e,i){if(!ne(t))throw new pe("position is required.");if(!ne(n))throw new pe("velocity is required.");const o=(e??De.default).geodeticSurfaceNormal(t,a5);let r=ae.cross(n,o,l5);ae.equalsEpsilon(r,ae.ZERO,he.EPSILON6)&&(r=ae.clone(ae.UNIT_X,r));const a=ae.cross(r,n,u5);return ae.normalize(a,a),ae.cross(n,a,r),ae.negate(r,r),ae.normalize(r,r),ne(i)||(i=new me),i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};const tx=new ge(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),nx=new Qe,jd=new ae,c5=new ae,h5=new me,qd=new ge,ix=new ge;ke.basisTo2D=function(t,n,e){if(!ne(t))throw new pe("projection is required.");if(!ne(n))throw new pe("matrix is required.");if(!ne(e))throw new pe("result is required.");const i=ge.getTranslation(n,c5),o=t.ellipsoid;let r;if(ae.equals(i,ae.ZERO))r=ae.clone(ae.ZERO,jd);else{const A=o.cartesianToCartographic(i,nx);r=t.project(A,jd),ae.fromElements(r.z,r.x,r.y,r)}const a=ke.eastNorthUpToFixedFrame(i,o,qd),s=ge.inverseTransformation(a,ix),l=ge.getMatrix3(n,h5),u=ge.multiplyByMatrix3(s,l,e);return ge.multiply(tx,u,e),ge.setTranslation(e,r,e),e},ke.ellipsoidTo2DModelMatrix=function(t,n,e){if(!ne(t))throw new pe("projection is required.");if(!ne(n))throw new pe("center is required.");if(!ne(e))throw new pe("result is required.");const i=t.ellipsoid,o=ke.eastNorthUpToFixedFrame(n,i,qd),r=ge.inverseTransformation(o,ix),a=i.cartesianToCartographic(n,nx),s=t.project(a,jd);ae.fromElements(s.z,s.x,s.y,s);const l=ge.fromTranslation(s,qd);return ge.multiply(tx,r,e),ge.multiply(l,e,e),e};function Te(t,n,e,i){this.west=t??0,this.south=n??0,this.east=e??0,this.north=i??0}Object.defineProperties(Te.prototype,{width:{get:function(){return Te.computeWidth(this)}},height:{get:function(){return Te.computeHeight(this)}}}),Te.packedLength=4,Te.pack=function(t,n,e){return N.typeOf.object("value",t),N.defined("array",n),e=e??0,n[e++]=t.west,n[e++]=t.south,n[e++]=t.east,n[e]=t.north,n},Te.unpack=function(t,n,e){return N.defined("array",t),n=n??0,ne(e)||(e=new Te),e.west=t[n++],e.south=t[n++],e.east=t[n++],e.north=t[n],e},Te.computeWidth=function(t){N.typeOf.object("rectangle",t);let n=t.east;const e=t.west;return n<e&&(n+=he.TWO_PI),n-e},Te.computeHeight=function(t){return N.typeOf.object("rectangle",t),t.north-t.south},Te.fromDegrees=function(t,n,e,i,o){return t=he.toRadians(t??0),n=he.toRadians(n??0),e=he.toRadians(e??0),i=he.toRadians(i??0),ne(o)?(o.west=t,o.south=n,o.east=e,o.north=i,o):new Te(t,n,e,i)},Te.fromRadians=function(t,n,e,i,o){return ne(o)?(o.west=t??0,o.south=n??0,o.east=e??0,o.north=i??0,o):new Te(t,n,e,i)},Te.fromCartographicArray=function(t,n){N.defined("cartographics",t);let e=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let l=0,u=t.length;l<u;l++){const A=t[l];e=Math.min(e,A.longitude),i=Math.max(i,A.longitude),a=Math.min(a,A.latitude),s=Math.max(s,A.latitude);const c=A.longitude>=0?A.longitude:A.longitude+he.TWO_PI;o=Math.min(o,c),r=Math.max(r,c)}return i-e>r-o&&(e=o,i=r,i>he.PI&&(i=i-he.TWO_PI),e>he.PI&&(e=e-he.TWO_PI)),ne(n)?(n.west=e,n.south=a,n.east=i,n.north=s,n):new Te(e,a,i,s)},Te.fromCartesianArray=function(t,n,e){N.defined("cartesians",t),n=n??De.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,A=t.length;u<A;u++){const c=n.cartesianToCartographic(t[u]);i=Math.min(i,c.longitude),o=Math.max(o,c.longitude),s=Math.min(s,c.latitude),l=Math.max(l,c.latitude);const f=c.longitude>=0?c.longitude:c.longitude+he.TWO_PI;r=Math.min(r,f),a=Math.max(a,f)}return o-i>a-r&&(i=r,o=a,o>he.PI&&(o=o-he.TWO_PI),i>he.PI&&(i=i-he.TWO_PI)),ne(e)?(e.west=i,e.south=s,e.east=o,e.north=l,e):new Te(i,s,o,l)};const A5=new ae,f5=new ae,p5=new ae,d5=new ae,m5=new ae,Kd=new Array(5);for(let t=0;t<Kd.length;++t)Kd[t]=new ae;Te.fromBoundingSphere=function(t,n,e){N.typeOf.object("boundingSphere",t);const i=t.center,o=t.radius;if(ne(n)||(n=De.default),ne(e)||(e=new Te),ae.equals(i,ae.ZERO))return Te.clone(Te.MAX_VALUE,e),e;const r=ke.eastNorthUpToFixedFrame(i,n,A5),a=ge.multiplyByPointAsVector(r,ae.UNIT_X,f5);ae.normalize(a,a);const s=ge.multiplyByPointAsVector(r,ae.UNIT_Y,p5);ae.normalize(s,s),ae.multiplyByScalar(s,o,s),ae.multiplyByScalar(a,o,a);const l=ae.negate(s,m5),u=ae.negate(a,d5),A=Kd;let c=A[0];return ae.add(i,s,c),c=A[1],ae.add(i,u,c),c=A[2],ae.add(i,l,c),c=A[3],ae.add(i,a,c),A[4]=i,Te.fromCartesianArray(A,n,e)},Te.clone=function(t,n){if(ne(t))return ne(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new Te(t.west,t.south,t.east,t.north)},Te.equalsEpsilon=function(t,n,e){return e=e??0,t===n||ne(t)&&ne(n)&&Math.abs(t.west-n.west)<=e&&Math.abs(t.south-n.south)<=e&&Math.abs(t.east-n.east)<=e&&Math.abs(t.north-n.north)<=e},Te.prototype.clone=function(t){return Te.clone(this,t)},Te.prototype.equals=function(t){return Te.equals(this,t)},Te.equals=function(t,n){return t===n||ne(t)&&ne(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north},Te.prototype.equalsEpsilon=function(t,n){return Te.equalsEpsilon(this,t,n)},Te._validate=function(t){N.typeOf.object("rectangle",t);const n=t.north;N.typeOf.number.greaterThanOrEquals("north",n,-he.PI_OVER_TWO),N.typeOf.number.lessThanOrEquals("north",n,he.PI_OVER_TWO);const e=t.south;N.typeOf.number.greaterThanOrEquals("south",e,-he.PI_OVER_TWO),N.typeOf.number.lessThanOrEquals("south",e,he.PI_OVER_TWO);const i=t.west;N.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),N.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=t.east;N.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),N.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Te.southwest=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new Qe(t.west,t.south)},Te.northwest=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new Qe(t.west,t.north)},Te.northeast=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new Qe(t.east,t.north)},Te.southeast=function(t,n){return N.typeOf.object("rectangle",t),ne(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new Qe(t.east,t.south)},Te.center=function(t,n){N.typeOf.object("rectangle",t);let e=t.east;const i=t.west;e<i&&(e+=he.TWO_PI);const o=he.negativePiToPi((i+e)*.5),r=(t.south+t.north)*.5;return ne(n)?(n.longitude=o,n.latitude=r,n.height=0,n):new Qe(o,r)},Te.intersection=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n);let i=t.east,o=t.west,r=n.east,a=n.west;i<o&&r>0?i+=he.TWO_PI:r<a&&i>0&&(r+=he.TWO_PI),i<o&&a<0?a+=he.TWO_PI:r<a&&o<0&&(o+=he.TWO_PI);const s=he.negativePiToPi(Math.max(o,a)),l=he.negativePiToPi(Math.min(i,r));if((t.west<t.east||n.west<n.east)&&l<=s)return;const u=Math.max(t.south,n.south),A=Math.min(t.north,n.north);if(!(u>=A))return ne(e)?(e.west=s,e.south=u,e.east=l,e.north=A,e):new Te(s,u,l,A)},Te.simpleIntersection=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n);const i=Math.max(t.west,n.west),o=Math.max(t.south,n.south),r=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||i>=r))return ne(e)?(e.west=i,e.south=o,e.east=r,e.north=a,e):new Te(i,o,r,a)},Te.union=function(t,n,e){N.typeOf.object("rectangle",t),N.typeOf.object("otherRectangle",n),ne(e)||(e=new Te);let i=t.east,o=t.west,r=n.east,a=n.west;i<o&&r>0?i+=he.TWO_PI:r<a&&i>0&&(r+=he.TWO_PI),i<o&&a<0?a+=he.TWO_PI:r<a&&o<0&&(o+=he.TWO_PI);const s=he.negativePiToPi(Math.min(o,a)),l=he.negativePiToPi(Math.max(i,r));return e.west=s,e.south=Math.min(t.south,n.south),e.east=l,e.north=Math.max(t.north,n.north),e},Te.expand=function(t,n,e){return N.typeOf.object("rectangle",t),N.typeOf.object("cartographic",n),ne(e)||(e=new Te),e.west=Math.min(t.west,n.longitude),e.south=Math.min(t.south,n.latitude),e.east=Math.max(t.east,n.longitude),e.north=Math.max(t.north,n.latitude),e},Te.contains=function(t,n){N.typeOf.object("rectangle",t),N.typeOf.object("cartographic",n);let e=n.longitude;const i=n.latitude,o=t.west;let r=t.east;return r<o&&(r+=he.TWO_PI,e<0&&(e+=he.TWO_PI)),(e>o||he.equalsEpsilon(e,o,he.EPSILON14))&&(e<r||he.equalsEpsilon(e,r,he.EPSILON14))&&i>=t.south&&i<=t.north};const g5=new Qe;Te.subsample=function(t,n,e,i){N.typeOf.object("rectangle",t),n=n??De.default,e=e??0,ne(i)||(i=[]);let o=0;const r=t.north,a=t.south,s=t.east,l=t.west,u=g5;u.height=e,u.longitude=l,u.latitude=r,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=n.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:a>0?u.latitude=a:u.latitude=0;for(let A=1;A<8;++A)u.longitude=-Math.PI+A*he.PI_OVER_TWO,Te.contains(t,u)&&(i[o]=n.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=n.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=n.cartographicToCartesian(u,i[o]),o++),i.length=o,i},Te.subsection=function(t,n,e,i,o,r){if(N.typeOf.object("rectangle",t),N.typeOf.number.greaterThanOrEquals("westLerp",n,0),N.typeOf.number.lessThanOrEquals("westLerp",n,1),N.typeOf.number.greaterThanOrEquals("southLerp",e,0),N.typeOf.number.lessThanOrEquals("southLerp",e,1),N.typeOf.number.greaterThanOrEquals("eastLerp",i,0),N.typeOf.number.lessThanOrEquals("eastLerp",i,1),N.typeOf.number.greaterThanOrEquals("northLerp",o,0),N.typeOf.number.lessThanOrEquals("northLerp",o,1),N.typeOf.number.lessThanOrEquals("westLerp",n,i),N.typeOf.number.lessThanOrEquals("southLerp",e,o),ne(r)||(r=new Te),t.west<=t.east){const s=t.east-t.west;r.west=t.west+n*s,r.east=t.west+i*s}else{const s=he.TWO_PI+t.east-t.west;r.west=he.negativePiToPi(t.west+n*s),r.east=he.negativePiToPi(t.west+i*s)}const a=t.north-t.south;return r.south=t.south+e*a,r.north=t.south+o*a,n===1&&(r.west=t.east),i===1&&(r.east=t.east),e===1&&(r.south=t.north),o===1&&(r.north=t.north),r},Te.MAX_VALUE=Object.freeze(new Te(-Math.PI,-he.PI_OVER_TWO,Math.PI,he.PI_OVER_TWO));function Ws(t,n,e,i,o){this._format=t,this._datatype=n,this._width=e,this._height=i,this._buffer=o}Object.defineProperties(Ws.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}}}),Ws.clone=function(t){if(ne(t))return new Ws(t._format,t._datatype,t._width,t._height,t._buffer)},Ws.prototype.clone=function(){return Ws.clone(this)};function rx(){if(!ne(Ut._canTransferArrayBuffer)){const t=$d("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const n=99,e=new Int8Array([n]);try{t.postMessage({array:e},[e.buffer])}catch{return Ut._canTransferArrayBuffer=!1,Ut._canTransferArrayBuffer}Ut._canTransferArrayBuffer=new Promise(i=>{t.onmessage=function(o){const r=o.data.array,a=ne(r)&&r[0]===n;i(a),t.terminate(),Ut._canTransferArrayBuffer=a}})}return Ut._canTransferArrayBuffer}const Zd=new zs;function Xd(t){let n;try{n=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(t),n=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(n)}function $d(t){const n=new Wi(t),e=n.scheme().length!==0&&n.fragment().length===0,i=t.replace(/\.js$/,""),o={};let r,a;if(Td(t))a=t;else if(!e){const s=Gn(`${Ut._workerModulePrefix}/${i}.js`);Td(s)&&(a=s)}if(a){const s=`import "${a}";`;return r=Xd(s),o.type="module",new Worker(r,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const s=`
384
384
  importScripts("${Xd(CESIUM_WORKERS)}");
385
385
  CesiumWorkers["${i}"]();
386
- `;return r=Xd(s),new Worker(r,o)}if(r=t,e||(r=Gn(`${Ut._workerModulePrefix+i}.js`)),!Ht.supportsEsmWebWorkers())throw new Nt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function y5(t,n){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ht.supportsWebAssembly()){if(!ne(n.fallbackModulePath))throw new Nt(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=Gn(n.fallbackModulePath),e}e.wasmBinaryFile=Gn(n.wasmBinaryFile);const i=await xe.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=i,e}function Ut(t,n){this._workerPath=t,this._maximumActiveTasks=n??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const v5=(t,n,e,i)=>{const o=({data:r})=>{if(r.id===n){if(ne(r.error)){let a=r.error;a.name==="RuntimeError"?(a=new Nt(r.error.message),a.stack=r.error.stack):a.name==="DeveloperError"?(a=new pe(r.error.message),a.stack=r.error.stack):a.name==="Error"&&(a=new Error(r.error.message),a.stack=r.error.stack),Zd.raiseEvent(a),i(a)}else Zd.raiseEvent(),e(r.result);t.removeEventListener("message",o)}};return o},w5=[];async function b5(t,n,e){const i=await Promise.resolve(rx());ne(e)?i||(e.length=0):e=w5;const o=t._nextID++,r=new Promise((a,s)=>{t._worker.addEventListener("message",v5(t._worker,o,a,s))});return t._worker.postMessage({id:o,baseUrl:Gn.getCesiumBaseUrl().url,parameters:n,canTransferArrayBuffer:i},e),r}async function x5(t,n,e){++t._activeTasks;try{const i=await b5(t,n,e);return--t._activeTasks,i}catch(i){throw--t._activeTasks,i}}Ut.prototype.scheduleTask=function(t,n){if(ne(this._worker)||(this._worker=$d(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return x5(this,t,n)},Ut.prototype.initWebAssemblyModule=async function(t){if(ne(this._webAssemblyPromise))return this._webAssemblyPromise;const n=async()=>{const e=this._worker=$d(this._workerPath),i=await y5(this,t),o=await Promise.resolve(rx());let r;const a=i.wasmBinary;ne(a)&&o&&(r=[a]);const s=new Promise((l,u)=>{e.onmessage=function({data:A}){ne(A)?l(A.result):u(new Nt("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),s};return this._webAssemblyPromise=n(),this._webAssemblyPromise},Ut.prototype.isDestroyed=function(){return!1},Ut.prototype.destroy=function(){return ne(this._worker)&&this._worker.terminate(),mR(this)},Ut.taskCompletedEvent=Zd,Ut._defaultWorkerModulePrefix="Workers/",Ut._workerModulePrefix=Ut._defaultWorkerModulePrefix,Ut._canTransferArrayBuffer=void 0;function Zi(){}Zi._transcodeTaskProcessor=new Ut("transcodeKTX2",Number.POSITIVE_INFINITY),Zi._readyPromise=void 0;function _5(){const t=Zi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(n){if(n)return Zi._transcodeTaskProcessor;throw new Nt("KTX2 transcoder could not be initialized.")});Zi._readyPromise=t}Zi.transcode=function(t,n){return N.defined("supportedTargetFormats",n),ne(Zi._readyPromise)||_5(),Zi._readyPromise.then(function(e){let i=t;t instanceof ArrayBuffer&&(i=new Uint8Array(t));const o={supportedTargetFormats:n,ktx2Buffer:i};return e.scheduleTask(o,[i.buffer])}).then(function(e){const i=e.length,o=Object.keys(e[0]);for(let r=0;r<i;r++){const a=e[r];for(let s=0;s<o.length;s++){const l=a[o[s]];a[o[s]]=new Ws(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)e[r]=e[r][o[0]];i===1&&(e=e[0])}return e}).catch(function(e){throw e})};let ox;sx.setKTX2SupportedFormats=function(t,n,e,i,o,r){ox={s3tc:t,pvrtc:n,astc:e,etc:i,etc1:o,bc7:r}};function sx(t){N.defined("resourceOrUrlOrBuffer",t);let n;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?n=Promise.resolve(t):n=xe.createIfNeeded(t).fetchArrayBuffer(),n.then(function(e){return Zi.transcode(e,ox)})}function yn(t){this._ellipsoid=t??De.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(yn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),yn.mercatorAngleToGeodeticLatitude=function(t){return he.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},yn.geodeticLatitudeToMercatorAngle=function(t){t>yn.MaximumLatitude?t=yn.MaximumLatitude:t<-yn.MaximumLatitude&&(t=-yn.MaximumLatitude);const n=Math.sin(t);return .5*Math.log((1+n)/(1-n))},yn.MaximumLatitude=yn.mercatorAngleToGeodeticLatitude(Math.PI),yn.prototype.project=function(t,n){const e=this._semimajorAxis,i=t.longitude*e,o=yn.geodeticLatitudeToMercatorAngle(t.latitude)*e,r=t.height;return ne(n)?(n.x=i,n.y=o,n.z=r,n):new ae(i,o,r)},yn.prototype.unproject=function(t,n){if(!ne(t))throw new pe("cartesian is required");const e=this._oneOverSemimajorAxis,i=t.x*e,o=yn.mercatorAngleToGeodeticLatitude(t.y*e),r=t.z;return ne(n)?(n.longitude=i,n.latitude=o,n.height=r,n):new Qe(i,o,r)};const ax={};function Cl(t,n){if(!ne(t))throw new pe("identifier is required.");ne(ax[t])||(ax[t]=!0,console.warn(n??t))}Cl.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.",Cl.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Cl.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Cl.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function lx(t,n){if(!ne(t)||!ne(n))throw new pe("identifier and message are required.");Cl(t,n)}function js(){pe.throwInstantiationError()}Object.defineProperties(js.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}}),js.prototype.getTileCredits=function(t,n,e){pe.throwInstantiationError()},js.prototype.requestImage=function(t,n,e,i){pe.throwInstantiationError()},js.prototype.pickFeatures=function(t,n,e,i,o){pe.throwInstantiationError()};const C5=/\.ktx2$/i;js.loadImage=function(t,n){N.defined("url",n);const e=xe.createIfNeeded(n);return C5.test(e.url)?sx(e):ne(t)&&ne(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function ux(t,n){return lx("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??n}Object.defineProperty(ux,"EMPTY_OBJECT",{get:function(){return lx("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),gi.EMPTY_OBJECT}});var UA=3.141592653589793*3e3/180,Ot=3.141592653589793,OA=6378245,LA=.006693421622965943,cx=function(i,o){var i=+i,o=+o,r=i-.0065,a=o-.006,s=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*UA),l=Math.atan2(a,r)-3e-6*Math.cos(r*UA),u=s*Math.cos(l),A=s*Math.sin(l);return[u,A]},hx=function(o,i){var i=+i,o=+o,r=Math.sqrt(o*o+i*i)+2e-5*Math.sin(i*UA),a=Math.atan2(i,o)+3e-6*Math.cos(o*UA),s=r*Math.cos(a)+.0065,l=r*Math.sin(a)+.006;return[s,l]},Yd=function(o,i){var i=+i,o=+o;if(px(o,i))return[o,i];var r=Ax(o-105,i-35),a=fx(o-105,i-35),s=i/180*Ot,l=Math.sin(s);l=1-LA*l*l;var u=Math.sqrt(l);r=r*180/(OA*(1-LA)/(l*u)*Ot),a=a*180/(OA/u*Math.cos(s)*Ot);var A=i+r,c=o+a;return[c,A]},Jd=function(o,i){var i=+i,o=+o;if(px(o,i))return[o,i];var r=Ax(o-105,i-35),a=fx(o-105,i-35),s=i/180*Ot,l=Math.sin(s);l=1-LA*l*l;var u=Math.sqrt(l);r=r*180/(OA*(1-LA)/(l*u)*Ot),a=a*180/(OA/u*Math.cos(s)*Ot);var A=i+r,c=o+a;return[o*2-c,i*2-A]},Ax=function(o,i){var i=+i,o=+o,r=-100+2*o+3*i+.2*i*i+.1*o*i+.2*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*Ot)+20*Math.sin(2*o*Ot))*2/3,r+=(20*Math.sin(i*Ot)+40*Math.sin(i/3*Ot))*2/3,r+=(160*Math.sin(i/12*Ot)+320*Math.sin(i*Ot/30))*2/3,r},fx=function(o,i){var i=+i,o=+o,r=300+o+2*i+.1*o*o+.1*o*i+.1*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*Ot)+20*Math.sin(2*o*Ot))*2/3,r+=(20*Math.sin(o*Ot)+40*Math.sin(o/3*Ot))*2/3,r+=(150*Math.sin(o/12*Ot)+300*Math.sin(o/30*Ot))*2/3,r},px=function(o,i){var i=+i,o=+o;return!(o>73.66&&o<135.05&&i>3.86&&i<53.55)};function em(t,n){this.x=t||0,this.y=n||0,this.x=this.x,this.y=this.y}em.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function ri(t,n){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(n)&&(n=decode64(n),n=isNaN(n)?0:n),typeof t=="lat"&&(n=parseFloat(n)),this.lng=t,this.lat=n}ri.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},ri.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function at(){}at.EARTHRADIUS=637099681e-2,at.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],at.LLBAND=[75,60,45,30,15,0],at.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]],at.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]],at.getDistanceByMC=function(t,n){if(!t||!n)return 0;var e,i,o,r;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),i=this.toRadians(t.lat),n=this.convertMC2LL(n),!n)?0:(o=this.toRadians(n.lng),r=this.toRadians(n.lat),this.getDistance(e,o,i,r))},at.getDistanceByLL=function(t,n){if(!t||!n)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),n.lng=this.getLoop(n.lng,-180,180),n.lat=this.getRange(n.lat,-74,74);var e,i,o,r;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),i=this.toRadians(n.lng),r=this.toRadians(n.lat),this.getDistance(e,i,o,r)},at.convertMC2LL=function(r){var n,e;n=new ri(Math.abs(r.lng),Math.abs(r.lat));for(var i=0;i<this.MCBAND.length;i++)if(n.lat>=this.MCBAND[i]){e=this.MC2LL[i];break}var o=this.convertor(r,e),r=new ri(o.lng.toFixed(6),o.lat.toFixed(6));return r},at.convertLL2MC=function(r){var n,e;r.lng=this.getLoop(r.lng,-180,180),r.lat=this.getRange(r.lat,-74,74),n=new ri(r.lng,r.lat);for(var i=0;i<this.LLBAND.length;i++)if(n.lat>=this.LLBAND[i]){e=this.LL2MC[i];break}if(!e){for(var i=this.LLBAND.length-1;i>=0;i--)if(n.lat<=-this.LLBAND[i]){e=this.LL2MC[i];break}}var o=this.convertor(r,e),r=new ri(o.lng.toFixed(2),o.lat.toFixed(2));return r},at.convertor=function(t,n){if(!(!t||!n)){var e=n[0]+n[1]*Math.abs(t.lng),i=Math.abs(t.lat)/n[9],o=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new ri(e,o)}},at.getDistance=function(t,n,e,i){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(i)+Math.cos(e)*Math.cos(i)*Math.cos(n-t))},at.toRadians=function(t){return Math.PI*t/180},at.toDegrees=function(t){return 180*t/Math.PI},at.getRange=function(t,n,e){return n!=null&&(t=Math.max(t,n)),e!=null&&(t=Math.min(t,e)),t},at.getLoop=function(t,n,e){for(;t>e;)t-=e-n;for(;t<n;)t+=e-n;return t},at.prototype.lngLatToMercator=function(t){return at.convertLL2MC(t)},at.prototype.lngLatToPoint=function(t){var n=at.convertLL2MC(t);return new em(n.lng,n.lat)},at.prototype.mercatorToLngLat=function(t){return at.convertMC2LL(t)},at.prototype.PointToLngLat=function(t){var n=new ri(t.x,t.y);return at.convertMC2LL(n)},at.prototype.PointToPixel=function(t,n,e,i,o){if(t){t=this.lngLatToMercator(t,o);var r=this.getZoomUnits(n),a=Math.round((t.lng-e.lng)/r+i[Twidth]/2),s=Math.round((e.lat-t.lat)/r+i[Theight]/2);return new em(a,s)}},at.prototype.PixelToPoint=function(t,n,e,i,o){if(t){var r=this.getZoomUnits(n),a=e.lng+r*(t.x-i[Twidth]/2),s=e.lat-r*(t.y-i[Theight]/2),l=new ri(a,s);return this.mercatorToLngLat(l,o)}},at.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Qr(t){t=t||{},this._ellipsoid=ux(t.ellipsoid,De.WGS84);var n=!0;ne(t.wgs84)&&(n=t.wgs84),this._projection=new yn(this._ellipsoid);var e=new at;this._projection.project=function(a){var s={};return n?(s=Yd(he.toDegrees(a.longitude),he.toDegrees(a.latitude)),s=hx(s[0],s[1])):s=hx(he.toDegrees(a.longitude),he.toDegrees(a.latitude)),s[0]=Math.min(s[0],180),s[0]=Math.max(s[0],-180),s[1]=Math.min(s[1],74.000022),s[1]=Math.max(s[1],-71.988531),s=e.lngLatToPoint(new ri(s[0],s[1])),new _e(s.x,s.y)},this._projection.unproject=function(a){var s=e.mercatorToLngLat(new ri(a.x,a.y));return s[0]=(s[0]+180)%360-180,n?(s=cx(s.lng,s.lat),s=Jd(s[0],s[1])):s=cx(s.lng,s.lat),new Qe(he.toRadians(s[0]),he.toRadians(s[1]))},this._rectangleSouthwestInMeters=new _e(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new _e(2003772637e-2,1247410417e-2);var i=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Te(i.longitude,i.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var r=0;r<19;r++)this.levelWidth[r]=Math.pow(2,18-r)*256}Object.defineProperties(Qr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Qr.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Qr.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Qr.prototype.rectangleToNativeRectangle=function(t,n){var e=this._projection,i=e.project(Te.southwest(t)),o=e.project(Te.northeast(t));return ne(n)?(n.west=i.x,n.south=i.y,n.east=o.x,n.north=o.y,n):new Te(i.x,i.y,o.x,o.y)},Qr.prototype.tileXYToNativeRectangle=function(t,n,e,i){var o=this.levelWidth[e],r=t*o,a=(t+1)*o;n=-n;var s=(n+1)*o,l=n*o;return ne(i)?(i.west=r,i.south=l,i.east=a,i.north=s,i):new Te(r,l,a,s)},Qr.prototype.tileXYToRectangle=function(t,n,e,i){var o=this.tileXYToNativeRectangle(t,n,e,i),r=this._projection,a=r.unproject(new _e(o.west,o.south)),s=r.unproject(new _e(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=s.longitude,o.north=s.latitude,o},Qr.prototype.positionToTileXY=function(t,n,e){var i=this._rectangle;if(Te.contains(i,t)){var o=this._projection,r=o.project(t);if(ne(r)){var a=this.levelWidth[n],s=Math.floor(r.x/a),l=-Math.floor(r.y/a);return ne(e)?(e.x=s,e.y=l,e):new _e(s,l)}}};function zA(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 Qr(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function S5(t,n,e,i){var o=t._url;return o=o.replace("{x}",n).replace("{y}",-e).replace("{z}",i),o}Object.defineProperties(zA.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}}}),zA.prototype.getTileCredits=function(t,n,e){},zA.prototype.requestImage=function(t,n,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var i=S5(this,t,n,e);return js.loadImage(this,i)};class E5 extends _.UrlTemplateImageryProvider{constructor(e){super(e);z(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new _.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,i,o,r){try{let a=this.buildImageUrl(this.indexTime,e,i,o);return _.ImageryProvider.loadImage(this,a)}catch{return}}buildImageUrl(e,i,o,r){return`https://tileser.giiiis.com/timetile/${e}/${r}/${i}/${o}.jpg`}}class P5 extends _.UrlTemplateImageryProvider{constructor(e){super(e);z(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,i,o,r){try{let a;return this.indexTimeID!==0?a=this.buildImageUrl(this.indexTimeID,e,i,o):a=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${i}/${e}`,_.ImageryProvider.loadImage(this,a)}catch{return}}buildImageUrl(e,i,o,r){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${r}/${o}/${i}`}}var tm={exports:{}};/*! For license information please see mvt-basic-render.js.LICENSE.txt */var dx;function B5(){return dx||(dx=1,(function(t,n){(function(e,i){t.exports=i()})(self,(function(){return(function(){var e={3226:function(r){r.exports=(function(){return(a=new Float32Array(3))[0]=0,a[1]=0,a[2]=0,(function(){var s=new Float32Array(4);s[0]=0,s[1]=0,s[2]=0,s[3]=0})(),{vec3:{transformMat3:function(s,l,u){var A=l[0],c=l[1],f=l[2];return s[0]=A*u[0]+c*u[3]+f*u[6],s[1]=A*u[1]+c*u[4]+f*u[7],s[2]=A*u[2]+c*u[5]+f*u[8],s}},vec4:{transformMat4:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3];return s[0]=u[0]*A+u[4]*c+u[8]*f+u[12]*d,s[1]=u[1]*A+u[5]*c+u[9]*f+u[13]*d,s[2]=u[2]*A+u[6]*c+u[10]*f+u[14]*d,s[3]=u[3]*A+u[7]*c+u[11]*f+u[15]*d,s}},mat2:{create:function(){var s=new Float32Array(4);return s[0]=1,s[1]=0,s[2]=0,s[3]=1,s},rotate:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=Math.sin(u),g=Math.cos(u);return s[0]=A*g+f*p,s[1]=c*g+d*p,s[2]=A*-p+f*g,s[3]=c*-p+d*g,s},scale:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=u[0],g=u[1];return s[0]=A*p,s[1]=c*p,s[2]=f*g,s[3]=d*g,s}},mat3:{create:function(){var s=new Float32Array(9);return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=1,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s},fromRotation:function(s,l){var u=Math.sin(l),A=Math.cos(l);return s[0]=A,s[1]=u,s[2]=0,s[3]=-u,s[4]=A,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s}},mat4:{create:function(){var s=new Float32Array(16);return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},identity:function(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},translate:function(s,l,u){var A,c,f,d,p,g,v,y,m,b,x,E,B=u[0],P=u[1],I=u[2];return l===s?(s[12]=l[0]*B+l[4]*P+l[8]*I+l[12],s[13]=l[1]*B+l[5]*P+l[9]*I+l[13],s[14]=l[2]*B+l[6]*P+l[10]*I+l[14],s[15]=l[3]*B+l[7]*P+l[11]*I+l[15]):(A=l[0],c=l[1],f=l[2],d=l[3],p=l[4],g=l[5],v=l[6],y=l[7],m=l[8],b=l[9],x=l[10],E=l[11],s[0]=A,s[1]=c,s[2]=f,s[3]=d,s[4]=p,s[5]=g,s[6]=v,s[7]=y,s[8]=m,s[9]=b,s[10]=x,s[11]=E,s[12]=A*B+p*P+m*I+l[12],s[13]=c*B+g*P+b*I+l[13],s[14]=f*B+v*P+x*I+l[14],s[15]=d*B+y*P+E*I+l[15]),s},scale:function(s,l,u){var A=u[0],c=u[1],f=u[2];return s[0]=l[0]*A,s[1]=l[1]*A,s[2]=l[2]*A,s[3]=l[3]*A,s[4]=l[4]*c,s[5]=l[5]*c,s[6]=l[6]*c,s[7]=l[7]*c,s[8]=l[8]*f,s[9]=l[9]*f,s[10]=l[10]*f,s[11]=l[11]*f,s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},multiply:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=l[4],g=l[5],v=l[6],y=l[7],m=l[8],b=l[9],x=l[10],E=l[11],B=l[12],P=l[13],I=l[14],O=l[15],M=u[0],S=u[1],T=u[2],w=u[3];return s[0]=M*A+S*p+T*m+w*B,s[1]=M*c+S*g+T*b+w*P,s[2]=M*f+S*v+T*x+w*I,s[3]=M*d+S*y+T*E+w*O,M=u[4],S=u[5],T=u[6],w=u[7],s[4]=M*A+S*p+T*m+w*B,s[5]=M*c+S*g+T*b+w*P,s[6]=M*f+S*v+T*x+w*I,s[7]=M*d+S*y+T*E+w*O,M=u[8],S=u[9],T=u[10],w=u[11],s[8]=M*A+S*p+T*m+w*B,s[9]=M*c+S*g+T*b+w*P,s[10]=M*f+S*v+T*x+w*I,s[11]=M*d+S*y+T*E+w*O,M=u[12],S=u[13],T=u[14],w=u[15],s[12]=M*A+S*p+T*m+w*B,s[13]=M*c+S*g+T*b+w*P,s[14]=M*f+S*v+T*x+w*I,s[15]=M*d+S*y+T*E+w*O,s},perspective:function(s,l,u,A,c){var f=1/Math.tan(l/2),d=1/(A-c);return s[0]=f/u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=f,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(c+A)*d,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*c*A*d,s[15]=0,s},rotateX:function(s,l,u){var A=Math.sin(u),c=Math.cos(u),f=l[4],d=l[5],p=l[6],g=l[7],v=l[8],y=l[9],m=l[10],b=l[11];return l!==s&&(s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[4]=f*c+v*A,s[5]=d*c+y*A,s[6]=p*c+m*A,s[7]=g*c+b*A,s[8]=v*c-f*A,s[9]=y*c-d*A,s[10]=m*c-p*A,s[11]=b*c-g*A,s},rotateZ:function(s,l,u){var A=Math.sin(u),c=Math.cos(u),f=l[0],d=l[1],p=l[2],g=l[3],v=l[4],y=l[5],m=l[6],b=l[7];return l!==s&&(s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[0]=f*c+v*A,s[1]=d*c+y*A,s[2]=p*c+m*A,s[3]=g*c+b*A,s[4]=v*c-f*A,s[5]=y*c-d*A,s[6]=m*c-p*A,s[7]=b*c-g*A,s},invert:function(s,l){var u=l[0],A=l[1],c=l[2],f=l[3],d=l[4],p=l[5],g=l[6],v=l[7],y=l[8],m=l[9],b=l[10],x=l[11],E=l[12],B=l[13],P=l[14],I=l[15],O=u*p-A*d,M=u*g-c*d,S=u*v-f*d,T=A*g-c*p,w=A*v-f*p,C=c*v-f*g,U=y*B-m*E,F=y*P-b*E,D=y*I-x*E,R=m*P-b*B,L=m*I-x*B,k=b*I-x*P,Q=O*k-M*L+S*R+T*D-w*F+C*U;return Q?(Q=1/Q,s[0]=(p*k-g*L+v*R)*Q,s[1]=(c*L-A*k-f*R)*Q,s[2]=(B*C-P*w+I*T)*Q,s[3]=(b*w-m*C-x*T)*Q,s[4]=(g*D-d*k-v*F)*Q,s[5]=(u*k-c*D+f*F)*Q,s[6]=(P*S-E*C-I*M)*Q,s[7]=(y*C-b*S+x*M)*Q,s[8]=(d*L-p*D+v*U)*Q,s[9]=(A*D-u*L-f*U)*Q,s[10]=(E*w-B*S+I*O)*Q,s[11]=(m*S-y*w-x*O)*Q,s[12]=(p*F-d*R-g*U)*Q,s[13]=(u*R-A*F+c*U)*Q,s[14]=(B*M-E*T-P*O)*Q,s[15]=(y*T-m*M+b*O)*Q,s):null},ortho:function(s,l,u,A,c,f,d){var p=1/(l-u),g=1/(A-c),v=1/(f-d);return s[0]=-2*p,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*g,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*v,s[11]=0,s[12]=(l+u)*p,s[13]=(c+A)*g,s[14]=(d+f)*v,s[15]=1,s}}};var a})()},2235:function(r){function a(l){return!!(typeof window<"u"&&typeof document<"u"&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var A,c,f=new Blob([""],{type:"text/javascript"}),d=URL.createObjectURL(f);try{c=new Worker(d),A=!0}catch{A=!1}return c&&c.terminate(),URL.revokeObjectURL(d),A})()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&(u=l&&l.failIfMajorPerformanceCaveat,s[u]===void 0&&(s[u]=(function(A){var c=document.createElement("canvas"),f=Object.create(a.webGLContextAttributes);return f.failIfMajorPerformanceCaveat=A,c.probablySupportsContext?c.probablySupportsContext("webgl",f)||c.probablySupportsContext("experimental-webgl",f):c.supportsContext?c.supportsContext("webgl",f)||c.supportsContext("experimental-webgl",f):c.getContext("webgl",f)||c.getContext("experimental-webgl",f)})(u)),s[u]));var u}r.exports?r.exports=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a);var s={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},5550:function(r){function a(s,l){this.x=s,this.y=l}r.exports=a,a.prototype={clone:function(){return new a(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,l){return this.clone()._rotateAround(s,l)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var l=s.x-this.x,u=s.y-this.y;return l*l+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,l){return Math.atan2(this.x*l-this.y*s,this.x*s+this.y*l)},_matMult:function(s){var l=s[0]*this.x+s[1]*this.y,u=s[2]*this.x+s[3]*this.y;return this.x=l,this.y=u,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var l=Math.cos(s),u=Math.sin(s),A=l*this.x-u*this.y,c=u*this.x+l*this.y;return this.x=A,this.y=c,this},_rotateAround:function(s,l){var u=Math.cos(s),A=Math.sin(s),c=l.x+u*(this.x-l.x)-A*(this.y-l.y),f=l.y+A*(this.x-l.x)+u*(this.y-l.y);return this.x=c,this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(s){return s instanceof a?s:Array.isArray(s)?new a(s[0],s[1]):s}},3775:function(r){r.exports=(function(){function a(u,A,c){c=c||{},this.w=u||64,this.h=A||64,this.autoResize=!!c.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function s(u,A,c){this.x=0,this.y=u,this.w=this.free=A,this.h=c}function l(u,A,c,f,d,p,g){this.id=u,this.x=A,this.y=c,this.w=f,this.h=d,this.maxw=p||f,this.maxh=g||d,this.refcount=0}return a.prototype.pack=function(u,A){u=[].concat(u),A=A||{};for(var c,f,d,p,g=[],v=0;v<u.length;v++)if(c=u[v].w||u[v].width,f=u[v].h||u[v].height,d=u[v].id,c&&f){if(!(p=this.packOne(c,f,d)))continue;A.inPlace&&(u[v].x=p.x,u[v].y=p.y,u[v].id=p.id),g.push(p)}return this.shrink(),g},a.prototype.packOne=function(u,A,c){var f,d,p,g,v,y,m,b,x={freebin:-1,shelf:-1,waste:1/0},E=0;if(typeof c=="string"||typeof c=="number"){if(f=this.getBin(c))return this.ref(f),f;typeof c=="number"&&(this.maxId=Math.max(c,this.maxId))}else c=++this.maxId;for(g=0;g<this.freebins.length;g++){if(A===(f=this.freebins[g]).maxh&&u===f.maxw)return this.allocFreebin(g,u,A,c);A>f.maxh||u>f.maxw||A<=f.maxh&&u<=f.maxw&&(p=f.maxw*f.maxh-u*A)<x.waste&&(x.waste=p,x.freebin=g)}for(g=0;g<this.shelves.length;g++)if(E+=(d=this.shelves[g]).h,!(u>d.free)){if(A===d.h)return this.allocShelf(g,u,A,c);A>d.h||A<d.h&&(p=(d.h-A)*u)<x.waste&&(x.freebin=-1,x.waste=p,x.shelf=g)}return x.freebin!==-1?this.allocFreebin(x.freebin,u,A,c):x.shelf!==-1?this.allocShelf(x.shelf,u,A,c):A<=this.h-E&&u<=this.w?(d=new s(E,this.w,A),this.allocShelf(this.shelves.push(d)-1,u,A,c)):this.autoResize?(v=y=this.h,((m=b=this.w)<=v||u>m)&&(b=2*Math.max(u,m)),(v<m||A>v)&&(y=2*Math.max(A,v)),this.resize(b,y),this.packOne(u,A,c)):null},a.prototype.allocFreebin=function(u,A,c,f){var d=this.freebins.splice(u,1)[0];return d.id=f,d.w=A,d.h=c,d.refcount=0,this.bins[f]=d,this.ref(d),d},a.prototype.allocShelf=function(u,A,c,f){var d=this.shelves[u].alloc(A,c,f);return this.bins[f]=d,this.ref(d),d},a.prototype.shrink=function(){if(this.shelves.length>0){for(var u=0,A=0,c=0;c<this.shelves.length;c++){var f=this.shelves[c];A+=f.h,u=Math.max(f.w-f.free,u)}this.resize(u,A)}},a.prototype.getBin=function(u){return this.bins[u]},a.prototype.ref=function(u){if(++u.refcount==1){var A=u.h;this.stats[A]=1+(0|this.stats[A])}return u.refcount},a.prototype.unref=function(u){return u.refcount===0?0:(--u.refcount==0&&(this.stats[u.h]--,delete this.bins[u.id],this.freebins.push(u)),u.refcount)},a.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},a.prototype.resize=function(u,A){this.w=u,this.h=A;for(var c=0;c<this.shelves.length;c++)this.shelves[c].resize(u);return!0},s.prototype.alloc=function(u,A,c){if(u>this.free||A>this.h)return null;var f=this.x;return this.x+=u,this.free-=u,new l(c,f,this.y,u,A,u,this.h)},s.prototype.resize=function(u){return this.free+=u-this.w,this.w=u,!0},a})()},3673:function(r,a){var s=(function(){var l={},u=Math.PI/180,A=180/Math.PI,c=6378137,f=20037508342789244e-9;function d(g){return Number(g)===g&&g%1!=0}function p(g){if(g=g||{},this.size=g.size||256,this.expansion=g.antimeridian===!0?2:1,!l[this.size]){var v=this.size,y=l[this.size]={};y.Bc=[],y.Cc=[],y.zc=[],y.Ac=[];for(var m=0;m<30;m++)y.Bc.push(v/360),y.Cc.push(v/(2*Math.PI)),y.zc.push(v/2),y.Ac.push(v),v*=2}this.Bc=l[this.size].Bc,this.Cc=l[this.size].Cc,this.zc=l[this.size].zc,this.Ac=l[this.size].Ac}return p.prototype.px=function(g,v){if(d(v)){var y=this.size*Math.pow(2,v),m=y/2,b=y/360,x=y/(2*Math.PI),E=y,B=Math.min(Math.max(Math.sin(u*g[1]),-.9999),.9999),P=m+g[0]*b,I=m+.5*Math.log((1+B)/(1-B))*-x;return P>E*this.expansion&&(P=E*this.expansion),I>E&&(I=E),[P,I]}return m=this.zc[v],B=Math.min(Math.max(Math.sin(u*g[1]),-.9999),.9999),P=Math.round(m+g[0]*this.Bc[v]),I=Math.round(m+.5*Math.log((1+B)/(1-B))*-this.Cc[v]),P>this.Ac[v]*this.expansion&&(P=this.Ac[v]*this.expansion),I>this.Ac[v]&&(I=this.Ac[v]),[P,I]},p.prototype.ll=function(g,v){if(d(v)){var y=this.size*Math.pow(2,v),m=y/360,b=y/(2*Math.PI),x=y/2,E=(g[1]-x)/-b;return[(g[0]-x)/m,A*(2*Math.atan(Math.exp(E))-.5*Math.PI)]}return E=(g[1]-this.zc[v])/-this.Cc[v],[(g[0]-this.zc[v])/this.Bc[v],A*(2*Math.atan(Math.exp(E))-.5*Math.PI)]},p.prototype.bbox=function(g,v,y,m,b){m&&(v=Math.pow(2,y)-1-v);var x=[g*this.size,(+v+1)*this.size],E=[(+g+1)*this.size,v*this.size],B=this.ll(x,y).concat(this.ll(E,y));return b==="900913"?this.convert(B,"900913"):B},p.prototype.xyz=function(g,v,y,m){m==="900913"&&(g=this.convert(g,"WGS84"));var b=[g[0],g[1]],x=[g[2],g[3]],E=this.px(b,v),B=this.px(x,v),P=[Math.floor(E[0]/this.size),Math.floor((B[0]-1)/this.size)],I=[Math.floor(B[1]/this.size),Math.floor((E[1]-1)/this.size)],O={minX:Math.min.apply(Math,P)<0?0:Math.min.apply(Math,P),minY:Math.min.apply(Math,I)<0?0:Math.min.apply(Math,I),maxX:Math.max.apply(Math,P),maxY:Math.max.apply(Math,I)};if(y){var M={minY:Math.pow(2,v)-1-O.maxY,maxY:Math.pow(2,v)-1-O.minY};O.minY=M.minY,O.maxY=M.maxY}return O},p.prototype.convert=function(g,v){return v==="900913"?this.forward(g.slice(0,2)).concat(this.forward(g.slice(2,4))):this.inverse(g.slice(0,2)).concat(this.inverse(g.slice(2,4)))},p.prototype.forward=function(g){var v=[c*g[0]*u,c*Math.log(Math.tan(.25*Math.PI+.5*g[1]*u))];return v[0]>f&&(v[0]=f),v[0]<-f&&(v[0]=-f),v[1]>f&&(v[1]=f),v[1]<-f&&(v[1]=-f),v},p.prototype.inverse=function(g){return[g[0]*A/c,(.5*Math.PI-2*Math.atan(Math.exp(-g[1]/c)))*A]},p})();r.exports=s},9296:function(r){r.exports=s,r.exports.default=s;var a=1e20;function s(A,c,f,d,p,g){this.fontSize=A||24,this.buffer=c===void 0?3:c,this.cutoff=d||.25,this.fontFamily=p||"sans-serif",this.fontWeight=g||"normal",this.radius=f||8;var v=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=v,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(v*v),this.gridInner=new Float64Array(v*v),this.f=new Float64Array(v),this.d=new Float64Array(v),this.z=new Float64Array(v+1),this.v=new Int16Array(v),this.middle=Math.round(v/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function l(A,c,f,d,p,g,v){for(var y=0;y<c;y++){for(var m=0;m<f;m++)d[m]=A[m*c+y];for(u(d,p,g,v,f),m=0;m<f;m++)A[m*c+y]=p[m]}for(m=0;m<f;m++){for(y=0;y<c;y++)d[y]=A[m*c+y];for(u(d,p,g,v,c),y=0;y<c;y++)A[m*c+y]=Math.sqrt(p[y])}}function u(A,c,f,d,p){f[0]=0,d[0]=-a,d[1]=+a;for(var g=1,v=0;g<p;g++){for(var y=(A[g]+g*g-(A[f[v]]+f[v]*f[v]))/(2*g-2*f[v]);y<=d[v];)v--,y=(A[g]+g*g-(A[f[v]]+f[v]*f[v]))/(2*g-2*f[v]);f[++v]=g,d[v]=y,d[v+1]=+a}for(g=0,v=0;g<p;g++){for(;d[v+1]<g;)v++;c[g]=(g-f[v])*(g-f[v])+A[f[v]]}}s.prototype.draw=function(A){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(A,this.buffer,this.middle);for(var c=this.ctx.getImageData(0,0,this.size,this.size),f=new Uint8ClampedArray(this.size*this.size),d=0;d<this.size*this.size;d++){var p=c.data[4*d+3]/255;this.gridOuter[d]=p===1?0:p===0?a:Math.pow(Math.max(0,.5-p),2),this.gridInner[d]=p===1?a:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(l(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),l(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),d=0;d<this.size*this.size;d++){var g=this.gridOuter[d]-this.gridInner[d];f[d]=Math.max(0,Math.min(255,Math.round(255-255*(g/this.radius+this.cutoff))))}return f}},9874:function(r){function a(s,l,u,A){this.cx=3*s,this.bx=3*(u-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(A-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=A,this.p2x=u,this.p2y=A}r.exports=a,a.prototype.sampleCurveX=function(s){return((this.ax*s+this.bx)*s+this.cx)*s},a.prototype.sampleCurveY=function(s){return((this.ay*s+this.by)*s+this.cy)*s},a.prototype.sampleCurveDerivativeX=function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},a.prototype.solveCurveX=function(s,l){var u,A,c,f,d;for(l===void 0&&(l=1e-6),c=s,d=0;d<8;d++){if(f=this.sampleCurveX(c)-s,Math.abs(f)<l)return c;var p=this.sampleCurveDerivativeX(c);if(Math.abs(p)<1e-6)break;c-=f/p}if((c=s)<(u=0))return u;if(c>(A=1))return A;for(;u<A;){if(f=this.sampleCurveX(c),Math.abs(f-s)<l)return c;s>f?u=c:A=c,c=.5*(A-u)+u}return c},a.prototype.solve=function(s,l){return this.sampleCurveY(this.solveCurveX(s,l))}},8929:function(r,a,s){r.exports.VectorTile=s(4054),r.exports.VectorTileFeature=s(6024),r.exports.VectorTileLayer=s(9701)},4054:function(r,a,s){var l=s(9701);function u(A,c,f){if(A===3){var d=new l(f,f.readVarint()+f.pos);d.length&&(c[d.name]=d)}}r.exports=function(A,c){this.layers=A.readFields(u,{},c)}},6024:function(r,a,s){var l=s(5550);function u(f,d,p,g,v){this.properties={},this.extent=p,this.type=0,this._pbf=f,this._geometry=-1,this._keys=g,this._values=v,f.readFields(A,this,d)}function A(f,d,p){f==1?d.id=p.readVarint():f==2?(function(g,v){for(var y=g.readVarint()+g.pos;g.pos<y;){var m=v._keys[g.readVarint()],b=v._values[g.readVarint()];v.properties[m]=b}})(p,d):f==3?d.type=p.readVarint():f==4&&(d._geometry=p.pos)}function c(f){for(var d,p,g=0,v=0,y=f.length,m=y-1;v<y;m=v++)d=f[v],g+=((p=f[m]).x-d.x)*(d.y+p.y);return g}r.exports=u,u.types=["Unknown","Point","LineString","Polygon"],u.prototype.loadGeometry=function(){var f=this._pbf;f.pos=this._geometry;for(var d,p=f.readVarint()+f.pos,g=1,v=0,y=0,m=0,b=[];f.pos<p;){if(v<=0){var x=f.readVarint();g=7&x,v=x>>3}if(v--,g===1||g===2)y+=f.readSVarint(),m+=f.readSVarint(),g===1&&(d&&b.push(d),d=[]),d.push(new l(y,m));else{if(g!==7)throw new Error("unknown command "+g);d&&d.push(d[0].clone())}}return d&&b.push(d),b},u.prototype.bbox=function(){var f=this._pbf;f.pos=this._geometry;for(var d=f.readVarint()+f.pos,p=1,g=0,v=0,y=0,m=1/0,b=-1/0,x=1/0,E=-1/0;f.pos<d;){if(g<=0){var B=f.readVarint();p=7&B,g=B>>3}if(g--,p===1||p===2)(v+=f.readSVarint())<m&&(m=v),v>b&&(b=v),(y+=f.readSVarint())<x&&(x=y),y>E&&(E=y);else if(p!==7)throw new Error("unknown command "+p)}return[m,x,b,E]},u.prototype.toGeoJSON=function(f,d,p){var g,v,y=this.extent*Math.pow(2,p),m=this.extent*f,b=this.extent*d,x=this.loadGeometry(),E=u.types[this.type];function B(O){for(var M=0;M<O.length;M++){var S=O[M],T=180-360*(S.y+b)/y;O[M]=[360*(S.x+m)/y-180,360/Math.PI*Math.atan(Math.exp(T*Math.PI/180))-90]}}switch(this.type){case 1:var P=[];for(g=0;g<x.length;g++)P[g]=x[g][0];B(x=P);break;case 2:for(g=0;g<x.length;g++)B(x[g]);break;case 3:for(x=(function(O){var M=O.length;if(M<=1)return[O];for(var S,T,w=[],C=0;C<M;C++){var U=c(O[C]);U!==0&&(T===void 0&&(T=U<0),T===U<0?(S&&w.push(S),S=[O[C]]):S.push(O[C]))}return S&&w.push(S),w})(x),g=0;g<x.length;g++)for(v=0;v<x[g].length;v++)B(x[g][v])}x.length===1?x=x[0]:E="Multi"+E;var I={type:"Feature",geometry:{type:E,coordinates:x},properties:this.properties};return"id"in this&&(I.id=this.id),I}},9701:function(r,a,s){var l=s(6024);function u(c,f){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(A,this,f),this.length=this._features.length}function A(c,f,d){c===15?f.version=d.readVarint():c===1?f.name=d.readString():c===5?f.extent=d.readVarint():c===2?f._features.push(d.pos):c===3?f._keys.push(d.readString()):c===4&&f._values.push((function(p){for(var g=null,v=p.readVarint()+p.pos;p.pos<v;){var y=p.readVarint()>>3;g=y===1?p.readString():y===2?p.readFloat():y===3?p.readDouble():y===4?p.readVarint64():y===5?p.readVarint():y===6?p.readSVarint():y===7?p.readBoolean():null}return g})(d))}r.exports=u,u.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var f=this._pbf.readVarint()+this._pbf.pos;return new l(this._pbf,f,this.extent,this._keys,this._values)}},8583:function(r,a,s){var l=s(7418);function u(w,C){if(w===C)return 0;for(var U=w.length,F=C.length,D=0,R=Math.min(U,F);D<R;++D)if(w[D]!==C[D]){U=w[D],F=C[D];break}return U<F?-1:F<U?1:0}function A(w){return s.g.Buffer&&typeof s.g.Buffer.isBuffer=="function"?s.g.Buffer.isBuffer(w):!(w==null||!w._isBuffer)}var c=s(69),f=Object.prototype.hasOwnProperty,d=Array.prototype.slice,p=(function(){}).name==="foo";function g(w){return Object.prototype.toString.call(w)}function v(w){return!A(w)&&typeof s.g.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(w):!!w&&(w instanceof DataView||!!(w.buffer&&w.buffer instanceof ArrayBuffer)))}var y=r.exports=P,m=/\s*function\s+([^\(\s]*)\s*/;function b(w){if(c.isFunction(w)){if(p)return w.name;var C=w.toString().match(m);return C&&C[1]}}function x(w,C){return typeof w=="string"?w.length<C?w:w.slice(0,C):w}function E(w){if(p||!c.isFunction(w))return c.inspect(w);var C=b(w);return"[Function"+(C?": "+C:"")+"]"}function B(w,C,U,F,D){throw new y.AssertionError({message:U,actual:w,expected:C,operator:F,stackStartFunction:D})}function P(w,C){w||B(w,!0,C,"==",y.ok)}function I(w,C,U,F){if(w===C)return!0;if(A(w)&&A(C))return u(w,C)===0;if(c.isDate(w)&&c.isDate(C))return w.getTime()===C.getTime();if(c.isRegExp(w)&&c.isRegExp(C))return w.source===C.source&&w.global===C.global&&w.multiline===C.multiline&&w.lastIndex===C.lastIndex&&w.ignoreCase===C.ignoreCase;if(w!==null&&typeof w=="object"||C!==null&&typeof C=="object"){if(v(w)&&v(C)&&g(w)===g(C)&&!(w instanceof Float32Array||w instanceof Float64Array))return u(new Uint8Array(w.buffer),new Uint8Array(C.buffer))===0;if(A(w)!==A(C))return!1;var D=(F=F||{actual:[],expected:[]}).actual.indexOf(w);return D!==-1&&D===F.expected.indexOf(C)||(F.actual.push(w),F.expected.push(C),(function(R,L,k,Q){if(R==null||L==null)return!1;if(c.isPrimitive(R)||c.isPrimitive(L))return R===L;if(k&&Object.getPrototypeOf(R)!==Object.getPrototypeOf(L))return!1;var V=O(R),G=O(L);if(V&&!G||!V&&G)return!1;if(V)return I(R=d.call(R),L=d.call(L),k);var $,Y,ie=T(R),re=T(L);if(ie.length!==re.length)return!1;for(ie.sort(),re.sort(),Y=ie.length-1;Y>=0;Y--)if(ie[Y]!==re[Y])return!1;for(Y=ie.length-1;Y>=0;Y--)if(!I(R[$=ie[Y]],L[$],k,Q))return!1;return!0})(w,C,U,F))}return U?w===C:w==C}function O(w){return Object.prototype.toString.call(w)=="[object Arguments]"}function M(w,C){if(!w||!C)return!1;if(Object.prototype.toString.call(C)=="[object RegExp]")return C.test(w);try{if(w instanceof C)return!0}catch{}return!Error.isPrototypeOf(C)&&C.call({},w)===!0}function S(w,C,U,F){var D;if(typeof C!="function")throw new TypeError('"block" argument must be a function');typeof U=="string"&&(F=U,U=null),D=(function(k){var Q;try{k()}catch(V){Q=V}return Q})(C),F=(U&&U.name?" ("+U.name+").":".")+(F?" "+F:"."),w&&!D&&B(D,U,"Missing expected exception"+F);var R=typeof F=="string",L=!w&&D&&!U;if((!w&&c.isError(D)&&R&&M(D,U)||L)&&B(D,U,"Got unwanted exception"+F),w&&D&&U&&!M(D,U)||!w&&D)throw D}y.AssertionError=function(w){this.name="AssertionError",this.actual=w.actual,this.expected=w.expected,this.operator=w.operator,w.message?(this.message=w.message,this.generatedMessage=!1):(this.message=(function(k){return x(E(k.actual),128)+" "+k.operator+" "+x(E(k.expected),128)})(this),this.generatedMessage=!0);var C=w.stackStartFunction||B;if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var U=new Error;if(U.stack){var F=U.stack,D=b(C),R=F.indexOf(`
386
+ `;return r=Xd(s),new Worker(r,o)}if(r=t,e||(r=Gn(`${Ut._workerModulePrefix+i}.js`)),!Ht.supportsEsmWebWorkers())throw new Nt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function y5(t,n){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ht.supportsWebAssembly()){if(!ne(n.fallbackModulePath))throw new Nt(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=Gn(n.fallbackModulePath),e}e.wasmBinaryFile=Gn(n.wasmBinaryFile);const i=await xe.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=i,e}function Ut(t,n){this._workerPath=t,this._maximumActiveTasks=n??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const v5=(t,n,e,i)=>{const o=({data:r})=>{if(r.id===n){if(ne(r.error)){let a=r.error;a.name==="RuntimeError"?(a=new Nt(r.error.message),a.stack=r.error.stack):a.name==="DeveloperError"?(a=new pe(r.error.message),a.stack=r.error.stack):a.name==="Error"&&(a=new Error(r.error.message),a.stack=r.error.stack),Zd.raiseEvent(a),i(a)}else Zd.raiseEvent(),e(r.result);t.removeEventListener("message",o)}};return o},w5=[];async function b5(t,n,e){const i=await Promise.resolve(rx());ne(e)?i||(e.length=0):e=w5;const o=t._nextID++,r=new Promise((a,s)=>{t._worker.addEventListener("message",v5(t._worker,o,a,s))});return t._worker.postMessage({id:o,baseUrl:Gn.getCesiumBaseUrl().url,parameters:n,canTransferArrayBuffer:i},e),r}async function x5(t,n,e){++t._activeTasks;try{const i=await b5(t,n,e);return--t._activeTasks,i}catch(i){throw--t._activeTasks,i}}Ut.prototype.scheduleTask=function(t,n){if(ne(this._worker)||(this._worker=$d(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return x5(this,t,n)},Ut.prototype.initWebAssemblyModule=async function(t){if(ne(this._webAssemblyPromise))return this._webAssemblyPromise;const n=async()=>{const e=this._worker=$d(this._workerPath),i=await y5(this,t),o=await Promise.resolve(rx());let r;const a=i.wasmBinary;ne(a)&&o&&(r=[a]);const s=new Promise((l,u)=>{e.onmessage=function({data:A}){ne(A)?l(A.result):u(new Nt("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),s};return this._webAssemblyPromise=n(),this._webAssemblyPromise},Ut.prototype.isDestroyed=function(){return!1},Ut.prototype.destroy=function(){return ne(this._worker)&&this._worker.terminate(),m4(this)},Ut.taskCompletedEvent=Zd,Ut._defaultWorkerModulePrefix="Workers/",Ut._workerModulePrefix=Ut._defaultWorkerModulePrefix,Ut._canTransferArrayBuffer=void 0;function Zi(){}Zi._transcodeTaskProcessor=new Ut("transcodeKTX2",Number.POSITIVE_INFINITY),Zi._readyPromise=void 0;function _5(){const t=Zi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(n){if(n)return Zi._transcodeTaskProcessor;throw new Nt("KTX2 transcoder could not be initialized.")});Zi._readyPromise=t}Zi.transcode=function(t,n){return N.defined("supportedTargetFormats",n),ne(Zi._readyPromise)||_5(),Zi._readyPromise.then(function(e){let i=t;t instanceof ArrayBuffer&&(i=new Uint8Array(t));const o={supportedTargetFormats:n,ktx2Buffer:i};return e.scheduleTask(o,[i.buffer])}).then(function(e){const i=e.length,o=Object.keys(e[0]);for(let r=0;r<i;r++){const a=e[r];for(let s=0;s<o.length;s++){const l=a[o[s]];a[o[s]]=new Ws(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)e[r]=e[r][o[0]];i===1&&(e=e[0])}return e}).catch(function(e){throw e})};let ox;sx.setKTX2SupportedFormats=function(t,n,e,i,o,r){ox={s3tc:t,pvrtc:n,astc:e,etc:i,etc1:o,bc7:r}};function sx(t){N.defined("resourceOrUrlOrBuffer",t);let n;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?n=Promise.resolve(t):n=xe.createIfNeeded(t).fetchArrayBuffer(),n.then(function(e){return Zi.transcode(e,ox)})}function yn(t){this._ellipsoid=t??De.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(yn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),yn.mercatorAngleToGeodeticLatitude=function(t){return he.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},yn.geodeticLatitudeToMercatorAngle=function(t){t>yn.MaximumLatitude?t=yn.MaximumLatitude:t<-yn.MaximumLatitude&&(t=-yn.MaximumLatitude);const n=Math.sin(t);return .5*Math.log((1+n)/(1-n))},yn.MaximumLatitude=yn.mercatorAngleToGeodeticLatitude(Math.PI),yn.prototype.project=function(t,n){const e=this._semimajorAxis,i=t.longitude*e,o=yn.geodeticLatitudeToMercatorAngle(t.latitude)*e,r=t.height;return ne(n)?(n.x=i,n.y=o,n.z=r,n):new ae(i,o,r)},yn.prototype.unproject=function(t,n){if(!ne(t))throw new pe("cartesian is required");const e=this._oneOverSemimajorAxis,i=t.x*e,o=yn.mercatorAngleToGeodeticLatitude(t.y*e),r=t.z;return ne(n)?(n.longitude=i,n.latitude=o,n.height=r,n):new Qe(i,o,r)};const ax={};function Cl(t,n){if(!ne(t))throw new pe("identifier is required.");ne(ax[t])||(ax[t]=!0,console.warn(n??t))}Cl.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.",Cl.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Cl.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Cl.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function lx(t,n){if(!ne(t)||!ne(n))throw new pe("identifier and message are required.");Cl(t,n)}function js(){pe.throwInstantiationError()}Object.defineProperties(js.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}}),js.prototype.getTileCredits=function(t,n,e){pe.throwInstantiationError()},js.prototype.requestImage=function(t,n,e,i){pe.throwInstantiationError()},js.prototype.pickFeatures=function(t,n,e,i,o){pe.throwInstantiationError()};const C5=/\.ktx2$/i;js.loadImage=function(t,n){N.defined("url",n);const e=xe.createIfNeeded(n);return C5.test(e.url)?sx(e):ne(t)&&ne(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function ux(t,n){return lx("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??n}Object.defineProperty(ux,"EMPTY_OBJECT",{get:function(){return lx("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),gi.EMPTY_OBJECT}});var UA=3.141592653589793*3e3/180,Ot=3.141592653589793,OA=6378245,LA=.006693421622965943,cx=function(i,o){var i=+i,o=+o,r=i-.0065,a=o-.006,s=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*UA),l=Math.atan2(a,r)-3e-6*Math.cos(r*UA),u=s*Math.cos(l),A=s*Math.sin(l);return[u,A]},hx=function(o,i){var i=+i,o=+o,r=Math.sqrt(o*o+i*i)+2e-5*Math.sin(i*UA),a=Math.atan2(i,o)+3e-6*Math.cos(o*UA),s=r*Math.cos(a)+.0065,l=r*Math.sin(a)+.006;return[s,l]},Yd=function(o,i){var i=+i,o=+o;if(px(o,i))return[o,i];var r=Ax(o-105,i-35),a=fx(o-105,i-35),s=i/180*Ot,l=Math.sin(s);l=1-LA*l*l;var u=Math.sqrt(l);r=r*180/(OA*(1-LA)/(l*u)*Ot),a=a*180/(OA/u*Math.cos(s)*Ot);var A=i+r,c=o+a;return[c,A]},Jd=function(o,i){var i=+i,o=+o;if(px(o,i))return[o,i];var r=Ax(o-105,i-35),a=fx(o-105,i-35),s=i/180*Ot,l=Math.sin(s);l=1-LA*l*l;var u=Math.sqrt(l);r=r*180/(OA*(1-LA)/(l*u)*Ot),a=a*180/(OA/u*Math.cos(s)*Ot);var A=i+r,c=o+a;return[o*2-c,i*2-A]},Ax=function(o,i){var i=+i,o=+o,r=-100+2*o+3*i+.2*i*i+.1*o*i+.2*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*Ot)+20*Math.sin(2*o*Ot))*2/3,r+=(20*Math.sin(i*Ot)+40*Math.sin(i/3*Ot))*2/3,r+=(160*Math.sin(i/12*Ot)+320*Math.sin(i*Ot/30))*2/3,r},fx=function(o,i){var i=+i,o=+o,r=300+o+2*i+.1*o*o+.1*o*i+.1*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*Ot)+20*Math.sin(2*o*Ot))*2/3,r+=(20*Math.sin(o*Ot)+40*Math.sin(o/3*Ot))*2/3,r+=(150*Math.sin(o/12*Ot)+300*Math.sin(o/30*Ot))*2/3,r},px=function(o,i){var i=+i,o=+o;return!(o>73.66&&o<135.05&&i>3.86&&i<53.55)};function em(t,n){this.x=t||0,this.y=n||0,this.x=this.x,this.y=this.y}em.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function ri(t,n){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(n)&&(n=decode64(n),n=isNaN(n)?0:n),typeof t=="lat"&&(n=parseFloat(n)),this.lng=t,this.lat=n}ri.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},ri.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function at(){}at.EARTHRADIUS=637099681e-2,at.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],at.LLBAND=[75,60,45,30,15,0],at.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]],at.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]],at.getDistanceByMC=function(t,n){if(!t||!n)return 0;var e,i,o,r;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),i=this.toRadians(t.lat),n=this.convertMC2LL(n),!n)?0:(o=this.toRadians(n.lng),r=this.toRadians(n.lat),this.getDistance(e,o,i,r))},at.getDistanceByLL=function(t,n){if(!t||!n)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),n.lng=this.getLoop(n.lng,-180,180),n.lat=this.getRange(n.lat,-74,74);var e,i,o,r;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),i=this.toRadians(n.lng),r=this.toRadians(n.lat),this.getDistance(e,i,o,r)},at.convertMC2LL=function(r){var n,e;n=new ri(Math.abs(r.lng),Math.abs(r.lat));for(var i=0;i<this.MCBAND.length;i++)if(n.lat>=this.MCBAND[i]){e=this.MC2LL[i];break}var o=this.convertor(r,e),r=new ri(o.lng.toFixed(6),o.lat.toFixed(6));return r},at.convertLL2MC=function(r){var n,e;r.lng=this.getLoop(r.lng,-180,180),r.lat=this.getRange(r.lat,-74,74),n=new ri(r.lng,r.lat);for(var i=0;i<this.LLBAND.length;i++)if(n.lat>=this.LLBAND[i]){e=this.LL2MC[i];break}if(!e){for(var i=this.LLBAND.length-1;i>=0;i--)if(n.lat<=-this.LLBAND[i]){e=this.LL2MC[i];break}}var o=this.convertor(r,e),r=new ri(o.lng.toFixed(2),o.lat.toFixed(2));return r},at.convertor=function(t,n){if(!(!t||!n)){var e=n[0]+n[1]*Math.abs(t.lng),i=Math.abs(t.lat)/n[9],o=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new ri(e,o)}},at.getDistance=function(t,n,e,i){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(i)+Math.cos(e)*Math.cos(i)*Math.cos(n-t))},at.toRadians=function(t){return Math.PI*t/180},at.toDegrees=function(t){return 180*t/Math.PI},at.getRange=function(t,n,e){return n!=null&&(t=Math.max(t,n)),e!=null&&(t=Math.min(t,e)),t},at.getLoop=function(t,n,e){for(;t>e;)t-=e-n;for(;t<n;)t+=e-n;return t},at.prototype.lngLatToMercator=function(t){return at.convertLL2MC(t)},at.prototype.lngLatToPoint=function(t){var n=at.convertLL2MC(t);return new em(n.lng,n.lat)},at.prototype.mercatorToLngLat=function(t){return at.convertMC2LL(t)},at.prototype.PointToLngLat=function(t){var n=new ri(t.x,t.y);return at.convertMC2LL(n)},at.prototype.PointToPixel=function(t,n,e,i,o){if(t){t=this.lngLatToMercator(t,o);var r=this.getZoomUnits(n),a=Math.round((t.lng-e.lng)/r+i[Twidth]/2),s=Math.round((e.lat-t.lat)/r+i[Theight]/2);return new em(a,s)}},at.prototype.PixelToPoint=function(t,n,e,i,o){if(t){var r=this.getZoomUnits(n),a=e.lng+r*(t.x-i[Twidth]/2),s=e.lat-r*(t.y-i[Theight]/2),l=new ri(a,s);return this.mercatorToLngLat(l,o)}},at.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Qr(t){t=t||{},this._ellipsoid=ux(t.ellipsoid,De.WGS84);var n=!0;ne(t.wgs84)&&(n=t.wgs84),this._projection=new yn(this._ellipsoid);var e=new at;this._projection.project=function(a){var s={};return n?(s=Yd(he.toDegrees(a.longitude),he.toDegrees(a.latitude)),s=hx(s[0],s[1])):s=hx(he.toDegrees(a.longitude),he.toDegrees(a.latitude)),s[0]=Math.min(s[0],180),s[0]=Math.max(s[0],-180),s[1]=Math.min(s[1],74.000022),s[1]=Math.max(s[1],-71.988531),s=e.lngLatToPoint(new ri(s[0],s[1])),new _e(s.x,s.y)},this._projection.unproject=function(a){var s=e.mercatorToLngLat(new ri(a.x,a.y));return s[0]=(s[0]+180)%360-180,n?(s=cx(s.lng,s.lat),s=Jd(s[0],s[1])):s=cx(s.lng,s.lat),new Qe(he.toRadians(s[0]),he.toRadians(s[1]))},this._rectangleSouthwestInMeters=new _e(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new _e(2003772637e-2,1247410417e-2);var i=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Te(i.longitude,i.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var r=0;r<19;r++)this.levelWidth[r]=Math.pow(2,18-r)*256}Object.defineProperties(Qr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Qr.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Qr.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Qr.prototype.rectangleToNativeRectangle=function(t,n){var e=this._projection,i=e.project(Te.southwest(t)),o=e.project(Te.northeast(t));return ne(n)?(n.west=i.x,n.south=i.y,n.east=o.x,n.north=o.y,n):new Te(i.x,i.y,o.x,o.y)},Qr.prototype.tileXYToNativeRectangle=function(t,n,e,i){var o=this.levelWidth[e],r=t*o,a=(t+1)*o;n=-n;var s=(n+1)*o,l=n*o;return ne(i)?(i.west=r,i.south=l,i.east=a,i.north=s,i):new Te(r,l,a,s)},Qr.prototype.tileXYToRectangle=function(t,n,e,i){var o=this.tileXYToNativeRectangle(t,n,e,i),r=this._projection,a=r.unproject(new _e(o.west,o.south)),s=r.unproject(new _e(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=s.longitude,o.north=s.latitude,o},Qr.prototype.positionToTileXY=function(t,n,e){var i=this._rectangle;if(Te.contains(i,t)){var o=this._projection,r=o.project(t);if(ne(r)){var a=this.levelWidth[n],s=Math.floor(r.x/a),l=-Math.floor(r.y/a);return ne(e)?(e.x=s,e.y=l,e):new _e(s,l)}}};function zA(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 Qr(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function S5(t,n,e,i){var o=t._url;return o=o.replace("{x}",n).replace("{y}",-e).replace("{z}",i),o}Object.defineProperties(zA.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}}}),zA.prototype.getTileCredits=function(t,n,e){},zA.prototype.requestImage=function(t,n,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var i=S5(this,t,n,e);return js.loadImage(this,i)};class E5 extends _.UrlTemplateImageryProvider{constructor(e){super(e);z(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new _.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,i,o,r){try{let a=this.buildImageUrl(this.indexTime,e,i,o);return _.ImageryProvider.loadImage(this,a)}catch{return}}buildImageUrl(e,i,o,r){return`https://tileser.giiiis.com/timetile/${e}/${r}/${i}/${o}.jpg`}}class P5 extends _.UrlTemplateImageryProvider{constructor(e){super(e);z(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,i,o,r){try{let a;return this.indexTimeID!==0?a=this.buildImageUrl(this.indexTimeID,e,i,o):a=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${i}/${e}`,_.ImageryProvider.loadImage(this,a)}catch{return}}buildImageUrl(e,i,o,r){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${r}/${o}/${i}`}}var tm={exports:{}};/*! For license information please see mvt-basic-render.js.LICENSE.txt */var dx;function B5(){return dx||(dx=1,(function(t,n){(function(e,i){t.exports=i()})(self,(function(){return(function(){var e={3226:function(r){r.exports=(function(){return(a=new Float32Array(3))[0]=0,a[1]=0,a[2]=0,(function(){var s=new Float32Array(4);s[0]=0,s[1]=0,s[2]=0,s[3]=0})(),{vec3:{transformMat3:function(s,l,u){var A=l[0],c=l[1],f=l[2];return s[0]=A*u[0]+c*u[3]+f*u[6],s[1]=A*u[1]+c*u[4]+f*u[7],s[2]=A*u[2]+c*u[5]+f*u[8],s}},vec4:{transformMat4:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3];return s[0]=u[0]*A+u[4]*c+u[8]*f+u[12]*d,s[1]=u[1]*A+u[5]*c+u[9]*f+u[13]*d,s[2]=u[2]*A+u[6]*c+u[10]*f+u[14]*d,s[3]=u[3]*A+u[7]*c+u[11]*f+u[15]*d,s}},mat2:{create:function(){var s=new Float32Array(4);return s[0]=1,s[1]=0,s[2]=0,s[3]=1,s},rotate:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=Math.sin(u),g=Math.cos(u);return s[0]=A*g+f*p,s[1]=c*g+d*p,s[2]=A*-p+f*g,s[3]=c*-p+d*g,s},scale:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=u[0],g=u[1];return s[0]=A*p,s[1]=c*p,s[2]=f*g,s[3]=d*g,s}},mat3:{create:function(){var s=new Float32Array(9);return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=1,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s},fromRotation:function(s,l){var u=Math.sin(l),A=Math.cos(l);return s[0]=A,s[1]=u,s[2]=0,s[3]=-u,s[4]=A,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s}},mat4:{create:function(){var s=new Float32Array(16);return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},identity:function(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},translate:function(s,l,u){var A,c,f,d,p,g,v,y,m,b,x,E,B=u[0],P=u[1],I=u[2];return l===s?(s[12]=l[0]*B+l[4]*P+l[8]*I+l[12],s[13]=l[1]*B+l[5]*P+l[9]*I+l[13],s[14]=l[2]*B+l[6]*P+l[10]*I+l[14],s[15]=l[3]*B+l[7]*P+l[11]*I+l[15]):(A=l[0],c=l[1],f=l[2],d=l[3],p=l[4],g=l[5],v=l[6],y=l[7],m=l[8],b=l[9],x=l[10],E=l[11],s[0]=A,s[1]=c,s[2]=f,s[3]=d,s[4]=p,s[5]=g,s[6]=v,s[7]=y,s[8]=m,s[9]=b,s[10]=x,s[11]=E,s[12]=A*B+p*P+m*I+l[12],s[13]=c*B+g*P+b*I+l[13],s[14]=f*B+v*P+x*I+l[14],s[15]=d*B+y*P+E*I+l[15]),s},scale:function(s,l,u){var A=u[0],c=u[1],f=u[2];return s[0]=l[0]*A,s[1]=l[1]*A,s[2]=l[2]*A,s[3]=l[3]*A,s[4]=l[4]*c,s[5]=l[5]*c,s[6]=l[6]*c,s[7]=l[7]*c,s[8]=l[8]*f,s[9]=l[9]*f,s[10]=l[10]*f,s[11]=l[11]*f,s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},multiply:function(s,l,u){var A=l[0],c=l[1],f=l[2],d=l[3],p=l[4],g=l[5],v=l[6],y=l[7],m=l[8],b=l[9],x=l[10],E=l[11],B=l[12],P=l[13],I=l[14],O=l[15],M=u[0],S=u[1],T=u[2],w=u[3];return s[0]=M*A+S*p+T*m+w*B,s[1]=M*c+S*g+T*b+w*P,s[2]=M*f+S*v+T*x+w*I,s[3]=M*d+S*y+T*E+w*O,M=u[4],S=u[5],T=u[6],w=u[7],s[4]=M*A+S*p+T*m+w*B,s[5]=M*c+S*g+T*b+w*P,s[6]=M*f+S*v+T*x+w*I,s[7]=M*d+S*y+T*E+w*O,M=u[8],S=u[9],T=u[10],w=u[11],s[8]=M*A+S*p+T*m+w*B,s[9]=M*c+S*g+T*b+w*P,s[10]=M*f+S*v+T*x+w*I,s[11]=M*d+S*y+T*E+w*O,M=u[12],S=u[13],T=u[14],w=u[15],s[12]=M*A+S*p+T*m+w*B,s[13]=M*c+S*g+T*b+w*P,s[14]=M*f+S*v+T*x+w*I,s[15]=M*d+S*y+T*E+w*O,s},perspective:function(s,l,u,A,c){var f=1/Math.tan(l/2),d=1/(A-c);return s[0]=f/u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=f,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(c+A)*d,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*c*A*d,s[15]=0,s},rotateX:function(s,l,u){var A=Math.sin(u),c=Math.cos(u),f=l[4],d=l[5],p=l[6],g=l[7],v=l[8],y=l[9],m=l[10],b=l[11];return l!==s&&(s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[4]=f*c+v*A,s[5]=d*c+y*A,s[6]=p*c+m*A,s[7]=g*c+b*A,s[8]=v*c-f*A,s[9]=y*c-d*A,s[10]=m*c-p*A,s[11]=b*c-g*A,s},rotateZ:function(s,l,u){var A=Math.sin(u),c=Math.cos(u),f=l[0],d=l[1],p=l[2],g=l[3],v=l[4],y=l[5],m=l[6],b=l[7];return l!==s&&(s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[0]=f*c+v*A,s[1]=d*c+y*A,s[2]=p*c+m*A,s[3]=g*c+b*A,s[4]=v*c-f*A,s[5]=y*c-d*A,s[6]=m*c-p*A,s[7]=b*c-g*A,s},invert:function(s,l){var u=l[0],A=l[1],c=l[2],f=l[3],d=l[4],p=l[5],g=l[6],v=l[7],y=l[8],m=l[9],b=l[10],x=l[11],E=l[12],B=l[13],P=l[14],I=l[15],O=u*p-A*d,M=u*g-c*d,S=u*v-f*d,T=A*g-c*p,w=A*v-f*p,C=c*v-f*g,U=y*B-m*E,F=y*P-b*E,D=y*I-x*E,R=m*P-b*B,L=m*I-x*B,k=b*I-x*P,Q=O*k-M*L+S*R+T*D-w*F+C*U;return Q?(Q=1/Q,s[0]=(p*k-g*L+v*R)*Q,s[1]=(c*L-A*k-f*R)*Q,s[2]=(B*C-P*w+I*T)*Q,s[3]=(b*w-m*C-x*T)*Q,s[4]=(g*D-d*k-v*F)*Q,s[5]=(u*k-c*D+f*F)*Q,s[6]=(P*S-E*C-I*M)*Q,s[7]=(y*C-b*S+x*M)*Q,s[8]=(d*L-p*D+v*U)*Q,s[9]=(A*D-u*L-f*U)*Q,s[10]=(E*w-B*S+I*O)*Q,s[11]=(m*S-y*w-x*O)*Q,s[12]=(p*F-d*R-g*U)*Q,s[13]=(u*R-A*F+c*U)*Q,s[14]=(B*M-E*T-P*O)*Q,s[15]=(y*T-m*M+b*O)*Q,s):null},ortho:function(s,l,u,A,c,f,d){var p=1/(l-u),g=1/(A-c),v=1/(f-d);return s[0]=-2*p,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*g,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*v,s[11]=0,s[12]=(l+u)*p,s[13]=(c+A)*g,s[14]=(d+f)*v,s[15]=1,s}}};var a})()},2235:function(r){function a(l){return!!(typeof window<"u"&&typeof document<"u"&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var A,c,f=new Blob([""],{type:"text/javascript"}),d=URL.createObjectURL(f);try{c=new Worker(d),A=!0}catch{A=!1}return c&&c.terminate(),URL.revokeObjectURL(d),A})()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&(u=l&&l.failIfMajorPerformanceCaveat,s[u]===void 0&&(s[u]=(function(A){var c=document.createElement("canvas"),f=Object.create(a.webGLContextAttributes);return f.failIfMajorPerformanceCaveat=A,c.probablySupportsContext?c.probablySupportsContext("webgl",f)||c.probablySupportsContext("experimental-webgl",f):c.supportsContext?c.supportsContext("webgl",f)||c.supportsContext("experimental-webgl",f):c.getContext("webgl",f)||c.getContext("experimental-webgl",f)})(u)),s[u]));var u}r.exports?r.exports=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a);var s={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},5550:function(r){function a(s,l){this.x=s,this.y=l}r.exports=a,a.prototype={clone:function(){return new a(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,l){return this.clone()._rotateAround(s,l)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var l=s.x-this.x,u=s.y-this.y;return l*l+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,l){return Math.atan2(this.x*l-this.y*s,this.x*s+this.y*l)},_matMult:function(s){var l=s[0]*this.x+s[1]*this.y,u=s[2]*this.x+s[3]*this.y;return this.x=l,this.y=u,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var l=Math.cos(s),u=Math.sin(s),A=l*this.x-u*this.y,c=u*this.x+l*this.y;return this.x=A,this.y=c,this},_rotateAround:function(s,l){var u=Math.cos(s),A=Math.sin(s),c=l.x+u*(this.x-l.x)-A*(this.y-l.y),f=l.y+A*(this.x-l.x)+u*(this.y-l.y);return this.x=c,this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(s){return s instanceof a?s:Array.isArray(s)?new a(s[0],s[1]):s}},3775:function(r){r.exports=(function(){function a(u,A,c){c=c||{},this.w=u||64,this.h=A||64,this.autoResize=!!c.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function s(u,A,c){this.x=0,this.y=u,this.w=this.free=A,this.h=c}function l(u,A,c,f,d,p,g){this.id=u,this.x=A,this.y=c,this.w=f,this.h=d,this.maxw=p||f,this.maxh=g||d,this.refcount=0}return a.prototype.pack=function(u,A){u=[].concat(u),A=A||{};for(var c,f,d,p,g=[],v=0;v<u.length;v++)if(c=u[v].w||u[v].width,f=u[v].h||u[v].height,d=u[v].id,c&&f){if(!(p=this.packOne(c,f,d)))continue;A.inPlace&&(u[v].x=p.x,u[v].y=p.y,u[v].id=p.id),g.push(p)}return this.shrink(),g},a.prototype.packOne=function(u,A,c){var f,d,p,g,v,y,m,b,x={freebin:-1,shelf:-1,waste:1/0},E=0;if(typeof c=="string"||typeof c=="number"){if(f=this.getBin(c))return this.ref(f),f;typeof c=="number"&&(this.maxId=Math.max(c,this.maxId))}else c=++this.maxId;for(g=0;g<this.freebins.length;g++){if(A===(f=this.freebins[g]).maxh&&u===f.maxw)return this.allocFreebin(g,u,A,c);A>f.maxh||u>f.maxw||A<=f.maxh&&u<=f.maxw&&(p=f.maxw*f.maxh-u*A)<x.waste&&(x.waste=p,x.freebin=g)}for(g=0;g<this.shelves.length;g++)if(E+=(d=this.shelves[g]).h,!(u>d.free)){if(A===d.h)return this.allocShelf(g,u,A,c);A>d.h||A<d.h&&(p=(d.h-A)*u)<x.waste&&(x.freebin=-1,x.waste=p,x.shelf=g)}return x.freebin!==-1?this.allocFreebin(x.freebin,u,A,c):x.shelf!==-1?this.allocShelf(x.shelf,u,A,c):A<=this.h-E&&u<=this.w?(d=new s(E,this.w,A),this.allocShelf(this.shelves.push(d)-1,u,A,c)):this.autoResize?(v=y=this.h,((m=b=this.w)<=v||u>m)&&(b=2*Math.max(u,m)),(v<m||A>v)&&(y=2*Math.max(A,v)),this.resize(b,y),this.packOne(u,A,c)):null},a.prototype.allocFreebin=function(u,A,c,f){var d=this.freebins.splice(u,1)[0];return d.id=f,d.w=A,d.h=c,d.refcount=0,this.bins[f]=d,this.ref(d),d},a.prototype.allocShelf=function(u,A,c,f){var d=this.shelves[u].alloc(A,c,f);return this.bins[f]=d,this.ref(d),d},a.prototype.shrink=function(){if(this.shelves.length>0){for(var u=0,A=0,c=0;c<this.shelves.length;c++){var f=this.shelves[c];A+=f.h,u=Math.max(f.w-f.free,u)}this.resize(u,A)}},a.prototype.getBin=function(u){return this.bins[u]},a.prototype.ref=function(u){if(++u.refcount==1){var A=u.h;this.stats[A]=1+(0|this.stats[A])}return u.refcount},a.prototype.unref=function(u){return u.refcount===0?0:(--u.refcount==0&&(this.stats[u.h]--,delete this.bins[u.id],this.freebins.push(u)),u.refcount)},a.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},a.prototype.resize=function(u,A){this.w=u,this.h=A;for(var c=0;c<this.shelves.length;c++)this.shelves[c].resize(u);return!0},s.prototype.alloc=function(u,A,c){if(u>this.free||A>this.h)return null;var f=this.x;return this.x+=u,this.free-=u,new l(c,f,this.y,u,A,u,this.h)},s.prototype.resize=function(u){return this.free+=u-this.w,this.w=u,!0},a})()},3673:function(r,a){var s=(function(){var l={},u=Math.PI/180,A=180/Math.PI,c=6378137,f=20037508342789244e-9;function d(g){return Number(g)===g&&g%1!=0}function p(g){if(g=g||{},this.size=g.size||256,this.expansion=g.antimeridian===!0?2:1,!l[this.size]){var v=this.size,y=l[this.size]={};y.Bc=[],y.Cc=[],y.zc=[],y.Ac=[];for(var m=0;m<30;m++)y.Bc.push(v/360),y.Cc.push(v/(2*Math.PI)),y.zc.push(v/2),y.Ac.push(v),v*=2}this.Bc=l[this.size].Bc,this.Cc=l[this.size].Cc,this.zc=l[this.size].zc,this.Ac=l[this.size].Ac}return p.prototype.px=function(g,v){if(d(v)){var y=this.size*Math.pow(2,v),m=y/2,b=y/360,x=y/(2*Math.PI),E=y,B=Math.min(Math.max(Math.sin(u*g[1]),-.9999),.9999),P=m+g[0]*b,I=m+.5*Math.log((1+B)/(1-B))*-x;return P>E*this.expansion&&(P=E*this.expansion),I>E&&(I=E),[P,I]}return m=this.zc[v],B=Math.min(Math.max(Math.sin(u*g[1]),-.9999),.9999),P=Math.round(m+g[0]*this.Bc[v]),I=Math.round(m+.5*Math.log((1+B)/(1-B))*-this.Cc[v]),P>this.Ac[v]*this.expansion&&(P=this.Ac[v]*this.expansion),I>this.Ac[v]&&(I=this.Ac[v]),[P,I]},p.prototype.ll=function(g,v){if(d(v)){var y=this.size*Math.pow(2,v),m=y/360,b=y/(2*Math.PI),x=y/2,E=(g[1]-x)/-b;return[(g[0]-x)/m,A*(2*Math.atan(Math.exp(E))-.5*Math.PI)]}return E=(g[1]-this.zc[v])/-this.Cc[v],[(g[0]-this.zc[v])/this.Bc[v],A*(2*Math.atan(Math.exp(E))-.5*Math.PI)]},p.prototype.bbox=function(g,v,y,m,b){m&&(v=Math.pow(2,y)-1-v);var x=[g*this.size,(+v+1)*this.size],E=[(+g+1)*this.size,v*this.size],B=this.ll(x,y).concat(this.ll(E,y));return b==="900913"?this.convert(B,"900913"):B},p.prototype.xyz=function(g,v,y,m){m==="900913"&&(g=this.convert(g,"WGS84"));var b=[g[0],g[1]],x=[g[2],g[3]],E=this.px(b,v),B=this.px(x,v),P=[Math.floor(E[0]/this.size),Math.floor((B[0]-1)/this.size)],I=[Math.floor(B[1]/this.size),Math.floor((E[1]-1)/this.size)],O={minX:Math.min.apply(Math,P)<0?0:Math.min.apply(Math,P),minY:Math.min.apply(Math,I)<0?0:Math.min.apply(Math,I),maxX:Math.max.apply(Math,P),maxY:Math.max.apply(Math,I)};if(y){var M={minY:Math.pow(2,v)-1-O.maxY,maxY:Math.pow(2,v)-1-O.minY};O.minY=M.minY,O.maxY=M.maxY}return O},p.prototype.convert=function(g,v){return v==="900913"?this.forward(g.slice(0,2)).concat(this.forward(g.slice(2,4))):this.inverse(g.slice(0,2)).concat(this.inverse(g.slice(2,4)))},p.prototype.forward=function(g){var v=[c*g[0]*u,c*Math.log(Math.tan(.25*Math.PI+.5*g[1]*u))];return v[0]>f&&(v[0]=f),v[0]<-f&&(v[0]=-f),v[1]>f&&(v[1]=f),v[1]<-f&&(v[1]=-f),v},p.prototype.inverse=function(g){return[g[0]*A/c,(.5*Math.PI-2*Math.atan(Math.exp(-g[1]/c)))*A]},p})();r.exports=s},9296:function(r){r.exports=s,r.exports.default=s;var a=1e20;function s(A,c,f,d,p,g){this.fontSize=A||24,this.buffer=c===void 0?3:c,this.cutoff=d||.25,this.fontFamily=p||"sans-serif",this.fontWeight=g||"normal",this.radius=f||8;var v=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=v,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(v*v),this.gridInner=new Float64Array(v*v),this.f=new Float64Array(v),this.d=new Float64Array(v),this.z=new Float64Array(v+1),this.v=new Int16Array(v),this.middle=Math.round(v/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function l(A,c,f,d,p,g,v){for(var y=0;y<c;y++){for(var m=0;m<f;m++)d[m]=A[m*c+y];for(u(d,p,g,v,f),m=0;m<f;m++)A[m*c+y]=p[m]}for(m=0;m<f;m++){for(y=0;y<c;y++)d[y]=A[m*c+y];for(u(d,p,g,v,c),y=0;y<c;y++)A[m*c+y]=Math.sqrt(p[y])}}function u(A,c,f,d,p){f[0]=0,d[0]=-a,d[1]=+a;for(var g=1,v=0;g<p;g++){for(var y=(A[g]+g*g-(A[f[v]]+f[v]*f[v]))/(2*g-2*f[v]);y<=d[v];)v--,y=(A[g]+g*g-(A[f[v]]+f[v]*f[v]))/(2*g-2*f[v]);f[++v]=g,d[v]=y,d[v+1]=+a}for(g=0,v=0;g<p;g++){for(;d[v+1]<g;)v++;c[g]=(g-f[v])*(g-f[v])+A[f[v]]}}s.prototype.draw=function(A){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(A,this.buffer,this.middle);for(var c=this.ctx.getImageData(0,0,this.size,this.size),f=new Uint8ClampedArray(this.size*this.size),d=0;d<this.size*this.size;d++){var p=c.data[4*d+3]/255;this.gridOuter[d]=p===1?0:p===0?a:Math.pow(Math.max(0,.5-p),2),this.gridInner[d]=p===1?a:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(l(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),l(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),d=0;d<this.size*this.size;d++){var g=this.gridOuter[d]-this.gridInner[d];f[d]=Math.max(0,Math.min(255,Math.round(255-255*(g/this.radius+this.cutoff))))}return f}},9874:function(r){function a(s,l,u,A){this.cx=3*s,this.bx=3*(u-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(A-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=A,this.p2x=u,this.p2y=A}r.exports=a,a.prototype.sampleCurveX=function(s){return((this.ax*s+this.bx)*s+this.cx)*s},a.prototype.sampleCurveY=function(s){return((this.ay*s+this.by)*s+this.cy)*s},a.prototype.sampleCurveDerivativeX=function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},a.prototype.solveCurveX=function(s,l){var u,A,c,f,d;for(l===void 0&&(l=1e-6),c=s,d=0;d<8;d++){if(f=this.sampleCurveX(c)-s,Math.abs(f)<l)return c;var p=this.sampleCurveDerivativeX(c);if(Math.abs(p)<1e-6)break;c-=f/p}if((c=s)<(u=0))return u;if(c>(A=1))return A;for(;u<A;){if(f=this.sampleCurveX(c),Math.abs(f-s)<l)return c;s>f?u=c:A=c,c=.5*(A-u)+u}return c},a.prototype.solve=function(s,l){return this.sampleCurveY(this.solveCurveX(s,l))}},8929:function(r,a,s){r.exports.VectorTile=s(4054),r.exports.VectorTileFeature=s(6024),r.exports.VectorTileLayer=s(9701)},4054:function(r,a,s){var l=s(9701);function u(A,c,f){if(A===3){var d=new l(f,f.readVarint()+f.pos);d.length&&(c[d.name]=d)}}r.exports=function(A,c){this.layers=A.readFields(u,{},c)}},6024:function(r,a,s){var l=s(5550);function u(f,d,p,g,v){this.properties={},this.extent=p,this.type=0,this._pbf=f,this._geometry=-1,this._keys=g,this._values=v,f.readFields(A,this,d)}function A(f,d,p){f==1?d.id=p.readVarint():f==2?(function(g,v){for(var y=g.readVarint()+g.pos;g.pos<y;){var m=v._keys[g.readVarint()],b=v._values[g.readVarint()];v.properties[m]=b}})(p,d):f==3?d.type=p.readVarint():f==4&&(d._geometry=p.pos)}function c(f){for(var d,p,g=0,v=0,y=f.length,m=y-1;v<y;m=v++)d=f[v],g+=((p=f[m]).x-d.x)*(d.y+p.y);return g}r.exports=u,u.types=["Unknown","Point","LineString","Polygon"],u.prototype.loadGeometry=function(){var f=this._pbf;f.pos=this._geometry;for(var d,p=f.readVarint()+f.pos,g=1,v=0,y=0,m=0,b=[];f.pos<p;){if(v<=0){var x=f.readVarint();g=7&x,v=x>>3}if(v--,g===1||g===2)y+=f.readSVarint(),m+=f.readSVarint(),g===1&&(d&&b.push(d),d=[]),d.push(new l(y,m));else{if(g!==7)throw new Error("unknown command "+g);d&&d.push(d[0].clone())}}return d&&b.push(d),b},u.prototype.bbox=function(){var f=this._pbf;f.pos=this._geometry;for(var d=f.readVarint()+f.pos,p=1,g=0,v=0,y=0,m=1/0,b=-1/0,x=1/0,E=-1/0;f.pos<d;){if(g<=0){var B=f.readVarint();p=7&B,g=B>>3}if(g--,p===1||p===2)(v+=f.readSVarint())<m&&(m=v),v>b&&(b=v),(y+=f.readSVarint())<x&&(x=y),y>E&&(E=y);else if(p!==7)throw new Error("unknown command "+p)}return[m,x,b,E]},u.prototype.toGeoJSON=function(f,d,p){var g,v,y=this.extent*Math.pow(2,p),m=this.extent*f,b=this.extent*d,x=this.loadGeometry(),E=u.types[this.type];function B(O){for(var M=0;M<O.length;M++){var S=O[M],T=180-360*(S.y+b)/y;O[M]=[360*(S.x+m)/y-180,360/Math.PI*Math.atan(Math.exp(T*Math.PI/180))-90]}}switch(this.type){case 1:var P=[];for(g=0;g<x.length;g++)P[g]=x[g][0];B(x=P);break;case 2:for(g=0;g<x.length;g++)B(x[g]);break;case 3:for(x=(function(O){var M=O.length;if(M<=1)return[O];for(var S,T,w=[],C=0;C<M;C++){var U=c(O[C]);U!==0&&(T===void 0&&(T=U<0),T===U<0?(S&&w.push(S),S=[O[C]]):S.push(O[C]))}return S&&w.push(S),w})(x),g=0;g<x.length;g++)for(v=0;v<x[g].length;v++)B(x[g][v])}x.length===1?x=x[0]:E="Multi"+E;var I={type:"Feature",geometry:{type:E,coordinates:x},properties:this.properties};return"id"in this&&(I.id=this.id),I}},9701:function(r,a,s){var l=s(6024);function u(c,f){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(A,this,f),this.length=this._features.length}function A(c,f,d){c===15?f.version=d.readVarint():c===1?f.name=d.readString():c===5?f.extent=d.readVarint():c===2?f._features.push(d.pos):c===3?f._keys.push(d.readString()):c===4&&f._values.push((function(p){for(var g=null,v=p.readVarint()+p.pos;p.pos<v;){var y=p.readVarint()>>3;g=y===1?p.readString():y===2?p.readFloat():y===3?p.readDouble():y===4?p.readVarint64():y===5?p.readVarint():y===6?p.readSVarint():y===7?p.readBoolean():null}return g})(d))}r.exports=u,u.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var f=this._pbf.readVarint()+this._pbf.pos;return new l(this._pbf,f,this.extent,this._keys,this._values)}},8583:function(r,a,s){var l=s(7418);function u(w,C){if(w===C)return 0;for(var U=w.length,F=C.length,D=0,R=Math.min(U,F);D<R;++D)if(w[D]!==C[D]){U=w[D],F=C[D];break}return U<F?-1:F<U?1:0}function A(w){return s.g.Buffer&&typeof s.g.Buffer.isBuffer=="function"?s.g.Buffer.isBuffer(w):!(w==null||!w._isBuffer)}var c=s(69),f=Object.prototype.hasOwnProperty,d=Array.prototype.slice,p=(function(){}).name==="foo";function g(w){return Object.prototype.toString.call(w)}function v(w){return!A(w)&&typeof s.g.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(w):!!w&&(w instanceof DataView||!!(w.buffer&&w.buffer instanceof ArrayBuffer)))}var y=r.exports=P,m=/\s*function\s+([^\(\s]*)\s*/;function b(w){if(c.isFunction(w)){if(p)return w.name;var C=w.toString().match(m);return C&&C[1]}}function x(w,C){return typeof w=="string"?w.length<C?w:w.slice(0,C):w}function E(w){if(p||!c.isFunction(w))return c.inspect(w);var C=b(w);return"[Function"+(C?": "+C:"")+"]"}function B(w,C,U,F,D){throw new y.AssertionError({message:U,actual:w,expected:C,operator:F,stackStartFunction:D})}function P(w,C){w||B(w,!0,C,"==",y.ok)}function I(w,C,U,F){if(w===C)return!0;if(A(w)&&A(C))return u(w,C)===0;if(c.isDate(w)&&c.isDate(C))return w.getTime()===C.getTime();if(c.isRegExp(w)&&c.isRegExp(C))return w.source===C.source&&w.global===C.global&&w.multiline===C.multiline&&w.lastIndex===C.lastIndex&&w.ignoreCase===C.ignoreCase;if(w!==null&&typeof w=="object"||C!==null&&typeof C=="object"){if(v(w)&&v(C)&&g(w)===g(C)&&!(w instanceof Float32Array||w instanceof Float64Array))return u(new Uint8Array(w.buffer),new Uint8Array(C.buffer))===0;if(A(w)!==A(C))return!1;var D=(F=F||{actual:[],expected:[]}).actual.indexOf(w);return D!==-1&&D===F.expected.indexOf(C)||(F.actual.push(w),F.expected.push(C),(function(R,L,k,Q){if(R==null||L==null)return!1;if(c.isPrimitive(R)||c.isPrimitive(L))return R===L;if(k&&Object.getPrototypeOf(R)!==Object.getPrototypeOf(L))return!1;var V=O(R),G=O(L);if(V&&!G||!V&&G)return!1;if(V)return I(R=d.call(R),L=d.call(L),k);var $,Y,ie=T(R),re=T(L);if(ie.length!==re.length)return!1;for(ie.sort(),re.sort(),Y=ie.length-1;Y>=0;Y--)if(ie[Y]!==re[Y])return!1;for(Y=ie.length-1;Y>=0;Y--)if(!I(R[$=ie[Y]],L[$],k,Q))return!1;return!0})(w,C,U,F))}return U?w===C:w==C}function O(w){return Object.prototype.toString.call(w)=="[object Arguments]"}function M(w,C){if(!w||!C)return!1;if(Object.prototype.toString.call(C)=="[object RegExp]")return C.test(w);try{if(w instanceof C)return!0}catch{}return!Error.isPrototypeOf(C)&&C.call({},w)===!0}function S(w,C,U,F){var D;if(typeof C!="function")throw new TypeError('"block" argument must be a function');typeof U=="string"&&(F=U,U=null),D=(function(k){var Q;try{k()}catch(V){Q=V}return Q})(C),F=(U&&U.name?" ("+U.name+").":".")+(F?" "+F:"."),w&&!D&&B(D,U,"Missing expected exception"+F);var R=typeof F=="string",L=!w&&D&&!U;if((!w&&c.isError(D)&&R&&M(D,U)||L)&&B(D,U,"Got unwanted exception"+F),w&&D&&U&&!M(D,U)||!w&&D)throw D}y.AssertionError=function(w){this.name="AssertionError",this.actual=w.actual,this.expected=w.expected,this.operator=w.operator,w.message?(this.message=w.message,this.generatedMessage=!1):(this.message=(function(k){return x(E(k.actual),128)+" "+k.operator+" "+x(E(k.expected),128)})(this),this.generatedMessage=!0);var C=w.stackStartFunction||B;if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var U=new Error;if(U.stack){var F=U.stack,D=b(C),R=F.indexOf(`
387
387
  `+D);if(R>=0){var L=F.indexOf(`
388
388
  `,R+1);F=F.substring(L+1)}this.stack=F}}},c.inherits(y.AssertionError,Error),y.fail=B,y.ok=P,y.equal=function(w,C,U){w!=C&&B(w,C,U,"==",y.equal)},y.notEqual=function(w,C,U){w==C&&B(w,C,U,"!=",y.notEqual)},y.deepEqual=function(w,C,U){I(w,C,!1)||B(w,C,U,"deepEqual",y.deepEqual)},y.deepStrictEqual=function(w,C,U){I(w,C,!0)||B(w,C,U,"deepStrictEqual",y.deepStrictEqual)},y.notDeepEqual=function(w,C,U){I(w,C,!1)&&B(w,C,U,"notDeepEqual",y.notDeepEqual)},y.notDeepStrictEqual=function w(C,U,F){I(C,U,!0)&&B(C,U,F,"notDeepStrictEqual",w)},y.strictEqual=function(w,C,U){w!==C&&B(w,C,U,"===",y.strictEqual)},y.notStrictEqual=function(w,C,U){w===C&&B(w,C,U,"!==",y.notStrictEqual)},y.throws=function(w,C,U){S(!0,w,C,U)},y.doesNotThrow=function(w,C,U){S(!1,w,C,U)},y.ifError=function(w){if(w)throw w},y.strict=l((function w(C,U){C||B(C,!0,U,"==",w)}),y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict;var T=Object.keys||function(w){var C=[];for(var U in w)f.call(w,U)&&C.push(U);return C}},6076:function(r){typeof Object.create=="function"?r.exports=function(a,s){a.super_=s,a.prototype=Object.create(s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:r.exports=function(a,s){a.super_=s;var l=function(){};l.prototype=s.prototype,a.prototype=new l,a.prototype.constructor=a}},2014:function(r){r.exports=function(a){return a&&typeof a=="object"&&typeof a.copy=="function"&&typeof a.fill=="function"&&typeof a.readUInt8=="function"}},69:function(r,a,s){var l=/%[sdj%]/g;a.format=function(D){if(!E(D)){for(var R=[],L=0;L<arguments.length;L++)R.push(c(arguments[L]));return R.join(" ")}L=1;for(var k=arguments,Q=k.length,V=String(D).replace(l,(function($){if($==="%%")return"%";if(L>=Q)return $;switch($){case"%s":return String(k[L++]);case"%d":return Number(k[L++]);case"%j":try{return JSON.stringify(k[L++])}catch{return"[Circular]"}default:return $}})),G=k[L];L<Q;G=k[++L])b(G)||!I(G)?V+=" "+G:V+=" "+c(G);return V},a.deprecate=function(D,R){if(B(s.g.process))return function(){return a.deprecate(D,R).apply(this,arguments)};if(process.noDeprecation===!0)return D;var L=!1;return function(){if(!L){if(process.throwDeprecation)throw new Error(R);process.traceDeprecation?console.trace(R):console.error(R),L=!0}return D.apply(this,arguments)}};var u,A={};function c(D,R){var L={seen:[],stylize:d};return arguments.length>=3&&(L.depth=arguments[2]),arguments.length>=4&&(L.colors=arguments[3]),m(R)?L.showHidden=R:R&&a._extend(L,R),B(L.showHidden)&&(L.showHidden=!1),B(L.depth)&&(L.depth=2),B(L.colors)&&(L.colors=!1),B(L.customInspect)&&(L.customInspect=!0),L.colors&&(L.stylize=f),p(L,D,L.depth)}function f(D,R){var L=c.styles[R];return L?"\x1B["+c.colors[L][0]+"m"+D+"\x1B["+c.colors[L][1]+"m":D}function d(D,R){return D}function p(D,R,L){if(D.customInspect&&R&&S(R.inspect)&&R.inspect!==a.inspect&&(!R.constructor||R.constructor.prototype!==R)){var k=R.inspect(L,D);return E(k)||(k=p(D,k,L)),k}var Q=(function(ue,te){if(B(te))return ue.stylize("undefined","undefined");if(E(te)){var ce="'"+JSON.stringify(te).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ue.stylize(ce,"string")}return x(te)?ue.stylize(""+te,"number"):m(te)?ue.stylize(""+te,"boolean"):b(te)?ue.stylize("null","null"):void 0})(D,R);if(Q)return Q;var V=Object.keys(R),G=(function(ue){var te={};return ue.forEach((function(ce,X){te[ce]=!0})),te})(V);if(D.showHidden&&(V=Object.getOwnPropertyNames(R)),M(R)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return g(R);if(V.length===0){if(S(R)){var $=R.name?": "+R.name:"";return D.stylize("[Function"+$+"]","special")}if(P(R))return D.stylize(RegExp.prototype.toString.call(R),"regexp");if(O(R))return D.stylize(Date.prototype.toString.call(R),"date");if(M(R))return g(R)}var Y,ie="",re=!1,le=["{","}"];return y(R)&&(re=!0,le=["[","]"]),S(R)&&(ie=" [Function"+(R.name?": "+R.name:"")+"]"),P(R)&&(ie=" "+RegExp.prototype.toString.call(R)),O(R)&&(ie=" "+Date.prototype.toUTCString.call(R)),M(R)&&(ie=" "+g(R)),V.length!==0||re&&R.length!=0?L<0?P(R)?D.stylize(RegExp.prototype.toString.call(R),"regexp"):D.stylize("[Object]","special"):(D.seen.push(R),Y=re?(function(ue,te,ce,X,q){for(var H=[],Z=0,K=te.length;Z<K;++Z)F(te,String(Z))?H.push(v(ue,te,ce,X,String(Z),!0)):H.push("");return q.forEach((function(j){j.match(/^\d+$/)||H.push(v(ue,te,ce,X,j,!0))})),H})(D,R,L,G,V):V.map((function(ue){return v(D,R,L,G,ue,re)})),D.seen.pop(),(function(ue,te,ce){return ue.reduce((function(X,q){return q.indexOf(`
389
389
  `),X+q.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?ce[0]+(te===""?"":te+`
@@ -3705,7 +3705,7 @@ function (result, this, instanceIndex, frameState) {
3705
3705
  result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
3706
3706
  return result;
3707
3707
  }\`\`\`
3708
- `,to=class to extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_player");z(this,"_finalImageUrlReact",this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));z(this,"_routePaths",this.disposeVar(h.react(void 0)));z(this,"routePathCallback");z(this,"_id",this.disposeVar(h.react(h.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new h.Player);{const d=to.defaults;this.dispose(h.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(h.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(h.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(h.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(h.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=QL(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(h.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=$f(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new cs),u=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=Q0(a.scene.context).getTextureHandler(s.value);if(p instanceof cs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,c=()=>u.restart();c(),this.dispose(s.changed.disposableOn(c));const f=this.ad(h.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new h.ObjResettingWithEvent(f,()=>this.routePaths?new nz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};z(to,"whiteGradientImageBase64",iz),z(to,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),z(to,"routePathCallbackStrMd",rz),z(to,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(to,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let $i=to;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:h.reactPositionsSet(void 0),data:h.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})($i||($i={})),h.extendClassProps($i.prototype,$i.createDefaultProps);class Yi extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_collection");this._collection=this.disposeVar(new $i(e,i)),this.dispose(h.track([this._collection,"show"],[this,"show"])),this.dispose(h.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(h.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(h.track([this._collection,"color"],[this,"color"])),this.dispose(h.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(h.track([this._collection,"width"],[this,"width"])),this.dispose(h.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(h.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(h.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(h.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(h.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(h.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(h.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(h.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(h.bind([this._collection,"playing"],[this,"playing"])),this.dispose(h.track([this._collection,"loop"],[this,"loop"])),this.dispose(h.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(h.bind([this._collection,"duration"],[this,"duration"])),this.dispose(h.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((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.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}}z(Yi,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(Yi,"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:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:h.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yi||(Yi={})),h.extendClassProps(Yi.prototype,Yi.createDefaultProps);const pc=class pc extends Jt{constructor(e,i){super(e,i);z(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(h.bind([r,"positions"],[e,"points"])),this.dispose(h.track([r,"width"],[e,"strokeWidth"])),this.dispose(h.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(h.track([r,"startTime"],[e,"startTime"])),this.dispose(h.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(h.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(h.track([r,"arcType"],[e,"arcType"])),this.dispose(h.track([r,"brightening"],[e,"brightening"])),this.dispose(h.track([r,"depthTest"],[e,"depthTest"])),this.dispose(h.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(h.track([r,"repeat"],[e,"repeat"])),this.dispose(h.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(h.track([r,"loop"],[e,"loop"])),this.dispose(h.track([r,"currentTime"],[e,"currentTime"])),this.dispose(h.track([r,"duration"],[e,"duration"])),this.dispose(h.track([r,"playing"],[e,"playing"])),this.dispose(h.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(pc,"type",pc.register("ESCesiumViewer",qA.type,pc));let Eg=pc;function Ho(t){var n=[1/0,1/0,-1/0,-1/0];return tf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ho.default=Ho;const Ji=11102230246251565e-32,en=134217729,oz=(3+8*Ji)*Ji;function Pg(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],c=0,f=0;A>u==A>-u?(r=u,u=n[++c]):(r=A,A=i[++f]);let d=0;if(c<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++c]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);c<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;c<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function sz(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function zl(t){return new Float64Array(t)}const az=(3+16*Ji)*Ji,lz=(2+12*Ji)*Ji,uz=(9+64*Ji)*Ji*Ji,ha=zl(4),y_=zl(8),v_=zl(12),w_=zl(16),on=zl(4);function cz(t,n,e,i,o,r,a){let s,l,u,A,c,f,d,p,g,v,y,m,b,x,E,B,P,I;const O=t-o,M=e-o,S=n-r,T=i-r;x=O*T,f=en*O,d=f-(f-O),p=O-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*M,f=en*S,d=f-(f-S),p=S-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,ha[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,ha[1]=b-(y+c)+(c-B),I=m+y,c=I-m,ha[2]=m-(I-c)+(y-c),ha[3]=I;let w=sz(4,ha),C=lz*a;if(w>=C||-w>=C||(c=t-O,s=t-(O+c)+(c-o),c=e-M,u=e-(M+c)+(c-o),c=n-S,l=n-(S+c)+(c-r),c=i-T,A=i-(T+c)+(c-r),s===0&&l===0&&u===0&&A===0)||(C=uz*a+oz*Math.abs(w),w+=O*A+T*s-(S*u+M*l),w>=C||-w>=C))return w;x=s*T,f=en*s,d=f-(f-s),p=s-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*M,f=en*l,d=f-(f-l),p=l-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const U=Pg(4,ha,4,on,y_);x=O*A,f=en*O,d=f-(f-O),p=O-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=en*S,d=f-(f-S),p=S-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const F=Pg(U,y_,4,on,v_);x=s*A,f=en*s,d=f-(f-s),p=s-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=en*l,d=f-(f-l),p=l-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const D=Pg(F,v_,4,on,w_);return w_[D-1]}function kl(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=az*u?l:-cz(t,n,e,i,o,r,u)}function sn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=ef(t),o=Pi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&hz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(b_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,c=1;c<s[u].length&&!A;)b_(i,s[u][c],!e.ignoreBoundary)&&(A=!0),c++;A||(l=!0)}return l}function b_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var c=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;c&&(i=!i)}return i}function hz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function Az(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return x_(t);case"FeatureCollection":return fz(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bg(t);default:throw new Error("unknown GeoJSON type")}}function x_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=__(t.properties),n.geometry=Bg(t.geometry),n}function __(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=__(i):n[e]=i}),n}function fz(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return x_(e)}),n}function Bg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Bg(e)}),n):(n.coordinates=C_(t.coordinates),n)}function C_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return C_(e)})}function S_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=ML(t),o=[];switch(i){case"LineString":o=Tg(t);break;case"MultiLineString":case"Polygon":Ei(t).forEach(function(a){o.push(Tg(a))});break;case"MultiPolygon":Ei(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(Tg(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ei(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Tg(t){var n=Ei(t);if(n.length===2&&!E_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,E_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function E_(t,n){return t[0]===n[0]&&t[1]===n[1]}function P_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,c=s-r,f=l-a,d=u*f-A*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function pz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return tf(t,function(r){e+=r[0],i+=r[1],o++},!0),Gr([e/o,i/o],n.properties)}function B_(t){if(!t)throw new Error("geojson is required");var n=[];return sa(t,function(e){dz(e,n)}),Si(n)}function dz(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ei(i);break;case"LineString":e=[Ei(i)]}e.forEach(function(o){var r=mz(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function mz(t,n){var e=[];return t.reduce(function(i,o){var r=YA([i,o],n);return r.bbox=gz(i,o),e.push(r),o}),e}function gz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var of={exports:{}},sf={exports:{}},yz=sf.exports,T_;function vz(){return T_||(T_=1,(function(t,n){(function(e,i){t.exports=i()})(yz,function(){function e(m,b,x,E,B){(function P(I,O,M,S,T){for(;S>M;){if(S-M>600){var w=S-M+1,C=O-M+1,U=Math.log(w),F=.5*Math.exp(2*U/3),D=.5*Math.sqrt(U*F*(w-F)/w)*(C-w/2<0?-1:1),R=Math.max(M,Math.floor(O-C*F/w+D)),L=Math.min(S,Math.floor(O+(w-C)*F/w+D));P(I,O,R,L,T)}var k=I[O],Q=M,V=S;for(i(I,M,O),T(I[S],k)>0&&i(I,M,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[M],k)===0?i(I,M,V):i(I,++V,S),V<=O&&(M=V+1),O<=V&&(S=V-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function c(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],O=b.leaf?E(I):I;g(m,O)&&(b.leaf?x.push(I):p(m,O)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.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 E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),O=[],M=[];P||O.length;){if(P||(P=O.pop(),E=O[O.length-1],x=M.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),O.push(P),this._condense(O),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(O.push(P),M.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var O=Math.ceil(P/I),M=O*Math.ceil(Math.sqrt(I));y(m,b,x,M,this.compareMinX);for(var S=b;S<=x;S+=M){var T=Math.min(S+M-1,x);y(m,S,T,O,this.compareMinY);for(var w=S;w<=T;w+=O){var C=Math.min(w+O-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,O=0;O<b.children.length;O++){var M=b.children[O],S=f(M),T=(w=m,C=M,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=M):T===P&&S<B&&(B=S,I=M)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,O,M,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var U=l(m,0,C,this.toBBox),F=l(m,C,x,this.toBBox),D=(B=U,P=F,I=void 0,O=void 0,M=void 0,S=void 0,I=Math.max(B.minX,P.minX),O=Math.max(B.minY,P.minY),M=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,M-I)*Math.max(0,S-O)),R=f(U)+f(F);D<T?(T=D,E=C,w=R<w?R:w):D===T&&R<w&&(w=R,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:c;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),O=d(P)+d(I),M=b;M<x-b;M++){var S=m.children[M];u(P,m.leaf?B(S):S),O+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),O+=d(I)}return O},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(sf)),sf.exports}var Ig={},I_;function F_(){return I_||(I_=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:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,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 n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return c(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,U=S;C<U.length;C++){var F=U[C];if(F.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var D=0;D<F[F.length-1].length;D++)if(F[F.length-1][D]!==F[0][D])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function c(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=c;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var U=t.areaFactors[w];if(!U)throw new Error("invalid final units");return S/C*U}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function O(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=O;function M(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=M})(Ig)),Ig}var Tt={},M_;function D_(){if(M_)return Tt;M_=1,Object.defineProperty(Tt,"__esModule",{value:!0});var t=F_();function n(m,b,x){if(m!==null)for(var E,B,P,I,O,M,S,T=0,w=0,C,U=m.type,F=U==="FeatureCollection",D=U==="Feature",R=F?m.features.length:1,L=0;L<R;L++){S=F?m.features[L].geometry:D?m.geometry:m,C=S?S.type==="GeometryCollection":!1,O=C?S.geometries.length:1;for(var k=0;k<O;k++){var Q=0,V=0;if(I=C?S.geometries[k]:S,I!==null){M=I.coordinates;var G=I.type;switch(T=x&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(b(M,w,L,Q,V)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(E=0;E<M.length;E++){if(b(M[E],w,L,Q,V)===!1)return!1;w++,G==="MultiPoint"&&Q++}G==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(E=0;E<M.length;E++){for(B=0;B<M[E].length-T;B++){if(b(M[E][B],w,L,Q,V)===!1)return!1;w++}G==="MultiLineString"&&Q++,G==="Polygon"&&V++}G==="Polygon"&&Q++;break;case"MultiPolygon":for(E=0;E<M.length;E++){for(V=0,B=0;B<M[E].length;B++){for(P=0;P<M[E][B].length-T;P++){if(b(M[E][B][P],w,L,Q,V)===!1)return!1;w++}V++}Q++}break;case"GeometryCollection":for(E=0;E<I.geometries.length;E++)if(n(I.geometries[E],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,b,x,E){var B=x;return n(m,function(P,I,O,M,S){I===0&&x===void 0?B=P:B=b(B,P,I,O,M,S)},E),B}function i(m,b){var x;switch(m.type){case"FeatureCollection":for(x=0;x<m.features.length&&b(m.features[x].properties,x)!==!1;x++);break;case"Feature":b(m.properties,0);break}}function o(m,b,x){var E=x;return i(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function r(m,b){if(m.type==="Feature")b(m,0);else if(m.type==="FeatureCollection")for(var x=0;x<m.features.length&&b(m.features[x],x)!==!1;x++);}function a(m,b,x){var E=x;return r(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function s(m){var b=[];return n(m,function(x){b.push(x)}),b}function l(m,b){var x,E,B,P,I,O,M,S,T,w,C=0,U=m.type==="FeatureCollection",F=m.type==="Feature",D=U?m.features.length:1;for(x=0;x<D;x++){for(O=U?m.features[x].geometry:F?m.geometry:m,S=U?m.features[x].properties:F?m.properties:{},T=U?m.features[x].bbox:F?m.bbox:void 0,w=U?m.features[x].id:F?m.id:void 0,M=O?O.type==="GeometryCollection":!1,I=M?O.geometries.length:1,B=0;B<I;B++){if(P=M?O.geometries[B]:O,P===null){if(b(null,C,S,T,w)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(P,C,S,T,w)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(b(P.geometries[E],C,S,T,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function u(m,b,x){var E=x;return l(m,function(B,P,I,O,M){P===0&&x===void 0?E=B:E=b(E,B,P,I,O,M)}),E}function A(m,b){l(m,function(x,E,B,P,I){var O=x===null?null:x.type;switch(O){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,B,{bbox:P,id:I}),E,0)===!1?!1:void 0}var M;switch(O){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var S=0;S<x.coordinates.length;S++){var T=x.coordinates[S],w={type:M,coordinates:T};if(b(t.feature(w,B),E,S)===!1)return!1}})}function c(m,b,x){var E=x;return A(m,function(B,P,I){P===0&&I===0&&x===void 0?E=B:E=b(E,B,P,I)}),E}function f(m,b){A(m,function(x,E,B){var P=0;if(x.geometry){var I=x.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var O,M=0,S=0,T=0;if(n(x,function(w,C,U,F,D){if(O===void 0||E>M||F>S||D>T){O=w,M=E,S=F,T=D,P=0;return}var R=t.lineString([O,w],x.properties);if(b(R,E,B,D,P)===!1)return!1;P++,O=w})===!1)return!1}}})}function d(m,b,x){var E=x,B=!1;return f(m,function(P,I,O,M,S){B===!1&&x===void 0?E=P:E=b(E,P,I,O,M,S),B=!0}),E}function p(m,b){if(!m)throw new Error("geojson is required");A(m,function(x,E,B){if(x.geometry!==null){var P=x.geometry.type,I=x.geometry.coordinates;switch(P){case"LineString":if(b(x,E,B,0,0)===!1)return!1;break;case"Polygon":for(var O=0;O<I.length;O++)if(b(t.lineString(I[O],x.properties),E,B,O)===!1)return!1;break}}})}function g(m,b,x){var E=x;return p(m,function(B,P,I,O){P===0&&x===void 0?E=B:E=b(E,B,P,I,O)}),E}function v(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.segmentIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=M.length+P-1),t.lineString([M[P],M[P+1]],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P-1),t.lineString([M[B][P],M[B][P+1]],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P-1),t.lineString([M[E][P],M[E][P+1]],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P-1),t.lineString([M[E][B][P],M[E][B][P+1]],I,b)}throw new Error("geojson is invalid")}function y(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.coordIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":return t.point(M,I,b);case"MultiPoint":return E<0&&(E=M.length+E),t.point(M[E],I,b);case"LineString":return P<0&&(P=M.length+P),t.point(M[P],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P),t.point(M[B][P],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P),t.point(M[E][P],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P),t.point(M[E][B][P],I,b)}throw new Error("geojson is invalid")}return Tt.coordAll=s,Tt.coordEach=n,Tt.coordReduce=e,Tt.featureEach=r,Tt.featureReduce=a,Tt.findPoint=y,Tt.findSegment=v,Tt.flattenEach=A,Tt.flattenReduce=c,Tt.geomEach=l,Tt.geomReduce=u,Tt.lineEach=p,Tt.lineReduce=g,Tt.propEach=i,Tt.propReduce=o,Tt.segmentEach=f,Tt.segmentReduce=d,Tt}var af={},R_;function wz(){if(R_)return af;R_=1,Object.defineProperty(af,"__esModule",{value:!0});var t=D_();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,af.default=n,af}var U_;function bz(){if(U_)return of.exports;U_=1;var t=vz(),n=F_(),e=D_(),i=wz().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function a(s){var l=new t(s);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.insert.call(this,u)},l.load=function(u){var A=[];return Array.isArray(u)?u.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}):o(u,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}),t.prototype.load.call(this,A)},l.remove=function(u,A){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.remove.call(this,u,A)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(u){var A=t.prototype.search.call(this,this.toBBox(u));return r(A)},l.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=t.prototype.all.call(this);return r(u)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var A;if(u.bbox)A=u.bbox;else if(Array.isArray(u)&&u.length===4)A=u;else if(Array.isArray(u)&&u.length===6)A=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")A=i(u);else if(u.type==="FeatureCollection")A=i(u);else throw new Error("invalid geojson");return{minX:A[0],minY:A[1],maxX:A[2],maxY:A[3]}},l}return of.exports=a,of.exports.default=a,of.exports}var xz=bz();const _z=Al(xz);function Fg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=O_(t,n);return o&&i.push(o),Si(i)}var r=_z();return r.load(B_(n)),nf(B_(t),function(a){nf(r.search(a),function(s){var l=O_(a,s);if(l){var u=Ei(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Si(i)}function O_(t,n){var e=Ei(t),i=Ei(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],c=i[1][1],f=(c-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(c-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Gr([y,m])}return null}function lf(t,n,e){e===void 0&&(e={});for(var i=ef(t),o=Ei(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Cz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Cz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],c=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=c*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Sz(t,n){var e=Pi(t),i=Pi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Ez(e,i);case"LineString":return lf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return sn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Pz(e,i);case"LineString":return Bz(e,i);case"Polygon":case"MultiPolygon":return Tz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Iz(e,i);case"Polygon":case"MultiPolygon":return Fz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Mz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Ez(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(z_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Pz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)z_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Bz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!lf(t.coordinates[i],n))return!1;e||(e=lf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function Tz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=sn(t.coordinates[1],n),!i){e=!1;break}i=sn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Iz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!lf(t.coordinates[e],n))return!1;return!0}function Fz(t,n){var e=Ho(n),i=Ho(t);if(!L_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!sn(t.coordinates[r],n))return!1;if(o||(o=sn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Dz(t.coordinates[r],t.coordinates[r+1]);o=sn(a,n,{ignoreBoundary:!0})}}return o}function Mz(t,n){var e=Ho(t),i=Ho(n);if(!L_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!sn(t.coordinates[0][o],n))return!1;return!0}function L_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function z_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Dz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function k_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Bi([o,r],[a,r],e),u=l*(a-o),A=n/Bi([o,r],[o,s],e),c=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/c),v=(f-p*u)/2,y=(d-g*c)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Gr([m,b],e.properties);e.mask?Sz(x,e.mask)&&i.push(x):i.push(x),b+=c}m+=u}return Si(i)}function Mg(t,n){n===void 0&&(n={});var e=Pi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Rz(e,n);case"MultiPolygon":return Uz(e,n);default:throw new Error("invalid poly")}}function Rz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return Q_(i,o)}function Uz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(Q_(a,o))}),Si(r)}function Q_(t,n){return t.length>1?BL(t,n):YA(t[0],n)}var Dg,V_;function N_(){if(V_)return Dg;V_=1;var t=Object.prototype.toString;return Dg=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Dg}var Rg,H_;function Oz(){if(H_)return Rg;H_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=N_(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.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},A=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1})(),c=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=c(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return Rg=t,Rg}var Ug,G_;function W_(){if(G_)return Ug;G_=1;var t=Array.prototype.slice,n=N_(),e=Object.keys,i=e?function(a){return e(a)}:Oz(),o=Object.keys;return i.shim=function(){if(Object.keys){var a=(function(){var s=Object.keys(arguments);return s&&s.length===arguments.length})(1,2);a||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Ug=i,Ug}var Og,j_;function q_(){return j_||(j_=1,Og=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0}),Og}var Lg,K_;function zg(){if(K_)return Lg;K_=1;var t=q_();return Lg=function(){return t()&&!!Symbol.toStringTag},Lg}var kg,Z_;function X_(){return Z_||(Z_=1,kg=Object),kg}var Qg,$_;function Y_(){return $_||($_=1,Qg=Error),Qg}var Vg,J_;function Lz(){return J_||(J_=1,Vg=EvalError),Vg}var Ng,eC;function zz(){return eC||(eC=1,Ng=RangeError),Ng}var Hg,tC;function kz(){return tC||(tC=1,Hg=ReferenceError),Hg}var Gg,nC;function iC(){return nC||(nC=1,Gg=SyntaxError),Gg}var Wg,rC;function Aa(){return rC||(rC=1,Wg=TypeError),Wg}var jg,oC;function Qz(){return oC||(oC=1,jg=URIError),jg}var qg,sC;function Vz(){return sC||(sC=1,qg=Math.abs),qg}var Kg,aC;function Nz(){return aC||(aC=1,Kg=Math.floor),Kg}var Zg,lC;function Hz(){return lC||(lC=1,Zg=Math.max),Zg}var Xg,uC;function Gz(){return uC||(uC=1,Xg=Math.min),Xg}var $g,cC;function Wz(){return cC||(cC=1,$g=Math.pow),$g}var Yg,hC;function jz(){return hC||(hC=1,Yg=Math.round),Yg}var Jg,AC;function qz(){return AC||(AC=1,Jg=Number.isNaN||function(n){return n!==n}),Jg}var ey,fC;function Kz(){if(fC)return ey;fC=1;var t=qz();return ey=function(e){return t(e)||e===0?e:e<0?-1:1},ey}var ty,pC;function Zz(){return pC||(pC=1,ty=Object.getOwnPropertyDescriptor),ty}var ny,dC;function fa(){if(dC)return ny;dC=1;var t=Zz();if(t)try{t([],"length")}catch{t=null}return ny=t,ny}var iy,mC;function uf(){if(mC)return iy;mC=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return iy=t,iy}var ry,gC;function Xz(){if(gC)return ry;gC=1;var t=typeof Symbol<"u"&&Symbol,n=q_();return ry=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},ry}var oy,yC;function vC(){return yC||(yC=1,oy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),oy}var sy,wC;function bC(){if(wC)return sy;wC=1;var t=X_();return sy=t.getPrototypeOf||null,sy}var ay,xC;function $z(){if(xC)return ay;xC=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,u){for(var A=[],c=0;c<l.length;c+=1)A[c]=l[c];for(var f=0;f<u.length;f+=1)A[f+l.length]=u[f];return A},r=function(l,u){for(var A=[],c=u,f=0;c<l.length;c+=1,f+=1)A[f]=l[c];return A},a=function(s,l){for(var u="",A=0;A<s.length;A+=1)u+=s[A],A+1<s.length&&(u+=l);return u};return ay=function(l){var u=this;if(typeof u!="function"||n.apply(u)!==i)throw new TypeError(t+u);for(var A=r(arguments,1),c,f=function(){if(this instanceof c){var y=u.apply(this,o(A,arguments));return Object(y)===y?y:this}return u.apply(l,o(A,arguments))},d=e(0,u.length-A.length),p=[],g=0;g<d;g++)p[g]="$"+g;if(c=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var v=function(){};v.prototype=u.prototype,c.prototype=new v,v.prototype=null}return c},ay}var ly,_C;function Ql(){if(_C)return ly;_C=1;var t=$z();return ly=Function.prototype.bind||t,ly}var uy,CC;function cy(){return CC||(CC=1,uy=Function.prototype.call),uy}var hy,SC;function Ay(){return SC||(SC=1,hy=Function.prototype.apply),hy}var fy,EC;function Yz(){return EC||(EC=1,fy=typeof Reflect<"u"&&Reflect&&Reflect.apply),fy}var py,PC;function BC(){if(PC)return py;PC=1;var t=Ql(),n=Ay(),e=cy(),i=Yz();return py=i||t.call(e,n),py}var dy,TC;function my(){if(TC)return dy;TC=1;var t=Ql(),n=Aa(),e=cy(),i=BC();return dy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},dy}var gy,IC;function Jz(){if(IC)return gy;IC=1;var t=my(),n=fa(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return gy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(s){return r(s==null?s:o(s))}:!1,gy}var yy,FC;function MC(){if(FC)return yy;FC=1;var t=vC(),n=bC(),e=Jz();return yy=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,yy}var vy,DC;function RC(){if(DC)return vy;DC=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=Ql();return vy=e.call(t,n),vy}var wy,UC;function OC(){if(UC)return wy;UC=1;var t,n=X_(),e=Y_(),i=Lz(),o=zz(),r=kz(),a=iC(),s=Aa(),l=Qz(),u=Vz(),A=Nz(),c=Hz(),f=Gz(),d=Wz(),p=jz(),g=Kz(),v=Function,y=function(ue){try{return v('"use strict"; return ('+ue+").constructor;")()}catch{}},m=fa(),b=uf(),x=function(){throw new s},E=m?(function(){try{return arguments.callee,x}catch{try{return m(arguments,"callee").get}catch{return x}}})():x,B=Xz()(),P=MC(),I=bC(),O=vC(),M=Ay(),S=cy(),T={},w=typeof Uint8Array>"u"||!P?t:P(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":B&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%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%":i,"%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%":v,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":B&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!B||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!B||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":B&&P?P(""[Symbol.iterator]()):t,"%Symbol%":B?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":w,"%TypeError%":s,"%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%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":M,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":A,"%Math.max%":c,"%Math.min%":f,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(P)try{null.error}catch(ue){var U=P(P(ue));C["%Error.prototype%"]=U}var F=function ue(te){var ce;if(te==="%AsyncFunction%")ce=y("async function () {}");else if(te==="%GeneratorFunction%")ce=y("function* () {}");else if(te==="%AsyncGeneratorFunction%")ce=y("async function* () {}");else if(te==="%AsyncGenerator%"){var X=ue("%AsyncGeneratorFunction%");X&&(ce=X.prototype)}else if(te==="%AsyncIteratorPrototype%"){var q=ue("%AsyncGenerator%");q&&P&&(ce=P(q.prototype))}return C[te]=ce,ce},D={__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"]},R=Ql(),L=RC(),k=R.call(S,Array.prototype.concat),Q=R.call(M,Array.prototype.splice),V=R.call(S,String.prototype.replace),G=R.call(S,String.prototype.slice),$=R.call(S,RegExp.prototype.exec),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(te){var ce=G(te,0,1),X=G(te,-1);if(ce==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&ce!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var q=[];return V(te,Y,function(H,Z,K,j){q[q.length]=K?V(j,ie,"$1"):Z||H}),q},le=function(te,ce){var X=te,q;if(L(D,X)&&(q=D[X],X="%"+q[0]+"%"),L(C,X)){var H=C[X];if(H===T&&(H=F(X)),typeof H>"u"&&!ce)throw new s("intrinsic "+te+" exists, but is not available. Please file an issue!");return{alias:q,name:X,value:H}}throw new a("intrinsic "+te+" does not exist!")};return wy=function(te,ce){if(typeof te!="string"||te.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new s('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,te)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=re(te),q=X.length>0?X[0]:"",H=le("%"+q+"%",ce),Z=H.name,K=H.value,j=!1,W=H.alias;W&&(q=W[0],Q(X,k([0,1],W)));for(var J=1,ee=!0;J<X.length;J+=1){var se=X[J],Ae=G(se,0,1),fe=G(se,-1);if((Ae==='"'||Ae==="'"||Ae==="`"||fe==='"'||fe==="'"||fe==="`")&&Ae!==fe)throw new a("property names with quotes must have matching quotes");if((se==="constructor"||!ee)&&(j=!0),q+="."+se,Z="%"+q+"%",L(C,Z))K=C[Z];else if(K!=null){if(!(se in K)){if(!ce)throw new s("base intrinsic for "+te+" exists, but the property is not available.");return}if(m&&J+1>=X.length){var de=m(K,se);ee=!!de,ee&&"get"in de&&!("originalValue"in de.get)?K=de.get:K=K[se]}else ee=L(K,se),K=K[se];ee&&!j&&(C[Z]=K)}}return K},wy}var by,LC;function xy(){if(LC)return by;LC=1;var t=OC(),n=my(),e=n([t("%String.prototype.indexOf%")]);return by=function(o,r){var a=t(o,!!r);return typeof a=="function"&&e(o,".prototype.")>-1?n([a]):a},by}var _y,zC;function ek(){if(zC)return _y;zC=1;var t=zg()(),n=xy(),e=n("Object.prototype.toString"),i=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:e(s)==="[object Arguments]"},o=function(s){return i(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&e(s)!=="[object Array]"&&"callee"in s&&e(s.callee)==="[object Function]"},r=(function(){return i(arguments)})();return i.isLegacyArguments=o,_y=r?i:o,_y}var Cy,kC;function Sy(){if(kC)return Cy;kC=1;var t=uf(),n=iC(),e=Aa(),i=fa();return Cy=function(r,a,s){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="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 l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!i&&i(r,a);if(t)t(r,a,{configurable:A===null&&f?f.configurable:!A,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:u===null&&f?f.writable:!u});else if(c||!l&&!u&&!A)r[a]=s;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Cy}var Ey,QC;function Py(){if(QC)return Ey;QC=1;var t=uf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ey=n,Ey}var By,VC;function Vl(){if(VC)return By;VC=1;var t=W_(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Sy(),r=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=Py()(),s=function(u,A,c,f){if(A in u){if(f===!0){if(u[A]===c)return}else if(!r(f)||!f())return}a?o(u,A,c,!0):o(u,A,c)},l=function(u,A){var c=arguments.length>2?arguments[2]:{},f=t(A);n&&(f=i.call(f,Object.getOwnPropertySymbols(A)));for(var d=0;d<f.length;d+=1)s(u,f[d],A[f[d]],c[f[d]])};return l.supportsDescriptors=!!a,By=l,By}var Ty={exports:{}},Iy,NC;function tk(){if(NC)return Iy;NC=1;var t=OC(),n=Sy(),e=Py()(),i=fa(),o=Aa(),r=t("%Math.floor%");return Iy=function(s,l){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],A=!0,c=!0;if("length"in s&&i){var f=i(s,"length");f&&!f.configurable&&(A=!1),f&&!f.writable&&(c=!1)}return(A||c||!u)&&(e?n(s,"length",l,!0,!0):n(s,"length",l)),s},Iy}var Fy,HC;function nk(){if(HC)return Fy;HC=1;var t=Ql(),n=Ay(),e=BC();return Fy=function(){return e(t,n,arguments)},Fy}var GC;function WC(){return GC||(GC=1,(function(t){var n=tk(),e=uf(),i=my(),o=nk();t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(Ty)),Ty.exports}var My,jC;function qC(){if(jC)return My;jC=1;var t=function(n){return n!==n};return My=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},My}var Dy,KC;function ZC(){if(KC)return Dy;KC=1;var t=qC();return Dy=function(){return typeof Object.is=="function"?Object.is:t},Dy}var Ry,XC;function ik(){if(XC)return Ry;XC=1;var t=ZC(),n=Vl();return Ry=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Ry}var Uy,$C;function rk(){if($C)return Uy;$C=1;var t=Vl(),n=WC(),e=qC(),i=ZC(),o=ik(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Uy=r,Uy}var Oy,YC;function ok(){if(YC)return Oy;YC=1;var t=xy(),n=zg()(),e=RC(),i=fa(),o;if(n){var r=t("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),o=function(f){if(!f||typeof f!="object")return!1;var d=i(f,"lastIndex"),p=d&&e(d,"value");if(!p)return!1;try{r(f,l)}catch(g){return g===a}}}else{var u=t("Object.prototype.toString"),A="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===A}}return Oy=o,Oy}var Ly,JC;function sk(){if(JC)return Ly;JC=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Ly=t,Ly}var zy,eS;function ak(){if(eS)return zy;eS=1;var t=Sy(),n=Py()(),e=sk().functionsHaveConfigurableNames(),i=Aa();return zy=function(r,a){if(typeof r!="function")throw new i("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||e)&&(n?t(r,"name",a,!0,!0):t(r,"name",a)),r},zy}var ky,tS;function nS(){if(tS)return ky;tS=1;var t=ak(),n=Aa(),e=Object;return ky=t(function(){if(this==null||this!==e(this))throw new n("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),ky}var Qy,iS;function rS(){if(iS)return Qy;iS=1;var t=nS(),n=Vl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Qy=function(){if(n&&/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 r="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(a,"sticky",{get:function(){r+="y"}}),o.get.call(a),r==="dy")return o.get}}return t},Qy}var Vy,oS;function lk(){if(oS)return Vy;oS=1;var t=Vl().supportsDescriptors,n=rS(),e=fa(),i=Object.defineProperty,o=Y_(),r=MC(),a=/a/;return Vy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),u=r(a),A=e(u,"flags");return(!A||A.get!==l)&&i(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Vy}var Ny,sS;function uk(){if(sS)return Ny;sS=1;var t=Vl(),n=WC(),e=nS(),i=rS(),o=lk(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Ny=r,Ny}var Hy,aS;function ck(){if(aS)return Hy;aS=1;var t=xy(),n=t("Date.prototype.getDay"),e=function(s){try{return n(s),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=zg()();return Hy=function(s){return typeof s!="object"||s===null?!1:r?e(s):i(s)===o},Hy}var Gy,lS;function hk(){if(lS)return Gy;lS=1;var t=W_(),n=ek(),e=rk(),i=ok(),o=uk(),r=ck(),a=Date.prototype.getTime;function s(c,f,d){var p=d||{};return(p.strict?e(c,f):c===f)?!0:!c||!f||typeof c!="object"&&typeof f!="object"?p.strict?e(c,f):c==f:A(c,f,p)}function l(c){return c==null}function u(c){return!(!c||typeof c!="object"||typeof c.length!="number"||typeof c.copy!="function"||typeof c.slice!="function"||c.length>0&&typeof c[0]!="number")}function A(c,f,d){var p,g;if(typeof c!=typeof f||l(c)||l(f)||c.prototype!==f.prototype||n(c)!==n(f))return!1;var v=i(c),y=i(f);if(v!==y)return!1;if(v||y)return c.source===f.source&&o(c)===o(f);if(r(c)&&r(f))return a.call(c)===a.call(f);var m=u(c),b=u(f);if(m!==b)return!1;if(m||b){if(c.length!==f.length)return!1;for(p=0;p<c.length;p++)if(c[p]!==f[p])return!1;return!0}if(typeof c!=typeof f)return!1;try{var x=t(c),E=t(f)}catch{return!1}if(x.length!==E.length)return!1;for(x.sort(),E.sort(),p=x.length-1;p>=0;p--)if(x[p]!=E[p])return!1;for(p=x.length-1;p>=0;p--)if(g=x[p],!s(c[g],f[g],d))return!1;return!0}return Gy=s,Gy}function Ak(t,n){var e=!0;return sa(t,function(i){sa(n,function(o){if(e===!1)return!1;e=fk(i.geometry,o.geometry)})}),e}function fk(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!gk(t.coordinates,n.coordinates);case"LineString":return!uS(n,t);case"Polygon":return!sn(t,n)}break;case"LineString":switch(n.type){case"Point":return!uS(t,n);case"LineString":return!pk(t,n);case"Polygon":return!cS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!sn(n,t);case"LineString":return!cS(t,n);case"Polygon":return!dk(n,t)}}return!1}function uS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(mk(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function pk(t,n){var e=Fg(t,n);return e.features.length>0}function cS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(sn(o,t))return!0}var r=Fg(n,Mg(t));return r.features.length>0}function dk(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(sn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(sn(s,t))return!0}var l=Fg(Mg(t),Mg(n));return l.features.length>0}function mk(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function gk(t,n){return t[0]===n[0]&&t[1]===n[1]}var Wy,hS;function yk(){if(hS)return Wy;hS=1;var t=hk(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,a){if(r.type!==a.type||!i(r,a))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,a.coordinates);case"LineString":return this.compareLine(r.coordinates,a.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,a);case"Feature":return this.compareFeature(r,a);default:if(r.type.indexOf("Multi")===0){var s=this,l=e(r),u=e(a);return l.every(function(A){return this.some(function(c){return s.compare(A,c)})},u)}}return!1};function e(r){return r.coordinates.map(function(a){return{type:r.type.replace("Multi",""),coordinates:a}})}function i(r,a){return r.hasOwnProperty("coordinates")?r.coordinates.length===a.coordinates.length:r.length===a.length}n.prototype.compareCoord=function(r,a){if(r.length!==a.length)return!1;for(var s=0;s<r.length;s++)if(r[s].toFixed(this.precision)!==a[s].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,a,s,l){if(!i(r,a))return!1;var u=this.pseudoNode?r:this.removePseudo(r),A=this.pseudoNode?a:this.removePseudo(a);if(!(l&&!this.compareCoord(u[0],A[0])&&(A=this.fixStartIndex(A,u),!A))){var c=this.compareCoord(u[s],A[s]);return this.direction||c?this.comparePath(u,A):this.compareCoord(u[s],A[A.length-(1+s)])?this.comparePath(u.slice().reverse(),A):!1}},n.prototype.fixStartIndex=function(r,a){for(var s,l=-1,u=0;u<r.length;u++)if(this.compareCoord(r[u],a[0])){l=u;break}return l>=0&&(s=[].concat(r.slice(l,r.length),r.slice(1,l+1))),s},n.prototype.comparePath=function(r,a){var s=this;return r.every(function(l,u){return s.compareCoord(l,this[u])},a)},n.prototype.comparePolygon=function(r,a){if(this.compareLine(r.coordinates[0],a.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),l=a.coordinates.slice(1,a.coordinates.length),u=this;return s.every(function(A){return this.some(function(c){return u.compareLine(A,c,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,a){return r.id!==a.id||!this.objectComparator(r.properties,a.properties)||!this.compareBBox(r,a)?!1:this.compare(r.geometry,a.geometry)},n.prototype.compareBBox=function(r,a){return!!(!r.bbox&&!a.bbox||r.bbox&&a.bbox&&this.compareCoord(r.bbox,a.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,a){return t(r,a,{strict:!0})}return Wy=n,Wy}var vk=yk();const wk=Al(vk);function bk(t,n){var e=Pi(t).type,i=Pi(n).type;if(e!==i)return!1;var o=new wk({precision:6});return o.compare(S_(t),S_(n))}function xk(t,n){var e=!1;return sa(t,function(i){sa(n,function(o){if(e===!0)return!0;e=!Ak(i.geometry,o.geometry)})}),e}/**
3708
+ `,to=class to extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_player");z(this,"_finalImageUrlReact",this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));z(this,"_routePaths",this.disposeVar(h.react(void 0)));z(this,"routePathCallback");z(this,"_id",this.disposeVar(h.react(h.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new h.Player);{const d=to.defaults;this.dispose(h.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(h.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(h.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(h.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(h.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=QL(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(h.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=$f(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new cs),u=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=Q0(a.scene.context).getTextureHandler(s.value);if(p instanceof cs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,c=()=>u.restart();c(),this.dispose(s.changed.disposableOn(c));const f=this.ad(h.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new h.ObjResettingWithEvent(f,()=>this.routePaths?new nz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};z(to,"whiteGradientImageBase64",iz),z(to,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),z(to,"routePathCallbackStrMd",rz),z(to,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(to,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let $i=to;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:h.reactPositionsSet(void 0),data:h.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})($i||($i={})),h.extendClassProps($i.prototype,$i.createDefaultProps);class Yi extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_collection");this._collection=this.disposeVar(new $i(e,i)),this.dispose(h.track([this._collection,"show"],[this,"show"])),this.dispose(h.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(h.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(h.track([this._collection,"color"],[this,"color"])),this.dispose(h.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(h.track([this._collection,"width"],[this,"width"])),this.dispose(h.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(h.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(h.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(h.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(h.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(h.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(h.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(h.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(h.bind([this._collection,"playing"],[this,"playing"])),this.dispose(h.track([this._collection,"loop"],[this,"loop"])),this.dispose(h.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(h.bind([this._collection,"duration"],[this,"duration"])),this.dispose(h.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((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.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}}z(Yi,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(Yi,"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:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:h.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yi||(Yi={})),h.extendClassProps(Yi.prototype,Yi.createDefaultProps);const pc=class pc extends Jt{constructor(e,i){super(e,i);z(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(h.bind([r,"positions"],[e,"points"])),this.dispose(h.track([r,"width"],[e,"strokeWidth"])),this.dispose(h.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(h.track([r,"startTime"],[e,"startTime"])),this.dispose(h.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(h.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(h.track([r,"arcType"],[e,"arcType"])),this.dispose(h.track([r,"brightening"],[e,"brightening"])),this.dispose(h.track([r,"depthTest"],[e,"depthTest"])),this.dispose(h.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(h.track([r,"repeat"],[e,"repeat"])),this.dispose(h.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(h.track([r,"loop"],[e,"loop"])),this.dispose(h.track([r,"currentTime"],[e,"currentTime"])),this.dispose(h.track([r,"duration"],[e,"duration"])),this.dispose(h.track([r,"playing"],[e,"playing"])),this.dispose(h.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(pc,"type",pc.register("ESCesiumViewer",qA.type,pc));let Eg=pc;function Ho(t){var n=[1/0,1/0,-1/0,-1/0];return tf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ho.default=Ho;const Ji=11102230246251565e-32,en=134217729,oz=(3+8*Ji)*Ji;function Pg(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],c=0,f=0;A>u==A>-u?(r=u,u=n[++c]):(r=A,A=i[++f]);let d=0;if(c<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++c]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);c<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;c<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function sz(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function zl(t){return new Float64Array(t)}const az=(3+16*Ji)*Ji,lz=(2+12*Ji)*Ji,uz=(9+64*Ji)*Ji*Ji,ha=zl(4),y_=zl(8),v_=zl(12),w_=zl(16),on=zl(4);function cz(t,n,e,i,o,r,a){let s,l,u,A,c,f,d,p,g,v,y,m,b,x,E,B,P,I;const O=t-o,M=e-o,S=n-r,T=i-r;x=O*T,f=en*O,d=f-(f-O),p=O-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*M,f=en*S,d=f-(f-S),p=S-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,ha[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,ha[1]=b-(y+c)+(c-B),I=m+y,c=I-m,ha[2]=m-(I-c)+(y-c),ha[3]=I;let w=sz(4,ha),C=lz*a;if(w>=C||-w>=C||(c=t-O,s=t-(O+c)+(c-o),c=e-M,u=e-(M+c)+(c-o),c=n-S,l=n-(S+c)+(c-r),c=i-T,A=i-(T+c)+(c-r),s===0&&l===0&&u===0&&A===0)||(C=uz*a+oz*Math.abs(w),w+=O*A+T*s-(S*u+M*l),w>=C||-w>=C))return w;x=s*T,f=en*s,d=f-(f-s),p=s-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*M,f=en*l,d=f-(f-l),p=l-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const U=Pg(4,ha,4,on,y_);x=O*A,f=en*O,d=f-(f-O),p=O-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=en*S,d=f-(f-S),p=S-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const F=Pg(U,y_,4,on,v_);x=s*A,f=en*s,d=f-(f-s),p=s-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=en*l,d=f-(f-l),p=l-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const D=Pg(F,v_,4,on,w_);return w_[D-1]}function kl(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=az*u?l:-cz(t,n,e,i,o,r,u)}function sn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=ef(t),o=Pi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&hz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(b_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,c=1;c<s[u].length&&!A;)b_(i,s[u][c],!e.ignoreBoundary)&&(A=!0),c++;A||(l=!0)}return l}function b_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var c=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;c&&(i=!i)}return i}function hz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function Az(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return x_(t);case"FeatureCollection":return fz(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bg(t);default:throw new Error("unknown GeoJSON type")}}function x_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=__(t.properties),n.geometry=Bg(t.geometry),n}function __(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=__(i):n[e]=i}),n}function fz(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return x_(e)}),n}function Bg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Bg(e)}),n):(n.coordinates=C_(t.coordinates),n)}function C_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return C_(e)})}function S_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=ML(t),o=[];switch(i){case"LineString":o=Tg(t);break;case"MultiLineString":case"Polygon":Ei(t).forEach(function(a){o.push(Tg(a))});break;case"MultiPolygon":Ei(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(Tg(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ei(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Tg(t){var n=Ei(t);if(n.length===2&&!E_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,E_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function E_(t,n){return t[0]===n[0]&&t[1]===n[1]}function P_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,c=s-r,f=l-a,d=u*f-A*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function pz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return tf(t,function(r){e+=r[0],i+=r[1],o++},!0),Gr([e/o,i/o],n.properties)}function B_(t){if(!t)throw new Error("geojson is required");var n=[];return sa(t,function(e){dz(e,n)}),Si(n)}function dz(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ei(i);break;case"LineString":e=[Ei(i)]}e.forEach(function(o){var r=mz(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function mz(t,n){var e=[];return t.reduce(function(i,o){var r=YA([i,o],n);return r.bbox=gz(i,o),e.push(r),o}),e}function gz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var of={exports:{}},sf={exports:{}},yz=sf.exports,T_;function vz(){return T_||(T_=1,(function(t,n){(function(e,i){t.exports=i()})(yz,function(){function e(m,b,x,E,B){(function P(I,O,M,S,T){for(;S>M;){if(S-M>600){var w=S-M+1,C=O-M+1,U=Math.log(w),F=.5*Math.exp(2*U/3),D=.5*Math.sqrt(U*F*(w-F)/w)*(C-w/2<0?-1:1),R=Math.max(M,Math.floor(O-C*F/w+D)),L=Math.min(S,Math.floor(O+(w-C)*F/w+D));P(I,O,R,L,T)}var k=I[O],Q=M,V=S;for(i(I,M,O),T(I[S],k)>0&&i(I,M,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[M],k)===0?i(I,M,V):i(I,++V,S),V<=O&&(M=V+1),O<=V&&(S=V-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function c(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],O=b.leaf?E(I):I;g(m,O)&&(b.leaf?x.push(I):p(m,O)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.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 E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),O=[],M=[];P||O.length;){if(P||(P=O.pop(),E=O[O.length-1],x=M.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),O.push(P),this._condense(O),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(O.push(P),M.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var O=Math.ceil(P/I),M=O*Math.ceil(Math.sqrt(I));y(m,b,x,M,this.compareMinX);for(var S=b;S<=x;S+=M){var T=Math.min(S+M-1,x);y(m,S,T,O,this.compareMinY);for(var w=S;w<=T;w+=O){var C=Math.min(w+O-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,O=0;O<b.children.length;O++){var M=b.children[O],S=f(M),T=(w=m,C=M,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=M):T===P&&S<B&&(B=S,I=M)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,O,M,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var U=l(m,0,C,this.toBBox),F=l(m,C,x,this.toBBox),D=(B=U,P=F,I=void 0,O=void 0,M=void 0,S=void 0,I=Math.max(B.minX,P.minX),O=Math.max(B.minY,P.minY),M=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,M-I)*Math.max(0,S-O)),R=f(U)+f(F);D<T?(T=D,E=C,w=R<w?R:w):D===T&&R<w&&(w=R,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:c;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),O=d(P)+d(I),M=b;M<x-b;M++){var S=m.children[M];u(P,m.leaf?B(S):S),O+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),O+=d(I)}return O},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(sf)),sf.exports}var Ig={},I_;function F_(){return I_||(I_=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:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,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 n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return c(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,U=S;C<U.length;C++){var F=U[C];if(F.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var D=0;D<F[F.length-1].length;D++)if(F[F.length-1][D]!==F[0][D])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function c(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=c;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var U=t.areaFactors[w];if(!U)throw new Error("invalid final units");return S/C*U}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function O(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=O;function M(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=M})(Ig)),Ig}var Tt={},M_;function D_(){if(M_)return Tt;M_=1,Object.defineProperty(Tt,"__esModule",{value:!0});var t=F_();function n(m,b,x){if(m!==null)for(var E,B,P,I,O,M,S,T=0,w=0,C,U=m.type,F=U==="FeatureCollection",D=U==="Feature",R=F?m.features.length:1,L=0;L<R;L++){S=F?m.features[L].geometry:D?m.geometry:m,C=S?S.type==="GeometryCollection":!1,O=C?S.geometries.length:1;for(var k=0;k<O;k++){var Q=0,V=0;if(I=C?S.geometries[k]:S,I!==null){M=I.coordinates;var G=I.type;switch(T=x&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(b(M,w,L,Q,V)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(E=0;E<M.length;E++){if(b(M[E],w,L,Q,V)===!1)return!1;w++,G==="MultiPoint"&&Q++}G==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(E=0;E<M.length;E++){for(B=0;B<M[E].length-T;B++){if(b(M[E][B],w,L,Q,V)===!1)return!1;w++}G==="MultiLineString"&&Q++,G==="Polygon"&&V++}G==="Polygon"&&Q++;break;case"MultiPolygon":for(E=0;E<M.length;E++){for(V=0,B=0;B<M[E].length;B++){for(P=0;P<M[E][B].length-T;P++){if(b(M[E][B][P],w,L,Q,V)===!1)return!1;w++}V++}Q++}break;case"GeometryCollection":for(E=0;E<I.geometries.length;E++)if(n(I.geometries[E],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,b,x,E){var B=x;return n(m,function(P,I,O,M,S){I===0&&x===void 0?B=P:B=b(B,P,I,O,M,S)},E),B}function i(m,b){var x;switch(m.type){case"FeatureCollection":for(x=0;x<m.features.length&&b(m.features[x].properties,x)!==!1;x++);break;case"Feature":b(m.properties,0);break}}function o(m,b,x){var E=x;return i(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function r(m,b){if(m.type==="Feature")b(m,0);else if(m.type==="FeatureCollection")for(var x=0;x<m.features.length&&b(m.features[x],x)!==!1;x++);}function a(m,b,x){var E=x;return r(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function s(m){var b=[];return n(m,function(x){b.push(x)}),b}function l(m,b){var x,E,B,P,I,O,M,S,T,w,C=0,U=m.type==="FeatureCollection",F=m.type==="Feature",D=U?m.features.length:1;for(x=0;x<D;x++){for(O=U?m.features[x].geometry:F?m.geometry:m,S=U?m.features[x].properties:F?m.properties:{},T=U?m.features[x].bbox:F?m.bbox:void 0,w=U?m.features[x].id:F?m.id:void 0,M=O?O.type==="GeometryCollection":!1,I=M?O.geometries.length:1,B=0;B<I;B++){if(P=M?O.geometries[B]:O,P===null){if(b(null,C,S,T,w)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(P,C,S,T,w)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(b(P.geometries[E],C,S,T,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function u(m,b,x){var E=x;return l(m,function(B,P,I,O,M){P===0&&x===void 0?E=B:E=b(E,B,P,I,O,M)}),E}function A(m,b){l(m,function(x,E,B,P,I){var O=x===null?null:x.type;switch(O){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,B,{bbox:P,id:I}),E,0)===!1?!1:void 0}var M;switch(O){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var S=0;S<x.coordinates.length;S++){var T=x.coordinates[S],w={type:M,coordinates:T};if(b(t.feature(w,B),E,S)===!1)return!1}})}function c(m,b,x){var E=x;return A(m,function(B,P,I){P===0&&I===0&&x===void 0?E=B:E=b(E,B,P,I)}),E}function f(m,b){A(m,function(x,E,B){var P=0;if(x.geometry){var I=x.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var O,M=0,S=0,T=0;if(n(x,function(w,C,U,F,D){if(O===void 0||E>M||F>S||D>T){O=w,M=E,S=F,T=D,P=0;return}var R=t.lineString([O,w],x.properties);if(b(R,E,B,D,P)===!1)return!1;P++,O=w})===!1)return!1}}})}function d(m,b,x){var E=x,B=!1;return f(m,function(P,I,O,M,S){B===!1&&x===void 0?E=P:E=b(E,P,I,O,M,S),B=!0}),E}function p(m,b){if(!m)throw new Error("geojson is required");A(m,function(x,E,B){if(x.geometry!==null){var P=x.geometry.type,I=x.geometry.coordinates;switch(P){case"LineString":if(b(x,E,B,0,0)===!1)return!1;break;case"Polygon":for(var O=0;O<I.length;O++)if(b(t.lineString(I[O],x.properties),E,B,O)===!1)return!1;break}}})}function g(m,b,x){var E=x;return p(m,function(B,P,I,O){P===0&&x===void 0?E=B:E=b(E,B,P,I,O)}),E}function v(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.segmentIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=M.length+P-1),t.lineString([M[P],M[P+1]],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P-1),t.lineString([M[B][P],M[B][P+1]],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P-1),t.lineString([M[E][P],M[E][P+1]],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P-1),t.lineString([M[E][B][P],M[E][B][P+1]],I,b)}throw new Error("geojson is invalid")}function y(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.coordIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":return t.point(M,I,b);case"MultiPoint":return E<0&&(E=M.length+E),t.point(M[E],I,b);case"LineString":return P<0&&(P=M.length+P),t.point(M[P],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P),t.point(M[B][P],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P),t.point(M[E][P],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P),t.point(M[E][B][P],I,b)}throw new Error("geojson is invalid")}return Tt.coordAll=s,Tt.coordEach=n,Tt.coordReduce=e,Tt.featureEach=r,Tt.featureReduce=a,Tt.findPoint=y,Tt.findSegment=v,Tt.flattenEach=A,Tt.flattenReduce=c,Tt.geomEach=l,Tt.geomReduce=u,Tt.lineEach=p,Tt.lineReduce=g,Tt.propEach=i,Tt.propReduce=o,Tt.segmentEach=f,Tt.segmentReduce=d,Tt}var af={},R_;function wz(){if(R_)return af;R_=1,Object.defineProperty(af,"__esModule",{value:!0});var t=D_();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,af.default=n,af}var U_;function bz(){if(U_)return of.exports;U_=1;var t=vz(),n=F_(),e=D_(),i=wz().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function a(s){var l=new t(s);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.insert.call(this,u)},l.load=function(u){var A=[];return Array.isArray(u)?u.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}):o(u,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}),t.prototype.load.call(this,A)},l.remove=function(u,A){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.remove.call(this,u,A)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(u){var A=t.prototype.search.call(this,this.toBBox(u));return r(A)},l.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=t.prototype.all.call(this);return r(u)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var A;if(u.bbox)A=u.bbox;else if(Array.isArray(u)&&u.length===4)A=u;else if(Array.isArray(u)&&u.length===6)A=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")A=i(u);else if(u.type==="FeatureCollection")A=i(u);else throw new Error("invalid geojson");return{minX:A[0],minY:A[1],maxX:A[2],maxY:A[3]}},l}return of.exports=a,of.exports.default=a,of.exports}var xz=bz();const _z=Al(xz);function Fg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=O_(t,n);return o&&i.push(o),Si(i)}var r=_z();return r.load(B_(n)),nf(B_(t),function(a){nf(r.search(a),function(s){var l=O_(a,s);if(l){var u=Ei(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Si(i)}function O_(t,n){var e=Ei(t),i=Ei(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],c=i[1][1],f=(c-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(c-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Gr([y,m])}return null}function lf(t,n,e){e===void 0&&(e={});for(var i=ef(t),o=Ei(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Cz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Cz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],c=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=c*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Sz(t,n){var e=Pi(t),i=Pi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Ez(e,i);case"LineString":return lf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return sn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Pz(e,i);case"LineString":return Bz(e,i);case"Polygon":case"MultiPolygon":return Tz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Iz(e,i);case"Polygon":case"MultiPolygon":return Fz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Mz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Ez(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(z_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Pz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)z_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Bz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!lf(t.coordinates[i],n))return!1;e||(e=lf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function Tz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=sn(t.coordinates[1],n),!i){e=!1;break}i=sn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Iz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!lf(t.coordinates[e],n))return!1;return!0}function Fz(t,n){var e=Ho(n),i=Ho(t);if(!L_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!sn(t.coordinates[r],n))return!1;if(o||(o=sn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Dz(t.coordinates[r],t.coordinates[r+1]);o=sn(a,n,{ignoreBoundary:!0})}}return o}function Mz(t,n){var e=Ho(t),i=Ho(n);if(!L_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!sn(t.coordinates[0][o],n))return!1;return!0}function L_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function z_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Dz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function k_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Bi([o,r],[a,r],e),u=l*(a-o),A=n/Bi([o,r],[o,s],e),c=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/c),v=(f-p*u)/2,y=(d-g*c)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Gr([m,b],e.properties);e.mask?Sz(x,e.mask)&&i.push(x):i.push(x),b+=c}m+=u}return Si(i)}function Mg(t,n){n===void 0&&(n={});var e=Pi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Rz(e,n);case"MultiPolygon":return Uz(e,n);default:throw new Error("invalid poly")}}function Rz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return Q_(i,o)}function Uz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(Q_(a,o))}),Si(r)}function Q_(t,n){return t.length>1?BL(t,n):YA(t[0],n)}var Dg,V_;function N_(){if(V_)return Dg;V_=1;var t=Object.prototype.toString;return Dg=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Dg}var Rg,H_;function Oz(){if(H_)return Rg;H_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=N_(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.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},A=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1})(),c=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=c(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return Rg=t,Rg}var Ug,G_;function W_(){if(G_)return Ug;G_=1;var t=Array.prototype.slice,n=N_(),e=Object.keys,i=e?function(a){return e(a)}:Oz(),o=Object.keys;return i.shim=function(){if(Object.keys){var a=(function(){var s=Object.keys(arguments);return s&&s.length===arguments.length})(1,2);a||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Ug=i,Ug}var Og,j_;function q_(){return j_||(j_=1,Og=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0}),Og}var Lg,K_;function zg(){if(K_)return Lg;K_=1;var t=q_();return Lg=function(){return t()&&!!Symbol.toStringTag},Lg}var kg,Z_;function X_(){return Z_||(Z_=1,kg=Object),kg}var Qg,$_;function Y_(){return $_||($_=1,Qg=Error),Qg}var Vg,J_;function Lz(){return J_||(J_=1,Vg=EvalError),Vg}var Ng,eC;function zz(){return eC||(eC=1,Ng=RangeError),Ng}var Hg,tC;function kz(){return tC||(tC=1,Hg=ReferenceError),Hg}var Gg,nC;function iC(){return nC||(nC=1,Gg=SyntaxError),Gg}var Wg,rC;function Aa(){return rC||(rC=1,Wg=TypeError),Wg}var jg,oC;function Qz(){return oC||(oC=1,jg=URIError),jg}var qg,sC;function Vz(){return sC||(sC=1,qg=Math.abs),qg}var Kg,aC;function Nz(){return aC||(aC=1,Kg=Math.floor),Kg}var Zg,lC;function Hz(){return lC||(lC=1,Zg=Math.max),Zg}var Xg,uC;function Gz(){return uC||(uC=1,Xg=Math.min),Xg}var $g,cC;function Wz(){return cC||(cC=1,$g=Math.pow),$g}var Yg,hC;function jz(){return hC||(hC=1,Yg=Math.round),Yg}var Jg,AC;function qz(){return AC||(AC=1,Jg=Number.isNaN||function(n){return n!==n}),Jg}var ey,fC;function Kz(){if(fC)return ey;fC=1;var t=qz();return ey=function(e){return t(e)||e===0?e:e<0?-1:1},ey}var ty,pC;function Zz(){return pC||(pC=1,ty=Object.getOwnPropertyDescriptor),ty}var ny,dC;function fa(){if(dC)return ny;dC=1;var t=Zz();if(t)try{t([],"length")}catch{t=null}return ny=t,ny}var iy,mC;function uf(){if(mC)return iy;mC=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return iy=t,iy}var ry,gC;function Xz(){if(gC)return ry;gC=1;var t=typeof Symbol<"u"&&Symbol,n=q_();return ry=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},ry}var oy,yC;function vC(){return yC||(yC=1,oy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),oy}var sy,wC;function bC(){if(wC)return sy;wC=1;var t=X_();return sy=t.getPrototypeOf||null,sy}var ay,xC;function $z(){if(xC)return ay;xC=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,u){for(var A=[],c=0;c<l.length;c+=1)A[c]=l[c];for(var f=0;f<u.length;f+=1)A[f+l.length]=u[f];return A},r=function(l,u){for(var A=[],c=u,f=0;c<l.length;c+=1,f+=1)A[f]=l[c];return A},a=function(s,l){for(var u="",A=0;A<s.length;A+=1)u+=s[A],A+1<s.length&&(u+=l);return u};return ay=function(l){var u=this;if(typeof u!="function"||n.apply(u)!==i)throw new TypeError(t+u);for(var A=r(arguments,1),c,f=function(){if(this instanceof c){var y=u.apply(this,o(A,arguments));return Object(y)===y?y:this}return u.apply(l,o(A,arguments))},d=e(0,u.length-A.length),p=[],g=0;g<d;g++)p[g]="$"+g;if(c=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var v=function(){};v.prototype=u.prototype,c.prototype=new v,v.prototype=null}return c},ay}var ly,_C;function Ql(){if(_C)return ly;_C=1;var t=$z();return ly=Function.prototype.bind||t,ly}var uy,CC;function cy(){return CC||(CC=1,uy=Function.prototype.call),uy}var hy,SC;function Ay(){return SC||(SC=1,hy=Function.prototype.apply),hy}var fy,EC;function Yz(){return EC||(EC=1,fy=typeof Reflect<"u"&&Reflect&&Reflect.apply),fy}var py,PC;function BC(){if(PC)return py;PC=1;var t=Ql(),n=Ay(),e=cy(),i=Yz();return py=i||t.call(e,n),py}var dy,TC;function my(){if(TC)return dy;TC=1;var t=Ql(),n=Aa(),e=cy(),i=BC();return dy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},dy}var gy,IC;function Jz(){if(IC)return gy;IC=1;var t=my(),n=fa(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return gy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(s){return r(s==null?s:o(s))}:!1,gy}var yy,FC;function MC(){if(FC)return yy;FC=1;var t=vC(),n=bC(),e=Jz();return yy=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,yy}var vy,DC;function RC(){if(DC)return vy;DC=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=Ql();return vy=e.call(t,n),vy}var wy,UC;function OC(){if(UC)return wy;UC=1;var t,n=X_(),e=Y_(),i=Lz(),o=zz(),r=kz(),a=iC(),s=Aa(),l=Qz(),u=Vz(),A=Nz(),c=Hz(),f=Gz(),d=Wz(),p=jz(),g=Kz(),v=Function,y=function(ue){try{return v('"use strict"; return ('+ue+").constructor;")()}catch{}},m=fa(),b=uf(),x=function(){throw new s},E=m?(function(){try{return arguments.callee,x}catch{try{return m(arguments,"callee").get}catch{return x}}})():x,B=Xz()(),P=MC(),I=bC(),O=vC(),M=Ay(),S=cy(),T={},w=typeof Uint8Array>"u"||!P?t:P(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":B&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%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%":i,"%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%":v,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":B&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!B||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!B||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":B&&P?P(""[Symbol.iterator]()):t,"%Symbol%":B?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":w,"%TypeError%":s,"%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%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":M,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":A,"%Math.max%":c,"%Math.min%":f,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(P)try{null.error}catch(ue){var U=P(P(ue));C["%Error.prototype%"]=U}var F=function ue(te){var ce;if(te==="%AsyncFunction%")ce=y("async function () {}");else if(te==="%GeneratorFunction%")ce=y("function* () {}");else if(te==="%AsyncGeneratorFunction%")ce=y("async function* () {}");else if(te==="%AsyncGenerator%"){var X=ue("%AsyncGeneratorFunction%");X&&(ce=X.prototype)}else if(te==="%AsyncIteratorPrototype%"){var q=ue("%AsyncGenerator%");q&&P&&(ce=P(q.prototype))}return C[te]=ce,ce},D={__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"]},R=Ql(),L=RC(),k=R.call(S,Array.prototype.concat),Q=R.call(M,Array.prototype.splice),V=R.call(S,String.prototype.replace),G=R.call(S,String.prototype.slice),$=R.call(S,RegExp.prototype.exec),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(te){var ce=G(te,0,1),X=G(te,-1);if(ce==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&ce!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var q=[];return V(te,Y,function(H,Z,K,j){q[q.length]=K?V(j,ie,"$1"):Z||H}),q},le=function(te,ce){var X=te,q;if(L(D,X)&&(q=D[X],X="%"+q[0]+"%"),L(C,X)){var H=C[X];if(H===T&&(H=F(X)),typeof H>"u"&&!ce)throw new s("intrinsic "+te+" exists, but is not available. Please file an issue!");return{alias:q,name:X,value:H}}throw new a("intrinsic "+te+" does not exist!")};return wy=function(te,ce){if(typeof te!="string"||te.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new s('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,te)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=re(te),q=X.length>0?X[0]:"",H=le("%"+q+"%",ce),Z=H.name,K=H.value,j=!1,W=H.alias;W&&(q=W[0],Q(X,k([0,1],W)));for(var J=1,ee=!0;J<X.length;J+=1){var se=X[J],Ae=G(se,0,1),fe=G(se,-1);if((Ae==='"'||Ae==="'"||Ae==="`"||fe==='"'||fe==="'"||fe==="`")&&Ae!==fe)throw new a("property names with quotes must have matching quotes");if((se==="constructor"||!ee)&&(j=!0),q+="."+se,Z="%"+q+"%",L(C,Z))K=C[Z];else if(K!=null){if(!(se in K)){if(!ce)throw new s("base intrinsic for "+te+" exists, but the property is not available.");return}if(m&&J+1>=X.length){var de=m(K,se);ee=!!de,ee&&"get"in de&&!("originalValue"in de.get)?K=de.get:K=K[se]}else ee=L(K,se),K=K[se];ee&&!j&&(C[Z]=K)}}return K},wy}var by,LC;function xy(){if(LC)return by;LC=1;var t=OC(),n=my(),e=n([t("%String.prototype.indexOf%")]);return by=function(o,r){var a=t(o,!!r);return typeof a=="function"&&e(o,".prototype.")>-1?n([a]):a},by}var _y,zC;function e6(){if(zC)return _y;zC=1;var t=zg()(),n=xy(),e=n("Object.prototype.toString"),i=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:e(s)==="[object Arguments]"},o=function(s){return i(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&e(s)!=="[object Array]"&&"callee"in s&&e(s.callee)==="[object Function]"},r=(function(){return i(arguments)})();return i.isLegacyArguments=o,_y=r?i:o,_y}var Cy,kC;function Sy(){if(kC)return Cy;kC=1;var t=uf(),n=iC(),e=Aa(),i=fa();return Cy=function(r,a,s){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="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 l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!i&&i(r,a);if(t)t(r,a,{configurable:A===null&&f?f.configurable:!A,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:u===null&&f?f.writable:!u});else if(c||!l&&!u&&!A)r[a]=s;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Cy}var Ey,QC;function Py(){if(QC)return Ey;QC=1;var t=uf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ey=n,Ey}var By,VC;function Vl(){if(VC)return By;VC=1;var t=W_(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Sy(),r=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=Py()(),s=function(u,A,c,f){if(A in u){if(f===!0){if(u[A]===c)return}else if(!r(f)||!f())return}a?o(u,A,c,!0):o(u,A,c)},l=function(u,A){var c=arguments.length>2?arguments[2]:{},f=t(A);n&&(f=i.call(f,Object.getOwnPropertySymbols(A)));for(var d=0;d<f.length;d+=1)s(u,f[d],A[f[d]],c[f[d]])};return l.supportsDescriptors=!!a,By=l,By}var Ty={exports:{}},Iy,NC;function t6(){if(NC)return Iy;NC=1;var t=OC(),n=Sy(),e=Py()(),i=fa(),o=Aa(),r=t("%Math.floor%");return Iy=function(s,l){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],A=!0,c=!0;if("length"in s&&i){var f=i(s,"length");f&&!f.configurable&&(A=!1),f&&!f.writable&&(c=!1)}return(A||c||!u)&&(e?n(s,"length",l,!0,!0):n(s,"length",l)),s},Iy}var Fy,HC;function n6(){if(HC)return Fy;HC=1;var t=Ql(),n=Ay(),e=BC();return Fy=function(){return e(t,n,arguments)},Fy}var GC;function WC(){return GC||(GC=1,(function(t){var n=t6(),e=uf(),i=my(),o=n6();t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(Ty)),Ty.exports}var My,jC;function qC(){if(jC)return My;jC=1;var t=function(n){return n!==n};return My=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},My}var Dy,KC;function ZC(){if(KC)return Dy;KC=1;var t=qC();return Dy=function(){return typeof Object.is=="function"?Object.is:t},Dy}var Ry,XC;function i6(){if(XC)return Ry;XC=1;var t=ZC(),n=Vl();return Ry=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Ry}var Uy,$C;function r6(){if($C)return Uy;$C=1;var t=Vl(),n=WC(),e=qC(),i=ZC(),o=i6(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Uy=r,Uy}var Oy,YC;function o6(){if(YC)return Oy;YC=1;var t=xy(),n=zg()(),e=RC(),i=fa(),o;if(n){var r=t("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),o=function(f){if(!f||typeof f!="object")return!1;var d=i(f,"lastIndex"),p=d&&e(d,"value");if(!p)return!1;try{r(f,l)}catch(g){return g===a}}}else{var u=t("Object.prototype.toString"),A="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===A}}return Oy=o,Oy}var Ly,JC;function s6(){if(JC)return Ly;JC=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Ly=t,Ly}var zy,eS;function a6(){if(eS)return zy;eS=1;var t=Sy(),n=Py()(),e=s6().functionsHaveConfigurableNames(),i=Aa();return zy=function(r,a){if(typeof r!="function")throw new i("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||e)&&(n?t(r,"name",a,!0,!0):t(r,"name",a)),r},zy}var ky,tS;function nS(){if(tS)return ky;tS=1;var t=a6(),n=Aa(),e=Object;return ky=t(function(){if(this==null||this!==e(this))throw new n("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),ky}var Qy,iS;function rS(){if(iS)return Qy;iS=1;var t=nS(),n=Vl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Qy=function(){if(n&&/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 r="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(a,"sticky",{get:function(){r+="y"}}),o.get.call(a),r==="dy")return o.get}}return t},Qy}var Vy,oS;function l6(){if(oS)return Vy;oS=1;var t=Vl().supportsDescriptors,n=rS(),e=fa(),i=Object.defineProperty,o=Y_(),r=MC(),a=/a/;return Vy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),u=r(a),A=e(u,"flags");return(!A||A.get!==l)&&i(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Vy}var Ny,sS;function u6(){if(sS)return Ny;sS=1;var t=Vl(),n=WC(),e=nS(),i=rS(),o=l6(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Ny=r,Ny}var Hy,aS;function c6(){if(aS)return Hy;aS=1;var t=xy(),n=t("Date.prototype.getDay"),e=function(s){try{return n(s),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=zg()();return Hy=function(s){return typeof s!="object"||s===null?!1:r?e(s):i(s)===o},Hy}var Gy,lS;function h6(){if(lS)return Gy;lS=1;var t=W_(),n=e6(),e=r6(),i=o6(),o=u6(),r=c6(),a=Date.prototype.getTime;function s(c,f,d){var p=d||{};return(p.strict?e(c,f):c===f)?!0:!c||!f||typeof c!="object"&&typeof f!="object"?p.strict?e(c,f):c==f:A(c,f,p)}function l(c){return c==null}function u(c){return!(!c||typeof c!="object"||typeof c.length!="number"||typeof c.copy!="function"||typeof c.slice!="function"||c.length>0&&typeof c[0]!="number")}function A(c,f,d){var p,g;if(typeof c!=typeof f||l(c)||l(f)||c.prototype!==f.prototype||n(c)!==n(f))return!1;var v=i(c),y=i(f);if(v!==y)return!1;if(v||y)return c.source===f.source&&o(c)===o(f);if(r(c)&&r(f))return a.call(c)===a.call(f);var m=u(c),b=u(f);if(m!==b)return!1;if(m||b){if(c.length!==f.length)return!1;for(p=0;p<c.length;p++)if(c[p]!==f[p])return!1;return!0}if(typeof c!=typeof f)return!1;try{var x=t(c),E=t(f)}catch{return!1}if(x.length!==E.length)return!1;for(x.sort(),E.sort(),p=x.length-1;p>=0;p--)if(x[p]!=E[p])return!1;for(p=x.length-1;p>=0;p--)if(g=x[p],!s(c[g],f[g],d))return!1;return!0}return Gy=s,Gy}function A6(t,n){var e=!0;return sa(t,function(i){sa(n,function(o){if(e===!1)return!1;e=f6(i.geometry,o.geometry)})}),e}function f6(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!g6(t.coordinates,n.coordinates);case"LineString":return!uS(n,t);case"Polygon":return!sn(t,n)}break;case"LineString":switch(n.type){case"Point":return!uS(t,n);case"LineString":return!p6(t,n);case"Polygon":return!cS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!sn(n,t);case"LineString":return!cS(t,n);case"Polygon":return!d6(n,t)}}return!1}function uS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(m6(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function p6(t,n){var e=Fg(t,n);return e.features.length>0}function cS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(sn(o,t))return!0}var r=Fg(n,Mg(t));return r.features.length>0}function d6(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(sn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(sn(s,t))return!0}var l=Fg(Mg(t),Mg(n));return l.features.length>0}function m6(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function g6(t,n){return t[0]===n[0]&&t[1]===n[1]}var Wy,hS;function y6(){if(hS)return Wy;hS=1;var t=h6(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,a){if(r.type!==a.type||!i(r,a))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,a.coordinates);case"LineString":return this.compareLine(r.coordinates,a.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,a);case"Feature":return this.compareFeature(r,a);default:if(r.type.indexOf("Multi")===0){var s=this,l=e(r),u=e(a);return l.every(function(A){return this.some(function(c){return s.compare(A,c)})},u)}}return!1};function e(r){return r.coordinates.map(function(a){return{type:r.type.replace("Multi",""),coordinates:a}})}function i(r,a){return r.hasOwnProperty("coordinates")?r.coordinates.length===a.coordinates.length:r.length===a.length}n.prototype.compareCoord=function(r,a){if(r.length!==a.length)return!1;for(var s=0;s<r.length;s++)if(r[s].toFixed(this.precision)!==a[s].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,a,s,l){if(!i(r,a))return!1;var u=this.pseudoNode?r:this.removePseudo(r),A=this.pseudoNode?a:this.removePseudo(a);if(!(l&&!this.compareCoord(u[0],A[0])&&(A=this.fixStartIndex(A,u),!A))){var c=this.compareCoord(u[s],A[s]);return this.direction||c?this.comparePath(u,A):this.compareCoord(u[s],A[A.length-(1+s)])?this.comparePath(u.slice().reverse(),A):!1}},n.prototype.fixStartIndex=function(r,a){for(var s,l=-1,u=0;u<r.length;u++)if(this.compareCoord(r[u],a[0])){l=u;break}return l>=0&&(s=[].concat(r.slice(l,r.length),r.slice(1,l+1))),s},n.prototype.comparePath=function(r,a){var s=this;return r.every(function(l,u){return s.compareCoord(l,this[u])},a)},n.prototype.comparePolygon=function(r,a){if(this.compareLine(r.coordinates[0],a.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),l=a.coordinates.slice(1,a.coordinates.length),u=this;return s.every(function(A){return this.some(function(c){return u.compareLine(A,c,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,a){return r.id!==a.id||!this.objectComparator(r.properties,a.properties)||!this.compareBBox(r,a)?!1:this.compare(r.geometry,a.geometry)},n.prototype.compareBBox=function(r,a){return!!(!r.bbox&&!a.bbox||r.bbox&&a.bbox&&this.compareCoord(r.bbox,a.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,a){return t(r,a,{strict:!0})}return Wy=n,Wy}var v6=y6();const w6=Al(v6);function b6(t,n){var e=Pi(t).type,i=Pi(n).type;if(e!==i)return!1;var o=new w6({precision:6});return o.compare(S_(t),S_(n))}function x6(t,n){var e=!1;return sa(t,function(i){sa(n,function(o){if(e===!0)return!0;e=!A6(i.geometry,o.geometry)})}),e}/**
3709
3709
  * splaytree v3.1.2
3710
3710
  * Fast Splay tree for Node and browser
3711
3711
  *
@@ -3725,8 +3725,8 @@ function (result, this, instanceIndex, frameState) {
3725
3725
 
3726
3726
  See the Apache Version 2.0 License for specific language governing permissions
3727
3727
  and limitations under the License.
3728
- ***************************************************************************** */function _k(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=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(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Wr=(function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t})();function Ck(t,n){return t>n?1:t<n?-1:0}function jr(t,n,e){for(var i=new Wr(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function jy(t,n,e,i){var o=new Wr(t,n);if(e===null)return o.left=o.right=null,o;e=jr(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function AS(t,n,e){var i=null,o=null;if(n){n=jr(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function Sk(t,n,e){return n===null?t:(t===null||(n=jr(t.key,n,e),n.left=t),n)}function qy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
3729
- `);var r=n+(e?" ":"│ ");t.left&&qy(t.left,r,!1,i,o),t.right&&qy(t.right,r,!0,i,o)}}var Ky=(function(){function t(n){n===void 0&&(n=Ck),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=jy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Wr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=jr(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=jr(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=jr(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=jr(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=jr(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},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(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return Pk(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Zy(n,e,0,o),this._size=o;else{var a=Bk(this.toList(),Ek(n,e),r);o=this._size+o,this._root=Xy({head:a},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(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=AS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=jy(e,i,s,o):a=jy(e,i,a,o),this._root=Sk(a,s,o)},t.prototype.split=function(n){return AS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return _k(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function Zy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Wr(a,s);return l.left=Zy(t,n,e,r),l.right=Zy(t,n,r+1,i),l}return null}function Ek(t,n){for(var e=new Wr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Wr(t[o],n[o]);return i.next=null,e.next}function Pk(t){for(var n=t,e=[],i=!1,o=new Wr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Xy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Xy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Xy(t,o+1,e),a}return null}function Bk(t,n,e){for(var i=new Wr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const Nl=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let qr=Number.EPSILON;qr===void 0&&(qr=Math.pow(2,-52));const Tk=qr*qr,fS=(t,n)=>{if(-qr<t&&t<qr&&-qr<n&&n<qr)return 0;const e=t-n;return e*e<Tk*t*n?0:t<n?-1:1};class Ik{constructor(){this.reset()}reset(){this.xRounder=new pS,this.yRounder=new pS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class pS{constructor(){this.tree=new Ky,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&fS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&fS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Hl=new Ik,cf=(t,n)=>t.x*n.y-t.y*n.x,dS=(t,n)=>t.x*n.x+t.y*n.y,mS=(t,n,e)=>{const i=kl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},hf=t=>Math.sqrt(dS(t,t)),Fk=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return cf(o,i)/hf(o)/hf(i)},Mk=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return dS(o,i)/hf(o)/hf(i)},gS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},yS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},Dk=(t,n,e,i)=>{if(n.x===0)return yS(e,i,t.x);if(i.x===0)return yS(t,n,e.x);if(n.y===0)return gS(e,i,t.y);if(i.y===0)return gS(t,n,e.y);const o=cf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=cf(r,n)/o,s=cf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,c=e.y+a*i.y,f=(l+u)/2,d=(A+c)/2;return{x:f,y:d}};class Wn{static compare(n,e){const i=Wn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:Kr.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:Fk(this.point,n.point,r.point),cosine:Mk(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let Rk=0;class Kr{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const c=n.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const c=e.comparePoint(n.leftSE.point);if(c!==0)return c;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const c=e.comparePoint(n.rightSE.point);if(c!==0)return c}if(r>a){const c=n.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(r!==a){const c=u-s,f=r-i,d=A-l,p=a-o;if(c>f&&d<p)return 1;if(c<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++Rk,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Wn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Wn(o,!0),u=new Wn(r,!1);return new Kr(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=Nl(e,s)&&this.comparePoint(s)===0,A=Nl(i,r)&&n.comparePoint(r)===0,c=Nl(e,l)&&this.comparePoint(l)===0,f=Nl(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!c?a:!f&&c?l:null;if(A)return c&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&c)return null;if(f)return a;if(c)return l;const d=Dk(r,this.vector(),s,n.vector());return d===null||!Nl(o,d)?null:Hl.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Wn(n,!0),r=new Wn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new Kr(o,a,this.rings.slice(),this.windings.slice());return Wn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Wn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=Kr.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.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 n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],c=e.indexOf(u);c===-1?(e.push(u),i.push(A)):i[c]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const c=r.indexOf(u.poly);c!==-1&&r.splice(c,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].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 n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(oi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===oi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${oi.type}`)}return this._isInResult}}class vS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Hl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Hl.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Kr.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Kr.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class Uk{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new vS(n[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 i=1,o=n.length;i<o;i++){const r=new vS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class wS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}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 i=0,o=n.length;i<o;i++){const r=new Uk(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Af{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,c=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=c.length;g<v;g++)if(c[g].point===s.point){d=g;break}if(d!==null){const g=c.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Af(v.reverse()));continue}c.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Af(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const c=this.events[u].point,f=this.events[u+1].point;mS(c,n,f)!==0&&(e.push(c),n=c)}if(e.length===1)return null;const i=e[0],o=e[1];mS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Wn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class bS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class Ok{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new bS(r));else{const a=r.enclosingRing();a.poly||e.push(new bS(a)),a.poly.addInterior(r)}}return e}}class Lk{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr.compare;this.queue=n,this.tree=new Ky(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.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 r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const c=s.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const c=l.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(A=c),!l.isAnEndpoint(c))){const f=this._splitSafely(l,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let c=null;u===null?c=A:A===null?c=u:c=Wn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const xS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,zk=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class kk{run(n,e,i){oi.type=n,Hl.reset();const o=[new wS(e,!0)];for(let c=0,f=i.length;c<f;c++)o.push(new wS(i[c],!1));if(oi.numMultiPolys=o.length,oi.type==="difference"){const c=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,c.bbox)!==null?f++:o.splice(f,1)}if(oi.type==="intersection")for(let c=0,f=o.length;c<f;c++){const d=o[c];for(let p=c+1,g=o.length;p<g;p++)if(Yy(d.bbox,o[p].bbox)===null)return[]}const r=new Ky(Wn.compare);for(let c=0,f=o.length;c<f;c++){const d=o[c].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>xS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Lk(r);let s=r.size,l=r.pop();for(;l;){const c=l.key;if(r.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>xS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>zk)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(c);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}Hl.reset();const u=Af.factory(a.segments);return new Ok(u).getGeom()}}const oi=new kk;var Qk={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("difference",t,e)}};function ff(t,n,e){e===void 0&&(e={});var i=Pi(t),o=Pi(n),r=Qk.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?rn(r[0],e.properties):TL(r,e.properties)}function Vk(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Bi([o,l],[a,l],e),c=A*(a-o),f=n*2/Bi([u,r],[u,s],e),d=f*(s-r),p=c/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),O=(m-I*v)/2,M=I*v-m>v/2;M&&(O-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var U=[],F=0;F<=B;F++)for(var D=0;D<=I;D++){var R=F%2===1;if(!(D===0&&R)&&!(D===0&&M)){var L=F*b+o-P,k=D*x+r+O;if(R&&(k-=v/2),e.triangles===!0)Hk([L,k],c/2,d/2,JSON.parse(i),S,T).forEach(function(V){e.mask?ff(e.mask,V)&&U.push(V):U.push(V)});else{var Q=Nk([L,k],c/2,d/2,JSON.parse(i),S,T);e.mask?ff(e.mask,Q)&&U.push(Q):U.push(Q)}}}return Si(U)}function Nk(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),rn([a],i)}function Hk(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(rn([l],i))}return a}function Gk(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Bi([r,a],[s,a],i),A=u*(s-r),c=e/Bi([r,a],[r,l],i),f=c*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=rn([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?xk(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return Si(o)}function Wk(t,n,e){return e===void 0&&(e={}),Gk(t,n,n,e)}function jk(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Bi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Bi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,c=t[1];c<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)):l%2===0&&A%2===1?(f=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties)):A%2===0&&l%2===1?(f=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties),d=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties)):A%2===1&&l%2===1&&(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)),e.mask?(ff(e.mask,f)&&i.push(f),ff(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),c+=s,A++}l++,u+=r}return Si(i)}function qk(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(FL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=Ho(t),s;switch(i){case"point":case"points":s=k_(a,n,e);break;case"square":case"squares":s=Wk(a,n,e);break;case"hex":case"hexes":s=Vk(a,n,e);break;case"triangle":case"triangles":s=jk(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return nf(s,function(u){var A=0,c=0;nf(t,function(d){var p=i==="point"?u:pz(u),g=Bi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);c+=y,A+=y*v});var f=Az(u);f.properties[o]=A/c,l.push(f)}),Si(l)}function Kk(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const _S=(t=0)=>new Promise(n=>setTimeout(n,t));function Zk(t,n){const e=Si(t.map(l=>Gr(l))),i=rn([t]);return qk(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>sn(Gr(l),i))}function Xk(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ma(e)}function $k(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const dc=class dc extends Tn{constructor(e,i){super(e,i);z(this,"czmPointPrimitiveCollection");z(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Eo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(h.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],u=e.sampleDistance,A=Zk(l,u).map(b=>[...b,e.height]),c=Math.floor(e.extrudedHeight/u);if(c>0){const b=[...A];for(let x=1;x<=c;x++)A.push(...b.map(E=>[E[0],E[1],e.height+x*u]))}const{startTime:f,endTime:d,spanTime:p}=e,g=p*36e5,v=Math.floor((d-f)/g),y=Array(A.length).fill(0);e:for(let b=0;b<v;b++){if(await _S(),this._stopRun)break e;const x=new Date(f+b*g),E=Xk(x);t:for(let B=0;B<A.length;B++){if(await _S(),this._stopRun)break t;Kk(A[B],E,o.scene)||(y[B]=(y[B]*v+1)/v)}!this._stopRun&&(e.progress=Number(((b+1)/v*100).toFixed(2)))}const m=A.map((b,x)=>({position:[...b],color:$k(e.startColor,e.endColor,y[x]),pixelSize:10}));r.pointPrimitiveOptions=m},s=this.dv(h.createProcessingFromAsyncFunc(async l=>{await l.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};z(dc,"type",dc.register("ESCesiumViewer",h.ESSunshineAnalysis.type,dc));let Jy=dc;const CS=Math.pow(2,-52),pf=new Uint32Array(512);class ev{static from(n,e=n6,i=i6){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const S=n[2*M],T=n[2*M+1];S<s&&(s=S),T<l&&(l=T),S>u&&(u=S),T>A&&(A=T),this._ids[M]=M}const c=(s+u)/2,f=(l+A)/2;let d=1/0,p,g,v;for(let M=0;M<a;M++){const S=tv(c,f,n[2*M],n[2*M+1]);S<d&&(p=M,d=S)}const y=n[2*p],m=n[2*p+1];d=1/0;for(let M=0;M<a;M++){if(M===p)continue;const S=tv(y,m,n[2*M],n[2*M+1]);S<d&&S>0&&(g=M,d=S)}let b=n[2*g],x=n[2*g+1],E=1/0;for(let M=0;M<a;M++){if(M===p||M===g)continue;const S=e6(y,m,b,x,n[2*M],n[2*M+1]);S<E&&(v=M,E=S)}let B=n[2*v],P=n[2*v+1];if(E===1/0){for(let T=0;T<a;T++)this._dists[T]=n[2*T]-n[0]||n[2*T+1]-n[1];pa(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let S=0;for(let T=0,w=-1/0;T<a;T++){const C=this._ids[T];this._dists[C]>w&&(M[S++]=C,w=this._dists[C])}this.hull=M.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(kl(y,m,b,x,B,P)<0){const M=g,S=b,T=x;g=v,b=B,x=P,v=M,B=S,P=T}const I=t6(y,m,b,x,B,P);this._cx=I.x,this._cy=I.y;for(let M=0;M<a;M++)this._dists[M]=tv(n[2*M],n[2*M+1],I.x,I.y);pa(this._ids,this._dists,0,a-1),this._hullStart=p;let O=3;i[p]=e[v]=g,i[g]=e[p]=v,i[v]=e[g]=p,o[p]=0,o[g]=1,o[v]=2,r.fill(-1),r[this._hashKey(y,m)]=p,r[this._hashKey(b,x)]=g,r[this._hashKey(B,P)]=v,this.trianglesLen=0,this._addTriangle(p,g,v,-1,-1,-1);for(let M=0,S,T;M<this._ids.length;M++){const w=this._ids[M],C=n[2*w],U=n[2*w+1];if(M>0&&Math.abs(C-S)<=CS&&Math.abs(U-T)<=CS||(S=C,T=U,w===p||w===g||w===v))continue;let F=0;for(let Q=0,V=this._hashKey(C,U);Q<this._hashSize&&(F=r[(V+Q)%this._hashSize],!(F!==-1&&F!==i[F]));Q++);F=e[F];let D=F,R;for(;R=i[D],kl(C,U,n[2*D],n[2*D+1],n[2*R],n[2*R+1])>=0;)if(D=R,D===F){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,w,i[D],-1,-1,o[D]);o[w]=this._legalize(L+2),o[D]=L,O++;let k=i[D];for(;R=i[k],kl(C,U,n[2*k],n[2*k+1],n[2*R],n[2*R+1])<0;)L=this._addTriangle(k,w,R,o[w],-1,o[k]),o[w]=this._legalize(L+2),i[k]=k,O--,k=R;if(D===F)for(;R=e[D],kl(C,U,n[2*R],n[2*R+1],n[2*D],n[2*D+1])<0;)L=this._addTriangle(R,w,D,-1,o[D],o[R]),this._legalize(L+2),o[R]=L,i[D]=D,O--,D=R;this._hullStart=e[w]=D,i[D]=e[k]=w,i[w]=k,r[this._hashKey(C,U)]=w,r[this._hashKey(n[2*D],n[2*D+1])]=D}this.hull=new Uint32Array(O);for(let M=0,S=this._hullStart;M<O;M++)this.hull[M]=S,S=i[S];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(Yk(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=pf[--r];continue}const u=s-s%3,A=l+(n+1)%3,c=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[c];if(Jk(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[c];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===c){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,c);const m=u+(s+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function Yk(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function Jk(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,c=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+c*c,v=f*f+d*d;return l*(c*v-g*d)-u*(A*v-g*f)+p*(A*d-c*f)<0}function e6(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*c)*f,p=(a*c-l*A)*f;return d*d+p*p}function t6(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*c)*f,p=n+(a*c-l*A)*f;return{x:d,y:p}}function pa(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;Gl(t,o,r),n[t[e]]>n[t[i]]&&Gl(t,e,i),n[t[r]]>n[t[i]]&&Gl(t,r,i),n[t[e]]>n[t[r]]&&Gl(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;Gl(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(pa(t,n,r,i),pa(t,n,e,a-1)):(pa(t,n,e,a-1),pa(t,n,r,i))}}function Gl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function n6(t){return t[0]}function i6(t){return t[1]}const SS=(t=0)=>new Promise(n=>setTimeout(n,t)),Jo=class Jo extends h.Destroyable{constructor(e,i){super();z(this,"_pickedEvent",this.disposeVar(new h.Event));z(this,"_startEvent",this.disposeVar(new h.Event));z(this,"_stopEvent",this.dv(new h.Event));z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_geoPolyline");z(this,"_customPrimitive");z(this,"_geoDivPoi");z(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Xe(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new yt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{zi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),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=`
3728
+ ***************************************************************************** */function _6(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=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(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Wr=(function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t})();function C6(t,n){return t>n?1:t<n?-1:0}function jr(t,n,e){for(var i=new Wr(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function jy(t,n,e,i){var o=new Wr(t,n);if(e===null)return o.left=o.right=null,o;e=jr(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function AS(t,n,e){var i=null,o=null;if(n){n=jr(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function S6(t,n,e){return n===null?t:(t===null||(n=jr(t.key,n,e),n.left=t),n)}function qy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
3729
+ `);var r=n+(e?" ":"│ ");t.left&&qy(t.left,r,!1,i,o),t.right&&qy(t.right,r,!0,i,o)}}var Ky=(function(){function t(n){n===void 0&&(n=C6),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=jy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Wr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=jr(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=jr(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=jr(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=jr(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=jr(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},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(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return P6(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Zy(n,e,0,o),this._size=o;else{var a=B6(this.toList(),E6(n,e),r);o=this._size+o,this._root=Xy({head:a},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(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=AS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=jy(e,i,s,o):a=jy(e,i,a,o),this._root=S6(a,s,o)},t.prototype.split=function(n){return AS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return _6(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function Zy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Wr(a,s);return l.left=Zy(t,n,e,r),l.right=Zy(t,n,r+1,i),l}return null}function E6(t,n){for(var e=new Wr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Wr(t[o],n[o]);return i.next=null,e.next}function P6(t){for(var n=t,e=[],i=!1,o=new Wr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Xy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Xy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Xy(t,o+1,e),a}return null}function B6(t,n,e){for(var i=new Wr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const Nl=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let qr=Number.EPSILON;qr===void 0&&(qr=Math.pow(2,-52));const T6=qr*qr,fS=(t,n)=>{if(-qr<t&&t<qr&&-qr<n&&n<qr)return 0;const e=t-n;return e*e<T6*t*n?0:t<n?-1:1};class I6{constructor(){this.reset()}reset(){this.xRounder=new pS,this.yRounder=new pS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class pS{constructor(){this.tree=new Ky,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&fS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&fS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Hl=new I6,cf=(t,n)=>t.x*n.y-t.y*n.x,dS=(t,n)=>t.x*n.x+t.y*n.y,mS=(t,n,e)=>{const i=kl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},hf=t=>Math.sqrt(dS(t,t)),F6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return cf(o,i)/hf(o)/hf(i)},M6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return dS(o,i)/hf(o)/hf(i)},gS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},yS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},D6=(t,n,e,i)=>{if(n.x===0)return yS(e,i,t.x);if(i.x===0)return yS(t,n,e.x);if(n.y===0)return gS(e,i,t.y);if(i.y===0)return gS(t,n,e.y);const o=cf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=cf(r,n)/o,s=cf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,c=e.y+a*i.y,f=(l+u)/2,d=(A+c)/2;return{x:f,y:d}};class Wn{static compare(n,e){const i=Wn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:Kr.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:F6(this.point,n.point,r.point),cosine:M6(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let R6=0;class Kr{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const c=n.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const c=e.comparePoint(n.leftSE.point);if(c!==0)return c;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const c=e.comparePoint(n.rightSE.point);if(c!==0)return c}if(r>a){const c=n.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(r!==a){const c=u-s,f=r-i,d=A-l,p=a-o;if(c>f&&d<p)return 1;if(c<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++R6,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Wn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Wn(o,!0),u=new Wn(r,!1);return new Kr(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=Nl(e,s)&&this.comparePoint(s)===0,A=Nl(i,r)&&n.comparePoint(r)===0,c=Nl(e,l)&&this.comparePoint(l)===0,f=Nl(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!c?a:!f&&c?l:null;if(A)return c&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&c)return null;if(f)return a;if(c)return l;const d=D6(r,this.vector(),s,n.vector());return d===null||!Nl(o,d)?null:Hl.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Wn(n,!0),r=new Wn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new Kr(o,a,this.rings.slice(),this.windings.slice());return Wn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Wn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=Kr.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.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 n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],c=e.indexOf(u);c===-1?(e.push(u),i.push(A)):i[c]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const c=r.indexOf(u.poly);c!==-1&&r.splice(c,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].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 n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(oi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===oi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${oi.type}`)}return this._isInResult}}class vS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Hl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Hl.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Kr.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Kr.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class U6{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new vS(n[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 i=1,o=n.length;i<o;i++){const r=new vS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class wS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}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 i=0,o=n.length;i<o;i++){const r=new U6(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Af{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,c=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=c.length;g<v;g++)if(c[g].point===s.point){d=g;break}if(d!==null){const g=c.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Af(v.reverse()));continue}c.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Af(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const c=this.events[u].point,f=this.events[u+1].point;mS(c,n,f)!==0&&(e.push(c),n=c)}if(e.length===1)return null;const i=e[0],o=e[1];mS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Wn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class bS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class O6{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new bS(r));else{const a=r.enclosingRing();a.poly||e.push(new bS(a)),a.poly.addInterior(r)}}return e}}class L6{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr.compare;this.queue=n,this.tree=new Ky(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.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 r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const c=s.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const c=l.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(A=c),!l.isAnEndpoint(c))){const f=this._splitSafely(l,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let c=null;u===null?c=A:A===null?c=u:c=Wn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const xS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,z6=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class k6{run(n,e,i){oi.type=n,Hl.reset();const o=[new wS(e,!0)];for(let c=0,f=i.length;c<f;c++)o.push(new wS(i[c],!1));if(oi.numMultiPolys=o.length,oi.type==="difference"){const c=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,c.bbox)!==null?f++:o.splice(f,1)}if(oi.type==="intersection")for(let c=0,f=o.length;c<f;c++){const d=o[c];for(let p=c+1,g=o.length;p<g;p++)if(Yy(d.bbox,o[p].bbox)===null)return[]}const r=new Ky(Wn.compare);for(let c=0,f=o.length;c<f;c++){const d=o[c].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>xS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new L6(r);let s=r.size,l=r.pop();for(;l;){const c=l.key;if(r.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>xS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>z6)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(c);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}Hl.reset();const u=Af.factory(a.segments);return new O6(u).getGeom()}}const oi=new k6;var Q6={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("difference",t,e)}};function ff(t,n,e){e===void 0&&(e={});var i=Pi(t),o=Pi(n),r=Q6.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?rn(r[0],e.properties):TL(r,e.properties)}function V6(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Bi([o,l],[a,l],e),c=A*(a-o),f=n*2/Bi([u,r],[u,s],e),d=f*(s-r),p=c/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),O=(m-I*v)/2,M=I*v-m>v/2;M&&(O-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var U=[],F=0;F<=B;F++)for(var D=0;D<=I;D++){var R=F%2===1;if(!(D===0&&R)&&!(D===0&&M)){var L=F*b+o-P,k=D*x+r+O;if(R&&(k-=v/2),e.triangles===!0)H6([L,k],c/2,d/2,JSON.parse(i),S,T).forEach(function(V){e.mask?ff(e.mask,V)&&U.push(V):U.push(V)});else{var Q=N6([L,k],c/2,d/2,JSON.parse(i),S,T);e.mask?ff(e.mask,Q)&&U.push(Q):U.push(Q)}}}return Si(U)}function N6(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),rn([a],i)}function H6(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(rn([l],i))}return a}function G6(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Bi([r,a],[s,a],i),A=u*(s-r),c=e/Bi([r,a],[r,l],i),f=c*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=rn([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?x6(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return Si(o)}function W6(t,n,e){return e===void 0&&(e={}),G6(t,n,n,e)}function j6(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Bi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Bi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,c=t[1];c<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)):l%2===0&&A%2===1?(f=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties)):A%2===0&&l%2===1?(f=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties),d=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties)):A%2===1&&l%2===1&&(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)),e.mask?(ff(e.mask,f)&&i.push(f),ff(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),c+=s,A++}l++,u+=r}return Si(i)}function q6(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(FL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=Ho(t),s;switch(i){case"point":case"points":s=k_(a,n,e);break;case"square":case"squares":s=W6(a,n,e);break;case"hex":case"hexes":s=V6(a,n,e);break;case"triangle":case"triangles":s=j6(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return nf(s,function(u){var A=0,c=0;nf(t,function(d){var p=i==="point"?u:pz(u),g=Bi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);c+=y,A+=y*v});var f=Az(u);f.properties[o]=A/c,l.push(f)}),Si(l)}function K6(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const _S=(t=0)=>new Promise(n=>setTimeout(n,t));function Z6(t,n){const e=Si(t.map(l=>Gr(l))),i=rn([t]);return q6(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>sn(Gr(l),i))}function X6(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ma(e)}function $6(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const dc=class dc extends Tn{constructor(e,i){super(e,i);z(this,"czmPointPrimitiveCollection");z(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Eo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(h.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],u=e.sampleDistance,A=Z6(l,u).map(b=>[...b,e.height]),c=Math.floor(e.extrudedHeight/u);if(c>0){const b=[...A];for(let x=1;x<=c;x++)A.push(...b.map(E=>[E[0],E[1],e.height+x*u]))}const{startTime:f,endTime:d,spanTime:p}=e,g=p*36e5,v=Math.floor((d-f)/g),y=Array(A.length).fill(0);e:for(let b=0;b<v;b++){if(await _S(),this._stopRun)break e;const x=new Date(f+b*g),E=X6(x);t:for(let B=0;B<A.length;B++){if(await _S(),this._stopRun)break t;K6(A[B],E,o.scene)||(y[B]=(y[B]*v+1)/v)}!this._stopRun&&(e.progress=Number(((b+1)/v*100).toFixed(2)))}const m=A.map((b,x)=>({position:[...b],color:$6(e.startColor,e.endColor,y[x]),pixelSize:10}));r.pointPrimitiveOptions=m},s=this.dv(h.createProcessingFromAsyncFunc(async l=>{await l.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};z(dc,"type",dc.register("ESCesiumViewer",h.ESSunshineAnalysis.type,dc));let Jy=dc;const CS=Math.pow(2,-52),pf=new Uint32Array(512);class ev{static from(n,e=nk,i=ik){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const S=n[2*M],T=n[2*M+1];S<s&&(s=S),T<l&&(l=T),S>u&&(u=S),T>A&&(A=T),this._ids[M]=M}const c=(s+u)/2,f=(l+A)/2;let d=1/0,p,g,v;for(let M=0;M<a;M++){const S=tv(c,f,n[2*M],n[2*M+1]);S<d&&(p=M,d=S)}const y=n[2*p],m=n[2*p+1];d=1/0;for(let M=0;M<a;M++){if(M===p)continue;const S=tv(y,m,n[2*M],n[2*M+1]);S<d&&S>0&&(g=M,d=S)}let b=n[2*g],x=n[2*g+1],E=1/0;for(let M=0;M<a;M++){if(M===p||M===g)continue;const S=ek(y,m,b,x,n[2*M],n[2*M+1]);S<E&&(v=M,E=S)}let B=n[2*v],P=n[2*v+1];if(E===1/0){for(let T=0;T<a;T++)this._dists[T]=n[2*T]-n[0]||n[2*T+1]-n[1];pa(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let S=0;for(let T=0,w=-1/0;T<a;T++){const C=this._ids[T];this._dists[C]>w&&(M[S++]=C,w=this._dists[C])}this.hull=M.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(kl(y,m,b,x,B,P)<0){const M=g,S=b,T=x;g=v,b=B,x=P,v=M,B=S,P=T}const I=tk(y,m,b,x,B,P);this._cx=I.x,this._cy=I.y;for(let M=0;M<a;M++)this._dists[M]=tv(n[2*M],n[2*M+1],I.x,I.y);pa(this._ids,this._dists,0,a-1),this._hullStart=p;let O=3;i[p]=e[v]=g,i[g]=e[p]=v,i[v]=e[g]=p,o[p]=0,o[g]=1,o[v]=2,r.fill(-1),r[this._hashKey(y,m)]=p,r[this._hashKey(b,x)]=g,r[this._hashKey(B,P)]=v,this.trianglesLen=0,this._addTriangle(p,g,v,-1,-1,-1);for(let M=0,S,T;M<this._ids.length;M++){const w=this._ids[M],C=n[2*w],U=n[2*w+1];if(M>0&&Math.abs(C-S)<=CS&&Math.abs(U-T)<=CS||(S=C,T=U,w===p||w===g||w===v))continue;let F=0;for(let Q=0,V=this._hashKey(C,U);Q<this._hashSize&&(F=r[(V+Q)%this._hashSize],!(F!==-1&&F!==i[F]));Q++);F=e[F];let D=F,R;for(;R=i[D],kl(C,U,n[2*D],n[2*D+1],n[2*R],n[2*R+1])>=0;)if(D=R,D===F){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,w,i[D],-1,-1,o[D]);o[w]=this._legalize(L+2),o[D]=L,O++;let k=i[D];for(;R=i[k],kl(C,U,n[2*k],n[2*k+1],n[2*R],n[2*R+1])<0;)L=this._addTriangle(k,w,R,o[w],-1,o[k]),o[w]=this._legalize(L+2),i[k]=k,O--,k=R;if(D===F)for(;R=e[D],kl(C,U,n[2*R],n[2*R+1],n[2*D],n[2*D+1])<0;)L=this._addTriangle(R,w,D,-1,o[D],o[R]),this._legalize(L+2),o[R]=L,i[D]=D,O--,D=R;this._hullStart=e[w]=D,i[D]=e[k]=w,i[w]=k,r[this._hashKey(C,U)]=w,r[this._hashKey(n[2*D],n[2*D+1])]=D}this.hull=new Uint32Array(O);for(let M=0,S=this._hullStart;M<O;M++)this.hull[M]=S,S=i[S];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(Y6(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=pf[--r];continue}const u=s-s%3,A=l+(n+1)%3,c=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[c];if(J6(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[c];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===c){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,c);const m=u+(s+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function Y6(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function J6(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,c=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+c*c,v=f*f+d*d;return l*(c*v-g*d)-u*(A*v-g*f)+p*(A*d-c*f)<0}function ek(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*c)*f,p=(a*c-l*A)*f;return d*d+p*p}function tk(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*c)*f,p=n+(a*c-l*A)*f;return{x:d,y:p}}function pa(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;Gl(t,o,r),n[t[e]]>n[t[i]]&&Gl(t,e,i),n[t[r]]>n[t[i]]&&Gl(t,r,i),n[t[e]]>n[t[r]]&&Gl(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;Gl(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(pa(t,n,r,i),pa(t,n,e,a-1)):(pa(t,n,e,a-1),pa(t,n,r,i))}}function Gl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function nk(t){return t[0]}function ik(t){return t[1]}const SS=(t=0)=>new Promise(n=>setTimeout(n,t)),Jo=class Jo extends h.Destroyable{constructor(e,i){super();z(this,"_pickedEvent",this.disposeVar(new h.Event));z(this,"_startEvent",this.disposeVar(new h.Event));z(this,"_stopEvent",this.dv(new h.Event));z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_geoPolyline");z(this,"_customPrimitive");z(this,"_geoDivPoi");z(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Xe(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new yt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{zi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),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=`
3730
3730
  uniform vec4 u_color;
3731
3731
  void main()
3732
3732
  {
@@ -3738,7 +3738,7 @@ void main()
3738
3738
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
3739
3739
  }
3740
3740
  `,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(h.track([this._customPrimitive,"show"],[this,"show"])),this.d(h.track([this._geoPolyline,"show"],[this,"show"])),this.d(h.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(h.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(h.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(u,A){const c=[];for(const f of A)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?c.push(`面积:${(u/1e6).toFixed(2)} km²`):c.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const d=u*(1/666.7);if(d>=15){const p=d/15;c.push(`面积:${p.toFixed(2)} 公顷`)}else c.push(`面积:${d.toFixed(2)} 亩`);break}return c};const a=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...r(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=fo([...u].join(`
3741
- `),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(h.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ox(this.positions):this._geoDivPoi.position=void 0)}));const s=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??Jo.defaults.interpolationDistance,A=this.interpolation??Jo.defaults.interpolation,c=this.offsetHeight??Jo.defaults.offsetHeight,f=this.drillDepth??Jo.defaults.drillDepth,d=[];if(this.positions)for(let L=0;L<this.positions.length;++L){const k=_.Cartesian3.fromDegrees(this.positions[L][0],this.positions[L][1],this.positions[L][2]);d.push(k)}var p=o6(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=s6(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=ES(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const L=a6(p,v);var x=ES(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(L,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=da(d,b),P=[],I=[],O=u6(B);if(A&&u>0){var M=l6(B);const L=Math.max(M.maxy-M.miny,M.maxx-M.minx);var S=f6(O,M,u);const k=await nv(S,m,b,p,o.scene,c,f,L);var T=p6(B,u);const Q=await nv(T,m,b,p,o.scene,c,f,L);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const G=B[V];var w=await nv([G],m,b,p,o.scene,c,f,L);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const $=[G.x,G.y,G.z+c];P.push($);var C=da([_.Cartesian3.fromArray($)],m);for(let Y=0;Y<C.length;++Y)I.push(C[Y])}}}else{const L=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+L]));P=L,I=da(L,m)}var U=c6(P,O);const F=h6(I,U);this.totalArea=F;const D=[];P.forEach(L=>{const k=[L.x,L.y,L.z];k&&D.push(...k)});const R={position:{typedArray:new Float32Array(D),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=R;const L=await r6([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(L),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(h.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};z(Jo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Go=Jo;(t=>{t.createDefaultProps=()=>({positions:h.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:h.reactArray([1,1,1,1]),units:h.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Go||(Go={})),h.extendClassProps(Go.prototype,Go.createDefaultProps);async function r6(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await SS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function o6(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function s6(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function ES(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function a6(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function l6(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function u6(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function c6(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=rn([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,c=(t[s].y+t[l].y+t[u].y)/3;sn([A,c],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function h6(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=A6(o)}return e}function A6(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function f6(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)m6([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function p6(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=d6(i,o,n);e.push(...r)}return e}function d6(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function m6(t,n){var e=Gr(t);if(!bk(Gr(n[0]),Gr(n[n.length-1])))return!1;var i=[];i.push(n);var o=rn(i);return sn(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],f=[],d=[];for(let b=0;b<u.length;++b){await SS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=da([y],e);m.forEach(x=>{x.z+=r}),y=da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:c,world_cartesian:d}}const mc=class mc extends Tn{constructor(e,i){super(e,i);z(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(h.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(h.track([r,"units"],[e,"units"])),this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([r,"positions"],[e,"points"])),this.d(h.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(h.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};z(mc,"type",mc.register("ESCesiumViewer",h.ESSurfaceAreaMeasurement.type,mc));let iv=mc;async function g6(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const gc=class gc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${h.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${h.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const c=document.createElement("span");A.appendChild(c),this.dispose(()=>A.removeChild(c));const f=document.createElement("span");c.appendChild(f),this.dispose(()=>c.removeChild(f));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),g6(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??h.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??h.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??h.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${h.ESViewerStatusBar.defaults.bgColor[0]},${h.ESViewerStatusBar.defaults.bgColor[1]},${h.ESViewerStatusBar.defaults.bgColor[2]},${h.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,O)=>b.position[I].toFixed(O),P=(I,O)=>b.rotation[I].toFixed(O);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};z(gc,"type",gc.register("ESCesiumViewer",h.ESViewerStatusBar.type,gc));let rv=gc;const yc=class yc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(h.track([r,"show"],[e,"show"])),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const c=document.createElement("div");A.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const f=document.createElement("div");c.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{c.style.height=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{c.style.fontSize=(e.fontSize??h.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${h.ESViewerStatusBarScale.defaults.bgColor[0]},${h.ESViewerStatusBarScale.defaults.bgColor[1]},${h.ESViewerStatusBarScale.defaults.bgColor[2]},${h.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const O=i.viewerLegend.legend.computedLengthInStr;O&&(y.innerHTML=O);const M=i.viewerLegend.legend.computedLengthInPixels;if(M){m.style.width=`${M}px`;const S=(135-M)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const O=()=>{e.show?(A.style.display="block",I=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var w;let M="";const S=u.getCameraInfo();if(S){const C=(U,F)=>S.position[U].toFixed(F);M+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(U,F)=>T[U].toFixed(F);M+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else M+="暂时无法获取鼠标位置...";b.innerText=M})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(O)),O()}}}}get customDiv(){return this._customDiv}};z(yc,"type",yc.register("ESCesiumViewer",h.ESViewerStatusBarScale.type,yc));let ov=yc;const PS=_.Math.toDegrees,y6=new _.Cartographic;function BS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,y6);return[PS(d.longitude),PS(d.latitude),d.height]}const vc=class vc extends Jt{constructor(e,i){super(e,i);z(this,"_hideGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));z(this,"_visibleGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([a,"show"],[e,"show"])),this.d(h.track([a,"color"],[e,"visibleColor"])),this.d(h.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const c=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=BS(v,y,o.scene);b?(c.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=c,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};z(vc,"type",vc.register("ESCesiumViewer",h.ESVisibilityAnalysis.type,vc));let sv=vc;class Wl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.dv(new h.Event));z(this,"_enableEvent",this.dv(new h.Event));z(this,"_clearEvent",this.dv(new h.Event));z(this,"_gridPoints",this.dv(h.reactJson([])));z(this,"excavationPolylines");z(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Pn(e,i)),a=this.dv(new Pn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(h.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(h.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new _i(e,i));this.d(h.track([d,"show"],[this,"show"])),this.d(h.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(h.bind([d,"positions"],[this,"positions"])),this.d(h.bind([d,"depthTest"],[this,"depthTest"])),this.d(h.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(h.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(h.bind([d,"outline"],[this,"outline"])),this.d(h.bind([d,"color"],[this,"fillColor"])),this.d(h.bind([d,"fill"],[this,"filled"])),this.d(h.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(h.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(h.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=h.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,O=k_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),M=_.Math.toRadians;return O.map(T=>new _.Cartographic(M(T[0]),M(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},c=this.dv(h.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Ux(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:h.reactPositions(void 0),planeHeight:h.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})})(Wl||(Wl={})),h.extendClassProps(Wl.prototype,Wl.createDefaultProps);const wc=class wc extends Tn{constructor(e,i){super(e,i);z(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Wl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(h.track([r,"show"],[e,"show"])),this.d(h.bind([r,"positions"],[e,"points"])),this.d(h.track([r,"allowPicking"],[e,"allowPicking"])),this.d(h.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(h.track([r,"gridWidth"],[e,"gridWidth"])),this.d(h.track([e,"cutVolume"],[r,"cutVolume"])),this.d(h.track([e,"fillVolume"],[r,"fillVolume"])),this.d(h.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(h.bind([e,"progress"],[r,"progress"])),this.d(h.track([r,"depthTest"],[e,"depthTest"])),this.d(h.track([r,"outline"],[e,"stroked"])),this.d(h.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(h.track([r,"outlineColor"],[e,"strokeColor"])),this.d(h.track([r,"filled"],[e,"filled"])),this.d(h.track([r,"fillColor"],[e,"fillColor"])),this.d(h.track([r,"fillGround"],[e,"fillGround"])),this.d(h.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(h.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(wc,"type",wc.register("ESCesiumViewer",h.ESVolumeMeasurement.type,wc));let av=wc;const bc=class bc extends Tn{constructor(e,i){super(e,i);z(this,"czmEntity");z(this,"czmPolyline",this.ad(new h.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(h.bind([r,"show"],[e,"show"])),this.ad(h.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(h.bind([r,"stroked"],[e,"stroked"])),this.ad(h.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(h.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(h.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(f=>(f[2]=e.height??h.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=Wt(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??h.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??h.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new h.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new rt.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=h.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};z(bc,"type",bc.register("ESCesiumViewer",h.ESGeoExtrudedPolygon.type,bc));let lv=bc;const xc=class xc extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(h.bind([o,"position"],[n,"position"])),this.dispose(h.bind([o,"rotation"],[n,"rotation"])),this.ad(h.bind([o,"scale"],[n,"scale"])),this.ad(h.track([r,"scale"],[n,"scale"])),this.dispose(h.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(h.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};z(xc,"type",xc.register("ESCesiumViewer",h.ESHumanPoi.type,xc));let uv=xc;const _c=class _c extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,c,f,d;const u=(d=(f=(c=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:c._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let c;l!=="HIGHLIGHT"?c=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):c=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",c),o.style=c};r();const a=this.dv(h.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};z(_c,"type",_c.register("ESCesiumViewer",h.ESRtsTileset.type,_c));let cv=_c;const Cc=class Cc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Cc,"type",Cc.register("ESCesiumViewer",h.ESRtsFeatureEditing.type,Cc));let hv=Cc;const Sc=class Sc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Sc,"type",Sc.register("ESCesiumViewer",h.ESMsTileset.type,Sc));let Av=Sc;const Ec=class Ec extends He{constructor(e,i){super(e,i);z(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(h.track([r,"show"],[e,"show"])),this.dispose(h.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};z(Ec,"type",Ec.register("ESCesiumViewer",h.ESStaticMesh.type,Ec));let fv=Ec;const Pc=class Pc extends Jt{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:h.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};z(Pc,"type",Pc.register("ESCesiumViewer",h.ESSkylineAnalysis.type,Pc));let pv=Pc;class v6 extends h.Destroyable{constructor(e,i){super();z(this,"_rectangle");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));const o=e.sceneObject;this._rectangle=this.ad(new mi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(h.bind([this.rectangle,"show"],[o,"show"])),this.ad(h.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class w6 extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));z(this,"czmViewer");z(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new h.Event),c=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(h.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(c))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=h.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
3741
+ `),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(h.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ox(this.positions):this._geoDivPoi.position=void 0)}));const s=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??Jo.defaults.interpolationDistance,A=this.interpolation??Jo.defaults.interpolation,c=this.offsetHeight??Jo.defaults.offsetHeight,f=this.drillDepth??Jo.defaults.drillDepth,d=[];if(this.positions)for(let L=0;L<this.positions.length;++L){const k=_.Cartesian3.fromDegrees(this.positions[L][0],this.positions[L][1],this.positions[L][2]);d.push(k)}var p=ok(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=sk(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=ES(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const L=ak(p,v);var x=ES(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(L,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=da(d,b),P=[],I=[],O=uk(B);if(A&&u>0){var M=lk(B);const L=Math.max(M.maxy-M.miny,M.maxx-M.minx);var S=fk(O,M,u);const k=await nv(S,m,b,p,o.scene,c,f,L);var T=pk(B,u);const Q=await nv(T,m,b,p,o.scene,c,f,L);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const G=B[V];var w=await nv([G],m,b,p,o.scene,c,f,L);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const $=[G.x,G.y,G.z+c];P.push($);var C=da([_.Cartesian3.fromArray($)],m);for(let Y=0;Y<C.length;++Y)I.push(C[Y])}}}else{const L=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+L]));P=L,I=da(L,m)}var U=ck(P,O);const F=hk(I,U);this.totalArea=F;const D=[];P.forEach(L=>{const k=[L.x,L.y,L.z];k&&D.push(...k)});const R={position:{typedArray:new Float32Array(D),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=R;const L=await rk([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(L),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(h.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};z(Jo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Go=Jo;(t=>{t.createDefaultProps=()=>({positions:h.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:h.reactArray([1,1,1,1]),units:h.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Go||(Go={})),h.extendClassProps(Go.prototype,Go.createDefaultProps);async function rk(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await SS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function ok(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function sk(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function ES(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function ak(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function lk(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function uk(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function ck(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=rn([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,c=(t[s].y+t[l].y+t[u].y)/3;sn([A,c],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function hk(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=Ak(o)}return e}function Ak(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function fk(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)mk([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function pk(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=dk(i,o,n);e.push(...r)}return e}function dk(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function mk(t,n){var e=Gr(t);if(!b6(Gr(n[0]),Gr(n[n.length-1])))return!1;var i=[];i.push(n);var o=rn(i);return sn(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],f=[],d=[];for(let b=0;b<u.length;++b){await SS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=da([y],e);m.forEach(x=>{x.z+=r}),y=da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:c,world_cartesian:d}}const mc=class mc extends Tn{constructor(e,i){super(e,i);z(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(h.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(h.track([r,"units"],[e,"units"])),this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([r,"positions"],[e,"points"])),this.d(h.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(h.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};z(mc,"type",mc.register("ESCesiumViewer",h.ESSurfaceAreaMeasurement.type,mc));let iv=mc;async function gk(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const gc=class gc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${h.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${h.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const c=document.createElement("span");A.appendChild(c),this.dispose(()=>A.removeChild(c));const f=document.createElement("span");c.appendChild(f),this.dispose(()=>c.removeChild(f));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),gk(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??h.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??h.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??h.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${h.ESViewerStatusBar.defaults.bgColor[0]},${h.ESViewerStatusBar.defaults.bgColor[1]},${h.ESViewerStatusBar.defaults.bgColor[2]},${h.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,O)=>b.position[I].toFixed(O),P=(I,O)=>b.rotation[I].toFixed(O);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};z(gc,"type",gc.register("ESCesiumViewer",h.ESViewerStatusBar.type,gc));let rv=gc;const yc=class yc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(h.track([r,"show"],[e,"show"])),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const c=document.createElement("div");A.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const f=document.createElement("div");c.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{c.style.height=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{c.style.fontSize=(e.fontSize??h.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${h.ESViewerStatusBarScale.defaults.bgColor[0]},${h.ESViewerStatusBarScale.defaults.bgColor[1]},${h.ESViewerStatusBarScale.defaults.bgColor[2]},${h.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const O=i.viewerLegend.legend.computedLengthInStr;O&&(y.innerHTML=O);const M=i.viewerLegend.legend.computedLengthInPixels;if(M){m.style.width=`${M}px`;const S=(135-M)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const O=()=>{e.show?(A.style.display="block",I=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var w;let M="";const S=u.getCameraInfo();if(S){const C=(U,F)=>S.position[U].toFixed(F);M+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(U,F)=>T[U].toFixed(F);M+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else M+="暂时无法获取鼠标位置...";b.innerText=M})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(O)),O()}}}}get customDiv(){return this._customDiv}};z(yc,"type",yc.register("ESCesiumViewer",h.ESViewerStatusBarScale.type,yc));let ov=yc;const PS=_.Math.toDegrees,yk=new _.Cartographic;function BS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,yk);return[PS(d.longitude),PS(d.latitude),d.height]}const vc=class vc extends Jt{constructor(e,i){super(e,i);z(this,"_hideGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));z(this,"_visibleGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([a,"show"],[e,"show"])),this.d(h.track([a,"color"],[e,"visibleColor"])),this.d(h.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const c=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=BS(v,y,o.scene);b?(c.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=c,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};z(vc,"type",vc.register("ESCesiumViewer",h.ESVisibilityAnalysis.type,vc));let sv=vc;class Wl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.dv(new h.Event));z(this,"_enableEvent",this.dv(new h.Event));z(this,"_clearEvent",this.dv(new h.Event));z(this,"_gridPoints",this.dv(h.reactJson([])));z(this,"excavationPolylines");z(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Pn(e,i)),a=this.dv(new Pn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(h.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(h.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new _i(e,i));this.d(h.track([d,"show"],[this,"show"])),this.d(h.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(h.bind([d,"positions"],[this,"positions"])),this.d(h.bind([d,"depthTest"],[this,"depthTest"])),this.d(h.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(h.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(h.bind([d,"outline"],[this,"outline"])),this.d(h.bind([d,"color"],[this,"fillColor"])),this.d(h.bind([d,"fill"],[this,"filled"])),this.d(h.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(h.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(h.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=h.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,O=k_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),M=_.Math.toRadians;return O.map(T=>new _.Cartographic(M(T[0]),M(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},c=this.dv(h.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Ux(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:h.reactPositions(void 0),planeHeight:h.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})})(Wl||(Wl={})),h.extendClassProps(Wl.prototype,Wl.createDefaultProps);const wc=class wc extends Tn{constructor(e,i){super(e,i);z(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Wl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(h.track([r,"show"],[e,"show"])),this.d(h.bind([r,"positions"],[e,"points"])),this.d(h.track([r,"allowPicking"],[e,"allowPicking"])),this.d(h.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(h.track([r,"gridWidth"],[e,"gridWidth"])),this.d(h.track([e,"cutVolume"],[r,"cutVolume"])),this.d(h.track([e,"fillVolume"],[r,"fillVolume"])),this.d(h.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(h.bind([e,"progress"],[r,"progress"])),this.d(h.track([r,"depthTest"],[e,"depthTest"])),this.d(h.track([r,"outline"],[e,"stroked"])),this.d(h.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(h.track([r,"outlineColor"],[e,"strokeColor"])),this.d(h.track([r,"filled"],[e,"filled"])),this.d(h.track([r,"fillColor"],[e,"fillColor"])),this.d(h.track([r,"fillGround"],[e,"fillGround"])),this.d(h.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(h.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(wc,"type",wc.register("ESCesiumViewer",h.ESVolumeMeasurement.type,wc));let av=wc;const bc=class bc extends Tn{constructor(e,i){super(e,i);z(this,"czmEntity");z(this,"czmPolyline",this.ad(new h.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(h.bind([r,"show"],[e,"show"])),this.ad(h.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(h.bind([r,"stroked"],[e,"stroked"])),this.ad(h.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(h.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(h.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(f=>(f[2]=e.height??h.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=Wt(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??h.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??h.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new h.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new rt.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=h.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};z(bc,"type",bc.register("ESCesiumViewer",h.ESGeoExtrudedPolygon.type,bc));let lv=bc;const xc=class xc extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(h.bind([o,"position"],[n,"position"])),this.dispose(h.bind([o,"rotation"],[n,"rotation"])),this.ad(h.bind([o,"scale"],[n,"scale"])),this.ad(h.track([r,"scale"],[n,"scale"])),this.dispose(h.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(h.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};z(xc,"type",xc.register("ESCesiumViewer",h.ESHumanPoi.type,xc));let uv=xc;const _c=class _c extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,c,f,d;const u=(d=(f=(c=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:c._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let c;l!=="HIGHLIGHT"?c=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):c=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",c),o.style=c};r();const a=this.dv(h.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};z(_c,"type",_c.register("ESCesiumViewer",h.ESRtsTileset.type,_c));let cv=_c;const Cc=class Cc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Cc,"type",Cc.register("ESCesiumViewer",h.ESRtsFeatureEditing.type,Cc));let hv=Cc;const Sc=class Sc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Sc,"type",Sc.register("ESCesiumViewer",h.ESMsTileset.type,Sc));let Av=Sc;const Ec=class Ec extends He{constructor(e,i){super(e,i);z(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(h.track([r,"show"],[e,"show"])),this.dispose(h.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};z(Ec,"type",Ec.register("ESCesiumViewer",h.ESStaticMesh.type,Ec));let fv=Ec;const Pc=class Pc extends Jt{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:h.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};z(Pc,"type",Pc.register("ESCesiumViewer",h.ESSkylineAnalysis.type,Pc));let pv=Pc;class vk extends h.Destroyable{constructor(e,i){super();z(this,"_rectangle");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));const o=e.sceneObject;this._rectangle=this.ad(new mi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(h.bind([this.rectangle,"show"],[o,"show"])),this.ad(h.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class wk extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));z(this,"czmViewer");z(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new h.Event),c=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(h.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(c))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=h.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
3742
3742
  in vec3 position3DHigh;
3743
3743
  in vec3 position3DLow;
3744
3744
  in vec3 normal;
@@ -3761,7 +3761,7 @@ void main()
3761
3761
  p += vec4(color.a * upDir * ${e??1e3}, 0.0);
3762
3762
 
3763
3763
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
3764
- }`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,c=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+c*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const bn={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class b6{constructor(n){z(this,"_coordinator");z(this,"_data");z(this,"_radi");z(this,"_min");z(this,"_max");z(this,"_xField");z(this,"_yField");z(this,"_valueField");z(this,"_cfgRadius");this._coordinator=new TS,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||bn.defaultXField,this._yField=n.yField||n.defaultYField||bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class x6{constructor(n){z(this,"shadowCanvas");z(this,"canvas");z(this,"_renderBoundaries");z(this,"_width");z(this,"_height");z(this,"shadowCtx");z(this,"ctx");z(this,"_palette");z(this,"_templates");z(this,"_blur",bn.defaultBlur);z(this,"_opacity",0);z(this,"_maxOpacity",bn.defaultMaxOpacity*255);z(this,"_minOpacity",bn.defaultMinOpacity*255);z(this,"_useGradientOpacity",!1);z(this,"_min",0);z(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class TS{constructor(){z(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class _6{constructor(n={}){z(this,"_config");z(this,"_coordinator");z(this,"_renderer");z(this,"_store");if(this._config={...bn,...n},this._coordinator=new TS,this._config.plugin){const e=bn.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new x6(this._config),this._store=new b6(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const C6=t=>new _6(t),Bc=class Bc extends Un{constructor(e,i){super(e,i);z(this,"_heatmap");z(this,"_div");z(this,"_primitiveObj");z(this,"_rectangle",this.disposeVar(h.react(void 0)));z(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new h.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new w6(this,i):new v6(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=C6({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new h.Event);let s=[],l={max:100,min:0};{const u=()=>{const c={radius:e.radius??h.ESHeatMap.defaults.radius,gradient:e.gradient??h.ESHeatMap.defaults.gradient,blur:e.blur??h.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(c),this.heatmap._store._cfgRadius=c.radius,a.emit()};u();const A=this.ad(h.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:c,minPos:f}=h.getMinMaxCorner(e.data),d=c[0]-f[0],p=c[1]-f[1];if(l={max:c[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??h.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??h.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,c[0]+y,c[1]+m],s=S6(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};z(Bc,"type",Bc.register("ESCesiumViewer",h.ESHeatMap.type,Bc));let dv=Bc;function S6(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const Tc=class Tc extends Jt{constructor(e,i){super(e,i);z(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Eo(i,e.id)),this._updateShow();const r=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??h.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??h.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??h.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??h.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};z(Tc,"type",Tc.register("ESCesiumViewer",h.ESGeoPoints.type,Tc));let mv=Tc;const es=class es extends _n{constructor(e){super();z(this,"_config",this.disposeVar(h.react(es.defaultConfig)));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_pointerEventFilterFunc",this.disposeVar(h.react(es.defaultPointerEventFilterFunc)));z(this,"point");z(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new h.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new E6(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new zn(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};z(es,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),z(es,"defaultPointerEventFilterFunc",e=>e.button===0),z(es,"defaults",{..._n.defaults,position:[116.39,39.9,0]});let Fi=es;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Fi||(Fi={})),h.extendClassProps(Fi.prototype,Fi.createDefaultProps);class E6 extends h.Destroyable{constructor(e,i){super();z(this,"_doings",[]);z(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new P6(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class P6 extends h.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=h.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Fn extends _n{constructor(){super()}}z(Fn,"defaults",{..._n.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0)})})(Fn||(Fn={})),h.extendClassProps(Fn.prototype,Fn.createDefaultProps);function gv(t,n){const e=new Xe(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Zn=class Zn extends h.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,Zn.defaults.xAxisColor)),i=this.disposeVar(gv(n,Zn.defaults.yAxisColor)),o=this.disposeVar(gv(n,Zn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(h.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=Zn.defaults.position,heading:l=Zn.defaults.heading}=this,[u,A,c]=s,{dimensions:f=Zn.defaults.dimensions}=this;o.positions=[s,[u,A,c+f[2]]];const d=h.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=h.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Zn.defaults.xAxisColor,i.color=this.yAxisColor??Zn.defaults.yAxisColor,o.color=this.zAxisColor??Zn.defaults.zAxisColor};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};z(Zn,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Zr=Zn;(t=>{t.createDefaultProps=()=>({show:!0,position:h.reactArrayWithUndefined(void 0),heading:0,dimensions:h.reactArray([1e3,1e3,1e3]),xAxisColor:h.reactArray([1,0,0,1]),yAxisColor:h.reactArray([0,1,0,1]),zAxisColor:h.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Zr||(Zr={})),h.extendClassProps(Zr.prototype,Zr.createDefaultProps);const no=class no extends Fn{constructor(e){super();z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.ad(h.react("none")),originPosition:this.disposeVar(h.reactArray(Fn.defaults.position)),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_createCoordinates",e=>{const i=this.ad(new Zr(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{IS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??no.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});z(this,"_createOriginCoordinates",e=>{const i=this.ad(new Zr(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});z(this,"_createGrid",e=>{const i=this.ad(new Jn(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s+90);if(c){const f=h.geoRhumbDestination(c,l,s+180),d=h.geoRhumbDestination(c,l,s);f&&d&&u.push([f,c,d])}}for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s);if(c){const f=h.geoRhumbDestination(c,l,s-90),d=h.geoRhumbDestination(c,l,s+90);f&&d&&u.push([f,c,d])}}i.positions=u};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});z(this,"_createHelpLine",e=>{const i=this.ad(new Xe(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});z(this,"_createCircle",e=>{const i=this.ad(new Jn(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const c=h.geoRhumbDestination(a,s,A*360/u);c&&l.push(c)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});z(this,"_pickingXYProcessing",e=>this.ad(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));z(this,"_pickingZProcessing",e=>this.ad(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));z(this,"_pickingZAxisProcessing",e=>this.ad(new h.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!ss(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;rs(o,i);const s=h.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=h.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(h.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Wf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,a)=>r===this._opInfo.targetPosition.value[a])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(h.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(h.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],IS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),c=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??no.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??no.defaults.position,heading:o.heading??no.defaults.heading,dimensions:o.dimensions??no.defaults.dimensions};e.viewer&&Df(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(h.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await h.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(c.restart(),x.disposer.dispose(()=>c.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};z(no,"defaults",{...Fn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let er=no;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(er||(er={})),h.extendClassProps(er.prototype,er.createDefaultProps);function IS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class yv extends h.HasOwner{constructor(e){super(e);z(this,"_valid",!1);z(this,"_normal",new _.Cartesian3(0,0,0));z(this,"_origin",new _.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const i=this.owner.cartesian,o=$n(e);return r0(this.scene,i,this.normal,o)}}class B6 extends yv{constructor(n){super(n);{const e=()=>{const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const i=this.ad(h.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class T6 extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class I6 extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class ma extends h.Destroyable{constructor(e){super();z(this,"_czmTexture");z(this,"_customPrimitiveForCircle");z(this,"_circleCanvas");z(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ct(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let i=this.disposeVar(h.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,c=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=c,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(h.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=ot({rotation:this.selfRotation});if(!s)return;const l=ot({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(h.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(F6(e)),this.dispose(h.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(h.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(h.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(h.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(M6(e)),this.dispose(h.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([this._debugAxis,"position"],[this,"position"])),this.dispose(h.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(h.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}z(ma,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,color:h.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(ma||(ma={})),h.extendClassProps(ma.prototype,ma.createDefaultProps);function F6(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},st,t)}function M6(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
3764
+ }`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,c=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+c*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const bn={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class bk{constructor(n){z(this,"_coordinator");z(this,"_data");z(this,"_radi");z(this,"_min");z(this,"_max");z(this,"_xField");z(this,"_yField");z(this,"_valueField");z(this,"_cfgRadius");this._coordinator=new TS,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||bn.defaultXField,this._yField=n.yField||n.defaultYField||bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class xk{constructor(n){z(this,"shadowCanvas");z(this,"canvas");z(this,"_renderBoundaries");z(this,"_width");z(this,"_height");z(this,"shadowCtx");z(this,"ctx");z(this,"_palette");z(this,"_templates");z(this,"_blur",bn.defaultBlur);z(this,"_opacity",0);z(this,"_maxOpacity",bn.defaultMaxOpacity*255);z(this,"_minOpacity",bn.defaultMinOpacity*255);z(this,"_useGradientOpacity",!1);z(this,"_min",0);z(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class TS{constructor(){z(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class _k{constructor(n={}){z(this,"_config");z(this,"_coordinator");z(this,"_renderer");z(this,"_store");if(this._config={...bn,...n},this._coordinator=new TS,this._config.plugin){const e=bn.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new xk(this._config),this._store=new bk(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const Ck=t=>new _k(t),Bc=class Bc extends Un{constructor(e,i){super(e,i);z(this,"_heatmap");z(this,"_div");z(this,"_primitiveObj");z(this,"_rectangle",this.disposeVar(h.react(void 0)));z(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new h.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new wk(this,i):new vk(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=Ck({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new h.Event);let s=[],l={max:100,min:0};{const u=()=>{const c={radius:e.radius??h.ESHeatMap.defaults.radius,gradient:e.gradient??h.ESHeatMap.defaults.gradient,blur:e.blur??h.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(c),this.heatmap._store._cfgRadius=c.radius,a.emit()};u();const A=this.ad(h.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:c,minPos:f}=h.getMinMaxCorner(e.data),d=c[0]-f[0],p=c[1]-f[1];if(l={max:c[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??h.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??h.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,c[0]+y,c[1]+m],s=Sk(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};z(Bc,"type",Bc.register("ESCesiumViewer",h.ESHeatMap.type,Bc));let dv=Bc;function Sk(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const Tc=class Tc extends Jt{constructor(e,i){super(e,i);z(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Eo(i,e.id)),this._updateShow();const r=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??h.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??h.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??h.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??h.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};z(Tc,"type",Tc.register("ESCesiumViewer",h.ESGeoPoints.type,Tc));let mv=Tc;const es=class es extends _n{constructor(e){super();z(this,"_config",this.disposeVar(h.react(es.defaultConfig)));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_pointerEventFilterFunc",this.disposeVar(h.react(es.defaultPointerEventFilterFunc)));z(this,"point");z(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new h.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new Ek(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new zn(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};z(es,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),z(es,"defaultPointerEventFilterFunc",e=>e.button===0),z(es,"defaults",{..._n.defaults,position:[116.39,39.9,0]});let Fi=es;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Fi||(Fi={})),h.extendClassProps(Fi.prototype,Fi.createDefaultProps);class Ek extends h.Destroyable{constructor(e,i){super();z(this,"_doings",[]);z(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new Pk(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class Pk extends h.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=h.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Fn extends _n{constructor(){super()}}z(Fn,"defaults",{..._n.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0)})})(Fn||(Fn={})),h.extendClassProps(Fn.prototype,Fn.createDefaultProps);function gv(t,n){const e=new Xe(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Zn=class Zn extends h.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,Zn.defaults.xAxisColor)),i=this.disposeVar(gv(n,Zn.defaults.yAxisColor)),o=this.disposeVar(gv(n,Zn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(h.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=Zn.defaults.position,heading:l=Zn.defaults.heading}=this,[u,A,c]=s,{dimensions:f=Zn.defaults.dimensions}=this;o.positions=[s,[u,A,c+f[2]]];const d=h.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=h.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Zn.defaults.xAxisColor,i.color=this.yAxisColor??Zn.defaults.yAxisColor,o.color=this.zAxisColor??Zn.defaults.zAxisColor};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};z(Zn,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Zr=Zn;(t=>{t.createDefaultProps=()=>({show:!0,position:h.reactArrayWithUndefined(void 0),heading:0,dimensions:h.reactArray([1e3,1e3,1e3]),xAxisColor:h.reactArray([1,0,0,1]),yAxisColor:h.reactArray([0,1,0,1]),zAxisColor:h.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Zr||(Zr={})),h.extendClassProps(Zr.prototype,Zr.createDefaultProps);const no=class no extends Fn{constructor(e){super();z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.ad(h.react("none")),originPosition:this.disposeVar(h.reactArray(Fn.defaults.position)),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_createCoordinates",e=>{const i=this.ad(new Zr(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{IS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??no.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});z(this,"_createOriginCoordinates",e=>{const i=this.ad(new Zr(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});z(this,"_createGrid",e=>{const i=this.ad(new Jn(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s+90);if(c){const f=h.geoRhumbDestination(c,l,s+180),d=h.geoRhumbDestination(c,l,s);f&&d&&u.push([f,c,d])}}for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s);if(c){const f=h.geoRhumbDestination(c,l,s-90),d=h.geoRhumbDestination(c,l,s+90);f&&d&&u.push([f,c,d])}}i.positions=u};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});z(this,"_createHelpLine",e=>{const i=this.ad(new Xe(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});z(this,"_createCircle",e=>{const i=this.ad(new Jn(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const c=h.geoRhumbDestination(a,s,A*360/u);c&&l.push(c)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});z(this,"_pickingXYProcessing",e=>this.ad(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));z(this,"_pickingZProcessing",e=>this.ad(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));z(this,"_pickingZAxisProcessing",e=>this.ad(new h.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!ss(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;rs(o,i);const s=h.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=h.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(h.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Wf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,a)=>r===this._opInfo.targetPosition.value[a])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(h.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(h.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],IS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),c=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??no.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??no.defaults.position,heading:o.heading??no.defaults.heading,dimensions:o.dimensions??no.defaults.dimensions};e.viewer&&Df(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(h.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await h.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(c.restart(),x.disposer.dispose(()=>c.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};z(no,"defaults",{...Fn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let er=no;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(er||(er={})),h.extendClassProps(er.prototype,er.createDefaultProps);function IS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class yv extends h.HasOwner{constructor(e){super(e);z(this,"_valid",!1);z(this,"_normal",new _.Cartesian3(0,0,0));z(this,"_origin",new _.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const i=this.owner.cartesian,o=$n(e);return r0(this.scene,i,this.normal,o)}}class Bk extends yv{constructor(n){super(n);{const e=()=>{const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const i=this.ad(h.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class Tk extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class Ik extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class ma extends h.Destroyable{constructor(e){super();z(this,"_czmTexture");z(this,"_customPrimitiveForCircle");z(this,"_circleCanvas");z(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ct(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let i=this.disposeVar(h.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,c=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=c,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(h.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=ot({rotation:this.selfRotation});if(!s)return;const l=ot({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(h.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(Fk(e)),this.dispose(h.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(h.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(h.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(h.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(Mk(e)),this.dispose(h.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([this._debugAxis,"position"],[this,"position"])),this.dispose(h.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(h.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}z(ma,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,color:h.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(ma||(ma={})),h.extendClassProps(ma.prototype,ma.createDefaultProps);function Fk(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},st,t)}function Mk(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
3765
3765
  void main()
3766
3766
  {
3767
3767
  // 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
@@ -3772,7 +3772,7 @@ void main()
3772
3772
  {
3773
3773
  out_FragColor = u_color;
3774
3774
  }
3775
- `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class D6 extends h.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[si.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(h.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const c=A.pick(l);if(!c||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(c,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=vv(f,d,A.normal),g=vv(A.origin,f,A.normal),v=vv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await h.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,c=A*3/128;if(!(u>=A-c&&u<=A+c))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[si.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Oi(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ts=class ts extends Fn{constructor(e){super();z(this,"_hoveredPlaneType",this.disposeVar(h.react("none")));z(this,"_movingPlaneType",this.disposeVar(h.react("none")));z(this,"_circles");z(this,"_czmCameraModel");z(this,"_cartesian");z(this,"_planes",{heading:this.disposeVar(new B6(this)),pitch:this.disposeVar(new T6(this)),roll:this.disposeVar(new I6(this))});z(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new D6(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&At(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new kt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(h.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(h.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(h.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ot({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ma(e));this.dispose(h.track([o,"position"],[this,"position"])),this.dispose(h.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([o,"debug"],[this,"debug"])),this.dispose(h.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ts.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ts.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ts.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};z(ts,"rotationNum",{heading:0,pitch:1,roll:2}),z(ts,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=ts;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),h.extendClassProps(si.prototype,si.createDefaultProps);const ns=class ns extends h.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ns.defaults.positions[0],this.stopPosition??ns.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ns.defaults.positions[0],n??ns.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Xe(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(h.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(h.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};z(ns,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=ns;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:h.reactPositions(t.defaults.positions),width:10,color:h.reactArray([1,0,0,1])})})(Wo||(Wo={})),h.extendClassProps(Wo.prototype,Wo.createDefaultProps);class tr extends Fn{constructor(e){super();z(this,"_lastPosition");z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.disposeVar(h.react("none")),originPosition:this.disposeVar(h.reactArray([0,0,0])),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_scaleAxis");z(this,"_pickingXYProcessing",e=>this.disposeVar(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let c=this.scale[0],f=this.scale[1];const d=h.geoDistance(A,this._opInfo.originPosition.value)-h.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?c+=p:c-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),c<=0&&(c+=p),f<=0&&(f+=p),this.scale=[c??1,f??1,this.scale[2]??1]})})));z(this,"_pickingZProcessing",e=>this.disposeVar(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Wf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=tr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[c,f,d]=s;l.stopPosition=[c,f,d+this._opInfo.originDimensions.value[2]];const p=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(h.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??tr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(h.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await h.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),c=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};c(),this.dispose(this.enabledChanged.disposableOn(c))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Wo(e));return o.width=10,this.ad(h.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),scale:h.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(tr||(tr={})),h.extendClassProps(tr.prototype,tr.createDefaultProps);const io=class io extends _n{constructor(e){super();z(this,"_editingPoints",this.disposeVar(new h.ObservableArray));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_currentProcess");z(this,"_menuPoiEnabled",this.disposeVar(h.react(!1)));z(this,"_status",this.disposeVar(h.react("None")));z(this,"_positionsChanged",this.ad(new h.Event));z(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??io.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??io.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Xe(e));this.ad(h.track([i,"color"],[this,"polylineColor"])),this.ad(h.track([i,"width"],[this,"polylineWidth"])),this.ad(h.track([i,"show"],[this,"polylineShow"])),this.ad(h.track([i,"arcType"],[this,"polylineArcType"])),this.ad(h.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new h.CursorInfo(e.container,h.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};z(io,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),z(io,"defaults",{..._n.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:io.baseImageUrl+"point-green.png",otherControlPointImageUrl:io.baseImageUrl+"point-yellow.png"});let jn=io;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:h.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(jn||(jn={})),h.extendClassProps(jn.prototype,jn.createDefaultProps);let R6=0;class FS extends h.Destroyable{constructor(e,i){super();z(this,"_position",this.disposeVar(h.reactArrayWithUndefined(void 0)));z(this,"_id",R6++);z(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ps(e.czmViewer));o.enabled=!1,this.ad(h.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??jn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??jn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class MS extends FS{constructor(n,e){super(n,e)}}class Ct extends jn{constructor(e){super(e);z(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new h.Event));z(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Fi(e));i.enabled=!1,this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ct.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ct.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(h.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new MS(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ct.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=h.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(h.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new U6(this,r)));const A=s.disposer.disposeVar(new L6(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps()})})(Ct||(Ct={})),h.extendClassProps(Ct.prototype,Ct.createDefaultProps);class U6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));const{placeEditing:o}=e;let r=new MS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Ct.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(h.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Ct.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function O6(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class L6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_doEvent",this.disposeVar(new h.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(O6(e,i)))),(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class DS extends Ct{constructor(n){super(n),this.loop=!1}}class RS extends Ct{constructor(n){super(n),this.loop=!0}}class df extends FS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ci(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??Je.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??Je.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??Je.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const c=Lf(u,A);if(!c)return o();c[2]-=n.czmViewer.editingHeightOffset??0,i.position=c;const f=l<(n.maxPointsNum??Je.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??Je.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new df(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class Je extends jn{constructor(e){super(e);z(this,"_menuPoiCommand",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"translationEditing");{const r=this.ad(h.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new h.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new z6(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new er(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??Je.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(h.step(r,async s=>{const l=s.disposer,u=l.ad(new k6(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(c=>u.modify(c))),await s.promise(new Promise(c=>{l.dispose(u.overEvent.disposableOnce(f=>{c(f)}))}))})),a===-1)(this.debug??Je.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Je.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Je.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const c=this.editingPoints.get(u).position;if(!c)return;const f=Lf(l,c);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new df(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??Je.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new df(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps(),moveWithFirstPosition:!1})})(Je||(Je={})),h.extendClassProps(Je.prototype,Je.createDefaultProps);class z6 extends h.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class k6 extends h.Destroyable{constructor(e){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new Q6(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class Q6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(h.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class US extends Je{constructor(n){super(n),this.loop=!1}}class OS extends Je{constructor(n){super(n),this.loop=!0}}class ga extends Ct{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=h.geoHeading(this.startPosition,this.endPosition),o=h.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([90,0,0]),distance:h.react(1)})})(ga||(ga={})),h.extendClassProps(ga.prototype,ga.createDefaultProps);class jo extends Je{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]];const i=h.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=h.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),distance:h.react(0)})})(jo||(jo={})),h.extendClassProps(jo.prototype,jo.createDefaultProps);class LS extends Ct{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class zS extends Je{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class ya extends Ct{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(ya||(ya={})),h.extendClassProps(ya.prototype,ya.createDefaultProps);class va extends Je{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(va||(va={})),h.extendClassProps(va.prototype,va.createDefaultProps);class kS extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class tn extends h.EngineObject{constructor(e,i,o){super(e,i,o??!0);z(this,"_currentEditing",this.disposeVar(h.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Ct&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Fi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Ic=class Ic extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Fi(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),i.enabled=!i.position||h.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};z(Ic,"type",Ic.registerEditing("ESCesiumViewer",h.ESJEditingMode.Place,Ic));let wv=Ic;const Fc=class Fc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(h.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};z(Fc,"type",Fc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Rotation,Fc));let bv=Fc;const Mc=class Mc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};z(Mc,"type",Mc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Scale,Mc));let xv=Mc;const Dc=class Dc extends tn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new er(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=h.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=An({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=An({originPosition:a},[u.position])[0][0];u.position=dr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=An({originPosition:a},u.points)[0];u.points=dr({originPosition:a},A.map(c=>[c[0]+s[0],c[1]+s[1],c[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(h.bind([i,"position"],[n,"position"]));else if(n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=h.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=An({originPosition:a},[r])[0][0];const l=An({originPosition:a},o.points)[0];o.points=dr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};z(Dc,"type",Dc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Translation,Dc));let mf=Dc;const Rc=class Rc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ga(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(h.bind([i,"startPosition"],[o,"position"])),this.ad(Ft([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(h.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(h.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(h.bind([i,"distance"],[o,"distance"]));else{const r=At(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Oi(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!h.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};z(Rc,"type",Rc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsAppend,Rc));let _v=Rc;const Uc=class Uc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(h.bind([i,"startPosition"],[r,"position"])),this.ad(Ft([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(h.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(h.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(h.bind([i,"distance"],[r,"distance"]));else{const a=At(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Oi(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(h.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Uc,"type",Uc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsModify,Uc));let Cv=Uc;const Oc=class Oc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new RS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};z(Oc,"type",Oc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularAppend,Oc));let Sv=Oc;const Lc=class Lc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new OS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};z(Lc,"type",Lc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularInsert,Lc));let Ev=Lc;const zc=class zc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new DS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};z(zc,"type",zc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringAppend,zc));let Pv=zc;const kc=class kc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new US(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};z(kc,"type",kc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringInsert,kc));let Bv=kc;const Qc=class Qc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new LS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};z(Qc,"type",Qc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterAppend,Qc));let Tv=Qc;const Vc=class Vc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new zS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};z(Vc,"type",Vc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterModify,Vc));let Iv=Vc;const Nc=class Nc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ya(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};z(Nc,"type",Nc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityAppend,Nc));let Fv=Nc;const Hc=class Hc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new va(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};z(Hc,"type",Hc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityModify,Hc));let Mv=Hc;const Gc=class Gc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new kS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof h.ESClassification||r instanceof h.ESPolygonFence;let A=h.getMinMaxCorner(r.points).center,c=[...A],f=u?r.points[0][2]:0;l?a?c[2]=r.extrudedHeight:c[2]=r.height+f:(s&&(A[2]=r.height),a&&(c[2]=r.extrudedHeight)),i.startPosition=A,i.distance=c[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Gc,"type",Gc.registerEditing("ESCesiumViewer",h.ESJEditingMode.HeightModify,Gc));let Dv=Gc;const Lt=class Lt extends h.Destroyable{constructor(e,i,o,r=!0){super();z(this,"czmViewer");z(this,"sceneObject");z(this,"editingModes",[]);z(this,"editingID");z(this,"useKeyToSwitch");z(this,"currentIndex",0);z(this,"currentEditingMode");z(this,"currentEditingWrapper");z(this,"_notSupportedEditCount",this.disposeVar(h.react(0)));z(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&h.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Lt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_ESCAPE&&Lt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Lt.MOUSE_LEFT&&h.nextAnimateFrame(()=>{Lt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Lt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=h.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Lt.stop(),Lt.esEditModeInstance=new Lt(e,i,o,r)}static stop(){const e=Lt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Lt.esEditModeInstance=void 0}};z(Lt,"KEY_ESCAPE","Escape"),z(Lt,"KEY_SPACE","Space"),z(Lt,"MOUSE_LEFT",0),z(Lt,"esEditModeInstance");let gf=Lt;function QS(){const t=h.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new mf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class V6 extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n,h.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof h.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(h.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class N6 extends h.Destroyable{constructor(e){super();z(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new h.ESSceneObjectWithId));this.dispose(h.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new h.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new V6(e,i)}))}}class H6 extends h.Destroyable{constructor(n){super(),this.dv(new h.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new G6(n)}))}}class G6 extends h.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(h.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new h.ObjResettingWithEvent(r,()=>{if(o)return new W6(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=h.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof h.ESExcavate?h.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof h.ESHole&&h.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class W6 extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=h.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof h.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof h.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class j6 extends h.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class q6 extends h.Destroyable{constructor(e){var a;super();z(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Fo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function K6(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function Z6(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=_.defaultValue(t,_.Matrix4.IDENTITY);const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function X6(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function $6(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=_.defaultValue(i,e),this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function Y6(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function J6(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defaultValue,o=t.defined,r=t.OrientedBoundingBox,a=t.Rectangle,s=t.TaskProcessor,l=t.TerrainData,u=t.TerrainEncoding,A=t.TerrainMesh,c=t.GoogleEarthEnterpriseTerrainData,f="createVerticesFromGoogleEarthEnterpriseBuffer",d=new s(f),p=new s(f,l.maximumAsynchronousTasks),g=new a,v=new a;c.prototype.createMesh=function(y){y=i(y,i.EMPTY_OBJECT);const m=y.tilingScheme,b=y.x,x=y.y,E=y.level,B=i(y.exaggeration,1),P=i(y.exaggerationRelativeHeight,0),I=i(y.throttle,!0),O=m.ellipsoid;m.tileXYToNativeRectangle(b,x,E,g),m.tileXYToRectangle(b,x,E,v);const M=O.cartographicToCartesian(a.center(v));this._skirtHeight=1.9134410999999999e6;const T=(I?p:d).scheduleTask({buffer:this._buffer,nativeRectangle:g,rectangle:a.clone(v),relativeToCenter:M,ellipsoid:O,skirtHeight:this._skirtHeight,exaggeration:B,exaggerationRelativeHeight:P,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!o(T))return;const w=this;return T.then(function(C){return w._mesh=new A(M,new Float32Array(C.vertices),new Uint16Array(C.indices),C.indexCountWithoutSkirts,C.vertexCountWithoutSkirts,C.minimumHeight,C.maximumHeight,n.clone(C.boundingSphere3D),e.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,r.clone(C.orientedBoundingBox),u.clone(C.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),w._minimumHeight=C.minimumHeight,w._maximumHeight=C.maximumHeight,w._buffer=void 0,w._mesh})}}function eQ(){return _.VERSION.split(".").map(n=>parseInt(n))}let Rv;function tQ(){return Rv||(Rv=eQ()),Rv}function nQ(){const t=tQ();t[0]===1&&t[1]>=92?J6(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function iQ(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function rQ(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function oQ(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const sQ=`#ifdef GL_OES_standard_derivatives
3775
+ `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class Dk extends h.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[si.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(h.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const c=A.pick(l);if(!c||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(c,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=vv(f,d,A.normal),g=vv(A.origin,f,A.normal),v=vv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await h.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,c=A*3/128;if(!(u>=A-c&&u<=A+c))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[si.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Oi(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ts=class ts extends Fn{constructor(e){super();z(this,"_hoveredPlaneType",this.disposeVar(h.react("none")));z(this,"_movingPlaneType",this.disposeVar(h.react("none")));z(this,"_circles");z(this,"_czmCameraModel");z(this,"_cartesian");z(this,"_planes",{heading:this.disposeVar(new Bk(this)),pitch:this.disposeVar(new Tk(this)),roll:this.disposeVar(new Ik(this))});z(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Dk(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&At(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new kt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(h.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(h.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(h.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ot({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ma(e));this.dispose(h.track([o,"position"],[this,"position"])),this.dispose(h.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([o,"debug"],[this,"debug"])),this.dispose(h.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ts.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ts.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ts.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};z(ts,"rotationNum",{heading:0,pitch:1,roll:2}),z(ts,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=ts;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),h.extendClassProps(si.prototype,si.createDefaultProps);const ns=class ns extends h.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ns.defaults.positions[0],this.stopPosition??ns.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ns.defaults.positions[0],n??ns.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Xe(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(h.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(h.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};z(ns,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=ns;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:h.reactPositions(t.defaults.positions),width:10,color:h.reactArray([1,0,0,1])})})(Wo||(Wo={})),h.extendClassProps(Wo.prototype,Wo.createDefaultProps);class tr extends Fn{constructor(e){super();z(this,"_lastPosition");z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.disposeVar(h.react("none")),originPosition:this.disposeVar(h.reactArray([0,0,0])),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_scaleAxis");z(this,"_pickingXYProcessing",e=>this.disposeVar(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let c=this.scale[0],f=this.scale[1];const d=h.geoDistance(A,this._opInfo.originPosition.value)-h.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?c+=p:c-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),c<=0&&(c+=p),f<=0&&(f+=p),this.scale=[c??1,f??1,this.scale[2]??1]})})));z(this,"_pickingZProcessing",e=>this.disposeVar(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Wf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=tr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[c,f,d]=s;l.stopPosition=[c,f,d+this._opInfo.originDimensions.value[2]];const p=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(h.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??tr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(h.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await h.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),c=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};c(),this.dispose(this.enabledChanged.disposableOn(c))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Wo(e));return o.width=10,this.ad(h.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),scale:h.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(tr||(tr={})),h.extendClassProps(tr.prototype,tr.createDefaultProps);const io=class io extends _n{constructor(e){super();z(this,"_editingPoints",this.disposeVar(new h.ObservableArray));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_currentProcess");z(this,"_menuPoiEnabled",this.disposeVar(h.react(!1)));z(this,"_status",this.disposeVar(h.react("None")));z(this,"_positionsChanged",this.ad(new h.Event));z(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??io.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??io.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Xe(e));this.ad(h.track([i,"color"],[this,"polylineColor"])),this.ad(h.track([i,"width"],[this,"polylineWidth"])),this.ad(h.track([i,"show"],[this,"polylineShow"])),this.ad(h.track([i,"arcType"],[this,"polylineArcType"])),this.ad(h.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new h.CursorInfo(e.container,h.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};z(io,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),z(io,"defaults",{..._n.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:io.baseImageUrl+"point-green.png",otherControlPointImageUrl:io.baseImageUrl+"point-yellow.png"});let jn=io;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:h.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(jn||(jn={})),h.extendClassProps(jn.prototype,jn.createDefaultProps);let Rk=0;class FS extends h.Destroyable{constructor(e,i){super();z(this,"_position",this.disposeVar(h.reactArrayWithUndefined(void 0)));z(this,"_id",Rk++);z(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ps(e.czmViewer));o.enabled=!1,this.ad(h.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??jn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??jn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class MS extends FS{constructor(n,e){super(n,e)}}class Ct extends jn{constructor(e){super(e);z(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new h.Event));z(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Fi(e));i.enabled=!1,this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ct.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ct.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(h.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new MS(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ct.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=h.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(h.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new Uk(this,r)));const A=s.disposer.disposeVar(new Lk(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps()})})(Ct||(Ct={})),h.extendClassProps(Ct.prototype,Ct.createDefaultProps);class Uk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));const{placeEditing:o}=e;let r=new MS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Ct.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(h.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Ct.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function Ok(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class Lk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_doEvent",this.disposeVar(new h.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(Ok(e,i)))),(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class DS extends Ct{constructor(n){super(n),this.loop=!1}}class RS extends Ct{constructor(n){super(n),this.loop=!0}}class df extends FS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ci(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??Je.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??Je.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??Je.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const c=Lf(u,A);if(!c)return o();c[2]-=n.czmViewer.editingHeightOffset??0,i.position=c;const f=l<(n.maxPointsNum??Je.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??Je.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new df(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class Je extends jn{constructor(e){super(e);z(this,"_menuPoiCommand",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"translationEditing");{const r=this.ad(h.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new h.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new zk(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new er(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??Je.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(h.step(r,async s=>{const l=s.disposer,u=l.ad(new kk(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(c=>u.modify(c))),await s.promise(new Promise(c=>{l.dispose(u.overEvent.disposableOnce(f=>{c(f)}))}))})),a===-1)(this.debug??Je.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Je.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Je.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const c=this.editingPoints.get(u).position;if(!c)return;const f=Lf(l,c);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new df(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??Je.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new df(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps(),moveWithFirstPosition:!1})})(Je||(Je={})),h.extendClassProps(Je.prototype,Je.createDefaultProps);class zk extends h.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class kk extends h.Destroyable{constructor(e){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new Qk(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class Qk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(h.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class US extends Je{constructor(n){super(n),this.loop=!1}}class OS extends Je{constructor(n){super(n),this.loop=!0}}class ga extends Ct{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=h.geoHeading(this.startPosition,this.endPosition),o=h.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([90,0,0]),distance:h.react(1)})})(ga||(ga={})),h.extendClassProps(ga.prototype,ga.createDefaultProps);class jo extends Je{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]];const i=h.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=h.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),distance:h.react(0)})})(jo||(jo={})),h.extendClassProps(jo.prototype,jo.createDefaultProps);class LS extends Ct{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class zS extends Je{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class ya extends Ct{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(ya||(ya={})),h.extendClassProps(ya.prototype,ya.createDefaultProps);class va extends Je{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(va||(va={})),h.extendClassProps(va.prototype,va.createDefaultProps);class kS extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class tn extends h.EngineObject{constructor(e,i,o){super(e,i,o??!0);z(this,"_currentEditing",this.disposeVar(h.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Ct&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Fi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Ic=class Ic extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Fi(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),i.enabled=!i.position||h.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};z(Ic,"type",Ic.registerEditing("ESCesiumViewer",h.ESJEditingMode.Place,Ic));let wv=Ic;const Fc=class Fc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(h.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};z(Fc,"type",Fc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Rotation,Fc));let bv=Fc;const Mc=class Mc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};z(Mc,"type",Mc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Scale,Mc));let xv=Mc;const Dc=class Dc extends tn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new er(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=h.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=An({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=An({originPosition:a},[u.position])[0][0];u.position=dr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=An({originPosition:a},u.points)[0];u.points=dr({originPosition:a},A.map(c=>[c[0]+s[0],c[1]+s[1],c[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(h.bind([i,"position"],[n,"position"]));else if(n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=h.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=An({originPosition:a},[r])[0][0];const l=An({originPosition:a},o.points)[0];o.points=dr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};z(Dc,"type",Dc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Translation,Dc));let mf=Dc;const Rc=class Rc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ga(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(h.bind([i,"startPosition"],[o,"position"])),this.ad(Ft([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(h.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(h.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(h.bind([i,"distance"],[o,"distance"]));else{const r=At(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Oi(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!h.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};z(Rc,"type",Rc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsAppend,Rc));let _v=Rc;const Uc=class Uc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(h.bind([i,"startPosition"],[r,"position"])),this.ad(Ft([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(h.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(h.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(h.bind([i,"distance"],[r,"distance"]));else{const a=At(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Oi(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(h.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Uc,"type",Uc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsModify,Uc));let Cv=Uc;const Oc=class Oc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new RS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};z(Oc,"type",Oc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularAppend,Oc));let Sv=Oc;const Lc=class Lc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new OS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};z(Lc,"type",Lc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularInsert,Lc));let Ev=Lc;const zc=class zc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new DS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};z(zc,"type",zc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringAppend,zc));let Pv=zc;const kc=class kc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new US(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};z(kc,"type",kc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringInsert,kc));let Bv=kc;const Qc=class Qc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new LS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};z(Qc,"type",Qc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterAppend,Qc));let Tv=Qc;const Vc=class Vc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new zS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};z(Vc,"type",Vc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterModify,Vc));let Iv=Vc;const Nc=class Nc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ya(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};z(Nc,"type",Nc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityAppend,Nc));let Fv=Nc;const Hc=class Hc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new va(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};z(Hc,"type",Hc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityModify,Hc));let Mv=Hc;const Gc=class Gc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new kS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof h.ESClassification||r instanceof h.ESPolygonFence;let A=h.getMinMaxCorner(r.points).center,c=[...A],f=u?r.points[0][2]:0;l?a?c[2]=r.extrudedHeight:c[2]=r.height+f:(s&&(A[2]=r.height),a&&(c[2]=r.extrudedHeight)),i.startPosition=A,i.distance=c[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Gc,"type",Gc.registerEditing("ESCesiumViewer",h.ESJEditingMode.HeightModify,Gc));let Dv=Gc;const Lt=class Lt extends h.Destroyable{constructor(e,i,o,r=!0){super();z(this,"czmViewer");z(this,"sceneObject");z(this,"editingModes",[]);z(this,"editingID");z(this,"useKeyToSwitch");z(this,"currentIndex",0);z(this,"currentEditingMode");z(this,"currentEditingWrapper");z(this,"_notSupportedEditCount",this.disposeVar(h.react(0)));z(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&h.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Lt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_ESCAPE&&Lt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Lt.MOUSE_LEFT&&h.nextAnimateFrame(()=>{Lt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Lt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=h.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Lt.stop(),Lt.esEditModeInstance=new Lt(e,i,o,r)}static stop(){const e=Lt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Lt.esEditModeInstance=void 0}};z(Lt,"KEY_ESCAPE","Escape"),z(Lt,"KEY_SPACE","Space"),z(Lt,"MOUSE_LEFT",0),z(Lt,"esEditModeInstance");let gf=Lt;function QS(){const t=h.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new mf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class Vk extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n,h.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof h.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(h.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class Nk extends h.Destroyable{constructor(e){super();z(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new h.ESSceneObjectWithId));this.dispose(h.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new h.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new Vk(e,i)}))}}class Hk extends h.Destroyable{constructor(n){super(),this.dv(new h.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new Gk(n)}))}}class Gk extends h.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(h.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new h.ObjResettingWithEvent(r,()=>{if(o)return new Wk(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=h.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof h.ESExcavate?h.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof h.ESHole&&h.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class Wk extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=h.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof h.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof h.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class jk extends h.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class qk extends h.Destroyable{constructor(e){var a;super();z(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Fo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function Kk(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function Zk(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=_.defaultValue(t,_.Matrix4.IDENTITY);const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function Xk(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function $k(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=_.defaultValue(i,e),this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function Yk(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function Jk(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defaultValue,o=t.defined,r=t.OrientedBoundingBox,a=t.Rectangle,s=t.TaskProcessor,l=t.TerrainData,u=t.TerrainEncoding,A=t.TerrainMesh,c=t.GoogleEarthEnterpriseTerrainData,f="createVerticesFromGoogleEarthEnterpriseBuffer",d=new s(f),p=new s(f,l.maximumAsynchronousTasks),g=new a,v=new a;c.prototype.createMesh=function(y){y=i(y,i.EMPTY_OBJECT);const m=y.tilingScheme,b=y.x,x=y.y,E=y.level,B=i(y.exaggeration,1),P=i(y.exaggerationRelativeHeight,0),I=i(y.throttle,!0),O=m.ellipsoid;m.tileXYToNativeRectangle(b,x,E,g),m.tileXYToRectangle(b,x,E,v);const M=O.cartographicToCartesian(a.center(v));this._skirtHeight=1.9134410999999999e6;const T=(I?p:d).scheduleTask({buffer:this._buffer,nativeRectangle:g,rectangle:a.clone(v),relativeToCenter:M,ellipsoid:O,skirtHeight:this._skirtHeight,exaggeration:B,exaggerationRelativeHeight:P,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!o(T))return;const w=this;return T.then(function(C){return w._mesh=new A(M,new Float32Array(C.vertices),new Uint16Array(C.indices),C.indexCountWithoutSkirts,C.vertexCountWithoutSkirts,C.minimumHeight,C.maximumHeight,n.clone(C.boundingSphere3D),e.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,r.clone(C.orientedBoundingBox),u.clone(C.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),w._minimumHeight=C.minimumHeight,w._maximumHeight=C.maximumHeight,w._buffer=void 0,w._mesh})}}function eQ(){return _.VERSION.split(".").map(n=>parseInt(n))}let Rv;function tQ(){return Rv||(Rv=eQ()),Rv}function nQ(){const t=tQ();t[0]===1&&t[1]>=92?Jk(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function iQ(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function rQ(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function oQ(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const sQ=`#ifdef GL_OES_standard_derivatives
3776
3776
  #extension GL_OES_standard_derivatives : enable
3777
3777
  #endif
3778
3778
 
@@ -3806,7 +3806,7 @@ material.alpha = materialInput.color.a;
3806
3806
 
3807
3807
  return material;
3808
3808
  }
3809
- `;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:sQ},translucent:!1});const{PrimitiveRenderResources:aQ,ModelUtility:lQ,Cartesian3:qn,Matrix4:wa,ModelRenderResources:uQ,defined:cQ,NodeRenderResources:hQ,BoundingSphere:nr,ModelDrawCommands:AQ}=_,fQ=new qn,pQ=new qn,VS=new qn,NS=new qn;class dQ extends aQ{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=wa.inverse(i,new wa),r=lQ.getPositionMinMax(e.primitive,wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,VS),wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,NS));this.positionMin=qn.clone(r.min,new qn),this.positionMax=qn.clone(r.max,new qn),this.boundingSphere=nr.fromCornerPoints(this.positionMin,this.positionMax,new nr)}}function mQ(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new uQ(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=qn.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fQ),l=qn.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,pQ);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!cQ(u))continue;u.configurePipeline();const A=u.pipelineStages,c=new hQ(e,u);for(r=0;r<A.length;r++)A[r].process(c,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new dQ(c,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=nr.clone(g.boundingSphere,new nr);const v=wa.multiplyByPoint(f,g.positionMin,VS),y=wa.multiplyByPoint(f,g.positionMax,NS);qn.minimumByComponent(s,v,s),qn.maximumByComponent(l,y,l);const m=AQ.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=nr.fromCornerPoints(s,l,new nr),this._boundingSphere=nr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=nr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=nr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const Wc=class Wc extends h.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{Wc.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=Wc.oldUpdate})}};z(Wc,"oldUpdate",_.ParticleSystem.prototype.update);let Uv=Wc;function gQ(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class yQ{constructor(n){z(this,"index");z(this,"image");z(this,"resolve");z(this,"reject");z(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function vQ(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new yQ({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,c=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),c=Math.max(c,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(c,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const Xr={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:wQ,Indices:bQ,FeatureIdAttribute:HS,FeatureIdTexture:GS,FeatureIdImplicitRange:WS,MorphTarget:xQ,Primitive:_Q,Instances:CQ,Skin:SQ,Node:EQ,AnimatedPropertyType:PQ,AnimationSampler:BQ,AnimationTarget:TQ,AnimationChannel:IQ,Animation:FQ,ArticulationStage:MQ,Articulation:DQ,Asset:RQ,Scene:UQ,Components:OQ,MetallicRoughness:LQ,SpecularGlossiness:zQ,Specular:kQ,Anisotropy:Ov,Clearcoat:Lv,Material:QQ}=_.ModelComponents;function VQ(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===Xr.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=NQ(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=Xr.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===Xr.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=Xr.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=Xr.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function NQ(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=GQ(t,n);return t._state=Xr.PROCESSING,t._textureState=Xr.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const HQ=new _.Cartesian3;function GQ(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=WQ(t,n),l=XQ(t,s),u=$Q(t,s),A=YQ(e),c=JQ(e,s),f=new OQ,d=new RQ,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=c,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,HQ);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=e8(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=t8(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return eE(y,t._loaderPromises),t._incrementallyLoadTextures||eE(y,t._texturesPromises),Promise.all(y)}function WQ(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=jQ(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function jQ(t,n,e){const i=new EQ;i.name=n.name,i.matrix=Mn(_.Matrix4,n.matrix),i.translation=Mn(_.Cartesian3,n.translation),i.rotation=Mn(_.Quaternion,n.rotation),i.scale=Mn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=n8(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(qQ(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,c=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(c.length).fill(0)}return i}function qQ(t,n,e,i){const o=new _Q,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=KQ(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=i8(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const c=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=kv(t,_.VertexAttributeSemantic,B),O=I.modelSemantic;if(c&&!o8(O))continue;O===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const M=jS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}const g=n.targets;if(_.defined(g)&&!c)for(let B=0;B<g.length;++B)o.morphTargets.push(s8(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=a8(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?l8(t,o,m,i):x&&u8(t,o,b,i),_.defined(y)?c8(o,y):x&&h8(t,o,b);const E=n.mode;if(c&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function KQ(t,n,e){const i=new QQ,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=ZQ(t,r,e):(_.defined(u)&&(i.metallicRoughness=A8(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=f8(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=p8(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=d8(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=an(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=an(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=an(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Mn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function ZQ(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new zQ;return _.defined(i)&&(l.diffuseTexture=an(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=an(t,o,e,void 0)),l.diffuseFactor=Mn(_.Cartesian4,r),l.specularFactor=Mn(_.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function XQ(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=m8(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function $Q(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=g8(t,o,n);return a.index=r,a})}function YQ(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(y8):[]}function JQ(t,n){const e=new UQ,i=v8(t);return e.nodes=i.map(function(o){return n[o]}),e}async function e8(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function t8(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Mn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function n8(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new CQ,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(w8(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?b8(o,s):_.defined(l)&&x8(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function i8(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return yf(t,i,!1)}const r8={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=r8;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function o8(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function jS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,c=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&c,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=qS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function s8(t,n,e,i,o){const r=new xQ,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const c=n[A],f=kv(t,VertexAttributeSemantic,A),d=jS(t,c,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function a8(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new bQ;u.count=s.count;const A=t._loadAttributesAsTypedArray,c=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||c||f,m=_8(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function l8(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=C8(t,a,i,s):_.defined(a.attribute)?l=KS(a,s):l=ZS(a,s),n.featureIds.push(l)}}function u8(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=XS(u,c,f,d):p=$S(u,c,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=S8(t,u,c,i,f,d);n.featureIds.push(p)}}function c8(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function h8(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function A8(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new LQ;return _.defined(i)&&(l.baseColorTexture=an(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=an(t,o,e,void 0)),l.baseColorFactor=Mn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function f8(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new kQ;return _.defined(o)&&(s.specularTexture=an(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=an(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Mn(_.Cartesian3,r),s}function p8(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return _.defined(r)&&(a.anisotropyTexture=an(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function d8(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return _.defined(o)&&(l.clearcoatTexture=an(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=an(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=an(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function an(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=Xr.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function m8(t,n,e){const i=new SQ,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=yf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function g8(t,n,e){const i=new FQ;i.name=n.name;const o=n.samplers.map(function(a,s){const l=E8(t,a);return l.index=s,l}),r=n.channels.map(function(a){return P8(a,o,e)});return i.samplers=o,i.channels=r,i}function y8(t){const n=new DQ;return n.name=t.name,n.stages=t.stages.map(T8),n}function v8(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function w8(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=kv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,c=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return qS(t,n,l,void 0,void 0,void 0,p,f||c&&(!s||g||d),o)}function b8(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=KS(o,r):a=ZS(o,r),t.featureIds.push(a)}}function x8(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,c=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=XS(s,u,A,c):f=$S(s,u,A,c),n.featureIds.push(f)}}function yf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=B8(t,o),a=I8(t,r,n,e,i);return t._loaderPromises.push(a),i}return F8(n,i)}function qS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],c=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?YS(d):void 0,y=M8(u,n,f,p,g);if(!_.defined(o)&&!_.defined(c)&&!_.defined(r))return y;const m=D8(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?R8(y,m,a,s):_.defined(r)?U8(y,m,a,s):O8(u,A,y,m,a,s)},y}function _8(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function C8(t,n,e,i){const o=new GS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=an(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function KS(t,n){const e=new HS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function ZS(t,n){const e=new WS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function XS(t,n,e,i){const o=new HS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=YS(r.attribute),o.positionalLabel=i,o}function $S(t,n,e,i){const o=new WS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function S8(t,n,e,i,o,r){const a=new GS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=an(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function E8(t,n){const e=new BQ,i=t.gltfJson.accessors,o=i[n.input];e.input=yf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=yf(t,a,!0),e}function P8(t,n,e){const i=new IQ,o=t.sampler;return i.sampler=n[o],i.target=L8(t.target,e),i}function B8(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function T8(t){const n=new MQ;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function I8(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=JS(r,e,n.typedArray);i=i??!1,z8(e,a,o,i)}function F8(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function YS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function M8(t,n,e,i,o){var c;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new wQ;l.name=e,l.semantic=i,l.setIndex=o,l.constant=k8(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Mn(a,r.min),l.max=Mn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&Q8(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((c=t.extensionsRequired)==null?void 0:c.includes("KHR_mesh_quantization"))&&s&&u&&N8(l,a),l}function D8(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,c=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:c,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function R8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function U8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,c=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),c=Math.min(c,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,c),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function O8(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=JS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function L8(t,n){const e=new TQ,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=PQ[o],e}function JS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const c=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)c[g*a+v]=d[v];i+=o}return c}function z8(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function k8(t){return t===Number?0:new t}function Q8(t,n,e){const i=t.decodeMatrix,o=Mn(e,t.decodedMin),r=Mn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const V8={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function N8(t,n){const e=H8(t.componentDatatype),i=V8[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function H8(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function eE(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}X6(),$6(),Y6(),nQ(),iQ(),rQ(),oQ(),Z6(),mQ(),gQ(),vQ(),VQ(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function G8(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class W8 extends h.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Dn(s);if(l&&(l.destroy(),Qv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(h.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=K6;await s.promise(G8());const A=await s.promise(h.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(c,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=c)})),this.dispose(ui(A.clockViewModel,"currentTime",c=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new oE(A,e);Qv(A,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const j8=new _.EllipsoidTerrainProvider;class tE extends h.Destroyable{constructor(e){super();z(this,"_terrainMap",new Map);z(this,"_nextAnimateFrame",this.dv(h.createNextAnimateFrame()));z(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??j8}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new h.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(h.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class nE extends h.Destroyable{constructor(e){super();z(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof yt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new h.Destroyable;{const r=o.dv(h.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof yt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof yt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof yt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof ki&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class q8 extends h.Destroyable{constructor(e){super();z(this,"_czmImageryLayerWrappers",new Set);z(this,"_zIndexChangedEvent",this.dv(new h.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class K8 extends h.Destroyable{constructor(e){super();z(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class Z8 extends h.Destroyable{constructor(e){super();z(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new h.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new K8(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class X8 extends h.Destroyable{constructor(e,i){super();z(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new h.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new Z8(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class iE extends h.Destroyable{constructor(e){super();z(this,"_czmImageryWrappers",new Set);z(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new q8(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new X8(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class rE extends h.Destroyable{constructor(e){super();z(this,"_pause",this.disposeVar(h.react(!1)));z(this,"_pickPositionTasks",[]);z(this,"_pickTasks",[]);z(this,"pickHeightMustGreaterThanZero",!0);z(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,c,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ke(A),y=g.getPickRay(v);if(y){let E;if(c?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ke(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,c,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ke(A),c&&c[0],c&&c[1]);!g&&_.defined(i.scene.globe)&&(g=await $8(i,Ke(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(M=>{v&&(v[M]=g.getProperty(M))})}catch(O){console.warn(O)}}if(!g){const{left:O,top:M}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+O,A[1]+M))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?h.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=h.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof h.ESEntityCluster){const O=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(O),properties:(B=g.id.properties)==null?void 0:B.getValue(O),coordinates:Ma(g.id.position.getValue(O))}:(P=g.id)==null?void 0:P.map(M=>{var S;return{name:M.id,properties:(S=M.properties)==null?void 0:S.getValue(O),coordinates:Ma(M.position.getValue(O))}})}else if(m instanceof h.ESGeoJson){const O=new _.JulianDate;if(!g.id.entityCollection)return;const M=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(O))??{},T=M=="Point"?Ue(g.id.position.getValue(O)):M=="LineString"?g.id.polyline.positions.getValue(O).map(w=>Ue(w)):Gf(g.id.polygon.hierarchy.getValue(O));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:M,coordinates:T},properties:S}:{type:M,coordinates:T,properties:S}}else if(m instanceof h.ESGltfModel){let O;Reflect.has(g,"featureId")?O=g.featureId:Reflect.has(g,"instanceId")&&(O=g.instanceId),O&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new h.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new h.ESJPickedResult);const x=new h.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function $8(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class Y8 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.disposeVar(h.react(!1)));z(this,"_cursorPosition",h.react(void 0));z(this,"quickPickPosition",!0);let i=new h.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Dn(e);if(!a)return;i=new h.Destroyable;const s=i.disposeVar(h.react(void 0)),l=i.disposeVar(h.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=h.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(h.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await A.promise(h.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await A.promise(h.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Dn(t){return h.getExtProp(t,"_viewerExtensions")}function Qv(t,n){h.setExtProp(t,"_viewerExtensions",n)}class oE extends h.Destroyable{constructor(e,i){super();z(this,"_imageriesManager");z(this,"_terrainManager");z(this,"_labelManager");z(this,"_pickingManager");z(this,"_poiContext");z(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new iE(this.viewer)),this._terrainManager=this.dv(new tE(this.viewer)),this._labelManager=this.dv(new nE(this.viewer)),this._poiContext=this.disposeVar(new V0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new Y8(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new rE(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var sE=new _.Cartesian3,aE=new _.Cartesian3;function lE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,sE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,aE);else var l=_.Cartesian3.cross(t.up,a,aE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,sE);u=A}var c=_.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function uE(t,n){lE(t,n,!1)}function cE(t,n){lE(t,-n,!0)}class J8 extends h.Destroyable{constructor(e){super();z(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*c),a.MoveBackword&&r.moveBackward(A*c),a.MoveLeft&&r.moveLeft(A*c),a.MoveRight&&r.moveRight(A*c)):(a.MoveForward&&uE(r,A*c),a.MoveBackword&&uE(r,-A*c),a.MoveLeft&&cE(r,-A*c),a.MoveRight&&cE(r,A*c));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class vf extends h.Destroyable{constructor(e){super();z(this,"_currentKeyIds",new Set);z(this,"_currentKeyIdsChanged",this.dv(new h.Event));z(this,"_debug",this.dv(h.react(!1)));z(this,"_debugResetting",this.dv(new h.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends h.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3809
+ `;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:sQ},translucent:!1});const{PrimitiveRenderResources:aQ,ModelUtility:lQ,Cartesian3:qn,Matrix4:wa,ModelRenderResources:uQ,defined:cQ,NodeRenderResources:hQ,BoundingSphere:nr,ModelDrawCommands:AQ}=_,fQ=new qn,pQ=new qn,VS=new qn,NS=new qn;class dQ extends aQ{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=wa.inverse(i,new wa),r=lQ.getPositionMinMax(e.primitive,wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,VS),wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,NS));this.positionMin=qn.clone(r.min,new qn),this.positionMax=qn.clone(r.max,new qn),this.boundingSphere=nr.fromCornerPoints(this.positionMin,this.positionMax,new nr)}}function mQ(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new uQ(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=qn.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fQ),l=qn.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,pQ);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!cQ(u))continue;u.configurePipeline();const A=u.pipelineStages,c=new hQ(e,u);for(r=0;r<A.length;r++)A[r].process(c,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new dQ(c,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=nr.clone(g.boundingSphere,new nr);const v=wa.multiplyByPoint(f,g.positionMin,VS),y=wa.multiplyByPoint(f,g.positionMax,NS);qn.minimumByComponent(s,v,s),qn.maximumByComponent(l,y,l);const m=AQ.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=nr.fromCornerPoints(s,l,new nr),this._boundingSphere=nr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=nr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=nr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const Wc=class Wc extends h.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{Wc.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=Wc.oldUpdate})}};z(Wc,"oldUpdate",_.ParticleSystem.prototype.update);let Uv=Wc;function gQ(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class yQ{constructor(n){z(this,"index");z(this,"image");z(this,"resolve");z(this,"reject");z(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function vQ(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new yQ({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,c=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),c=Math.max(c,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(c,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const Xr={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:wQ,Indices:bQ,FeatureIdAttribute:HS,FeatureIdTexture:GS,FeatureIdImplicitRange:WS,MorphTarget:xQ,Primitive:_Q,Instances:CQ,Skin:SQ,Node:EQ,AnimatedPropertyType:PQ,AnimationSampler:BQ,AnimationTarget:TQ,AnimationChannel:IQ,Animation:FQ,ArticulationStage:MQ,Articulation:DQ,Asset:RQ,Scene:UQ,Components:OQ,MetallicRoughness:LQ,SpecularGlossiness:zQ,Specular:kQ,Anisotropy:Ov,Clearcoat:Lv,Material:QQ}=_.ModelComponents;function VQ(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===Xr.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=NQ(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=Xr.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===Xr.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=Xr.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=Xr.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function NQ(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=GQ(t,n);return t._state=Xr.PROCESSING,t._textureState=Xr.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const HQ=new _.Cartesian3;function GQ(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=WQ(t,n),l=XQ(t,s),u=$Q(t,s),A=YQ(e),c=JQ(e,s),f=new OQ,d=new RQ,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=c,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,HQ);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=e8(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=t8(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return eE(y,t._loaderPromises),t._incrementallyLoadTextures||eE(y,t._texturesPromises),Promise.all(y)}function WQ(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=jQ(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function jQ(t,n,e){const i=new EQ;i.name=n.name,i.matrix=Mn(_.Matrix4,n.matrix),i.translation=Mn(_.Cartesian3,n.translation),i.rotation=Mn(_.Quaternion,n.rotation),i.scale=Mn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=n8(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(qQ(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,c=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(c.length).fill(0)}return i}function qQ(t,n,e,i){const o=new _Q,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=KQ(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=i8(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const c=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=kv(t,_.VertexAttributeSemantic,B),O=I.modelSemantic;if(c&&!o8(O))continue;O===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const M=jS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}const g=n.targets;if(_.defined(g)&&!c)for(let B=0;B<g.length;++B)o.morphTargets.push(s8(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=a8(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?l8(t,o,m,i):x&&u8(t,o,b,i),_.defined(y)?c8(o,y):x&&h8(t,o,b);const E=n.mode;if(c&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function KQ(t,n,e){const i=new QQ,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=ZQ(t,r,e):(_.defined(u)&&(i.metallicRoughness=A8(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=f8(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=p8(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=d8(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=an(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=an(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=an(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Mn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function ZQ(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new zQ;return _.defined(i)&&(l.diffuseTexture=an(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=an(t,o,e,void 0)),l.diffuseFactor=Mn(_.Cartesian4,r),l.specularFactor=Mn(_.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function XQ(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=m8(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function $Q(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=g8(t,o,n);return a.index=r,a})}function YQ(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(y8):[]}function JQ(t,n){const e=new UQ,i=v8(t);return e.nodes=i.map(function(o){return n[o]}),e}async function e8(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function t8(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Mn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function n8(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new CQ,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(w8(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?b8(o,s):_.defined(l)&&x8(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function i8(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return yf(t,i,!1)}const r8={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=r8;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function o8(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function jS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,c=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&c,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=qS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function s8(t,n,e,i,o){const r=new xQ,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const c=n[A],f=kv(t,VertexAttributeSemantic,A),d=jS(t,c,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function a8(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new bQ;u.count=s.count;const A=t._loadAttributesAsTypedArray,c=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||c||f,m=_8(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function l8(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=C8(t,a,i,s):_.defined(a.attribute)?l=KS(a,s):l=ZS(a,s),n.featureIds.push(l)}}function u8(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=XS(u,c,f,d):p=$S(u,c,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=S8(t,u,c,i,f,d);n.featureIds.push(p)}}function c8(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function h8(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function A8(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new LQ;return _.defined(i)&&(l.baseColorTexture=an(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=an(t,o,e,void 0)),l.baseColorFactor=Mn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function f8(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new kQ;return _.defined(o)&&(s.specularTexture=an(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=an(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Mn(_.Cartesian3,r),s}function p8(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return _.defined(r)&&(a.anisotropyTexture=an(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function d8(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return _.defined(o)&&(l.clearcoatTexture=an(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=an(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=an(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function an(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=Xr.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function m8(t,n,e){const i=new SQ,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=yf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function g8(t,n,e){const i=new FQ;i.name=n.name;const o=n.samplers.map(function(a,s){const l=E8(t,a);return l.index=s,l}),r=n.channels.map(function(a){return P8(a,o,e)});return i.samplers=o,i.channels=r,i}function y8(t){const n=new DQ;return n.name=t.name,n.stages=t.stages.map(T8),n}function v8(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function w8(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=kv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,c=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return qS(t,n,l,void 0,void 0,void 0,p,f||c&&(!s||g||d),o)}function b8(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=KS(o,r):a=ZS(o,r),t.featureIds.push(a)}}function x8(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,c=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=XS(s,u,A,c):f=$S(s,u,A,c),n.featureIds.push(f)}}function yf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=B8(t,o),a=I8(t,r,n,e,i);return t._loaderPromises.push(a),i}return F8(n,i)}function qS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],c=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?YS(d):void 0,y=M8(u,n,f,p,g);if(!_.defined(o)&&!_.defined(c)&&!_.defined(r))return y;const m=D8(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?R8(y,m,a,s):_.defined(r)?U8(y,m,a,s):O8(u,A,y,m,a,s)},y}function _8(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function C8(t,n,e,i){const o=new GS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=an(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function KS(t,n){const e=new HS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function ZS(t,n){const e=new WS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function XS(t,n,e,i){const o=new HS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=YS(r.attribute),o.positionalLabel=i,o}function $S(t,n,e,i){const o=new WS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function S8(t,n,e,i,o,r){const a=new GS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=an(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function E8(t,n){const e=new BQ,i=t.gltfJson.accessors,o=i[n.input];e.input=yf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=yf(t,a,!0),e}function P8(t,n,e){const i=new IQ,o=t.sampler;return i.sampler=n[o],i.target=L8(t.target,e),i}function B8(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function T8(t){const n=new MQ;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function I8(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=JS(r,e,n.typedArray);i=i??!1,z8(e,a,o,i)}function F8(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function YS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function M8(t,n,e,i,o){var c;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new wQ;l.name=e,l.semantic=i,l.setIndex=o,l.constant=k8(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Mn(a,r.min),l.max=Mn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&Q8(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((c=t.extensionsRequired)==null?void 0:c.includes("KHR_mesh_quantization"))&&s&&u&&N8(l,a),l}function D8(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,c=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:c,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function R8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function U8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,c=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),c=Math.min(c,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,c),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function O8(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=JS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function L8(t,n){const e=new TQ,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=PQ[o],e}function JS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const c=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)c[g*a+v]=d[v];i+=o}return c}function z8(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function k8(t){return t===Number?0:new t}function Q8(t,n,e){const i=t.decodeMatrix,o=Mn(e,t.decodedMin),r=Mn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const V8={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function N8(t,n){const e=H8(t.componentDatatype),i=V8[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function H8(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function eE(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}Xk(),$k(),Yk(),nQ(),iQ(),rQ(),oQ(),Zk(),mQ(),gQ(),vQ(),VQ(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function G8(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class W8 extends h.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Dn(s);if(l&&(l.destroy(),Qv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(h.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=Kk;await s.promise(G8());const A=await s.promise(h.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(c,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=c)})),this.dispose(ui(A.clockViewModel,"currentTime",c=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new oE(A,e);Qv(A,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const j8=new _.EllipsoidTerrainProvider;class tE extends h.Destroyable{constructor(e){super();z(this,"_terrainMap",new Map);z(this,"_nextAnimateFrame",this.dv(h.createNextAnimateFrame()));z(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??j8}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new h.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(h.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class nE extends h.Destroyable{constructor(e){super();z(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof yt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new h.Destroyable;{const r=o.dv(h.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof yt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof yt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof yt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof ki&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class q8 extends h.Destroyable{constructor(e){super();z(this,"_czmImageryLayerWrappers",new Set);z(this,"_zIndexChangedEvent",this.dv(new h.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class K8 extends h.Destroyable{constructor(e){super();z(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class Z8 extends h.Destroyable{constructor(e){super();z(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new h.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new K8(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class X8 extends h.Destroyable{constructor(e,i){super();z(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new h.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new Z8(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class iE extends h.Destroyable{constructor(e){super();z(this,"_czmImageryWrappers",new Set);z(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new q8(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new X8(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class rE extends h.Destroyable{constructor(e){super();z(this,"_pause",this.disposeVar(h.react(!1)));z(this,"_pickPositionTasks",[]);z(this,"_pickTasks",[]);z(this,"pickHeightMustGreaterThanZero",!0);z(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,c,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ke(A),y=g.getPickRay(v);if(y){let E;if(c?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ke(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,c,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ke(A),c&&c[0],c&&c[1]);!g&&_.defined(i.scene.globe)&&(g=await $8(i,Ke(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(M=>{v&&(v[M]=g.getProperty(M))})}catch(O){console.warn(O)}}if(!g){const{left:O,top:M}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+O,A[1]+M))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?h.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=h.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof h.ESEntityCluster){const O=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(O),properties:(B=g.id.properties)==null?void 0:B.getValue(O),coordinates:Ma(g.id.position.getValue(O))}:(P=g.id)==null?void 0:P.map(M=>{var S;return{name:M.id,properties:(S=M.properties)==null?void 0:S.getValue(O),coordinates:Ma(M.position.getValue(O))}})}else if(m instanceof h.ESGeoJson){const O=new _.JulianDate;if(!g.id.entityCollection)return;const M=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(O))??{},T=M=="Point"?Ue(g.id.position.getValue(O)):M=="LineString"?g.id.polyline.positions.getValue(O).map(w=>Ue(w)):Gf(g.id.polygon.hierarchy.getValue(O));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:M,coordinates:T},properties:S}:{type:M,coordinates:T,properties:S}}else if(m instanceof h.ESGltfModel){let O;Reflect.has(g,"featureId")?O=g.featureId:Reflect.has(g,"instanceId")&&(O=g.instanceId),O&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new h.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new h.ESJPickedResult);const x=new h.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function $8(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class Y8 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.disposeVar(h.react(!1)));z(this,"_cursorPosition",h.react(void 0));z(this,"quickPickPosition",!0);let i=new h.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Dn(e);if(!a)return;i=new h.Destroyable;const s=i.disposeVar(h.react(void 0)),l=i.disposeVar(h.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=h.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(h.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await A.promise(h.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await A.promise(h.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Dn(t){return h.getExtProp(t,"_viewerExtensions")}function Qv(t,n){h.setExtProp(t,"_viewerExtensions",n)}class oE extends h.Destroyable{constructor(e,i){super();z(this,"_imageriesManager");z(this,"_terrainManager");z(this,"_labelManager");z(this,"_pickingManager");z(this,"_poiContext");z(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new iE(this.viewer)),this._terrainManager=this.dv(new tE(this.viewer)),this._labelManager=this.dv(new nE(this.viewer)),this._poiContext=this.disposeVar(new V0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new Y8(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new rE(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var sE=new _.Cartesian3,aE=new _.Cartesian3;function lE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,sE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,aE);else var l=_.Cartesian3.cross(t.up,a,aE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,sE);u=A}var c=_.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function uE(t,n){lE(t,n,!1)}function cE(t,n){lE(t,-n,!0)}class J8 extends h.Destroyable{constructor(e){super();z(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*c),a.MoveBackword&&r.moveBackward(A*c),a.MoveLeft&&r.moveLeft(A*c),a.MoveRight&&r.moveRight(A*c)):(a.MoveForward&&uE(r,A*c),a.MoveBackword&&uE(r,-A*c),a.MoveLeft&&cE(r,-A*c),a.MoveRight&&cE(r,A*c));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class vf extends h.Destroyable{constructor(e){super();z(this,"_currentKeyIds",new Set);z(this,"_currentKeyIdsChanged",this.dv(new h.Event));z(this,"_debug",this.dv(h.react(!1)));z(this,"_debugResetting",this.dv(new h.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends h.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3810
3810
  `))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=vf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=vf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class eV extends h.Destroyable{constructor(e){super();z(this,"_keyStatus");z(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new vf(this)),this._cameraOp=this.dv(new J8(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const Ef=class Ef extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!1)));z(this,"_keyStatusMap",this.dv(h.react(Ef.defaultKeyStatusMap)));z(this,"_speed",this.dv(h.react(1)));z(this,"_rotateSpeed",this.dv(h.react(.01)));z(this,"_alwaysWithCamera",this.dv(h.react(!1)));z(this,"_keyDownEvent",this.dv(new h.Event));z(this,"_keyUpEvent",this.dv(new h.Event));z(this,"_abortEvent",this.dv(new h.Event));this._firstPersonController=e,this.dv(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new eV(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};z(Ef,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let wf=Ef;function tV(t,n){t.lookRight(_.Math.toRadians(n.movementX)*.1),t.lookDown(_.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=_.Math.clamp(e,-_.Math.PI_OVER_TWO,_.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class nV extends h.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;tV(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const Pf=class Pf extends h.Destroyable{constructor(e){super();z(this,"_mouseMoving",this.dv(new nV(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Pf.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};z(Pf,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=Pf;class iV extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!1)));z(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});z(this,"_mouseResetting",this.dv(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class rV extends h.Destroyable{constructor(e){super();z(this,"viewer");z(this,"_mouseCameraController",this.dv(new iV(this)));z(this,"_keyboardCameraController",this.dv(new wf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function hE(t){t.removeInputAction(_.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(_.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new _.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new _.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,c,f;if(!l||!u)return;r.frustum instanceof _.OrthographicFrustum?(c=l.origin,f=u.origin,_.Cartesian3.add(r.direction,c,c),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(c,r.position,c),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(c,c),_.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction);let d=_.Cartesian3.dot(c,f);d<1&&(A=Math.acos(d)),A=n.startPosition.x>n.endPosition.x?A:-A;const p=e._horizontalRotationAxis;if(_.defined(i)?r.look(i,-A):_.defined(p)?r.look(p,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,!(!l||!u))if(r.frustum instanceof _.OrthographicFrustum?(c=l.origin,f=u.origin,_.Cartesian3.add(r.direction,c,c),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(c,r.position,c),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(c,c),_.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction),d=_.Cartesian3.dot(c,f),d<1&&(A=Math.acos(d)),A=n.startPosition.y>n.endPosition.y?A:-A,i=_.defaultValue(i,p),_.defined(i)){const g=r.direction,v=_.Cartesian3.negate(i,new _.Cartesian3),y=_.Cartesian3.equalsEpsilon(g,i,_.Math.EPSILON2),m=_.Cartesian3.equalsEpsilon(g,v,_.Math.EPSILON2);if(!y&&!m){d=_.Cartesian3.dot(g,i);let b=_.Math.acosClamped(d);A>0&&A>b&&(A=b-_.Math.EPSILON4),d=_.Cartesian3.dot(g,v),b=_.Math.acosClamped(d),A<0&&-A>b&&(A=-b+_.Math.EPSILON4);const x=_.Cartesian3.cross(i,g,new _.Cartesian3);r.look(x,A)}else(y&&A<0||m&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class oV extends h.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const c=At(n.position),f=i.camera.positionWC,d=_.Cartesian3.distance(c,f);n.viewDistance=d}h.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=Mi.defaults.offsetRotation}=n,u=[...l];h.Vector.set(r,0,0,0),s&&(n.relativeRotation??Mi.defaults.relativeRotation)&&(h.Vector.add(s,r,r),u[0]+=90),h.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=h.Vector.add(n.offsetRotation??Mi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class Mi extends h.Destroyable{constructor(e){super();z(this,"_resetWithCameraEvent",this.dv(new h.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new oV(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=os(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}z(Mi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:h.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Mi||(Mi={})),h.extendClassProps(Mi.prototype,Mi.createDefaultProps);class jl extends h.Destroyable{constructor(e){super();z(this,"_geoCameraController");z(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Mi(e)),this._geoPolylinePath=this.dv(new Zs(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(h.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(h.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(h.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(h.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(h.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(h.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new h.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new sV(this,e);if(this.lineMode==="manual")return new aV(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:h.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(jl||(jl={})),h.extendClassProps(jl.prototype,jl.createDefaultProps);class sV extends h.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class aV extends h.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class lV extends h.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class uV extends h.Destroyable{constructor(n,e){super();const i=this.dv(new h.ESSceneObjectWithId);i.id=n;const o=this.dv(h.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new h.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new lV(r,e)}))}}class ql extends h.Destroyable{constructor(e){super();z(this,"_geoCameraController");this._geoCameraController=this.dv(new Mi(e)),this.d(h.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new h.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new uV(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(ql||(ql={})),h.extendClassProps(ql.prototype,ql.createDefaultProps);class cV extends h.Destroyable{constructor(e){super();z(this,"height",1e7);z(this,"cycle",60);z(this,"latitude",6.632251044444445);z(this,"_running",!1);z(this,"_sseh");z(this,"_eventDisposer");z(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new _.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},_.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:_.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*_.Math.PI*2/this.cycle;e.setView({destination:_.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class hV extends h.Destroyable{constructor(e){super();z(this,"_height",this.dv(h.react(1e7)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_latitude",this.dv(h.react(38)));z(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new cV(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class AV extends h.Destroyable{constructor(e){super();z(this,"_position",this.dv(h.reactArrayWithUndefined(void 0)));z(this,"_distance",this.dv(h.react(5e4)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_heading",this.dv(h.react(0)));z(this,"_pitch",this.dv(h.react(-30)));z(this,"_transform");z(this,"_headingRadius");z(this,"_pitchRadius");z(this,"_running",!1);z(this,"_sseh");z(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new _.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new _.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=_.Cartesian3.fromDegrees(...this.position);a&&(this._transform=_.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=_.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=_.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new _.Cartesian3(0,i,o);e.flyTo({destination:_.Matrix4.multiplyByPoint(this._transform,r,new _.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*_.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new _.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(_.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class fV extends h.Destroyable{constructor(e){super();z(this,"_position",this.dv(h.reactArrayWithUndefined(void 0)));z(this,"_distance",this.dv(h.react(5e4)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_heading",this.dv(h.react(0)));z(this,"_pitch",this.dv(h.react(-30)));z(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new AV(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class pV extends h.Destroyable{constructor(e){super();z(this,"_firstPersonController");z(this,"_rotateGlobe");z(this,"_rotatePoint");z(this,"_followController");z(this,"_pathCameraController");z(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new rV(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=wf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new hV(e)),this._rotatePoint=this.dv(new fV(e)),this._followController=this.dv(new ql(e)),this._pathCameraController=this.dv(new jl(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=_.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=h.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const c=h.getDistancesFromPositions(A,"NONE"),f=c[c.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const d=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||d==!1?[0]:d.map(p=>p/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new _.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&hE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&hE(o),r.lookEventTypes=_.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=_.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],r.translateEventTypes=_.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}])}}const dV=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class mV extends h.Destroyable{constructor(e){super();z(this,"_show",this.dv(h.react(!1)));z(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new _.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ke(s.scale),maximumSize:Xn(s.maximumSize),color:Be(s.color),position:At(s.position)});(()=>{o.removeAll();for(let s of dV)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Kl extends h.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(_.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Kl||(Kl={})),h.extendClassProps(Kl.prototype,Kl.createDefaultProps);const gV=`
3811
3811
  float getDistance(sampler2D depthTexture, vec2 texCoords)
3812
3812
  {
@@ -4020,7 +4020,7 @@ void main (void)
4020
4020
  out_FragColor = color;
4021
4021
  // ------------------ skybox vtxf end -------------------
4022
4022
  }
4023
- `,Yr=_.Cartesian3,MV=_.defaultValue,ir=_.defined,DV=_.destroyObject,RV=_.Ellipsoid,dE=_.EllipsoidGeometry,UV=_.GeometryPipeline,ba=_.Math,rr=_.Matrix4,OV=_.VertexFormat,LV=_.BufferUsage,zV=_.DrawCommand,kV=_.RenderState,QV=_.ShaderProgram,mE=_.ShaderSource,VV=_.VertexArray,gE=_._shadersAtmosphereCommon,yE=_._shadersSkyAtmosphereCommon,NV=_._shadersSkyAtmosphereVS,HV=_.Axis,GV=_.BlendingState,WV=_.CullFace,vE=_.SceneMode,xf=_.Transforms,jV=_.Matrix3,wE=_.DeveloperError,qV=_.loadCubeMap,KV=_.CubeMap;function xa(t,n){t=MV(t,RV.WGS84),this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=Yr.multiplyByScalar(t.radii,e,new Yr);this._scaleMatrix=rr.fromScale(i),this._modelMatrix=new rr,this._command=new zV({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yr(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yr(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 Yr;const o=new Yr;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new jV,rr.getMatrix3(r._eunMatrix||rr.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(xa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new rr;xa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==vE.SCENE3D&&e!==vE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!ir(o.positiveX)||!ir(o.negativeX)||!ir(o.positiveY)||!ir(o.negativeY)||!ir(o.positiveZ)||!ir(o.negativeZ))throw new wE("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 wE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?qV(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new KV({context:p,source:o}))}const r=rr.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yr.ZERO,Gv),a=rr.multiplyTransformation(r,HV.Y_UP_TO_Z_UP,Gv),s=rr.multiply(this._scaleMatrix,a,Gv);rr.clone(s,this._modelMatrix);const l=t.context,u=ZV(this),A=t.globeTranslucencyState.translucent,c=this.perFragmentAtmosphere||A||!ir(n)||!n.show,f=this._command;if(xf.eastUpNorthToFixedFrame=xf.eastUpNorthToFixedFrame||xf.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=xf.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!ir(f.vertexArray)){const p=dE.createGeometry(new dE({radii:new Yr(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:OV.POSITION_ONLY}));f.vertexArray=VV.fromGeometry({context:l,geometry:p,attributeLocations:UV.createAttributeLocations(p),bufferUsage:LV.STATIC_DRAW}),f.renderState=kV.fromCache({cull:{enabled:!0,face:WV.FRONT},blending:GV.ALPHA_BLEND,depthMask:!1})}const d=u|c<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),c&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new mE({defines:p,sources:[gE,yE,NV]}),v=new mE({defines:p,sources:[gE,yE,FV]});this._spSkyAtmosphere=QV.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(ir(this._cubeMap))return f};function ZV(t){return!(ba.equalsEpsilon(t.hueShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.saturationShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.brightnessShift,0,ba.EPSILON7))}xa.prototype.isDestroyed=function(){return!1},xa.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(),DV(this)};const Fa=class Fa extends h.Destroyable{constructor(e,i){super();z(this,"_navigationManager");z(this,"_envManager");z(this,"_reu",(e,i)=>h.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new pV(r)),this._envManager=this.dv(new CV(r)),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Fa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=pE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Fa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends h.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new h.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=rt.latestDefaultAccessToken??rt.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(h.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(ui(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends h.Destroyable{constructor(){super();const c=r.flashLighting??!1;o.scene.light=c?l:s,c&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new h.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>h.registerEventUpdate(this,p,g),c=rt.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(c,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??c[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=h.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=dt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ra(p??{enabled:!1});return}jc(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?qc(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=h.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&pE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=ur(p)),f("sceneGlobeTranslucencyEnabled",p=>u.translucency.enabled=p),f("sceneGlobeTranslucencyBackFaceAlpha",p=>u.translucency.backFaceAlpha=p),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyFrontFaceAlpha",p=>u.translucency.frontFaceAlpha=p),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=dt(p)),f("sceneSplitPosition",p=>s.splitPosition=h.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new h.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};z(Fa,"BackGroundResetting",class extends h.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new bf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),z(Fa,"LocalSkyBoxResetting",class extends h.Destroyable{constructor(o,r,a){super();z(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new xa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Fa;function XV(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function $V(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[XV(a,l,s,u,A),r]}const YV=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function JV(t){return-Math.log2(t/YV)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function e3(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class t3 extends h.Destroyable{constructor(){super();z(this,"_lengthInPixels",this.disposeVar(h.react(100)));z(this,"_resolution",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInPixels",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInMeters",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInStr",this.disposeVar(h.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=e3(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}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 n3 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!0)));z(this,"_resolution",this.dv(h.react(void 0)));z(this,"_center",this.dv(h.react(void 0)));z(this,"_zoom",this.dv(h.react(void 0)));z(this,"_legend",this.dv(new t3));this._czmViewer=e;{const i=this.dv(h.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(h.sleep(1e3));const l=await o.promise($V(this._czmViewer));if(l){const[u,A]=l;r=u,a=JV(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(h.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}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 i3(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:r3}=_,{ShaderDestination:qo}=_,bE={name:"FlattenedPipelineStage"};bE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,qo.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",qo.BOTH),i.addUniform("vec4","u_flattenedBound",qo.BOTH),i.addUniform("bool","u_flattened",qo.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",qo.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",qo.BOTH),i.addUniform("bool","u_flattenDiscard",qo.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=r3(o,t.uniformMap)}};function xE(){Object.defineProperties(_.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&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.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 _E(){Object.defineProperties(_.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 CE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function SE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(bE),i}}xE(),_E(),CE(),SE();const o3=()=>({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:h.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:h.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:h.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:h.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:h.reactArray([]),sceneGlobeUndergroundColor:h.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyEnabled:void 0,sceneGlobeTranslucencyBackFaceAlpha:void 0,sceneGlobeTranslucencyBackFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlpha:void 0,sceneGlobeTranslucencyFrontFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:h.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:h.reactJson(rt.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:h.reactArray([1,1,1,1]),xbsjLocalBoxSources:h.reactJsonWithUndefined(void 0),sceneBackgroundColor:h.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}),s3=`
4023
+ `,Yr=_.Cartesian3,MV=_.defaultValue,ir=_.defined,DV=_.destroyObject,RV=_.Ellipsoid,dE=_.EllipsoidGeometry,UV=_.GeometryPipeline,ba=_.Math,rr=_.Matrix4,OV=_.VertexFormat,LV=_.BufferUsage,zV=_.DrawCommand,kV=_.RenderState,QV=_.ShaderProgram,mE=_.ShaderSource,VV=_.VertexArray,gE=_._shadersAtmosphereCommon,yE=_._shadersSkyAtmosphereCommon,NV=_._shadersSkyAtmosphereVS,HV=_.Axis,GV=_.BlendingState,WV=_.CullFace,vE=_.SceneMode,xf=_.Transforms,jV=_.Matrix3,wE=_.DeveloperError,qV=_.loadCubeMap,KV=_.CubeMap;function xa(t,n){t=MV(t,RV.WGS84),this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=Yr.multiplyByScalar(t.radii,e,new Yr);this._scaleMatrix=rr.fromScale(i),this._modelMatrix=new rr,this._command=new zV({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yr(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yr(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 Yr;const o=new Yr;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new jV,rr.getMatrix3(r._eunMatrix||rr.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(xa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new rr;xa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==vE.SCENE3D&&e!==vE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!ir(o.positiveX)||!ir(o.negativeX)||!ir(o.positiveY)||!ir(o.negativeY)||!ir(o.positiveZ)||!ir(o.negativeZ))throw new wE("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 wE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?qV(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new KV({context:p,source:o}))}const r=rr.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yr.ZERO,Gv),a=rr.multiplyTransformation(r,HV.Y_UP_TO_Z_UP,Gv),s=rr.multiply(this._scaleMatrix,a,Gv);rr.clone(s,this._modelMatrix);const l=t.context,u=ZV(this),A=t.globeTranslucencyState.translucent,c=this.perFragmentAtmosphere||A||!ir(n)||!n.show,f=this._command;if(xf.eastUpNorthToFixedFrame=xf.eastUpNorthToFixedFrame||xf.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=xf.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!ir(f.vertexArray)){const p=dE.createGeometry(new dE({radii:new Yr(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:OV.POSITION_ONLY}));f.vertexArray=VV.fromGeometry({context:l,geometry:p,attributeLocations:UV.createAttributeLocations(p),bufferUsage:LV.STATIC_DRAW}),f.renderState=kV.fromCache({cull:{enabled:!0,face:WV.FRONT},blending:GV.ALPHA_BLEND,depthMask:!1})}const d=u|c<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),c&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new mE({defines:p,sources:[gE,yE,NV]}),v=new mE({defines:p,sources:[gE,yE,FV]});this._spSkyAtmosphere=QV.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(ir(this._cubeMap))return f};function ZV(t){return!(ba.equalsEpsilon(t.hueShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.saturationShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.brightnessShift,0,ba.EPSILON7))}xa.prototype.isDestroyed=function(){return!1},xa.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(),DV(this)};const Fa=class Fa extends h.Destroyable{constructor(e,i){super();z(this,"_navigationManager");z(this,"_envManager");z(this,"_reu",(e,i)=>h.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new pV(r)),this._envManager=this.dv(new CV(r)),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Fa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=pE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Fa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends h.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new h.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=rt.latestDefaultAccessToken??rt.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(h.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(ui(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends h.Destroyable{constructor(){super();const c=r.flashLighting??!1;o.scene.light=c?l:s,c&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new h.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>h.registerEventUpdate(this,p,g),c=rt.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(c,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??c[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),s.globe.translucency.enabled=!0,f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=h.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=dt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ra(p??{enabled:!1});return}jc(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?qc(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=h.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&pE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=ur(p)),f("sceneGlobeTranslucencyEnabled",p=>u.translucency.enabled=p),f("sceneGlobeTranslucencyBackFaceAlpha",p=>u.translucency.backFaceAlpha=p),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyFrontFaceAlpha",p=>u.translucency.frontFaceAlpha=p),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=dt(p)),f("sceneSplitPosition",p=>s.splitPosition=h.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new h.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};z(Fa,"BackGroundResetting",class extends h.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new bf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),z(Fa,"LocalSkyBoxResetting",class extends h.Destroyable{constructor(o,r,a){super();z(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new xa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Fa;function XV(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function $V(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[XV(a,l,s,u,A),r]}const YV=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function JV(t){return-Math.log2(t/YV)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function e3(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class t3 extends h.Destroyable{constructor(){super();z(this,"_lengthInPixels",this.disposeVar(h.react(100)));z(this,"_resolution",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInPixels",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInMeters",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInStr",this.disposeVar(h.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=e3(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}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 n3 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!0)));z(this,"_resolution",this.dv(h.react(void 0)));z(this,"_center",this.dv(h.react(void 0)));z(this,"_zoom",this.dv(h.react(void 0)));z(this,"_legend",this.dv(new t3));this._czmViewer=e;{const i=this.dv(h.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(h.sleep(1e3));const l=await o.promise($V(this._czmViewer));if(l){const[u,A]=l;r=u,a=JV(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(h.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}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 i3(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:r3}=_,{ShaderDestination:qo}=_,bE={name:"FlattenedPipelineStage"};bE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,qo.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",qo.BOTH),i.addUniform("vec4","u_flattenedBound",qo.BOTH),i.addUniform("bool","u_flattened",qo.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",qo.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",qo.BOTH),i.addUniform("bool","u_flattenDiscard",qo.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=r3(o,t.uniformMap)}};function xE(){Object.defineProperties(_.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&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.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 _E(){Object.defineProperties(_.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 CE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function SE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(bE),i}}xE(),_E(),CE(),SE();const o3=()=>({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:h.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:h.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:h.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:h.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:h.reactArray([]),sceneGlobeUndergroundColor:h.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyEnabled:void 0,sceneGlobeTranslucencyBackFaceAlpha:void 0,sceneGlobeTranslucencyBackFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlpha:void 0,sceneGlobeTranslucencyFrontFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:h.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:h.reactJson(rt.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:h.reactArray([1,1,1,1]),xbsjLocalBoxSources:h.reactJsonWithUndefined(void 0),sceneBackgroundColor:h.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}),s3=`
4024
4024
  #### 示例代码1
4025
4025
  \`\`\`
4026
4026
  async function initCesiumViewer(container, czmViewer) {
@@ -4106,10 +4106,10 @@ async function initCesiumViewer(container, czmViewer) {
4106
4106
  `;function l3(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4107
4107
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
4108
4108
  gitee地址:${t}
4109
- `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends h.ESViewer{constructor(e){super(e);z(this,"_disabledInputStack",this.disposeVar(h.react(0)));z(this,"_viewer",this.dv(h.react(void 0)));z(this,"_viewerInstance");z(this,"_viewerLegend");z(this,"pickCustomAttachedInfo");z(this,"_fps",this.dv(h.react(0)));z(this,"_notSupportEditingCount",this.disposeVar(h.react(0)));z(this,"_editingSystem",gf);z(this,"_moveObjectsProcess",this.ad(QS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new N6(this)),this.ad(new H6(this)),this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new q6(this)})),this._viewerLegend=this.dv(new n3(this)),this._viewerInstance=this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new h.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new W8(this.subContainer,this,o=>this._viewer.value=o,i.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&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var c=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(c,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=os(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&Qa(s,a)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,c={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&Qa(f,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=h.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(c=this.viewer)==null?void 0:c.camera;return A&&Qa(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(At(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${h.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=h.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return An(e,i)}localPositionsToPositions(e,i){return dr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=At(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new h.GroupProperty([],"通用","通用"),new h.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a3,s3,!0),new h.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new h.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new h.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new h.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new h.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new h.GroupProperty([],"Viewer","Viewer"),new h.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new h.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new h.BooleanProperty([this,"shadows"]),new h.GroupProperty([],"比例尺","比例尺(Legend)"),new h.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new h.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new h.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new h.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new h.GroupProperty([],"场景","场景(Scene)"),new h.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new h.GroupProperty([],"Globe","Globe"),new h.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new h.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new h.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new h.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new h.BooleanProperty([this,"sceneGlobeShowSkirts"]),new h.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new h.ColorProperty([this,"sceneGlobeBaseColor"]),new h.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new h.JsonProperty([this,"sceneGlobeClippingPlanes"]),new h.StringProperty([this,"sceneGlobeClippingPlanesId"]),new h.JsonProperty([this,"sceneGlobeClippingPolygons"]),new h.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new h.GroupProperty([],"underground","underground"),new h.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new h.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new h.GroupProperty([],"Translucency","Translucency"),new h.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new h.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new h.GroupProperty([],"Sun","Sun"),new h.BooleanProperty([this,"sun"],"sun",i.sun,!0),new h.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new h.GroupProperty([],"Moon","Moon"),new h.BooleanProperty([this,"moon"],"moon",i.moon,!0),new h.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new h.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new h.GroupProperty([],"SkyBox","SkyBox"),new h.BooleanProperty([this,"sceneSkyBoxShow"]),new h.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new h.GroupProperty([],"Background","Background"),new h.BooleanProperty([this,"xbsjUseBackground"]),new h.StringProperty([this,"xbsjBackgroundImageUri"]),new h.ColorProperty([this,"xbsjBackgroundColor"]),new h.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new h.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new h.ColorProperty([this,"sceneBackgroundColor"]),new h.GroupProperty([],"Fog","Fog"),new h.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new h.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new h.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new h.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new h.GroupProperty([],"Sscc","Sscc"),new h.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new h.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new h.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new h.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new h.GroupProperty([],"后处理","后处理"),new h.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new h.GroupProperty([],"环境遮蔽","环境遮蔽"),new h.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new h.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new h.GroupProperty([],"Bloom","Bloom"),new h.BooleanProperty([this,"scenePpsBloomEnabled"]),new h.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new h.NumberProperty([this,"scenePpsBloomContrast"]),new h.NumberProperty([this,"scenePpsBloomBrightness"]),new h.NumberProperty([this,"scenePpsBloomDelta"]),new h.NumberProperty([this,"scenePpsBloomSigma"]),new h.NumberProperty([this,"scenePpsBloomStepSize"]),new h.GroupProperty([],"调试","调试"),new h.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new h.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new h.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new h.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new h.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new h.GroupProperty([],"Inspector","Inspector"),new h.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new h.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new h.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};z(zt,"type",zt.register("ESCesiumViewer",zt)),z(zt,"getCesiumIonToken",l3),z(zt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),z(zt,"latestDefaultAccessToken"),z(zt,"ObjectsToExcludeWrapper",j6),z(zt,"defaults",{...h.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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),z(zt,"getHeightsScartchCarto",new _.Cartographic);let rt=zt;(t=>{t.createDefaultProps=()=>({...h.ESViewer.createDefaultProps(),...o3()})})(rt||(rt={})),h.extendClassProps(rt.prototype,rt.createDefaultProps),oe.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.3",e="2025-09-24T02:01:07.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="62920530555151f915731e05be61453cd9598271",s=((Date.now()-1758679267e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4109
+ `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends h.ESViewer{constructor(e){super(e);z(this,"_disabledInputStack",this.disposeVar(h.react(0)));z(this,"_viewer",this.dv(h.react(void 0)));z(this,"_viewerInstance");z(this,"_viewerLegend");z(this,"pickCustomAttachedInfo");z(this,"_fps",this.dv(h.react(0)));z(this,"_notSupportEditingCount",this.disposeVar(h.react(0)));z(this,"_editingSystem",gf);z(this,"_moveObjectsProcess",this.ad(QS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new Nk(this)),this.ad(new Hk(this)),this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new qk(this)})),this._viewerLegend=this.dv(new n3(this)),this._viewerInstance=this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new h.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new W8(this.subContainer,this,o=>this._viewer.value=o,i.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&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var c=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(c,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=os(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&Qa(s,a)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,c={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&Qa(f,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=h.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(c=this.viewer)==null?void 0:c.camera;return A&&Qa(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(At(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${h.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=h.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return An(e,i)}localPositionsToPositions(e,i){return dr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=At(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new h.GroupProperty([],"通用","通用"),new h.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a3,s3,!0),new h.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new h.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new h.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new h.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new h.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new h.GroupProperty([],"Viewer","Viewer"),new h.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new h.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new h.BooleanProperty([this,"shadows"]),new h.GroupProperty([],"比例尺","比例尺(Legend)"),new h.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new h.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new h.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new h.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new h.GroupProperty([],"场景","场景(Scene)"),new h.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new h.GroupProperty([],"Globe","Globe"),new h.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new h.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new h.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new h.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new h.BooleanProperty([this,"sceneGlobeShowSkirts"]),new h.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new h.ColorProperty([this,"sceneGlobeBaseColor"]),new h.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new h.JsonProperty([this,"sceneGlobeClippingPlanes"]),new h.StringProperty([this,"sceneGlobeClippingPlanesId"]),new h.JsonProperty([this,"sceneGlobeClippingPolygons"]),new h.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new h.GroupProperty([],"underground","underground"),new h.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new h.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new h.GroupProperty([],"Translucency","Translucency"),new h.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new h.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new h.GroupProperty([],"Sun","Sun"),new h.BooleanProperty([this,"sun"],"sun",i.sun,!0),new h.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new h.GroupProperty([],"Moon","Moon"),new h.BooleanProperty([this,"moon"],"moon",i.moon,!0),new h.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new h.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new h.GroupProperty([],"SkyBox","SkyBox"),new h.BooleanProperty([this,"sceneSkyBoxShow"]),new h.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new h.GroupProperty([],"Background","Background"),new h.BooleanProperty([this,"xbsjUseBackground"]),new h.StringProperty([this,"xbsjBackgroundImageUri"]),new h.ColorProperty([this,"xbsjBackgroundColor"]),new h.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new h.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new h.ColorProperty([this,"sceneBackgroundColor"]),new h.GroupProperty([],"Fog","Fog"),new h.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new h.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new h.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new h.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new h.GroupProperty([],"Sscc","Sscc"),new h.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new h.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new h.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new h.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new h.GroupProperty([],"后处理","后处理"),new h.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new h.GroupProperty([],"环境遮蔽","环境遮蔽"),new h.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new h.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new h.GroupProperty([],"Bloom","Bloom"),new h.BooleanProperty([this,"scenePpsBloomEnabled"]),new h.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new h.NumberProperty([this,"scenePpsBloomContrast"]),new h.NumberProperty([this,"scenePpsBloomBrightness"]),new h.NumberProperty([this,"scenePpsBloomDelta"]),new h.NumberProperty([this,"scenePpsBloomSigma"]),new h.NumberProperty([this,"scenePpsBloomStepSize"]),new h.GroupProperty([],"调试","调试"),new h.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new h.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new h.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new h.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new h.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new h.GroupProperty([],"Inspector","Inspector"),new h.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new h.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new h.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};z(zt,"type",zt.register("ESCesiumViewer",zt)),z(zt,"getCesiumIonToken",l3),z(zt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),z(zt,"latestDefaultAccessToken"),z(zt,"ObjectsToExcludeWrapper",jk),z(zt,"defaults",{...h.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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),z(zt,"getHeightsScartchCarto",new _.Cartographic);let rt=zt;(t=>{t.createDefaultProps=()=>({...h.ESViewer.createDefaultProps(),...o3()})})(rt||(rt={})),h.extendClassProps(rt.prototype,rt.createDefaultProps),oe.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.4",e="2025-09-24T06:57:53.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="68cd621b33e0c85c47fbbd4116bf77c0f96320ec",s=((Date.now()-1758697073e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4110
4110
  %c${o?o+`
4111
4111
  `:""}当前网站正在使用${t},此软件版权归${i}所有
4112
- `;oe.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","62920530555151f915731e05be61453cd9598271")},get info(){return l},get date(){return"2025-09-24T02:01:07.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.3"},get name(){return"earthsdk3-cesium"},get commitId(){return"62920530555151f915731e05be61453cd9598271"},print(){console.info(this.info,`
4112
+ `;oe.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","68cd621b33e0c85c47fbbd4116bf77c0f96320ec")},get info(){return l},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,`
4113
4113
  font-size: 18px;
4114
4114
  font-weight: 1000;
4115
4115
  line-height: 1;