Keep honorary Order membership independent of its former sponsor and simplify tariff downloads

This commit is contained in:
unimatrixgit 2026-11-19 00:26:31 +01:00
commit d2ec36dad2
6 changed files with 19 additions and 9 deletions

View file

@ -1,7 +1,11 @@
import {randomUUID} from 'node:crypto';import {STAFF_OFFICE_ACCOUNT_ID} from './organisation-keys.mjs';
export const CRYSKNIFE_COMPANY_ID='6da94d13-730e-4c50-9869-76aa5c5232b9';
export async function reconcileCrysknifeCompany(db,keys,{clock=Date.now}={}){
const source=await db.prepare("SELECT m.user_id owner_id,p.id parent_id,d.owner_account_id controller_id FROM site_memorials m JOIN site_accounts owner ON owner.id=m.user_id JOIN corrino_companies p ON p.slug='uni' AND p.status='active' JOIN site_company_deeds d ON d.company_id=p.id JOIN site_accounts a ON a.id=d.owner_account_id AND LOWER(a.username)='unimatrix999' WHERE m.slug='patrick-stewart' AND d.charter_kind='royal'").first();if(!source)return{state:'awaiting-source'};
const memorial=await db.prepare("SELECT m.user_id owner_id FROM site_memorials m JOIN site_accounts a ON a.id=m.user_id WHERE m.slug='patrick-stewart'").first();if(!memorial)return{state:'awaiting-source'};
const existing=await db.prepare("SELECT id FROM corrino_companies WHERE slug='order-crysknife'").first();if(existing&&existing.id!==CRYSKNIFE_COMPANY_ID)throw Error('Crysknife company identity requires review');
// Reconcile existing Orders independently of their former temporary sponsor.
let source=memorial;
if(!existing){const sponsor=await db.prepare("SELECT p.id parent_id,d.owner_account_id controller_id FROM corrino_companies p JOIN site_company_deeds d ON d.company_id=p.id JOIN site_accounts a ON a.id=d.owner_account_id AND LOWER(a.username)='unimatrix999' WHERE p.slug='uni' AND p.status='active' AND d.charter_kind='royal'").first();if(!sponsor)return{state:'awaiting-source'};source={...memorial,...sponsor};}
await db.transaction(async tx=>{const now=clock(),prior=await tx.first("SELECT id FROM corrino_companies WHERE slug='order-crysknife' FOR UPDATE");if(prior&&prior.id!==CRYSKNIFE_COMPANY_ID)throw Error('Crysknife company identity requires review');if(!prior){await tx.query("INSERT INTO corrino_companies(id,slug,name,description,founded_by,ceo_account_id,status,created_at,updated_at) VALUES(?,'order-crysknife','Order of the Crysknife','Protected honorary Order. Sir Patrick Stewart holds the local deed; Unicorp is the temporary test parent. The political company is the intended release parent.',?,NULL,'active',?,?)",[CRYSKNIFE_COMPANY_ID,source.owner_id,now,now]);await tx.query("INSERT INTO site_company_deeds(company_id,owner_account_id,charter_kind,version,created_at,updated_at) VALUES(?,?,'basic',1,?,?)",[CRYSKNIFE_COMPANY_ID,source.owner_id,now,now]);await tx.query("INSERT INTO site_company_relations(company_id,parent_company_id,relation_origin,updated_at) VALUES(?,?,'created',?)",[CRYSKNIFE_COMPANY_ID,source.parent_id,now]);await tx.query("INSERT INTO site_company_institutions(company_id,institution_key) VALUES(?,'order-crysknife')",[CRYSKNIFE_COMPANY_ID]);await tx.query('INSERT INTO corrino_company_events(id,company_id,action,actor_id,details_json,created_at) VALUES(?,?,?,?,?,?)',[randomUUID(),CRYSKNIFE_COMPANY_ID,'protected-order-created',source.controller_id,JSON.stringify({temporaryParent:source.parent_id,releaseParent:'political-company',memorial:'patrick-stewart'}),now]);}
const current=await tx.first('SELECT owner_account_id FROM site_company_deeds WHERE company_id=?',[CRYSKNIFE_COMPANY_ID]);if(current.owner_account_id!==source.owner_id)throw Error('Protected Order owner changed; manual review required');await tx.query('INSERT INTO site_company_members(company_id,user_id,joined_at) VALUES(?,?,?) ON DUPLICATE KEY UPDATE user_id=VALUES(user_id)',[CRYSKNIFE_COMPANY_ID,source.owner_id,now]);
const holders=await tx.query("SELECT DISTINCT a.id FROM site_accounts a WHERE a.role='crysknife' OR EXISTS(SELECT 1 FROM cp_account_ranks r WHERE r.user_id=a.id AND r.rank_key='crysknife')");for(const holder of holders)await tx.query('INSERT INTO site_company_members(company_id,user_id,joined_at) VALUES(?,?,?) ON DUPLICATE KEY UPDATE user_id=VALUES(user_id)',[CRYSKNIFE_COMPANY_ID,holder.id,now]);

View file

@ -7,7 +7,7 @@ export const RATES_GUIDE_EDITION='alpha-1.0.1.2-20261118';
export function ratesReferenceSections(){return [
{id:'tax-rules',title:'Tax rules & payment destinations',art:'imperial-postbank-v2.png',paragraphs:['A configured tax rate does not make every website or Minecraft action taxable. The relevant transaction handler must apply the tax and record its ledger entries. No blanket extra tax is added to the prices below.','Rihla: 1% for transfers up to and including 3,000 DM; 5% on the full amount above 3,000 DM. The sender pays principal plus tax; the recipient receives the full principal. Tax rounds upward to the next cent. In-game sending and collection remain a separate integration.'],headers:['Charge','Who pays / basis','Destination / status'],rows:[['Applicable game-sales VAT','Configured public VAT rate; supported taxable sales only','Tax treasury; game-flow integration dependent'],['VAT on bank fees','Configured bank-fee VAT rate shown in the live register','Tax treasury; a zero rate adds no VAT'],['Monthly account tax','Configured fixed amount shown in the live register','A zero amount adds no account tax'],['Package and account charges','Accepted package terms; automated monthly billing remains disabled','Website bank treasury; published fees are not yet monthly collection'],['Rihla transfer tax','Sender; 1% / 5% of full principal','Tax treasury on collection; game execution pending'],['Payroll deductions','Employee social contribution and income tax; employer social contribution is additional','Tax treasury through supported P&O payroll posting'],['Recruitment and campaigns','Publishing organisation or officeholder; accepted quote','Tax treasury; listing charge is distinct from VAT'],['Office auction','Winning bidder; accepted final bid','Tax treasury; losing holds released'],['Claim upkeep / unlock','Original organisation, including upgrades by its mother','Tax treasury; published schedule and supported claim flow apply'],['Server project funding','Approved budget paid from available Tax funds','Dedicated 979 project account; project workflow in development']]},
{id:'publication-charges',title:'Recruitment, campaigns & office auctions',art:'exchange-political-positions-v1.png',paragraphs:['Recruitment: Basic clans are free. Keyed/Royal recruitment uses 10 DM + 0.25 DM per occupied member. Protected institutions do not use ordinary recruitment. Political custom vacancies use the same agreed recruitment tariff.','Campaign bookings use whole hourly slots, may cover multiple hours and open no earlier than seven days before the election. A featured slot is exclusive for its election scope and hour. Forum/Discord promotion is optional: 25 DM per selected channel per booking, not per hour; retries do not create another charge.'],headers:['Election campaign','Standard / hour','Featured / hour'],rows:Object.entries(CAMPAIGN_RATES).map(([kind,price])=>[({clan_delegate:'Clan Delegate',house:'House leader',bene:'Veiled Concord',guild:'Vaerkring',imperial:'Emperor'})[kind],dm(price),dm(price*1.5)]).concat([['Office auction opening bid',dm(OFFICE_AUCTION_RULES.startMinor),'Minimum increase '+dm(OFFICE_AUCTION_RULES.incrementMinor)]])},
{id:'reserve-instruments',title:'Federal Reserve & J.A.R.V.I.S. instruments',art:'organisation-deed-keys-v1.png',paragraphs:['An instrument records a purpose and authority; knowing a reference is not permission. Public references never disclose secret codes. These are fictional game-economy instruments, not real-world securities.','Reserve issuance is restricted to the designated reserve owner and existing administration checks. It uses balanced grant postings to the Tax treasury; this guide creates no reserve budget or money. The new baseline and seasonal budget still require configuration.'],headers:['Instrument / flow','Purpose','Availability'],rows:[['Economic snapshot · ECO-SNAP','Sealed observation, baseline, policy version, index and rates; immutable payload hash','Implemented archival instrument; automatic collection is not connected'],['Reserve grant','Existing owner-controlled issuance to the Tax treasury, recorded in both ledgers','Existing restricted bank flow; no public redeemable reserve key'],['Policy / baseline change','Versioned configuration followed by a new observation','Requires a reviewed implementation or supported dev batch; no invented player code'],['Developer batch instrument','Exact manifest, server identity, short expiry, once-only action and audit receipt','Server/CLI only; never a website generator, download or player entitlement'],['Rihla instrument · RIA','Account-bound transfer reference, parties, amount and state','Private website register; in-game execution pending'],['News record · NEWS','Sealed public fact linked to its source and article','Gazette backend batch; not a redeemable reward']]},
{id:'reserve-instruments',title:'Federal Reserve & J.A.R.V.I.S. instruments',art:'imperial-postbank-v2.png',paragraphs:['An instrument records a purpose and authority; knowing a reference is not permission. Public references never disclose secret codes. These are fictional game-economy instruments, not real-world securities.','Reserve issuance is restricted to the designated reserve owner and existing administration checks. It uses balanced grant postings to the Tax treasury; this guide creates no reserve budget or money. The new baseline and seasonal budget still require configuration.'],headers:['Instrument / flow','Purpose','Availability'],rows:[['Economic snapshot · ECO-SNAP','Sealed observation, baseline, policy version, index and rates; immutable payload hash','Implemented archival instrument; automatic collection is not connected'],['Reserve grant','Existing owner-controlled issuance to the Tax treasury, recorded in both ledgers','Existing restricted bank flow; no public redeemable reserve key'],['Policy / baseline change','Versioned configuration followed by a new observation','Requires a reviewed implementation or supported dev batch; no invented player code'],['Developer batch instrument','Exact manifest, server identity, short expiry, once-only action and audit receipt','Server/CLI only; never a website generator, download or player entitlement'],['Rihla instrument · RIA','Account-bound transfer reference, parties, amount and state','Private website register; in-game execution pending'],['News record · NEWS','Sealed public fact linked to its source and article','Gazette backend batch; not a redeemable reward']]},
{id:'economy-formulas',title:'Economic formulas & limits',art:'imperial-postbank-v2.png',paragraphs:['Calculation policy v'+p.version+'. Formula support is implemented; automatic price, savings-interest, lending-rate and wage adjustments are not enabled by publishing this guide. Existing accepted loans keep their contracted rates. Player-set listing prices are not silently rewritten.','M = verified circulating DM; M0 = a strictly positive approved baseline. E is an index, not a direct annual inflation percentage. Unfunded issuance positions and system reserves must be classified by the approved collector; issued minus returned alone is not a complete inflation measure.'],headers:['Calculation','Formula','Limits / meaning'],rows:[['Money index','E = (M / M0)^'+p.moneyExponent,'M0 > 0; a fresh baseline starts at E = 1'],['Demand factor','D = ((sold + '+p.demandSmoothing+') / (offered + '+p.demandSmoothing+'))^'+p.demandExponent,'Verified counts; smoothing avoids empty-market division'],['System price target','target = clamp(base price × E × D, 0.5 × base, 2 × base)','System catalogue prices only; quote policy/version must be stored'],['Published system price','clamp(target, 0.95 × previous, 1.05 × previous)','Maximum ±5% per daily step; round in cents within bounds'],['Savings rate','S = clamp(round(S0 + 500 × (E − 1)), Smin, Smax)','Basis points; +5 percentage points per +1 index unit. Base and bounds require configuration'],['New lending rate','L = clamp(round(L0 + 1000 × (E − 1)), Lmin, Lmax)','Basis points; +10 percentage points per +1 index unit. Existing contracts unchanged'],['Indexed staff wage','target = base wage × E; next = clamp(target, 0.95 × previous, 1.05 × previous)','Maximum ±5% per monthly step; use P&O approved wages'],['Tax-inclusive price','gross = net + applicable tax','Only when that transaction implements the relevant tax rule']]},
{id:'payroll-formulas',title:'Payroll calculation',art:'nav-staff-v2.webp',paragraphs:['All amounts use integer DM cents. Contribution and tax calculations round to the nearest cent using the existing payroll model. This is a fictional game model with selected Belgian-inspired parameters; household deductions and real-world tax advice are outside its scope.'],headers:['Step','Calculation'],rows:[['Employee contribution','round(gross monthly × employee social rate)'],['Monthly taxable pay','gross monthly − employee contribution'],['Annual progressive tax','Apply the configured marginal bands to 12 × monthly taxable pay'],['Basic allowance credit','Apply the same tax bands to the annual basic allowance; subtract this credit from annual tax, floor at zero'],['Monthly income tax','round(max(annual tax − allowance credit, 0) / 12)'],['Net wage','gross monthly − employee contribution − monthly income tax'],['Employer cost','gross monthly + round(gross monthly × employer social rate)'],['Tax treasury receipt','employee contribution + monthly income tax + employer contribution']]},
...Object.entries(CLAIM_ORGANISATIONS).map(([kind,group])=>({id:'guide-claims-'+kind,title:group.name+' · claim schedule',paragraphs:['Capacity and price schedule; the published guide does not itself reserve land, upgrade a deed or enable recurring billing.'],headers:['Tier','Chunks','Monthly','Unlock'],rows:claimTariffs(kind).map(r=>[r.code,String(r.chunks),claimMoney(r.upkeepMinor),claimMoney(r.unlockMinor)])}))

View file

@ -1,3 +1,3 @@
import test from 'node:test';import assert from 'node:assert/strict';import {companyFixture} from './company-deed-fixture.mjs';import {reconcileCrysknifeCompany,CRYSKNIFE_COMPANY_ID} from '../node/crysknife-company.mjs';import {readCompanyDeed,companyDeedView} from '../node/company-deeds.mjs';
test('protected Crysknife Order uses memorial ownership, a consumed Royal staff key and temporary Unicorp parent control; rank membership reconciles without changing personal companies',async()=>{const f=await companyFixture();const central={query:f.db.query.bind(f.db),prepare:f.db.prepare.bind(f.db),transaction:f.db.transaction.bind(f.db)};assert.equal(central.first,undefined);try{f.db.sqlite.exec('CREATE TABLE cp_account_ranks(user_id TEXT,rank_key TEXT)');const parent=await f.create();await f.db.query("UPDATE corrino_companies SET slug='uni' WHERE id=?",[parent]);await f.db.query("UPDATE site_company_deeds SET charter_kind='royal' WHERE company_id=?",[parent]);await f.db.query("UPDATE site_accounts SET username='unimatrix999' WHERE id=?",[f.people.Owner.id]);await f.db.query("INSERT INTO site_memorials(slug,user_id) VALUES('patrick-stewart',?)",[f.people.Ceo.id]);await f.db.query("INSERT INTO cp_account_ranks VALUES(?,'crysknife')",[f.people.Member.id]);await reconcileCrysknifeCompany(central,f.keys);await reconcileCrysknifeCompany(central,f.keys);const deed=await readCompanyDeed(f.db,CRYSKNIFE_COMPANY_ID);assert.equal(deed.company.charter_kind,'royal');assert.equal(deed.company.owner_account_id,f.people.Ceo.id);assert.equal(deed.members.length,2);assert.equal(companyDeedView(deed,f.people.Owner.id).canManage,true);assert.equal((await f.db.first('SELECT COUNT(*) n FROM site_company_relations WHERE company_id=?',[CRYSKNIFE_COMPANY_ID])).n,1);await f.db.query('DELETE FROM cp_account_ranks');await reconcileCrysknifeCompany(central,f.keys);assert.equal((await readCompanyDeed(f.db,CRYSKNIFE_COMPANY_ID)).members.length,1);}finally{f.db.close();}});
test('protected Crysknife Order uses memorial ownership, a consumed Royal staff key and temporary Unicorp parent control; rank membership reconciles without changing personal companies',async()=>{const f=await companyFixture();const central={query:f.db.query.bind(f.db),prepare:f.db.prepare.bind(f.db),transaction:f.db.transaction.bind(f.db)};assert.equal(central.first,undefined);try{f.db.sqlite.exec('CREATE TABLE cp_account_ranks(user_id TEXT,rank_key TEXT)');const parent=await f.create();await f.db.query("UPDATE corrino_companies SET slug='uni' WHERE id=?",[parent]);await f.db.query("UPDATE site_company_deeds SET charter_kind='royal' WHERE company_id=?",[parent]);await f.db.query("UPDATE site_accounts SET username='unimatrix999' WHERE id=?",[f.people.Owner.id]);await f.db.query("INSERT INTO site_memorials(slug,user_id) VALUES('patrick-stewart',?)",[f.people.Ceo.id]);await f.db.query("INSERT INTO cp_account_ranks VALUES(?,'crysknife')",[f.people.Member.id]);await reconcileCrysknifeCompany(central,f.keys);await reconcileCrysknifeCompany(central,f.keys);const deed=await readCompanyDeed(f.db,CRYSKNIFE_COMPANY_ID);assert.equal(deed.company.charter_kind,'royal');assert.equal(deed.company.owner_account_id,f.people.Ceo.id);assert.equal(deed.members.length,2);assert.equal(companyDeedView(deed,f.people.Owner.id).canManage,true);assert.equal((await f.db.first('SELECT COUNT(*) n FROM site_company_relations WHERE company_id=?',[CRYSKNIFE_COMPANY_ID])).n,1);await f.db.query("UPDATE site_company_deeds SET charter_kind='basic' WHERE company_id=?",[parent]);await f.db.query("DELETE FROM site_company_relations WHERE company_id=?",[CRYSKNIFE_COMPANY_ID]);await f.db.query('DELETE FROM cp_account_ranks');await reconcileCrysknifeCompany(central,f.keys);assert.equal((await readCompanyDeed(f.db,CRYSKNIFE_COMPANY_ID)).members.length,1);assert.equal((await f.db.first('SELECT COUNT(*) n FROM site_company_relations WHERE company_id=?',[CRYSKNIFE_COMPANY_ID])).n,0);}finally{f.db.close();}});

View file

@ -3,3 +3,6 @@
/* Complete public register: the same framed dev style as the CP. */
.hero{background:linear-gradient(90deg,#102d27f2,#102d27b0),url('/assets/minecraft-hero.webp') center/cover}.reference-section,.claim-rates,#packages,#credit,#services,#rihla,#payroll-tax{padding:28px;border:1px solid #8f7945;border-radius:16px;background:linear-gradient(125deg,#203e31ee,#10291fee)}.reference-heading{display:flex;align-items:center;gap:20px;padding:18px;border:1px solid #8d7546;border-radius:12px;background:linear-gradient(90deg,#122e24f0,#122e24bd),url('/assets/minecraft-hero.webp') center/cover;margin-bottom:20px}.reference-heading img{width:76px;height:76px;object-fit:contain}#economy-formulas td:nth-child(2),#payroll-formulas td:nth-child(2){font-family:ui-monospace,monospace;font-size:13px}.document{flex-wrap:wrap;background:#17372b}.document-actions{display:flex;flex-direction:column;gap:12px}.pdf-download{display:inline-block;padding:14px 20px;border:1px solid #dbb763;border-radius:9px;text-decoration:none;background:linear-gradient(#3d5b38,#1c392b);color:#ffe7aa;font-weight:bold}.guide-download{box-shadow:inset 0 0 0 2px #112c1f,0 3px 12px #0003}.sections a{display:flex;align-items:center;justify-content:center;font-size:13px}.reference-section p{max-width:100ch}.table-wrap:focus-visible,.pdf-download:focus-visible{outline:3px solid #f4d681;outline-offset:3px}@media(max-width:650px){.reference-section,.claim-rates,#packages,#credit,#services,#rihla,#payroll-tax{padding:16px}.reference-heading{padding:12px;gap:12px}.reference-heading img{width:48px;height:48px}.reference-heading h2{font-size:25px}.document-actions,.pdf-download{width:100%}}@media print{.reference-section,.claim-rates,#packages,#credit,#services,#rihla,#payroll-tax{background:white;border-color:#98885d;padding:12px;break-inside:auto}.reference-heading{background:white}.reference-heading img{width:40px;height:40px}.pdf-download,.document-actions{display:none}tr{break-inside:avoid}}
/* Compact handbook download, with publication and source dates kept distinct. */
.document{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 32px;padding:26px 28px;align-items:center}.document>div:first-child{min-width:0}.document h2{font-size:28px;margin:6px 0}.document p{margin:6px 0;overflow-wrap:anywhere}.document-actions{align-items:flex-start;gap:8px}.document-actions .fine{margin:0}.snapshot-download{font-size:12px;text-underline-offset:3px}.document-status{grid-column:1/-1;border-top:1px solid #59765966;padding-top:10px}.document .eyebrow{font-size:10px}@media(max-width:700px){.document{grid-template-columns:1fr;padding:22px}.document-actions{width:100%}.document .pdf-download{text-align:center}}

View file

@ -3,7 +3,7 @@
const origin='https://cp.dunerealms.com',money=n=>(Number(n)/100).toFixed(2)+' DM',percent=n=>(Number(n)/100).toFixed(2)+'%';
const el=(tag,text)=>{const node=document.createElement(tag);if(text!==undefined)node.textContent=text;return node;};
async function load(){
const documentBox=document.querySelector('.document'),status=el('p','Loading the current public tariff publication…');documentBox?.append(status);
const documentBox=document.querySelector('.document'),status=el('p','Loading the current public tariff publication…');status.className='fine document-status';status.setAttribute('role','status');documentBox?.append(status);
try{
const response=await fetch(origin+'/api/bank/public/rates',{credentials:'omit',cache:'no-store'});if(!response.ok)throw Error('Current publication unavailable.');const data=await response.json();
document.querySelector('.stamp').textContent='PUBLIC TARIFF REGISTER · '+new Date(data.publishedAt).toLocaleDateString('en-GB',{timeZone:'Europe/Brussels'});
@ -15,10 +15,13 @@
const wrap=el('div');wrap.className='table-wrap';const table=el('table'),head=el('thead'),header=el('tr'),body=el('tbody');for(const text of ['Annual taxable income','Tax rate'])header.append(el('th',text));head.append(header);let lower=0;
for(const band of data.payrollTax.bands){const row=el('tr');row.append(el('td',band.upToMinor===null?'Above '+money(lower):money(lower)+'–'+money(band.upToMinor)),el('td',percent(band.bps)));body.append(row);lower=band.upToMinor;}
table.append(head,body);wrap.append(table);section.append(wrap,el('p','Fictional game payroll using selected Belgian-inspired parameters. The basic allowance is a tax credit; individual salaries remain private.'));documentBox.before(section);
const description=documentBox.querySelector('div');if(description){description.replaceChildren(el('h2','Download the public tariff guide'),el('p','Publication '+data.version+' · '+new Date(data.publishedAt).toLocaleString('en-GB',{timeZone:'Europe/Brussels'})),el('p','The complete handbook includes the policy reference and claim schedules. The bank-only PDF preserves its own immutable publication. Accepted contracts retain their agreed terms.'));}
status.textContent=data.pdfReady?'Bank publication verified.':'The bank publication PDF is being prepared.';
try{const manifest=await (await fetch('/downloads/rates-guide-manifest.json',{cache:'no-store',credentials:'omit'})).json();if(manifest.sourcePublicationVersion!==data.version)status.textContent+=' The expanded handbook uses an earlier financial snapshot; current bank figures above take precedence.';else status.textContent+=' Expanded handbook financial source matches this register.';}catch{status.textContent+=' Handbook source check unavailable.';}
if(data.pdfReady){const link=el('a','Download Rates & Charges PDF');link.href=origin+data.pdfUrl;link.className='pdf-download';link.textContent='Bank rates snapshot · PDF';documentBox.append(link);}
const date=value=>new Date(value).toLocaleDateString('en-GB',{timeZone:'Europe/Brussels'});
const description=documentBox.querySelector('div');if(description){description.replaceChildren(el('span','IMPERIAL POSTBANK · PUBLIC HANDBOOK'),el('h2','Rates & Charges'),el('p','Banking tariffs, tax rules and the realm economy in one reference guide.'));description.firstChild.className='eyebrow';}
const actions=documentBox.querySelector('.document-actions'),edition=actions?.querySelector('.fine');
status.textContent='Bank tariffs dated '+date(data.publishedAt)+'.';
try{const manifest=await (await fetch('/downloads/rates-guide-manifest.json',{cache:'no-store',credentials:'omit'})).json();if(edition)edition.textContent='Version '+manifest.edition.replace(/^alpha-/,'Alpha ').replace(/-\d{8}$/,'')+' · Published '+date(manifest.publishedAt);if(manifest.sourcePublicationVersion!==data.version)status.textContent+=' The handbook uses an earlier bank snapshot; current figures above take precedence.';}catch{status.textContent+=' Handbook publication details could not be verified.';}
if(data.pdfReady){const link=el('a','Bank tariff snapshot · PDF');link.href=origin+data.pdfUrl;link.className='snapshot-download';actions?.append(link);}
}catch{status.textContent='Live publication unavailable. Catalogue reference prices are shown; retry before relying on a changed tariff.';}
}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',load,{once:true});else void load();

File diff suppressed because one or more lines are too long