1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7707],{10714:(t,e,o)=>{o.d(e,{A:()=>r});var i=o(28168),n=o(74880),a=o(91024);let r=(t,e)=>{var o;let r,l=(0,a.l)(),s=e.features[0].geometry.coordinates.slice(),{vid:d,name:c,train_number:p,agency:g,spd:u,org:h,dst:m,updated_ago:y,vehicleClassificationText:b,isGhost:_}=e.features[0].properties,f=n.Y.getNetwork(g),v=f?f.color:"#000000",w=f?f.darkerColor:"#000000",x=null==p?"":String(p).trim(),C=String(`${c||"Unknown"}${x?` \xb7 ${l("popupTrain")} ${x}`:""}`).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]),k="",$=C;return d&&(k=` 2 <div class="mt-4"> 3 <a href="/networks/${g}/trains/${d}/" 4 class="inline-block px-4 py-2 bg-white text-black border border-black rounded hover:bg-gray-100 transition-colors no-underline"> 5 <span class="text-black hover:text-black">${l("popupViewTrainDetails")}</span> 6 </a> 7 </div> 8 `,$=`<a href="/networks/${g}/trains/${d}/" style="cursor: pointer;" class="text-gray-800 hover:text-gray-800">${C}</a>`),new i.A.Popup({closeButton:!1,closeOnClick:!0,className:"train-popup"}).setLngLat(s).setHTML(` 9 <div class="p-4 max-w-md bg-white rounded-lg" style="padding: 16px;"> 10 <a href="/networks/${g}/" class="text-sm font-medium text-gray-500 mb-0 p-0 m-0 hover:text-gray-700">${f?f.name:g}</a> 11 <div class="flex items-center mb-2 mt-1"> 12 <div class="w-6 h-6 mr-2">${(o=e.features[0].properties.direction,r="",void 0!==o&&""!==o&&(r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" style="transform: rotate(${o}deg);"><path fill-rule="evenodd" d="M10 17a.75.75 0 01-.75-.75V5.612L5.29 9.77a.75.75 0 01-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 11-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0110 17z" clip-rule="evenodd" /></svg>`),` 13 <div style="background-color: ${v}; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; border: 2px solid ${w};"> 14 ${r} 15 </div> 16 `)}</div> 17 <h6 class="text-xl font-bold text-gray-900">${$}</h6> 18 </div> 19 ${_?` 20 <div class="mb-3 p-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-800"> 21 <strong>${l("popupScheduledPosition")}:</strong> ${l("popupNoGps")} 22 </div> 23 `:""} 24 <table class="w-full text-sm"> 25 <tbody> 26 <tr> 27 <td class="font-medium text-gray-600 pr-4">${l("popupFrom")}</td> 28 <td class="text-gray-600">${h||"-"}</td> 29 </tr> 30 <tr> 31 <td class="font-medium text-gray-600 pr-4">${l("popupTo")}</td> 32 <td class="text-gray-600">${m||"-"}</td> 33 </tr> 34 <tr> 35 <td class="font-medium text-gray-600 pr-4">${l("popupSpeed")}</td> 36 <td class="text-gray-600">${u}</td> 37 </tr> 38 <tr> 39 <td class="font-medium text-gray-600 pr-4">${l("popupUpdated")}</td> 40 <td class="text-gray-600">${y}</td> 41 </tr> 42 <tr> 43 <td class="font-medium text-gray-600 pr-4">${l("popupType")}</td> 44 <td class="text-gray-600">${b||"-"}</td> 45 </tr> 46 </tbody> 47 </table> 48 ${k} 49 </div> 50 `).addTo(t)}},21691:(t,e,o)=>{o.d(e,{MB:()=>n,pt:()=>a});let i="true"===o(65364).env.NEXT_PUBLIC_E2E_TEST,n=t=>{i&&(window.__tfyiMap=t)},a=t=>{i&&(window.__tfyiLastTrainFeatures=t,window.dispatchEvent(new CustomEvent("tfyi:trains-updated")))}},28168:(t,e,o)=>{o.d(e,{A:()=>a});var i=o(31198),n=o.n(i);"unavailable"===n().getRTLTextPluginStatus()&&n().setRTLTextPlugin("/vendor/mapbox-gl-rtl-text/0.2.3.min.js",!0).catch(t=>console.error("Unable to initialize right-to-left map labels",t));let a=n()},59025:(t,e,o)=>{o.d(e,{E:()=>r,b:()=>a});var i=o(28168);let n=(t,e)=>{if(e){t.boxZoom.enable(),t.scrollZoom.enable(),t.dragPan.enable(),t.dragRotate.enable(),t.doubleClickZoom.enable(),t.keyboard.enable(),t.touchZoomRotate.enable();return}t.boxZoom.disable(),t.scrollZoom.disable(),t.dragPan.disable(),t.dragRotate.disable(),t.doubleClickZoom.disable(),t.keyboard.disable(),t.touchZoomRotate.disable()},a=(t,e={})=>{let{buttonLabel:o="Enable Map Controls",buttonPosition:i="bottom-left",enableO
50nMapClick:a=!0}=e,r=!1,l=()=>{!r&&(r=!0,n(t,!0),d?._button&&(d._button.style.display="none"))};class s{onAdd(){return this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._button=document.createElement("button"),this._button.className="maplibregl-ctrl-icon",this._button.type="button",this._button.title=o,this._button.textContent=o,this._button.style.width="auto",this._button.style.padding="5px 10px",this._button.style.minWidth="120px",this._button.style.whiteSpace="nowrap",this._button.className+=" text-gray-900",this._button.onclick=l,this._container.appendChild(this._button),this._container}onRemove(){this._container.parentNode.removeChild(this._container)}}let d=new s;n(t,!1),t.addControl(d,i),a&&t.on("click",l)},r=(t,e,o={})=>{let{enablePanning:n=!1,setIsUserPanning:r=null,train:l=null,initialMode:s="2d",interactiveOnDemand:d=!1}=o;t.addControl(new i.A.NavigationControl),t.addControl(new i.A.FullscreenControl),t.addControl(new i.A.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}));class c{constructor(){this._mode="3d"===s?"3d":"2d"}onAdd(t){return this._map=t,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._button=document.createElement("button"),this._button.className="maplibregl-ctrl-icon",this._button.type="button",this._button.title="Toggle 3D/2D",this._button.textContent=this._mode.toUpperCase(),this._button.onclick=()=>this.toggle(),this._container.appendChild(this._button),setTimeout(()=>this.applyMode(),0),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}toggle(){this._mode="3d"===this._mode?"2d":"3d",this._button.textContent=this._mode.toUpperCase(),this._button.title=`Switch to ${"3d"===this._mode?"2D":"3D"}`,this.applyMode()}applyMode(){if(this._map)if("3d"===this._mode){let t=l?[l.lng,l.lat]:this._map.getCenter();this._map.easeTo({center:t,pitch:60,bearing:20,zoom:Math.max(this._map.getZoom(),15),duration:800})}else(0!==this._map.getPitch()||0!==this._map.getBearing())&&this._map.easeTo({pitch:0,bearing:0,duration:800})}}t.addControl(new c);class p{onAdd(t){return this._map=t,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._container.innerHTML='<button class="maplibregl-ctrl-icon" type="button" title="Toggle Railway Layer">\uD83D\uDEE4ï¸</button>',this._container.onclick=()=>{e(e=>{let o=!e;return o?(t.addSource("railway",{type:"raster",tiles:["https://a.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png"],tileSize:256}),t.addLayer({id:"railway-layer",type:"raster",source:"railway",paint:{"raster-opacity":.5}},"train-points")):(t.getLayer("railway-layer")&&t.removeLayer("railway-layer"),t.getSource("railway")&&t.removeSource("railway")),o})},this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}t.addControl(new p);let g=null;if(n&&r&&l){class e{onAdd(t){return this._map=t,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._btn=document.createElement("button"),this._btn.className="maplibregl-ctrl-icon",this._btn.style.padding="5px 10px",this._btn.style.minWidth="120px",this._btn.style.whiteSpace="nowrap",this._btn.innerHTML="Re-Center Map",this._btn.className+=" text-gray-900",this._btn.style.display="none",this._btn.onclick=()=>{r(!1),t.easeTo({center:[l.lng,l.lat],duration:1e3}),this._btn.style.display="none"},this._container.appendChild(this._btn),this._container}show(){this._btn.style.display="block"}hide(){this._btn.style.display="none"}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}g=new e,t.addControl(g,"bottom-left"),t.on("dragstart",()=>{r(!0),g.show()})}return d&&a(t),g}},59531:(t,e,o)=>{o.d(e,{Ec:()=>n,pI:()=>i,z7:()=>a});let i=(t="light")=>`https://tiles.openfreemap.org/styles/${"dark"===t?"dark":"positron"}`,n=()=>({version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},layers:[{id:"background",type:"background",paint:{"background-color":"#f2f3f0"}}
50,{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",paint:{"fill-color":"#a8d5e3"}}]}),a=t=>{try{let e=t.getStyle();if(!e)return;let o=e.layers?.find(t=>"symbol"===t.type&&t.layout&&t.layout["text-field"])?.id,i=Object.keys(e.sources||{}).find(t=>e.sources[t]?.type==="vector");if(!i)return;t.getLayer("3d-buildings")||t.addLayer({id:"3d-buildings",type:"fill-extrusion",source:i,"source-layer":"building",minzoom:15,paint:{"fill-extrusion-color":"#d1d5db","fill-extrusion-height":["coalesce",["get","render_height"],["get","height"],0],"fill-extrusion-base":["coalesce",["get","render_min_height"],["get","min_height"],0],"fill-extrusion-opacity":.6}},o)}catch(t){}}},91024:(t,e,o)=>{o.d(e,{l:()=>n});var i=o(35634);function n(){let t="en";try{let e=localStorage.getItem("trains_fyi_settings");if(e){let o=JSON.parse(e);o.language&&i.P[o.language]&&(t=o.language)}}catch(t){}return e=>i.P[t][e]??e}},91482:(t,e,o)=>{o.d(e,{TL:()=>n,X4:()=>i,hB:()=>a});let i=(t,e,o,i,n)=>{if(!t||!e)return;let a=t?(t.__tfyiAddedImages||Object.defineProperty(t,"__tfyiAddedImages",{value:new Set,enumerable:!1,writable:!1,configurable:!1}),t.__tfyiAddedImages):null;if(a&&a.has(e))return;if("function"==typeof t.hasImage&&t.hasImage(e)){a&&a.add(e);return}let r=((t,e,o)=>{if("u"<typeof document)return null;let i=document.createElement("canvas");i.width=24,i.height=24;let n=i.getContext("2d");if(!n)return null;n.beginPath(),n.arc(12,12,10,0,2*Math.PI),n.fillStyle=t,n.fill(),n.lineWidth=2,n.strokeStyle=e,n.stroke(),o&&(n.strokeStyle="#ffffff",n.lineWidth=1.5,n.lineCap="round",n.lineJoin="round",n.beginPath(),n.moveTo(8.25,11.25),n.lineTo(12,7.5),n.lineTo(15.75,11.25),n.moveTo(12,7.5),n.lineTo(12,16.5),n.stroke());let{data:a}=n.getImageData(0,0,24,24);return{width:24,height:24,data:a}})(o,i,n);r&&"function"==typeof t.addImage&&(t.addImage(e,r),a&&a.add(e))},n=(t,e,o)=>{t.getSource("trains")||t.addSource("trains",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.getLayer("train-points")||t.addLayer({id:"train-points",type:"symbol",source:"trains",layout:{"icon-image":["case",["has","icon"],["get","icon"],["case",["==",["get","isGhost"],!0],["case",["any",["==",["get","direction"],""],["==",["get","direction"],null],["==",["typeof",["get","direction"]],"undefined"]],["concat","train-icon-ghost-stopped-",["downcase",["get","agency"]]],["concat","train-icon-ghost-moving-",["downcase",["get","agency"]]]],["case",["any",["==",["get","direction"],""],["==",["get","direction"],null],["==",["typeof",["get","direction"]],"undefined"]],["concat","train-icon-stopped-",["downcase",["get","agency"]]],["concat","train-icon-moving-",["downcase",["get","agency"]]]]]],"icon-rotate":["case",["all",["has","direction"],["==",["typeof",["get","direction"]],"number"]],["get","direction"],0],"icon-rotation-alignment":"map","icon-pitch-alignment":"viewport","icon-size":1,"icon-allow-overlap":!0}}),((t,e=[])=>{if(!t||t.__tfyiStyleImageMissingHandlerRegistered)return;let o=new Map((e||[]).map(t=>[String(t.slug||"").toLowerCase(),{color:t.color,darkerColor:t.darkerColor}]));t.on("styleimagemissing",e=>{let n=e&&e.id;if(n&&"string"==typeof n){if(n.startsWith("train-icon-moving-")||n.startsWith("train-icon-stopped-")){let e=n.startsWith("train-icon-moving-"),a=n.replace("train-icon-moving-","").replace("train-icon-stopped-",""),r=o.get(a)||{color:"#000000",darkerColor:"#000000"};i(t,n,r.color,r.darkerColor,e);return}if(n.startsWith("train-icon-ghost-moving-")||n.startsWith("train-icon-ghost-stopped-")){let e=n.startsWith("train-icon-ghost-moving-"),a=n.replace("train-icon-ghost-moving-","").replace("train-icon-ghost-stopped-",""),r=o.get(a)||{color:"#000000",darkerColor:"#000000"};i(t,n,r.color,r.darkerColor,e);return}if(n.startsWith("train-icon-")){let e=n.endsWith("-moving");i(t,n,"#4b5563","#111827",e)}}}),Object.defineProperty(t,"__tfyiStyleImageMissingHandlerRegistered",{value:!0,enumerable:!1,writable:!1,configurable:!1})})(t,e),o&&t.on("click","train-points",e=>{o(t,e)}),t.on("mouseenter","train-points",()=>{t.getCanvas().style.cursor="pointer"}),t.on("mouseleave","train-points",()=>{t.getCanvas().style.cursor=""})},a=(t,e)=>{t.getSource("trains")||t.addSource("trains",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.getLayer("train-points")||t.addLayer({id:"train-points",type:"circle",s
50ource:"trains",paint:{"circle-radius":["interpolate",["linear"],["zoom"],2,2.5,6,4,10,6,16,9],"circle-color":["get","color"],"circle-stroke-color":["get","borderColor"],"circle-stroke-width":1.5}}),e&&t.on("click","train-points",o=>{e(t,o)}),t.on("mouseenter","train-points",()=>{t.getCanvas().style.cursor="pointer"}),t.on("mouseleave","train-points",()=>{t.getCanvas().style.cursor=""})}}}]);
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.