PageSourceSearch

https://www.orchestrsim.com/_next/static/chunks/740.476bd9897b526b5a.js

js orchestrsim.com collected 2026-10-02 01:39:02 UTC 32,433 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[740],{8408:function(e,t,a){a.r(t),a.d(t,{default:function(){return M}});var r=a(3323),n=a(7979),i=a(2838),s=a(7574),l=a(3914),o=a(1189),c=a(7283),d=a(2701),u=a(4174),p=a(8394),h=a(3278),m=a(3632),x=a.n(m);function f(e,t){if(!e)return NaN;let a=e.indexOf(".");if(a<0)return NaN;let r=a-2,n=parseInt(e.slice(0,r),10),i=parseFloat(e.slice(r)),s=n+i/60;return("S"===t||"W"===t)&&(s=-s),s}a(150);class b{static available(){return"undefined"!=typeof navigator&&!!navigator.serial}async connect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9600;if(!navigator.serial)throw Error("Web Serial API not supported. Use desktop Chrome / Edge / Opera.");this.port=await navigator.serial.requestPort(),await this.port.open({baudRate:e}),this.running=!0,this.pump()}onUpdate(e){this.onFix=e}async disconnect(){var e,t;this.running=!1;try{await (null===(e=this.reader)||void 0===e?void 0:e.cancel())}catch(e){}try{await (null===(t=this.port)||void 0===t?void 0:t.close())}catch(e){}this.port=null,this.reader=null}async pump(){var e,t,a,r,n,i,s;if(!(null===(e=this.port)||void 0===e?void 0:e.readable))return;let l=new TextDecoder;this.reader=this.port.readable.getReader();try{for(;this.running;){let e;let{value:s,done:o}=await this.reader.read();if(o)break;if(s)for(this.buf+=l.decode(s,{stream:!0});-1!==(e=this.buf.indexOf("\n"));){let s=this.buf.slice(0,e).trim();if(this.buf=this.buf.slice(e+1),0===s.length)continue;let l=function(e){if(!e.startsWith("$"))return null;let t=e.indexOf("*"),a=t>=0?e.slice(1,t):e.slice(1),r=a.split(","),n=r[0];if(n.endsWith("RMC")){if("A"!==r[2])return{fix:"no-fix"};let e=f(r[3],r[4]),t=f(r[5],r[6]),a=parseFloat(r[7]),n=parseFloat(r[8]);return Number.isFinite(e)&&Number.isFinite(t)?{lat:e,lon:t,speedKt:Number.isFinite(a)?a:null,trackDeg:Number.isFinite(n)?n:null,fix:"3d",ts:Date.now()}:null}if(n.endsWith("GGA")){let e=parseInt(r[6]||"0",10);if(0===e)return{fix:"no-fix"};let t=f(r[2],r[3]),a=f(r[4],r[5]),n=parseFloat(r[9]);return Number.isFinite(t)&&Number.isFinite(a)?{lat:t,lon:a,altFt:Number.isFinite(n)?Math.round(3.28084*n):null,fix:e>=2?"3d":"2d",ts:Date.now()}:null}return null}(s);l&&(this.merged={...this.merged,...l},"number"==typeof this.merged.lat&&"number"==typeof this.merged.lon&&this.onFix&&this.onFix({lat:this.merged.lat,lon:this.merged.lon,altFt:null!==(t=this.merged.altFt)&&void 0!==t?t:null,speedKt:null!==(a=this.merged.speedKt)&&void 0!==a?a:null,trackDeg:null!==(r=this.merged.trackDeg)&&void 0!==r?r:null,fix:null!==(n=this.merged.fix)&&void 0!==n?n:"3d",ts:null!==(i=this.merged.ts)&&void 0!==i?i:Date.now()}))}}}catch(e){}finally{try{null===(s=this.reader)||void 0===s||s.releaseLock()}catch(e){}}}constructor(){this.port=null,this.reader=null,this.running=!1,this.buf="",this.merged={},this.onFix=null}}var g=a(4267),v=a(2821),w=a(8066);delete x().Icon.Default.prototype._getIconUrl,x().Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/[email protected]/dist/images/marker-shadow.png"});let y={vfr:{name:"VFR",url:"https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Sectional/MapServer/tile/{z}/{y}/{x}",maxZoom:11,attr:"FAA \xb7 Esri"},ifrLow:{name:"IFR Low",url:"https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/IFR_AreaLow/MapServer/tile/{z}/{y}/{x}",maxZoom:11,attr:"FAA \xb7 Esri"},ifrHigh:{name:"IFR High",url:"https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/IFR_High/MapServer/tile/{z}/{y}/{x}",maxZoom:11,attr:"FAA \xb7 Esri"},sat:{name:"Sat",url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",maxZoom:19,attr:"\xa9 Esri \xb7 Maxar"},terrain:{name:"Terrain",url:"https://tile.opentopomap.org/{z}/{x}/{y}.png",maxZoom:15,attr:"\xa9 OpenTopoMap (CC-BY-SA) \xb7 OpenStreetMap"}};function j(e){switch(e){case"B":return"#3b82f6";case"C":return"#a855f7";case"D":return"#22d3ee";case"E":return"#9ca3af";case"MOA":case"TRSA":case"RESTRICTED":return"#ef4444";default:return"#6b7280"}}function k(e){let{lat:t,lon:a,source:r}=e,s=(0,i.Sx)(),l=(0,n.useRef)(!1);return(0,n.useEffect)(()=>
1{if("default"!==r&&!l.current){let e="gps"===r||"qt"===r||"serial"===r;s.flyTo([t,a],e?6:4,{duration:1.2}),l.current=!0}},[t,a,r,s]),null}function N(e,t){let a=e[0]*Math.PI/180,r=t[0]*Math.PI/180,n=(t[0]-e[0])*Math.PI/180,i=(t[1]-e[1])*Math.PI/180;return 6880.13*Math.asin(Math.min(1,Math.sqrt(Math.sin(n/2)**2+Math.cos(a)*Math.cos(r)*Math.sin(i/2)**2)))}function S(e){let{enabled:t,start:a,end:n,onClick:o}=e;return((0,i.$_)("click",e=>{t&&o(e.latlng)}),t&&a)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.J,{position:a,icon:x().divIcon({html:'<div style="width:12px;height:12px;background:#fbbf24;border:2px solid #000;border-radius:50%;"></div>',iconSize:[12,12],iconAnchor:[6,6],className:""}),interactive:!1}),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.a,{positions:[a,n],pathOptions:{color:"#fbbf24",weight:3,dashArray:"6 6"}}),(0,r.jsx)(s.J,{position:n,icon:x().divIcon({html:'<div style="width:12px;height:12px;background:#fbbf24;border:2px solid #000;border-radius:50%;"></div>',iconSize:[12,12],iconAnchor:[6,6],className:""}),interactive:!1})]})]}):null}function F(e){let{onChange:t}=e,a=(0,i.Sx)();return(0,n.useEffect)(()=>{let e=()=>{let e=a.getBounds();t({minLat:e.getSouth(),maxLat:e.getNorth(),minLon:e.getWest(),maxLon:e.getEast(),zoom:a.getZoom()})};return e(),a.on("moveend",e),a.on("zoomend",e),()=>{a.off("moveend",e),a.off("zoomend",e)}},[a,t]),null}function M(){var e,t,i,m,f,M,I;let[A,C]=(0,n.useState)("sat"),[z,D]=(0,n.useState)({airports:!0,navaids:!0,fixes:!0,airways:!0,airspaces:!0,procedures:!1,terrain:!1}),[R,E]=(0,n.useState)("nexrad"),[L,O]=(0,n.useState)("internet"),[Z,q]=(0,n.useState)(()=>{try{return localStorage.getItem("jeb-dump1090-url")||""}catch(e){return""}});(0,n.useEffect)(()=>{try{localStorage.setItem("jeb-dump1090-url",Z)}catch(e){}},[Z]);let[P,_]=(0,n.useState)([]),[T,U]=(0,n.useState)("https://tilecache.rainviewer.com"),[B,W]=(0,n.useState)(0),[G,H]=(0,n.useState)(!1),[K,J]=(0,n.use
1State)(null),[X,V]=(0,n.useState)(1),Y=(0,n.useRef)(new Map),[$,Q]=(0,n.useState)(null),[ee,et]=(0,n.useState)(null),[ea,er]=(0,n.useState)(null),[en,ei]=(0,n.useState)(null),[es,el]=(0,n.useState)(!1),[eo,ec]=(0,n.useState)(null),[ed,eu]=(0,n.useState)([]),[ep,eh]=(0,n.useState)([]),[em,ex]=(0,n.useState)([]),[ef,eb]=(0,n.useState)([]),[eg,ev]=(0,n.useState)([]),[ew,ey]=(0,n.useState)(null),[ej,ek]=(0,n.useState)([]),[eN,eS]=(0,n.useState)([]),[eF,eM]=(0,n.useState)(null),[eI,eA]=(0,n.useState)(null),[eC,ez]=(0,n.useState)(!1),[eD,eR]=(0,n.useState)(null),[eE,eL]=(0,n.useState)(null),[eO,eZ]=(0,n.useState)(null),[eq,eP]=(0,n.useState)(null),e_=(0,n.useRef)(null),eT=function(){let[e,t]=(0,n.useState)({lat:45.4706,lon:-73.7408,source:"default",track:0});return(0,n.useEffect)(()=>{let e=!1,r=null;if(a.e(640).then(a.bind(a,1640)).then(a=>{let{subscribeQtPosition:n}=a;return n(a=>{e||t({lat:a.lat,lon:a.lon,source:"qt",track:a.trackDegrees})}).then(t=>{e?t():r=t})}).catch(()=>{}),!navigator.geolocation)return fetch("/api/ip-location").then(e=>e.json()).then(e=>{e.lat&&e.lon&&t({lat:e.lat,lon:e.lon,source:"ip",track:0})}).catch(()=>{}),()=>{e=!0,null==r||r()};let n=a=>{var r;e||t({lat:a.coords.latitude,lon:a.coords.longitude,source:"gps",track:null!==(r=a.coords.heading)&&void 0!==r?r:0})};navigator.geolocation.getCurrentPosition(n,()=>{e||fetch("/api/ip-location").then(e=>e.json()).then(a=>{!e&&a.lat&&a.lon&&t({lat:a.lat,lon:a.lon,source:"ip",track:0})}).catch(()=>{})},{enableHighAccuracy:!0,maximumAge:3e4,timeout:8e3});let i=navigator.geolocation.watchPosition(n,()=>{},{enableHighAccuracy:!0,maximumAge:5e3});return()=>{e=!0,navigator.geolocation.clearWatch(i),null==r||r()}},[]),e}(),{addWaypoint:eU}=(0,g.kf)(),eB=eO?{lat:eO.lat,lon:eO.lon,source:"serial",track:null!==(i=eO.trackDeg)&&void 0!==i?i:0}:eT;(0,n.useEffect)(()=>{Promise.all([fetch("/navdata/airports.json").then(e=>e.json()).catch(()=>[]),fetch("/navdata/navaids.json").then(e=>e.json()).catch(()=>[]),fetch("/navdata/airspace.json").then(e=>e.json()).catch(()=>[]),fetch("/navdata/peaks.json").then(e=>e.json()).catch(()=>({})),fetch("/navdata/cifp/fixes.json").then(e=>e.json()).catch(()=>[]),fetch("/navdata/cifp/airways.json").then(e=>e.json()).catch(()=>[]),fetch("/navdata/cifp/procedures.json").then(e=>e.json()).catch(()=>null)]).then(e=>{var t;let[a,r,n,i,s,l,o]=e;eu(a),eh(r),ex(n),eb(null!==(t=null==i?void 0:i.peaks)&&void 0!==t?t:[]),ek(s),eS(l),eM(o)})},[]),(0,n.useEffect)(()=>{if("internet"!==L&&"dump1090"!==L){ev([]);return}if("default"===eB.source&&!eI)return;let e=!1,t=async()=>{try{var t,a,r,n,i;let s;if("dump1090"===L){if(!Z)return;let i=await fetch(Z),l=await i.json();if(e||!Array.isArray(null==l?void 0:l.aircraft))return;s=l.aircraft.map(e=>({icao:(e.hex||"").toUpperCase(),flight:(e.flight||"").trim(),lat:e.lat,lon:e.lon,altFt:null!==(a=null!==(t=e.alt_baro)&&void 0!==t?t:e.alt_geom)&&void 0!==a?a:0,gsKt:null!==(r=e.gs)&&void 0!==r?r:0,trackDeg:null!==(n=e.track)&&void 0!==n?n:0,aircraftType:e.t,registration:e.r,squawk:"string"==typeof e.squawk?e.squawk:"number"==typeof e.squawk?String(e.squawk).padStart(4,"0"):void 0,vsiFpm:Number.isFinite(e.baro_rate)?e.baro_rate:Number.isFinite(e.geom_rate)?e.geom_rate:void 0})).filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))}else{let t;t=eI?"bbox=".concat(eI.minLat.toFixed(3),",").concat(eI.minLon.toFixed(3),",")+"".concat(eI.maxLat.toFixed(3),",").concat(eI.maxLon.toFixed(3)):"lat=".concat(eB.lat.toFixed(3),"&lon=").concat(eB.lon.toFixed(3),"&dist=50");let a=await fetch("/api/traffic?".concat(t)),r=await a.json();if(e||!Array.isArray(null==r?void 0:r.aircraft))return;s=r.aircraft}ev(s);let l=Date.now(),o=Y.current;for(let e of s){let t=null!==(i=o.get(e.icao))&&void 0!==i?i:[],a=t[t.length-1];(!a||Math.abs(a.lat-e.lat)>.001||Math.abs(a.lon-e.lon)>.001)&&t.push({lat:e.lat,lon:e.lon,ts:l}),t.length>60&&t.splice(0,t.length-60),o.set(e.icao,t)}let c=[];for(let e of(o.forEach((e,t)=>{(0===e.length||l-e[e.length-1].ts>3e5)&&c.push(t)}),c))o.delete(e)}catch(e){}};t();let a=setInterval(t,15e3);return()=>{e=!0,clearInterval(a)}},[eB.lat,eB.lon,eB.source,L,eI]),(0,n.useEffect)(()=>{"default"!==eB.source&&fetch("/api/weather/winds?lat=".concat(eB.lat.toFixed(3),"&lon=").concat(eB.lon.toFixed(3),"&alt=6500")).then(e=>e.json()).then(e=>{e&&Number.isFinite(e.speedKt)&&ey(e)}).catch(()=>{})},[eB.lat,eB.lon,eB.source]);let eW=async e=>{el(!0),ec(null);try{let t=await fetch("/api/charts/index?icao=".concat(encodeURIComponent(e.icao))),r=await t.json();if(!t.ok)throw Error((null==r?void 0:r.error)||"index ".concat(t.status));let n=r.groups.flatMap(e=>e.items.map(t=>({...t,group:e.label}))),i=n.find(e=>"APD"===e.code&&e.georef),s=null!=i?i:n.find(e=>e.georef);if(!s)throw Error("No georeferenced plate for this airport");let{renderPlateToDataUrl:l}=await a.e(66).then(a.bind(a,797)),o=await l("".concat(r.pdfBase).concat(s.pdf)),c=s.georef;ei({png:o,bounds:[[c.latBottom,c.lonLeft],[c.latTop,c.lonRight]],name:s.name,icao:e.icao})}catch(e){ec(e instanceof Error?e.message:String(e))}finally{el(!1)}};(0,n.useEffect)(()=>
1{if("rainviewer"!==R)return;let e=!1,t=async()=>{try{var t,a,r,n;let i=await fetch("https://api.rainviewer.com/public/weather-maps.json"),s=await i.json();if(e)return;"string"==typeof s.host&&U(s.host);let l=(null!==(r=null==s?void 0:null===(t=s.radar)||void 0===t?void 0:t.past)&&void 0!==r?r:[]).map(e=>({time:e.time,path:e.path,kind:"past"})),o=(null!==(n=null==s?void 0:null===(a=s.radar)||void 0===a?void 0:a.nowcast)&&void 0!==n?n:[]).map(e=>({time:e.time,path:e.path,kind:"nowcast"})),c=[...l,...o];_(c),c.length>0&&W(l.length-1)}catch(e){}};t();let a=setInterval(t,3e5);return()=>{e=!0,clearInterval(a)}},[R]),(0,n.useEffect)(()=>{if(!G||0===P.length)return;let e=!1,t=setInterval(()=>{e||W(e=>(e+1)%P.length)},700);return()=>{e=!0,clearInterval(t)}},[G,P.length]),(0,n.useEffect)(()=>{if(!P[B])return;V(0);let e=performance.now(),t=0,a=r=>{let n=Math.min(1,(r-e)/250);V(n),n<1?t=requestAnimationFrame(a):J(P[B])};return t=requestAnimationFrame(a),()=>cancelAnimationFrame(t)},[B]),(0,n.useEffect)(()=>{if(!$){et(null);return}let e=!1;return(async()=>{try{var t,a;let r=await fetch("/api/aircraft/photo?hex=".concat($.icao.toLowerCase()));if(!r.ok)return;let n=await r.json(),i=null===(t=n.photos)||void 0===t?void 0:t[0];if(e||!(null==i?void 0:null===(a=i.thumbnail_large)||void 0===a?void 0:a.src))return;et({url:i.thumbnail_large.src,photographer:i.photographer,link:i.link})}catch(e){}})(),()=>{e=!0}},[$]);let eG=(0,n.useMemo)(()=>{if(!eD||!eE)return null;let e=N(eD,eE),t=function(e,t){let a=e[0]*Math.PI/180,r=t[0]*Math.PI/180,n=(t[1]-e[1])*Math.PI/180;return(180*Math.atan2(Math.sin(n)*Math.cos(r),Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(n))/Math.PI+360)%360}(eD,eE);return{nm:e,brg:t}},[eD,eE]),eH=(e,t)=>!eI||e>=eI.minLat&&e<=eI.maxLat&&t>=eI.minLon&&t<=eI.maxLon,eK=null!==(m=null==eI?void 0:eI.zoom)&&void 0!==m?m:7,eJ=(0,n.useMemo)(()=>{if(0===ed.length||!z.airports)return[];let e=ed.filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon)&&eH(e.lat,e.lon));return eK<7?e.filter(e=>4===e.icao.length).slice(0,600):e.slice(0,600)},[ed,eI,z.airports]),eX=(0,n.useMemo)(()=>0===ep.length||!z.navaids||eK<6?[]:ep.filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon)&&eH(e.lat,e.lon)).slice(0,400),[ep,eI,z.navaids]),eV=(0,n.useMemo)(()=>0===ej.length||!z.fixes||eK<8?[]:ej.filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon)&&eH(e.lat,e.lon)).slice(0,500),[ej,eI,z.fixes]),eY=(0,n.useMemo)(()=>{let e=new Map;
1for(let t of ej)e.set(t.ident,t);for(let t of ep)e.has(t.ident)||e.set(t.ident,{ident:t.ident,lat:t.lat,lon:t.lon});return e},[ej,ep]),e$=(0,n.useMemo)(()=>{if(0===eN.length||!z.airways||eK<7)return[];let e=[];for(let t of eN){let a=[],r=!1;for(let e of t.fixes){let t=eY.get(e);t&&(a.push([t.lat,t.lon]),eH(t.lat,t.lon)&&(r=!0))}if(r&&a.length>=2&&e.push({id:t.id,coords:a}),e.length>=300)break}return e},[eN,eY,eI,z.airways]),eQ=(0,n.useMemo)(()=>{if(!eF||!z.procedures)return[];let e=new Map;for(let t of ed)e.set(t.icao,[t.lat,t.lon]);let t=[],a=(a,r)=>{if(r)for(let n of Object.keys(r)){let i=e.get(n);if(i&&eH(i[0],i[1]))for(let e of r[n]){let r=[i];for(let t of e.fixes)Number.isFinite(t.lat)&&Number.isFinite(t.lon)&&r.push([t.lat,t.lon]);r.length>=2&&t.push({id:"".concat(n,"-").concat(a,"-").concat(e.name),kind:a,coords:r})}}};return a("SID",eF.sid),a("STAR",eF.star),t},[eF,ed,eI,z.procedures]),e0=(0,n.useMemo)(()=>0!==em.length&&z.airspaces?em.filter(e=>Array.isArray(e.polygon)&&e.polygon.length>=3).filter(e=>e.polygon.some(e=>
1{let[t,a]=e;return eH(t,a)})).slice(0,400):[],[em,eI,z.airspaces]),e1=y[A];return(0,r.jsxs)("div",{className:"absolute inset-0",children:[(0,r.jsxs)(o.h,{center:[eB.lat,eB.lon],zoom:4,preferCanvas:!0,scrollWheelZoom:!0,zoomControl:!1,className:"w-full h-full",style:{background:"#0a0f1a"},children:[(0,r.jsx)(c.I,{attribution:e1.attr,url:e1.url,maxZoom:e1.maxZoom}),"nexrad"===R&&(0,r.jsx)(c.I,{url:"https://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{z}/{x}/{y}.png",attribution:"NOAA NEXRAD \xb7 Iowa State Mesonet",opacity:.55,maxNativeZoom:8,maxZoom:8,zIndex:400},"nexrad"),"rainviewer"===R&&P[B]&&(0,r.jsxs)(r.Fragment,{children:[K&&K.time!==P[B].time&&(0,r.jsx)(c.I,{url:"".concat(T).concat(K.path,"/256/{z}/{x}/{y}/2/1_1.png"),opacity:.6*(1-X),maxZoom:12,zIndex:399},"rv-prev-".concat(K.time)),(0,r.jsx)(c.I,{url:"".concat(T).concat(P[B].path,"/256/{z}/{x}/{y}/2/1_1.png"),attribution:"RainViewer \xb7 global radar + nowcast",opacity:.6*X,maxZoom:12,zIndex:400},"rv-cur-".concat(P[B].time))]}),z.terrain&&(0,r.jsx)(c.I,{url:"https://server.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}",attribution:"Esri \xb7 World Hillshade",opacity:.45,maxZoom:16,zIndex:350},"terrain"),(0,r.jsx)(k,{lat:eB.lat,lon:eB.lon,source:eB.source}),(0,r.jsx)(F,{onChange:eA}),e0.map((e,t)=>{let a=e.polygon,n=Math.max(1,Math.floor(a.length/16));for(let e=0;e<a.length;e+=n)a[e][0],a[e][1];let i=e.ceilingFt&&null!=e.floorFt?"".concat(Math.round(e.ceilingFt/100).toString().padStart(3,"0")," / ").concat(Math.round(e.floorFt/100).toString().padStart(3,"0")):"";return(0,r.jsx)(d.m,{positions:a.map(e=>{let[t,a]=e;return[t,a]}),pathOptions:{color:"#ffffff",weight:"B"===e.class?2:1.5,opacity:.55,fillColor:j(e.class),fillOpacity:"B"===e.class?.12:.08},children:(0,r.jsx)(u.u,{direction:"center",opacity:.85,permanent:!0,className:"airspace-label",children:(0,r.jsxs)("div",{className:"text-center leading-tight",children:[(0,r.jsxs)("div",{className:"text-[11px] font-bold tracking-wide",style:{color:j(e.class)},children:[e.icao," \xb7 Class ",e.class]}),i&&(0,r.jsx)("div",{className:"text-[9px] font-mono tabular-nums opacity-85",children:i})]})})},"".concat(e.icao,"-").concat(e.floorFt,"-").concat(t))}),e$.map(e=>(0,r.jsx)(l.a,{positions:e.coords,pathOptions:{color:"#22d3ee",weight:1,opacity:.45,dashArray:"4 4"},children:(0,r.jsx)(u.u,{direction:"center",permanent:!0,opacity:.55,className:"airway-label",children:e.id})},e.id)),eQ.map(e=>(0,r.jsx)(l.a,{positions:e.coords,pathOptions:{color:"SID"===e.kind?"#34d399":"#fb923c",weight:2.2,opacity:.85},children:(0,r.jsx)(u.u,{direction:"center",opacity:.9,children:(0,r.jsx)("span",{className:"text-xs font-medium",children:e.id})})},e.id)),eJ.map(e=>(0,r.jsx)(p.C,{center:[e.lat,e.lon],radius:150,pathOptions:{color:"#ffffff",weight:2,fillColor:"transparent",fillOpacity:0},eventHandlers:{click:()=>er(e)},children:(0,r.jsx)(u.u,{direction:"top",offset:[0,-4],children:(0,r.jsxs)("span",{className:"text-xs font-medium",children:[e.icao,e.name?" — ".concat(e.name):""]})})},e.icao)),en&&(0,r.jsx)(h.v,{url:en.png,bounds:en.bounds,opacity:.85,zIndex:380}),(0,r.jsx)(w.Z,{navaids:eX,fixes:eV,peaks:ef,showNavaids:z.navaids,showFixes:z.fixes}),!1,(0,r.jsx)(v.Z,{traffic:eg,trails:Y.current,selected:null!==(f=null==$?void 0:$.icao)&&void 0!==f?f:null,onSelect:e=>Q(e&&null!==(M=eg.find(t=>t.icao===e))&&void 0!==M?M:null)}),(0,r.jsx)(s.J,{position:[eB.lat,eB.lon],icon:function(e){let t='\n    <div style="transform: rotate('.concat(e,'deg); transform-origin: 50% 50%;">\n      <svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n        <path d="M14 2 L23 24 L14 18 L5 24 Z"\n              fill="#38bdf8" stroke="#fff" stroke-width="1.5" stroke-linejoin="round"/>\n      </svg>\n    </div>');return x().divIcon({html:t,iconSize:[28,28],iconAnchor:[14,14],className:""})}(eB.track),interactive:!1}),(0,r.jsx)(S,{enabled:eC,start:eD,end:eE,onClick:e=>{eD?eE?(eR([e.lat,e.lng]),eL(null)):eL([e.lat,e.lng]):(eR([e.lat,e.lng]),eL(null))}})]}),(0,r.jsx)("div",{className:"absolute top-3 right-3 z-[1000] flex gap-1 bg-[#10141de6] border border-white/10 rounded-lg p-1 backdrop-blur-sm",children:Object.entries(y).map(e=>
1{let[t,a]=e;return(0,r.jsx)("button",{onClick:()=>C(t),className:"px-3 py-1 rounded text-xs font-medium ".concat(A===t?"bg-sky-500/30 text-sky-200":"text-white/60 hover:text-white"),children:a.name},t)})}),(0,r.jsx)("div",{className:"absolute top-3 left-3 z-[1000] flex flex-wrap gap-1 bg-[#10141de6] border border-white/10 rounded-lg p-1 backdrop-blur-sm max-w-[460px]",children:[["airports","Airports",eJ.length],["navaids","Navaids",eX.length],["fixes","Fixes",eV.length],["airways","Airways",e$.length],["airspaces","Airspace",e0.length],["procedures","SID/STAR",eQ.length],["terrain","Terrain",0]].map(e=>{let[t,a,n]=e;return(0,r.jsxs)("button",{onClick:()=>D(e=>({...e,[t]:!e[t]})),className:"px-2 py-1 rounded text-[11px] font-medium tabular-nums ".concat(z[t]?"bg-emerald-500/20 text-emerald-200 border border-emerald-400/40":"text-white/45 border border-white/10 hover:text-white"),title:z[t]?"".concat(a," on — ").concat(n," in view"):"".concat(a," off"),children:[a,z[t]&&n>0?" \xb7 ".concat(n):""]},t)})}),(0,r.jsxs)("div",{className:"absolute top-14 left-3 z-[1000] flex flex-col gap-1 bg-[#10141de6] border border-white/10 rounded-lg p-1 backdrop-blur-sm",children:[(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("span",{className:"px-2 py-1 text-[10px] uppercase tracking-widest opacity-50 self-center font-semibold",children:"WX"}),[["off","Off",!0,"No weather overlay"],["nexrad","NEXRAD",!0,"NOAA Mesonet \xb7 CONUS/AK \xb7 static now-frame"],["rainviewer","Animated",!0,"RainViewer \xb7 global past 2 h + 30 min nowcast \xb7 play/scrub"],["fisb","FIS-B (UAT)",!1,"RTL-SDR 978 MHz FIS-B receiver — dump978-wasm port pending"]].map(e=>{let[t,a,n,i]=e;return(0,r.jsx)("button",{disabled:!n,onClick:()=>n&&E(t),title:i,className:"px-2 py-1 rounded text-[11px] font-medium ".concat(n?R===t?"bg-sky-500/25 text-sky-200 border border-sky-400/50":"text-white/55 border border-white/10 hover:text-white":"text-white/25 border border-white/5 cursor-not-allowed"),children:a},t)})]}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("span",{className:"px-2 py-1 text-[10px] uppercase tracking-widest opacity-50 self-center font-semibold",children:"TFC"}),[["off","Off",!0,"No traffic"],["internet","adsb.fi",!0,"Internet feed \xb7 ~10 s"],["dump1090","Local SDR",!0,"Point at your own dump1090 / dump978 /data/aircraft.json (CORS-enabled)"],["uat","1090ES (SDR)",!1,"RTL-SDR 1090 MHz Mode S receiver in-browser — dump1090-wasm port pending"]].map(e=>{let[t,a,n,i]=e;return(0,r.jsx)("button",{disabled:!n,onClick:()=>n&&O(t),title:i,className:"px-2 py-1 rounded text-[11px] font-medium ".concat(n?L===t?"bg-amber-500/25 text-amber-200 border border-amber-400/50":"text-white/55 border border-white/10 hover:text-white":"text-white/25 border border-white/5 cursor-not-allowed"),children:a},t)})]}),"dump1090"===L&&(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("span",{className:"px-2 py-1 text-[10px] uppercase tracking-widest opacity-50 self-center font-semibold",children:"URL"}),(0,r.jsx)("input",{value:Z,onChange:e=>q(e.target.value.trim()),placeholder:"http://192.168.1.100:8080/data/aircraft.json",className:"flex-1 bg-[#0a0f1a] border border-white/15 rounded px-2 py-0.5 text-[11px] font-mono",style:{minWidth:280},title:"Full URL to your dump1090 aircraft.json (must serve CORS — run dump1090 with --http-cors-origin '*' or behind a reverse proxy)"})]})]}),(0,r.jsx)("div",{className:"absolute top-14 right-3 z-[1000] bg-[#10141de6] border border-white/10 rounded-lg backdrop-blur-sm",children:(0,r.jsxs)("button",{onClick:()=>{eC?(ez(!1),eR(null),eL(null)):ez(!0)},className:"px-3 py-2 text-xs font-medium ".concat(eC?"bg-amber-500/30 text-amber-200":"text-white/65 hover:text-white"),children:["\uD83D\uDCCF ",eC?eG?"".concat(eG.nm.toFixed(1)," nm \xb7 ").concat(Math.round(eG.brg).toString().padStart(3,"0"),"\xb0"):eD?"Tap second point":"Tap start":"Ruler"]})}),"rainviewer"===R&&P.length>0&&(0,r.jsxs)("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-[1001] w-[min(640px,90vw)] bg-[#10141de8] border border-white/10 rounded-lg p-2 backdrop-blur-sm flex items-center gap-3",children:[(0,r.jsx)("button",{onClick:()=>H(e=>!e),className:"px-2 py-1 rounded bg-sky-500/25 border border-sky-400/60 text-sky-100 text-xs font-medium",children:G?"⏸":"▶"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("input",{type:"range",min:0,max:Math.max(0,P.length-1),value:B,onChange:e=>{H(!1),W(parseInt(e.target.value,10))},className:"w-full",style:{background:(()=>{let e=P.filter(e=>"past"===e.kind).length,t=e/P.length*100;return"linear-gradient(to right, #1e40af 0%, #1e40af ".concat(t,"%, #b45309 ").concat(t,"%, #b45309 100%)")})(),borderRadius:999,height:6,appearance:"none"}}),(0,r.jsxs)("div",{className:"flex justify-between text-[10px] opacity-65 mt-1 font-mono tabular-nums",children:[(0,r.jsx)("span",{children:"−2 h"}),(0,r.jsxs)("span",{className:(null===(e=P[B])||void 0===e?void 0:e.kind)==="nowcast"?"text-amber-300":"text-sky-300",children:[P[B]?new Date(1e3*P[B].time).toUTCString().slice(17,22)+"Z":"—",(null===(t=P[B])||void 0===t?void 0:t.kind)==="nowcast"?" (forecast)":""]}),(0,r.jsx)("span",{children:"+30 min"})]})]})]}),ew&&(0,r.jsxs)("div",{className:"absolute bottom-12 right-3 z-[1000] bg-[#10141de6] border border-white/10 rounded-lg px-3 py-2 backdrop-blur-sm text-xs",children:[(0,r.jsxs)("span",{className:"opacity-60 mr-1",children:["Winds @ ",ew.altFt," ft"]}),(0,r.jsxs)("span",{className:"font-medium tabular-nums",children:[Math.round(ew.dirDeg).toString().padStart(3,"0"),"\xb0 / ",ew.speedKt," kt"]})]}),"nexrad"===R&&(0,r.jsxs)("div",{className:"absolute bottom-10 left-3 z-[1000] bg-[#10141de6] border border-white/10 rounded-lg px-2 py-1.5 backdrop-blur-sm",children:[(0,r.jsx)("div",{className:"text-[9px] uppercase tracking-widest opacity-55 mb-1 font-semibold",children:"Radar \xb7 dBZ"}),(0,r.jsx)("div",{className:"flex items-end gap-0.5",children:[["#04e9e7","5"],["#019ff4","15"],["#0300f4","25"],["#02fd02","35"],["#01c501","40"],["#008e00","45"],["#fdf802","50"],["#e5bc00","55"],["#fd9500","60"],["#fd0000","65"],["#bc0000","70"],["#fd00fd","75"]].map(e=>
1{let[t,a]=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("div",{style:{background:t,width:12,height:8}}),(0,r.jsx)("div",{className:"text-[8px] opacity-50 mt-0.5 tabular-nums",children:a})]},a)})})]}),(0,r.jsxs)("div",{className:"absolute bottom-3 left-3 z-[1000] flex items-center gap-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest opacity-60 text-white",children:"serial"===eB.source?"USB GPS \xb7 ".concat(null!==(I=null==eO?void 0:eO.fix)&&void 0!==I?I:"no-fix"):"gps"===eB.source?"GPS lock":"ip"===eB.source?"IP approximation":"default Montreal"}),b.available()&&(null===eO&&null===e_.current?(0,r.jsx)("button",{onClick:async()=>{eP(null);try{let e=new b;e.onUpdate(eZ),await e.connect(9600),e_.current=e}catch(e){eP(e instanceof Error?e.message:String(e))}},className:"px-2 py-0.5 rounded border border-white/15 text-[10px] uppercase tracking-widest text-white/70 hover:text-white hover:border-sky-400/60",title:"Connect a USB GPS dongle (Amazon / GlobalSat / u-blox / Garmin GLO). Web Serial API — desktop Chrome only.",children:"Connect USB GPS"}):(0,r.jsx)("button",{onClick:async()=>{try{var e;await (null===(e=e_.current)||void 0===e?void 0:e.disconnect())}catch(e){}e_.current=null,eZ(null)},className:"px-2 py-0.5 rounded border border-red-400/60 text-[10px] uppercase tracking-widest text-red-200 hover:bg-red-500/15",children:"Disconnect GPS"})),eq&&(0,r.jsx)("span",{className:"text-[10px] text-red-300 max-w-xs truncate",title:eq,children:eq})]}),ea&&(0,r.jsxs)("div",{className:"absolute top-[88px] right-3 z-[1001] w-72 bg-[#10141df2] border border-white/10 rounded-lg p-3 backdrop-blur-sm",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-bold tracking-wide",children:ea.icao}),(0,r.jsx)("div",{className:"text-[11px] opacity-70 truncate",children:ea.name||"—"}),(0,r.jsxs)("div",{className:"text-[10px] opacity-50 font-mono mt-0.5",children:[ea.lat.toFixed(3),", ",ea.lon.toFixed(3),null!=ea.elevation_ft?" \xb7 ".concat(ea.elevation_ft," ft elev"):""]})]}),(0,r.jsx)("button",{onClick:()=>er(null),className:"opacity-50 hover:opacity-100 px-1",children:"✕"})]}),en&&en.icao===ea.icao?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"text-[10px] opacity-65",children:["Overlay: ",(0,r.jsx)("span",{className:"text-sky-300",children:en.name})]}),(0,r.jsx)("button",{onClick:()=>ei(null),className:"w-full px-3 py-1.5 rounded bg-red-500/20 border border-red-400/60 text-red-200 text-xs font-medium",children:"Clear plate overlay"})]}):(0,r.jsx)("button",{onClick:()=>eW(ea),disabled:es,className:"w-full px-3 py-1.5 rounded bg-sky-500/20 border border-sky-400/60 text-sky-100 text-xs font-medium disabled:opacity-50",children:es?"Loading plate…":"Overlay approach plate"}),eo&&(0,r.jsx)("p",{className:"text-[10px] text-red-300 mt-2",children:eo}),(0,r.jsx)("button",{onClick:()=>eU(ea.icao),className:"w-full mt-2 px-3 py-1.5 rounded bg-emerald-500/15 border border-emerald-400/50 text-emerald-100 text-xs font-medium",children:"+ Add to flight plan"}),(0,r.jsx)("p",{className:"text-[10px] opacity-45 mt-2 leading-relaxed",children:"Plate overlay: US airports only \xb7 FAA georeferences IAPs + most airport diagrams."})]}),$&&(0,r.jsxs)("div",{className:"absolute top-[88px] right-3 z-[1001] w-72 bg-[#10141df2] border border-white/10 rounded-lg p-3 backdrop-blur-sm",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-bold tracking-wide",children:($.flight||$.icao).trim()}),(0,r.jsxs)("div",{className:"text-[10px] opacity-60 font-mono uppercase tracking-widest",children:[$.aircraftType||"—",$.registration?" \xb7 ".concat($.registration):""," \xb7 ",$.icao]})]}),(0,r.jsx)("button",{onClick:()=>Q(null),className:"opacity-50 hover:opacity-100 px-1",children:"✕"})]}),ee&&(0,r.jsxs)("a",{href:ee.link,target:"_blank",rel:"noopener noreferrer",className:"block mb-2 rounded overflow-hidden border border-white/10",children:[(0,r.jsx)("img",{src:ee.url,alt:"aircraft photo",className:"w-full h-32 object-cover"}),ee.photographer&&(0,r.jsxs)("div",{className:"text-[9px] opacity-50 px-1 py-0.5 bg-black/40",children:["\xa9 ",ee.photographer," \xb7 planespotters.net"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"Alt"}),(0,r.jsxs)("div",{className:"font-mono tabular-nums",children:[Math.round($.altFt).toLocaleStr
1ing()," ft"]})]}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"GS"}),(0,r.jsxs)("div",{className:"font-mono tabular-nums",children:[Math.round($.gsKt)," kt"]})]}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"Trk"}),(0,r.jsxs)("div",{className:"font-mono tabular-nums",children:[Math.round($.trackDeg).toString().padStart(3,"0"),"\xb0"]})]}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"VSI"}),(0,r.jsx)("div",{className:"font-mono tabular-nums ".concat(void 0===$.vsiFpm?"opacity-40":$.vsiFpm>200?"text-emerald-300":$.vsiFpm<-200?"text-amber-300":""),children:void 0===$.vsiFpm?"—":"".concat($.vsiFpm>0?"+":"").concat(Math.round($.vsiFpm).toLocaleString())})]}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"Sqk"}),(0,r.jsx)("div",{className:"font-mono tabular-nums ".concat("7500"===$.squawk||"7600"===$.squawk||"7700"===$.squawk?"text-red-300 font-bold":"1200"===$.squawk?"text-emerald-300":""),children:$.squawk||"—"})]}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded px-2 py-1",children:[(0,r.jsx)("div",{className:"text-[9px] opacity-50 uppercase tracking-widest",children:"Dist"}),(0,r.jsx)("div",{className:"font-mono tabular-nums",children:"default"!==eB.source?"".concat(N([eB.lat,eB.lon],[$.lat,$.lon]).toFixed(1)," nm"):"—"})]})]}),("7500"===$.squawk||"7600"===$.squawk||"7700"===$.squawk)&&(0,r.jsxs)("div",{className:"mt-2 px-2 py-1.5 rounded bg-red-500/20 border border-red-400/60 text-red-100 text-xs font-medium",children:["⚠ Emergency squawk: ","7500"===$.squawk?"Hijack (7500)":"7600"===$.squawk?"Lost comms (7600)":"General emergency (7700)"]}),(0,r.jsx)("div",{className:"text-[10px] opacity-50 mt-2",children:"Yellow dashed line = position history since this session started."})]}),eg.length>0&&(0,r.jsxs)("div",{className:"absolute bottom-3 right-3 z-[1000] text-[10px] uppercase tracking-widest opacity-60 text-amber-300",children:[eg.length," traffic"]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.