(() => { const I = new PreservesSchema.SchemaInterpreter(); globalThis.Schema = { __interpreter: I }; let schemaReady; globalThis.SchemaReady = new Promise(res => schemaReady = res); async function translateScripts() { const schemaScripts = Array.from(document.getElementsByTagName('script')) .filter(s => (s.type === 'text/preserves+schema' || s.type === 'schema')); for (const script of schemaScripts) { function complain(message, detail) { const e = new Error(message); e.script = script; e.detail = detail; console.error(e); } let sourceCodeBlob; const sourceUrl = script.src || script.getAttribute('data-src') || false; if (sourceUrl) { const res = await fetch(sourceUrl); if (res.ok) { sourceCodeBlob = new Uint8Array(await res.arrayBuffer()); } else { complain(`Failed to retrieve schema from ${sourceUrl}`, { res }); continue; } } else { sourceCodeBlob = new TextEncoder().encode(script.innerHTML); } const schemaName = () => { const n = script.getAttribute('name'); if (n === null) complain(`