* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasM}from"./chunk-ICZXFP3D.js";import{aasV}from"./chunk-ZFTFDHK4.js";import{aasN}from"./chunk-NNHN6WUY.js";import{aask}from"./chunk-T7ERZ2CJ.js";import{basD,casP,dasL}from"./chunk-GSNDLQ4C.js";import{dasy}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasA}from"./chunk-VTVHUB7E.js";import{aasS,casR}from"./chunk-JMSSU44E.js";import"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasc}from"./chunk-VLPNAR64.js";import{aasT,basm}from"./chunk-GE5NEIZC.js";import{easd}from"./chunk-35CVRQTC.js";varw=newR;functiona(t){t=c(t,c.EMPTY_OBJECT);lete=t.length,i=t.topRadius,f=t.bottomRadius,o=c(t.slices,128),r=Math.max(c(t.numberOfVerticalLines,16),0);if(m.typeOf.number("options.positions",e),m.typeOf.number("options.topRadius",i),m.typeOf.number("options.bottomRadius",f),m.typeOf.number.greaterThanOrEquals("options.slices",o,3),d(t.offsetAttribute)&&t.offsetAttribute===V.TOP)thrownewT("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=i,this._bottomRadius=f,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}a.packedLength=6;a.pack=function(t,e,i){returnm.typeOf.object("value",t),m.defined("array",e),i=c(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=c(t._offsetAttribute,-1),e};varb={length:void0,topRadius:void0,bottomRadius:void0,slices:void0,numberOfVerticalLines:void0,offsetAttribute:void0};a.unpack=function(t,e,i){m.defined("array",t),e=c(e,0);letf=t[e++],o=t[e++],r=t[e++],h=t[e++],l=t[e++],p=t[e];returnd(i)?(i._length=f,i._topRadius=o,i._bottomRadius=r,i._slices=h,i._numberOfVerticalLines=l,i._offsetAttribute=p===-1?void0:p,i):(b.length=f,b.topRadius=o,b.bottomRadius=r,b.slices=h,b.numberOfVerticalLines=l,b.offsetAttribute=p===-1?void0:p,newa(b))};a.createGeometry=function(t){lete=t._length,i=t._topRadius,f=t._bottomRadius,o=t._slices,r=t._numberOfVerticalLines;if(e<=0||i<0||f<0||i===0&&f===0)return;leth=o*2,l=M.computePositions(e,i,f,o,!1),p=o*2,E;if(r>0){letO=Math.min(r,o);E=Math.round(o/O),p+=O}lets=N.createTypedArray(h,p*2),u=0,n;for(n=0;n<o-1;n++)s[u++]=n,s[u++]=n+1,s[u++]=n+o,s[u++]=n+1+o;if(s[u++]=o-1,s[u++]=0,s[u++]=o+o-1,s[u++]=o,r>0)for(n=0;n<o;n+=E)s[u++]=n,s[u++]=n+o;let_=newk;_.position=newL({componentDatatype:A.DOUBLE,componentsPerAttribute:3,values:l}),w.x=e*.5,w.y=Math.max(f,i);letg=newy(S.ZERO,R.magnitude(w));if(d(t._offsetAttribute)){e=l.length;letO=t._offsetAttribute===V.NONE?0:1,B=newUint8Array(e/3).fill(O);_.applyOffset=newL({componentDatatype:A.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}returnnewP({attributes:_,indices:s,primitiveType:D.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};varC=a;functionG(t,e){returnd(e)&&(t=C.unpack(t,e)),C.createGeometry(t)}varet=G;export{etasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasd}from"./chunk-J4KLLKML.js";import{aasw}from"./chunk-PWAJ3RAI.js";import"./chunk-R3AL5FUL.js";import"./chunk-AOALMXNW.js";import"./chunk-CXNPIJLB.js";import"./chunk-APUOR5ZJ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import"./chunk-NNHN6WUY.js";import"./chunk-T7ERZ2CJ.js";import"./chunk-GSNDLQ4C.js";import"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import"./chunk-VTVHUB7E.js";import"./chunk-JMSSU44E.js";import"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aask}from"./chunk-VLPNAR64.js";import{aasy}from"./chunk-GE5NEIZC.js";import{a,basp,easr}from"./chunk-35CVRQTC.js";varb=p({"./combineGeometry.js":()=>import("./combineGeometry.js"),"./createBoxGeometry.js":()=>import("./createBoxGeometry.js"),"./createBoxOutlineGeometry.js":()=>import("./createBoxOutlineGeometry.js"),"./createCircleGeometry.js":()=>import("./createCircleGeometry.js"),"./createCircleOutlineGeometry.js":()=>import("./createCircleOutlineGeometry.js"),"./createCoplanarPolygonGeometry.js":()=>import("./createCoplanarPolygonGeometry.js"),"./createCoplanarPolygonOutlineGeometry.js":()=>import("./createCoplanarPolygonOutlineGeometry.js"),"./createCorridorGeometry.js":()=>import("./createCorridorGeometry.js"),"./createCorridorOutlineGeometry.js":()=>import("./createCorridorOutlineGeometry.js"),"./createCylinderGeometry.js":()=>import("./createCylinderGeometry.js"),"./createCylinderOutlineGeometry.js":()=>import("./createCylinderOutlineGeometry.js"),"./createEllipseGeometry.js":()=>import("./createEllipseGeometry.js"),"./createEllipseOutlineGeometry.js":()=>import("./createEllipseOutlineGeometry.js"),"./createEllipsoidGeometry.js":()=>import("./createEllipsoidGeometry.js"),"./createEllipsoidOutlineGeometry.js":()=>import("./createEllipsoidOutlineGeometry.js"),"./createFrustumGeometry.js":()=>import("./createFrustumGeometry.js"),"./createFrustumOutlineGeometry.js":()=>import("./createFrustumOutlineGeometry.js"),"./createGeometry.js":()=>import("./createGeometry.js"),"./createGroundPolylineGeometry.js":()=>import("./createGroundPolylineGeometry.js"),"./createPlaneGeometry.js":()=>import("./createPlaneGeometry.js"),"./createPlaneOutlineGeometry.js":()=>import("./createPlaneOutlineGeometry.js"),"./createPolygonGeometry.js":()=>import("./createPolygonGeometry.js"),"./createPolygonOutlineGeometry.js":()=>import("./createPolygonOutlineGeometry.js"),"./createPolylineGeometry.js":()=>import("./createPolylineGeometry.js"),"./createPolylineVolumeGeometry.js":()=>import("./createPolylineVolumeGeometry.js"),"./createPolylineVolumeOutlineGeometry.js":()=>import("./createPolylineVolumeOutlineGeometry.js"),"./createRectangleGeometry.js":()=>import("./createRectangleGeometry.js"),"./createRectangleOutlineGeometry.js":()=>import("./createRectangleOutlineGeometry.js"),"./createSimplePolylineGeometry.js":()=>import("./createSimplePolylineGeometry.js"),"./createSphereGeometry.js":()=>import("./createSphereGeometry.js"),"./createSphereOutlineGeometry.js":()=>import("./createSphereOutlineGeometry.js"),"./createTaskProcessorWorker.js":()=>import("./createTaskProcessorWorker.js"),"./createVectorTileClampedPolylines.js":()=>import("./createVectorTileClampedPolylines.js"),"./createVectorTileGeometries.js":()=>import("./createVectorTileGeometries.js"),"./createVectorTilePoints.js":()=>import("./createVectorTilePoints.js"),"./createVectorTilePolygons.js":()=>import("./createVectorTilePolygons.js"),"./createVectorTilePolylines.js":()=>import("./createVectorTilePolylines.js"),"./createVerticesFromGoogleEarthEnterpriseBuffer.js":()=>import("./createVerticesFromGoogleEarthEnterpriseBuffer.js"),"./createVerticesFromHeightmap.js":()=>import("./createVerticesFromHeightmap.js"),"./createVerticesFromQuantizedTerrainMesh.js":()=>import("./createVerticesFromQuantizedTerrainMesh.js"),"./createWallGeometry.js":()=>import("./createWallGeometry.js"),"./createWallOutlineGeometry.js":()=>import("./createWallOutlineGeometry.js"),"./decodeDraco.js":()=>import("./decodeDraco.js"),"./decodeGoogleEarthEnterprisePacket.js":()=>import("./decodeGoogleEarthEnterprisePacket.js"),"./decodeI3S.js":()=>import("./decodeI3S.js"),"./transcodeKTX2.js":()=>import("./transcodeKTX2.js"),"./transferTypedArrayTest.js":()=>import("./transferTypedArrayTest.js"),"./upsampleQuantizedTerrainMesh.js":()=>import("./upsampleQuantizedTerrainMesh.js")});varf={};asyncfunctionh(s,t){lete=k(f[t],f[s]);returnr(e)?e:r(t)?(typeofexports=="object"?e=a(t):e=(awaitimport(t)).default,f[t]=e,e):(typeofexports=="object"?e=a(`Workers/${s}`):e=(r(t)?awaitimport(t):awaitb(`./${s}.js`)).default,f[s]=e,e)}asyncfunctionx(s,t){lete=s.subTasks,n=e.length,u=newArray(n);for(leto=0;o<n;o++){leti=e[o],m=i.geometry,l=i.moduleName,c=i.modulePath;if(r(l)&&r(c))thrownewy("Must only set moduleName or modulePath");r(l)||r(c)?u[o]=h(l,c).then(g=>g(m,i.offset)):u[o]=m}returnPromise.all(u).then(function(o){returnd.packCreateGeometryResults(o,t)})}varP=w(x);export{Pasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aas_e}from"./chunk-R3AL5FUL.js";import{aasZ}from"./chunk-GHQSI7F2.js";import{aas_t}from"./chunk-APUOR5ZJ.js";import{aasOe}from"./chunk-ZPYKVVFF.js";import{aasLe}from"./chunk-WNTCOVG2.js";import{aaste}from"./chunk-EEKB62LQ.js";import{basQt}from"./chunk-V3DSE3OK.js";import{aasjt}from"./chunk-FMRIJYNG.js";import{casCe,daszt}from"./chunk-GSNDLQ4C.js";import{aasbt,dasG}from"./chunk-BKSIEBAA.js";import{dasxe,easNe,fasKt,hasU}from"./chunk-YWRPWWKI.js";import{aasBt}from"./chunk-VTVHUB7E.js";import{aast,basu,casPt,dasz,easvt}from"./chunk-JMSSU44E.js";import{aasp}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasO}from"./chunk-VLPNAR64.js";import{aasSt,baset}from"./chunk-GE5NEIZC.js";import{easg}from"./chunk-35CVRQTC.js";functionrt(e){e=O(e,O.EMPTY_OBJECT),this._ellipsoid=O(e.ellipsoid,z.default),this._rectangle=O(e.rectangle,U.MAX_VALUE),this._projection=newbt(this._ellipsoid),this._numberOfLevelZeroTilesX=O(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=O(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},rectangle:{get:function(){returnthis._rectangle}},projection:{get:function(){returnthis._projection}}});rt.prototype.getNumberOfXTilesAtLevel=function(e){returnthis._numberOfLevelZeroTilesX<<e};rt.prototype.getNumberOfYTilesAtLevel=function(e){returnthis._numberOfLevelZeroTilesY<<e};rt.prototype.rectangleToNativeRectangle=function(e,i){et.defined("rectangle",e);letr=p.toDegrees(e.west),n=p.toDegrees(e.south),o=p.toDegrees(e.east),a=p.toDegrees(e.north);returng(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):newU(r,n,o,a)};rt.prototype.tileXYToNativeRectangle=function(e,i,r,n){leto=this.tileXYToRectangle(e,i,r,n);returno.west=p.toDegrees(o.west),o.south=p.toDegrees(o.south),o.east=p.toDegrees(o.east),o.north=p.toDegrees(o.north),o};rt.prototype.tileXYToRectangle=function(e,i,r,n){leto=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=o.width/a,s=e*l+o.west,d=(e+1)*l+o.west,h=o.height/c,N=o.north-i*h,S=o.north-(i+1)*h;returng(n)||(n=newU(s,S,d,N)),n.west=s,n.south=S,n.east=d,n.north=N,n};rt.prototype.positionToTileXY=function(e,i,r){letn=this._rectangle;if(!U.contains(n,e))return;leto=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=n.width/o,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);letd=(s-n.west)/c|0;d>=o&&(d=o-1);leth=(n.north-e.latitude)/l|0;returnh>=a&&(h=a-1),g(r)?(r.x=d,r.y=h,r):newPt(d,h)};varDe=rt;varIe=newt,He=newt,ke=newu,ee=newt,hn=newt,ye=newG,pn=newDe,Lt=[newu,newu,newu,newu],Ot=newPt,w={};w.initialize=function(){lete=w._initPromise;returng(e)||(e=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(i){w._terrainHeights=i}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))thrownewSt("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);letr=Ae(e),n=w._defaultMinTerrainHeight,o=w._defaultMaxTerrainHeight;if(g(r)){leta=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[0],o=c[1]),i.cartographicToCartesian(U.northeast(e,ke),Ie),i.cartographicToCartesian(U.southwest(e,ke),He),t.midpoint(He,Ie,ee);letl=i.scaleToGeodeticSurface(ee,hn);if(g(l)){lets=t.distance(ee,l);n=Math.min(n,-s)}elsen=w._defaultMinTerrainHeight}returnn=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:o}};w.getBoundingSphere=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))thrownewSt("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);letr=Ae(e),n=w._defaultMaxTerrainHeight;if(g(r)){leta=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[1])}leto=G.fromRectangle3D(e,i,0);returnG.fromRectangle3D(e,i,n,ye),G.union(o,ye,o)};functionAe(e){u.fromRadians(e.east,e.north,0,Lt[0]),u.fromRadians(e.west,e.north,0,Lt[1]),u.fromRadians(e.east,e.south,0,Lt[2]),u.fromRadians(e.west,e.south,0,Lt[3]);leti=0,r=0,n=0,o=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){letl=!1;for(lets=0;s<4;++s){letd=Lt[s];if(pn.positionToTileXY(d,c,Ot),s===0)n=Ot.x,o=Ot.y;elseif(n!==Ot.x||o!==Ot.y){l=!0;break}}if(l)break;i=n,r=o}if(c!==0)return{x:i,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void0;w._initPromise=void0;Object.defineProperties(w,{initialized:{get:function(){returng(w._terrainHeights)}}});varXt=w;varle=[bt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;functionct(e){e=O(e,O.EMPTY_OBJECT);leti=e.positions;if(!g(i)||i.length<2)thrownewSt("At least two positions are required.");if(g(e.arcType)&&e.arcType!==Z.GEODESIC&&e.arcType!==Z.RHUMB)thrownewSt("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=O(e.width,1),this._positions=i,this.granularity=O(e.granularity,9999),this.loop=O(e.loop,!1),this.arcType=O(e.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return1+this._positions.length*3+1+1+1+z.packedLength+1+1}}});ct.setProjectionAndEllipsoid=function(e,i){letr=0;for(letn=0;n<dn;n++)if(iinstanceofle[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=i.ellipsoid};varfn=newt,Re=newt,Pe=newt;functionse(e,i,r,n,o){leta=P(n,e,0,fn),c=P(n,e,r,Re),l=P(n,i,0,Pe),s=nt(c,a,Re),d=nt(l,a,Pe);returnt.cross(d,s,o),t.normalize(o,o)}varmn=newu,gn=newt,un=newt,wn=newt;functionne(e,i,r,n,o,a,c,l,s,d,h){if(o===0)return;letN;a===Z.GEODESIC?N=newOe(e,i,c):a===Z.RHUMB&&(N=newte(e,i,c));letS=N.surfaceDistance;if(S<o)return;letR=se(e,i,n,c,wn),D=Math.ceil(S/o),I=S/D,j=I,q=D-1,f=l.length;for(letX=0;X<q;X++){letv=N.interpolateUsingSurfaceDistance(j,mn),y=P(c,v,r,gn),H=P(c,v,n,un);t.pack(R,l,f),t.pack(y,s,f),t.pack(H,d,f),h.push(v.latitude),h.push(v.longitude),f+=3,j+=I}}varoe=newu;functionP(e,i,r,n){returnu.clone(i,oe),oe.height=r,u.toCartesian(oe,e,n)}ct.pack=function(e,i,r){et.typeOf.object("value",e),et.defined("array",i);letn=O(r,0),o=e._positions,a=o.length;i[n++]=a;for(letc=0;c<a;++c){letl=o[c];t.pack(l,i,n),n+=3}returni[n++]=e.granularity,i[n++]=e.loop?1:0,i[n++]=e.arcType,z.pack(e._ellipsoid,i,n),n+=z.packedLength,i[n++]=e._projectionIndex,i[n++]=e._scene3DOnly?1:0,i};ct.unpack=function(e,i,r){et.defined("array",e);letn=O(i,0),o=e[n++],a=newArray(o);for(letS=0;S<o;S++)a[S]=t.unpack(e,n),n+=3;letc=e[n++],l=e[n++]===1,s=e[n++],d=z.unpack(e,n);n+=z.packedLength;leth=e[n++],N=e[n++]===1;returng(r)||(r=newct({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=N,r};functionnt(e,i,r){returnt.subtract(e,i,r),t.normalize(r,r),r}functionbe(e,i,r,n){returnn=nt(e,i,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}varSn=newt,Tn=newt,En=newt,en=newt,xn=0,Nn=-1;functionie(e,i,r,n,o){leta=nt(r,i,en),c=be(e,i,a,Sn),l=be(n,i,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))returno=t.cross(a,c,o),o=t.normalize(o,o),o;o=t.add(l,c,o),o=t.normalize(o,o);lets=t.cross(a,o,En);returnt.dot(l,s)<xn&&(o=t.negate(o,o)),o}varGt=jt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=newt,_n=newt,Ln=newt,On=newt,Dn=newt,Yt=newt,Ft=newu,ve=newu,Be=newu;ct.createGeometry=function(e){leti=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,o=e.granularity,a=e.arcType,c=newle[e._projectionIndex](n),l=Qe,s=tn,d,h,N=e._positions,S=N.length;S===2&&(r=!1);letR,D,I,j,q=newte(void0,void0,n),f,X,v,y=[N[0]];for(h=0;h<S-1;h++)R=N[h],D=N[h+1],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))),y.push(D);r&&(R=N[S-1],D=N[0],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))));letH=y.length,C=newArray(H);for(h=0;h<H;h++){letF=u.fromCartesian(y[h],n);F.height=0,C[h]=F}if(C=Le(C,u.equalsEpsilon),H=C.length,H<2)return;letk=[],b=[],B=[],E=[],x=Cn,L=_n,_=Ln,Y=On,A=Dn,m=C[0],V=C[1],It=C[H-1];for(x=P(n,It,l,x),Y=P(n,V,l,Y),L=P(n,m,l,L),_=P(n,m,s,_),r?A=ie(x,L,_,Y,A):A=se(m,V,s,n,A),t.pack(A,b,0),t.pack(L,B,0),t.pack(_,E,0),k.push(m.latitude),k.push(m.longitude),ne(m,V,l,s,o,a,n,b,B,E,k),h=1;h<H-1;++h){x=t.clone(L,x),L=t.clone(Y,L);letF=C[h];P(n,F,s,_),P(n,C[h+1],l,Y),ie(x,L,_,Y,A),d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(F.latitude),k.push(F.longitude),ne(C[h],C[h+1],l,s,o,a,n,b,B,E,k)}letM=C[H-1],Tt=C[H-2];if(L=P(n,M,l,L),_=P(n,M,s,_),r){letF=C[0];x=P(n,Tt,l,x),Y=P(n,F,l,Y),A=ie(x,L,_,Y,A)}elseA=se(Tt,M,s,n,A);if(d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(M.latitude),k.push(M.longitude),r){for(ne(M,m,l,s,o,a,n,b,B,E,k),d=b.length,h=0;h<3;++h)b[d+h]=b[h],B[d+h]=B[h],E[d+h]=E[h];k.push(m.latitude),k.push(m.longitude)}returnQn(r,c,B,E,b,k,i)};varIn=newt,Hn=newvt,kn=newKt;functionze(e,i,r,n){leto=nt(r,i,In),a=t.dot(o,e);if(a>Ke||a<Me){letc=nt(n,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Kt.fromAxisAngle(c,l,kn),d=vt.fromQuaternion(s,Hn);returnvt.multiplyByVector(d,e,e),!0}return!1}varje=newu,yn=newt,Xe=newt;functionDt(e,i,r,n,o){leta=u.toCartesian(i,e._ellipsoid,yn),c=t.add(a,r,Xe),l=!1,s=e._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(i.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Xe),d=s.cartesianToCartographic(c,je)),d.height=0;leth=e.project(d,o);returno=t.subtract(h,n,o),o.z=0,o=t.normalize(o,o),l&&t.negate(o,o),o}varAn=newt,Ye=newt;functionFe(e,i,r,n,o,a){letc=t.subtract(i,e,An);t.normalize(c,c);letl=r-Qe,s=t.multiplyByScalar(c,l,Ye);t.add(e,s,o);letd=n-tn;s=t.multiplyByScalar(c,d,Ye),t.add(i,s,a)}varMn=newt;functionUt(e,i){letr=jt.getPointDistance(Gt,e),n=jt.getPointDistance(Gt,i),o=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(o=nt(i,e,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(e,o,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(o=nt(e,i,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(i,o,i))}functionRn(e,i){letr=Math.abs(e.longitude),n=Math.abs(i.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){leto=p.sign(i.longitude);returne.longitude=o*(r-p.EPSILON11),1}elseif(p.equalsEpsilon(n,p.PI,p.EPSILON11)){leto=p.sign(e.longitude);returni.longitude=o*(n-p.EPSILON11),2}return0}varnn=newu,on=newu,Ue=newt,re=newt,Ge=newt,qe=newt,Pn=newt,We=newt,bn=[nn,on],vn=newU,Bn=newt,zn=newt,jn=newt,Xn=newt,Yn=newt,Fn=newt,ae=newt,ce=newt,Un=newt,Gn=newt,qn=newt,Ze=newt,Wn=newt,Zn=newt,Vn=new_t,$n=new_t,Ve=newt,Jn=newt,$e=newt,Kn=[newG,newG],rn=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Je=rn.length;functionQn(e,i,r,n,o,a,c){letl,s,d=i._ellipsoid,h=r.length/3-1,N=h*8,S=N*4,R=h*36,D=N>65535?newUint32Array(R):newUint16Array(R),I=newFloat64Array(N*3),j=newFloat32Array(S),q=newFloat32Array(S),f=newFloat32Array(S),X=newFloat32Array(S),v=newFloat32Array(S),y,H,C,k;c&&(y=newFloat32Array(S),H=newFloat32Array(S),C=newFloat32Array(S),k=newFloat32Array(N*2));letb=a.length/2,B=0,E=nn;E.height=0;letx=on;x.height=0;letL=Ue,_=re;if(c)for(s=0,l=1;l<b;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],L=i.project(E,L),_=i.project(x,_),B+=t.distance(L,_),s+=2;letY=n.length/3;_=t.unpack(n,0,_);letA=0;for(s=3,l=1;l<Y;l++)L=t.clone(_,L),_=t.unpack(n,s,_),A+=t.distance(L,_),s+=3;letm;s=3;letV=0,It=0,M=0,Tt=0,F=!1,st=t.unpack(r,0,qe),lt=t.unpack(n,0,re),W=t.unpack(o,0,We);if(e){letht=t.unpack(r,r.length-6,Ge);ze(W,ht,st,lt)&&(W=t.negate(W,W))}letpe=0,de=0,qt=0;for(l=0;l<h;l++){letht=t.clone(st,Ge),Zt=t.clone(lt,Ue),mt=t.clone(W,Pn);F&&(mt=t.negate(mt,mt)),st=t.unpack(r,s,qe),lt=t.unpack(n,s,re),W=t.unpack(o,s,We),F=ze(W,ht,st,lt),E.latitude=a[V],E.longitude=a[V+1],x.latitude=a[V+2],x.longitude=a[V+3];letpt,gt,ot,it;if(c){letT=Rn(E,x);pt=i.project(E,Yn),gt=i.project(x,Fn);letwt=nt(gt,pt,Ve);wt.y=Math.abs(wt.y),ot=ae,it=ce,T===0||t.dot(wt,t.UNIT_Y)>Ke?(ot=Dt(i,E,mt,pt,ae),it=Dt(i,x,W,gt,ce)):T===1?(it=Dt(i,x,W,gt,ce),ot.x=0,ot.y=p.sign(E.longitude-Math.abs(x.longitude)),ot.z=0):(ot=Dt(i,E,mt,pt,ae),it.x=0,it.y=p.sign(E.longitude-x.longitude),it.z=0)}letge=t.distance(Zt,lt),ue=_t.fromCartesian(ht,Vn),Ht=t.subtract(st,ht,Un),an=t.normalize(Ht,Ze),xt=t.subtract(Zt,ht,Gn);xt=t.normalize(xt,xt);letut=t.cross(an,xt,Ze);ut=t.normalize(ut,ut);letkt=t.cross(xt,mt,Wn);kt=t.normalize(kt,kt);letyt=t.subtract(lt,st,qn);yt=t.normalize(yt,yt);letAt=t.cross(W,yt,Zn);At=t.normalize(At,At);letcn=ge/A,sn=pe/A,Vt=0,Nt,Mt,dt,we=0,Se=0;if(c){Vt=t.distance(pt,gt),Nt=_t.fromCartesian(pt,$n),Mt=t.subtract(gt,pt,Ve),dt=t.normalize(Mt,Jn);letT=dt.x;dt.x=dt.y,dt.y=-T,we=Vt/B,Se=de/B}for(m=0;m<8;m++){letT=Tt+m*4,wt=It+m*2,Ct=T+3,Ee=m<4?1:-1,Rt=m===2||m===3||m===6||m===7?1:-1;t.pack(ue.high,j,T),j[Ct]=Ht.x,t.pack(ue.low,q,T),q[Ct]=Ht.y,t.pack(kt,f,T),f[Ct]=Ht.z,t.pack(At,X,T),X[Ct]=cn*Ee,t.pack(ut,v,T);letft=sn*Rt;ft===0&&Rt<0&&(ft=9),v[Ct]=ft,c&&(y[T]=Nt.high.x,y[T+1]=Nt.high.y,y[T+2]=Nt.low.x,y[T+3]=Nt.low.y,C[T]=-ot.y,C[T+1]=ot.x,C[T+2]=it.y,C[T+3]=-it.x,H[T]=Mt.x,H[T+1]=Mt.y,H[T+2]=dt.x,H[T+3]=dt.y,k[wt]=we*Ee,ft=Se*Rt,ft===0&&Rt<0&&(ft=9),k[wt+1]=ft)}let$=jn,J=Xn,K=Bn,Q=zn,ln=U.fromCartographicArray(bn,vn),Te=Xt.getMinimumMaximumHeights(ln,d),$t=Te.minimumTerrainHeight,Jt=Te.maximumTerrainHeight;qt+=Math.abs($t),qt+=Math.abs(Jt),Fe(ht,Zt,$t,Jt,$,K),Fe(st,lt,$t,Jt,J,Q);lettt=t.multiplyByScalar(ut,p.EPSILON5,$e);t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M),t.pack(J,I,M+3),t.pack(Q,I,M+6),t.pack(K,I,M+9),tt=t.multiplyByScalar(ut,-2*p.EPSILON5,$e),t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M+12),t.pack(J,I,M+15),t.pack(Q,I,M+18),t.pack(K,I,M+21),V+=2,s+=3,It+=16,M+=24,Tt+=32,pe+=ge,de+=Vt}s=0;letfe=0;for(l=0;l<h;l++){for(m=0;m<Je;m++)D[s+m]=rn[m]+fe;fe+=8,s+=Je}letWt=Kn;G.fromVertices(r,t.ZERO,3,Wt[0]),G.fromVertices(n,t.ZERO,3,Wt[1]);letme=G.fromBoundingSpheres(Wt);me.radius+=qt/(h*2);letEt={position:newzt({componentDatatype:Bt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:at(j),startLoAndForwardOffsetY:at(q),startNormalAndForwardOffsetZ:at(f),endNormalAndTextureCoordinateNormalizationX:at(X),rightNormalAndTextureCoordinateNormalizationY:at(v)};returnc&&(Et.startHiLo2D=at(y),Et.offsetAndRight2D=at(H),Et.startEndNormals2D=at(C),Et.texcoordNormalization2D=newzt({componentDatatype:Bt.FLOAT,componentsPerAttribute:2,normalize:!1,values:k})),newCe({attributes:Et,indices:D,boundingSphere:me})}functionat(e){returnnewzt({componentDatatype:Bt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ct._projectNormal=Dt;varhe=ct;functionto(e,i){returnXt.initialize().then(function(){returng(i)&&(e=he.unpack(e,i)),he.createGeometry(e)})}varti=to;export{tiasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasdt}from"./chunk-4IMXHKCA.js";import{aasF}from"./chunk-D4TZ3IL5.js";import{aasat}from"./chunk-GHQSI7F2.js";import{aasst}from"./chunk-KM43AUZL.js";import{aasbt}from"./chunk-AOALMXNW.js";import"./chunk-CXNPIJLB.js";import"./chunk-APUOR5ZJ.js";import{aasht}from"./chunk-ZFTFDHK4.js";import{aasQ}from"./chunk-74GQJJ7R.js";import{aasK}from"./chunk-FNJKWSPR.js";import"./chunk-KSZ5EBRB.js";import{aasgt,basnt}from"./chunk-CKMJZ5B3.js";import"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import{aaswt,basyt}from"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aaslt}from"./chunk-NNHN6WUY.js";import"./chunk-T7ERZ2CJ.js";import{casmt,dastt}from"./chunk-GSNDLQ4C.js";import{dasTt}from"./chunk-BKSIEBAA.js";import{fasct,has_t}from"./chunk-YWRPWWKI.js";import{aas$}from"./chunk-VTVHUB7E.js";import{aasc,basot,casO,dasV,easU}from"./chunk-JMSSU44E.js";import{aasl}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasL}from"./chunk-VLPNAR64.js";import{aasut,basq}from"./chunk-GE5NEIZC.js";import{easP}from"./chunk-35CVRQTC.js";functionb(t,e){this.position=t,P(this.position)||(this.position=newO),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){returnthis.tangentPlane.ellipsoid}},x:{get:function(){returnthis.position.x}},y:{get:function(){returnthis.position.y}},conformalLatitude:{get:function(){lett=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;returnthis.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){lett=l.PI_OVER_TWO+Math.atan2(this.y,this.x);returnt>Math.PI&&(t-=l.TWO_PI),t}}});varit=newot,Rt=newc;b.prototype.getLatitude=function(t){P(t)||(t=V.default),it.latitude=this.conformalLatitude,it.longitude=this.longitude,it.height=0;lete=this.ellipsoid.cartographicToCartesian(it,Rt);returnt.cartesianToCartographic(e,it),it.latitude};varIt=newwt,Lt=newc,Ft=newc;b.fromCartesian=function(t,e){q.defined("cartesian",t);leto=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);leti=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);letr=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);returnP(e)?(e.position=newO(d,p),e.tangentPlane=n,e):newb(newO(d,p),n)};b.fromCartesianArray=function(t,e){q.defined("cartesians",t);leto=t.length;P(e)?e.length=o:e=newArray(o);for(letn=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);returne};b.clone=function(t,e){if(P(t))returnP(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):newb(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(newV(.5,.5,.5));b.NORTH_POLE=Object.freeze(newc(0,0,.5));b.SOUTH_POLE=Object.freeze(newc(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(newK(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(newK(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));varD=b;varvt=newot,Ot=newot;functionSt(t,e,o,n){leti=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);letf=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}varEt=newdt,Vt=newc,Bt=newc,Mt=newc,jt=newc,kt=newc,zt=newc,ft=newc,Z=newc,rt=newc,Dt=newO,Ut=newO,Wt=newc,At=newct,Gt=newU,Yt=newU;functionpt(t){lete=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){letw=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,j=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;letB=e.st?newFloat32Array(2*(r/3)):void0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=newFloat32Array(r));letE=e.tangent?newFloat32Array(r):void0,A=e.bitangent?newFloat32Array(r):void0,v=n?newFloat32Array(r):void0,T=0,y=0,_=Bt,h=Mt,g=jt,k=!0,Y=Gt,J=Yt;if(j!==0){letM=ct.fromAxisAngle(a,j,At);Y=U.fromQuaternion(M,Y),M=ct.fromAxisAngle(a,-j,At),J=U.fromQuaternion(M,J)}elseY=U.clone(U.IDENTITY,Y),J=U.clone(U.IDENTITY,J);letm=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(letM=0;M<r;M+=3){letz=c.fromArray(s,M,Wt);if(e.st&&!P(i)){letN=U.multiplyByVector(Y,z,Vt);N=x.scaleToGeodeticSurface(N,N);letS=H([N],Ut)[0];O.subtract(S,R,S);letX=l.clamp(S.x/w.width,0,1),et=l.clamp(S.y/w.height,0,1);p&&(B[T+I]=X,B[T+1+I]=et),d&&(B[T]=X,B[T+1]=et),T+=2}if(e.normal||e.tangent||e.bitangent||n){letN=y+1,S=y+2;if(f){if(M+3<r){letX=c.fromArray(s,M+3,kt);if(k){letet=c.fromArray(s,M+r,zt);C&&St(z,X,et,x),c.subtract(X,z,X),c.subtract(et,z,et),_=c.normalize(c.cross(et,X,_),_),k=!1}c.equalsEpsilon(X,z,l.EPSILON10)&&(k=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(z,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else_=x.geodeticSurfaceNormal(z,_),(e.tangent||e.bitangent)&&(C&&(ft=c.fromArray(u,y,ft),Z=c.cross(c.UNIT_Z,ft,Z),Z=c.normalize(U.multiplyByVector(J,Z,Z),Z),e.bitangent&&(rt=c.normalize(c.cross(ft,Z,rt),rt))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(U.multiplyByVector(J,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[S+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[S+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[S]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(z,_)),v[y+m]=-_.x,v[N+m]=-_.y,v[S+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[S+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[S+m]=-h.z),d&&(C?(E[y]=Z.x,E[N]=Z.y,E[S]=Z.z):(E[y]=h.x,E[N]=h.y,E[S]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[S+m]=g.z),d&&(C?(A[y]=rt.x,A[N]=rt.y,A[S]=rt.z):(A[y]=g.x,A[N]=g.y,A[S]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=newtt({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:B})),e.normal&&(o.attributes.normal=newtt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=newtt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=newtt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=newtt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(t.extrude&&P(t.offsetAttribute)){letw=s.length/3,a=newUint8Array(w);if(t.offsetAttribute===ht.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{letH=t.offsetAttribute===ht.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=newtt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}returno}varHt=[];functionqt(t,e,o,n,s,i,r,f,d,p){letw={walls:[]},a;if(r||f){letu=F.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,v,T;if(r&&f){lety=E.concat(E);v=y.length/3,T=lt.createTypedArray(v,A.length*2),T.set(A);let_=A.length,h=v/2;for(a=0;a<_;a+=3){letg=T[a]+h,k=T[a+1]+h,Y=T[a+2]+h;T[a+_]=Y,T[a+1+_]=k,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){letg=u.attributes.normal.values;u.attributes.normal.values=newFloat32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){letg=u.attributes.st.values;u.attributes.st.values=newFloat32Array(v*2),u.attributes.st.values=g.concat(g)}u.indices=T}elseif(f){for(v=E.length/3,T=lt.createTypedArray(v,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=newst({geometry:u})}letH=s.outerRing,x=K.fromPoints(H,t),j=x.projectPointsOntoPlane(H,Ht),C=nt.computeWindingOrder2D(j);C===gt.CLOCKWISE&&(H=H.slice().reverse());letR=F.computeWallGeometry(H,o,t,n,i,p);w.walls.push(newst({geometry:R}));letB=s.holes;for(a=0;a<B.length;a++){letu=B[a];j=x.projectPointsOntoPlane(u,Ht),C=nt.computeWindingOrder2D(j),C===gt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=F.computeWallGeometry(u,o,t,n,i,p),w.walls.push(newst({geometry:R}))}returnw}functionG(t){if(q.typeOf.object("options",t),q.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))thrownewut("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==at.GEODESIC&&t.arcType!==at.RHUMB)thrownewut("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");lete=t.polygonHierarchy,o=L(t.vertexFormat,Q.DEFAULT),n=L(t.ellipsoid,V.default),s=L(t.granularity,l.RADIANS_PER_DEGREE),i=L(t.stRotation,0),r=t.textureCoordinates,f=L(t.perPositionHeight,!1),d=f&&P(t.extrudedHeight),p=L(t.height,0),w=L(t.extrudedHeight,p);if(!d){leta=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=Q.clone(o),this._ellipsoid=V.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=L(t.closeTop,!0),this._closeBottom=L(t.closeBottom,!0),this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=L(t.arcType,at.GEODESIC),this._rectangle=void0,this._textureCoordinateRotationPoints=void0,this._textureCoordinates=r,this.packedLength=F.computeHierarchyPackedLength(e,c)+V.packedLength+Q.packedLength+(r?F.computeHierarchyPackedLength(r,O):1)+12}G.fromPositions=function(t){t=L(t,L.EMPTY_OBJECT),q.defined("options.positions",t.positions);lete={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};returnnewG(e)};G.pack=function(t,e,o){returnq.typeOf.object("value",t),q.defined("array",e),o=L(o,0),o=F.packPolygonHierarchy(t._polygonHierarchy,e,o,c),V.pack(t._ellipsoid,e,o),o+=V.packedLength,Q.pack(t._vertexFormat,e,o),o+=Q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=L(t._offsetAttribute,-1),e[o++]=t._arcType,P(t._textureCoordinates)?o=F.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o++]=t.packedLength,e};varQt=V.clone(V.UNIT_SPHERE),Zt=newQ,Kt={polygonHierarchy:{}};G.unpack=function(t,e,o){q.defined("array",t),e=L(e,0);letn=F.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,deleten.startingIndex;lets=V.unpack(t,e,Qt);e+=V.packedLength;leti=Q.unpack(t,e,Zt);e+=Q.packedLength;letr=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,j=t[e++]===1,C=t[e++],R=t[e++],B=t[e]===-1?void0:F.unpackPolygonHierarchy(t,e,O);P(B)?(e=B.startingIndex,deleteB.startingIndex):e++;letu=t[e++];returnP(o)||(o=newG(Kt)),o._polygonHierarchy=n,o._ellipsoid=V.clone(s,o._ellipsoid),o._vertexFormat=Q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=j,o._offsetAttribute=C===-1?void0:C,o._arcType=R,o._textureCoordinates=B,o.packedLength=u,o};varJt=newO,Xt=newO,$t=newD;functionxt(t,e,o,n,s,i){letr=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);letd=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==at.RHUMB){letH=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){letj=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=D.clone(e,$t);C.position=j;letR=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}letw=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}varCt=newD,te=newD,W={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};G.computeRectangleFromPositions=function(t,e,o,n){if(q.defined("positions",t),P(n)||(n=new_t),t.length<3)returnn;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,W.northAngle=0,W.southAngle=0,W.westOverIdl=Number.POSITIVE_INFINITY,W.eastOverIdl=Number.NEGATIVE_INFINITY;lets=t.length,i=D.fromCartesian(t[0],te);for(letr=1;r<s;r++){letf=D.fromCartesian(t[r],Ct);xt(f,i,e,o,W,n),i=D.clone(f,i)}returnxt(D.fromCartesian(t[0],Ct),i,e,o,W,n),n.east-n.west>W.eastOverIdl-W.westOverIdl&&(n.west=W.westOverIdl,n.east=W.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(W.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(W.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};varee=newD;functionoe(t,e,o){returnt.height>=l.PI||t.width>=l.PI?D.fromCartesian(e[0],ee).tangentPlane:K.fromPoints(e,o)}varNt=newot;functionne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(letr=0;r<n.length;++r){letf=o.cartesianToCartographic(n[r],Nt);s[r]=newO(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}returns.length=n.length,s}returnD.fromCartesianArray(n,s)}returnK.fromPoints(e,o).projectPointsOntoPlane(n,s)}}functionie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){letr=o.cartesianToCartographic(s,Nt);returnP(i)||(i=newO),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}returnD.fromCartesian(s,i)};letn=K.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}functionre(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?F.splitPolygonsOnEquator(s,e,o,i):s}functionse(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)returndt.fromRectangle(e,void0,Et);lets=t,i=K.fromPoints(s,o);returnF.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}G.createGeometry=function(t){lete=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;letx=t.rectangle,j=F.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=j.hierarchy,R=j.polygons,B=function(m){returnm},u=a?F.polygonsFromHierarchy(w,!0,B,!1,o).polygons:void0;if(C.length===0)return;letE=C[0].outerRing,A=se(E,x,o,s),v=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){letm=qt(o,R[g],a?u[g]:void0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=F.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=pt(h),v.push(I));letM=m.walls;h.wall=!0;for(letz=0;z<M.length;z++){letN=M[z];h.geometry=F.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=pt(h),v.push(N)}}elsefor(g=0;g<R.length;g++){letm=newst({geometry:F.createGeometryFromPositions(o,R[g],a?u[g]:void0,n,r,e,p)});if(m.geometry.attributes.position.values=nt.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=pt(h),P(t._offsetAttribute)){letI=m.geometry.attributes.position.values.length,M=t._offsetAttribute===ht.NONE?0:1,z=newUint8Array(I/3).fill(M);m.geometry.attributes.applyOffset=newtt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}v.push(m)}letk=bt.combineInstances(v)[0];k.attributes.position.values=newFloat64Array(k.attributes.position.values),k.indices=lt.createTypedArray(k.attributes.position.values.length/3,k.indices);letY=k.attributes,J=Tt.fromVertices(Y.position.values);returne.position||deleteY.position,newmt({attributes:Y,indices:k.indices,primitiveType:k.primitiveType,boundingSphere:J,offsetAttribute:t._offsetAttribute})};G.createShadowVolume=function(t,e,o){letn=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);returnnewG({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:Q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};functionae(t){lete=-t._stRotation;if(e===0)return[0,0,0,1,1,0];leto=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;returnmt._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(G.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){lett=this._polygonHierarchy.positions;this._rectangle=G.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}returnthis._rectangle}},textureCoordinateRotationPoints:{get:function(){returnP(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});varPt=G;functionce(t,e){returnP(e)&&(t=Pt.unpack(t,e)),t._ellipsoid=V.clone(t._ellipsoid),Pt.createGeometry(t)}varXe=ce;export{Xeasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a}from"./chunk-D4TZ3IL5.js";import{aasb}from"./chunk-GHQSI7F2.js";import{aasF}from"./chunk-KM43AUZL.js";import{aasV}from"./chunk-AOALMXNW.js";import"./chunk-CXNPIJLB.js";import"./chunk-APUOR5ZJ.js";import{aasD}from"./chunk-ZFTFDHK4.js";import{aasW}from"./chunk-FNJKWSPR.js";import"./chunk-KSZ5EBRB.js";import{aasj,bask}from"./chunk-CKMJZ5B3.js";import"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasM}from"./chunk-NNHN6WUY.js";import{aasG}from"./chunk-T7ERZ2CJ.js";import{basB,casC,dasv}from"./chunk-GSNDLQ4C.js";import{dasz}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasw}from"./chunk-VTVHUB7E.js";import{aasS,dasy}from"./chunk-JMSSU44E.js";import{aasT}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasP}from"./chunk-VLPNAR64.js";import{aasU,basA}from"./chunk-GE5NEIZC.js";import{easO}from"./chunk-35CVRQTC.js";varY=[],R=[];functionK(e,t,r,H,l){letp=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());letn,i,o=t.length,c=0;if(H)for(n=newFloat64Array(o*2*3),i=0;i<o;i++){letu=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{letu=0;if(l===b.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);elseif(l===b.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=newFloat64Array(u*3),i=0;i<o;i++){leth;l===b.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));letg=h.length;for(letd=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;letf=o*2,m=M.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;returnm[c++]=o-1,m[c++]=0,newF({geometry:newC({attributes:newG({position:newv({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:B.LINES})})}functionq(e,t,r,H,l){letp=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());letn,i,o=t.length,c=newArray(o),f=0;if(H)for(n=newFloat64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;letg=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{letg=0;if(l===b.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);elseif(l===b.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=newFloat64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;letd;l===b.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));letE=d.length;for(letN=0;N<E;++N)n[f++]=d[N]}}o=n.length/(3*2);letm=c.length,u=(o*2+m)*2,h=M.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){letg=c[i];h[f++]=g,h[f++]=g+o}returnnewF({geometry:newC({attributes:newG({position:newv({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:B.LINES})})}functionL(e){if(A.typeOf.object("options",e),A.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&O(e.height))thrownewU("Cannot use both options.perPositionHeight and options.height");if(O(e.arcType)&&e.arcType!==b.GEODESIC&&e.arcType!==b.RHUMB)thrownewU("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");lett=e.polygonHierarchy,r=P(e.ellipsoid,y.default),H=P(e.granularity,T.RADIANS_PER_DEGREE),l=P(e.perPositionHeight,!1),_=l&&O(e.extrudedHeight),p=P(e.arcType,b.GEODESIC),s=P(e.height,0),n=P(e.extrudedHeight,s);if(!_){leti=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=H,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=_,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,S)+y.packedLength+8}L.pack=function(e,t,r){returnA.typeOf.object("value",e),A.defined("array",t),r=P(r,0),r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,S),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=P(e._offsetAttribute,-1),t[r]=e.packedLength,t};varJ=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};L.unpack=function(e,t,r){A.defined("array",e),t=P(t,0);letH=a.unpackPolygonHierarchy(e,t,S);t=H.startingIndex,deleteH.startingIndex;letl=y.unpack(e,t,J);t+=y.packedLength;let_=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];returnO(r)||(r=newL(Q)),r._polygonHierarchy=H,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=_,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void0:c,r.packedLength=f,r};L.fromPositions=function(e){e=P(e,P.EMPTY_OBJECT),A.defined("options.positions",e.positions);lett={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};returnnewL(t)};L.createGeometry=function(e){lett=e._ellipsoid,r=e._granularity,H=e._polygonHierarchy,l=e._perPositionHeight,_=e._arcType,p=a.polygonOutlinesFromHierarchy(H,!l,t);if(p.length===0)return;lets,n=[],i=T.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!T.equalsEpsilon(o,c,0,T.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,_),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),O(e._offsetAttribute)){letd=s.geometry.attributes.position.values.length/3,E=newUint8Array(d);e._offsetAttribute===D.TOP?E=E.fill(1,0,d/2):(m=e._offsetAttribute===D.NONE?0:1,E=E.fill(m)),s.geometry.attributes.applyOffset=newv({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}elsefor(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,_),s.geometry.attributes.position.values=k.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),O(e._offsetAttribute)){letd=s.geometry.attributes.position.values.length;m=e._offsetAttribute===D.NONE?0:1;letE=newUint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=newv({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}leth=V.combineInstances(n)[0],g=z.fromVertices(h.attributes.position.values);returnnewC({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};varx=L;functionX(e,t){returnO(t)&&(e=x.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),x.createGeometry(e)}varOe=X;export{Oeasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasm}from"./chunk-JS6PT4NQ.js";import{aasN}from"./chunk-GHQSI7F2.js";import{aasU}from"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import{aask}from"./chunk-74GQJJ7R.js";import{aasle}from"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasse}from"./chunk-NNHN6WUY.js";import{aasce}from"./chunk-T7ERZ2CJ.js";import{aasne,basre,casie,dasO}from"./chunk-GSNDLQ4C.js";import{dasoe}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasx}from"./chunk-VTVHUB7E.js";import{aasp,dasu}from"./chunk-JMSSU44E.js";import{aasJ}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasA}from"./chunk-VLPNAR64.js";import{aasV}from"./chunk-GE5NEIZC.js";import{eash}from"./chunk-35CVRQTC.js";varme=[];functionAe(e,o,t,n,c){lets=me;s.length=c;letl,E=t.red,a=t.green,r=t.blue,w=t.alpha,b=n.red,i=n.green,f=n.blue,L=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);returns}letM=(b-E)/c,z=(i-a)/c,H=(f-r)/c,B=(L-w)/c;for(l=0;l<c;l++)s[l]=newm(E+l*M,a+l*z,r+l*H,w+l*B);returns}functionG(e){e=A(e,A.EMPTY_OBJECT);leto=e.positions,t=e.colors,n=A(e.width,1),c=A(e.colorsPerVertex,!1);if(!h(o)||o.length<2)thrownewV("At least two positions are required.");if(typeofn!="number")thrownewV("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))thrownewV("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=k.clone(A(e.vertexFormat,k.DEFAULT)),this._arcType=A(e.arcType,N.GEODESIC),this._granularity=A(e.granularity,J.RADIANS_PER_DEGREE),this._ellipsoid=u.clone(A(e.ellipsoid,u.default)),this._workerName="createPolylineGeometry";lets=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+k.packedLength+4}G.pack=function(e,o,t){if(!h(e))thrownewV("value is required");if(!h(o))thrownewV("array is required");t=A(t,0);letn,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);letl=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);returnu.pack(e._ellipsoid,o,t),t+=u.packedLength,k.pack(e._vertexFormat,o,t),t+=k.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};varde=u.clone(u.UNIT_SPHERE),ue=newk,S={positions:void0,colors:void0,ellipsoid:de,vertexFormat:ue,width:void0,colorsPerVertex:void0,arcType:void0,granularity:void0};G.unpack=function(e,o,t){if(!h(e))thrownewV("array is required");o=A(o,0);letn,c=e[o++],s=newArray(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];letl=c>0?newArray(c):void0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);letE=u.unpack(e,o,de);o+=u.packedLength;leta=k.unpack(e,o,ue);o+=k.packedLength;letr=e[o++],w=e[o++]===1,b=e[o++],i=e[o];returnh(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(E,t._ellipsoid),t._vertexFormat=k.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=b,t._granularity=i,t):(S.positions=s,S.colors=l,S.width=r,S.colorsPerVertex=w,S.arcType=b,S.granularity=i,newG(S))};varpe=newp,ae=newp,fe=newp,he=newp;G.createGeometry=function(e){leto=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,E=e._ellipsoid,a,r,w,b=[],i=le(e._positions,p.equalsEpsilon,!1,b);if(h(n)&&b.length>0){letd=0,P=b[0];n=n.filter(function(q,T){letg=!1;returnc?g=T===P||T===0&&P===1:g=T+1===P,g?(d++,P=b[d],!1):!0})}letf=i.length;if(f<2||o<=0)return;if(s===N.GEODESIC||s===N.RHUMB){letd,P;s===N.GEODESIC?(d=J.chordLength(l,E.maximumRadius),P=U.numberOfPoints):(d=l,P=U.numberOfPointsRhumbLine);letq=U.extractHeights(i,E);if(h(n)){letT=1;for(a=0;a<f-1;++a)T+=P(i[a],i[a+1],d);letg=newArray(T),D=0;for(a=0;a<f-1;++a){letZ=i[a],$=i[a+1],I=n[a],ee=P(Z,$,d);if(c&&a<T){let_e=n[a+1],te=Ae(Z,$,I,_e,ee),Pe=te.length;for(r=0;r<Pe;++r)g[D++]=te[r]}elsefor(r=0;r<ee;++r)g[D++]=m.clone(I)}g[D]=m.clone(n[n.length-1]),n=g,me.length=0}s===N.GEODESIC?i=U.generateCartesianArc({positions:i,minDistance:d,ellipsoid:E,height:q}):i=U.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:E,height:q})}f=i.length;letL=f*4-4,M=newFloat64Array(L*3),z=newFloat64Array(L*3),H=newFloat64Array(L*3),B=newFloat32Array(L*2),K=t.st?newFloat32Array(L*2):void0,y=h(n)?newUint8Array(L*4):void0,W=0,j=0,X=0,Y=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);letd,P;h(y)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));letq=r===0?2:0,T=r===f-1?2:4;for(w=q;w<T;++w){p.pack(ae,M,W),p.pack(fe,z,W),p.pack(he,H,W),W+=3;letg=w-2<0?-1:1;if(B[j++]=2*(w%2)-1,B[j++]=g*o,t.st&&(K[X++]=r/(f-1),K[X++]=Math.max(B[j-2],0)),h(y)){letD=w<2?d:P;y[Y++]=m.floatToByte(D.red),y[Y++]=m.floatToByte(D.green),y[Y++]=m.floatToByte(D.blue),y[Y++]=m.floatToByte(D.alpha)}}}letv=newce;v.position=newO({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:M}),v.prevPosition=newO({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:z}),v.nextPosition=newO({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:H}),v.expandAndWidth=newO({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:B}),t.st&&(v.st=newO({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:K})),h(y)&&(v.color=newO({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0}));letC=se.createTypedArray(L,f*6-6),F=0,R=0,we=f-1;for(r=0;r<we;++r)C[R++]=F,C[R++]=F+2,C[R++]=F+1,C[R++]=F+1,C[R++]=F+2,C[R++]=F+3,F+=4;returnnewie({attributes:v,indices:C,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};varQ=G;functionge(e,o){returnh(o)&&(e=Q.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),Q.createGeometry(e)}varWe=ge;export{Weasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasM}from"./chunk-4IMXHKCA.js";import{aasW}from"./chunk-AOALMXNW.js";import"./chunk-CXNPIJLB.js";import"./chunk-APUOR5ZJ.js";import{aasx,basI,casj}from"./chunk-6BHHTHKE.js";import"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import{aasg}from"./chunk-74GQJJ7R.js";import"./chunk-FNJKWSPR.js";import"./chunk-KSZ5EBRB.js";import{aas$,basV}from"./chunk-CKMJZ5B3.js";import{aasZ}from"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasX}from"./chunk-NNHN6WUY.js";import{aasQ}from"./chunk-T7ERZ2CJ.js";import{basY,casz,dasU}from"./chunk-GSNDLQ4C.js";import{dasK}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasB}from"./chunk-VTVHUB7E.js";import{aasT,casC,dasf}from"./chunk-JMSSU44E.js";import{aasJ}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aask}from"./chunk-VLPNAR64.js";import{aasD}from"./chunk-GE5NEIZC.js";import{eas_}from"./chunk-35CVRQTC.js";functionoe(t,e,n,o){letl=newQ;o.position&&(l.position=newU({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:t}));leti=e.length,u=t.length/3,L=(u-i*2)/(i*2),E=V.triangulate(e),q=(L-1)*i*6+E.length*2,r=X.createTypedArray(u,q),m,s,d,b,A,F,G=i*2,p=0;for(m=0;m<L-1;m++){for(s=0;s<i-1;s++)d=s*2+m*i*2,F=d+G,b=d+1,A=b+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F;d=i*2-2+m*i*2,b=d+1,A=b+G,F=d+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){letc=newFloat32Array(u*2),O=1/(L-1),w=1/n.height,S=n.height/2,y,a,h=0;for(m=0;m<L;m++){for(y=m*O,a=w*(e[0].y+S),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=w*(e[s].y+S),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=w*(e[0].y+S),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(L-1)*O,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;l.st=newU({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:newFloat32Array(c)})}letN=u-i*2;for(m=0;m<E.length;m+=3){letc=E[m]+N,O=E[m+1]+N,w=E[m+2]+N;r[p++]=c,r[p++]=O,r[p++]=w,r[p++]=w+i,r[p++]=O+i,r[p++]=c+i}letP=newz({attributes:l,indices:r,boundingSphere:K.fromVertices(t),primitiveType:Y.TRIANGLES});if(o.normal&&(P=W.computeNormal(P)),o.tangent||o.bitangent){try{P=W.computeTangentAndBitangent(P)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(P.attributes.tangent=void0),o.bitangent||(P.attributes.bitangent=void0),o.st||(P.attributes.st=void0)}returnP}functionR(t){t=k(t,k.EMPTY_OBJECT);lete=t.polylinePositions,n=t.shapePositions;if(!_(e))thrownewD("options.polylinePositions is required.");if(!_(n))thrownewD("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(k(t.ellipsoid,f.default)),this._cornerType=k(t.cornerType,x.ROUNDED),this._vertexFormat=g.clone(k(t.vertexFormat,g.DEFAULT)),this._granularity=k(t.granularity,J.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";leto=1+e.length*T.packedLength;o+=1+n.length*C.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}R.pack=function(t,e,n){if(!_(t))thrownewD("value is required");if(!_(e))thrownewD("array is required");n=k(n,0);leto,l=t._positions,i=l.length;for(e[n++]=i,o=0;o<i;++o,n+=T.packedLength)T.pack(l[o],e,n);letu=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=C.packedLength)C.pack(u[o],e,n);returnf.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};varee=f.clone(f.UNIT_SPHERE),te=newg,v={polylinePositions:void0,shapePositions:void0,ellipsoid:ee,vertexFormat:te,cornerType:void0,granularity:void0};R.unpack=function(t,e,n){if(!_(t))thrownewD("array is required");e=k(e,0);leto,l=t[e++],i=newArray(l);for(o=0;o<l;++o,e+=T.packedLength)i[o]=T.unpack(t,e);l=t[e++];letu=newArray(l);for(o=0;o<l;++o,e+=C.packedLength)u[o]=C.unpack(t,e);letL=f.unpack(t,e,ee);e+=f.packedLength;letE=g.unpack(t,e,te);e+=g.packedLength;letq=t[e++],r=t[e];return_(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(L,n._ellipsoid),n._vertexFormat=g.clone(E,n._vertexFormat),n._cornerType=q,n._granularity=r,n):(v.polylinePositions=i,v.shapePositions=u,v.cornerType=q,v.granularity=r,newR(v))};varne=newM;R.createGeometry=function(t){lete=t._positions,n=Z(e,T.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;V.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();letl=M.fromPoints(o,ne),i=j.computePositions(n,o,l,t,!0);returnoe(i,o,l,t._vertexFormat)};varH=R;functionie(t,e){return_(e)&&(t=H.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),H.createGeometry(t)}varRe=ie;export{Reasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasw}from"./chunk-4IMXHKCA.js";import{aasN,casE}from"./chunk-6BHHTHKE.js";import"./chunk-M5SITFFN.js";import"./chunk-ZPYKVVFF.js";import"./chunk-FNJKWSPR.js";import"./chunk-KSZ5EBRB.js";import{aasv,basG}from"./chunk-CKMJZ5B3.js";import{aasq}from"./chunk-WNTCOVG2.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aask}from"./chunk-NNHN6WUY.js";import{aasO}from"./chunk-T7ERZ2CJ.js";import{basA,casR,dasS}from"./chunk-GSNDLQ4C.js";import{dasC}from"./chunk-BKSIEBAA.js";import"./chunk-YWRPWWKI.js";import{aasb}from"./chunk-VTVHUB7E.js";import{a,cas_,dass}from"./chunk-JMSSU44E.js";import{aasD}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasd}from"./chunk-VLPNAR64.js";import{aasy}from"./chunk-GE5NEIZC.js";import{easu}from"./chunk-35CVRQTC.js";functionW(o,i){lett=newO;t.position=newS({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});lete=i.length,r=t.position.values.length/3,f=o.length/3/e,p=k.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;leth=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){letT=e*m,U=T+e;for(n=0;n<e;n++)p[l++]=n+T,p[l++]=n+U}returnnewR({attributes:t,indices:k.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}functiong(o){o=d(o,d.EMPTY_OBJECT);leti=o.polylinePositions,t=o.shapePositions;if(!u(i))thrownewy("options.polylinePositions is required.");if(!u(t))thrownewy("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(d(o.ellipsoid,s.default)),this._cornerType=d(o.cornerType,N.ROUNDED),this._granularity=d(o.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";lete=1+i.length*a.packedLength;e+=1+t.length*_.packedLength,this.packedLength=e+s.packedLength+2}g.pack=function(o,i,t){if(!u(o))thrownewy("value is required");if(!u(i))thrownewy("array is required");t=d(t,0);lete,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=a.packedLength)a.pack(r[e],i,t);letf=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=_.packedLength)_.pack(f[e],i,t);returns.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};varB=s.clone(s.UNIT_SPHERE),P={polylinePositions:void0,shapePositions:void0,ellipsoid:B,height:void0,cornerType:void0,granularity:void0};g.unpack=function(o,i,t){if(!u(o))thrownewy("array is required");i=d(i,0);lete,r=o[i++],c=newArray(r);for(e=0;e<r;++e,i+=a.packedLength)c[e]=a.unpack(o,i);r=o[i++];letf=newArray(r);for(e=0;e<r;++e,i+=_.packedLength)f[e]=_.unpack(o,i);letp=s.unpack(o,i,B);i+=s.packedLength;letm=o[i++],n=o[i];returnu(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(P.polylinePositions=c,P.shapePositions=f,P.cornerType=m,P.granularity=n,newg(P))};varM=neww;g.createGeometry=function(o){leti=o._positions,t=q(i,a.equalsEpsilon),e=o._shape;if(e=E.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();letr=w.fromPoints(e,M),c=E.computePositions(t,e,r,o,!1);returnW(c,e)};varL=g;functionj(o,i){returnu(i)&&(o=L.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),L.createGeometry(o)}varhe=j;export{heasdefault};
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{aasJ}from"./chunk-IIL7G2BA.js";import{aasNt}from"./chunk-KM43AUZL.js";import{aaszt}from"./chunk-AOALMXNW.js";import"./chunk-CXNPIJLB.js";import"./chunk-APUOR5ZJ.js";import{aasut}from"./chunk-ZFTFDHK4.js";import{aasX}from"./chunk-74GQJJ7R.js";import{basRt}from"./chunk-CKMJZ5B3.js";import"./chunk-EEKB62LQ.js";import"./chunk-V3DSE3OK.js";import"./chunk-FMRIJYNG.js";import{aasyt}from"./chunk-NNHN6WUY.js";import{aasVt}from"./chunk-T7ERZ2CJ.js";import{basMt,casPt,dasq}from"./chunk-GSNDLQ4C.js";import{dasst}from"./chunk-BKSIEBAA.js";import{fasLt,hasE,iasAt}from"./chunk-YWRPWWKI.js";import{aasY}from"./chunk-VTVHUB7E.js";import{aasw,bas_t,casG,dasH,easft}from"./chunk-JMSSU44E.js";import{aasW}from"./chunk-4UYSGV57.js";import"./chunk-ANLJ4KBN.js";import"./chunk-ID6SFQTL.js";import{aasL}from"./chunk-VLPNAR64.js";import{aasSt,baslt}from"./chunk-GE5NEIZC.js";import{eas$}from"./chunk-35CVRQTC.js";varTt=neww,Bt=neww,Ut=neww,Yt=neww,qt=newE,Zt=newG,Kt=newst,$t=newst;functionXt(t,e){letn=newPt({attributes:newVt,primitiveType:Mt.TRIANGLES});returnn.attributes.position=newq({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}functionGt(t,e,n,r){leta=t.length,c=e.normal?newFloat32Array(a):void0,l=e.tangent?newFloat32Array(a):void0,u=e.bitangent?newFloat32Array(a):void0,d=0,p=Yt,o=Ut,i=Bt;if(e.normal||e.tangent||e.bitangent)for(letf=0;f<a;f+=3){lets=w.fromArray(t,f,Tt),h=d+1,g=d+2;i=n.geodeticSurfaceNormal(s,i),(e.tangent||e.bitangent)&&(w.cross(w.UNIT_Z,i,o),ft.multiplyByVector(r,o,o),w.normalize(o,o),e.bitangent&&w.normalize(w.cross(i,o,p),p)),e.normal&&(c[d]=i.x,c[h]=i.y,c[g]=i.z),e.tangent&&(l[d]=o.x,l[h]=o.y,l[g]=o.z),e.bitangent&&(u[d]=p.x,u[h]=p.y,u[g]=p.z),d+=3}returnXt(e,{positions:t,normals:c,tangents:l,bitangents:u})}varCt=neww,jt=neww;functionte(t,e,n){letr=t.length,a=e.normal?newFloat32Array(r):void0,c=e.tangent?newFloat32Array(r):void0,l=e.bitangent?newFloat32Array(r):void0,u=0,d=0,p=0,o=!0,i=Yt,f=Ut,s=Bt;if(e.normal||e.tangent||e.bitangent)for(leth=0;h<r;h+=6){letg=w.fromArray(t,h,Tt),A=w.fromArray(t,(h+6)%r,Ct);if(o){letb=w.fromArray(t,(h+3)%r,jt);w.subtract(A,g,A),w.subtract(b,g,b),s=w.normalize(w.cross(b,A,s),s),o=!1}w.equalsEpsilon(A,g,W.EPSILON10)&&(o=!0),(e.tangent||e.bitangent)&&(i=n.geodeticSurfaceNormal(g,i),e.tangent&&(f=w.normalize(w.cross(i,s,f),f))),e.normal&&(a[u++]=s.x,a[u++]=s.y,a[u++]=s.z,a[u++]=s.x,a[u++]=s.y,a[u++]=s.z),e.tangent&&(c[d++]=f.x,c[d++]=f.y,c[d++]=f.z,c[d++]=f.x,c[d++]=f.y,c[d++]=f.z),e.bitangent&&(l[p++]=i.x,l[p++]=i.y,l[p++]=i.z,l[p++]=i.x,l[p++]=i.y,l[p++]=i.z)}returnXt(e,{positions:t,normals:a,tangents:c,bitangents:l})}functionIt(t,e){letn=t._vertexFormat,r=t._ellipsoid,a=e.height,c=e.width,l=e.northCap,u=e.southCap,d=0,p=a,o=a,i=0;l&&(d=1,o-=1,i+=1),u&&(p-=1,o-=1,i+=1),i+=c*o;letf=n.position?newFloat64Array(i*3):void0,s=n.st?newFloat32Array(i*2):void0,h=0,g=0,A=Tt,b=Zt,z=Number.MAX_VALUE,F=Number.MAX_VALUE,j=-Number.MAX_VALUE,T=-Number.MAX_VALUE;for(letx=d;x<p;++x)for(letk=0;k<c;++k)J.computePosition(e,r,n.st,x,k,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y));if(l&&(J.computePosition(e,r,n.st,0,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=b.x,F=b.y,j=b.x,T=b.y)),u&&(J.computePosition(e,r,n.st,a-1,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h]=A.z,n.st&&(s[g++]=b.x,s[g]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y))),n.st&&(z<0||F<0||j>1||T>1))for(letx=0;x<s.length;x+=2)s[x]=(s[x]-z)/(j-z),s[x+1]=(s[x+1]-F)/(T-F);letm=Gt(f,n,r,e.tangentRotationMatrix),K=6*(c-1)*(o-1);l&&(K+=3*(c-1)),u&&(K+=3*(c-1));letP=yt.createTypedArray(i,K),D=0,N=0,O;for(O=0;O<o-1;++O){for(letx=0;x<c-1;++x){letk=D,M=k+c,I=M+1,rt=k+1;P[N++]=k,P[N++]=M,P[N++]=rt,P[N++]=rt,P[N++]=M,P[N++]=I,++D}++D}if(l||u){letx=i-1,k=i-1;l&&u&&(x=i-2);letM,I;if(D=0,l)for(O=0;O<c-1;O++)M=D,I=M+1,P[N++]=x,P[N++]=M,P[N++]=I,++D;if(u)for(D=(o-1)*c,O=0;O<c-1;O++)M=D,I=M+1,P[N++]=M,P[N++]=k,P[N++]=I,++D}returnm.indices=P,n.st&&(m.attributes.st=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:s})),m}functionht(t,e,n,r,a){returnt[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n+2],t[e++]=a[n],t[e++]=a[n+1],t[e]=a[n+2],t}functiondt(t,e,n,r){returnt[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n],t[e]=r[n+1],t}varDt=newX;functionee(t,e){letn=t._shadowVolume,r=t._offsetAttribute,a=t._vertexFormat,c=t._extrudedHeight,l=t._surfaceHeight,u=t._ellipsoid,d=e.height,p=e.width,o;if(n){letR=X.clone(a,Dt);R.normal=!0,t._vertexFormat=R}leti=It(t,e);n&&(t._vertexFormat=a);letf=Rt.scaleToGeodeticHeight(i.attributes.position.values,l,u,!1);f=newFloat64Array(f);lets=f.length,h=s*2,g=newFloat64Array(h);g.set(f);letA=Rt.scaleToGeodeticHeight(i.attributes.position.values,c,u);g.set(A,s),i.attributes.position.values=g;letb=a.normal?newFloat32Array(h):void0,z=a.tangent?newFloat32Array(h):void0,F=a.bitangent?newFloat32Array(h):void0,j=a.st?newFloat32Array(h/3*2):void0,T,m;if(a.normal){for(m=i.attributes.normal.values,b.set(m),o=0;o<s;o++)m[o]=-m[o];b.set(m,s),i.attributes.normal.values=b}if(n){m=i.attributes.normal.values,a.normal||(i.attributes.normal=void0);letR=newFloat32Array(h);for(o=0;o<s;o++)m[o]=-m[o];R.set(m,s),i.attributes.extrudeDirection=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:R})}letK,P=$(r);if(P){letR=s/3*2,at=newUint8Array(R);r===ut.TOP?at=at.fill(1,0,R/2):(K=r===ut.NONE?0:1,at=at.fill(K)),i.attributes.applyOffset=newq({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:at})}if(a.tangent){letR=i.attributes.tangent.values;for(z.set(R),o=0;o<s;o++)R[o]=-R[o];z.set(R,s),i.attributes.tangent.values=z}if(a.bitangent){letR=i.attributes.bitangent.values;F.set(R),F.set(R,s),i.attributes.bitangent.values=F}a.st&&(T=i.attributes.st.values,j.set(T),j.set(T,s/3*2),i.attributes.st.values=j);letD=i.indices,N=D.length,O=s/3,x=yt.createTypedArray(h/3,N*2);for(x.set(D),o=0;o<N;o+=3)x[o+N]=D[o+2]+O,x[o+1+N]=D[o+1]+O,x[o+2+N]=D[o]+O;i.indices=x;letk=e.northCap,M=e.southCap,I=d,rt=2,pt=0,xt=4,Et=4;k&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),M&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),pt+=rt*p+2*I-xt;letgt=(pt+Et)*2,C=newFloat64Array(gt*3),S=n?newFloat32Array(gt*3):void0,Z=P?newUint8Array(gt):void0,V=a.st?newFloat32Array(gt*2):void0,et=r===ut.TOP;P&&!et&&(K=r===ut.ALL?1:0,Z=Z.fill(K));letv=0,B=0,y=0,U=0,nt=p*I,_;for(o=0;o<nt;o+=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(M){letR=k?nt+1:nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}elsefor(o=nt-p;o<nt;o++)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);for(o=nt-1;o>0;o-=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(k){letR=nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}elsefor(o=p-1;o>=0;o--)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);letot=te(C,a,u);a.st&&(ot.attributes.st=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),n&&(ot.attributes.extrudeDirection=newq({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:S})),P&&(ot.attributes.applyOffset=newq({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z}));letit=yt.createTypedArray(gt,pt*6),mt,wt,kt,bt;s=C.length/3;letct=0;for(o=0;o<s-1;o+=2){mt=o,bt=(mt+2)%s;letR=w.fromArray(C,mt*3,Ct),at=w.fromArray(C,bt*3,jt);w.equalsEpsilon(R,at,W.EPSILON10)||(wt=(mt+1)%s,kt=(wt+2)%s,it[ct++]=mt,it[ct++]=wt,it[ct++]=bt,it[ct++]=bt,it[ct++]=wt,it[ct++]=kt)}returnot.indices=it,ot=zt.combineInstances([newNt({geometry:i}),newNt({geometry:ot})]),ot[0]}varne=[neww,neww,neww,neww],Wt=new_t,oe=new_t;functionHt(t,e,n,r,a){if(n===0)returnE.clone(t,a);letc=J.computeOptions(t,e,n,0,qt,Wt),l=c.height,u=c.width,d=ne;returnJ.computePosition(c,r,!1,0,0,d[0]),J.computePosition(c,r,!1,0,u-1,d[1]),J.computePosition(c,r,!1,l-1,0,d[2]),J.computePosition(c,r,!1,l-1,u-1,d[3]),E.fromCartesianArray(d,r,a)}functionQ(t){t=L(t,L.EMPTY_OBJECT);lete=t.rectangle;if(lt.typeOf.object("rectangle",e),E._validate(e),e.north<e.south)thrownewSt("options.rectangle.north must be greater than or equal to options.rectangle.south");letn=L(t.height,0),r=L(t.extrudedHeight,n);this._rectangle=E.clone(e),this._granularity=L(t.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=H.clone(L(t.ellipsoid,H.default)),this._surfaceHeight=Math.max(n,r),this._rotation=L(t.rotation,0),this._stRotation=L(t.stRotation,0),this._vertexFormat=X.clone(L(t.vertexFormat,X.DEFAULT)),this._extrudedHeight=Math.min(n,r),this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void0,this._textureCoordinateRotationPoints=void0}Q.packedLength=E.packedLength+H.packedLength+X.packedLength+7;Q.pack=function(t,e,n){returnlt.typeOf.object("value",t),lt.defined("array",e),n=L(n,0),E.pack(t._rectangle,e,n),n+=E.packedLength,H.pack(t._ellipsoid,e,n),n+=H.packedLength,X.pack(t._vertexFormat,e,n),n+=X.packedLength,e[n++]=t._granularity,e[n++]=t._surfaceHeight,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=L(t._offsetAttribute,-1),e};varJt=newE,Qt=H.clone(H.UNIT_SPHERE),tt={rectangle:Jt,ellipsoid:Qt,vertexFormat:Dt,granularity:void0,height:void0,rotation:void0,stRotation:void0,extrudedHeight:void0,shadowVolume:void0,offsetAttribute:void0};Q.unpack=function(t,e,n){lt.defined("array",t),e=L(e,0);letr=E.unpack(t,e,Jt);e+=E.packedLength;leta=H.unpack(t,e,Qt);e+=H.packedLength;letc=X.unpack(t,e,Dt);e+=X.packedLength;letl=t[e++],u=t[e++],d=t[e++],p=t[e++],o=t[e++],i=t[e++]===1,f=t[e];return$(n)?(n._rectangle=E.clone(r,n._rectangle),n._ellipsoid=H.clone(a,n._ellipsoid),n._vertexFormat=X.clone(c,n._vertexFormat),n._granularity=l,n._surfaceHeight=u,n._rotation=d,n._stRotation=p,n._extrudedHeight=o,n._shadowVolume=i,n._offsetAttribute=f===-1?void0:f,n):(tt.granularity=l,tt.height=u,tt.rotation=d,tt.stRotation=p,tt.extrudedHeight=o,tt.shadowVolume=i,tt.offsetAttribute=f===-1?void0:f,newQ(tt))};Q.computeRectangle=function(t,e){t=L(t,L.EMPTY_OBJECT);letn=t.rectangle;if(lt.typeOf.object("rectangle",n),E._validate(n),n.north<n.south)thrownewSt("options.rectangle.north must be greater than or equal to options.rectangle.south");letr=L(t.granularity,W.RADIANS_PER_DEGREE),a=L(t.ellipsoid,H.default),c=L(t.rotation,0);returnHt(n,r,c,a,e)};varie=newft,Ft=newLt,ae=new_t;Q.createGeometry=function(t){if(W.equalsEpsilon(t._rectangle.north,t._rectangle.south,W.EPSILON10)||W.equalsEpsilon(t._rectangle.east,t._rectangle.west,W.EPSILON10))return;lete=t._rectangle,n=t._ellipsoid,r=t._rotation,a=t._stRotation,c=t._vertexFormat,l=J.computeOptions(e,t._granularity,r,a,qt,Wt,oe),u=ie;if(a!==0||r!==0){lets=E.center(e,ae),h=n.geodeticSurfaceNormalCartographic(s,Ct);Lt.fromAxisAngle(h,-a,Ft),ft.fromQuaternion(Ft,u)}elseft.clone(ft.IDENTITY,u);letd=t._surfaceHeight,p=t._extrudedHeight,o=!W.equalsEpsilon(d,p,0,W.EPSILON2);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.tangentRotationMatrix=u;leti,f;if(e=t._rectangle,o){i=ee(t,l);lets=st.fromRectangle3D(e,n,d,$t),h=st.fromRectangle3D(e,n,p,Kt);f=st.union(s,h)}else{if(i=It(t,l),i.attributes.position.values=Rt.scaleToGeodeticHeight(i.attributes.position.values,d,n,!1),$(t._offsetAttribute)){lets=i.attributes.position.values.length,h=t._offsetAttribute===ut.NONE?0:1,g=newUint8Array(s/3).fill(h);i.attributes.applyOffset=newq({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}f=st.fromRectangle3D(e,n,d)}returnc.position||deletei.attributes.position,newPt({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:f,offsetAttribute:t._offsetAttribute})};Q.createShadowVolume=function(t,e,n){letr=t._granularity,a=t._ellipsoid,c=e(r,a),l=n(r,a);returnnewQ({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:a,stRotation:t._stRotation,granularity:r,extrudedHeight:l,height:c,vertexFormat:X.POSITION_ONLY,shadowVolume:!0})};varvt=newE,se=[newG,newG,newG],re=newAt,ce=new_t;functionle(t){if(t._stRotation===0)return[0,0,0,1,1,0];lete=E.clone(t._rectangle,vt),n=t._granularity,r=t._ellipsoid,a=t._rotation-t._stRotation,c=Ht(e,n,a,r,vt),l=se;l[0].x=c.west,l[0].y=c.south,l[1].x=c.west,l[1].y=c.north,l[2].x=c.east,l[2].y=c.south;letu=t.rectangle,d=At.fromRotation(t._stRotation,re),p=E.center(u,ce);for(leth=0;h<3;++h){letg=l[h];g.x-=p.longitude,g.y-=p.latitude,At.multiplyByVector(d,g,g),g.x+=p.longitude,g.y+=p.latitude,g.x=(g.x-u.west)/u.width,g.y=(g.y-u.south)/u.height}leto=l[0],i=l[1],f=l[2],s=newArray(6);returnG.pack(o,s),G.pack(i,s,2),G.pack(f,s,4),s}Object.defineProperties(Q.prototype,{rectangle:{get:function(){return$(this._rotatedRectangle)||(this._rotatedRectangle=Ht(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return$(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=le(this)),this._textureCoordinateRotationPoints}}});varOt=Q;functionfe(t,e){return$(e)&&(t=Ot.unpack(t,e)),t._ellipsoid=H.clone(t._ellipsoid),t._rectangle=E.clone(t._rectangle),Ot.createGeometry(t)}varYe=fe;export{Yeasdefault};