UNPKG

jspredict-dc

Version:

Satellite propagation and visibility utilities built on satellite.js.

1 lines 50.7 kB
define((function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:function(){return t[e]}})})),n}var n,o;function i(){return o?n:(o=1,n={printIntervalInfo:!1,maxIterations:99999})}var r,a=Math.PI,s=2*a,c=a/180,l=180/a,u=398600.8,m=6378.135,d=60/Math.sqrt(650942.9922085947),h=m*d/60,f=1/d,p=.001082616,M=-253881e-11,g=-165597e-11,b=M/p,E=2/3,x=1440/(2*a),T=Object.freeze({__proto__:null,deg2rad:c,earthRadius:m,j2:p,j3:M,j3oj2:b,j4:g,minutesPerDay:1440,mu:u,pi:a,rad2deg:l,tumin:f,twoPi:s,vkmpersec:h,x2o3:E,xke:d,xpdotp:x});function N(t,e){for(var n=[31,t%4==0?29:28,31,30,31,30,31,31,30,31,30,31],o=Math.floor(e),i=1,r=0;o>r+n[i-1]&&i<12;)r+=n[i-1],i+=1;var a=i,s=o-r,c=24*(e-o),l=Math.floor(c);c=60*(c-l);var u=Math.floor(c);return{mon:a,day:s,hr:l,minute:u,sec:60*(c-u)}}function v(t,e,n,o,i,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;return 367*t-Math.floor(7*(t+Math.floor((e+9)/12))*.25)+Math.floor(275*e/9)+n+1721013.5+((a/6e4+r/60+i)/60+o)/24}function O(t,e,n,o,i,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(t instanceof Date){var s=t;return v(s.getUTCFullYear(),s.getUTCMonth()+1,s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds())}return v(t,e,n,o,i,r,a)}function y(t,e){var n,o,i,r,c,l,u,m,d,h,f,p,M,g,b,E,x,T,N=t.e3,v=t.ee2,O=t.peo,y=t.pgho,A=t.pho,I=t.pinco,z=t.plo,_=t.se2,S=t.se3,C=t.sgh2,w=t.sgh3,F=t.sgh4,D=t.sh2,P=t.sh3,R=t.si2,Y=t.si3,$=t.sl2,L=t.sl3,U=t.sl4,k=t.t,j=t.xgh2,q=t.xgh3,H=t.xgh4,B=t.xh2,V=t.xh3,G=t.xi2,W=t.xi3,Z=t.xl2,J=t.xl3,K=t.xl4,X=t.zmol,Q=t.zmos,tt=e.init,et=e.opsmode,nt=e.ep,ot=e.inclp,it=e.nodep,rt=e.argpp,at=e.mp;T=Q+119459e-10*k,"y"===tt&&(T=Q),x=T+.0335*Math.sin(T);var st=_*(u=.5*(g=Math.sin(x))*g-.25)+S*(m=-.5*g*Math.cos(x)),ct=R*u+Y*m,lt=$*u+L*m+U*g,ut=C*u+w*m+F*g,mt=D*u+P*m;return T=X+.00015835218*k,"y"===tt&&(T=X),x=T+.1098*Math.sin(T),d=st+(v*(u=.5*(g=Math.sin(x))*g-.25)+N*(m=-.5*g*Math.cos(x))),p=ct+(G*u+W*m),M=lt+(Z*u+J*m+K*g),h=ut+(j*u+q*m+H*g),f=mt+(B*u+V*m),"n"===tt&&(M-=z,h-=y,f-=A,ot+=p-=I,nt+=d-=O,r=Math.sin(ot),i=Math.cos(ot),ot>=.2?(rt+=h-=i*(f/=r),it+=f,at+=M):(n=r*(l=Math.sin(it)),o=r*(c=Math.cos(it)),n+=f*c+p*i*l,o+=-f*l+p*i*c,(it%=s)<0&&"a"===et&&(it+=s),b=at+rt+i*it,b+=M+h-p*it*r,E=it,(it=Math.atan2(n,o))<0&&"a"===et&&(it+=s),Math.abs(E-it)>a&&(it<E?it+=s:it-=s),rt=b-(at+=M)-i*it)),{ep:nt,inclp:ot,nodep:it,argpp:rt,mp:at}}function A(t){var e=(t-2451545)/36525,n=-62e-7*e*e*e+.093104*e*e+3164400184.812866*e+67310.54841;return(n=n*c/240%s)<0&&(n+=s),n}function I(t,e,n,o,i,r,a){return t instanceof Date?A(O(t)):A(void 0!==e?O(t,e,n,o,i,r,a):t)}function z(t,e){var n,o,i,c,l,u,f,M,g,x,T,N,v,O,A,I,z,_,S,C,w,F,D,P,R,Y;t.t=e,t.error=r.None;var $=t.mo+t.mdot*t.t,L=t.argpo+t.argpdot*t.t,U=t.nodeo+t.nodedot*t.t;M=L,C=$;var k=t.t*t.t;if(F=U+t.nodecf*k,I=1-t.cc1*t.t,z=t.bstar*t.cc4*t.t,_=t.t2cof*k,1!==t.isimp){u=t.omgcof*t.t;var j=1+t.eta*Math.cos($);C=$+(A=u+t.xmcof*(j*j*j-t.delmo)),M=L-A,N=(T=k*t.t)*t.t,I=I-t.d2*k-t.d3*T-t.d4*N,z+=t.bstar*t.cc5*(Math.sin(C)-t.sinmao),_=_+t.t3cof*T+N*(t.t4cof+t.t*t.t5cof)}w=t.no;var q=t.ecco;if(S=t.inclo,"d"===t.method){v=t.t;var H=function(t){var e,n,o,i,r,a,c,l,u=t.irez,m=t.d2201,d=t.d2211,h=t.d3210,f=t.d3222,p=t.d4410,M=t.d4422,g=t.d5220,b=t.d5232,E=t.d5421,x=t.d5433,T=t.dedt,N=t.del1,v=t.del2,O=t.del3,y=t.didt,A=t.dmdt,I=t.dnodt,z=t.domdt,_=t.argpo,S=t.argpdot,C=t.t,w=t.tc,F=t.gsto,D=t.xfact,P=t.xlamo,R=t.no,Y=t.atime,$=t.em,L=t.argpm,U=t.inclm,k=t.xli,j=t.mm,q=t.xni,H=t.nodem,B=t.nm,V=.13130908,G=2.8843198,W=.37448087,Z=5.7686396,J=.95240898,K=1.8014998,X=1.050833,Q=4.4108898,tt=259200,et=0,nt=0,ot=(F+.0043752690880113*w)%s;if($+=T*C,U+=y*C,L+=z*C,H+=I*C,j+=A*C,0!==u){(0===Y||C*Y<=0||Math.abs(C)<Math.abs(Y))&&(Y=0,q=R,k=P),e=C>0?720:-720;for(var it=381;381===it;)2!==u?(c=N*Math.sin(k-V)+v*Math.sin(2*(k-G))+O*Math.sin(3*(k-W)),r=q+D,a=N*Math.cos(k-V)+2*v*Math.cos(2*(k-G))+3*O*Math.cos(3*(k-W)),a*=r):(o=(l=_+S*Y)+l,n=k+k,c=m*Math.sin(o+k-Z)+d*Math.sin(k-Z)+h*Math.sin(l+k-J)+f*Math.sin(-l+k-J)+p*Math.sin(o+n-K)+M*Math.sin(n-K)+g*Math.sin(l+k-X)+b*Math.sin(-l+k-X)+E*Math.sin(l+n-Q)+x*Math.sin(-l+n-Q),r=q+D,a=m*Math.cos(o+k-Z)+d*Math.cos(k-Z)+h*Math.cos(l+k-J)+f*Math.cos(-l+k-J)+g*Math.cos(l+k-X)+b*Math.cos(-l+k-X)+2*(p*Math.cos(o+n-K)+M*Math.cos(n-K)+E*Math.cos(l+n-Q)+x*Math.cos(-l+n-Q)),a*=r),Math.abs(C-Y)>=720?it=381:(nt=C-Y,it=0),381===it&&(k+=r*e+c*tt,q+=c*e+a*tt,Y+=e);B=q+c*nt+a*nt*nt*.5,i=k+r*nt+c*nt*nt*.5,1!==u?(j=i-2*H+2*ot,et=B-R):(j=i-H-L+ot,et=B-R),B=R+et}return{atime:Y,em:$,argpm:L,inclm:U,xli:k,mm:j,xni:q,nodem:H,dndt:et,nm:B}}({irez:t.irez,d2201:t.d2201,d2211:t.d2211,d3210:t.d3210,d3222:t.d3222,d4410:t.d4410,d4422:t.d4422,d5220:t.d5220,d5232:t.d5232,d5421:t.d5421,d5433:t.d5433,dedt:t.dedt,del1:t.del1,del2:t.del2,del3:t.del3,didt:t.didt,dmdt:t.dmdt,dnodt:t.dnodt,domdt:t.domdt,argpo:t.argpo,argpdot:t.argpdot,t:t.t,tc:v,gsto:t.gsto,xfact:t.xfact,xlamo:t.xlamo,no:t.no,atime:t.atime,em:q,argpm:M,inclm:S,xli:t.xli,mm:C,xni:t.xni,nodem:F,nm:w});q=H.em,M=H.argpm,S=H.inclm,C=H.mm,F=H.nodem,w=H.nm}if(w<=0)return t.error=r.MeanMotionBelowZero,null;var B=Math.pow(d/w,E)*I*I;if(w=d/Math.pow(B,1.5),(q-=z)>=1||q<-.001)return t.error=r.MeanEccentricityOutOfRange,null;q<1e-6&&(q=1e-6),P=(C+=t.no*_)+M+F;var V={am:B,em:q,im:S,Om:F%=s,om:M%=s,mm:C=((P%=s)-M-F)%s,nm:w},G=q;if(D=S,g=M,Y=F,R=C,c=Math.sin(S),i=Math.cos(S),"d"===t.method){var W=y(t,{inclo:t.inclo,init:"n",ep:G,inclp:D,nodep:Y,argpp:g,mp:R,opsmode:t.operationmode});if(G=W.ep,Y=W.nodep,g=W.argpp,R=W.mp,(D=W.inclp)<0&&(D=-D,Y+=a,g-=a),G<0||G>1)return t.error=r.PerturbedEccentricityOutOfRange,null}"d"===t.method&&(c=Math.sin(D),i=Math.cos(D),t.aycof=-.5*b*c,Math.abs(i+1)>15e-13?t.xlcof=-.25*b*c*(3+5*i)/(1+i):t.xlcof=-.25*b*c*(3+5*i)/15e-13);var Z=G*Math.cos(g);A=1/(B*(1-G*G));var J=G*Math.sin(g)+A*t.aycof,K=(R+g+Y+A*t.xlcof*Z-Y)%s;f=K,O=9999.9;for(var X=1;Math.abs(O)>=1e-12&&X<=10;)o=Math.sin(f),O=(K-J*(n=Math.cos(f))+Z*o-f)/(O=1-n*Z-o*J),Math.abs(O)>=.95&&(O=O>0?.95:-.95),f+=O,X+=1;var Q=Z*n+J*o,tt=Z*o-J*n,et=Z*Z+J*J,nt=B*(1-et);if(nt<0)return t.error=r.SemiLatusRectumBelowZero,null;var ot=B*(1-Q),it=Math.sqrt(B)*tt/ot,rt=Math.sqrt(nt)/ot,at=Math.sqrt(1-et),st=B/ot*(o-J-Z*(A=tt/(1+at))),ct=B/ot*(n-Z+J*A);x=Math.atan2(st,ct);var lt=(ct+ct)*st,ut=1-2*st*st,mt=.5*p*(A=1/nt),dt=mt*A;"d"===t.method&&(l=i*i,t.con41=3*l-1,t.x1mth2=1-l,t.x7thm1=7*l-1);var ht=ot*(1-1.5*dt*at*t.con41)+.5*mt*t.x1mth2*ut;if(ht<1)return t.error=r.Decayed,null;x-=.25*dt*t.x7thm1*lt;var ft=Y+1.5*dt*i*lt,pt=D+1.5*dt*i*c*ut,Mt=it-w*mt*t.x1mth2*lt/d,gt=rt+w*mt*(t.x1mth2*ut+1.5*t.con41)/d,bt=Math.sin(x),Et=Math.cos(x),xt=Math.sin(ft),Tt=Math.cos(ft),Nt=Math.sin(pt),vt=Math.cos(pt),Ot=-xt*vt,yt=Tt*vt,At=Ot*bt+Tt*Et,It=yt*bt+xt*Et,zt=Nt*bt;return{position:{x:ht*At*m,y:ht*It*m,z:ht*zt*m},velocity:{x:(Mt*At+gt*(Ot*Et-Tt*bt))*h,y:(Mt*It+gt*(yt*Et-xt*bt))*h,z:(Mt*zt+gt*(Nt*Et))*h},meanElements:V}}function _(t,e){var n=e.opsmode;e.satn;var o,i,r,c,l,u,h,M,x,T,N,v,O,A,_,S,C,w,F,D,P,R,Y,$,L,U,k,j,q,H,B,V,G,W,Z,J,K,X,Q,tt,et,nt,ot,it,rt,at,st,ct,lt,ut,mt,dt,ht=e.epoch,ft=e.xbstar,pt=e.xecco,Mt=e.xargpo,gt=e.xinclo,bt=e.xmo,Et=e.xno,xt=e.xnodeo,Tt=t;Tt.isimp=0,Tt.method="n",Tt.aycof=0,Tt.con41=0,Tt.cc1=0,Tt.cc4=0,Tt.cc5=0,Tt.d2=0,Tt.d3=0,Tt.d4=0,Tt.delmo=0,Tt.eta=0,Tt.argpdot=0,Tt.omgcof=0,Tt.sinmao=0,Tt.t=0,Tt.t2cof=0,Tt.t3cof=0,Tt.t4cof=0,Tt.t5cof=0,Tt.x1mth2=0,Tt.x7thm1=0,Tt.mdot=0,Tt.nodedot=0,Tt.xlcof=0,Tt.xmcof=0,Tt.nodecf=0,Tt.irez=0,Tt.d2201=0,Tt.d2211=0,Tt.d3210=0,Tt.d3222=0,Tt.d4410=0,Tt.d4422=0,Tt.d5220=0,Tt.d5232=0,Tt.d5421=0,Tt.d5433=0,Tt.dedt=0,Tt.del1=0,Tt.del2=0,Tt.del3=0,Tt.didt=0,Tt.dmdt=0,Tt.dnodt=0,Tt.domdt=0,Tt.e3=0,Tt.ee2=0,Tt.peo=0,Tt.pgho=0,Tt.pho=0,Tt.pinco=0,Tt.plo=0,Tt.se2=0,Tt.se3=0,Tt.sgh2=0,Tt.sgh3=0,Tt.sgh4=0,Tt.sh2=0,Tt.sh3=0,Tt.si2=0,Tt.si3=0,Tt.sl2=0,Tt.sl3=0,Tt.sl4=0,Tt.gsto=0,Tt.xfact=0,Tt.xgh2=0,Tt.xgh3=0,Tt.xgh4=0,Tt.xh2=0,Tt.xh3=0,Tt.xi2=0,Tt.xi3=0,Tt.xl2=0,Tt.xl3=0,Tt.xl4=0,Tt.xlamo=0,Tt.zmol=0,Tt.zmos=0,Tt.atime=0,Tt.xli=0,Tt.xni=0,Tt.bstar=ft,Tt.ecco=pt,Tt.argpo=Mt,Tt.inclo=gt,Tt.mo=bt,Tt.no=Et,Tt.nodeo=xt,Tt.operationmode=n;var Nt=78/m+1;Tt.init="y",Tt.t=0;var vt=function(t){var e=t.ecco,n=t.epoch,o=t.inclo,i=t.opsmode,r=t.no,a=e*e,c=1-a,l=Math.sqrt(c),u=Math.cos(o),m=u*u,h=Math.pow(d/r,E),f=.75*p*(3*m-1)/(l*c),M=f/(h*h),g=h*(1-M*M-M*(1/3+134*M*M/81));r/=1+(M=f/(g*g));var b,x=Math.pow(d/r,E),T=Math.sin(o),N=x*c,v=1-5*m,O=-v-m-m,y=1/x,A=N*N,z=x*(1-e);if("a"===i){var _=n-7305,S=Math.floor(_+1e-8),C=.017202791694070362;(b=(1.7321343856509375+C*S+(C+s)*(_-S)+_*_*5075514194322695e-30)%s)<0&&(b+=s)}else b=I(n+2433281.5);return{no:r,method:"n",ainv:y,ao:x,con41:O,con42:v,cosio:u,cosio2:m,eccsq:a,omeosq:c,posq:A,rp:z,rteosq:l,sinio:T,gsto:b}}({ecco:Tt.ecco,epoch:ht,inclo:Tt.inclo,no:Tt.no,method:Tt.method,opsmode:Tt.operationmode}),Ot=vt.ao,yt=vt.con42,At=vt.cosio,It=vt.cosio2,zt=vt.eccsq,_t=vt.omeosq,St=vt.posq,Ct=vt.rp,wt=vt.rteosq,Ft=vt.sinio;if(Tt.no=vt.no,Tt.con41=vt.con41,Tt.gsto=vt.gsto,Tt.a=Math.pow(Tt.no*f,-2/3),Tt.alta=Tt.a*(1+Tt.ecco)-1,Tt.altp=Tt.a*(1-Tt.ecco)-1,Tt.error=0,_t>=0||Tt.no>=0){if(Tt.isimp=0,Ct<1.034492841559484&&(Tt.isimp=1),$=Nt,w=1.880279159015271e-9,(_=(Ct-1)*m)<156){$=_-78,_<98&&($=20);var Dt=(120-$)/m;w=Dt*Dt*Dt*Dt,$=$/m+1}S=1/St,nt=1/(Ot-$),Tt.eta=Ot*Tt.ecco*nt,v=Tt.eta*Tt.eta,N=Tt.ecco*Tt.eta,C=Math.abs(1-v),c=(h=(u=w*Math.pow(nt,4))/Math.pow(C,3.5))*Tt.no*(Ot*(1+1.5*v+N*(4+v))+.375*p*nt/C*Tt.con41*(8+3*v*(8+v))),Tt.cc1=Tt.bstar*c,l=0,Tt.ecco>1e-4&&(l=-2*u*nt*b*Tt.no*Ft/Tt.ecco),Tt.x1mth2=1-It,Tt.cc4=2*Tt.no*h*Ot*_t*(Tt.eta*(2+.5*v)+Tt.ecco*(.5+2*v)-p*nt/(Ot*C)*(-3*Tt.con41*(1-2*N+v*(1.5-.5*N))+.75*Tt.x1mth2*(2*v-N*(1+v))*Math.cos(2*Tt.argpo))),Tt.cc5=2*h*Ot*_t*(1+2.75*(v+N)+N*v),M=It*It,tt=.5*(Q=1.5*p*S*Tt.no)*p*S,et=-.46875*g*S*S*Tt.no,Tt.mdot=Tt.no+.5*Q*wt*Tt.con41+.0625*tt*wt*(13-78*It+137*M),Tt.argpdot=-.5*Q*yt+.0625*tt*(7-114*It+395*M)+et*(3-36*It+49*M),it=-Q*At,Tt.nodedot=it+(.5*tt*(4-19*It)+2*et*(3-7*It))*At,ot=Tt.argpdot+Tt.nodedot,Tt.omgcof=Tt.bstar*l*Math.cos(Tt.argpo),Tt.xmcof=0,Tt.ecco>1e-4&&(Tt.xmcof=-.6666666666666666*u*Tt.bstar/N),Tt.nodecf=3.5*_t*it*Tt.cc1,Tt.t2cof=1.5*Tt.cc1,Math.abs(At+1)>15e-13?Tt.xlcof=-.25*b*Ft*(3+5*At)/(1+At):Tt.xlcof=-.25*b*Ft*(3+5*At)/15e-13,Tt.aycof=-.5*b*Ft;var Pt=1+Tt.eta*Math.cos(Tt.mo);if(Tt.delmo=Pt*Pt*Pt,Tt.sinmao=Math.sin(Tt.mo),Tt.x7thm1=7*It-1,2*a/Tt.no>=225){Tt.method="d",Tt.isimp=1,O=Tt.inclo;var Rt=function(t){var e,n,o,i,r,a,c,l,u,m,d,h,f,p,M,g,b,E,x,T,N,v,O,y,A,I,z,_,S,C,w,F,D,P,R,Y,$,L,U,k,j,q,H,B,V,G,W,Z,J,K,X,Q,tt,et,nt,ot,it,rt,at,st,ct,lt,ut,mt=t.epoch,dt=t.ep,ht=t.argpp,ft=t.tc,pt=t.inclp,Mt=t.nodep,gt=.01675,bt=.0549,Et=t.np,xt=dt,Tt=Math.sin(Mt),Nt=Math.cos(Mt),vt=Math.sin(ht),Ot=Math.cos(ht),yt=Math.sin(pt),At=Math.cos(pt),It=xt*xt,zt=1-It,_t=Math.sqrt(zt),St=mt+18261.5+ft/1440,Ct=(4.523602-.00092422029*St)%s,wt=Math.sin(Ct),Ft=Math.cos(Ct),Dt=.91375164-.03568096*Ft,Pt=Math.sqrt(1-Dt*Dt),Rt=.089683511*wt/Pt,Yt=Math.sqrt(1-Rt*Rt),$t=5.8351514+.001944368*St,Lt=.39785416*wt/Pt,Ut=Yt*Ft+.91744867*Rt*wt;Lt=Math.atan2(Lt,Ut),Lt+=$t-Ct;var kt=Math.cos(Lt),jt=Math.sin(Lt);T=.1945905,N=-.98088458,y=.91744867,A=.39785416,v=Nt,O=Tt,d=29864797e-13;for(var qt=1/Et,Ht=0;Ht<2;)nt=-6*(e=T*v+N*y*O)*(r=-yt*(c=-T*O+N*y*v)+At*(l=N*A))+It*(-24*(h=e*Ot+(n=At*c+yt*l)*vt)*(E=r*Ot)-6*(p=-e*vt+n*Ot)*(g=r*vt)),ot=-6*(e*(a=-yt*(u=N*O+T*y*v)+At*(m=T*A))+(o=-N*v+T*y*O)*r)+It*(-24*((f=o*Ot+(i=At*u+yt*m)*vt)*E+h*(x=a*Ot))+-6*(p*(b=a*vt)+(M=-o*vt+i*Ot)*g)),it=-6*o*a+It*(-24*f*x-6*M*b),rt=6*n*r+It*(24*h*g-6*p*E),at=6*(i*r+n*a)+It*(24*(f*g+h*b)-6*(M*E+p*x)),st=6*i*a+It*(24*f*b-6*M*x),Q=(Q=3*(e*e+n*n)+(ct=12*h*h-3*p*p)*It)+Q+zt*ct,tt=(tt=6*(e*o+n*i)+(lt=24*h*f-6*p*M)*It)+tt+zt*lt,et=(et=3*(o*o+i*i)+(ut=12*f*f-3*M*M)*It)+et+zt*ut,G=-.5*(W=d*qt)/_t,V=-15*xt*(Z=W*_t),J=h*p+f*M,K=f*p+h*M,X=f*M-h*p,1===(Ht+=1)&&(I=V,z=G,_=W,S=Z,C=J,w=K,F=X,D=Q,P=tt,R=et,Y=nt,$=ot,L=it,U=rt,k=at,j=st,q=ct,H=lt,B=ut,T=kt,N=jt,y=Dt,A=Pt,v=Yt*Nt+Rt*Tt,O=Tt*Yt-Nt*Rt,d=4.7968065e-7);return{snodm:Tt,cnodm:Nt,sinim:yt,cosim:At,sinomm:vt,cosomm:Ot,day:St,e3:2*V*X,ee2:2*V*K,em:xt,emsq:It,gam:$t,peo:0,pgho:0,pho:0,pinco:0,plo:0,rtemsq:_t,se2:2*I*w,se3:2*I*F,sgh2:2*S*H,sgh3:2*S*(B-q),sgh4:-18*S*gt,sh2:-2*z*k,sh3:-2*z*(j-U),si2:2*z*$,si3:2*z*(L-Y),sl2:-2*_*P,sl3:-2*_*(R-D),sl4:-2*_*(-21-9*It)*gt,s1:V,s2:G,s3:W,s4:Z,s5:J,s6:K,s7:X,ss1:I,ss2:z,ss3:_,ss4:S,ss5:C,ss6:w,ss7:F,sz1:D,sz2:P,sz3:R,sz11:Y,sz12:$,sz13:L,sz21:U,sz22:k,sz23:j,sz31:q,sz32:H,sz33:B,xgh2:2*Z*lt,xgh3:2*Z*(ut-ct),xgh4:-18*Z*bt,xh2:-2*G*at,xh3:-2*G*(st-rt),xi2:2*G*ot,xi3:2*G*(it-nt),xl2:-2*W*tt,xl3:-2*W*(et-Q),xl4:-2*W*(-21-9*It)*bt,nm:Et,z1:Q,z2:tt,z3:et,z11:nt,z12:ot,z13:it,z21:rt,z22:at,z23:st,z31:ct,z32:lt,z33:ut,zmol:(.2299715*St-$t+4.7199672)%s,zmos:(6.2565837+.017201977*St)%s}}({epoch:ht,ep:Tt.ecco,argpp:Tt.argpo,tc:0,inclp:Tt.inclo,nodep:Tt.nodeo,np:Tt.no,e3:Tt.e3,ee2:Tt.ee2,peo:Tt.peo,pgho:Tt.pgho,pho:Tt.pho,pinco:Tt.pinco,plo:Tt.plo,se2:Tt.se2,se3:Tt.se3,sgh2:Tt.sgh2,sgh3:Tt.sgh3,sgh4:Tt.sgh4,sh2:Tt.sh2,sh3:Tt.sh3,si2:Tt.si2,si3:Tt.si3,sl2:Tt.sl2,sl3:Tt.sl3,sl4:Tt.sl4,xgh2:Tt.xgh2,xgh3:Tt.xgh3,xgh4:Tt.xgh4,xh2:Tt.xh2,xh3:Tt.xh3,xi2:Tt.xi2,xi3:Tt.xi3,xl2:Tt.xl2,xl3:Tt.xl3,xl4:Tt.xl4,zmol:Tt.zmol,zmos:Tt.zmos});Tt.e3=Rt.e3,Tt.ee2=Rt.ee2,Tt.peo=Rt.peo,Tt.pgho=Rt.pgho,Tt.pho=Rt.pho,Tt.pinco=Rt.pinco,Tt.plo=Rt.plo,Tt.se2=Rt.se2,Tt.se3=Rt.se3,Tt.sgh2=Rt.sgh2,Tt.sgh3=Rt.sgh3,Tt.sgh4=Rt.sgh4,Tt.sh2=Rt.sh2,Tt.sh3=Rt.sh3,Tt.si2=Rt.si2,Tt.si3=Rt.si3,Tt.sl2=Rt.sl2,Tt.sl3=Rt.sl3,Tt.sl4=Rt.sl4,i=Rt.sinim,o=Rt.cosim,x=Rt.em,T=Rt.emsq,F=Rt.s1,D=Rt.s2,P=Rt.s3,R=Rt.s4,Y=Rt.s5,L=Rt.ss1,U=Rt.ss2,k=Rt.ss3,j=Rt.ss4,q=Rt.ss5,H=Rt.sz1,B=Rt.sz3,V=Rt.sz11,G=Rt.sz13,W=Rt.sz21,Z=Rt.sz23,J=Rt.sz31,K=Rt.sz33,Tt.xgh2=Rt.xgh2,Tt.xgh3=Rt.xgh3,Tt.xgh4=Rt.xgh4,Tt.xh2=Rt.xh2,Tt.xh3=Rt.xh3,Tt.xi2=Rt.xi2,Tt.xi3=Rt.xi3,Tt.xl2=Rt.xl2,Tt.xl3=Rt.xl3,Tt.xl4=Rt.xl4,Tt.zmol=Rt.zmol,Tt.zmos=Rt.zmos,A=Rt.nm,rt=Rt.z1,at=Rt.z3,st=Rt.z11,ct=Rt.z13,lt=Rt.z21,ut=Rt.z23,mt=Rt.z31,dt=Rt.z33;var Yt=y(Tt,{inclo:O,init:Tt.init,ep:Tt.ecco,inclp:Tt.inclo,nodep:Tt.nodeo,argpp:Tt.argpo,mp:Tt.mo,opsmode:Tt.operationmode});Tt.ecco=Yt.ep,Tt.inclo=Yt.inclp,Tt.nodeo=Yt.nodep,Tt.argpo=Yt.argpp,Tt.mo=Yt.mp;var $t=function(t){var e,n,o,i,r,c,l,u,m,h,f,p,M,g,b,x,T,N=t.cosim,v=t.argpo,O=t.s1,y=t.s2,A=t.s3,I=t.s4,z=t.s5,_=t.sinim,S=t.ss1,C=t.ss2,w=t.ss3,F=t.ss4,D=t.ss5,P=t.sz1,R=t.sz3,Y=t.sz11,$=t.sz13,L=t.sz21,U=t.sz23,k=t.sz31,j=t.sz33,q=t.t,H=t.tc,B=t.gsto,V=t.mo,G=t.mdot,W=t.no,Z=t.nodeo,J=t.nodedot,K=t.xpidot,X=t.z1,Q=t.z3,tt=t.z11,et=t.z13,nt=t.z21,ot=t.z23,it=t.z31,rt=t.z33,at=t.ecco,st=t.eccsq,ct=t.emsq,lt=t.em,ut=t.argpm,mt=t.inclm,dt=t.mm,ht=t.nm,ft=t.nodem,pt=t.irez,Mt=t.atime,gt=t.d2201,bt=t.d2211,Et=t.d3210,xt=t.d3222,Tt=t.d4410,Nt=t.d4422,vt=t.d5220,Ot=t.d5232,yt=t.d5421,At=t.d5433,It=t.dedt,zt=t.didt,_t=t.dmdt,St=t.dnodt,Ct=t.domdt,wt=t.del1,Ft=t.del2,Dt=t.del3,Pt=t.xfact,Rt=t.xlamo,Yt=t.xli,$t=t.xni,Lt=.0043752690880113,Ut=.00015835218,kt=119459e-10;pt=0,ht<.0052359877&&ht>.0034906585&&(pt=1),ht>=.00826&&ht<=.00924&&lt>=.5&&(pt=2);var jt=-119459e-10*C*(L+U);(mt<.052359877||mt>a-.052359877)&&(jt=0),0!==_&&(jt/=_);var qt=-.00015835218*y*(nt+ot);(mt<.052359877||mt>a-.052359877)&&(qt=0),Ct=F*kt*(k+j-6)-N*jt+I*Ut*(it+rt-6),St=jt,0!==_&&(Ct-=N/_*qt,St+=qt/_);var Ht=(B+H*Lt)%s;if(lt+=(It=S*kt*D+O*Ut*z)*q,mt+=(zt=C*kt*(Y+$)+y*Ut*(tt+et))*q,ut+=Ct*q,ft+=St*q,dt+=(_t=-119459e-10*w*(P+R-14-6*ct)-Ut*A*(X+Q-14-6*ct))*q,0!==pt){if(b=Math.pow(ht/d,E),2===pt){var Bt=lt,Vt=ct;T=(lt=at)*(ct=st),lt<=.65?(o=3.616-13.247*lt+16.29*ct,i=117.39*lt-19.302-228.419*ct+156.591*T,r=109.7927*lt-18.9068-214.6334*ct+146.5816*T,c=242.694*lt-41.122-471.094*ct+313.953*T,l=841.88*lt-146.407-1629.014*ct+1083.435*T,u=3017.977*lt-532.114-5740.032*ct+3708.276*T):(o=331.819*lt-72.099-508.738*ct+266.724*T,i=1582.851*lt-346.844-2415.925*ct+1246.113*T,r=1554.908*lt-342.585-2366.899*ct+1215.972*T,c=4758.686*lt-1052.797-7193.992*ct+3651.957*T,l=16178.11*lt-3581.69-24462.77*ct+12422.52*T,u=lt>.715?29936.92*lt-5149.66-54087.36*ct+31324.56*T:1464.74-4664.75*lt+3763.64*ct),lt<.7?(f=4988.61*lt-919.2277-9064.77*ct+5542.21*T,m=4568.6173*lt-822.71072-8491.4146*ct+5337.524*T,h=4690.25*lt-853.666-8624.77*ct+5341.4*T):(f=161616.52*lt-37995.78-229838.2*ct+109377.94*T,m=218913.95*lt-51752.104-309468.16*ct+146349.42*T,h=170470.89*lt-40023.88-242699.48*ct+115605.82*T),gt=(M=17891679e-13*(g=ht*ht*3*(b*b)))*(e=.75*(1+2*N+(x=N*N)))*(-.306-.44*(lt-.64)),bt=M*(1.5*(p=_*_))*o,Et=(M=3.7393792e-7*(g*=b))*(1.875*_*(1-2*N-3*x))*i,xt=M*(-1.875*_*(1+2*N-3*x))*r,Tt=(M=2*(g*=b)*7.3636953e-9)*(35*p*e)*c,Nt=M*(39.375*p*p)*l,vt=(M=1.1428639e-7*(g*=b))*(9.84375*_*(p*(1-2*N-5*x)+.33333333*(4*N-2+6*x)))*u,Ot=M*(_*(4.92187512*p*(-2-4*N+10*x)+6.56250012*(1+2*N-3*x)))*h,yt=(M=2*g*2.1765803e-9)*(29.53125*_*(2-8*N+x*(8*N-12+10*x)))*m,At=M*(29.53125*_*(-2-8*N+x*(12+8*N-10*x)))*f,Rt=(V+Z+Z-(Ht+Ht))%s,Pt=G+_t+2*(J+St-Lt)-W,lt=Bt,ct=Vt}1===pt&&(n=1+N,Ft=2*(wt=3*ht*ht*b*b)*(e=.75*(1+N)*(1+N))*(1+ct*(.8125*ct-2.5))*17891679e-13,Dt=3*wt*(n*=1.875*n*n)*(1+ct*(6.60937*ct-6))*2.2123015e-7*b,wt=wt*(.9375*_*_*(1+3*N)-.75*(1+N))*(i=1+2*ct)*21460748e-13*b,Rt=(V+Z+v-Ht)%s,Pt=G+K+_t+Ct+St-(W+Lt)),Yt=Rt,$t=W,Mt=0,ht=W+0}return{em:lt,argpm:ut,inclm:mt,mm:dt,nm:ht,nodem:ft,irez:pt,atime:Mt,d2201:gt,d2211:bt,d3210:Et,d3222:xt,d4410:Tt,d4422:Nt,d5220:vt,d5232:Ot,d5421:yt,d5433:At,dedt:It,didt:zt,dmdt:_t,dndt:0,dnodt:St,domdt:Ct,del1:wt,del2:Ft,del3:Dt,xfact:Pt,xlamo:Rt,xli:Yt,xni:$t}}({cosim:o,emsq:T,argpo:Tt.argpo,s1:F,s2:D,s3:P,s4:R,s5:Y,sinim:i,ss1:L,ss2:U,ss3:k,ss4:j,ss5:q,sz1:H,sz3:B,sz11:V,sz13:G,sz21:W,sz23:Z,sz31:J,sz33:K,t:Tt.t,tc:0,gsto:Tt.gsto,mo:Tt.mo,mdot:Tt.mdot,no:Tt.no,nodeo:Tt.nodeo,nodedot:Tt.nodedot,xpidot:ot,z1:rt,z3:at,z11:st,z13:ct,z21:lt,z23:ut,z31:mt,z33:dt,ecco:Tt.ecco,eccsq:zt,em:x,argpm:0,inclm:O,mm:0,nm:A,nodem:0,irez:Tt.irez,atime:Tt.atime,d2201:Tt.d2201,d2211:Tt.d2211,d3210:Tt.d3210,d3222:Tt.d3222,d4410:Tt.d4410,d4422:Tt.d4422,d5220:Tt.d5220,d5232:Tt.d5232,d5421:Tt.d5421,d5433:Tt.d5433,dedt:Tt.dedt,didt:Tt.didt,dmdt:Tt.dmdt,dnodt:Tt.dnodt,domdt:Tt.domdt,del1:Tt.del1,del2:Tt.del2,del3:Tt.del3,xfact:Tt.xfact,xlamo:Tt.xlamo,xli:Tt.xli,xni:Tt.xni});Tt.irez=$t.irez,Tt.atime=$t.atime,Tt.d2201=$t.d2201,Tt.d2211=$t.d2211,Tt.d3210=$t.d3210,Tt.d3222=$t.d3222,Tt.d4410=$t.d4410,Tt.d4422=$t.d4422,Tt.d5220=$t.d5220,Tt.d5232=$t.d5232,Tt.d5421=$t.d5421,Tt.d5433=$t.d5433,Tt.dedt=$t.dedt,Tt.didt=$t.didt,Tt.dmdt=$t.dmdt,Tt.dnodt=$t.dnodt,Tt.domdt=$t.domdt,Tt.del1=$t.del1,Tt.del2=$t.del2,Tt.del3=$t.del3,Tt.xfact=$t.xfact,Tt.xlamo=$t.xlamo,Tt.xli=$t.xli,Tt.xni=$t.xni}1!==Tt.isimp&&(r=Tt.cc1*Tt.cc1,Tt.d2=4*Ot*nt*r,X=Tt.d2*nt*Tt.cc1/3,Tt.d3=(17*Ot+$)*X,Tt.d4=.5*X*Ot*nt*(221*Ot+31*$)*Tt.cc1,Tt.t3cof=Tt.d2+2*r,Tt.t4cof=.25*(3*Tt.d3+Tt.cc1*(12*Tt.d2+10*r)),Tt.t5cof=.2*(3*Tt.d4+12*Tt.cc1*Tt.d3+6*Tt.d2*Tt.d2+15*r*(2*Tt.d2+r)))}z(Tt,0),Tt.init="n"}!function(t){t[t.None=0]="None",t[t.MeanEccentricityOutOfRange=1]="MeanEccentricityOutOfRange",t[t.MeanMotionBelowZero=2]="MeanMotionBelowZero",t[t.PerturbedEccentricityOutOfRange=3]="PerturbedEccentricityOutOfRange",t[t.SemiLatusRectumBelowZero=4]="SemiLatusRectumBelowZero",t[t.Decayed=6]="Decayed"}(r||(r={}));var S=7292115e-11;function C(t){return t*l}function w(t){return t*c}function F(t){var e=t.longitude,n=t.latitude,o=t.height,i=6378.137,r=(i-6356.7523142)/i,a=2*r-r*r,s=i/Math.sqrt(1-a*(Math.sin(n)*Math.sin(n)));return{x:(s+o)*Math.cos(n)*Math.cos(e),y:(s+o)*Math.cos(n)*Math.sin(e),z:(s*(1-a)+o)*Math.sin(n)}}var D,P,R,Y,$,L,U,k,j=Object.freeze({__proto__:null,get SatRecError(){return r},constants:T,degreesLat:function(t){if(t<-a/2||t>a/2)throw new RangeError("Latitude radians must be in range [-pi/2; pi/2].");return C(t)},degreesLong:function(t){if(t<-a||t>a)throw new RangeError("Longitude radians must be in range [-pi; pi].");return C(t)},degreesToRadians:w,dopplerFactor:function(t,e,n){var o=e.x-t.x,i=e.y-t.y,r=e.z-t.z,a=Math.sqrt(Math.pow(o,2)+Math.pow(i,2)+Math.pow(r,2));return 1-(o*(n.x+S*t.y)+i*(n.y-S*t.x)+r*n.z)/a/299792.458},ecfToEci:function(t,e){return{x:t.x*Math.cos(e)-t.y*Math.sin(e),y:t.x*Math.sin(e)+t.y*Math.cos(e),z:t.z}},ecfToLookAngles:function(t,e){var n,o,i,r,s,c,l=function(t,e){var n=t.longitude,o=t.latitude,i=F(t),r=e.x-i.x,a=e.y-i.y,s=e.z-i.z;return{topS:Math.sin(o)*Math.cos(n)*r+Math.sin(o)*Math.sin(n)*a-Math.cos(o)*s,topE:-Math.sin(n)*r+Math.cos(n)*a,topZ:Math.cos(o)*Math.cos(n)*r+Math.cos(o)*Math.sin(n)*a+Math.sin(o)*s}}(t,e);return o=(n=l).topS,i=n.topE,r=n.topZ,s=Math.sqrt(o*o+i*i+r*r),c=Math.asin(r/s),{azimuth:Math.atan2(-i,o)+a,elevation:c,rangeSat:s}},eciToEcf:function(t,e){return{x:t.x*Math.cos(e)+t.y*Math.sin(e),y:t.x*-Math.sin(e)+t.y*Math.cos(e),z:t.z}},eciToGeodetic:function(t,e){for(var n=6378.137,o=Math.sqrt(t.x*t.x+t.y*t.y),i=(n-6356.7523142)/n,r=2*i-i*i,c=Math.atan2(t.y,t.x)-e;c<-a;)c+=s;for(;c>a;)c-=s;for(var l,u=0,m=Math.atan2(t.z,Math.sqrt(t.x*t.x+t.y*t.y));u++<20;)l=1/Math.sqrt(1-r*(Math.sin(m)*Math.sin(m))),m=Math.atan2(t.z+n*l*r*Math.sin(m),o);return{longitude:c,latitude:m,height:o/Math.cos(m)-n*l}},geodeticToEcf:F,gstime:I,invjday:function(t,e){var n=t-2415019.5,o=n/365.25,i=1900+Math.floor(o),r=Math.floor(.25*(i-1901)),a=n-(365*(i-1900)+r)+1e-11;a<1&&(a=n-(365*((i-=1)-1900)+(r=Math.floor(.25*(i-1901)))));var s=N(i,a),c=s.mon,l=s.day,u=s.hr,m=s.minute,d=s.sec-864e-9;return e?[i,c,l,u,m,Math.floor(d)]:new Date(Date.UTC(i,c-1,l,u,m,Math.floor(d)))},jday:O,json2satrec:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"i",n=t.NORAD_CAT_ID.toString(),o=new Date(t.EPOCH.endsWith("Z")?t.EPOCH:t.EPOCH+"Z"),i=o.getUTCFullYear(),r=Number(i.toString().slice(-2)),a=(o.valueOf()-new Date(Date.UTC(i,0,1,0,0,0)).valueOf())/864e5+1,s=Number(t.MEAN_MOTION_DOT),l=Number(t.MEAN_MOTION_DDOT),u=Number(t.BSTAR),m=Number(t.INCLINATION)*c,d=Number(t.RA_OF_ASC_NODE)*c,h=Number(t.ECCENTRICITY),f=Number(t.ARG_OF_PERICENTER)*c,p=Number(t.MEAN_ANOMALY)*c,M=Number(t.MEAN_MOTION)/x,g=N(i,a),b={error:0,satnum:n,epochyr:r,epochdays:a,ndot:s,nddot:l,bstar:u,inclo:m,nodeo:d,ecco:h,argpo:f,mo:p,no:M,jdsatepoch:O(i,g.mon,g.day,g.hr,g.minute,g.sec)};return _(b,{opsmode:e,satn:b.satnum,epoch:b.jdsatepoch-2433281.5,xbstar:b.bstar,xecco:b.ecco,xargpo:b.argpo,xinclo:b.inclo,xmo:b.mo,xno:b.no,xnodeo:b.nodeo}),b},propagate:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return z(t,1440*(O.apply(void 0,n)-t.jdsatepoch))},radiansLat:function(t){if(t<-90||t>90)throw new RangeError("Latitude degrees must be in range [-90; 90].");return w(t)},radiansLong:function(t){if(t<-180||t>180)throw new RangeError("Longitude degrees must be in range [-180; 180].");return w(t)},radiansToDegrees:C,sgp4:z,sunPos:function(t){var e=(t-2451545)/36525,n=e,o=(357.5277233+35999.05034*n*c)%s;o<0&&(o+=s);var i=((280.46+36000.77*e)%360+1.914666471*Math.sin(o)+.019994643*Math.sin(2*o))%360*c,r=(23.439291-.0130042*n)*c,l=1.000140612-.016708617*Math.cos(o)-139589e-9*Math.cos(2*o),u=[l*Math.cos(i),l*Math.cos(r)*Math.sin(i),l*Math.sin(r)*Math.sin(i)],m=Math.atan(Math.cos(r)*Math.tan(i)),d=m;return Math.abs(i-d)>.5*a&&(d+=.5*a*Math.round((i-m)/(.5*a))),{rsun:u,rtasc:d,decl:Math.asin(Math.sin(r)*Math.sin(i))}},twoline2satrec:function(t,e){var n=t.substring(2,7),o=parseInt(t.substring(18,20),10),i=parseFloat(t.substring(20,32)),r=parseFloat(t.substring(33,43)),a=parseFloat("".concat(t.substring(44,45),".").concat(t.substring(45,50),"E").concat(t.substring(50,52))),s=parseFloat("".concat(t.substring(53,54),".").concat(t.substring(54,59),"E").concat(t.substring(59,61))),l=parseFloat(e.substring(8,16))*c,u=parseFloat(e.substring(17,25))*c,m=parseFloat(".".concat(e.substring(26,33).replace(/\s/g,"0"))),d=parseFloat(e.substring(34,42))*c,h=parseFloat(e.substring(43,51))*c,f=parseFloat(e.substring(52,63))/x,p=o<57?o+2e3:o+1900,M=N(p,i),g={error:0,satnum:n,epochyr:o,epochdays:i,ndot:r,nddot:a,bstar:s,inclo:l,nodeo:u,ecco:m,argpo:d,mo:h,no:f,jdsatepoch:O(p,M.mon,M.day,M.hr,M.minute,M.sec)};return _(g,{opsmode:"i",satn:g.satnum,epoch:g.jdsatepoch-2433281.5,xbstar:g.bstar,xecco:g.ecco,xargpo:g.argpo,xinclo:g.inclo,xmo:g.mo,xno:g.no,xnodeo:g.nodeo}),g}}),q=e(j);function H(){if(Y)return R;Y=1;const t=q,{astronomicalUnitKm:e,deg2rad:n,earthRadiusKm:o,msPerDay:r}=function(){if(P)return D;P=1;const t=Math.PI/180,e=180/Math.PI;return D={deg2rad:t,rad2deg:e,earthRadiusKm:6378.137,earthDiameterKm:12756.274,solarRadiusKm:696e3,astronomicalUnitKm:149597870.7,muKm3PerS2:398600.5,msPerDay:864e5,defaultMinElevation:4,defaultStepSeconds:60,defaultMaxIterations:99999}}(),a=new Set;function s(t){return Boolean(t)&&"[object Object]"===Object.prototype.toString.call(t)}function c(t){if(null==t)return new Date;if(t instanceof Date)return new Date(t.getTime());if("number"==typeof t&&Number.isFinite(t))return new Date(t);if("string"==typeof t){const e=new Date(t);if(!Number.isNaN(e.getTime()))return e}if("function"==typeof t.valueOf){const e=t.valueOf();if("number"==typeof e&&Number.isFinite(e))return new Date(e)}throw new Error("Invalid time value")}function l(t,e=6e4){if(null==t)return e;if("number"==typeof t){if(!Number.isFinite(t)||t<=0)throw new Error("Interval must be a positive number");return t}if("string"==typeof t){const e=Number(t);if(Number.isFinite(e)&&e>0)return e}if(s(t)){const e={milliseconds:1,ms:1,seconds:1e3,second:1e3,s:1e3,minutes:6e4,minute:6e4,m:6e4,hours:36e5,hour:36e5,h:36e5,days:864e5,day:864e5,d:864e5,weeks:6048e5,week:6048e5,w:6048e5},n=Object.entries(t).reduce(((t,[n,o])=>{const i=e[n];return i&&"number"==typeof o?t+o*i:t}),0);if(n>0)return n}throw new Error("Invalid interval value")}function u(t,e){a.has(e)||(a.add(e),console.warn(`[jspredict-dc] ${t}`))}function m(t,e="observerLocation"){const n=Number(t);if(d(n,"altitude"),Math.abs(n)>200){const t=n/1e3;return u(`${e}: altitude=${n} was interpreted as meters and converted to ${t} km.`,`${e}|alt-auto-meter-convert|${n}`),t}return n}function d(t,e){if(!Number.isFinite(t))throw new Error(`Observer ${e} must be a finite number`)}function h(t,e){const[n,o,i]=t,r=`${e} observerLocation`;Math.abs(n)>90&&u(`${r}: latitude=${n} is outside [-90, 90]. You may have passed [lon, lat, alt] instead of [lat, lon, alt].`,`${e}|lat-out-of-range|${n}|${o}`),Math.abs(o)>180&&u(`${r}: longitude=${o} is outside [-180, 180].`,`${e}|lon-out-of-range|${o}`),Math.abs(n)>90&&Math.abs(o)<=90&&u(`${r}: value pattern strongly suggests [lon, lat, alt] was provided.`,`${e}|swapped-lat-lon|${n}|${o}`),i>20&&u(`${r}: altitude=${i} km is unusually high for a ground observer. Check that altitude is provided in kilometers.`,`${e}|alt-high|${i}`),i>100&&u(`${r}: altitude=${i} km is likely not a ground-observer altitude. Unit may be meters instead of kilometers.`,`${e}|alt-very-high|${i}`),i<-1&&u(`${r}: altitude=${i} km is below a typical ground range. Check unit and sign.`,`${e}|alt-low|${i}`)}function f(t){if(null==t)return null;if(Array.isArray(t)){if(t.length<3)throw new Error("Observer location must contain latitude, longitude, and altitude");const e=[Number(t[0]),Number(t[1]),m(t[2])];return d(e[0],"latitude"),d(e[1],"longitude"),d(e[2],"altitude"),e}if(s(t)){const e=t.latitude??t.lat,n=t.longitude??t.lon??t.lng,o=t.altMeters??t.altitudeMeters??t.heightMeters,i=null==o?t.altitude??t.height??t.alt:Number(o)/1e3;if([e,n,i].some((t=>null==t)))throw new Error("Observer location object must expose latitude, longitude, and altitude");null!=o&&u(`observerLocation: altMeters=${o} converted to ${Number(o)/1e3} km.`,`observerLocation|alt-meters-field|${o}`);const r=[Number(e),Number(n),m(i)];return d(r[0],"latitude"),d(r[1],"longitude"),d(r[2],"altitude"),r}throw new Error("Unsupported observer location format")}function p(t,e){const n=f(t);if(!n)throw new Error(`${e} requires observerLocation`);return h(n,e),n}function M(t,e,n){return Math.min(n,Math.max(e,t))}function g(t){let e=t;for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}function b(t){return t.replace(/\r/g,"\n").split("\n").map((t=>t.trim())).filter(Boolean)}function E(t,e){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[new RegExp(`<${n}\\b[^>]*>([\\s\\S]*?)</${n}>`,"i"),new RegExp(`<[^:>]+:${n}\\b[^>]*>([\\s\\S]*?)</[^:>]+:${n}>`,"i")];for(const e of o){const n=e.exec(t);if(n)return n[1].trim()}}function x(t){const e={},n=["CCSDS_OMM_VERS","COMMENT","CLASSIFICATION","OBJECT_NAME","OBJECT_ID","OBJECT_TYPE","COUNTRY_CODE","LAUNCH_DATE","SITE","DECAY_DATE","FILE","GP_ID","CENTER_NAME","REF_FRAME","REF_FRAME_EPOCH","TIME_SYSTEM","MEAN_ELEMENT_THEORY","CREATION_DATE","ORIGINATOR","MEAN_MOTION","ECCENTRICITY","INCLINATION","RA_OF_ASC_NODE","ARG_OF_PERICENTER","MEAN_ANOMALY","EPHEMERIS_TYPE","CLASSIFICATION_TYPE","NORAD_CAT_ID","ELEMENT_SET_NO","REV_AT_EPOCH","BSTAR","MEAN_MOTION_DOT","MEAN_MOTION_DDOT","EPOCH"];for(const o of n){const n=t[o];null!=n&&""!==n&&(e[o]="string"==typeof n?n.trim():n)}return e.EPOCH instanceof Date&&(e.EPOCH=e.EPOCH.toISOString()),e}function T(t){const e={},n=["CCSDS_OMM_VERS","COMMENT","CLASSIFICATION","OBJECT_NAME","OBJECT_ID","OBJECT_TYPE","COUNTRY_CODE","LAUNCH_DATE","SITE","DECAY_DATE","FILE","GP_ID","CENTER_NAME","REF_FRAME","REF_FRAME_EPOCH","TIME_SYSTEM","MEAN_ELEMENT_THEORY","CREATION_DATE","ORIGINATOR","MEAN_MOTION","ECCENTRICITY","INCLINATION","RA_OF_ASC_NODE","ARG_OF_PERICENTER","MEAN_ANOMALY","EPHEMERIS_TYPE","CLASSIFICATION_TYPE","NORAD_CAT_ID","ELEMENT_SET_NO","REV_AT_EPOCH","BSTAR","MEAN_MOTION_DOT","MEAN_MOTION_DDOT","EPOCH"];for(const o of n){const n=E(t,o);void 0!==n&&(e[o]=n)}if(!e.EPOCH){const n=E(t,"EPOCH");n&&(e.EPOCH=n)}return x(e)}function N(t){const e=b(t);if(e.length<2)throw new Error("Invalid CSV orbit source");const n=e[0].split(",").map((t=>t.trim())),o=e[1].split(",").map((t=>t.trim())),i={};return n.forEach(((t,e)=>{t&&(i[t]=o[e]??"")})),x(i)}function v(t){const e={},n=t.replace(/\r/g,"\n").split("\n");for(const t of n){const n=/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/.exec(t);if(!n)continue;const[,o,i]=n;e[o]=i}return x(e)}function O(t){if(t&&"object"==typeof t&&"satrec"===t.kind&&t.satrec)return{kind:"satrec",satrec:t.satrec};if(t&&"object"==typeof t&&"tle"===t.kind&&t.tle)return{kind:"tle",tle:{name:t.tle.name?String(t.tle.name).trim():void 0,line1:String(t.tle.line1).trim(),line2:String(t.tle.line2).trim()}};if(t&&"object"==typeof t&&"omm"===t.kind&&t.omm)return{kind:"omm",omm:x(t.omm)};if(t&&"object"==typeof t&&null!=t.no&&null!=t.ecco&&null!=t.inclo)return{kind:"satrec",satrec:t};if("string"==typeof t){const e=t.trim();if(!e)throw new Error("Orbit source is empty");if(function(t){return/^\s*<[\s\S]+>\s*$/.test(t)}(e))return{kind:"omm",source:e,omm:T(e)};if(function(t){return/^\s*[{[]/.test(t)}(e))try{const t=JSON.parse(e);if(Array.isArray(t)){if(1!==t.length)throw new Error("JSON orbit source must contain exactly one record");return O(t[0])}return O(t)}catch(t){throw new Error(`Invalid JSON orbit source: ${t.message}`)}if(function(t){const e=b(t);return!(e.length<2)&&e[0].includes(",")&&/(OBJECT_NAME|NORAD_CAT_ID|EPOCH)/.test(e[0])}(e))return{kind:"omm",source:e,omm:N(e)};if(function(t){return/^\s*[A-Z0-9_]+\s*=\s*/m.test(t)}(e))return{kind:"omm",source:e,omm:v(e)};const n=b(e);if(2===n.length)return{kind:"tle",source:e,tle:{line1:n[0],line2:n[1]}};if(n.length>=3)return{kind:"tle",source:e,tle:{name:n[0],line1:n[n.length-2],line2:n[n.length-1]}};throw new Error("Invalid orbit source string")}if(Array.isArray(t)){if(1!==t.length)throw new Error("Orbit source array must contain exactly one record");return O(t[0])}if(s(t)){if(t.line1&&t.line2)return{kind:"tle",tle:{name:t.name?String(t.name).trim():void 0,line1:String(t.line1).trim(),line2:String(t.line2).trim()}};if("tle"===t.type&&t.tle)return O(t.tle);if("tle"===t.format&&t.line1&&t.line2)return{kind:"tle",tle:{name:t.name?String(t.name).trim():void 0,line1:String(t.line1).trim(),line2:String(t.line2).trim()}};if("omm"===t.type&&t.omm)return{kind:"omm",omm:x(t.omm)};if(null!=t.MEAN_MOTION||null!=t.ECCENTRICITY||null!=t.INCLINATION||null!=t.NORAD_CAT_ID)return{kind:"omm",omm:x(t)}}throw new Error("Unsupported orbit source format")}function y(e){const n=O(e),o=t;if("satrec"===n.kind)return n.satrec;if("tle"===n.kind)return o.twoline2satrec(n.tle.line1,n.tle.line2);if("omm"===n.kind){if("function"!=typeof o.json2satrec)throw new Error("satellite.js json2satrec is unavailable in this build");return o.json2satrec(n.omm)}throw new Error("Unable to convert orbit source to satrec")}function A(t){if(Number.isFinite(t.jdsatepoch))return(t.jdsatepoch-2440587.5)*r;if(Number.isFinite(t.epochyr)&&Number.isFinite(t.epochdays)){const e=t.epochyr<100?2e3+t.epochyr:t.epochyr;return Date.UTC(e,0,1)+(t.epochdays-1)*r}return NaN}function I(t){if(null==t||""===t)return null;const e=Number(t);return Number.isFinite(e)?e:null}function z(t){if(null==t)return null;const e=String(t).trim();return e||null}function _(t){if(null==t||""===t)return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.toISOString();const e=String(t).trim();if(!e)return null;const n=/(?:Z|[+\-]\d{2}:\d{2})$/i.test(e)?e:`${e}Z`,o=new Date(n);return Number.isNaN(o.getTime())?null:o.toISOString()}function S(t){const e=function(t){const e=z(t);if(!e)return null;if(/^\d{4}-\d{3}[A-Z]+$/i.test(e))return e.toUpperCase();const n=/^(\d{2})(\d{3})([A-Z]+)$/i.exec(e.replace(/\s+/g,""));if(!n)return e.toUpperCase();const o=Number(n[1]);return`${o<57?2e3+o:1900+o}-${n[2]}${n[3].toUpperCase()}`}(t);if(!e)return{internationalDesignator:null,launchYear:null,launchNumberOfYear:null,launchPiece:null};const n=/^(\d{4})-(\d{3})([A-Z]+)$/.exec(e);return n?{internationalDesignator:e,launchYear:Number(n[1]),launchNumberOfYear:Number(n[2]),launchPiece:n[3]}:{internationalDesignator:e,launchYear:null,launchNumberOfYear:null,launchPiece:null}}function C(t,e){if(!Number.isFinite(t)||t<=0)return null;const n=Number.isFinite(e)?e:0,i=t*(1-n)-o,r=t*(1+n)-o;return Math.abs(t-42164)<2e3&&n<.1?"GEO":r<2e3?"LEO":r<35786?"MEO":i<2e3&&r>=35786?"HEO":"DEEP_SPACE"}function w(t){const e=O(t),i=y(e);return"tle"===e.kind?function(t,e){const n=t.line1,i=t.line2,r=A(e),a=Number.isFinite(r)?new Date(r).toISOString():null,s=S(n.substring(9,17)),c=I(i.substring(52,63)),l=I(`0.${i.substring(26,33).replace(/\s/g,"0")}`),u=Number.isFinite(c)&&c>0?86400/c:null,m=Number.isFinite(e.a)?e.a*o:null;return{format:"tle",name:z(t.name),noradCatalogNumber:z(n.substring(2,7)),classification:z(n.substring(7,8)),...s,centerName:"EARTH",referenceFrame:"TEME",timeSystem:"UTC",meanElementTheory:"SGP4",epoch:a,epochMs:Number.isFinite(r)?r:null,epochYear:Number.isFinite(e.epochyr)?e.epochyr<57?2e3+e.epochyr:1900+e.epochyr:null,epochDayOfYear:Number.isFinite(e.epochdays)?e.epochdays:null,meanMotion:c,meanMotionFirstDerivative:Number.isFinite(e.ndot)?e.ndot:null,meanMotionSecondDerivative:Number.isFinite(e.nddot)?e.nddot:null,bstar:Number.isFinite(e.bstar)?e.bstar:null,inclination:I(i.substring(8,16)),rightAscensionOfAscendingNode:I(i.substring(17,25)),eccentricity:l,argumentOfPerigee:I(i.substring(34,42)),meanAnomaly:I(i.substring(43,51)),ephemerisType:z(n.substring(62,63)),elementSetNumber:I(n.substring(64,68)),revolutionNumberAtEpoch:I(i.substring(63,68)),semiMajorAxisKm:m,orbitalPeriodSeconds:u,orbitClass:C(m,l),isDeepSpace:Boolean(Number.isFinite(u)&&u>=13500),raw:{line0:z(t.name),line1:n,line2:i}}}(e.tle,i):"omm"===e.kind?function(t,e){const n=_(t.EPOCH),i=n?new Date(n):null,a=i?i.getTime():null,s=S(t.OBJECT_ID),c=I(t.MEAN_MOTION),l=I(t.ECCENTRICITY),u=Number.isFinite(c)&&c>0?86400/c:null,m=Number.isFinite(e.a)?e.a*o:null;return{format:"omm",name:z(t.OBJECT_NAME),noradCatalogNumber:z(t.NORAD_CAT_ID),classification:z(t.CLASSIFICATION_TYPE??t.CLASSIFICATION),...s,objectType:z(t.OBJECT_TYPE),countryCode:z(t.COUNTRY_CODE),launchDate:_(t.LAUNCH_DATE),decayDate:_(t.DECAY_DATE),centerName:z(t.CENTER_NAME)??"EARTH",referenceFrame:z(t.REF_FRAME)??"TEME",referenceFrameEpoch:_(t.REF_FRAME_EPOCH),timeSystem:z(t.TIME_SYSTEM)??"UTC",meanElementTheory:z(t.MEAN_ELEMENT_THEORY),creationDate:_(t.CREATION_DATE),originator:z(t.ORIGINATOR),comment:z(t.COMMENT),epoch:n,epochMs:a,epochYear:i?i.getUTCFullYear():null,epochDayOfYear:i?(a-Date.UTC(i.getUTCFullYear(),0,1))/r+1:null,meanMotion:c,meanMotionFirstDerivative:I(t.MEAN_MOTION_DOT),meanMotionSecondDerivative:I(t.MEAN_MOTION_DDOT),bstar:I(t.BSTAR),inclination:I(t.INCLINATION),rightAscensionOfAscendingNode:I(t.RA_OF_ASC_NODE),eccentricity:l,argumentOfPerigee:I(t.ARG_OF_PERICENTER),meanAnomaly:I(t.MEAN_ANOMALY),ephemerisType:z(t.EPHEMERIS_TYPE),elementSetNumber:I(t.ELEMENT_SET_NO),revolutionNumberAtEpoch:I(t.REV_AT_EPOCH),semiMajorAxisKm:m,orbitalPeriodSeconds:u,orbitClass:C(m,l),isDeepSpace:Boolean(Number.isFinite(u)&&u>=13500),raw:{...t}}}(e.omm,i):function(t){const e=A(t),i=Number.isFinite(e)?new Date(e).toISOString():null,r=Number.isFinite(t.a)?t.a*o:null,a=Number.isFinite(t.no)?1440*t.no/(2*Math.PI):null,s=Number.isFinite(t.ecco)?t.ecco:null,c=Number.isFinite(a)&&a>0?86400/a:null;return{format:"satrec",name:null,noradCatalogNumber:z(t.satnum),classification:null,internationalDesignator:null,launchYear:null,launchNumberOfYear:null,launchPiece:null,centerName:"EARTH",referenceFrame:"TEME",timeSystem:"UTC",meanElementTheory:"SGP4",epoch:i,epochMs:Number.isFinite(e)?e:null,epochYear:Number.isFinite(t.epochyr)?t.epochyr<57?2e3+t.epochyr:1900+t.epochyr:null,epochDayOfYear:Number.isFinite(t.epochdays)?t.epochdays:null,meanMotion:a,meanMotionFirstDerivative:Number.isFinite(t.ndot)?t.ndot:null,meanMotionSecondDerivative:Number.isFinite(t.nddot)?t.nddot:null,bstar:Number.isFinite(t.bstar)?t.bstar:null,inclination:Number.isFinite(t.inclo)?t.inclo/n:null,rightAscensionOfAscendingNode:Number.isFinite(t.nodeo)?t.nodeo/n:null,eccentricity:s,argumentOfPerigee:Number.isFinite(t.argpo)?t.argpo/n:null,meanAnomaly:Number.isFinite(t.mo)?t.mo/n:null,ephemerisType:null,elementSetNumber:null,revolutionNumberAtEpoch:null,semiMajorAxisKm:r,orbitalPeriodSeconds:c,orbitClass:C(r,s),isDeepSpace:Boolean(Number.isFinite(c)&&c>=13500),raw:t}}(i)}function F(e){const n=t.jday(e);try{return t.gstime(n)}catch(n){return t.gstime(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}}function $(e,n){try{const o=t.propagate(n,e);if(o&&o.position)return o}catch(t){}return t.propagate(n,e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}function L(o){if("function"==typeof t.sunPos){const n=t.sunPos(t.jday(o));if(n&&Array.isArray(n.rsun)&&n.rsun.length>=3)return{x:n.rsun[0]*e,y:n.rsun[1]*e,z:n.rsun[2]*e}}const i=o.getTime()/r+2444238.5-2415020,a=1900+i/365.25,s=(i+(26.465+.747622*(a-1950)+1.886913*Math.sin(2*Math.PI*(a-1975)/33))/(r/1e3))/36525,c=n*((358.47583+35999.04975*s%360-(15e-5+33e-7*s)*Math.pow(s,2))%360),l=n*((279.69668+36000.76892*s%360+3025e-7*Math.pow(s,2))%360),u=.01675104-(418e-7+126e-9*s)*s,m=n*((1.91946-(.004789+1e-4*s)*s)*Math.sin(c)+(.020094-1e-4*s)*Math.sin(2*c)+293e-6*Math.sin(3*c)),d=n*((259.18-1934.142*s)%360),h=(l+m-n*(.00569-.00479*Math.sin(d)))%(2*Math.PI),f=(c+m)%(2*Math.PI);let p=1.0000002*(1-Math.pow(u,2))/(1+u*Math.cos(f));const M=n*(23.452294-(.0130125+(164e-8-503e-9*s)*s)*s+.00256*Math.cos(d));return p*=e,{x:p*Math.cos(h),y:p*Math.sin(h)*Math.cos(M),z:p*Math.sin(h)*Math.sin(M)}}function U(t,e){const n=Math.sqrt(t.x**2+t.y**2+t.z**2),i=e.x-t.x,r=e.y-t.y,a=e.z-t.z,s=Math.sqrt(i**2+r**2+a**2),c=o,l=Math.asin(M(c/n,-1,1)),u=Math.asin(M(696e3/s,-1,1)),m=-t.x,d=-t.y,h=-t.z,f=e.x*m+e.y*d+e.z*h,p=l-u-Math.acos(M(f/(Math.sqrt(e.x**2+e.y**2+e.z**2)*n),-1,1));return{depth:p,eclipsed:l>=u&&p>=0}}function k(t){const e=24*t.no*60/(2*Math.PI);return Math.abs(e-1.0027)<.005}function j(t,e){let i=24*t.no*60/(2*Math.PI);if(0===i)return!1;let r=t.inclo/n;r>=90&&(r=180-r);const a=331.25*Math.exp(Math.log(1440/i)*(2/3))*(1+t.ecco)-o;return Math.acos(o/(a+o))+r*n>Math.abs(e[0]*n)}function H(t,e){const n=A(t),o=24*t.no*60/(2*Math.PI),i=24*t.ndot*60*24*60/(2*Math.PI);return!(!Number.isFinite(n)||!Number.isFinite(o)||0===i)&&n+r*((16.666666-o)/(10*Math.abs(i)))<e}function B(t,e,n){return!(!e||j(t,e))||!(null==n||!H(t,n))}function V(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}}function G(t){return Math.sqrt(t.x**2+t.y**2+t.z**2)}function W(e,i,r){const a=y(e),s=c(r),l=$(s,a);if(!l||!l.position)return null;const u=F(s),m=t.eciToGeodetic(l.position,u),d=L(s),p=U(l.position,d),b=m.height,E=M(o/Math.max(o+b,1e-6),-1,1),x={timestamp:s.getTime(),eci:l,gmst:u,latitude:m.latitude/n,longitude:g(m.longitude/n),altitude:b,footprint:2*o*Math.acos(E),sunlit:!p.eclipsed,eclipseDepth:p.depth/n},T=f(i);if(T){h(T,"observeAt");const e={longitude:T[1]*n,latitude:T[0]*n,height:T[2]},o=t.eciToEcf(l.position,u),i=t.eciToEcf(l.velocity,u),r=t.geodeticToEcf(e),a=t.ecfToLookAngles(e,o),s=t.dopplerFactor(r,o,i);x.azimuth=a.azimuth/n,x.elevation=a.elevation/n,x.rangeSat=a.rangeSat,x.doppler=s}return x}function Z(t,e,n){let o=n,a=W(t,e,o);if(!a)return null;let s=0,c=0;if(a.elevation>0)return o;for(;a.elevation<-1&&c<i().maxIterations&&(o-=35e-5*r*(a.elevation*(a.altitude/8400+.46)-2),a=W(t,e,o),a);)c+=1;for(c=0;0===s&&c<i().maxIterations&&a;)Math.abs(a.elevation)<.5?s=o:(o-=r*a.elevation*Math.sqrt(a.altitude)/53e4,a=W(t,e,o)),c+=1;return 0===s?null:s}function J(t,e,n){let o=n,a=W(t,e,o),s=0,c=0;for(;0===s&&c<i().maxIterations;){if(Math.abs(a.elevation)<.5)s=o;else if(o+=r*a.elevation*Math.sqrt(a.altitude)/502500,a=W(t,e,o),!a)break;c+=1}return s}function K(t,e){const n=V(e,t);if(0===G(n))return!1;const i=n.x*n.x+n.y*n.y+n.z*n.z,r=2*(t.x*n.x+t.y*n.y+t.z*n.z),a=r*r-4*i*(t.x*t.x+t.y*t.y+t.z*t.z-o*o);if(a<0)return!0;const s=(-r+Math.sqrt(a))/(2*i),c=(-r-Math.sqrt(a))/(2*i);return s<0||s>1||c<0||c>1}function X(t,e,n,o){const i=G(V(e.position,t.position)),r=G(V(e.velocity,t.velocity));if(0===r)return o;const a=Math.max(1,Math.min(o,i/r));return n?o:Math.min(o,a/2)}function Q(t,e,n){const o=W(t,e,n);return o&&Number.isFinite(o.elevation)?o:null}function tt(t,e,n){return t?e?Math.abs(t.elevation-n)<=Math.abs(e.elevation-n)?t:e:t:e}function et(t,e,n,o,i){let r=Q(t,e,n),a=Q(t,e,o);if(!r||!a)return tt(r,a,i);let s=n,c=o,l=0;for(;c-s>250&&l<25;){const n=Math.floor((s+c)/2),o=Q(t,e,n);if(!o)break;const u=r.elevation-i,m=o.elevation-i;if(0===u)return r;u<0&&m>=0||u>=0&&m<0?(c=n,a=o):(s=n,r=o),l+=1}return tt(r,a,i)}function nt(t,e,n,o){const i=Math.max(o-n,0),r=Math.max(1e3,Math.min(5e3,Math.floor(i/120)||1e3));let a=n,s=Number.NEGATIVE_INFINITY,c=0,l=null,u=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;for(;a<=o;){const n=Q(t,e,a);n&&(n.elevation>s&&(s=n.elevation,c=n.azimuth,l=a),u=Math.min(u,n.azimuth),m=Math.max(m,n.azimuth)),a+=r}const d=Q(t,e,o);return d&&(d.elevation>s&&(s=d.elevation,c=d.azimuth,l=o),u=Math.min(u,d.azimuth),m=Math.max(m,d.azimuth)),{maxElevation:Number.isFinite(s)?s:0,apexAzimuth:c,apexTime:l,minAzimuth:Number.isFinite(u)?u:0,maxAzimuth:Number.isFinite(m)?m:0}}function ot(t,e,n,o,r,a=100){const s=c(n),l=c(o),u=y(t),m=null==r?4:r,d=null==a?i().maxIterations:a,h=p(e,"findTransits");if(!Number.isFinite(d)||d<0)throw new Error("maxTransits must be a non-negative number");return it(u,h,s.getTime(),l.getTime(),m,d).transits}function it(t,e,n,o,r,a){const s=[];let c=n,l=Q(t,e,c),u=0,m="windowEnded",d=n;const h=i().maxIterations;let f=Boolean(l&&l.elevation>=r),p=f?n:null;for(;l&&c<o&&u<h&&s.length<a;){const n=Math.min(c+3e4,o),i=Q(t,e,n);if(d=n,!i){m="noTransitPredicted";break}if(!f&&l.elevation<r&&i.elevation>=r){const o=et(t,e,c,n,r);p=o?o.timestamp:n,f=!0}if(f&&l.elevation>=r&&i.elevation<r){const o=et(t,e,c,n,r),i=o?o.timestamp:n,a=nt(t,e,p,i);s.push({start:p,end:i,maxElevation:a.maxElevation,apexAzimuth:a.apexAzimuth,apexTime:a.apexTime,maxAzimuth:a.maxAzimuth,minAzimuth:a.minAzimuth,duration:i-p}),f=!1,p=null}c=n,l=i,u+=1}if(f&&null!=p&&l){const n=Math.min(c,o),i=nt(t,e,p,n);s.push({start:p,end:n,maxElevation:i.maxElevation,apexAzimuth:i.apexAzimuth,apexTime:i.apexTime,maxAzimuth:i.maxAzimuth,minAzimuth:i.minAzimuth,duration:n-p})}return s.length>=a?m="maxTransitsReached":u>=h?m="maxIterationsReached":0===s.length&&(m="noTransitPredicted"),{transits:s,iterations:u,terminationReason:m,lastScanTime:d}}function rt(t,e,n,o){const i=c(n),r=c(o),a=y(t),s=p(e,"visibilityWindows");if(k(a)&&j(a,s))return[[i.getTime(),r.getTime()]];const l=ot(a,s,i,r,0);return l&&0!==l.length?l.map((t=>[t.start,t.end])):[]}return R={DEFAULT_MAX_TRANSITS:100,parseOrbitSource:O,normalizeOrbitSource:O,parseOrbitMetadata:w,parseOrbitElements:function(t){const e=w(t);return{epoch:e.epoch,epochMs:e.epochMs,epochYear:e.epochYear,epochDayOfYear:e.epochDayOfYear,meanMotion:e.meanMotion,meanMotionFirstDerivative:e.meanMotionFirstDerivative,meanMotionSecondDerivative:e.meanMotionSecondDerivative,bstar:e.bstar,inclination:e.inclination,rightAscensionOfAscendingNode:e.rightAscensionOfAscendingNode,eccentricity:e.eccentricity,argumentOfPerigee:e.argumentOfPerigee,meanAnomaly:e.meanAnomaly,semiMajorAxisKm:e.semiMajorAxisKm,orbitalPeriodSeconds:e.orbitalPeriodSeconds,revolutionNumberAtEpoch:e.revolutionNumberAtEpoch,ephemerisType:e.ephemerisType}},parseTle:function(t){const e=O(t);if("tle"!==e.kind)throw new Error("parseTle requires TLE input");return w(e)},fromTle:(t,e)=>O(e?{line1:t,line2:e}:t),fromJsonGp:t=>O(x(t)),fromOmmXml:t=>O(T(t)),toSatrec:y,observeAt:W,ephemeris:function(t,e,n,o,r){const a=c(n),s=c(o),u=l(r,6e4),m=[],d=i().maxIterations;let h=new Date(a.getTime()),f=0;for(;h<s&&f<d;){const n=W(t,e,h);if(!n)break;m.push(n),h=new Date(h.getTime()+u),i().printIntervalInfo&&console.log(h.toISOString()),f+=1}return m},findTransits:ot,findTransitsDebug:function(t,e,n,o,r,a=100,s={}){const u=c(n),m=c(o),d=y(t),h=null==r?4:r,f=null==a?i().maxIterations:a,M=p(e,"findTransitsDebug"),g=l(s.scanStepMs,6e4);if(!Number.isFinite(f)||f<0)throw new Error("maxTransits must be a non-negative number");const b=it(d,M,u.getTime(),m.getTime(),h,f),E=function(t,e,n,o,r){const a={scanStepMs:r,maxElevationInWindow:Number.NEGATIVE_INFINITY,closestToHorizonAt:null,closestToHorizonElevation:null,latestNearHorizonAt:null,sampledPoints:0};if(o<=n)return a.maxElevationInWindow=null,a;let s=n,c=Number.POSITIVE_INFINITY,l=0;const u=i().maxIterations;for(;s<=o&&l<u;){const n=W(t,e,s);if(!n)break;if(a.sampledPoints+=1,Number.isFinite(n.elevation)){n.elevation>a.maxElevationInWindow&&(a.maxElevationInWindow=n.elevation);const t=Math.abs(n.elevation);t<c&&(c=t,a.closestToHorizonAt=s,a.closestToHorizonElevation=n.elevation),t<=1&&(a.latestNearHorizonAt=s)}s+=r,l+=1}return a.maxElevationInWindow===Number.NEGATIVE_INFINITY&&(a.maxElevationInWindow=null),a}(d,M,u.getTime(),m.getTime(),g);return{transits:b.transits,diagnostics:{...E,thresholdElevation:h,searchIterations:b.iterations,terminationReason:b.terminationReason,lastScanTime:b.lastScanTime}}},transitSegment:function(t,e,n,o){const i=c(n),r=c(o);return it(y(t),p(e,"transitSegment"),i.getTime(),r.getTime(),0,1).transits[0]||null},groundVisibilityWindows:function(t,e,n,o){return rt(t,e,n,o)},visibilityWindows:rt,satelliteVisibilityWindows:function(t,e,n,o,r=60){const a=y(t),s=y(e),l=c(n),u=c(o),m=[];let d=new Date(l.getTime()),h=!1,f=null;const p=i().maxIterations;for(;d<=u&&m.length<p;){const t=$(d,a),e=$(d,s);if(!t.position||!e.position)break;const n=K(t.position,e.position);n&&!h?(h=!0,f=d.getTime()):!n&&h&&(h=!1,m.push([f,d.getTime()]),f=null);const o=X(t,e,n,r);d=new Date(d.getTime()+1e3*o)}return h&&null!=f&&m.push([f,u.getTime()]),m},orbitalPeriodFromOrbitSource:function(t){const e=y(t).a*o;return 2*Math.PI*Math.sqrt(Math.pow(e,3)/398600.5)},orbitalPeriodFromCartesian3:function(t=[0,0,0]){const[e,n,o]=t,i=Math.sqrt(e*e+n*n+o*o);return i<=0?0:2*Math.PI*Math.sqrt(Math.pow(i,3)/398600.5)},_internals:{boundLongitude:g,clamp:M,getPropagation:$,getGmst:F,getSunVector:L,satEclipsed:U,isGeostationary:k,badSat:B,aosHappens:j,decayed:H,findAOS:Z,findLOS:J,quickPredict:function(t,e,o,a){if(k(t))return null;if(B(t,e,o))return null;const s={};let c=0,l=0;const u=i().maxIterations;let m=Z(t,e,o);if(!m)return null;s.start=m;let d=W(t,e,m);if(!d)return null;let h=Math.round(d.elevation),f=0,p=0,M=null,g=360,b=0;for(;h>=0&&l<u&&(!a||m<a)&&(c=h,m+=r*Math.cos((d.elevation-1)*n)*Math.sqrt(d.altitude)/25e3,d=W(t,e,m),d);)h=Math.round(d.elevation),f<d.elevation&&(f=d.elevation,p=d.azimuth,M=m),b=Math.max(b,d.azimuth),g=Math.min(g,d.azimuth),l+=1;return 0!==c&&(m=J(t,e,m)),s.end=m,s.maxElevation=f,s.apexAzimuth=p,s.apexTime=M,s.maxAzimuth=b,s.minAzimuth=g,s.duration=s.end-s.start,s},isSatToSatVisible:K,adaptiveStep:X,vecSub:V,magnitude:G,scalarMultiply:function(t,e){return{x:t*e.x,y:t*e.y,z:t*e.z}},angle:function(t,e){const n=t.x*e.x+t.y*e.y+t.z*e.z;return Math.acos(n/(G(t)*G(e)))}}}}function B(){return L?$:(L=1,$=H())}var V=function(){if(k)return U;k=1;const t=i(),e=B();function n(e){if(null==e)return t.maxIterations;if(!Number.isFinite(e)||e<=0)throw new Error("max must be a positive number");return t.maxIterations=Math.floor(e),t.maxIterations}function o(e){return t.printIntervalInfo=Boolean(e),t.printIntervalInfo}const r={printIntervalInfo:o,setDebugIntervalLogging:o,setMax:n,setIterationLimit:n,DEFAULT_MAX_TRANSITS:e.DEFAULT_MAX_TRANSITS,normalizeOrbitSource:e.normalizeOrbitSource,parseOrbitMetadata:e.parseOrbitMetadata,parseOrbitElements:e.parseOrbitElements,parseTle:e.parseTle,fromTle:e.fromTle,fromJsonGp:e.fromJsonGp,fromOmmXml:e.fromOmmXml,observeAt:e.observeAt,getPositionByTime:e.observeAt,ephemeris:e.ephemeris,getEphemeris:e.ephemeris,findTransits:e.findTransits,transits:e.findTransits,findTransitsDebug:e.findTransitsDebug,transitSegment:e.transitSegment,getTra