import{aasr}from"./chunk-H2CDK6OB.js";import{aasS}from"./chunk-GMMUK6QU.js";import{aasE}from"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{aasX}from"./chunk-YFQNY2YN.js";import{aasW}from"./chunk-NT26NNVH.js";import{basK,casQ,dasY}from"./chunk-NW2YE576.js";import{dasj}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{aasH}from"./chunk-QHHYYTCM.js";import{aask,dasb}from"./chunk-RH3GFHG2.js";import{aasq}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{aasw}from"./chunk-TA3RE4KQ.js";import{aasL}from"./chunk-RTY3VPG6.js";import{easu}from"./chunk-LRNH5AEO.js";functionZ(t,e,o,i,s,l,p){letg=E.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,c=i.red,h=i.green,y=i.blue,V=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)l[p++]=r.floatToByte(n),l[p++]=r.floatToByte(m),l[p++]=r.floatToByte(d),l[p++]=r.floatToByte(T);returnp}letM=(c-n)/g,C=(h-m)/g,G=(y-d)/g,_=(V-T)/g,a=p;for(f=0;f<g;f++)l[a++]=r.floatToByte(n+f*M),l[a++]=r.floatToByte(m+f*C),l[a++]=r.floatToByte(d+f*G),l[a++]=r.floatToByte(T+f*_);returna}functionR(t){t=w(t,w.EMPTY_OBJECT);lete=t.positions,o=t.colors,i=w(t.colorsPerVertex,!1);if(!u(e)||e.length<2)thrownewL("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))thrownewL("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=w(t.arcType,S.GEODESIC),this._granularity=w(t.granularity,q.RADIANS_PER_DEGREE),this._ellipsoid=w(t.ellipsoid,b.default),this._workerName="createSimplePolylineGeometry";lets=1+e.length*k.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+b.packedLength+3}R.pack=function(t,e,o){if(!u(t))thrownewL("value is required");if(!u(e))thrownewL("array is required");o=w(o,0);leti,s=t._positions,l=s.length;for(e[o++]=l,i=0;i<l;++i,o+=k.packedLength)k.pack(s[i],e,o);letp=t._colors;for(l=u(p)?p.length:0,e[o++]=l,i=0;i<l;++i,o+=r.packedLength)r.pack(p[i],e,o);returnb.pack(t._ellipsoid,e,o),o+=b.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};R.unpack=function(t,e,o){if(!u(t))thrownewL("array is required");e=w(e,0);leti,s=t[e++],l=newArray(s);for(i=0;i<s;++i,e+=k.packedLength)l[i]=k.unpack(t,e);s=t[e++];letp=s>0?newArray(s):void0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);letg=b.unpack(t,e);e+=b.packedLength;letf=t[e++]===1,n=t[e++],m=t[e];returnu(o)?(o._positions=l,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):newR({positions:l,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};varF=newArray(2),N=newArray(2),$={positions:F,height:N,ellipsoid:void0,minDistance:void0,granularity:void0};R.createGeometry=function(t){lete=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,l=t._granularity,p=t._ellipsoid,g=q.chordLength(l,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,c,h,y=0;if(s===S.GEODESIC||s===S.RHUMB){let_,a,P;s===S.GEODESIC?(_=q.chordLength(l,p.maximumRadius),a=E.numberOfPoints,P=E.generateArc):(_=l,a=E.numberOfPointsRhumbLine,P=E.generateRhumbArc);letv=E.extractHeights(e,p),B=$;if(s===S.GEODESIC?B.minDistance=g:B.granularity=l,B.ellipsoid=p,f){letA=0;for(n=0;n<m-1;n++)A+=a(e[n],e[n+1],_)+1;d=newFloat64Array(A*3),c=newUint8Array(A*4),B.positions=F,B.height=N;letD=0;for(n=0;n<m-1;++n){F[0]=e[n],F[1]=e[n+1],N[0]=v[n],N[1]=v[n+1];letO=P(B);if(u(o)){letz=O.length/3;h=o[n];for(letU=0;U<z;++U)c[D++]=r.floatToByte(h.red),c[D++]=r.floatToByte(h.green),c[D++]=r.floatToByte(h.blue),c[D++]=r.floatToByte(h.alpha)}d.set(O,y),y+=O.length}}elseif(B.positions=e,B.height=v,d=newFloat64Array(P(B)),u(o)){for(c=newUint8Array(d.length/3*4),n=0;n<m-1;++n){letD=e[n],O=e[n+1],z=o[n],U=o[n+1];y=Z(D,O,z,U,g,c,y)}letA=o[m-1];c[y++]=r.floatToByte(A.red),c[y++]=r.floatToByte(A.green),c[y++]=r.floatToByte(A.blue),c[y++]=r.floatToByte(A.alpha)}}else{T=f?m*2-2:m,d=newFloat64Array(T*3),c=u(o)?newUint8Array(