diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f77a32..eeb7df9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
+- A new Road to Tier 1 card in Goals shows what still stands between you and Tier 1 (#111, #121, #12). It counts the transit ports left to cancel, names the Tier 1s you still need a PNI with and what they want from you first, and shows how much of the internet you would still reach without transit. The Networks tab can list just the networks you reach only through transit, biggest first, each with why it is not peering with you yet and where to meet it: the cities for a PNI and the exchanges it sits on, your POPs first, then the nearest. Who your transit carries, in the NOC, names the nearest city when a network is not in yours and takes you straight to it.
- Your own subsea cables now come in three designs, from the budget route to one as fast as the fastest cable on the map, and two upgrades carry faster channels further (#65). Each design shows its latency, price and build time before you order: optimized costs three times as much and low latency seven times, and both take months longer. Premium terminals and optical engineering light longer routes at higher speeds, so a cable as long as New York to Sydney can now carry traffic, and the order screen tells you which upgrade a route needs. Calling off a cable while it is being laid refunds what you actually paid for it.
- Only Spätzle-IX can now be won with peering alone (#114). The goal is now 45% reach and 300 Gbps served, and the scenario card shows your reach as well as your traffic.
- Series of Tubes now speaks French. The game follows your browser's language the first time, and you can switch to Français under Settings or on the title screen.
diff --git a/site/i18n/fr.js b/site/i18n/fr.js
index 0f0da55..765ebdc 100644
--- a/site/i18n/fr.js
+++ b/site/i18n/fr.js
@@ -2600,4 +2600,17 @@
"This design’s route is {km} km: too long for any optics, even with both upgrades. A shorter design can make it.":"Le tracé de cette conception fait {km} km : trop long pour toute optique, même avec les deux améliorations. Une conception plus courte peut y arriver.",
"{km} km is too far for your optics on their own. Add {what} to light this cable.":"{km} km, c’est trop loin pour tes optiques seules. Ajoute {what} pour allumer ce câble.",
"Estimated latency":"Latence estimée",
+"Out of reach without transit {n}":"Hors couverture sans transit {n}",
+"Nothing: every network is reachable without transit.":"Aucun : chaque réseau est joignable sans transit.",
+"Open peer, but not on any IX where you have a POP. Nearest: {city}":"Peer ouvert, mais sur aucun IX où tu as un POP. Le plus proche : {city}",
+"Not in your cities yet. Nearest: {city}":"Pas encore dans tes villes. La plus proche : {city}",
+"Where to meet them":"Où les trouver",
+"Goal":"Objectif",
+"Road to Tier 1":"En route vers le Tier 1",
+"Transit ports to cancel":"Ports de transit à résilier",
+"PNIs with every Tier 1":"PNI avec chaque Tier 1",
+"Tier 1s only take a PNI from a network with {list}.":"Les Tier 1 n’acceptent un PNI que d’un réseau avec {list}.",
+"Reach without transit":"Couverture sans transit",
+"All {n} out of reach":"Les {n} hors couverture",
+"Where?":"Où ?",
};
diff --git a/site/i18n/it.js b/site/i18n/it.js
index 59126d4..5b2d060 100644
--- a/site/i18n/it.js
+++ b/site/i18n/it.js
@@ -2600,4 +2600,17 @@
"This design’s route is {km} km: too long for any optics, even with both upgrades. A shorter design can make it.":"Il percorso di questo progetto è di {km} km: troppo lungo per qualsiasi ottica, anche con entrambi i miglioramenti. Un progetto più corto ce la fa.",
"{km} km is too far for your optics on their own. Add {what} to light this cable.":"{km} km sono troppi per le tue ottiche da sole. Aggiungi {what} per accendere questo cavo.",
"Reach 45% of the internet and serve 300 Gbps":"Raggiungi il 45% di internet e servi 300 Gbps",
+"Out of reach without transit {n}":"Fuori copertura senza transit {n}",
+"Nothing: every network is reachable without transit.":"Nessuna: ogni rete è raggiungibile senza transit.",
+"Open peer, but not on any IX where you have a POP. Nearest: {city}":"Peer aperto, ma non su nessun IX dove hai un POP. Il più vicino: {city}",
+"Not in your cities yet. Nearest: {city}":"Non ancora nelle tue città. La più vicina: {city}",
+"Where to meet them":"Dove trovarli",
+"Goal":"Obiettivo",
+"Road to Tier 1":"Verso il Tier 1",
+"Transit ports to cancel":"Porte transit da disdire",
+"PNIs with every Tier 1":"PNI con ogni Tier 1",
+"Tier 1s only take a PNI from a network with {list}.":"I Tier 1 accettano un PNI solo da una rete con {list}.",
+"Reach without transit":"Copertura senza transit",
+"All {n} out of reach":"Tutte le {n} fuori copertura",
+"Where?":"Dove?",
};
diff --git a/site/i18n/pt.js b/site/i18n/pt.js
index 3a80dd6..69b4cd0 100644
--- a/site/i18n/pt.js
+++ b/site/i18n/pt.js
@@ -2600,4 +2600,17 @@
"{km} km is too far for your optics on their own. Add {what} to light this cable.":"{km} km é longe demais para as suas ópticas sozinhas. Adicione {what} para acender este cabo.",
"Estimated latency":"Latência estimada",
"Reach 45% of the internet and serve 300 Gbps":"Alcance 45% da internet e atenda 300 Gbps",
+"Out of reach without transit {n}":"Fora de alcance sem transit {n}",
+"Nothing: every network is reachable without transit.":"Nenhuma: toda rede é alcançável sem transit.",
+"Open peer, but not on any IX where you have a POP. Nearest: {city}":"Peer aberto, mas em nenhum IX onde você tem POP. O mais próximo: {city}",
+"Not in your cities yet. Nearest: {city}":"Ainda não está nas suas cidades. A mais próxima: {city}",
+"Where to meet them":"Onde encontrá-los",
+"Goal":"Meta",
+"Road to Tier 1":"Rumo ao Tier 1",
+"Transit ports to cancel":"Portas de transit a cancelar",
+"PNIs with every Tier 1":"PNIs com cada Tier 1",
+"Tier 1s only take a PNI from a network with {list}.":"Os Tier 1 só aceitam PNI de uma rede com {list}.",
+"Reach without transit":"Alcance sem transit",
+"All {n} out of reach":"Todas as {n} fora de alcance",
+"Where?":"Onde?",
};
diff --git a/site/index.html b/site/index.html
index 347c581..90803aa 100644
--- a/site/index.html
+++ b/site/index.html
@@ -1423,7 +1423,7 @@ const GOALS=[
let S=null, R=emptyR();
const UI={sel:null,tab:'cust',left:'goals',speed:1,hover:null,drag:null,snap:null,pending:null,confirm:null,leftOpen:false,muted:false,startCity:'fra',hintOff:false};
let uidN=1; const uid=()=>'i'+(Date.now()%1e7).toString(36)+(uidN++);
-function emptyR(){return {teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{}};}
+function emptyR(){return {nt:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{}};}
/* ================= BANKS & LOANS =================
Lenders make offers now and then (more often when you are broke). Each loan
is a fixed monthly payment that shows up in your costs; conditions are checked
@@ -1950,7 +1950,7 @@ function compute(){
const ekN={};for(const e of E){e.ek=e.k+':'+e.id;ekN[e.ek]=(ekN[e.ek]||0)+1;}
// dup: shares its key with another exit (a hand-edited save), so R.egDesc shows whichever pushed last.
for(const e of E){e.desc={lab:e.lab,city:e.city,k:e.k};e.dup=ekN[e.ek]>1;e.told=false;e.hp=e.pref==='high'?0:1;e.ci=CIDX[e.city];e.cn=cnCity(e.city);e.vis=0;for(const n of e.nets||NET_IDS){const L=okBy[n];if(L&&L[L.length-1]!==e&&e.ok(n))L.push(e);}}
- for(const n of NETS){R2.reachable[n.id]=okBy[n.id].some(e=>e.rank>0);if(R2.reachable[n.id])R2.reach+=NSH[n.id];}
+ for(const n of NETS){R2.reachable[n.id]=okBy[n.id].some(e=>e.rank>0);if(R2.reachable[n.id])R2.reach+=NSH[n.id];if(okBy[n.id].some(e=>e.rank>0&&e.k!=='t')){R2.nt[n.id]=1;R2.reachNT+=NSH[n.id];}}
const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net));
const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1);
// Every flow has the same shape and carries what routing asks about it again and again (nj: its network's index).
@@ -2893,6 +2893,9 @@ const ACT={
closeModal:()=>closeModal(),
tab:({t})=>{UI.tab=t;UI.confirm=null;renderPanel();},
leftTab:({t})=>{UI.left=t;UI.leftOpen=true;renderLeft();},
+ netFocus:({id})=>{if(!NET[id])return;$('dash').hidden=true;UI.netFocus=id;UI.nf='all';UI.left='nets';UI.leftOpen=true;UI.sel=null;renderPanel();renderLeft();const b=$('leftBody');if(b)b.scrollTop=0;},
+ netFilter:({f})=>{UI.nf=f==='out'?'out':'all';UI.netFocus=null;$('dash').hidden=true;UI.left='nets';UI.leftOpen=true;UI.sel=null;renderPanel();renderLeft();const b=$('leftBody');if(b)b.scrollTop=0;},
+ meetGo:({city})=>{if(!isCity(city))return;$('dash').hidden=true;ACT.focusCity({city});if(S.pops[city]){UI.tab='peer';renderPanel();}},
toggleLeft:()=>{UI.leftOpen=!UI.leftOpen;renderLeft();},
phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();},
phonePlay:()=>{haptic(10);if(UI.speed){UI.lastSpeed=UI.speed;UI.speed=0;}else UI.speed=UI.lastSpeed||1;renderHUD();},
@@ -3286,7 +3289,7 @@ function renderLeft(){checkLayer();
$('leftTabs').innerHTML=tabs.map(([k,l])=>``).join('')+(innerWidth<760?``:'');
let h='';
if(UI.left==='goals'){
- h+=scnCard()+lvlCard();
+ h+=scnCard()+lvlCard()+t1Card();
const cur=GOALS.find(g=>S.done[g.id]===undefined);
h+=GOALS.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `
${d?'✓':''}
${esc(g.t)}
${c||!d?`
${esc(g.d)}
`:''}${!d&&g.r?`
${tr('Reward {cash}',{cash:fmt$(g.r)})}
`:''}
`;}).join('');
h+=badgeGrid();
@@ -3322,9 +3325,12 @@ function renderLeft(){checkLayer();
h+=`
${tr("Every network on the map. Traffic share is how much of your users' traffic goes to them. Tap a connection to jump to its POP.")}
`;}
const where=netWhereIdx(),tl=NETS.filter(n=>n.tail),tlOn=tl.filter(n=>where(n.id).some(x=>x[2]==='ix')).length;
- for(const n of NETS){if(n.tail&&!UI.tailOpen)continue;
- h+=`
${logo(n)}
${esc(n.name)} AS${n.asn}
${TYPE_L[n.type]}${n.pol} · ${tr('{p}% of traffic',{p:(NSH[n.id]*100).toFixed(1)})}${n.price?` · ${tr('transit ${price}/Gbps',{price:(n.price*S.priceMul).toFixed(2)})}`:''}
${esc(n.blurb)}
${netWhere(n,where)}
`;}
- h+=`
${tr('The long tail')} ${tr('{n} small networks',{n:tl.length})}
${tr('{p}% of traffic between them, scattered across exchanges. You peer with {n}.',{p:(tl.reduce((a,n)=>a+NSH[n.id],0)*100).toFixed(1),n:tlOn})}
${btn(tr('All networks'),'netFilter',{f:'all'},!foc&&!out?'sm':'ghost sm')}${btn(tr('Out of reach without transit {n}',{n:lostN}),'netFilter',{f:'out'},out?'sm':'ghost sm')}
`;
+ if(out&&!lostN)h+=`
${tr('Nothing: every network is reachable without transit.')}
`;
+ for(const n of foc?[foc]:out?ntLost():NETS){if(n.tail&&!UI.tailOpen&&!foc&&!out)continue;
+ h+=`
${logo(n)}
${esc(n.name)} AS${n.asn}
${TYPE_L[n.type]}${n.pol} · ${tr('{p}% of traffic',{p:(NSH[n.id]*100).toFixed(1)})}${n.price?` · ${tr('transit ${price}/Gbps',{price:(n.price*S.priceMul).toFixed(2)})}`:''}
`;
}
if(h!==UI._lh){UI._lh=h;morph($('leftBody'),h);}
}
@@ -3591,15 +3597,17 @@ function svgChart(rows,stackKeys,lines,fmtY){
g+=`${dateStr(rows[0].d)}${dateStr(rows[rows.length-1].d)}`;
return ``;}
// For a network you currently reach over transit: the cheapest way to move it to peering.
+// Exchange members as sets, rebuilt once per routing pass: hints are asked for many networks at a time.
+let IXMR=null,IXMC={};const ixHas=(x,id)=>{if(IXMR!==R){IXMR=R;IXMC={};}return (IXMC[x]||(IXMC[x]=new Set(ixMembers(x)))).has(id);};
function offTransitHint(id,city){const n=NET[id];if(n.type==='t1')return tr('Tier 1: only a PNI, and only once you are big enough for the Tier 1 club');
- const ixc=Object.keys(S.pops).flatMap(ixIdsIn).filter(x=>ixMembers(x).includes(id)),here=city&&ixIdsIn(city).find(x=>ixMembers(x).includes(id))||null,pick1=here||ixc.find(x=>S.ixp[x]!==undefined)||ixc[0];
- if(n.pol==='open')return pick1?(here?tr('Open peer: join the route server at {ix}',{ix:ixName(pick1)}):tr('Open peer: join the route server at {ix} ({city})',{ix:ixName(pick1),city:CITY[ixCity(pick1)].name})):tr('Open peer, but not on any IX where you have a POP');
+ const ixc=Object.keys(S.pops).flatMap(ixIdsIn).filter(x=>ixHas(x,id)),here=city&&ixIdsIn(city).find(x=>ixHas(x,id))||null,pick1=here||ixc.find(x=>S.ixp[x]!==undefined)||ixc[0];
+ if(n.pol==='open'){if(pick1)return here?tr('Open peer: join the route server at {ix}',{ix:ixName(pick1)}):tr('Open peer: join the route server at {ix} ({city})',{ix:ixName(pick1),city:CITY[ixCity(pick1)].name});const x=nearestSpot(id);return x?tr('Open peer, but not on any IX where you have a POP. Nearest: {city}',{city:CITY[x.c].name}):tr('Open peer, but not on any IX where you have a POP');}
if(n.pol==='paid')return paidFree(n)?tr('Peers with you for free over a PNI. You got too big to charge.'):n.freeLv?tr('Paid peering only: a PNI costs {price}/mo. Free from customer level {n}.',{price:fmt$(n.paidFee),n:n.freeLv}):tr('Paid peering only: a PNI costs {price}/mo',{price:fmt$(n.paidFee)});
const pniC=Object.keys(S.pops).filter(c=>n.pops.includes(c));const ixOk=pick1?peerOk(id,'ix',pick1):null,pOk=pniC.length?peerOk(id,'pni',pniC.includes(city)?city:pniC[0]):null;
if(pOk&&pOk.ok)return tr('Ready for a PNI in {city}',{city:CITY[pniC.includes(city)?city:pniC[0]].name});
if(ixOk&&ixOk.ok)return tr('Will peer at {ix}: request a session',{ix:ixName(pick1)});
if(ixOk)return `${ixName(pick1)}: ${ixOk.why}`;
- return pniC.length?tr('PNI in {city}: {why}',{city:CITY[pniC[0]].name,why:pOk.why}):tr('Not present in any of your cities yet');}
+ if(pniC.length)return tr('PNI in {city}: {why}',{city:CITY[pniC[0]].name,why:pOk.why});{const x=nearestSpot(id);return x?tr('Not in your cities yet. Nearest: {city}',{city:CITY[x.c].name}):tr('Not present in any of your cities yet');}}
function transitTop(ids,k=5){const m={};for(const id of ids)for(const [n,v] of Object.entries(R.tNet[id]||{}))m[n]=(m[n]||0)+v;return Object.entries(m).filter(([,v])=>v>0.01).sort((a,b)=>b[1]-a[1]).slice(0,k);}
/* ---------- scenario and level progress (#34) ---------- */
const pSrv=g=>({l:tr('Traffic served'),v:R.served,max:g,txt:`${fmtG(R.served)} / ${fmtG(g)}`});
@@ -3627,6 +3635,37 @@ function lvlItems(){const lv=S.lvl||1,pk=S.stats.peak||0,pops=Object.keys(S.pops
const t1Note=()=>S.won&&!isTier1()?`
${tr('Not Tier 1 right now: {why}.',{why:esc(t1Why())})}
`:'';
function lvlCard(){const lv=S.lvl||1,nx=LEVELS[lv];
return `
${tr('Customer level {lv} of {max}',{lv,max:LEVELS.length})}
${tr('Every customer type is unlocked. Go get those terabits.')}
`}
`;}
+/* ---------- where to meet a network (#12, #111, #121) ---------- */
+// Static: the cities where a network takes PNIs and the exchanges it sits on. Built once, on first use.
+let PLACES=null;
+function netPlaces(id){if(!PLACES){PLACES={};for(const n of NETS)PLACES[n.id]={p:n.pops.filter(c=>CITY[c]),x:[]};
+ for(const c of CITIES)if(c.ix)for(const n of NETS)if(n.ix==='ALL'||(Array.isArray(n.ix)&&n.ix.includes(c.id)))PLACES[n.id].x.push(c.id);
+ for(const X of XIX)for(const m of X.members)if(PLACES[m])PLACES[m].x.push(X.id);}return PLACES[id];}
+// km from each city to your nearest POP, cached until the set of POPs changes.
+let NEARK='',NEARM=null;
+function popNear(){const ps=Object.keys(S.pops),k=ps.join();if(k!==NEARK||!NEARM){NEARK=k;NEARM={};for(const c of CITIES)NEARM[c.id]=ps.length?Math.min(...ps.map(q=>q===c.id?0:kmBetween(q,c.id))):0;}return NEARM;}
+// One entry per city: can you PNI there, which of its exchanges have them. Your POPs first, then nearest.
+let SPOTK='',SPOTM={};
+function meetSpots(id){const near=popNear();if(SPOTK!==NEARK){SPOTK=NEARK;SPOTM={};}if(SPOTM[id])return SPOTM[id];const P=netPlaces(id),m={};if(!P)return [];
+ for(const c of P.p)(m[c]||(m[c]={c,pni:false,ix:[]})).pni=true;
+ for(const x of P.x){const c=ixCity(x);if(CITY[c])(m[c]||(m[c]={c,pni:false,ix:[]})).ix.push(x);}
+ return SPOTM[id]=Object.values(m).sort((a,b)=>(!!S.pops[b.c]-!!S.pops[a.c])||(near[a.c]-near[b.c])||(a.c[x.pni?'PNI':'',...x.ix.map(ixName)].filter(Boolean).join(' · ');
+ return `
`;}
+// The nearest place to meet a network you have no POP for, for one-line hints.
+function nearestSpot(id){const x=meetSpots(id)[0];return x&&!S.pops[x.c]?x:null;}
+// Networks you reach only through transit, biggest first: what stands between you and Tier 1.
+const ntLost=()=>NETS.filter(n=>!R.nt[n.id]).sort((a,b)=>NSH[b.id]-NSH[a.id]);
+function t1Card(){const cur=GOALS.find(g=>S.done[g.id]===undefined);if(!((cur&&cur.id==='t1')||S.won)||isTier1())return '';
+ const need=t1Need(),miss=need.filter(n=>!S.pni.some(p=>p.net===n.id)),club=t1Club(),lost=ntLost(),nb=n=>btn(esc(n.name),'netFocus',{id:n.id},'ghost sm');
+ let h=`
${tr('Goal')} · ${tr('Go transit-free: Tier 1!')}
${tr('Road to Tier 1')}
`;
+ h+=pRow({l:tr('Transit ports to cancel'),v:S.transit.length?0:1,max:1,txt:S.transit.length?String(S.transit.length):'✓'});
+ h+=pRow({l:tr('PNIs with every Tier 1'),v:need.length-miss.length,max:need.length,txt:`${need.length-miss.length} / ${need.length}`});
+ if(miss.length)h+=`
${miss.map(nb).join('')}
`+(club.ok?'':`
${tr('Tier 1s only take a PNI from a network with {list}.',{list:club.missing.join(', ')})}
`);
+ h+=pRow({l:tr('Reach without transit'),v:Math.min(R.reachNT,0.999),max:0.999,txt:`${reachPct(R.reachNT)} / 99.9%`});
+ if(lost.length)h+=`
${lost.slice(0,3).map(nb).join('')}${btn(trn('All {n} out of reach','All {n} out of reach',lost.length),'netFilter',{f:'out'},'pink sm')}
`;
+ return h+'
';}
/* ---------- customers overview (#13, #14, #15) ---------- */
const bizMo=b=>{const T=BIZ_T[b.type];return T.event?0:T.fiber?b.rate:b.bw*b.rate;};
// Why a customer is unhappy, in the same terms the daily mood update uses.
@@ -3784,7 +3823,7 @@ function renderDash(){checkLayer();
if(DT==='conn')h+=connSection();
if(DT==='traffic')h+=`
${tr('Traffic by network (ASN)')}
${tr("Where your users' traffic comes from, and how it gets to you. Transit is the only part you pay per gigabit; caches, PNIs and IX peering are free or flat-rate. Tap a column to sort.")}
${[['name',tr('Network'),''],['asn','AS',''],['type',tr('Type'),''],['traffic',tr('Traffic'),'r'],['mix',tr('How it arrives'),''],['cost',tr('Transit cost'),'r'],['lost',tr('Lost'),'r']].map(([k,l,c])=>`
${tr('The networks you pay transit to reach, biggest first, and the cheapest way to move each one to peering. This is your to-do list on the way to Tier 1.')}
${tr('The networks you pay transit to reach, biggest first, and the cheapest way to move each one to peering. This is your to-do list on the way to Tier 1.')}
diff --git a/tests/issues.test.js b/tests/issues.test.js
index 05ee434..69e63a7 100644
--- a/tests/issues.test.js
+++ b/tests/issues.test.js
@@ -1158,3 +1158,51 @@ test('#110 PNI buttons show the monthly port fee, not just the one-off setup', (
assert.match(ev("connUp(conns().find(r=>r.k==='p'&&r.id==='p1')).replace(/<[^>]+>/g,'')"), /Upgrade 100G \$2\.3k \+ \$350\/mo/);
assert.deepEqual(errors, []);
});
+
+test('#111 #121 #12 the road to Tier 1: what is missing, and where to meet each network', () => {
+ const { ev, errors, dom } = load();
+ ev("ACT.start({});S.cash=1e9;S.lvl=6;for(const g of GOALS)if(g.id!=='t1')S.done[g.id]=0");
+ ev("for(const c of ['fra','ams','nyc']){ACT.buildPop({city:c});S.pops[c].rgen=3;}ACT.buyTransit({city:'fra',net:'cog',tier:2});for(const x of ixIdsIn('ams'))ACT.buyIx({city:x,tier:2,signed:true});compute();ACT.peerAll({city:'ams'});compute()");
+ const body = () => dom.window.document.getElementById('leftBody').textContent;
+ // transit hides how much you would lose without it
+ assert.ok(ev('R.reach') > 0.99 && ev('R.reachNT') < ev('R.reach'), 'reach without transit is counted separately');
+ assert.equal(ev("NETS.filter(n=>R.nt[n.id]).reduce((a,n)=>a+NSH[n.id],0).toFixed(6)"), ev('R.reachNT.toFixed(6)'));
+ // #111: the goal card lists the missing Tier 1 PNIs and the networks out of reach
+ ev("UI.left='goals';UI.leftOpen=true;UI.sel=null;renderLeft()");
+ assert.match(body(), /Road to Tier 1/);
+ assert.match(body(), new RegExp(`PNIs with every Tier 1\\s*0 / ${ev('t1Need().length')}`));
+ assert.match(body(), /Transit ports to cancel\s*1/);
+ assert.match(body(), new RegExp(ev('t1Need()[0].name')));
+ assert.match(body(), /Tier 1s only take a PNI from a network with/);
+ assert.match(body(), /out of reach/);
+ // the filter lists exactly the networks you reach only through transit, biggest first
+ ev("ACT.netFilter({f:'out'})");
+ const shown = JSON.parse(ev("JSON.stringify(ntLost().map(n=>n.id))"));
+ assert.ok(shown.length > 0 && shown.length === ev("NETS.filter(n=>!R.nt[n.id]).length"));
+ const reached = ev("NETS.find(n=>R.nt[n.id]&&!n.tail).name");
+ assert.ok(!body().includes(reached + ' AS'), 'networks you already reach are not on the list');
+ assert.ok(ev("ntLost().every((n,i,a)=>!i||NSH[a[i-1].id]>=NSH[n.id])"));
+ // #12, #121: every place to meet a network, your POPs first, then the nearest
+ const far = ev("NETS.find(n=>!n.tail&&n.ix!=='ALL'&&n.pops.length&&n.pops.every(c=>!S.pops[c])).id");
+ const spots = JSON.parse(ev(`JSON.stringify(meetSpots('${far}').map(x=>x.c))`));
+ assert.ok(spots.length >= 1);
+ const near = JSON.parse(ev("JSON.stringify(popNear())"));
+ assert.ok(spots.every((c, i) => !i || near[spots[i - 1]] <= near[c]), 'nearest first');
+ assert.ok(ev(`NET['${far}'].pops.every(c=>meetSpots('${far}').some(x=>x.c===c&&x.pni))`), 'every PNI city is listed');
+ assert.match(ev(`offTransitHint('${far}')`), new RegExp('Nearest: ' + ev(`CITY['${spots[0]}'].name`)));
+ ev(`ACT.netFocus({id:'${far}'})`);
+ assert.match(body(), /Where to meet them/);
+ assert.match(body(), new RegExp(ev(`CITY['${spots[0]}'].name`)));
+ ev(`ACT.meetGo({city:'${spots[0]}'})`);
+ assert.equal(ev('UI.sel&&UI.sel.id'), spots[0]);
+ // the NOC to-do list has a way to the network's entry
+ ev("for(const c of Object.keys(S.pops))ACT.launchBB({city:c});for(let i=0;i<3;i++)dayTick();$('dash').hidden=false;UI.dtab='traffic';renderDash()");
+ assert.match(dom.window.document.getElementById('dash').innerHTML, /data-act="netFocus"/);
+ // Tier 1 reached: the card goes away
+ ev("S.transit=[];for(const n of t1Need())S.pni.push({id:'t'+n.id,net:n.id,city:n.pops[0],tier:0});compute();R.reach=1;R.reachNT=1;for(const n of NETS)R.reachable[n.id]=R.nt[n.id]=1;UI.left='goals';renderLeft()");
+ assert.equal(ev('isTier1()'), true);
+ assert.doesNotMatch(body(), /Road to Tier 1/);
+ // phones: the same views in the bottom sheet
+ dom.window.innerWidth = 360; ev("ACT.netFilter({f:'out'});renderAll&&renderAll()");
+ assert.deepEqual(errors, []);
+});