/* The build standard sheet: every target as a list (two to a row on a phone), grouped POP / ports and peering / fiber; what is below the standard and what bringing it up costs, priced without changing anything; one tap to do it now; and the intern's order that keeps it there. A bottom sheet on phones, like the Ops sheet it sits next to. */ const BSTD_GRP=[['pop',N_('common.pops')],['port',N_('bstd.g_port')],['fiber',N_('bstd.g_fiber')]]; // Every value a target can take, in the order its list shows them; the current one is always on the list. function bstdOpts(k){const L=BSTDK[k].v(),cur=bstd()[k];if(!L.includes(cur))L.push(cur);return L;} function bstdVal(k,v){if(v===BSTDK[k].d&&k!=='rt')return tr('bstd.keep'); switch(k){case 'g':return RG[v].n+(rgOpen(v)?'':' '+tr('bstd.from_level',{lv:RG[v].lvl})); case 'rt':return v>1?tr('bstd.at_least_n',{n:v}):tr('bstd.keep'); case 'site2':case 'gen':return tr('bstd.at_every_pop'); case 'lag':return tr('bstd.at_least_n',{n:v}); case 'split':return tr('bstd.both_buildings'); case 'ix':return tr('bstd.every_exchange'); case 'pni':return tr('bstd.in_n_cities',{n:v}); case 'sys':return tr('bstd.or_better',{x:DF_SYS[v].n}); case 'opt':return tr('bstd.fastest'); case 'wv':return tr('bstd.or_better',{x:LT[v].n});} return String(v);} const bstdShown=()=>!!$('modal')&&!$('modal').hidden&&!!$('modalCard').querySelector('[data-sheet="bstd"]'); // msg: why the sheet is shown again (the quote changed). function bstdModal(msg){if(!S||pzOn())return;const D=bstd(),q=bstdQuote(false),hired=opsHired(),on=hired&&S.ops.on.std; let h=`
${tr('bstd.tagline')}
${typeof msg==='string'&&msg?`${esc(msg)}
`:''}`; for(const [g,lab] of BSTD_GRP)h+=`${g==='pop'?tr('bstd.new_pops_note'):g==='port'?tr('bstd.port_note'):tr('bstd.fiber_note_two')}