Serve story artwork and replace letter branches with named arcs

This commit is contained in:
unimatrixgit 2026-12-05 08:31:16 +01:00
commit 1fdf4dc720
10 changed files with 88 additions and 18 deletions

View file

@ -1,7 +1,7 @@
import {element as el} from './cp-v2-page-template.mjs';
import {actions,briefing,currentObjective,nextInArc,objectives,rewards} from './cp-v2-mission-journal-model.mjs';
import {actions,briefing,currentObjective,nextInArc,objectives,rewards,pickSelection} from './cp-v2-mission-journal-model.mjs';
import {categoryFor,categoryHero,groupBranches,orderChapters,bannerUrl,iconUrl,ensureStyles} from './cp-v2-quest-categories.mjs';
import {categoryFor,categoryHero,groupJournalArcs,bannerUrl,iconUrl,ensureStyles} from './cp-v2-quest-categories.mjs';
const bar=(percent,label)=>{const p=el('progress');p.max=100;p.value=percent;p.setAttribute('aria-label',label);return p;};
const button=(text,fn,disabled=false)=>{const b=el('button',text);b.type='button';b.disabled=disabled;b.onclick=fn;return b;};
@ -24,20 +24,21 @@ export function renderMissionJournal(body,{journal,selected,tracked,banners=[],b
const layout=el('div',undefined,'mj-layout'),nav=el('nav',undefined,'mj-arcs');nav.setAttribute('aria-label','Story arcs');
ensureStyles();
for(const categoryGroup of groupBranches(journal.arcs)){
const heading=el('div',undefined,'quest-category-heading');heading.style.backgroundImage='url("'+bannerUrl(categoryGroup.category)+'")';
const icon=el('img');icon.src=iconUrl(categoryGroup.category);icon.alt='';icon.width=icon.height=24;heading.append(icon,el('span',categoryGroup.category.title));nav.append(heading);
for(const arc of categoryGroup.rows){
const group=el('details',undefined,'mj-arc');group.open=arc.quests.some(q=>q.id===selected)||(!arc.complete&&arc.quests.some(q=>q.status==='active'||q.status==='ready'))||journal.arcs.length===1;
const head=el('summary');head.append(el('span',arc.title),el('small',arc.done+' / '+arc.total));group.append(head);
for(const arc of groupJournalArcs(journal.arcs)){
const group=el('details',undefined,'mj-arc');group.dataset.categoryId=arc.category.id;group.open=arc.quests.some(q=>q.id===selected)||(!arc.complete&&arc.quests.some(q=>q.status==='active'||q.status==='ready'));
const head=el('summary',undefined,'quest-category-heading');head.style.backgroundImage='linear-gradient(90deg,rgba(24,34,25,.75),rgba(24,34,25,.15)),url("'+bannerUrl(arc.category)+'")';
const icon=el('img');icon.src=iconUrl(arc.category);icon.alt='';icon.width=icon.height=24;
head.append(icon,el('span',arc.category.title),el('small',arc.done+' / '+arc.total));
head.onclick=event=>{if(!arc.quests.some(q=>q.id===selected)){event.preventDefault();onSelect(pickSelection({all:arc.quests},{tracked}));}};
group.append(head,el('p',arc.category.tagline,'mj-arc-tagline'),bar(arc.total?arc.done/arc.total*100:0,arc.category.title+' progress'));
if(arc.ready)group.append(el('small',arc.ready+' reward'+(arc.ready===1?'':'s')+' ready','mj-arc-ready'));
const list=el('ol');
for(const q of orderChapters(arc.quests)){
for(const q of arc.quests){
const item=el('li'),pick=button('',()=>onSelect(q.id));pick.className='mj-mission';pick.dataset.status=q.status;pick.setAttribute('aria-pressed',String(q.id===selected));
pick.append(el('span',q.title),el('small',q.statusLabel));if(q.id===tracked&&q.status!=='done')pick.append(el('small','Tracked','mj-tracked'));
item.append(pick);list.append(item);
}
group.append(list);nav.append(group);
}
}
layout.append(nav);

View file

@ -74,11 +74,11 @@ export function mountPersonalProgression(host,{view='missions',fetcher=fetch,api
const progress=el('progress');progress.max=data.season.levelCap;progress.value=data.profile.level;progress.setAttribute('aria-label','Season level');if(data.season.levelCap!==null)stats.append(progress);body.append(stats);
if(data.affiliations?.length){const affiliation=el('aside',undefined,'progression-intro');affiliation.append(el('strong','The Unmarked Caravan'),el('p','Your smuggler clan and company affiliations are secondary. Your ordinary affiliations stay in place.'));body.append(affiliation);}
const select=el('select');select.setAttribute('aria-label','Mission branch');
const availableBranches=data.branches||branches;for(const group of groupBranches(availableBranches.filter(b=>data.quests.some(q=>q.branch===b.id)))){const optgroup=el('optgroup');optgroup.label=group.category.title;for(const b of group.rows){const option=el('option',b.title);option.value=b.id;optgroup.append(option);}select.append(optgroup);}
const availableBranches=data.branches||branches;for(const group of groupBranches(availableBranches.filter(b=>data.quests.some(q=>q.branch===b.id)))){const option=el('option',group.category.title);option.value=group.category.id;select.append(option);}
if(!data.quests.some(q=>q.branch===branch))branch=data.quests[0]?.branch;
select.value=branch;select.onchange=()=>{branch=select.value;selected=null;render();};onBranches(availableBranches.filter(b=>data.quests.some(q=>q.branch===b.id)),branch);body.append(categoryHero(categoryFor(branch),el));if(!externalBranches)body.append(select);
select.value=categoryFor(branch).id;select.onchange=()=>{branch=data.quests.find(q=>categoryFor(q.branch).id===select.value)?.branch||branch;selected=null;render();};onBranches(availableBranches.filter(b=>data.quests.some(q=>q.branch===b.id)),branch);body.append(categoryHero(categoryFor(branch),el));if(!externalBranches)body.append(select);
if(branch==='e'&&typeof onCareerNavigate==='function'){const careers=el('section',undefined,'progression-toolbar');careers.append(el('h3','Reputation careers'),button('Official Spice Harvesting',()=>onCareerNavigate('spice-harvesting')),button('Smuggling Jobs',()=>onCareerNavigate('smugglers')),button('Bounty Jobs',()=>onCareerNavigate('bounty-jobs')));body.append(careers);}
const rows=orderChapters(data.quests.filter(q=>q.branch===branch)).map(q=>({...q,channel:questChannel(q.executionRequirements)}));selected=rows.find(q=>q.id===selected)?.id||null;
const rows=orderChapters(data.quests.filter(q=>categoryFor(q.branch).id===categoryFor(branch).id)).map(q=>({...q,channel:questChannel(q.executionRequirements)}));selected=rows.find(q=>q.id===selected)?.id||null;
const layout=el('div',undefined,'progression-layout'),tree=el('div',undefined,'progression-tree');tree.setAttribute('aria-label','Mission tree');
for(const row of rows){const card=button('',()=>{selected=row.id;detailOpen=true;render();});card.className='progression-mission';card.dataset.missionId=row.id;card.dataset.channel=row.channel==='website'?'website':'shared';card.setAttribute('aria-pressed',String(row.id===selected));card.setAttribute('aria-haspopup','dialog');card.append(image(artwork||questArtwork(row.channel)),el('strong',row.title),el('span',labels[row.state]||'Awaiting verification','progression-badge'));tree.append(card);}
layout.append(tree);const row=rows.find(q=>q.id===selected);
@ -96,5 +96,5 @@ export function mountPersonalProgression(host,{view='missions',fetcher=fetch,api
const connect=()=>{if(!active||!tree.isConnected)return;const box=tree.getBoundingClientRect();svg.setAttribute('viewBox','0 0 '+box.width+' '+box.height);svg.replaceChildren();const cards=new Map([...tree.querySelectorAll('[data-mission-id]')].map(n=>[n.dataset.missionId,n]));for(const row of rows)for(const dependency of row.requires||[]){if(!cards.has(dependency))continue;const a=cards.get(dependency).getBoundingClientRect(),b=cards.get(row.id).getBoundingClientRect(),line=document.createElementNS(svg.namespaceURI,'path'),sameRow=Math.abs(a.top-b.top)<5,x1=(sameRow?a.right:a.left+a.width/2)-box.left,y1=(sameRow?a.top+a.height/2:a.bottom)-box.top,x2=(sameRow?b.left:b.left+b.width/2)-box.left,y2=(sameRow?b.top+b.height/2:b.top)-box.top;line.setAttribute('d',sameRow?`M ${x1} ${y1} H ${x2}`:`M ${x1} ${y1} V ${y1+14} H ${x2} V ${y2}`);svg.append(line);}};
connectorObserver=new ResizeObserver(connect);connectorObserver.observe(tree);requestAnimationFrame(connect);
}
load();const poll=journalMode?setInterval(()=>{if(active&&!busy&&!document.hidden)load();},30000):null;const dispose=()=>{active=false;if(poll)clearInterval(poll);dossier.dispose();connectorObserver?.disconnect();controller.abort();};dispose.selectBranch=id=>{if(active&&data?.quests?.some(q=>q.branch===id)){branch=id;const arc=buildJournal(data).arcs.find(a=>a.id===id);selected=arc?.quests.find(q=>q.status!=='done')?.id||arc?.quests[0]?.id||null;render();}};return dispose;
load();const poll=journalMode?setInterval(()=>{if(active&&!busy&&!document.hidden)load();},30000):null;const dispose=()=>{active=false;if(poll)clearInterval(poll);dossier.dispose();connectorObserver?.disconnect();controller.abort();};dispose.selectBranch=id=>{if(!active||!data?.quests)return;const model=buildJournal(data),quests=model.all.filter(q=>id.startsWith('category:')?categoryFor(q.branch).id===id.slice(9):q.branch===id);if(!quests.length)return;selected=pickSelection({all:quests},{tracked});branch=quests.find(q=>q.id===selected)?.branch||quests[0].branch;render();};return dispose;
}

View file

@ -40,7 +40,8 @@ export function createProgressionSidebar(host,{fetcher=fetch,onBranch=()=>{},onN
function menuIcon(key){const img=el('img');img.src=typeof globalThis.uniqueMenuIcon==='function'?globalThis.uniqueMenuIcon('quests/'+key):'https://www.dunerealms.com/assets/nav-account-v2.webp';img.alt='';img.width=img.height=24;return img;}
function menuHeading(label,count){const title=el('div',undefined,'category-heading');title.setAttribute('role','heading');title.setAttribute('aria-level','2');title.append(menuIcon('category/'+label),el('span',label,'category-name'),el('span',String(count),'category-count'));return title;}
function renderViews(){journalMenu.replaceChildren(menuHeading('Journal views',3));const links=el('div',undefined,'category-links');for(const [view,label]of [['missions','Missions'],['decisions','Decisions'],['history','History']]){const link=el('a',undefined,'navitem');link.append(menuIcon('view/'+view),el('span',label));link.href=href(currentKind,view);link.setAttribute('aria-current',view===currentView?'page':'false');link.onclick=event=>open(event,currentKind,view);links.append(link);}journalMenu.append(links);}
function renderBranches(){directory.replaceChildren(menuHeading('Mission branches',branchRows.length));ensureStyles();for(const group of groupBranches(branchRows)){const heading=el('div',undefined,'quest-category-heading');heading.style.backgroundImage='linear-gradient(90deg,rgba(40,26,18,.78),rgba(40,26,18,.25)),url("'+bannerUrl(group.category)+'")';const icon=el('img');icon.src=iconUrl(group.category);icon.alt='';icon.width=icon.height=20;heading.append(icon,el('span',group.category.title));directory.append(heading);const links=el('div',undefined,'category-links');for(const row of group.rows){const button=el('button',undefined,'navitem');button.type='button';button.setAttribute('aria-current',row.id===branchId?'page':'false');button.append(menuIcon('branch/'+row.id),el('span',row.title));button.onclick=()=>{onBranch(row.id);closeMenus();};links.append(button);}directory.append(links);}directory.hidden=!branchRows.length;}
function renderBranches(){const groups=groupBranches(branchRows);directory.replaceChildren(menuHeading('Story arcs',groups.length));ensureStyles();const links=el('div',undefined,'category-links');for(const group of groups){const button=el('button',undefined,'navitem quest-arc-link');button.type='button';button.setAttribute('aria-current',group.rows.some(row=>row.id===branchId)?'page':'false');button.style.backgroundImage='linear-gradient(90deg,rgba(24,34,25,.75),rgba(24,34,25,.2)),url("'+bannerUrl(group.category)+'")';const icon=el('img');icon.src=iconUrl(group.category);icon.alt='';icon.width=icon.height=28;button.append(icon,el('span',group.category.title));button.onclick=()=>{onBranch('category:'+group.category.id);closeMenus();};links.append(button);}directory.append(links);directory.hidden=!groups.length;}
async function read(path){const r=await fetcher(path,{credentials:'same-origin',cache:'no-store',signal:controller.signal});if(!r.ok)throw Error('Report unavailable');return r.json();}
function updateBranches(){const data=journals.get(currentKind);const rows=data?.branches||[...MISSION_BRANCHES.filter(b=>b.id!=='discoveries'),{id:'acquisitions',title:'Acquisitions'}];branchRows=data?.quests?rows.filter(b=>data.quests.some(q=>q.branch===b.id)):[];if(!branchRows.some(b=>b.id===branchId))branchId=branchRows[0]?.id;renderBranches();}
function ensureJournal(kind){if(journals.has(kind)||pending.has(kind))return;pending.add(kind);void read(kind==='pol'?'/api/progression/pol':'/api/progression').then(data=>setJournal(kind,data)).catch(()=>{if(alive){failures.add(kind);render();}}).finally(()=>pending.delete(kind));}

View file

@ -6,3 +6,12 @@
.mj .mj-arcs{max-height:calc(100vh - 16rem);min-height:15rem;overflow-y:auto;overscroll-behavior:contain;padding-right:.35rem}
@media(max-width:46rem){.mj .mj-arcs{max-height:42vh;min-height:10rem}.quest-category-hero{padding-right:5rem}}
.mj .mj-arc>summary.quest-category-heading{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:.6rem;min-height:44px;padding:.55rem .65rem;margin:0;border-radius:.35rem}
.mj .mj-arc[open]>summary{box-shadow:inset 0 0 0 1px #b6995c}
.mj .mj-arc>progress{width:calc(100% - 1rem);height:.45rem;margin:.25rem .5rem}
.mj-arc-tagline{font-size:.82rem;line-height:1.4;margin:.45rem .5rem;color:#c9b991}
.mj-arc-ready{display:block;margin:.2rem .5rem;color:#e5c27b}
.quest-arc-link{display:flex;align-items:center;gap:.65rem;min-height:52px;background-size:cover;background-position:right center;text-shadow:0 1px 3px #10231e;color:#fff4d8}
.quest-arc-link img{width:28px;height:28px;image-rendering:pixelated}
.quest-arc-link[aria-current=page]{outline:1px solid #d5b36c;outline-offset:-1px}

View file

@ -162,6 +162,14 @@ export function groupBranches(rows){
}
return groups;
}
/** A themed arc can contain several legacy branches. Keep their IDs internal. */
export function groupJournalArcs(arcs){
return groupBranches(arcs).map(({category,rows})=>{
const quests=orderChapters(rows.flatMap(row=>row.quests));
const done=quests.filter(quest=>quest.status==='done').length;
return {category,quests,done,total:quests.length,ready:quests.filter(quest=>quest.status==='ready'&&quest.canClaim).length,complete:done===quests.length};
});
}
/** Chapter order: prerequisites first, otherwise the server's own order. Stable and cycle-safe. */
export function orderChapters(rows){
const byId=new Map(rows.map(r=>[r.id,r])),placed=new Set(),out=[];

View file

@ -0,0 +1,15 @@
import {readFile} from 'node:fs/promises';
import {QUEST_CATEGORIES,OTHER_CATEGORY} from './public/cp-v2/cp-v2-quest-categories.mjs';
const categories=new Set([...QUEST_CATEGORIES,OTHER_CATEGORY].map(category=>category.id));
// Only the authored category PNGs are public; this is not a directory server.
export async function questCategoryArt(request){
const match=/^\/(?:v2|cp-v2)\/art\/quests\/([a-z0-9-]+)-(icon|banner)\.png$/.exec(new URL(request.url).pathname);
if(!match||!categories.has(match[1]))return null;
if(!['GET','HEAD'].includes(request.method))return new Response('Method not allowed',{status:405,headers:{Allow:'GET, HEAD'}});
try{
const bytes=await readFile(new URL('./public/cp-v2/art/quests/'+match[1]+'-'+match[2]+'.png',import.meta.url));
return new Response(request.method==='HEAD'?null:bytes,{headers:{'Content-Type':'image/png','Cache-Control':'private, no-store','X-Content-Type-Options':'nosniff'}});
}catch(error){if(error.code==='ENOENT')return new Response('Not found',{status:404});throw error;}
}

View file

@ -48,6 +48,7 @@ import {POL_COOP_CARGO_SCHEMA} from '../node/pol-coop-cargo.mjs';
import {createPOLCargoService} from '../node/pol-cargo-service.mjs';
import {createGameRefits} from '../node/organisation-refits.mjs';
import {createGameQuestEventsAPI} from '../node/game-quest-events.mjs';
import {questCategoryArt} from './quest-category-art.mjs';
import {createGameItemDesignAPI} from '../node/game-item-designs.mjs';
import {createPOLFundedRewards} from '../node/pol-funded-rewards.mjs';
import {ensurePOLMentorPolicy} from '../node/pol-mentor-rewards.mjs';
@ -606,6 +607,7 @@ export function createPanel(db,settings={},dependencies={}){
if(path==='/politics-cp')return new Response(request.method==='HEAD'?null:politicsCPDocument(await readFile(new URL('./public/cp-v2/index.html',import.meta.url),'utf8')),{headers:{'Content-Type':'text/html; charset=utf-8','Cache-Control':'no-store','X-Content-Type-Options':'nosniff'}});
const calendarVendorFiles=new Set(['fullcalendar.global.min.js','monarch.global.min.js','skeleton.css','monarch.css','palette.css','LICENSE.md','SOURCE.json']);
if(path.startsWith('/v2/vendor/fullcalendar/')&&['GET','HEAD'].includes(request.method)){const file=path.slice('/v2/vendor/fullcalendar/'.length);if(!calendarVendorFiles.has(file))return new Response('Not found',{status:404});const type=file.endsWith('.js')?'text/javascript':file.endsWith('.css')?'text/css':file.endsWith('.json')?'application/json':'text/plain';return new Response(request.method==='HEAD'?null:await readFile(new URL('./public/cp-v2/vendor/fullcalendar/'+file,import.meta.url)),{headers:{'Content-Type':type+'; charset=utf-8','Cache-Control':'private, no-store','X-Content-Type-Options':'nosniff'}});}
const categoryArtwork=await questCategoryArt(request);if(categoryArtwork)return categoryArtwork;
// All authored cp-v2 browser modules share this bounded public directory.
// New components must not require a second, manually maintained route list.
if(path==='/mentat-report')return new Response(request.method==='HEAD'?null:await readFile(new URL('./public/cp-v2/cp-v2-mentat-embed.html',import.meta.url)),{headers:{'Content-Type':'text/html; charset=utf-8','Cache-Control':'private, no-store','X-Content-Type-Options':'nosniff','Content-Security-Policy':PANEL_CSP.replace("img-src 'self' data:;","img-src 'self' data: https://www.dunerealms.com;")}});

View file

@ -48,3 +48,16 @@ test('current journal groups categories without hiding unknown branches or chang
assert.equal(all.filter(e=>e.textContent==='Claim reward').length,1);assert.equal(all.filter(e=>e.className==='quest-category-hero').length,1);
}finally{globalThis.document=before;}
});
test('one named story arc combines former letter branches once in prerequisite order',()=>{
const before=globalThis.document;globalThis.document={createElement:tag=>new Element(tag),querySelector:()=>null,head:new Element('head')};
try{
const mission=(id,branch,requires=[])=>({id,title:'Mission '+id,branch,requires,state:'active',progress:0,target:1});
const journal=buildJournal({branches:[{id:'e',title:'E'},{id:'f',title:'F'},{id:'g',title:'G'}],quests:[mission('third','g',['second']),mission('first','e'),mission('second','f',['first'])]}),root=new Element('main'),calls=[];
renderMissionJournal(root,{journal,selected:'first',tracked:'second'},{onSelect:id=>calls.push(id),onTrack:()=>{},onAct:()=>{},onSteps:()=>{}});
const all=descendants(root),headings=all.filter(e=>e.tagName==='summary');assert.equal(headings.length,1);assert.equal(headings[0].children.find(e=>e.tagName==='span').textContent,'A Place in the Realm');
const picks=all.filter(e=>e.className==='mj-mission');assert.deepEqual(picks.map(e=>e.children[0].textContent),['Mission first','Mission second','Mission third']);
assert.equal(new Set(picks.map(e=>e.children[0].textContent)).size,3);picks[1].onclick();assert.deepEqual(calls,['second']);
assert.ok(!all.some(e=>['E','F','G'].includes(e.textContent)));
}finally{globalThis.document=before;}
});

View file

@ -30,7 +30,7 @@ test('mission branches and directory persist through decisions/history and stay
const right=new Node(),left=new Node(),banner=new Node(),shell=new Node();right.parentElement=shell;right.querySelector=()=>banner;shell.querySelector=s=>s==='#sidebar'?left:right;
globalThis.document={createElement:()=>new Node(),querySelector:()=>null};globalThis.location={hash:'#quests/quests'};globalThis.history={replaceState(){}};
const host={closest:()=>({parentElement:shell})},requests=[],selected=[];
const data=kind=>({state:'active',branches:[{id:kind,title:kind}],quests:[{branch:kind}],player:{}});
const data=kind=>{const branch=kind==='personal'?'a':'fremen';return {state:'active',branches:[{id:branch,title:kind==='personal'?'A':'Fremen'}],quests:[{branch}],player:{}};};
let sidebar;
try{
sidebar=createProgressionSidebar(host,{onBranch:id=>selected.push(id),fetcher:async path=>{requests.push(path);return Response.json(path==='/api/progression/pol'?data('pol'):path==='/api/progression'?data('personal'):{});}});
@ -38,8 +38,8 @@ test('mission branches and directory persist through decisions/history and stay
const directory=left.children.find(n=>n.attributes['aria-label']==='Mission branches');
assert.equal(directory.hidden,false);assert.equal(banner.hidden,false);
sidebar.setNavigation('personal','history');sidebar.showBranches(true);assert.equal(directory.hidden,false);
branchButtons(directory)[0].onclick();assert.deepEqual(selected,['personal']);
sidebar.setNavigation('pol','decisions');assert.equal(branchButtons(directory)[0].children[1].textContent,'pol');
branchButtons(directory)[0].onclick();assert.deepEqual(selected,['category:arrival']);
sidebar.setNavigation('pol','decisions');assert.equal(branchButtons(directory)[0].children[1].textContent,'Sons of the Sand');
assert.equal(requests.filter(p=>p==='/api/progression').length,1);
}finally{sidebar?.dispose();for(const [key,value]of Object.entries(before)){if(value===undefined)delete globalThis[key];else globalThis[key]=value;}}
});

View file

@ -0,0 +1,21 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {readFile} from 'node:fs/promises';
import {createPanel} from '../control-panel/server.mjs';
import {LocalD1} from './d1-adapter.mjs';
import {QUEST_CATEGORIES,OTHER_CATEGORY} from '../control-panel/public/cp-v2/cp-v2-quest-categories.mjs';
test('real CP routes serve all authored arc PNGs with correct GET and HEAD semantics',async()=>{
const db=new LocalD1(),app=createPanel(db),origin='https://cp.dunerealms.com';
try{
for(const category of [...QUEST_CATEGORIES,OTHER_CATEGORY])for(const kind of ['icon','banner']){
const name=category.id+'-'+kind+'.png',url=origin+'/v2/art/quests/'+name;
const response=await app(new Request(url));assert.equal(response.status,200,name);assert.equal(response.headers.get('content-type'),'image/png');assert.equal(response.headers.get('x-content-type-options'),'nosniff');
assert.deepEqual(Buffer.from(await response.arrayBuffer()),await readFile(new URL('../control-panel/public/cp-v2/art/quests/'+name,import.meta.url)));
const head=await app(new Request(url,{method:'HEAD'}));assert.equal(head.status,200);assert.equal(head.headers.get('content-type'),'image/png');assert.equal(await head.text(),'');
}
assert.equal((await app(new Request(origin+'/cp-v2/art/quests/arrival-icon.png'))).status,200);
const post=await app(new Request(origin+'/v2/art/quests/arrival-icon.png',{method:'POST'}));assert.equal(post.status,405);
for(const path of ['/v2/art/quests/unknown-icon.png','/v2/art/quests/arrival-icon.png.js','/v2/art/quests/arrival%2Ficon.png','/v2/art/quests/../../server.mjs'])assert.equal((await app(new Request(origin+path))).status,404,path);
}finally{db.close();}
});