mdld-parse 0.9.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +243 -262
  2. package/dist/index.js +1797 -1324
  3. package/package.json +5 -5
  4. package/dist/.nojekyll +0 -0
  5. package/dist/CNAME +0 -1
  6. package/dist/README.md +0 -431
  7. package/dist/docs/API.md +0 -435
  8. package/dist/docs/Architecture.md +0 -190
  9. package/dist/docs/Guide.md +0 -816
  10. package/dist/docs/LLM-MDLD-Inducer.md +0 -550
  11. package/dist/docs/LiterateRDF.md +0 -472
  12. package/dist/docs/Parser.md +0 -720
  13. package/dist/docs/Performance.md +0 -238
  14. package/dist/docs/Spec-render.md +0 -1439
  15. package/dist/docs/Subject.md +0 -180
  16. package/dist/docs/Syntax.md +0 -463
  17. package/dist/docs/TodoList.md +0 -215
  18. package/dist/docs/Use-Cases.md +0 -354
  19. package/dist/docs/guide-m.md +0 -56
  20. package/dist/docs/index.html +0 -108
  21. package/dist/docs/index.md +0 -56
  22. package/dist/docs/one-page.md +0 -322
  23. package/dist/docs/origin.md +0 -459
  24. package/dist/docs/polarity.md +0 -586
  25. package/dist/docs/primary-subject.md +0 -326
  26. package/dist/docs/statements.md +0 -226
  27. package/dist/docs/tokenization-performance-report.md +0 -164
  28. package/dist/examples/Cookbook.md +0 -32
  29. package/dist/examples/Status-SHACL.md +0 -31
  30. package/dist/examples/demo/index.md +0 -35
  31. package/dist/examples/demo/journal.md +0 -60
  32. package/dist/examples/demo/minimal.md +0 -23
  33. package/dist/examples/demo/project.md +0 -84
  34. package/dist/examples/demo/prov.md +0 -107
  35. package/dist/examples/demo/rdf.md +0 -69
  36. package/dist/examples/demo/recipe.md +0 -50
  37. package/dist/examples/demo/research.md +0 -84
  38. package/dist/examples/demo/shacl.md +0 -161
  39. package/dist/examples/demo/space-mission.md +0 -58
  40. package/dist/examples/demo/tasks.md +0 -175
  41. package/dist/examples/demo/xsd.md +0 -91
  42. package/dist/examples/dogfood.md +0 -288
  43. package/dist/examples/few-shot.md +0 -309
  44. package/dist/examples/graph/rdf-graph.html +0 -473
  45. package/dist/examples/graph/rdf_force_graph_web_component.html +0 -506
  46. package/dist/examples/index.md +0 -45
  47. package/dist/examples/llm-time-workflow.md +0 -173
  48. package/dist/examples/statements.md +0 -43
  49. package/dist/examples/workflow.md +0 -150
  50. package/dist/index.html +0 -3023
  51. package/dist/logo.svg +0 -7
  52. package/dist/spec/Spec-compact.md +0 -368
  53. package/dist/spec/Spec-ultra.md +0 -232
  54. package/dist/spec/Spec.md +0 -1116
  55. package/dist/spec/index.md +0 -46
package/dist/index.html DELETED
@@ -1,3023 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>MD-LD - Markdown Linked Data Parser</title>
8
- <meta name="description"
9
- content="MD-LD: Human-friendly RDF authoring format. Write semantic data in natural Markdown. Parse to RDF triples. Zero dependencies.">
10
-
11
- <script>
12
- // Enable dark mode detection - check system preference first
13
- const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
14
- if (isDarkMode) {
15
- document.documentElement.classList.add('dark')
16
- } else {
17
- document.documentElement.classList.remove('dark')
18
- }
19
-
20
- // Listen for system theme changes
21
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
22
- if (e.matches) {
23
- document.documentElement.classList.add('dark')
24
- } else {
25
- document.documentElement.classList.remove('dark')
26
- }
27
- })
28
- </script>
29
-
30
-
31
-
32
- <script type="module" crossorigin>var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r={"@vocab":`http://www.w3.org/2000/01/rdf-schema#`,rdf:`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,rdfs:`http://www.w3.org/2000/01/rdf-schema#`,xsd:`http://www.w3.org/2001/XMLSchema#`,sh:`http://www.w3.org/ns/shacl#`,prov:`http://www.w3.org/ns/prov#`},i=/^(https?|ftp|mailto|tag|nih|urn|uuid|did|web|ipfs|ipns|data|file|urn:uuid):/,a=/^(https?|ftp|mailto|tag|nih|urn|uuid|did|web|ipfs|ipns|data|file):/,o=class{constructor(e){this.id=e}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}},s=class extends o{constructor(e){super(e),this.termType=`NamedNode`,this.value=e}},c=class extends o{constructor(e){super(e),this.termType=`Literal`,this.value=``,this.language=``,this.datatype=null;let t=e.match(/^"([^"\\]*(?:\\.[^"\\]*)*)"(\^\^([^"]+))?(@([^-]+)(--(.+))?)?$/);t?(this.value=t[1].replace(/\\"/g,`"`).replace(/\\\\/g,`\\`),t[5]?(this.language=t[5],this.datatype=new s(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`)):t[3]?this.datatype=new s(t[3]):this.datatype=new s(`http://www.w3.org/2001/XMLSchema#string`)):(this.value=e.replace(/^"|"$/g,``),this.datatype=new s(`http://www.w3.org/2001/XMLSchema#string`))}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype?.value===e.datatype?.value}},l=class extends o{constructor(e){super(e||`b${Math.random().toString(36).slice(2,11)}`),this.termType=`BlankNode`,this.value=this.id}},u=class extends o{constructor(e){super(e),this.termType=`Variable`,this.value=e}},d=new class extends o{constructor(){super(``),this.termType=`DefaultGraph`,this.value=``}equals(e){return!!e&&this.termType===e.termType}},f=class extends o{constructor(e,t,n,r=d){super(`${e.id}|${t.id}|${n.id}|${r.id}`),this.termType=`Quad`,this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&this.termType===e.termType&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}toJSON(){return{termType:this.termType,subject:this.subject.toJSON?this.subject.toJSON():{termType:this.subject.termType,value:this.subject.value},predicate:this.predicate.toJSON?this.predicate.toJSON():{termType:this.predicate.termType,value:this.predicate.value},object:this.object.toJSON?this.object.toJSON():{termType:this.object.termType,value:this.object.value},graph:this.graph.toJSON?this.graph.toJSON():{termType:this.graph.termType,value:this.graph.value}}}},p={boolean:`http://www.w3.org/2001/XMLSchema#boolean`,integer:`http://www.w3.org/2001/XMLSchema#integer`,double:`http://www.w3.org/2001/XMLSchema#double`,string:`http://www.w3.org/2001/XMLSchema#string`},m={namedNode:e=>new s(e),blankNode:e=>new l(e),literal:(e,t)=>{let n=String(e).replace(/"/g,`\\"`);if(typeof t==`string`)return new c(`"${n}"@${t.toLowerCase()}`);if(t!==void 0&&!(`termType`in t)){let e=t.direction?`--${t.direction.toLowerCase()}`:``;return new c(`"${n}"@${t.language.toLowerCase()}${e}`)}let r=t?t.value:``;return r===``&&(typeof e==`boolean`?r=p.boolean:typeof e==`number`&&(Number.isFinite(e)?r=Number.isInteger(e)?p.integer:p.double:(r=p.double,Number.isNaN(e)||(e=e>0?`INF`:`-INF`)))),r===``||r===p.string?new c(`"${n}"`):new c(`"${n}"^^${r}`)},variable:e=>new u(e),defaultGraph:()=>d,quad:(e,t,n,r)=>new f(e,t,n,r),triple:(e,t,n,r)=>new f(e,t,n,r),fromTerm:e=>{if(e instanceof o)return e;switch(e.termType){case`NamedNode`:return new s(e.value);case`BlankNode`:return new l(e.value);case`Variable`:return new u(e.value);case`DefaultGraph`:return d;case`Literal`:let t=String(e.value).replace(/"/g,`\\"`);return e.language?new c(`"${t}"@${e.language}`):e.datatype?new c(`"${t}"^^${e.datatype.value||e.datatype}`):new c(`"${t}"`);case`Quad`:return m.fromQuad(e);default:throw Error(`Unexpected termType: ${e.termType}`)}},fromQuad:e=>{if(e instanceof f)return e;if(e.termType!==`Quad`){if(e.subject&&e.predicate&&e.object)return new f(m.fromTerm(e.subject),m.fromTerm(e.predicate),m.fromTerm(e.object),m.fromTerm(e.graph||m.defaultGraph()));throw Error(`Unexpected termType: ${e.termType}`)}return new f(m.fromTerm(e.subject),m.fromTerm(e.predicate),m.fromTerm(e.object),m.fromTerm(e.graph))}};function h(e,t){if(!e||!t||!t.quadIndex)return null;let n=C(e);return n&&t.quadIndex.get(n)||null}function g(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return Math.abs(t).toString(16).slice(0,12)}var _=new Map;function v(e,t){if(e==null)return null;let n=`${e}|${t[`@vocab`]||``}|${Object.keys(t).filter(e=>e!==`@vocab`).sort().map(e=>`${e}:${t[e]}`).join(`,`)}`;if(_.has(n))return _.get(n);let r=(typeof e==`string`?e:typeof e==`object`&&typeof e.value==`string`?e.value:String(e)).trim(),a;if(r.match(i))a=r;else if(r.includes(`:`)){let[e,n]=r.split(`:`,2);e&&!t[e]&&e!==`@vocab`&&console.warn(`Undefined prefix "${e}" in IRI "${r}" - treating as literal`),a=t[e]?t[e]+n:r}else a=(t[`@vocab`]||``)+r;return _.set(n,a),a}function y(e,t){if(!e||!a.test(e))return e;if(t[`@vocab`]&&e.startsWith(t[`@vocab`]))return e.substring(t[`@vocab`].length);for(let[n,r]of Object.entries(t))if(n!==`@vocab`&&e.startsWith(r)&&Object.entries(t).filter(([t,n])=>t!==`@vocab`&&e.startsWith(n)).every(([e,t])=>r.length>=t.length||e===n&&t.length===r.length))return n+`:`+e.substring(r.length);return e}var b={"=#":{kind:`fragment`,extract:e=>e.substring(2).replace(`}`,``)},"+#":{kind:`softFragment`,extract:e=>e.substring(2).replace(`}`,``)},"+":{kind:`object`,extract:e=>e.substring(1)},"^^":{kind:`datatype`,extract:e=>e.substring(2)},"@":{kind:`language`,extract:e=>e.substring(1)},".":{kind:`type`,extract:e=>e.substring(1)},"!":{kind:`property`,form:`!`,extract:e=>e.substring(1)},"?":{kind:`property`,form:`?`,extract:e=>e.substring(1)}};function x(e){try{let t=String(e||``).trim().replace(/^\{|\}$/g,``).trim();if(!t)return{subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]};let n={subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]},r=/\S+/g,i;for(;(i=r.exec(t))!==null;){let e=i[0],t=1+i.index,r=t+e.length,a=n.entries.length,o=!1;if(e.startsWith(`-`)&&e.length>1&&(o=!0,e=e.slice(1)),e===`=`){o&&console.warn(`-= is not valid, subject declarations have no polarity`),n.subject=`RESET`,n.entries.push({kind:`subjectReset`,relRange:{start:t,end:r},raw:e});continue}if(e.startsWith(`=`)&&!e.startsWith(`=#`)){o&&console.warn(`-= is not valid, subject declarations have no polarity`);let i=e.substring(1);n.subject=i,n.entries.push({kind:`subject`,iri:i,relRange:{start:t,end:r},raw:e});continue}let s=!1;for(let[c,l]of Object.entries(b))if(e.startsWith(c)){let c={kind:l.kind,relRange:{start:t,end:r},raw:i[0]},u=l.extract(e);l.kind===`fragment`?(n.subject=`=#${u}`,c.fragment=u):l.kind===`softFragment`?(n.object=`#${u}`,c.fragment=u):l.kind===`object`?(o&&=(console.warn(`-+ is not valid, object declarations have no polarity`),!1),n.object=u,c.iri=u):l.kind===`datatype`?(o&&=(console.warn(`-^^ is not valid, datatype modifiers have no polarity`),!1),n.language||(n.datatype=u),c.datatype=u):l.kind===`language`?(o&&=(console.warn(`-@ is not valid, language modifiers have no polarity`),!1),n.language=u,n.datatype=null,c.language=u):l.kind===`type`?(n.types.push({iri:u,entryIndex:a,remove:o}),c.iri=u,c.remove=o):l.kind===`property`&&(n.predicates.push({iri:u,form:l.form,entryIndex:a,remove:o}),c.iri=u,c.form=l.form,c.remove=o),n.entries.push(c),s=!0;break}s||(n.predicates.push({iri:e,form:``,entryIndex:a,remove:o}),n.entries.push({kind:`property`,iri:e,form:``,relRange:{start:t,end:r},raw:i[0],remove:o}))}return n}catch(t){return console.error(`Error parsing semantic block ${e}:`,t),{subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]}}}function S(e,t,n){let r=n.termType===`Literal`?JSON.stringify({t:`Literal`,v:n.value,lang:n.language||``,dt:n.datatype?.value||``}):JSON.stringify({t:n.termType,v:n.value});return JSON.stringify([e.value,t.value,r])}function C(e){return e?S(e.subject,e.predicate,e.object):null}function w(e,t,n,r,i){return t?i.literal(e,i.namedNode(v(t,r))):n?i.literal(e,n):i.literal(e)}function T(e){if(e.length<3)return null;let t=e[0];if(t!=="`"&&t!==`~`)return null;let n=1;for(;n<e.length&&e[n]===t;)n++;if(n<3)return null;let r=e.slice(n).trimStart(),i=r.match(/^([^\s{]+)/),a=i?i[1]:``,o=r.match(/\{([^}]+)\}/),s=o?o[1]:null;return{fenceChar:t,fenceLength:n,lang:a,attrs:s,infoString:r}}function E(e){if(e[0]!==`[`)return null;let t=e.indexOf(`]`,1);if(t===-1)return null;let n=e.slice(1,t).trim();if(!n)return null;let r=t+1;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`<`)return null;let i=e.indexOf(`>`,r+1);if(i===-1)return null;let a=e.slice(r+1,i).trim();return a?{prefix:n,iri:a}:null}function D(e){if(e[0]!==`#`)return null;let t=1;for(;t<e.length&&t<6&&e[t]===`#`;)t++;if(t>=e.length||e[t]!==` `&&e[t]!==` `)return null;let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;let r=e.slice(n),i=r.match(/\s*\{([^}]+)\}\s*$/),a=r,o=null;return i&&(o=i[1],a=r.slice(0,-i[0].length).trim()),{depth:t,content:a,attrs:o}}function ee(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let n=t;if(t>=e.length)return null;let r=e[t],i,a=t+1;if(r===`-`||r===`*`||r===`+`)i=r;else if(r>=`0`&&r<=`9`){let n=t+1;for(;n<e.length&&e[n]>=`0`&&e[n]<=`9`;)n++;if(n>=e.length||e[n]!==`.`)return null;i=e.slice(t,n+1),a=n+1}else return null;if(a>=e.length||e[a]!==` `&&e[a]!==` `)return null;for(;a<e.length&&(e[a]===` `||e[a]===` `);)a++;let o=e.slice(a),s=null,c=o.match(/\s*\{([^}]+)\}\s*$/);return c&&(s=c[1],o=o.slice(0,-c[0].length).trim()),{indent:n,marker:i,content:o,attrs:s}}function O(e){if(e[0]!==`>`||e.length>1&&e[1]!==` `&&e[1]!==` `)return null;let t=1;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let n=e.slice(t),r=null,i=n.match(/\s*\{([^}]+)\}\s*$/);return i&&(r=i[1],n=n.slice(0,-i[0].length).trim()),{content:n,attrs:r}}function k(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`{`||(t++,t>=e.length||e[t]!==`=`))return null;t++;let n=t,r=1;for(;t<e.length&&r>0;)e[t]===`{`&&r++,e[t]===`}`&&r--,r>0&&t++;if(r>0)return null;let i=e.slice(n,t).trim();for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return t<e.length?null:{content:i}}function A(e,t,n=`[`,r=`]`){let i=1,a=t+1;for(;a<e.length&&i>0;)e[a]===n&&i++,e[a]===r&&i--,i>0&&a++;return i===0?a:null}function j(e,t){let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;if(n>=e.length||e[n]!==`{`)return null;let r=e.indexOf(`}`,n+1);return r===-1?null:{attrs:e.slice(n+1,r),endPos:r+1}}function M(e,t){if(e[t]!==`<`)return null;let n=e.indexOf(`>`,t+1);if(n===-1)return null;let r=e.slice(t+1,n).trim();return r.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:/)?{url:r,endPos:n+1}:null}function N(e,t){let n=e[t];if(n!==`*`&&n!==`_`)return null;let r=1;for(;t+r<e.length&&e[t+r]===n;)r++;if(r>2)return null;let i=r===1?`emphasis`:`strong`,a=n.repeat(r),o=t+r,s=o;for(;s<e.length;){if(e.slice(s,s+r)===a){if(s+r<e.length&&e[s+r]===n){s++;continue}let t=e.slice(o,s),a=s+r,c=j(e,a),l=c?c.endPos:a;return{type:i,content:t,attrs:c?.attrs||null,endPos:l,contentEnd:a}}s++}return null}function P(e,t){if(e[t]!=="`")return null;let n=1;for(;t+n<e.length&&e[t+n]==="`";)n++;if(n>2)return null;let r="`".repeat(n),i=t+n,a=i;for(;a<e.length;){if(e.slice(a,a+n)===r){let t=e.slice(i,a),r=a+n,o=j(e,r),s=o?o.endPos:r;return{type:`code`,content:t,attrs:o?.attrs||null,endPos:s,contentEnd:r}}a++}return null}function te(e,t){if(e[t]!==`[`)return null;let n=A(e,t,`[`,`]`);if(!n)return null;let r=e.slice(t+1,n),i=n+1,a=null;if(i<e.length&&e[i]===`(`){let t=e.indexOf(`)`,i+1);t!==-1&&(a=e.slice(i+1,t),i=t+1)}else if(i<e.length&&e[i]===`<`){let t=e.indexOf(`>`,i+1);if(t!==-1){let n=e.slice(i+1,t).trim();n.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:/)&&(a=n,i=t+1)}}let o=j(e,i),s=o?o.endPos:i;return{type:a?`link`:`span`,text:r,url:a,attrs:o?.attrs||null,endPos:s,bracketEnd:n+1}}function F(e,t=0){let n=[],r=e.length,i=0;for(;i<r;){let r=e[i],a=null;switch(r){case`<`:if(a=M(e,i),a){let t=j(e,a.endPos);t&&(a.attrs=t.attrs,a.endPos=t.endPos),a.type=`link`,a.text=a.url}break;case`[`:a=te(e,i);break;case`*`:case`_`:a=N(e,i);break;case"`":a=P(e,i);break}if(!a){i++;continue}let o=a.url,s=a.type,c=a.attrs;if(o?.startsWith(`=`)||s===`link`&&!c&&!o){i=a.endPos;continue}let l=t+i,u=t+a.endPos,d=t+(a.contentEnd||a.bracketEnd||a.endPos),f={type:s,text:a.content===void 0?a.text===void 0?o:a.text:a.content,range:[l,u],valueRange:[l+ +(s===`url`),d-+(s===`url`)],attrs:c,url:o,pos:a.endPos};c&&(f.attrsRange=[d,u]),n.push(f),i=a.endPos}return n}var I=new Map;function ne(e){return I.has(e)||I.set(e,RegExp(`^(${e}{3,})`)),I.get(e)}function re(e,t,n,r,i){let a=r+(r<e.length&&e[r]===` `?1:e.slice(r).match(/^\s+/)?.[0]?.length||0);return{valueRange:[n+a,n+a+i],attrsRange:L(e,t,n)}}function L(e,t,n){if(!t)return null;let r=e.lastIndexOf(t);return r>=0?[n+r,n+r+t.length]:null}function R(e,t,n,r=null,i=null,a=null,o={}){let s={type:e,range:t,text:n,attrs:r,attrsRange:i,valueRange:a,...o};return Object.defineProperty(s,`_carriers`,{enumerable:!1,writable:!0,value:null}),s}function ie(e,t,n,r,i){let a=i[4]||null,o=re(t,a,n,i[1].length+(i[2]?i[2].length:0),i[3].length);return R(e,[n,r-1],i[3].trim(),a,o.attrsRange,o.valueRange,{indent:i[1].length})}var z={},ae=Object.freeze({predicates:[],types:[],subject:null});function oe(e){if(!e)return ae;let t=z[e];return t||(t=Object.freeze(x(e)),z[e]=t),t}function se(e){if(!e.text)return``;let t=e.text;e.attrsRange&&(t=t.substring(0,e.attrsRange[0]-(e.range?.[0]||0))+t.substring(e.attrsRange[1]-(e.range?.[0]||0)));let n=(e._carriers||[]).filter(e=>e.attrsRange).map(t=>t.attrsRange.map(t=>t-(e.range?.[0]||0))).filter(([e,n])=>e>=0&&n<=t.length).sort((e,t)=>t[0]-e[0]);for(let[e,r]of n)t=t.substring(0,e)+t.substring(r);switch(e.type){case`heading`:return t.replace(/^#+\s*/,``).trim();case`list`:return t.replace(/^[-*+]\s*/,``).trim();case`blockquote`:return t.replace(/^>\s*/,``).trim();default:return t.trim()}}function ce(e,t,n,r=null){return{blockId:e.id,range:e.range,carrierType:e.carrierType,subject:t.value,predicate:n.value,context:e.context,polarity:r?.remove?`-`:`+`,value:e.text||``}}function le(e,t,n){if(!t)return null;let r=t.value,i=r.indexOf(`#`),a=i>-1?r.slice(0,i):r;return n.namedNode(a+`#`+e)}function ue(e,t){return e.subject?e.subject===`RESET`?(t.currentSubject=null,null):e.subject.startsWith(`=#`)?le(e.subject.substring(2),t.currentSubject,t.df):t.df.namedNode(v(e.subject,t.ctx)):null}function de(e,t){return e.object?e.object.startsWith(`#`)?le(e.object.substring(1),t.currentSubject,t.df):t.df.namedNode(v(e.object,t.ctx)):null}function fe(e){return e?.termType===`Literal`}function pe(e){return e?.termType===`NamedNode`}function me(e){return e?.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`}function he(e,t){if(!e)return null;let n=y(e,t);return n.includes(`:`)?n.split(`:`)[0]:null}function ge(e,t){let n=new Set;for(let r of e.values())for(let e of r){let r=he(e.subject.value,t);r&&n.add(r);let i=he(e.predicate.value,t);if(i&&n.add(i),pe(e.object)){let r=he(e.object.value,t);r&&n.add(r)}if(e.object.datatype&&e.object.datatype.value){let r=he(e.object.datatype.value,t);r&&n.add(r)}}return n}function _e(e,t,n,r,i=[]){let a=r(e,t);t.currentBlock=a,t.blockStack.push(a.id),i.forEach(n=>n(e,t)),n(e,t,e.type),t.blockStack.pop(),t.currentBlock=t.blockStack.length>0?t.origin.blocks.get(t.blockStack[t.blockStack.length-1]):null}function B(e){return e.sort((e,t)=>e.predicate.value.localeCompare(t.predicate.value))}var ve=(e,t)=>`[${e}] <${t}>\n`;function V(e,t){let n=y(e.predicate.value,t);e.object.language?n+=` @${e.object.language}`:e.object.datatype.value!==`http://www.w3.org/2001/XMLSchema#string`&&(n+=` ^^${y(e.object.datatype.value,t)}`);let r=e.object.value||e.object,i=typeof r==`string`?r:String(r),a=e.object.datatype?.value||``;return i.includes(`
33
- `)?`~~~ {${n}}\n${i}\n~~~\n\n`:a.includes(`integer`)||a.includes(`decimal`)||a.includes(`double`)||a.includes(`float`)?`\`${i}\` {${n}}\n`:a.includes(`date`)||a.includes(`time`)?`*${i}* {${n}}\n`:a.includes(`boolean`)?`**${i}** {${n}}\n`:`[${i}] {${n}}\n`}var ye=(e,t,n=null)=>{let r=y(e.object.value,t),i=y(e.predicate.value,t);return`[${n&&n.has(e.object.value)?n.get(e.object.value):r}] {+${r} ?${i}}\n`};function be(e){let t=[],n=[],r=[];for(let i of e)me(i.predicate)?t.push(i):fe(i.object)?n.push(i):pe(i.object)&&r.push(i);return{types:t,literals:n,objects:r}}function H(e,t={}){let n=typeof e==`object`&&!!e&&`text`in e,i=n?e.text:e,a=n?{context:e.context,dataFactory:e.dataFactory,graph:e.graph}:t,o={ctx:{...r,...a.context||{}},df:a.dataFactory||m,graph:a.graph?m.namedNode(a.graph):m.defaultGraph(),quads:[],quadBuffer:new Map,removeSet:new Set,origin:{quadIndex:new Map,blocks:new Map,documentStructure:[]},currentSubject:null,primarySubject:null,primaryType:null,primaryLabel:null,tokens:null,currentTokenIndex:-1,statements:[],statementCandidates:new Map,currentBlock:null,blockStack:[]},s=Se(i);o.tokens=s.tokens;for(let e=0;e<o.tokens.length;e++){let t=o.tokens[e];if(o.currentTokenIndex=e,t.type===`prefix`){let e=t.iri;if(t.iri.includes(`:`)){let n=t.iri.indexOf(`:`),r=t.iri.substring(0,n),i=t.iri.substring(n+1);o.ctx[r]&&r!==`@vocab`&&(e=o.ctx[r]+i)}o.ctx[t.prefix]=e;continue}Le[t.type]?.(t,o)}let c=new Set;for(let e of o.quads)c.add(S(e.subject,e.predicate,e.object));let l=[];for(let e of o.removeSet){let t=S(e.subject,e.predicate,e.object);c.has(t)||l.push(e)}let u={subject:o.primarySubject,type:o.primaryType,label:o.primaryLabel,comment:o.primaryComment};return{quads:o.quads,remove:l,statements:o.statements,origin:o.origin,context:o.ctx,primarySubject:o.primarySubject,primary:u,md:s.md}}function xe(e){return e.type===`code`?[]:e._carriers||=Ce(e.text,e.range[0])}function Se(e){let t=[],n=[],r=e.split(`
34
- `),i=0,a=null,o=[{type:`fence`,test:e=>T(e.trim()),process:s},{type:`content`,test:()=>a,process:e=>a.content.push(e)},{type:`prefix`,test:e=>E(e),process:c},{type:`standalone`,test:e=>k(e),process:p},{type:`heading`,test:e=>D(e),process:l},{type:`list`,test:e=>ee(e),process:u},{type:`blockquote`,test:e=>O(e),process:d},{type:`para`,test:e=>e.trim(),process:f}];function s(e,r,i){let o=e.trim();if(a){let i=a.fence[0],s=i.repeat(a.fence.length),c=o.match(ne(i));if(c&&c[1]===s){let i=a.valueRangeStart,o=Math.max(i,r-1);t.push({type:`code`,range:[a.start,r],text:a.content.join(`
35
- `),lang:a.lang,attrs:a.attrs,attrsRange:a.attrsRange,valueRange:[i,o]});for(let e of a.content)n.push(e);a=null;let s=e.replace(/\r?\n.*$/,``);n.push(s)}}else{let t=T(o);if(!t)return!1;let i=t.attrs,s=i?e.indexOf(i):-1,c=r+e.length+1;a={fence:t.fenceChar.repeat(t.fenceLength),start:r,content:[],lang:t.lang,attrs:i,attrsRange:i&&s>=0?[r+s,r+s+i.length]:null,valueRangeStart:c};let l=e.replace(/\s*\{[^}]+\}\s*$/,``);n.push(l)}return!0}function c(e,n,r){let i=E(e);return t.push({type:`prefix`,prefix:i.prefix,iri:i.iri}),!0}function l(e,r,i){let a=D(e),o=a.attrs,s=a.depth,c=re(e,o,r,s,a.content.length);t.push(R(`heading`,[r,i-1],a.content,o,c.attrsRange,c.valueRange,{depth:a.depth}));let l=`${`#`.repeat(a.depth)} ${a.content}`;return n.push(l),!0}function u(e,r,i){let a=ee(e),o=` `.repeat(a.indent),s=[e,o,a.marker,a.content,a.attrs];t.push(ie(`list`,e,r,i,s));let c=`${o}${a.marker} ${a.content}`;return n.push(c),!0}function d(e,r,i){let a=O(e),o=a.attrs,s=e.startsWith(`> `)?2:e.indexOf(`>`)+1,c=s+a.content.length;t.push(R(`blockquote`,[r,i-1],a.content,o,L(e,o,r),[r+s,r+c]));let l=`> ${a.content}`;return n.push(l),!0}function f(e,r,i){t.push(R(`para`,[r,i-1],e.trim()));let a=e,o=F(a,0);for(let e of o)if(e.attrs&&(e.type===`emphasis`||e.type===`code`)){let t=a.substring(0,e.range[0]),n=a.substring(e.range[1]);a=t+(e.text||``)+n}return a=a.replace(/\[([^\]]+)\]\s*\{[^}]+\}/g,`$1`),a=a.replace(/\s*\{[^}]+\}\s*/g,` `),a=a.replace(/\s+/g,` `).trim(),n.push(a),!0}function p(e,n,r){return t.push({type:`standalone`,text:e.trim(),range:[n,r-1]}),!0}for(let e=0;e<r.length;e++){let t=r[e],n=i;i+=t.length+1;for(let e of o)if(e.test(t)&&e.process(t,n,i))break}return{tokens:t,md:n.join(`
36
- `)}}function Ce(e,t=0){return F(e,t)}function we(e,t){let n=e._blockId||g(`${e.type}:${e.range?.[0]}:${e.range?.[1]}`);e._blockId=n;let r=xe(e),i=se(e),a={id:n,type:e.type,range:e.range,text:i,subject:null,types:[],predicates:[],carriers:[],listLevel:e.indent||0,parentBlockId:t.blockStack.length>0?t.blockStack[t.blockStack.length-1]:null,quadKeys:[]};for(let e of r){let t={type:e.type,range:e.range,text:e.text,subject:null,predicates:[],sem:null};if(e.attrs){let n=oe(e.attrs);t.sem=n,t.predicates=n.predicates||[],t.subject=n.subject,t.types=n.types||[]}a.carriers.push(t)}return t.origin.blocks.set(n,a),t.origin.documentStructure.push(a),a}function Te(e,t,n,r){if(t.subject&&t.subject!==`RESET`){let n=ue(t,r);n&&(e.subject=n.value)}if(t.types&&t.types.length>0&&t.types.forEach(t=>{let n=v(typeof t==`string`?t:t.iri,r.ctx);e.types.includes(n)||e.types.push(n)}),t.predicates&&t.predicates.length>0&&t.predicates.forEach(t=>{let n={iri:v(t.iri,r.ctx),form:t.form||``,object:null};e.predicates.push(n)}),n){let t={type:n.type,range:n.range,text:n.text,subject:null,predicates:[]};if(n.attrs){let e=oe(n.attrs);t.sem=e,t.predicates=e.predicates||[],t.subject=e.subject,t.types=e.types||[]}e.carriers.push(t)}}function Ee(e,t,n,r={}){let{preserveGlobalSubject:i=!1,implicitSubject:a=null}=r;if(t.subject===`RESET`){n.currentSubject=null;return}let o=n.currentSubject,s=ue(t,n),c=de(t,n);s&&!n.primarySubject&&!t.subject.startsWith(`=#`)&&(n.primarySubject=s.value),s&&!i&&!a&&(n.currentSubject=s);let l=i?s||o:a||n.currentSubject;if(!l)return;let u=De(l.value,t.types,t.predicates,e.range,e.attrsRange||null,e.valueRange||null,e.type||null,n.ctx,e.text),d=w(e.text,t.datatype,t.language,n.ctx,n.df),f=e.url?n.df.namedNode(v(e.url,n.ctx)):null,p=s||f;n.currentBlock&&Te(n.currentBlock,t,e,n),je(t,s,c,f,l,u,n,e),Ne(t,s,o,c,p,l,d,u,n,e)}function De(e,t,n,r,i,a,o,s,c){let l={subject:e,types:t.map(e=>v(typeof e==`string`?e:e.iri,s)),predicates:n.map(e=>({iri:v(e.iri,s),form:e.form}))};return{id:g([e,o||`unknown`,l.types.join(`,`),l.predicates.map(e=>`${e.form}${e.iri}`).join(`,`)].join(`|`)),range:{start:r[0],end:r[1]},carrierType:o||null,subject:e,types:l.types,predicates:l.predicates,context:s,text:c||``}}function Oe(e,t,n,r,i,a,o,s,c,l=null,u=null,d=null,f=null){if(!a||!o||!s)return;let p=c.quad(a,o,s);if(l?.remove){let i=S(p.subject,p.predicate,p.object);if(t.has(i)){t.delete(i);let n=e.findIndex(e=>e.subject.value===p.subject.value&&e.predicate.value===p.predicate.value&&e.object.value===p.object.value);n!==-1&&e.splice(n,1),r.delete(i)}else n.add(p)}else{let n=S(p.subject,p.predicate,p.object);t.set(n,p),e.push(p),f&&(!f.primaryType&&o.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&(f.primaryType=s.value),!f.primaryLabel&&o.value===`http://www.w3.org/2000/01/rdf-schema#label`&&s.termType===`Literal`&&(f.primaryLabel=s.value),!f.primaryComment&&o.value===`http://www.w3.org/2000/01/rdf-schema#comment`&&s.termType===`Literal`&&(f.primaryComment=s.value)),ke(p,c,l,u,d);let m=ce(i,a,o,l);r.set(n,m),f.currentBlock&&i.id===f.currentBlock.id&&(f.currentBlock.quadKeys||(f.currentBlock.quadKeys=[]),f.currentBlock.quadKeys.push(n))}}function ke(e,t,n,r=null,i=null){if(!r||!i)return;let a=e.predicate.value;if(a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`)return;if(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&e.object.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement`){i.set(e.subject.value,{spo:{}});return}let o=i.get(e.subject.value);if(o&&(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`?o.spo.subject=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`?o.spo.predicate=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`&&(o.spo.object=e.object,o.objectQuad=e),o.spo.subject&&o.spo.predicate&&o.spo.object)){let n=t.quad(o.spo.subject,o.spo.predicate,o.spo.object);r.push(n),i.delete(e.subject.value)}}var Ae=(e,t,n,r,i=null)=>{let a=v(e,n.ctx),o=typeof i==`object`?i:{entryIndex:i,remove:!1};Oe(n.quads,n.quadBuffer,n.removeSet,n.origin.quadIndex,r,t,n.df.namedNode(v(`rdf:type`,n.ctx)),n.df.namedNode(a),n.df,{kind:`type`,token:`.${e}`,expandedType:a,entryIndex:o.entryIndex,remove:o.remove},n.statements,n.statementCandidates,n)};function je(e,t,n,r,i,a,o,s){e.types.forEach(e=>{Ae(typeof e==`string`?e:e.iri,t||n||r||i,o,a,typeof e==`string`?{entryIndex:null,remove:!1}:e)})}var Me=(e,t,n,r,i,a,o,s)=>{if(e.form===``&&t?.type===`link`&&t?.url&&t.text===t.url)return null;switch(e.form){case``:return n?{subject:i||o,object:s}:t?.type===`link`&&t?.url&&t.text!==t.url?{subject:a,object:s}:{subject:i||o,object:s};case`?`:return{subject:n?r:o,object:i||a};case`!`:return{subject:i||a,object:n?r:o};default:return null}};function Ne(e,t,n,r,i,a,o,s,c,l){e.predicates.forEach(e=>{let u=Me(e,l,t,n,r,i,a,o);if(u){let t=c.df.namedNode(v(e.iri,c.ctx));Oe(c.quads,c.quadBuffer,c.removeSet,c.origin.quadIndex,s,u.subject,t,u.object,c.df,{kind:`pred`,token:`${e.form}${e.iri}`,form:e.form,expandedPredicate:t.value,entryIndex:e.entryIndex,remove:e.remove||!1},c.statements,c.statementCandidates,c)}})}function Pe(e,t,n,r={}){Ee(e,t,n,r)}function Fe(e,t,n){if(e.attrs){let r=oe(e.attrs);Pe({type:n,text:e.text,range:e.range,attrsRange:e.attrsRange||null,valueRange:e.valueRange||null},r,t)}xe(e).forEach(e=>{e.attrs&&Pe(e,oe(e.attrs),t)})}function Ie(e,t){let n=k(e.text);if(!n)return;let r=oe(`{=${n.content}}`),i=e.range[0]+e.text.indexOf(`{=`);Pe({type:`standalone`,text:``,range:e.range,attrsRange:[i,i+(n.content?n.content.length:0)],valueRange:null},r,t)}var Le={heading:(e,t)=>_e(e,t,Fe,we),code:(e,t)=>_e(e,t,Fe,we),blockquote:(e,t)=>_e(e,t,Fe,we),para:(e,t)=>_e(e,t,Fe,we,[Ie]),list:(e,t)=>_e(e,t,Fe,we),standalone:(e,t)=>Ie(e,t)};function Re(e){return C(e)}function ze(e,t,n){return typeof e==`string`?H({text:e,...t,context:{...n,...t.context}}):e}function U(e,t={}){let n=new Map,i=new Set,a=[],o=new Map,s=[],c=new Map,l=[],u=[];for(let d=0;d<e.length;d++){let f=e[d],p=ze(f,t,{...r,...t.context});if(p.context)for(let[e,t]of Object.entries(p.context))!c.has(e)&&!r[e]&&c.set(e,t);let m={index:d,input:typeof f==`string`?`string`:`ParseResult`,origin:p.origin,context:p.context,statementsCount:p.statements?.length||0};a.push(m),p.statements&&p.statements.length>0&&s.push(...p.statements),p.primary&&(p.primary.subject||p.primary.type||p.primary.label)&&l.push(p.primary),p.primarySubject&&u.push(p.primarySubject);for(let e of p.quads){let t=Re(e);n.set(t,e);let r=p.origin.quadIndex.get(t);o.set(t,{...r||{},documentIndex:d,polarity:`+`})}for(let e of p.remove){let t=Re(e);n.has(t)?n.delete(t):i.add(e);let r=p.origin.quadIndex.get(t);o.set(t,{...r||{},documentIndex:d,polarity:`-`})}}let d=Array.from(n.values()),f=Array.from(i),p={documents:a,quadIndex:o},m={...r,...t.context,...Object.fromEntries(c)},h=new Set(d.map(Re)),g=new Set(f.map(Re));return{quads:d.filter(e=>!g.has(Re(e))),remove:f.filter(e=>!h.has(Re(e))),statements:s,origin:p,context:m,primarySubjects:u,primary:l}}var Be=new Map,Ve=1e3;function He(e,t){let n=`${e}|${JSON.stringify(t)}`;if(Be.has(n))return Be.get(n);let r=y(e,t);return Be.size>=Ve&&Array.from(Be.keys()).slice(0,Math.floor(Ve/2)).forEach(e=>Be.delete(e)),Be.set(n,r),r}function Ue(e,t={}){if(!e)return e;for(let[n,r]of Object.entries(t))if(e.startsWith(r)||e.startsWith(r.slice(0,-1)))return e.substring(r.length);for(let t of[`#`,`/`,`:`]){let n=e.lastIndexOf(t);if(n!==-1&&n<e.length-1)return e.substring(n+1)}return e}function We({quads:e,context:t={},primarySubject:n=null}){let i=Object.assign({},r,t),a=Ge(e),o=Ke(a),s=n;!s&&a.length>0&&(s=a[0].subject.value);let{text:c}=qe(o,i,s);return{text:c,context:i}}function Ge(e){return!e||e.length===0?[]:e.map(e=>e.subject.termType&&e.predicate.termType&&e.object.termType?e:{subject:m.fromTerm(e.subject),predicate:m.fromTerm(e.predicate),object:m.fromTerm(e.object)}).sort((e,t)=>{let n=e.subject.value.localeCompare(t.subject.value);if(n!==0)return n;let r=e.predicate.value.localeCompare(t.predicate.value);if(r!==0)return r;let i=(fe(e.object),e.object.value),a=(fe(t.object),t.object.value);return i.localeCompare(a)})}function Ke(e){let t=new Map;for(let n of e){let e=n.subject.value,r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function qe(e,t,n=null){let i=[],a=ge(e,t),o=Je(e),s=Object.entries(t).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of s)e!==`@vocab`&&!e.startsWith(`@`)&&!r[e]&&a.has(e)&&i.push(ve(e,t));s.length>0&&i.push(`
37
- `);let c=Array.from(e.keys()).sort(),l=n,u=l?[l,...c.filter(e=>e!==l)]:c;for(let n of u){let r=e.get(n);if(!r)continue;let a=He(n,t),{types:s,literals:c,objects:l}=be(r),u=o.has(n),d=u?o.get(n):Ue(n,t),f=s.length>0?s.map(e=>`.`+He(e.object.value,t)).sort().join(` `):``;u&&(f+=(f?` `:``)+`label`);let p=f?` `+f:``;i.push(`# ${d} {=${a}${p}}\n`);let m=u?o.get(n):null;B(c).forEach(e=>{e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`&&e.object.value===m||i.push(V(e,t))}),B(l).forEach(e=>{i.push(ye(e,t,o))}),i.push(`
38
- `)}return{text:i.join(``)}}function Je(e){let t=new Map;for(let n of e.values())for(let e of n)e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`&&e.object.termType===`Literal`&&t.set(e.subject.value,e.object.value);return t}function W(e){return String(e).replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#39;`)}var G={text:`#6b7280`,marker:`#f97316`,retraction:`#dc2626`,value:`#eab308`,annotation:`#4b5563`};function Ye(e,t){let n=t;for(;n<e.length&&e[n]!==`
39
- `&&e[n]!==`\r`;){if(e[n]===`{`)return!0;n++}return!1}function Xe(e,t){let n=e[t];if(n===`*`&&t+1<e.length&&e[t+1]===`*`){let n=e.indexOf(`**`,t+2);if(n!==-1){let r=e.slice(t+2,n),i=Ye(e,n+2)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>**</span><strong>${W(r)}</strong><span${i}>**</span>`,nextIndex:n+2}}}if(n===`_`&&t+1<e.length&&e[t+1]===`_`){let n=e.indexOf(`__`,t+2);if(n!==-1){let r=e.slice(t+2,n),i=Ye(e,n+2)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>__</span><strong>${W(r)}</strong><span${i}>__</span>`,nextIndex:n+2}}}if(n===`*`){let n=e.indexOf(`*`,t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>*</span><em>${W(r)}</em><span${i}>*</span>`,nextIndex:n+1}}}if(n===`_`){let n=e.indexOf(`_`,t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>_</span><em>${W(r)}</em><span${i}>_</span>`,nextIndex:n+1}}}if(n==="`"){let n=e.indexOf("`",t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>\`</span><code style="background-color:#7773">${W(r)}</code><span${i}>\`</span>`,nextIndex:n+1}}}return null}var Ze=new Map;function Qe(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t)}function $e(e){if(Ze.has(e))return Ze.get(e);let t=Qe(e),n=`hsl(${t%360}, ${15+t%10}%, ${45+t%10}%)`;return Ze.set(e,n),n}function et(e){let t=new Map,n=/^\[(\w+)\]\s*<([^>]*)>\s*$/gm,i;for(;(i=n.exec(e))!==null;){let e=i[1],n=i[2];if(n.includes(`:`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e),i=n.slice(e+1);t.has(r)&&(n=t.get(r)+i)}}t.set(e,n)}for(let[e,n]of Object.entries(r))e!==`@vocab`&&t.set(e,n);return t}function tt(e,t,n){let r=t?G.retraction:G.text,i=e.indexOf(`:`);if(i>0){let t=e.slice(0,i),r=e.slice(i+1);if(n.has(t)){let e=n.get(t),i=$e(e),a=e+r,o=$e(a);return`<span style="color: ${i}">${W(t)}</span><span style="color: ${G.marker}">:</span><span data-iri="${a}" style="color: ${o}">${W(r)}</span> `}}return e.startsWith(`http:`)||e.startsWith(`https:`)||e.startsWith(`tag:`)||e.startsWith(`urn:`)?`<span style="color: ${$e(e)}">${W(e)}</span> `:`<span style="color: ${r}">${W(e)}</span> `}function nt(e,t){let n=e.trim().split(/\s+/),r=``,i=!1;for(let e=0;e<n.length;e++){let a=n[e];if(!a)continue;if(a.startsWith(`=`)||a.startsWith(`+`)){let e=a[0],n=a.slice(1);r+=`<span style="color: ${G.marker}">${W(e)}</span>${tt(n,!1,t)}`;continue}if(a===`-`){i=!0,r+=`<span style="color: ${G.retraction}">${W(a)}</span> `;continue}if(a.startsWith(`-`)&&a.length>1){r+=`<span style="color: ${G.retraction}">${W(a)}</span> `;continue}let o=i;if(i=!1,a.startsWith(`?`)||a.startsWith(`!`)){let e=a[0],n=a.slice(1),i=o?G.retraction:G.marker;r+=`<span style="color: ${i}">${W(e)}</span>${tt(n,o,t)}`;continue}if(a.startsWith(`^^`)){let e=a.slice(2),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`^^`)}</span>${tt(e,o,t)}`;continue}if(a.startsWith(`@`)){let e=a.slice(1),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`@`)}</span>${tt(e,o,t)}`;continue}if(a.startsWith(`.`)){let e=a.slice(1),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`.`)}</span>${tt(e,o,t)}`;continue}r+=tt(a,o,t)}return r.trim()}function rt(e){let t=et(e),n=``,r=0;for(;r<e.length;){let i=e[r];if(i===`{`){let a=e.indexOf(`}`,r);if(a===-1){n+=W(i),r++;continue}let o=nt(e.slice(r+1,a),t);n+=`<span style="color: ${G.annotation}; opacity: 0.75">{</span>`,n+=o,n+=`<span style="color: ${G.annotation}; opacity: 0.75">}</span>`,r=a+1;continue}if(i===`[`){let a=e.indexOf(`]`,r);if(a===-1){n+=W(i),r++;continue}let o=e.slice(r+1,a),s=a+1;for(;s<e.length&&/\s/.test(e[s]);)s++;if(s<e.length&&e[s]===`<`){let i=e.indexOf(`>`,s);if(i!==-1){let a=e.slice(s+1,i),c=t.has(o)?$e(t.get(o)):G.text;n+=`<span style="color: ${G.annotation}; opacity: 0.75">[</span><span style="color: ${c}">${W(o)}</span><span style="color: ${G.annotation}; opacity: 0.75">]</span> <span style="color: ${G.text}; opacity: 0.6">&lt;${W(a)}&gt;</span>`,r=i+1;continue}}let c=e.slice(r+1,a),l=Ye(e,a+1)?G.marker:G.value,u=W(c);n+=`<span style="color: ${l}; opacity: 0.85">[</span><span style=" opacity: 1.0">${u}</span><span style="color: ${l}; opacity: 0.85">]</span>`,r=a+1;continue}if(i===`*`||i===`_`||i==="`"){let t=Xe(e,r);if(t){n+=t.html,r=t.nextIndex;continue}}if(i===`#`){let i=0,a=r;for(;a<e.length&&e[a]===`#`;)i++,a++;if(i<=6&&(a>=e.length||e[a]===` `||e[a]===` `)){let o=e.indexOf(`
40
- `,a),s=o===-1?e.length:o,c=e.slice(a,s).trim(),l=``,u=0,d=c.indexOf(`{`);for(;d!==-1;){let e=c.indexOf(`}`,d);if(e===-1)break;let n=c.slice(u,d);l+=W(n);let r=nt(c.slice(d+1,e),t);l+=`<span style="color: ${G.annotation}; opacity: 0.75">{</span>`+r+`<span style="color: ${G.annotation}; opacity: 0.75">}</span>`,u=e+1,d=c.indexOf(`{`,u)}l+=W(c.slice(u));let f=c.includes(`{`)&&c.includes(`}`),p=`h${i}`,m=`#`.repeat(i),h=f?`color: ${G.marker}; opacity: 0.8`:``;n+=`<${p} style="margin: 0; font-weight: 600;"><span style="${h}">${m}</span> ${l}</${p}>`,r=s;continue}}if(i===`-`||i===`*`){let t=r>0?e[r-1]:`
41
- `;if((t===`
42
- `||t===`\r`||t===` `||t===` `)&&e[r+1]===` `){let t=Ye(e,r+2)?`color: ${G.marker}; opacity: 0.85`:``;n+=`<span style="${t}">${W(i)}</span>`,r++;continue}}if(i===`>`){let t=r>0?e[r-1]:`
43
- `;if((t===`
44
- `||t===`\r`||t===` `||t===` `)&&e[r+1]===` `){let t=Ye(e,r+2)?`color: ${G.marker}; opacity: 0.85`:``;n+=`<span style="${t}">${W(i)}</span>`,r++;continue}}n+=W(i),r++}return n}function K(e,t){if(!e)throw Error(t)}function it(e,t,n,r){return e.find(e=>e.subject.value===t&&e.predicate.value===n&&(r===null||(e.object.termType,e.object.value===r)))}function q(e,t,n,r){return!!it(e,t,n,r)}var at=[{name:`Primary subject - first subject declaration`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
45
-
46
- # Document {=ex:doc .ex:Article label}
47
- [Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, got ${e}`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, got ${t.subject}`),K(t.type===`http://example.org/Article`,`Primary object type should be ex:Article, got ${t.type}`),K(t.label===`Document`,`Primary object label should be Document, got ${t.label}`)}},{name:`Primary subject - null when no subject declared`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[Alice] {label}`});K(e===null,`Primary subject should be null when no subject declared`),K(t!==null,`Primary object should exist even when no subject declared`),K(t.subject===null,`Primary object subject should be null when no subject declared`),K(t.type===null,`Primary object type should be null when no subject declared`),K(t.label===null,`Primary object label should be null when no label exists`)}},{name:`Primary subject - fragment does not become primary`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
48
-
49
- # Document {=ex:doc}
50
- {=#summary}
51
- [Content] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, not fragment`)}},{name:`Primary subject - reset does not clear primary`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
52
-
53
- # First {=ex:first}
54
- [Value] {label}
55
-
56
- # Reset {=}
57
-
58
- # Second {=ex:second}
59
- [Value] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/first`,`Primary subject should remain ex:first after reset, got ${e}`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/first`,`Primary object subject should be ex:first after reset, got ${t.subject}`)}},{name:`Primary subject - first non-fragment subject wins`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
60
-
61
- {=#summary}
62
- [Content] {label}
63
-
64
- # Document {=ex:doc}
65
- [Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, not fragment`)}},{name:`Primary subject - round-trip with generate()`,fn:()=>{let{quads:e,primarySubject:t,primary:n}=H({text:`[ex] <http://example.org/>
66
-
67
- # Document {=ex:doc .ex:Article label}
68
- [Alice] {ex:author}`}),r=We({quads:e,context:{ex:`http://example.org/`},primarySubject:t}),{primarySubject:i,primary:a}=H({text:r.text,context:r.context});K(t!==null,`Original should have primary subject`),K(n!==null,`Original should have primary object`),K(i!==null,`Regenerated should have primary subject`),K(a!==null,`Regenerated should have primary object`),K(t===i,`Primary subject should be preserved in round-trip: ${t} vs ${i}`),K(n.subject===a.subject,`Primary object subject should be preserved: ${n.subject} vs ${a.subject}`),K(n.type===a.type,`Primary object type should be preserved: ${n.type} vs ${a.type}`),K(n.label===a.label,`Primary object label should be preserved: ${n.label} vs ${a.label}`)}},{name:`Subject declaration sets context`,fn:()=>{let{quads:e,context:t}=H({text:`[ex] <http://example.org/>
69
- # Title {=ex:doc}
70
-
71
- [value] {label}`});K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`value`),`Subject should be ex:doc`)}},{name:`Subject reset with {=}`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
72
- # First {=ex:first}
73
-
74
- [value1] {label}
75
-
76
- # Reset {=}
77
-
78
- [value2] {label}`});K(e.length===1,`Should only emit 1 quad, got ${e.length}`),K(q(e,`http://example.org/first`,`http://www.w3.org/2000/01/rdf-schema#label`,`value1`),`Only first value should emit`)}},{name:`Type declaration emits rdf:type`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
79
- [schema] <http://schema.org/>
80
-
81
- # Doc {=ex:doc .schema:Article}`});K(q(e,`http://example.org/doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Article`),`Should emit type triple`)}},{name:`Multiple types on same subject`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
82
- [schema] <http://schema.org/>
83
-
84
- # Doc {=ex:doc .schema:Article .schema:CreativeWork}`});K(e.length===2,`Should emit 2 type triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Article`),`Should have Article type`),K(q(e,`http://example.org/doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/CreativeWork`),`Should have CreativeWork type`)}},{name:`Literal property: S → L (form p)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
85
-
86
- # Doc {=ex:doc}
87
-
88
- [Alice] {label}`}),t=it(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Alice`);K(t,`Should find name triple`),K(t.object.termType===`Literal`,`Object should be Literal`),K(t.object.value===`Alice`,`Value should be "Alice", got "${t.object.value}"`)}},{name:`Multiple literal properties`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
89
- [schema] <http://schema.org/>
90
-
91
- # Doc {=ex:doc}
92
-
93
- [Alice] {label schema:author}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Alice`),`Should have label`),K(q(e,`http://example.org/doc`,`http://schema.org/author`,`Alice`),`Should have author`)}},{name:`Object property: S → O (form ?p)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
94
- [schema] <http://schema.org/>
95
-
96
- # Doc {=ex:doc}
97
-
98
- [Alice] {=ex:alice ?schema:author}`}),t=it(e,`http://example.org/doc`,`http://schema.org/author`,`http://example.org/alice`);K(t,`Should find author triple`),K(t.object.termType===`NamedNode`,`Object should be NamedNode`),K(t.object.value===`http://example.org/alice`,`Object should be ex:alice`)}},{name:`Object property with resource declaration`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
99
- [schema] <http://schema.org/>
100
-
101
- # Doc {=ex:doc}
102
-
103
- [Alice] {=ex:alice ?schema:author .schema:Person}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://schema.org/author`,`http://example.org/alice`),`Should link to alice`),K(q(e,`http://example.org/alice`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Person`),`Alice should be Person`)}},{name:`Object property without O emits nothing`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
104
-
105
- # Doc {=ex:doc}
106
-
107
- [Alice] {?author}`});K(e.length===0,`Should emit 0 triples when O missing, got ${e.length}`)}},{name:`Reverse object property: O → S (form !p)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
108
- [schema] <http://schema.org/>
109
-
110
- # Doc {=ex:doc}
111
-
112
- [Parent] {=ex:parent !schema:hasPart}`}),t=it(e,`http://example.org/parent`,`http://schema.org/hasPart`,`http://example.org/doc`);K(t,`Should find reverse triple`),K(t.subject.value===`http://example.org/parent`,`Subject should be parent`),K(t.object.value===`http://example.org/doc`,`Object should be doc`)}},{name:`Datatype annotation (^^xsd:integer)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
113
- [schema] <http://schema.org/>
114
-
115
- # Doc {=ex:doc}
116
-
117
- [42] {schema:count ^^xsd:integer}`}),t=it(e,`http://example.org/doc`,`http://schema.org/count`,`42`);K(t,`Should find count triple`),K(t.object.datatype.value===`http://www.w3.org/2001/XMLSchema#integer`,`Datatype should be xsd:integer, got ${t.object.datatype.value}`)}},{name:`Language tag (@en)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
118
- [schema] <http://schema.org/>
119
-
120
- # Doc {=ex:doc}
121
-
122
- [Hello] {schema:greeting @en}`}),t=it(e,`http://example.org/doc`,`http://schema.org/greeting`,`Hello`);K(t,`Should find greeting triple`),K(t.object.language===`en`,`Language should be "en", got "${t.object.language}"`)}},{name:`Multiple datatypes (^^xsd:date, ^^xsd:decimal)`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
123
- [schema] <http://schema.org/>
124
-
125
- # Doc {=ex:doc}
126
-
127
- [2024-01-01] {schema:date ^^xsd:date}
128
- [19.99] {schema:price ^^xsd:decimal}`}),t=it(e,`http://example.org/doc`,`http://schema.org/date`,`2024-01-01`),n=it(e,`http://example.org/doc`,`http://schema.org/price`,`19.99`);K(t.object.datatype.value===`http://www.w3.org/2001/XMLSchema#date`,`Should be xsd:date`),K(n.object.datatype.value===`http://www.w3.org/2001/XMLSchema#decimal`,`Should be xsd:decimal`)}},{name:`Empty literal should still emit`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
129
-
130
- # Doc {=ex:doc}
131
-
132
- [] {label}`});K(e.length===1,`Should emit 1 quad, got ${e.length}`),K(it(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,``).object.value===``,`Empty literal should be empty string`)}},{name:`Literal with special characters`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
133
-
134
- # Doc {=ex:doc}
135
-
136
- [Hello "world"! @#$%] {label}`});K(it(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Hello "world"! @#$%`),`Should handle special characters`)}},{name:`Multiple predicates on same carrier`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
137
- [schema] <http://schema.org/>
138
-
139
- # Doc {=ex:doc}
140
-
141
- [Value] {label schema:description schema:author}`});K(e.length===3,`Should emit 3 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Value`),`Should have label`),K(q(e,`http://example.org/doc`,`http://schema.org/description`,`Value`),`Should have description`),K(q(e,`http://example.org/doc`,`http://schema.org/author`,`Value`),`Should have author`)}},{name:`Mixed datatype and language should prioritize language`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
142
-
143
- # Doc {=ex:doc}
144
-
145
- [Hello] {label @en ^^xsd:string}`}),t=it(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Hello`);K(t.object.language===`en`,`Should have language tag`),K(t.object.datatype.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`,`Should use langString datatype when language present`)}},{name:`Prefix declarations`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
146
-
147
- # Doc {=ex:doc}
148
-
149
- [value] {ex:property}`});K(q(e,`http://example.org/doc`,`http://example.org/property`,`value`),`Should use declared prefix`)}},{name:`Prefix folding - basic functionality`,fn:()=>{let{quads:e,context:t}=H({text:`[base] <https://example.com/>
150
- [doc] <base:document/>
151
- [auth] <base:author/>
152
-
153
- # Test {=doc:test1 auth:created}`});K(t.doc===`https://example.com/document/`,`Should fold prefix correctly`),K(t.auth===`https://example.com/author/`,`Should fold prefix correctly`),K(q(e,`https://example.com/document/test1`,`https://example.com/author/created`,`Test`),`Should use folded prefixes in quads`)}},{name:`Prefix folding - forward reference should be literal`,fn:()=>{let{context:e}=H({text:`[j] <my:journal:>
154
- [my] <tag:mymail@domain.com,2026:>
155
-
156
- # Test {=j:test}`});K(e.j===`my:journal:`,`Forward reference should be treated as literal`),K(e.my===`tag:mymail@domain.com,2026:`,`Base prefix should be set correctly`)}},{name:`Prefix folding - circular reference safety`,fn:()=>{let{context:e}=H({text:`[a] <b:test>
157
- [b] <a:test>
158
-
159
- # Test {=a:test}`});K(e.a===`b:test`,`Should handle circular reference safely`),K(e.b===`b:testtest`,`Should handle circular reference safely`)}},{name:`Prefix folding - redeclaration overrides`,fn:()=>{let{context:e}=H({text:`[my] <tag:mymail@domain.com,2026:>
160
- [my] <https://example.com/new/>
161
- [j] <my:journal:>
162
-
163
- # Test {=j:test}`});K(e.my===`https://example.com/new/`,`Redeclaration should override previous definition`),K(e.j===`https://example.com/new/journal:`,`Should use new base for folding`)}},{name:`Prefix folding - multi-level nesting`,fn:()=>{let{context:e,quads:t}=H({text:`[org] <https://org.example.com/>
164
- [person] <org:person/>
165
- [emp] <person:employee/>
166
- [dev] <emp:developer/>
167
-
168
- # Test {=dev:john emp:worksFor}`});K(e.org===`https://org.example.com/`,`Base level should work`),K(e.person===`https://org.example.com/person/`,`First level folding should work`),K(e.emp===`https://org.example.com/person/employee/`,`Second level folding should work`),K(e.dev===`https://org.example.com/person/employee/developer/`,`Third level folding should work`),K(q(t,`https://org.example.com/person/employee/developer/john`,`https://org.example.com/person/employee/worksFor`,`Test`),`Should use all folded prefixes correctly`)}},{name:`Prefix folding - invalid CURIE treated as literal`,fn:()=>{let{context:e}=H({text:`[my] <tag:me,2026:>
169
- [invalid] <nonexistent:prefix:>
170
-
171
- # Test {=invalid:test}`});K(e.my===`tag:me,2026:`,`Valid prefix should work`),K(e.invalid===`nonexistent:prefix:`,`Invalid CURIE should be treated as literal`)}},{name:`Multiple inline carriers in paragraph`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
172
- [schema] <http://schema.org/>
173
-
174
- # Doc {=ex:doc}
175
-
176
- Author is [Alice] {label} and [Bob] {schema:contributor}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Alice`),`Should have Alice`),K(q(e,`http://example.org/doc`,`http://schema.org/contributor`,`Bob`),`Should have Bob`)}},{name:`All inline carrier variants work correctly`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
177
- [@vocab] <http://example.org/>
178
-
179
- # Document {=ex:doc}
180
-
181
- [span] {spanName}
182
- *emphasis* {emphasisName}
183
- **strong** {strongName}
184
- _underline_ {underlineName}
185
- __double_underline__ {doubleUnderlineName}
186
- \`code\` {codeName}
187
- [link](http://example.com) {linkName}`});K(e.length===7,`Should emit 7 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://example.org/spanName`,`span`),`Should have span`),K(q(e,`http://example.org/doc`,`http://example.org/emphasisName`,`emphasis`),`Should have emphasis`),K(q(e,`http://example.org/doc`,`http://example.org/strongName`,`strong`),`Should have strong`),K(q(e,`http://example.org/doc`,`http://example.org/underlineName`,`underline`),`Should have underline`),K(q(e,`http://example.org/doc`,`http://example.org/doubleUnderlineName`,`double_underline`),`Should have double underline`),K(q(e,`http://example.org/doc`,`http://example.org/codeName`,`code`),`Should have code`),K(q(e,`http://example.com`,`http://example.org/linkName`,`link`),`Should have link attached to URL`)}},{name:`Multiple inline carriers on same line`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
188
- [@vocab] <http://example.org/>
189
-
190
- # Document {=ex:doc}
191
-
192
- [span] {spanName} *emphasis* {emphasisName} **strong** {strongName}`});K(e.length===3,`Should emit 3 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://example.org/spanName`,`span`),`Should have span`),K(q(e,`http://example.org/doc`,`http://example.org/emphasisName`,`emphasis`),`Should have emphasis`),K(q(e,`http://example.org/doc`,`http://example.org/strongName`,`strong`),`Should have strong`)}},{name:`Empty annotation emits nothing`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
193
-
194
- # Doc {=ex:doc}
195
-
196
- [value] {}`});K(e.length===0,`Empty annotation should emit nothing, got ${e.length}`)}},{name:`Annotation without subject emits nothing`,fn:()=>{let{quads:e}=H({text:`[value] {label}`});K(e.length===0,`No subject means no quads, got ${e.length}`)}},{name:`Plain paragraph without annotation is ignored`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
197
- [schema] <http://schema.org/>
198
-
199
- # Doc {=ex:doc}
200
-
201
- This is plain text.
202
-
203
- [value] {label}`});K(e.length===1,`Only annotated value should emit`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`value`),`Should have value`)}},{name:`Soft IRI declaration with ?predicate`,fn:()=>{let{quads:e}=H({text:`[schema] <http://schema.org/>
204
- [wd] <http://www.wikidata.org/entity/>
205
-
206
- # Apollo 11 {=wd:Q43653}
207
-
208
- Part of the [Apollo Program] {+wd:Q495307 ?schema:partOf}
209
- and launched on a [Saturn V] {+wd:Q193237 ?schema:vehicle}.`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://www.wikidata.org/entity/Q43653`,`http://schema.org/partOf`,`http://www.wikidata.org/entity/Q495307`),`Should use soft IRI as object for partOf`),K(q(e,`http://www.wikidata.org/entity/Q43653`,`http://schema.org/vehicle`,`http://www.wikidata.org/entity/Q193237`),`Should use soft IRI as object for vehicle`)}},{name:`Soft IRI with reverse predicate !p`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
210
- [schema] <http://schema.org/>
211
-
212
- # Document {=ex:doc}
213
-
214
- [Parent] {+ex:parent !schema:hasPart}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/parent`,`http://schema.org/hasPart`,`http://example.org/doc`),`Should create reverse relationship from soft IRI to subject`)}},{name:`Soft IRI with type declaration`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
215
- [schema] <http://schema.org/>
216
-
217
- # Project {=ex:project}
218
-
219
- [Team Lead] {+ex:alice ?schema:teamLead .schema:Person}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/project`,`http://schema.org/teamLead`,`http://example.org/alice`),`Should link project to alice`),K(q(e,`http://example.org/alice`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Person`),`Should declare alice as Person`)}},{name:`Fragment syntax uses current subject IRI base`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
220
-
221
- # Document {=ex:document}
222
-
223
- {=#summary}
224
- [This is the summary] {label}`});K(q(e,`http://example.org/document#summary`,`http://www.w3.org/2000/01/rdf-schema#label`,`This is the summary`),`Fragment should resolve to current subject + #fragment`)}},{name:`Fragment syntax with nested path segments`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
225
- [schema] <http://schema.org/>
226
-
227
- # Document {=ex:document}
228
-
229
- ## Section {=#section1}
230
- [Section content] {schema:headline}
231
-
232
- ## Subsection {=#subsection}
233
- [Content here] {label}`});K(q(e,`http://example.org/document#section1`,`http://schema.org/headline`,`Section content`),`Fragment should append to existing path`),K(q(e,`http://example.org/document#subsection`,`http://www.w3.org/2000/01/rdf-schema#label`,`Content here`),`Fragment should replace existing fragment, not nest`)}},{name:`Fragment syntax without current subject emits nothing`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
234
-
235
- {=#summary}
236
- [Content] {label}`});K(e.length===0,`Fragment without subject should emit nothing, got ${e.length}`)}},{name:`Malformed annotation should be ignored`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
237
-
238
- # Doc {=ex:doc}
239
-
240
- [Value] {name incomplete`});K(e.length===0,`Malformed annotation should emit nothing, got ${e.length}`)}},{name:`Empty annotation block should be ignored`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
241
-
242
- # Doc {=ex:doc}
243
-
244
- [Value] {}`});K(e.length===0,`Empty annotation should emit nothing, got ${e.length}`)}},{name:`Nested brackets should not crash`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
245
-
246
- # Doc {=ex:doc}
247
-
248
- [Value [nested]] {label}`});K(e.length===1,`Should handle nested brackets gracefully, got ${e.length}`),K(it(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Value [nested]`),`Should extract literal with brackets`)}},{name:`Fenced code blocks should skip annotation processing`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
249
- [schema] <http://schema.org/>
250
-
251
- # Document {=ex:doc}
252
-
253
- \`\`\`mdld
254
- [This should be ignored] {label schema:description}
255
- \`\`\`
256
-
257
- [This should be processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`This should be processed`),`Only content outside code blocks should be processed`)}},{name:`Fenced code blocks should process fence annotations but skip content`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
258
- [schema] <http://schema.org/>
259
-
260
- # Document {=ex:doc}
261
-
262
- \`\`\`mdld {label schema:description}
263
- [This should be ignored] {label schema:description}
264
- \`\`\`
265
-
266
- [This should be processed] {label}`});K(e.length===3,`Should emit 3 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`[This should be ignored] {label schema:description}`),`Should use content as label value`),K(q(e,`http://example.org/doc`,`http://schema.org/description`,`[This should be ignored] {label schema:description}`),`Should use content as description value`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`This should be processed`),`Should process content outside code block`)}},{name:`Multiple fenced code blocks should all be skipped`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
267
- [schema] <http://schema.org/>
268
-
269
- # Document {=ex:doc}
270
-
271
- \`\`\`mdld
272
- [First ignored] {label}
273
- \`\`\`
274
-
275
- [Processed] {label}
276
-
277
- \`\`\`mdld {schema:description}
278
- [Second ignored] {schema:description}
279
- \`\`\`
280
-
281
- [Also processed] {schema:description}`});K(e.length===3,`Should emit 3 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should process first content`),K(q(e,`http://example.org/doc`,`http://schema.org/description`,`[Second ignored] {schema:description}`),`Should use second code block content as description value`),K(q(e,`http://example.org/doc`,`http://schema.org/description`,`Also processed`),`Should process second content`)}},{name:`Fenced code blocks with language info and attributes should be processed`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
282
- [schema] <http://schema.org/>
283
-
284
- # Document {=ex:doc}
285
-
286
- \`\`\`javascript {ex:attribute}
287
- [Code example] {label schema:description}
288
- console.log("hello");
289
- \`\`\``});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://example.org/attribute`,`[Code example] {label schema:description}
290
- console.log("hello");`),`Should use code block content as attribute value`)}},{name:`Mixed content with fenced code blocks should work correctly`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
291
- [schema] <http://schema.org/>
292
-
293
- # Document {=ex:doc}
294
-
295
- Regular content [before] {label}
296
-
297
- \`\`\`mdld
298
- [Ignored content] {schema:description}
299
- More ignored [content] {label}
300
- \`\`\`
301
-
302
- Regular content [after] {schema:description}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`before`),`Should process content before code block`),K(q(e,`http://example.org/doc`,`http://schema.org/description`,`after`),`Should process content after code block`)}},{name:`Tilde fenced code blocks should work like backticks`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
303
- [schema] <http://schema.org/>
304
-
305
- # Document {=ex:doc}
306
-
307
- ~~~mdld
308
- [This should be ignored] {label schema:description}
309
- ~~~
310
-
311
- [This should be processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`This should be processed`),`Only content outside code blocks should be processed`)}},{name:`Exact fence length matching - 6 tildes require 6 tildes to close`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
312
-
313
- # Document {=ex:doc}
314
-
315
- ~~~~~~mdld
316
- [Content with ~~~~ inside] {label}
317
- More content
318
- ~~~~~~
319
-
320
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should process content outside code block`)}},{name:`Exact fence length matching - shorter fence should not close block`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
321
- [schema] <http://schema.org/>
322
-
323
- # Document {=ex:doc}
324
-
325
- ~~~~~~mdld
326
- [Content] {label}
327
- ~~~~~ // This should NOT close the block
328
- // Still content [inside] {label}
329
- ~~~~~~
330
- // This should close the block
331
-
332
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Exact fence length matching - longer fence should not close block`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
333
-
334
- [schema] < http://schema.org/>
335
-
336
- # Document {=ex:doc}
337
-
338
- ~~~mdld
339
- [Content] {label}
340
- ~~~~~~~~ // This should NOT close the block
341
- Still content [inside] {label}
342
- ~~~ // This should close the block
343
-
344
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Mixed fence types - backticks should not close tilde blocks`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
345
-
346
- # Document {=ex:doc}
347
-
348
- ~~~mdld
349
- [Content] {label}
350
- \`\`\` // This should NOT close the tilde block
351
- Still content [inside] {label}
352
- ~~~ // This should close the block
353
-
354
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Mixed fence types - tildes should not close backtick blocks`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
355
-
356
- # Document {=ex:doc}
357
-
358
- \`\`\`mdld
359
- [Content] {label}
360
- ~~~ // This should NOT close the backtick block
361
- Still content [inside] {label}
362
- \`\`\` // This should close the block
363
-
364
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Nested codeblocks with different fence lengths`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
365
-
366
- # Document {=ex:doc}
367
-
368
- ~~~~mdld
369
- [Outer block content] {label}
370
- \`\`\`mdld
371
- [This is still inside outer block] {label}
372
- \`\`\`
373
- More outer [content] {label}
374
- ~~~~
375
-
376
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Tilde codeblocks with attributes should be processed`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
377
-
378
- [schema] <http://schema.org//>
379
-
380
- # Document {=ex:doc}
381
-
382
- ~~~javascript {ex:attribute}
383
- [Code example] {label schema:description}
384
- console.log("hello");
385
- ~~~`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://example.org/attribute`,`[Code example] {label schema:description}
386
- console.log("hello");`),`Should use tilde code block content as attribute value`)}},{name:`Minimum fence length (3) should work for both types`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
387
-
388
- # Document {=ex:doc}
389
-
390
- ~~~
391
- Min tilde block
392
- ~~~
393
-
394
- \`\`\`
395
- Min backtick block
396
- \`\`\`
397
-
398
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code blocks`)}},{name:`Fence detection should ignore indentation`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
399
-
400
- # Document {=ex:doc}
401
-
402
- ~~~mdld
403
- [Indented content] {label}
404
- ~~~
405
-
406
- [Processed] {label}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Processed`),`Should only process content outside code block`)}},{name:`Boolean datatype handling`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
407
- [schema] <http://schema.org/>
408
-
409
- # Doc {=ex:doc}
410
-
411
- [true] {schema:active ^^xsd:boolean}
412
- [false] {schema:completed ^^xsd:boolean}`}),t=it(e,`http://example.org/doc`,`http://schema.org/active`,`true`),n=it(e,`http://example.org/doc`,`http://schema.org/completed`,`false`);K(t.object.datatype.value===`http://www.w3.org/2001/XMLSchema#boolean`,`True should be boolean`),K(n.object.datatype.value===`http://www.w3.org/2001/XMLSchema#boolean`,`False should be boolean`),K(t.object.value===`true`,`True value should be "true"`),K(n.object.value===`false`,`False value should be "false"`)}},{name:`Invalid IRI in subject should not crash`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
413
- [schema] <http://schema.org/>
414
-
415
- # Doc {=ex:invalid-iri-with spaces}
416
-
417
- [Value] {label}`});K(e.length>=0,`Should not crash on invalid IRI`)}},{name:`Subject chaining with standalone declarations`,fn:()=>{let{quads:e}=H(`[ex] <http://example.org/>
418
-
419
- ## Main Event {=ex:main-event .schema:Event}
420
- Title: [Main Title] {schema:title}
421
- Description: [Main description] {schema:description}
422
-
423
- {=ex:sub-event-1 .schema:Event}
424
- Sub title: [Sub Title 1] {schema:title}
425
- Sub description: [Sub description 1] {schema:description}
426
-
427
- {=ex:sub-event-2 .schema:Event}
428
- Sub title: [Sub Title 2] {schema:title}
429
- Sub description: [Sub description 2] {schema:description}
430
-
431
- Back to main: [Back to main] {schema:description}`,{context:{schema:`http://schema.org/`}});K(q(e,`http://example.org/main-event`,`http://schema.org/title`,`Main Title`),`Main event title should use ex:main-event as subject`),K(q(e,`http://example.org/main-event`,`http://schema.org/description`,`Main description`),`Main event description should use ex:main-event as subject`),K(q(e,`http://example.org/sub-event-1`,`http://schema.org/title`,`Sub Title 1`),`Sub event 1 title should use ex:sub-event-1 as subject`),K(q(e,`http://example.org/sub-event-1`,`http://schema.org/description`,`Sub description 1`),`Sub event 1 description should use ex:sub-event-1 as subject`),K(q(e,`http://example.org/sub-event-2`,`http://schema.org/title`,`Sub Title 2`),`Sub event 2 title should use ex:sub-event-2 as subject`),K(q(e,`http://example.org/sub-event-2`,`http://schema.org/description`,`Sub description 2`),`Sub event 2 description should use ex:sub-event-2 as subject`),K(q(e,`http://example.org/sub-event-2`,`http://schema.org/description`,`Back to main`),`Back to main should use ex:sub-event-2 as subject`),K(q(e,`http://example.org/main-event`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Event`),`Main event should have Event type`),K(q(e,`http://example.org/sub-event-1`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Event`),`Sub event 1 should have Event type`),K(q(e,`http://example.org/sub-event-2`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Event`),`Sub event 2 should have Event type`)}},{name:`Subject reset with standalone {=}`,fn:()=>{let{quads:e}=H(`[ex] <http://example.org/>
432
-
433
- ## First {=ex:first}
434
- Title: [First Title] {schema:title}
435
- Description: [First description] {schema:description}
436
-
437
- {=}
438
- Title: [No subject title] {schema:title}
439
- Description: [No subject description] {schema:description}`,{context:{schema:`http://schema.org/`}});K(q(e,`http://example.org/first`,`http://schema.org/title`,`First Title`),`First title should use ex:first as subject`),K(q(e,`http://example.org/first`,`http://schema.org/description`,`First description`),`First description should use ex:first as subject`),K(!q(e,`http://example.org/first`,`http://schema.org/title`,`No subject title`),`Should not emit title after subject reset`),K(!q(e,`http://example.org/first`,`http://schema.org/description`,`No subject description`),`Should not emit description after subject reset`),K(e.length===2,`Should have exactly 2 quads (title, description), got ${e.length}`)}},{name:`Soft fragment declaration with ?predicate`,fn:()=>{let{quads:e}=H(`# Document {=ex:doc}
440
-
441
- [Section] {+#section1 label ?schema:hasPart}`,{context:{ex:`http://example.org/`,schema:`http://schema.org/`}});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc#section1`,`http://www.w3.org/2000/01/rdf-schema#label`,`Section`),`Soft fragment should have name`),K(q(e,`http://example.org/doc`,`http://schema.org/hasPart`,`http://example.org/doc#section1`),`Should use soft fragment as object`)}},{name:`Soft fragment with reverse predicate !p`,fn:()=>{let{quads:e}=H(`# Document {=ex:doc}
442
-
443
- [Parent] {+#parent !schema:hasPart}`,{context:{ex:`http://example.org/`,schema:`http://schema.org/`}});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc#parent`,`http://schema.org/hasPart`,`http://example.org/doc`),`Should create reverse relationship from soft fragment to subject`)}},{name:`Soft fragment with type declaration`,fn:()=>{let{quads:e}=H(`# Document {=ex:doc}
444
-
445
- [Chapter] {+#chapter1 .schema:Section label}`,{context:{ex:`http://example.org/`,schema:`http://schema.org/`}});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`http://example.org/doc#chapter1`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://schema.org/Section`),`Soft fragment should have type`),K(q(e,`http://example.org/doc#chapter1`,`http://www.w3.org/2000/01/rdf-schema#label`,`Chapter`),`Soft fragment should have name`)}},{name:`Soft fragment does not persist between annotations`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
446
- [schema] <http://schema.org/>
447
-
448
- # Doc {=ex:doc}
449
-
450
- [First] {+#frag1 ?schema:p}
451
- [Second] {?schema:p}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://schema.org/p`,`http://example.org/doc#frag1`),`Should use soft fragment from first annotation only`)}},{name:`Soft IRI does not persist between annotations`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
452
- [schema] <http://schema.org/>
453
-
454
- # Doc {=ex:doc}
455
-
456
- [First] {+ex:object1 ?schema:p}
457
- [Second] {?schema:p}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`http://example.org/doc`,`http://schema.org/p`,`http://example.org/object1`),`Should use soft IRI from first annotation only`)}},{name:`Angle-bracket URL soft subject behavior`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
458
- [@vocab] <http://example.org/>
459
-
460
- # Document {=ex:doc}
461
-
462
- <https://nasa.gov> {.Organization} <https://arxiv.org/abs/2301.07041> {?cites .Paper}
463
- <https://doi.org/10.1000/xyz123> {!hasVersion .Article}`});K(e.length===5,`Should emit 5 triples, got ${e.length}`),K(q(e,`https://nasa.gov`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://example.org/Organization`),`Type declaration should use URL as subject`),K(q(e,`https://arxiv.org/abs/2301.07041`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://example.org/Paper`),`Type declaration should use URL as subject`),K(q(e,`https://doi.org/10.1000/xyz123`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://example.org/Article`),`Type declaration should use URL as subject`),K(q(e,`http://example.org/doc`,`http://example.org/cites`,`https://arxiv.org/abs/2301.07041`),`Object predicate should use current subject as subject`),K(q(e,`https://doi.org/10.1000/xyz123`,`http://example.org/hasVersion`,`http://example.org/doc`),`Reverse predicate should use URL as subject`)}},{name:`Angle-bracket URL edge cases and integration`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
464
- [@vocab] <http://example.org/>
465
-
466
- # Research {=tag:research}
467
-
468
- [NASA] {publisher} <https://nasa.gov> {?website} *Important* {emphasis}
469
- <https://github.com/user/repo> {?cloned .Repository}
470
- <not-a-url> {name}
471
- <https://example.com> {name title identifier ^^xsd:anyURI}`});K(e.length===5,`Should emit 5 triples, got ${e.length}`),K(q(e,`tag:research`,`http://example.org/publisher`,`NASA`),`Should handle bracketed link`),K(q(e,`tag:research`,`http://example.org/website`,`https://nasa.gov`),`Should handle angle-bracket URL with object predicate`),K(q(e,`tag:research`,`http://example.org/emphasis`,`Important`),`Should handle emphasis`),K(q(e,`tag:research`,`http://example.org/cloned`,`https://github.com/user/repo`),`Should handle repository URL`),K(q(e,`https://github.com/user/repo`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://example.org/Repository`),`Repository URL should get type declaration`)}},{name:`Bracketed link type declaration uses URL as subject`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
472
- [@vocab] <http://example.org/>
473
-
474
- # Document {=ex:doc}
475
-
476
- [NASA](https://nasa.gov) {.Organization}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`https://nasa.gov`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://example.org/Organization`),`Should use URL as subject for type declaration (consistent with <URL> behavior)`)}},{name:`List items maintain current subject context`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
477
-
478
- # Container {=ex:container .Container}
479
-
480
- List items:
481
-
482
- - Item1 {+ex:item1 ?member}
483
- - Item2 {+ex:item2 ?member}
484
- - Item3 {+ex:item3 ?member}`});K(e.length===4,`Should emit 4 triples, got ${e.length}`),K(q(e,`http://example.org/container`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://www.w3.org/2000/01/rdf-schema#Container`),`Container should have type`),K(q(e,`http://example.org/container`,`http://www.w3.org/2000/01/rdf-schema#member`,`http://example.org/item1`),`Container should have member relationship to item1`),K(q(e,`http://example.org/container`,`http://www.w3.org/2000/01/rdf-schema#member`,`http://example.org/item2`),`Container should have member relationship to item2`),K(q(e,`http://example.org/container`,`http://www.w3.org/2000/01/rdf-schema#member`,`http://example.org/item3`),`Container should have member relationship to item3`),K(e.filter(e=>e.subject.value.startsWith(`http://example.org/item`)&&e.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`).length===0,`List items should not create standalone subject triples`),K(e.filter(e=>e.subject.value===`http://example.org/container`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#member`).length===3,`All list items should be members of container`)}},{name:`Intra-document cancel — remove is empty`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
485
-
486
- # Employee {=my:emp456 .my:Employee}
487
- [Software Engineer] {my:jobTitle}
488
- [Software Engineer] {-my:jobTitle}
489
- [Senior Software Engineer] {my:jobTitle}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have final job title`),K(q(e,`tag:hr@example.com,2026:emp456`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Employee`),`Should have employee type`),K(t.length===0,`Remove should be empty, got ${t.length}`),K(!q(e,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Software Engineer`),`Software Engineer should be cancelled`)}},{name:`External retract — remove is populated`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
490
- # Employee {=my:emp456}
491
- [Software Engineer] {-my:jobTitle}
492
- [Senior Software Engineer] {my:jobTitle}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have final job title`),K(t.length===1,`Remove should have 1 triple, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Software Engineer`),`Should have Software Engineer in remove`)}},{name:`Type migration — single annotation`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
493
- # Project Alpha {=my:proj -.my:ActiveProject .my:ArchivedProject}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ArchivedProject`),`Should have Archived type`),K(t.length===1,`Remove should have 1 triple, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ActiveProject`),`Should have Active type in remove`)}},{name:`Type migration — with prior assertion in same document`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
494
- # Project Alpha {=my:proj .my:ActiveProject}
495
- # Project Alpha {=my:proj -.my:ActiveProject .my:ArchivedProject}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ArchivedProject`),`Should have Archived type`),K(t.length===0,`Remove should be empty, got ${t.length}`),K(!q(e,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ActiveProject`),`Active type should be cancelled`)}},{name:`Object triple remove`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
496
- # Team {=my:team789}
497
- [old member] {-?my:hasMember +my:emp123}`});K(e.length===0,`Should emit 0 triples, got ${e.length}`),K(t.length===1,`Remove should have 1 triple, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:team789`,`tag:hr@example.com,2026:hasMember`,`tag:hr@example.com,2026:emp123`),`Should have member relationship in remove`)}},{name:`Reverse triple remove`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
498
- # Chapter {=my:ch1}
499
- [Book] {-!my:hasPart +my:book}`});K(e.length===0,`Should emit 0 triples, got ${e.length}`),K(t.length===1,`Remove should have 1 triple, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:book`,`tag:hr@example.com,2026:hasPart`,`tag:hr@example.com,2026:ch1`),`Should have reverse relationship in remove`)}},{name:`Block carriers — all types`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
500
- {=my:doc}
501
- # Old Title {-label}
502
- # New Title {label}
503
- > old quote {-prov:value}
504
- > new quote {prov:value}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`New Title`),`Should have new title`),K(q(e,`tag:hr@example.com,2026:doc`,`http://www.w3.org/ns/prov#value`,`new quote`),`Should have new quote`),K(t.length===2,`Remove should have 2 triples, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`Old Title`),`Should have old title in remove`),K(q(t,`tag:hr@example.com,2026:doc`,`http://www.w3.org/ns/prov#value`,`old quote`),`Should have old quote in remove`)}},{name:`Mixed polarity — same annotation`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
505
- # Doc {=my:doc -.my:Draft .my:Published -my:version}
506
- [2.0] {my:version}`});K(e.length===2,`Should emit 2 triples, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Published`),`Should have Published type`),K(q(e,`tag:hr@example.com,2026:doc`,`tag:hr@example.com,2026:version`,`2.0`),`Should have version 2.0`),K(t.length===2,`Remove should have 2 triples, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Draft`),`Should have Draft type in remove`),K(q(t,`tag:hr@example.com,2026:doc`,`tag:hr@example.com,2026:version`,`Doc`),`Should have version Doc in remove`)}},{name:`Subject context unaffected by remove token`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
507
- # Employee {=my:emp456}
508
- [Engineer] {-my:jobTitle}
509
- [Alice] {my:name}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:name`,`Alice`),`Should have name Alice`),K(t.length===1,`Remove should have 1 triple, got ${t.length}`),K(q(t,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Engineer`),`Should have Engineer job title in remove`)}},{name:`Invalid -= — warning, not error`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
510
- # Doc {-=my:doc .my:Article}`});K(e.length===1,`Should emit 1 triple, got ${e.length}`),K(q(e,`tag:hr@example.com,2026:doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Article`),`Should have Article type`),K(t.length===0,`Remove should be empty, got ${t.length}`)}},{name:`Hard invariant — quads ∩ remove = ∅`,fn:()=>{let{quads:e,remove:t}=H({text:`[my] <tag:hr@example.com,2026:>
511
- # Test {=my:test}
512
- [value] {label}
513
- [value] {-label}
514
- [value2] {label}`}),n=new Set;e.forEach(e=>{n.add(`${e.subject.value}|${e.predicate.value}|${e.object.value}`)});let r=!1;t.forEach(e=>{let t=`${e.subject.value}|${e.predicate.value}|${e.object.value}`;n.has(t)&&(r=!0)}),K(!r,`Hard invariant violated: quads ∩ remove should be empty`),K(e.length===1,`Should have 1 quad, got ${e.length}`),K(t.length===0,`Remove should be empty for intra-document cancellation, got ${t.length}`)}},{name:`Generate - round-trip safety with labels, numbers, dates, booleans`,fn:()=>{let{text:e,context:t}=We({quads:[{subject:{value:`http://example.org/org`,termType:`NamedNode`},predicate:{value:`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,termType:`NamedNode`},object:{value:`http://www.w3.org/ns/prov#Organization`,termType:`NamedNode`}},{subject:{value:`http://example.org/org`,termType:`NamedNode`},predicate:{value:`http://www.w3.org/2000/01/rdf-schema#label`,termType:`NamedNode`},object:{value:`ACME Inc.`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#string`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,termType:`NamedNode`},object:{value:`http://www.w3.org/ns/prov#Person`,termType:`NamedNode`}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://www.w3.org/2000/01/rdf-schema#label`,termType:`NamedNode`},object:{value:`Alice Smith`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#string`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://www.w3.org/2000/01/rdf-schema#label`,termType:`NamedNode`},object:{value:`Alicia`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#string`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/birthDate`,termType:`NamedNode`},object:{value:`1994-09-21`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#date`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/salary`,termType:`NamedNode`},object:{value:`75000`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#integer`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/rating`,termType:`NamedNode`},object:{value:`4.5`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#decimal`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/isActive`,termType:`NamedNode`},object:{value:`true`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#boolean`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/email`,termType:`NamedNode`},object:{value:`alice@example.com`,termType:`Literal`,datatype:{value:`http://www.w3.org/2001/XMLSchema#string`}}},{subject:{value:`http://example.org/person`,termType:`NamedNode`},predicate:{value:`http://example.org/worksAt`,termType:`NamedNode`},object:{value:`http://example.org/org`,termType:`NamedNode`}}],context:{ex:`http://example.org/`}}),n=H({text:e,context:t});K(q(n.quads,`http://example.org/person`,`http://www.w3.org/2000/01/rdf-schema#label`,`Alice Smith`),`First label should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://www.w3.org/2000/01/rdf-schema#label`,`Alicia`),`Second label should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/birthDate`,`1994-09-21`),`Date should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/salary`,`75000`),`Integer should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/rating`,`4.5`),`Decimal should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/isActive`,`true`),`Boolean should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/email`,`alice@example.com`),`String literal should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://example.org/worksAt`,`http://example.org/org`),`Object link should survive round-trip`),K(q(n.quads,`http://example.org/org`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://www.w3.org/ns/prov#Organization`),`Organization type should survive round-trip`),K(q(n.quads,`http://example.org/person`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`http://www.w3.org/ns/prov#Person`),`Person type should survive round-trip`),K(n.quads.length===11,`Should have 11 quads after round-trip, got ${n.quads.length}`)}}];function ot(e,t){if(!e)throw Error(t||`Assertion failed`)}function J(e,t,n){if(JSON.stringify(e)!==JSON.stringify(t))throw Error(n||`Expected ${JSON.stringify(t)}, got ${JSON.stringify(e)}`)}var st=[{name:`Locate - Basic quad location with origin`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
515
-
516
- # Article {=ex:article .ex:Article}
517
-
518
- > Alice Smith {author}
519
- > 2024-01-01 {datePublished}`}),t=e.quads.find(e=>e.subject.value===`http://example.org/article`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`);ot(t,`Should find author quad`);let n=h(t,e.origin);ot(n,`Should locate author quad`),J(n.carrierType,`blockquote`),ot(typeof n.blockId==`string`),J(n.subject,`http://example.org/article`),J(n.value,`Alice Smith`),J(n.polarity,`+`)}},{name:`Locate - Auto-parse when origin not provided`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
520
-
521
- # Person {=ex:alice .ex:Person}
522
-
523
- > Alice Smith {name}
524
- > 25 {age ^^xsd:integer}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/alice`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#name`),e.origin);ot(t,`Should locate quad with origin`),J(t.carrierType,`blockquote`),J(t.value,`Alice Smith`),J(t.polarity,`+`)}},{name:`Locate - Type annotation in heading`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
525
-
526
- # Document {=ex:doc .ex:Document label}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/doc`&&e.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`),e.origin);ot(t,`Should locate type annotation`),J(t.carrierType,`heading`),J(t.value,`Document`),J(t.polarity,`+`)}},{name:`Locate - Object reference in blockquote`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
527
-
528
- # Article {=ex:article .ex:Article}
529
-
530
- > alice {+ex:alice ?author}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/article`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),e.origin);ot(t,`Should locate object reference`),J(t.carrierType,`blockquote`),J(t.value,`alice`),J(t.polarity,`+`)}},{name:`Locate - Literal with datatype`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
531
-
532
- # Person {=ex:person .ex:Person}
533
-
534
- > 25 {age ^^xsd:integer}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/person`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#age`),e.origin);ot(t,`Should locate datatype literal`),J(t.carrierType,`blockquote`),J(t.value,`25`),J(t.polarity,`+`)}},{name:`Locate - Non-existent quad returns null`,fn:()=>{ot(h({subject:{termType:`NamedNode`,value:`http://example.org/nonexistent`},predicate:{termType:`NamedNode`,value:`http://schema.org/fake`},object:{termType:`Literal`,value:`fake`}},H({text:`[ex] <http://example.org/>
535
-
536
- # Article {=ex:article .ex:Article}
537
-
538
- > Alice Smith {author}`}).origin)===null,`Should return null for non-existent quad`)}},{name:`Locate - Quad in generated MDLD`,fn:()=>{let{text:e}=We({quads:[{subject:{termType:`NamedNode`,value:`http://example.org/project`},predicate:{termType:`NamedNode`,value:`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`},object:{termType:`NamedNode`,value:`http://example.org/Project`}},{subject:{termType:`NamedNode`,value:`http://example.org/project`},predicate:{termType:`NamedNode`,value:`http://www.w3.org/2000/01/rdf-schema#label`},object:{termType:`Literal`,value:`Web Application`}}],context:{ex:`http://example.org/`}}),t=H({text:e}),n=h(t.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`),t.origin);ot(n,`Should locate quad in generated MDLD`),J(n.carrierType,`heading`),J(n.value,`Web Application`),J(n.polarity,`+`)}},{name:`Locate - Complex few-shot example (simplified)`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
539
-
540
- # Project Alpha {=ex:ProjectAlpha .ex:Project}
541
-
542
- [Design schema] {label}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/ProjectAlpha`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`),e.origin);ot(t,`Should locate label quad in span`),J(t.carrierType,`span`),J(t.value,`Design schema`),J(t.polarity,`+`)}},{name:`Locate - Multiple parameter patterns`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
543
-
544
- # Test {=ex:test .ex:Test}
545
-
546
- > value {property} `}),t=e.quads[0];ot(h(t,e.origin),`Pattern 1 should work`),ot(h(t)===null,`Pattern 2 should return null`)}},{name:`Locate - Range precision validation`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
547
-
548
- # Article {=ex:article .ex:Article}
549
-
550
- [Alice Smith] {author}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/article`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),e.origin);ot(t,`Should locate quad`),ot(t.range.start>=0,`Range start should be non-negative`),ot(t.range.end<=87,`Range end should be within text`),ot(t.range.start<t.range.end,`Range start should be before end`),J(t.value,`Alice Smith`),J(t.polarity,`+`)}}];function Y(e,t){if(!e)throw Error(t||`Assertion failed`)}function ct(e){let t=e.object.datatype?.value||``,n=e.object.language||``;return`${e.subject.value}|${e.predicate.value}|${e.object.value}|${t}|${n}`}function lt(e,t,n,r){return e.some(e=>e.subject.value===t&&e.predicate.value===n&&e.object.value===r)}var ut=[{name:`Primary subjects - single document`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
551
- # Employee {=my:emp456 .my:Employee}
552
- [Alice] {my:name}`]);Y(e.primarySubjects.length===1,`Should have 1 primary subject, got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`tag:hr@example.com,2026:emp456`,`Primary subject should be my:emp456, got ${e.primarySubjects[0]}`),Y(e.primary.length===1,`Should have 1 primary object, got ${e.primary.length}`),Y(e.primary[0].subject===`tag:hr@example.com,2026:emp456`,`Primary object subject should be my:emp456, got ${e.primary[0].subject}`),Y(e.primary[0].type===`tag:hr@example.com,2026:Employee`,`Primary object type should be my:Employee, got ${e.primary[0].type}`),Y(e.primary[0].label===null,`Primary object label should be null, got ${e.primary[0].label}`)}},{name:`Primary subjects - multiple documents`,fn:()=>{let e=U([`[ex] <http://example.org/>
553
- # Doc1 {=ex:doc1}
554
- [Value] {label}`,`[ex] <http://example.org/>
555
- # Doc2 {=ex:doc2}
556
- [Value] {label}`]);Y(e.primarySubjects.length===2,`Should have 2 primary subjects, got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`http://example.org/doc1`,`First primary subject should be ex:doc1, got ${e.primarySubjects[0]}`),Y(e.primarySubjects[1]===`http://example.org/doc2`,`Second primary subject should be ex:doc2, got ${e.primarySubjects[1]}`)}},{name:`Primary subjects - document with no primary subject`,fn:()=>{let e=U([`[ex] <http://example.org/>
557
- # Doc1 {=ex:doc1}
558
- [Value] {label}`,`[Value] {label}`]);Y(e.primarySubjects.length===1,`Should have 1 primary subject (doc2 has none), got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`http://example.org/doc1`,`Primary subject should be ex:doc1, got ${e.primarySubjects[0]}`)}},{name:`Primary subjects - ParseResult input`,fn:()=>{let e=U([H({text:`[ex] <http://example.org/>
559
- # Doc1 {=ex:doc1}
560
- [Value] {label}`}),H({text:`[ex] <http://example.org/>
561
- # Doc2 {=ex:doc2}
562
- [Value] {label}`})]);Y(e.primarySubjects.length===2,`Should have 2 primary subjects, got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`http://example.org/doc1`,`First primary subject should be ex:doc1, got ${e.primarySubjects[0]}`),Y(e.primarySubjects[1]===`http://example.org/doc2`,`Second primary subject should be ex:doc2, got ${e.primarySubjects[1]}`)}},{name:`Single document — equivalence to parse()`,fn:()=>{let e=`[my] <tag:hr@example.com,2026:>
563
- # Employee {=my:emp456 .my:Employee}
564
- [Alice] {my:name}>`,t=U([e]);Y(t.quads.length===H(e).quads.length,`Merge quads length ${t.quads.length} should equal parse quads length ${H(e).quads.length}`),Y(t.remove.length===0,`Merge remove should be empty, got ${t.remove.length}`),Y(t.origin.documents.length===1,`Should have 1 document, got ${t.origin.documents.length}`)}},{name:`Single document with appended diff — primary use case`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
565
- # Employee {=my:emp456 .my:Employee}
566
- [Software Engineer] {my:jobTitle}
567
-
568
- ---
569
-
570
- # Employee {=my:emp456}
571
- [Software Engineer] {-my:jobTitle}
572
- [Senior Software Engineer] {my:jobTitle}`]);Y(e.quads.length===2,`Should have 2 quads, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Employee`),`Should have Employee type`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have Senior Engineer title`),Y(e.remove.length===0,`Remove should be empty, got ${e.remove.length}`)}},{name:`Single document — external retract`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
573
- # Employee {=my:emp456}
574
- [Software Engineer] {-my:jobTitle}
575
- [Senior Software Engineer] {my:jobTitle}`]);Y(e.quads.length===1,`Should have 1 quad, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have Senior Engineer title`),Y(e.remove.length===1,`Should have 1 remove, got ${e.remove.length}`),Y(lt(e.remove,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Software Engineer`),`Should remove Software Engineer title`)}},{name:`Two documents — inter-document cancel`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
576
- # Employee {=my:emp456 .my:Employee}
577
- [Software Engineer] {my:jobTitle}`,`[my] <tag:hr@example.com,2026:>
578
- # Employee {=my:emp456}
579
- [Software Engineer] {-my:jobTitle}
580
- [Senior Software Engineer] {my:jobTitle}`]);Y(e.quads.length===2,`Should have 2 quads, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Employee`),`Should have Employee type`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have Senior Engineer title`),Y(e.remove.length===0,`Remove should be empty, got ${e.remove.length}`),Y(e.origin.documents.length===2,`Should have 2 documents, got ${e.origin.documents.length}`)}},{name:`Type migration — single annotation`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
581
- # Project {=my:proj .my:ActiveProject}
582
- # Project {=my:proj -.my:ActiveProject .my:ArchivedProject}`]);Y(e.quads.length===1,`Should have 1 quad, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ArchivedProject`),`Should have ArchivedProject type`),Y(!lt(e.quads,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ActiveProject`),`Should not have ActiveProject type`),Y(e.remove.length===0,`Remove should be empty, got ${e.remove.length}`)}},{name:`Type migration — with prior assertion in same document`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
583
- # Project {=my:proj .my:ActiveProject}
584
- # Project {=my:proj -.my:ActiveProject .my:ArchivedProject}`]);Y(e.quads.length===1,`Should have 1 quad, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ArchivedProject`),`Should have ArchivedProject type`),Y(!lt(e.quads,`tag:hr@example.com,2026:proj`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:ActiveProject`),`Should not have ActiveProject type`),Y(e.remove.length===0,`Remove should be empty, got ${e.remove.length}`)}},{name:`ParseResult passthrough — no re-parse`,fn:()=>{let e=`[my] <tag:hr@example.com,2026:>
585
- # Employee {=my:emp456 .my:Employee}
586
- [Alice] {my:name}`,t=U([H({text:e}),e],{context:{my:`tag:hr@example.com,2026:`}});Y(t.origin.documents.length===2,`Should have 2 documents, got ${t.origin.documents.length}`),Y(t.origin.documents[0].input===`ParseResult`,`First document should be ParseResult, got ${t.origin.documents[0].input}`),Y(t.origin.documents[1].input===`string`,`Second document should be string, got ${t.origin.documents[1].input}`)}},{name:`Hard invariant — quads ∩ remove = ∅`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
587
- # Employee {=my:emp456}
588
- [Software Engineer] {my:jobTitle}
589
- [Software Engineer] {-my:jobTitle}
590
- [Senior Software Engineer] {my:jobTitle}`]),t=new Set;e.quads.forEach(e=>t.add(ct(e)));let n=!1;e.remove.forEach(e=>{t.has(ct(e))&&(n=!0)}),Y(!n,`Hard invariant violated: quads ∩ remove should be empty`)}},{name:`Four-document replay chain`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
591
- # Employee {=my:emp456 .my:Employee}`,`[my] <tag:hr@example.com,2026:>
592
- # Employee {=my:emp456}
593
- [Junior Software Engineer] {my:jobTitle}`,`[my] <tag:hr@example.com,2026:>
594
- # Employee {=my:emp456}
595
- [Junior Software Engineer] {-my:jobTitle}
596
- [Software Engineer] {my:jobTitle}`,`[my] <tag:hr@example.com,2026:>
597
- # Employee {=my:emp456}
598
- [Software Engineer] {-my:jobTitle}
599
- [Senior Software Engineer] {my:jobTitle}`]);Y(e.quads.length===2,`Should have 2 quads, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Employee`),`Should have Employee type`),Y(lt(e.quads,`tag:hr@example.com,2026:emp456`,`tag:hr@example.com,2026:jobTitle`,`Senior Software Engineer`),`Should have Senior Engineer title`),Y(e.origin.documents.length===4,`Should have 4 documents, got ${e.origin.documents.length}`)}},{name:`Mixed polarity in single annotation`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
600
- # Doc {=my:doc -.my:Draft .my:Published -my:version}
601
- [2.0] {my:version}`]);Y(e.quads.length===2,`Should have 2 quads, got ${e.quads.length}`),Y(lt(e.quads,`tag:hr@example.com,2026:doc`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,`tag:hr@example.com,2026:Published`),`Should have Published type`),Y(lt(e.quads,`tag:hr@example.com,2026:doc`,`tag:hr@example.com,2026:version`,`2.0`),`Should have version 2.0`)}},{name:`Statements merging`,fn:()=>{let e=U([`[ex] <http://example.org/>
602
-
603
- ## Statement 1 {=ex:stmt1 .rdf:Statement}
604
- **Alice** {+ex:alice ?rdf:subject} *knows* {+ex:knows ?rdf:predicate} **Bob** {+ex:bob ?rdf:object}
605
-
606
- **Alice** {=ex:alice} knows **Bob** {?ex:knows +ex:bob}`,`[ex] <http://example.org/>
607
-
608
- ## Statement 2 {=ex:stmt2 .rdf:Statement}
609
- **Charlie** {+ex:charlie ?rdf:subject} *works with* {+ex:works-with ?rdf:predicate} **David** {+ex:david ?rdf:object}
610
-
611
- **Charlie** {=ex:charlie} works with **David** {?ex:works-with +ex:david}`]);Y(e.statements.length===2,`Should have 2 statements, got ${e.statements.length}`);let t=e.statements.find(e=>e.subject.value===`http://example.org/alice`&&e.predicate.value===`http://example.org/knows`&&e.object.value===`http://example.org/bob`),n=e.statements.find(e=>e.subject.value===`http://example.org/charlie`&&e.predicate.value===`http://example.org/works-with`&&e.object.value===`http://example.org/david`);Y(t,`Should have Alice knows Bob statement`),Y(n,`Should have Charlie works with David statement`)}},{name:`Context accumulation across documents`,fn:()=>{let e=U([`[ex1] <http://example.org/1/>
612
- # Person {=ex1:alice}
613
- [Alice] {ex1:name}`,`[ex2] <http://example.org/2/>
614
- # Person {=ex2:bob}
615
- [Bob] {ex2:name}`]);Y(e.context.ex1===`http://example.org/1/`,`Should have ex1 prefix, got ${JSON.stringify(e.context)}`),Y(e.context.ex2===`http://example.org/2/`,`Should have ex2 prefix, got ${JSON.stringify(e.context)}`),Y(e.quads.length===2,`Should have 2 quads, got ${e.quads.length}`)}}];function X(e,t){if(!e)throw Error(t||`Assertion failed`)}function dt(e,t,n){if(JSON.stringify(e)!==JSON.stringify(t))throw Error(n||`Expected ${JSON.stringify(t)}, got ${JSON.stringify(e)}`)}var ft=[{name:`Origin Lean - Only quadIndex present`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
616
-
617
- # Article {=ex:article .ex:Article}
618
-
619
- > Alice Smith {author}
620
- > 2024-01-01 {datePublished}`});X(e.origin,`Origin should exist`),X(e.origin.quadIndex instanceof Map,`Origin should have quadIndex Map`),X(!e.origin.quadMap,`Origin should not have quadMap`),X(!e.origin.entries,`Origin should not have entries array`)}},{name:`Origin Lean - OriginEntry structure`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
621
-
622
- # Person {=ex:alice .ex:Person}
623
-
624
- > Alice Smith {name}`}),t=h(e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#name`),e.origin);X(t,`Should locate name quad`),dt(t.predicate,`http://www.w3.org/2000/01/rdf-schema#name`,`Should include predicate IRI`),X(typeof t.blockId==`string`,`Should have blockId string`),X(typeof t.range==`object`,`Should have range object`),X(typeof t.range.start==`number`,`Range should have start number`),X(typeof t.range.end==`number`,`Range should have end number`),X(typeof t.carrierType==`string`,`Should have carrierType string`),X(typeof t.subject==`string`,`Should have subject string`),X(typeof t.predicate==`string`,`Should have predicate string`),X(typeof t.polarity==`string`,`Should have polarity string`),dt(t.polarity,`+`,`Default polarity should be +`),X(typeof t.context==`object`,`Should have context object`),X(typeof t.value==`string`,`Should have value string`),X(t.entryIndex===void 0,`Should not have entryIndex`),X(t.kind===void 0,`Should not have kind`),X(t.isVacant===void 0,`Should not have isVacant`),X(t.attrsRange===void 0,`Should not have attrsRange`),X(t.valueRange===void 0,`Should not have valueRange`),X(t.slotId===void 0,`Should not have slotId`),X(t.lastValue===void 0,`Should not have lastValue`),X(t.vacantSince===void 0,`Should not have vacantSince`)}},{name:`Origin Lean - Multiple quads same block`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
625
-
626
- # Article {=ex:article .ex:Article .ex:PublishedContent}
627
-
628
- [Alice Smith] {author datePublished}`}),t=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),n=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#datePublished`),r=h(t,e.origin),i=h(n,e.origin);dt(r.blockId,i.blockId,`Quads in same block should share blockId`),dt(r.carrierType,`span`,`Should have correct carrierType`),dt(i.carrierType,`span`,`Should have correct carrierType`)}},{name:`Origin Lean - Different carrier types`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
629
-
630
- # Document {=ex:doc .ex:Document}
631
-
632
- [Design spec] {label}
633
- > alice {+ex:alice ?author}`}),t=e.quads.find(e=>e.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`),n=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`),r=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),i=h(t,e.origin),a=h(n,e.origin),o=h(r,e.origin);dt(i.carrierType,`heading`,`Type should be in heading`),dt(a.carrierType,`span`,`Label should be in span`),dt(o.carrierType,`blockquote`,`Author should be in blockquote`)}},{name:`Origin Lean - Range precision`,fn:()=>{let e=`[ex] <http://example.org/>
634
-
635
- # Article {=ex:article .ex:Article}
636
-
637
- > Alice Smith {author}`,t=H({text:e}),n=h(t.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),t.origin);X(n.range.start>=0,`Range start should be non-negative`),X(n.range.end<=87,`Range end should be within text`),X(n.range.start<n.range.end,`Range start should be before end`),X(e.substring(n.range.start,n.range.end).includes(`Alice Smith`),`Range should contain expected text`)}},{name:`Origin Lean - Context inheritance`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
638
-
639
- # Article {=ex:article .ex:Article}
640
-
641
- > Alice Smith {author}`}),t=h(e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),e.origin);X(t.context,`Should have context`),dt(t.context.ex,`http://example.org/`,`Should inherit prefix context`)}},{name:`Origin Lean - Value field content`,fn:()=>{let e=H({text:`[ex] <http://example.org/>
642
-
643
- # Person {=ex:person .ex:Person}
644
-
645
- > Alice Smith {name}
646
- > 25 {age ^^xsd:integer}
647
- > alice {+ex:alice ?knows}`}),t=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#name`),n=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#age`),r=e.quads.find(e=>e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#knows`),i=h(t,e.origin),a=h(n,e.origin),o=h(r,e.origin);dt(i.value,`Alice Smith`,`Value should match literal text`),dt(a.value,`25`,`Value should match datatype literal text`),dt(o.value,`alice`,`Value should match object reference text`)}}];function pt(e,t){if(!e)throw Error(t||`Assertion failed`)}var mt=[{name:`Elevated Statements - Basic pattern with IRIs`,fn:()=>{let e=H({text:`
648
- [ex] <http://example.org/>
649
-
650
- ## Elevated statement {=ex:stmt1 .rdf:Statement}
651
- **Alice** {+ex:alice ?rdf:subject} *knows* {+ex:knows ?rdf:predicate} **Bob** {+ex:bob ?rdf:object}
652
-
653
- **Alice** {=ex:alice} knows **Bob** {?ex:knows +ex:bob}
654
- `});pt(e.statements.length===1,`Should have 1 elevated statement`);let t=e.statements[0];pt(t.subject.value===`http://example.org/alice`,`Subject should be Alice`),pt(t.predicate.value===`http://example.org/knows`,`Predicate should be knows`),pt(t.object.value===`http://example.org/bob`,`Object should be Bob`),pt(e.quads.filter(e=>e.subject.value===`http://example.org/stmt1`&&e.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`).length===1,`Should have rdf:Statement type quad`)}},{name:`Elevated Statements - Datatypes and language tags`,fn:()=>{let e=H({text:`
655
- [ex] <http://example.org/>
656
-
657
- ## Statement with integer datatype {=ex:stmt2 .rdf:Statement}
658
- **Alice** {+ex:alice ?rdf:subject} *has age* {+ex:hasAge ?rdf:predicate} **25** {rdf:object ^^xsd:integer}
659
-
660
- ## Statement with language tag {=ex:stmt3 .rdf:Statement}
661
- **Alice** {+ex:alice ?rdf:subject} *has name* {+ex:hasName ?rdf:predicate} **Alice** {rdf:object @en}
662
- `});pt(e.statements.length===2,`Should have 2 elevated statements`);let t=e.statements.find(e=>e.predicate.value.endsWith(`hasAge`));pt(t.object.datatype.value===`http://www.w3.org/2001/XMLSchema#integer`,`Should preserve integer datatype`),pt(t.object.value===`25`,`Should preserve literal value`);let n=e.statements.find(e=>e.predicate.value.endsWith(`hasName`));pt(n.object.language===`en`,`Should preserve language tag`),pt(n.object.value===`Alice`,`Should preserve literal value`)}},{name:`Elevated Statements - Multiple and incomplete patterns`,fn:()=>{let e=H({text:`
663
- [ex] <http://example.org/>
664
-
665
- ## Complete statement 1 {=ex:stmt1 .rdf:Statement}
666
- **Alice** {+ex:alice ?rdf:subject} *knows* {+ex:knows ?rdf:predicate} **Bob** {+ex:bob ?rdf:object}
667
-
668
- ## Complete statement 2 {=ex:stmt2 .rdf:Statement}
669
- **Charlie** {+ex:charlie ?rdf:subject} *works with* {+ex:works-with ?rdf:predicate} **David** {+ex:david ?rdf:object}
670
-
671
- ## Incomplete statement {=ex:incomplete .rdf:Statement}
672
- **Eve** {+ex:eve ?rdf:subject} *has age* {+ex:hasAge ?rdf:predicate}
673
- // Missing rdf:object - should not be elevated
674
- `});pt(e.statements.length===2,`Should have 2 elevated statements (incomplete ignored)`);let t=e.statements.map(e=>e.object.value);pt(t.includes(`http://example.org/bob`),`Should include Bob`),pt(t.includes(`http://example.org/david`),`Should include David`)}},{name:`Elevated Statements - Real-world example with tag URIs and FOAF`,fn:()=>{let e=H({text:`
675
- [my] <tag:alice@example.com,2026:>
676
- [foaf] <http://xmlns.com/foaf/0.1/>
677
-
678
- My name is **Alice** {=my:Alice .foaf:Person foaf:name}.
679
-
680
- Today I have learned that my colleague name is [Clair] {=my:Claire .foaf:Person foaf:name}
681
-
682
- ## I know Claire's name {=my:claire-name .rdf:Statement}
683
- [My colleague] {+my:Claire ?rdf:subject} [name] {+foaf:name ?rdf:predicate} is [Clair] {rdf:object}.
684
-
685
- {=}
686
-
687
- ## We've talked! {=my:claire-first-talk .rdf:Statement}
688
- Today [I] {+my:Alice ?rdf:subject} came to office a bit earlier and [talked for some time] {+foaf:knows ?rdf:predicate} with [Claire] {+my:Claire ?rdf:object}.
689
-
690
- Now **I** {=my:Alice} know **Claire** {+my:Claire ?foaf:knows}.
691
- `});pt(e.statements.length===2,`Should have 2 elevated statements`),pt(e.statements.filter(e=>e.subject.value.startsWith(`tag:`)).length===2,`Should have 2 tag: IRIs in elevated statements`);let t=e.statements.map(e=>e.predicate.value);pt(t.includes(`http://xmlns.com/foaf/0.1/name`),`Should include FOAF name predicate`),pt(t.includes(`http://xmlns.com/foaf/0.1/knows`),`Should include FOAF knows predicate`)}}],ht=[{name:`MD field exists and prefixes/annotations stripped`,fn:()=>{let e=H(`[ex] <tag:ex.org,2026:>
692
- [foaf] <http://xmlns.com/foaf/0.1/>
693
-
694
- # Document {=ex:doc .foaf:Document label}
695
- [Content] {ex:content}
696
-
697
- {=ex:section1}
698
- More content here. {ex:note}`);if(!(`md`in e))throw Error(`Result should have md field`);if(e.md.includes(`[ex] <tag:`))throw Error(`Prefix declarations should be stripped`);if(e.md.includes(`{=ex:doc`))throw Error(`Subject annotations should be stripped`);if(e.md.includes(`{ex:content}`))throw Error(`Property annotations should be stripped`);if(e.md.includes(`{=ex:section1}`))throw Error(`Standalone subjects should be stripped`);if(!e.md.includes(`# Document`))throw Error(`Heading text should be preserved`);if(!e.md.includes(`Content`))throw Error(`Value carrier text should be preserved`);if(!e.md.includes(`More content here.`))throw Error(`Paragraph text should be preserved`);if(e.quads.length===0)throw Error(`Quads should be generated`)}},{name:`Headings, lists, blockquotes cleaned`,fn:()=>{let e=H(`[ex] <tag:ex.org,2026:>
699
-
700
- # Apollo 11 {=ex:apollo .ex:Mission label}
701
- ## Mission Details {=#details label}
702
-
703
- Ingredients:
704
- - **Flour** {+ex:flour ?ex:ingredient .ex:Ingredient label}
705
- - **Water** {+ex:water ?ex:ingredient .ex:Ingredient label}
706
-
707
- > Quote one {ex:quote1}
708
- > Quote two {ex:quote2}`);if(!e.md.includes(`# Apollo 11`))throw Error(`H1 should be preserved`);if(!e.md.includes(`## Mission Details`))throw Error(`H2 should be preserved`);if(e.md.includes(`{=ex:apollo}`))throw Error(`H1 annotation should be stripped`);if(e.md.includes(`{=#details}`))throw Error(`H2 annotation should be stripped`);if(!e.md.includes(`- **Flour**`)||!e.md.includes(`- **Water**`))throw Error(`List item text should be preserved`);if(e.md.includes(`{+ex:flour`))throw Error(`List annotation should be stripped`);if(!e.md.includes(`> Quote one`)||!e.md.includes(`> Quote two`))throw Error(`Blockquote text should be preserved`);if(e.md.includes(`{ex:quote1}`))throw Error(`Blockquote annotation should be stripped`)}},{name:`Inline carriers and code blocks cleaned`,fn:()=>{let e=H('[ex] <tag:ex.org,2026:>\n\n# Mission {=ex:mission}\n[*Important*] {ex:emphasis} mission using **Saturn V** {ex:rocket} rocket.\n[Code example] {ex:code} with `inline code` {ex:inline}.\n\n```javascript {=ex:js .ex:Code text}\nconsole.log("hello");\n```\n\n```python\n# Plain code block\nprint("world")\n```');if(!e.md.includes(`*Important*`))throw Error(`Emphasis content should be preserved`);if(!e.md.includes(`**Saturn V**`))throw Error(`Strong content should be preserved`);if(e.md.includes(`{ex:emphasis}`))throw Error(`Emphasis annotation should be stripped`);if(e.md.includes(`{ex:rocket}`))throw Error(`Strong annotation should be stripped`);if(e.md.includes(`{ex:code}`))throw Error(`Link annotation should be stripped`);if(!e.md.includes("```javascript"))throw Error(`JS fence should be preserved`);if(!e.md.includes(`console.log("hello");`))throw Error(`JS code should be preserved`);if(e.md.includes(`{=ex:js`))throw Error(`Code block annotation should be stripped`);if(!e.md.includes("```python"))throw Error(`Python fence should be preserved`);if(!e.md.includes(`print("world")`))throw Error(`Python code should be preserved`)}},{name:`Round-trip safety: clean MD parses to zero quads`,fn:()=>{let e=H(`[my] <tag:test@example.com,2026:>
709
-
710
- # Test Document {=my:doc .my:Doc label}
711
-
712
- Some **bold** and *italic* text.
713
-
714
- ## Section {=my:section}
715
- - **Item 1** {+my:item1 ?my:item}
716
- - **Item 2** {+my:item2 ?my:item}
717
-
718
- > A quote {my:quote}`),t=e.md;if(e.quads.length===0)throw Error(`Original should generate quads`);let n=H(t);if(n.quads.length!==0)throw Error(`Clean MD should produce 0 quads, got ${n.quads.length}`);if(n.md!==t)throw Error(`MD stripping should be idempotent`)}},{name:`Invalid syntax (mid-line annotations) preserved as visible markers`,fn:()=>{let e=H(`[ex] <tag:ex.org,2026:>
719
-
720
- # Valid {=ex:valid}
721
- 1. **Item** {+ex:obj} - trailing text makes this invalid
722
- 2. **Another** {+ex:obj2} more trailing text
723
-
724
- Valid item:
725
- - **Good** {+ex:good .ex:Type}
726
-
727
- After invalid block {ex:after}`);if(e.md.includes(`{=ex:valid}`))throw Error(`Valid subject annotation should be stripped`);if(e.md.includes(`{+ex:good`))throw Error(`Valid list annotation should be stripped`);if(!e.md.includes(`{+ex:obj}`)||!e.md.includes(`{+ex:obj2}`))throw Error(`Invalid mid-line annotation should be preserved as marker`);if(!e.md.includes(`- trailing text`))throw Error(`Trailing text should be preserved`)}}],gt=[...at,...st,...ut,...ft,...mt,...ht],_t=0,vt=0;async function yt(){console.log(`# MD-LD Specification Test Suite
728
- `);let e=[];for(let{name:t,fn:n}of gt)try{n(),e.push({name:t,status:`passed`}),_t++,console.log(`✓ ${t}`)}catch(n){e.push({name:t,status:`failed`,error:n.message}),vt++,console.log(`✗ ${t}`),console.log(` ${n.message}`)}return console.log(`\n${`-`.repeat(60)}`),console.log(`Results: ${_t} passed, ${vt} failed, ${gt.length} total`),vt>0&&process?.exit(1),e}typeof process<`u`&&import.meta.url===`file://${process.argv[1]}`&&yt();var bt=t((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),xt=t((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),St=t((e=>{var t=bt(),n=xt(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(B(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||ve(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(B(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(B(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return pe(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ge(e).length;default:if(i)return r?-1:pe(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return P(this,t,n);case`utf8`:case`utf-8`:return k(this,t,n);case`ascii`:return M(this,t,n);case`latin1`:case`binary`:return N(this,t,n);case`base64`:return O(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return te(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?k(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(B(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,ve(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(ve(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return _e(pe(t,e.length-n),e,n,r)}function E(e,t,n,r){return _e(me(t),e,n,r)}function D(e,t,n,r){return _e(ge(t),e,n,r)}function ee(e,t,n,r){return _e(he(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ee(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function k(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return j(r)}var A=4096;function j(e){let t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=A));return n}function M(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=V[e[r]];return i}function te(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function F(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=ye(function(e){e>>>=0,le(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ue(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=ye(function(e){e>>>=0,le(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ue(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=ye(function(e){e>>>=0,le(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ue(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=ye(function(e){e>>>=0,le(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ue(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!1,52,8)};function I(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;I(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;I(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ne(e,t,n,r,i){ce(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function re(e,t,n,r,i){ce(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=ye(function(e,t=0){return ne(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=ye(function(e,t=0){return re(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);I(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);I(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=ye(function(e,t=0){return ne(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=ye(function(e,t=0){return re(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function L(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function R(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)};function ie(e,t,r,i,a){return t=+t,r>>>=0,a||L(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return ie(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return ie(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var z={};function ae(e,t,n){z[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ae(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ae(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ae(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=oe(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=oe(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function oe(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function se(e,t,n){le(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&ue(t,e.length-(n+1))}function ce(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new z.ERR_OUT_OF_RANGE(`value`,i,e)}se(r,i,a)}function le(e,t){if(typeof e!=`number`)throw new z.ERR_INVALID_ARG_TYPE(t,`number`,e)}function ue(e,t,n){throw Math.floor(e)===e?t<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(le(e,n),new z.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var de=/[^+/0-9A-Za-z-_]/g;function fe(e){if(e=e.split(`=`)[0],e=e.trim().replace(de,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function pe(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function me(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function he(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ge(e){return t.toByteArray(fe(e))}function _e(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ve(e){return e!==e}var V=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function ye(e){return typeof BigInt>`u`?be:e}function be(){throw Error(`BigInt not supported`)}})),Ct=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,wt=`http://www.w3.org/2001/XMLSchema#`,Tt=`http://www.w3.org/2000/10/swap/`,Z={xsd:{decimal:`${wt}decimal`,boolean:`${wt}boolean`,double:`${wt}double`,integer:`${wt}integer`,string:`${wt}string`},rdf:{type:`${Ct}type`,nil:`${Ct}nil`,first:`${Ct}first`,rest:`${Ct}rest`,langString:`${Ct}langString`,dirLangString:`${Ct}dirLangString`,reifies:`${Ct}reifies`},owl:{sameAs:`http://www.w3.org/2002/07/owl#sameAs`},r:{forSome:`${Tt}reify#forSome`,forAll:`${Tt}reify#forAll`},log:{implies:`${Tt}log#implies`,isImpliedBy:`${Tt}log#isImpliedBy`}},Et=St(),{xsd:Dt}=Z,Ot=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,kt={"\\":`\\`,"'":`'`,'"':`"`,n:`
729
- `,r:`\r`,t:` `,f:`\f`,b:`\b`,_:`_`,"~":`~`,".":`.`,"-":`-`,"!":`!`,$:`$`,"&":`&`,"(":`(`,")":`)`,"*":`*`,"+":`+`,",":`,`,";":`;`,"=":`=`,"/":`/`,"?":`?`,"#":`#`,"@":`@`,"%":`%`},At=/[\x00-\x20<>\\"\{\}\|\^\`]/,jt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_dircode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Mt=/$0^/,Nt=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i,this._dircode=/^--(ltr)|(rtl)/,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e||={},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let e in this)!(e in jt)&&this[e]instanceof RegExp&&(this[e]=Mt)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,o;for(;e=this._newline.exec(n);)this.comments&&(o=this._comment.exec(e[0]))&&i(`comment`,o[1],``,this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(o=this._comment.exec(n))&&i(`comment`,o[1],``,this._line,n.length),n=null,i(`eof`,``,``,this._line,0)),this._input=n;let s=this._line,c=n[0],l=``,u=``,d=``,f=null,p=0,m=!1;switch(c){case`^`:if(n.length<3)break;if(n[1]===`^`){if(this._previousMarker=`^^`,n=n.substr(2),n[0]!==`<`){m=!0;break}}else{this._n3Mode&&(p=1,l=`^`);break}case`<`:if(f=this._unescapedIri.exec(n))l=`IRI`,u=f[1];else if(f=this._iri.exec(n)){if(u=this._unescape(f[1]),u===null||At.test(u))return a(this);l=`IRI`}else n.length>2&&n[1]===`<`&&n[2]===`(`?(l=`<<(`,p=3):!this._lineMode&&n.length>(t?1:2)&&n[1]===`<`?(l=`<<`,p=2):this._n3Mode&&n.length>1&&n[1]===`=`&&(p=2,this._isImpliedBy?(l=`abbreviation`,u=`<`):(l=`inverse`,u=`>`));break;case`>`:n.length>1&&n[1]===`>`&&(l=`>>`,p=2);break;case`_`:((f=this._blank.exec(n))||t&&(f=this._blank.exec(`${n} `)))&&(l=`blank`,d=`_`,u=f[1]);break;case`"`:if(f=this._simpleQuotedString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0);break;case`'`:if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0)}break;case`?`:this._n3Mode&&(f=this._variable.exec(n))&&(l=`var`,u=f[0]);break;case`@`:this._previousMarker===`literal`&&(f=this._langcode.exec(n))&&f[1]!==`version`?(l=`langcode`,u=f[1]):(f=this._atKeyword.exec(n))&&(l=f[0]);break;case`.`:if(n.length===1?t:n[1]<`0`||n[1]>`9`){l=`.`,p=1;break}case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:case`+`:case`-`:if(n[1]===`-`){this._previousMarker===`langcode`&&(f=this._dircode.exec(n))&&(l=`dircode`,p=2,u=f[1]||f[2],p=u.length+2);break}(f=this._number.exec(n)||t&&(f=this._number.exec(`${n} `)))&&(l=`literal`,u=f[0],d=typeof f[1]==`string`?Dt.double:typeof f[2]==`string`?Dt.decimal:Dt.integer);break;case`B`:case`b`:case`p`:case`P`:case`G`:case`g`:case`V`:case`v`:(f=this._keyword.exec(n))?l=f[0].toUpperCase():m=!0;break;case`f`:case`t`:(f=this._boolean.exec(n))?(l=`literal`,u=f[0],d=Dt.boolean):m=!0;break;case`a`:(f=this._shortPredicates.exec(n))?(l=`abbreviation`,u=`a`):m=!0;break;case`=`:this._n3Mode&&n.length>1&&(l=`abbreviation`,n[1]===`>`?(p=2,u=`>`):(p=1,u=`=`));break;case`!`:if(!this._n3Mode)break;case`)`:if(!t&&(n.length===1||n.length===2&&n[1]===`>`))break;if(n.length>2&&n[1]===`>`&&n[2]===`>`){l=`)>>`,p=3;break}case`,`:case`;`:case`[`:case`]`:case`(`:case`}`:case`~`:this._lineMode||(p=1,l=c);break;case`{`:!this._lineMode&&n.length>=2&&(n[1]===`|`?(l=`{|`,p=2):(l=c,p=1));break;case`|`:n.length>=2&&n[1]===`}`&&(l=`|}`,p=2);break;default:m=!0}if(m&&((this._previousMarker===`@prefix`||this._previousMarker===`PREFIX`)&&(f=this._prefix.exec(n))?(l=`prefix`,u=f[1]||``):((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(`${n} `)))&&(l=`prefixed`,d=f[1]||``,u=this._unescape(f[2]))),this._previousMarker===`^^`)switch(l){case`prefixed`:l=`type`;break;case`IRI`:l=`typeIRI`;break;default:l=``}if(!l)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;let h=p||f[0].length,g=i(l,u,d,s,h);this.previousToken=g,this._previousMarker=l,n=n.substr(h,n.length)}function i(t,i,a,o,s){let c=n?r-n.length:r,l={type:t,value:i,prefix:a,line:o,start:c,end:c+s};return e(null,l),l}function a(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1,n=e.replace(Ot,(e,n,r,i)=>{if(typeof n==`string`)return String.fromCharCode(Number.parseInt(n,16));if(typeof r==`string`){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(e&1023))}return i in kt?kt[i]:(t=!0,``)});return t?null:n}_parseLiteral(e){if(e.length>=3){let t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;e[r-t-1]===`\\`;)t++;if(t%2==0){let t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,a=r+n;if(n===1&&i!==0||n===3&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:a}}r++}this._literalClosingPos=e.length-n+1}return{value:``,matchLength:0}}_syntaxError(e){this._input=null;let t=Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith(``)?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e==`string`)if(this._input=this._readStartingBom(e),typeof t==`function`)queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{let e=[],t;if(this._tokenizeToEnd((n,r)=>n?t=n:e.push(r),!0),t)throw t;return e}else this._pendingBuffer=null,typeof e.setEncoding==`function`&&e.setEncoding(`utf8`),e.on(`data`,e=>{this._input!==null&&e.length!==0&&(this._pendingBuffer&&=(e=Et.Buffer.concat([this._pendingBuffer,e]),null),e[e.length-1]&128?this._pendingBuffer=e:(this._input===void 0?this._input=this._readStartingBom(typeof e==`string`?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))}),e.on(`end`,()=>{typeof this._input==`string`&&this._tokenizeToEnd(t,!0)}),e.on(`error`,t)}},{rdf:Pt,xsd:Ft}=Z,It,Lt=0,Rt={namedNode:qt,blankNode:Jt,variable:Xt,literal:Yt,defaultGraph:Zt,quad:Qt,triple:Qt,fromTerm:$t,fromQuad:en},zt=class e{constructor(e){this.id=e}get value(){return this.id}equals(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},Bt=class extends zt{get termType(){return`NamedNode`}},Vt=class e extends zt{get termType(){return`Literal`}get value(){return this.id.substring(1,this.id.lastIndexOf(`"`))}get language(){let e=this.id,t=e.lastIndexOf(`"`)+1,n=e.lastIndexOf(`--`);return t<e.length&&e[t++]===`@`?(n>t?e.substr(0,n):e).substr(t).toLowerCase():``}get direction(){let e=this.id,t=e.lastIndexOf(`"`),n=e.lastIndexOf(`--`);return n>t&&n+2<e.length?e.substr(n+2).toLowerCase():``}get datatype(){return new Bt(this.datatypeString)}get datatypeString(){let e=this.id,t=e.lastIndexOf(`"`)+1,n=t<e.length?e[t]:``;return n===`^`?e.substr(t+2):n===`@`?e.indexOf(`--`,t)>0?Pt.dirLangString:Pt.langString:Ft.string}equals(t){return t instanceof e?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(this.direction===t.direction||this.direction===``&&!t.direction)&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:`NamedNode`,value:this.datatypeString}}}},Ht=class extends zt{constructor(e){super(`_:${e}`)}get termType(){return`BlankNode`}get value(){return this.id.substr(2)}},Ut=class extends zt{constructor(e){super(`?${e}`)}get termType(){return`Variable`}get value(){return this.id.substr(1)}};It=new class extends zt{constructor(){return super(``),It||this}get termType(){return`DefaultGraph`}equals(e){return this===e||!!e&&this.termType===e.termType}};function Wt(e,t,n){if(t||=Rt,!e)return t.defaultGraph();switch(e[0]){case`?`:return t.variable(e.substr(1));case`_`:return t.blankNode(e.substr(2));case`"`:if(t===Rt)return new Vt(e);if(e[e.length-1]===`"`)return t.literal(e.substr(1,e.length-2));let r=e.lastIndexOf(`"`,e.length-1),i;if(e[r+1]===`@`){i=e.substr(r+2);let t=i.lastIndexOf(`--`);t>0&&t<i.length&&(i={language:i.substr(0,t),direction:i.substr(t+2)})}else i=t.namedNode(e.substr(r+3));return t.literal(e.substr(1,r-1),i);case`[`:e=JSON.parse(e);break;default:if(!n||!Array.isArray(e))return t.namedNode(e)}return t.quad(Wt(e[0],t,!0),Wt(e[1],t,!0),Wt(e[2],t,!0),e[3]&&Wt(e[3],t,!0))}function Gt(e,t){if(typeof e==`string`)return e;if(e instanceof zt&&e.termType!==`Quad`)return e.id;if(!e)return It.id;switch(e.termType){case`NamedNode`:return e.value;case`BlankNode`:return`_:${e.value}`;case`Variable`:return`?${e.value}`;case`DefaultGraph`:return``;case`Literal`:return`"${e.value}"${e.language?`@${e.language}${e.direction?`--${e.direction}`:``}`:e.datatype&&e.datatype.value!==Ft.string?`^^${e.datatype.value}`:``}`;case`Quad`:let n=[Gt(e.subject,!0),Gt(e.predicate,!0),Gt(e.object,!0)];return e.graph&&e.graph.termType!==`DefaultGraph`&&n.push(Gt(e.graph,!0)),t?n:JSON.stringify(n);default:throw Error(`Unexpected termType: ${e.termType}`)}}var Kt=class extends zt{constructor(e,t,n,r){super(``),this._subject=e,this._predicate=t,this._object=n,this._graph=r||It}get termType(){return`Quad`}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function qt(e){return new Bt(e)}function Jt(e){return new Ht(e||`n3-${Lt++}`)}function Yt(e,t){if(typeof t==`string`)return new Vt(`"${e}"@${t.toLowerCase()}`);if(t!==void 0&&!(`termType`in t))return new Vt(`"${e}"@${t.language.toLowerCase()}${t.direction?`--${t.direction.toLowerCase()}`:``}`);let n=t?t.value:``;return n===``&&(typeof e==`boolean`?n=Ft.boolean:typeof e==`number`&&(Number.isFinite(e)?n=Number.isInteger(e)?Ft.integer:Ft.double:(n=Ft.double,Number.isNaN(e)||(e=e>0?`INF`:`-INF`)))),n===``||n===Ft.string?new Vt(`"${e}"`):new Vt(`"${e}"^^${n}`)}function Xt(e){return new Ut(e)}function Zt(){return It}function Qt(e,t,n,r){return new Kt(e,t,n,r)}function $t(e){if(e instanceof zt)return e;switch(e.termType){case`NamedNode`:return qt(e.value);case`BlankNode`:return Jt(e.value);case`Variable`:return Xt(e.value);case`DefaultGraph`:return It;case`Literal`:return Yt(e.value,e.language||e.datatype);case`Quad`:return en(e);default:throw Error(`Unexpected termType: ${e.termType}`)}}function en(e){if(e instanceof Kt)return e;if(e.termType!==`Quad`)throw Error(`Unexpected termType: ${e.termType}`);return Qt($t(e.subject),$t(e.predicate),$t(e.object),$t(e.graph))}var tn=0,nn=class e{constructor(e){this._contextStack=[],this._graph=null,e||={},this._setBase(e.baseIRI),e.factory&&an(this,e.factory);let t=typeof e.format==`string`?e.format.match(/\w*$/)[0].toLowerCase():``,n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),s=i||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||o),this._isImpliedBy=e.isImpliedBy,s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix=typeof e.blankNodePrefix==`string`?e.blankNodePrefix.replace(/^(?!_:)/,`_:`):``,this._lexer=e.lexer||new Nt({lineMode:s,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){tn=0}_setBase(e){if(!e)this._base=``,this._basePath=``;else{let t=e.indexOf(`#`);t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf(`/`)<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,``),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,n,r,i){let a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:``,quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:`.`,this._quantified=Object.create(this._quantified))}_restoreContext(e,t){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case`eof`:return this._graph===null?(delete this._prefixes._,this._callback(null,null,this._prefixes)):this._error(`Unclosed graph`,e);case`PREFIX`:this._sparqlStyle=!0;case`@prefix`:return this._readPrefix;case`BASE`:this._sparqlStyle=!0;case`@base`:return this._readBaseIRI;case`VERSION`:this._sparqlStyle=!0;case`@version`:return this._readVersion;case`{`:if(this._supportsNamedGraphs)return this._graph=``,this._subject=null,this._readSubject;case`GRAPH`:if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case`IRI`:case`typeIRI`:let t=this._resolveIRI(e.value);if(t===null)return this._error(`Invalid IRI`,e);n=this._factory.namedNode(t);break;case`type`:case`prefixed`:let r=this._prefixes[e.prefix];if(r===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(r+e.value);break;case`blank`:n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case`var`:n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case`[`:return this._saveContext(`blank`,this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case`(`:let t=this._contextStack;return(t.length&&t[t.length-1]).type===`<<`?this._error(`Unexpected list in reified triple`,e):(this._saveContext(`list`,this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem);case`{`:return this._n3Mode?(this._saveContext(`formula`,this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error(`Unexpected graph`,e);case`}`:return this._readPunctuation(e);case`@forSome`:return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=`blankNode`,this._readQuantifierList):this._error(`Unexpected "@forSome"`,e);case`@forAll`:return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=`variable`,this._readQuantifierList):this._error(`Unexpected "@forAll"`,e);case`literal`:if(!this._n3Mode)return this._error(`Unexpected literal`,e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case`<<(`:return this._n3Mode?(this._saveContext(`<<(`,this._graph,null,null,null),this._graph=null,this._readSubject):this._error(`Disallowed triple term as subject`,e);case`<<`:return this._saveContext(`<<`,this._graph,null,null,null),this._graph=null,this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let t=e.type;switch(t){case`inverse`:this._inversePredicate=!0;case`abbreviation`:this._predicate=this.ABBREVIATIONS[e.value];break;case`.`:case`]`:case`}`:case`|}`:return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t===`]`?this._readBlankNodeTail(e):this._readPunctuation(e));case`;`:return this._predicate===null?this._error(`Expected predicate but got ;`,e):this._readPredicate;case`[`:if(this._n3Mode)return this._saveContext(`blank`,this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case`blank`:if(!this._n3Mode)return this._error(`Disallowed blank node as predicate`,e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._validAnnotation=!0,this._readObject}_readObject(e){switch(e.type){case`literal`:if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case`[`:return this._saveContext(`blank`,this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case`(`:let t=this._contextStack;return(t.length&&t[t.length-1]).type===`<<`?this._error(`Unexpected list in reified triple`,e):(this._saveContext(`list`,this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem);case`{`:return this._n3Mode?(this._saveContext(`formula`,this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error(`Unexpected graph`,e);case`<<(`:return this._saveContext(`<<(`,this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case`<<`:return this._saveContext(`<<`,this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type===`{`?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type===`{`?(this._graph=this._subject,this._subject=null,this._readSubject):this._error(`Expected graph but got ${e.type}`,e)}_readBlankNodeHead(e){if(e.type===`]`)return this._subject=null,this._readBlankNodeTail(e);{let t=this._contextStack;return(t.length>1&&t[t.length-2]).type===`<<`?this._error(`Unexpected compound blank node expression in reified triple`,e):(this._predicate=null,this._readPredicate(e))}}_readBlankNodeTail(e){if(e.type!==`]`)return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let t=this._predicate===null;return this._restoreContext(`blank`,e),this._object===null?this._predicate===null?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._readObject:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case`.`:case`}`:return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem,i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case`[`:this._saveContext(`blank`,this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),r=this._readBlankNodeHead;break;case`(`:this._saveContext(`list`,this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case`)`:if(this._restoreContext(`list`,e),a.length!==0&&a[a.length-1].type===`list`&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case`literal`:e.prefix.length===0?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),r=this._getContextEndReader());break;case`{`:return this._n3Mode?(this._saveContext(`formula`,this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error(`Unexpected graph`,e);case`<<`:this._saveContext(`<<`,this._graph,null,null,null),this._graph=null,r=this._readSubject;break;default:if((t=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),e.type===`<<`&&(a[a.length-1].subject=this._subject),i===null?o.predicate===null?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),t!==null){if(this._n3Mode&&(e.type===`IRI`||e.type===`prefixed`))return this._saveContext(`item`,this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,t){let n=this._factory.literal(this._literalValue),r;switch(e.type){case`type`:case`typeIRI`:let i=this._readEntity(e);if(i===void 0)return;if(i.value===Z.rdf.langString||i.value===Z.rdf.dirLangString)return this._error(`Detected illegal (directional) languaged-tagged string with explicit datatype`,e);n=this._factory.literal(this._literalValue,i),e=null;break;case`langcode`:if(e.value.split(`-`).some(e=>e.length>8))return this._error(`Detected language tag with subtag longer than 8 characters`,e);n=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,r=this._readDirCode.bind(this,t);break}return{token:e,literal:n,readCb:r}}_readDirCode(e,t,n){if(n.type===`dircode`){let t=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:n.value});e===`subject`?this._subject=t:this._object=t,this._literalLanguage=void 0,n=null}return e===`subject`?n===null?this._readPredicateOrNamedGraph:this._readPredicateOrNamedGraph(n):this._completeObjectLiteralPost(n,t)}_completeSubjectLiteral(e){let t=this._completeLiteral(e,`subject`);return this._subject=t.literal,t.readCb?t.readCb.bind(this,!1):this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){let n=this._completeLiteral(e,`object`);if(n)return this._object=n.literal,n.readCb?n.readCb.bind(this,t):this._completeObjectLiteralPost(n.token,t)}_completeObjectLiteralPost(e,t){return t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e))}_readFormulaTail(e){return e.type===`}`?(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(`formula`,e),this._object===null?this._readPredicate:this._getContextEndReader()):this._readPunctuation(e)}_readPunctuation(e){let t,n=this._graph,r=!1,i=this._subject,a=this._inversePredicate;switch(e.type){case`}`:if(this._graph===null)return this._error(`Unexpected graph closing`,e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case`.`:this._subject=null,this._tripleTerm=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case`;`:t=this._readPredicate;break;case`,`:t=this._readObject;break;case`~`:t=this._readReifierInAnnotation,r=!0;break;case`{|`:this._subject=this._readTripleTerm(),this._validAnnotation=!1,r=!0,t=this._readPredicate;break;case`|}`:if(!this._annotation)return this._error(`Unexpected annotation syntax closing`,e);if(!this._validAnnotation)return this._error(`Annotation block can not be empty`,e);this._subject=null,this._annotation=!1,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null&&(!r||r&&!this._annotation)){let e=this._predicate,t=this._object;a?this._emit(t,e,i,n):this._emit(i,e,t,n)}return r&&(this._annotation=!0),t}_readBlankNodePunctuation(e){let t;switch(e.type){case`;`:t=this._readPredicate;break;case`,`:t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type===`.`?this._readInTopContext:this._error(`Expected dot to follow quad`,e)}_readPrefix(e){return e.type===`prefix`?(this._prefix=e.value,this._readPrefixIRI):this._error(`Expected prefix to follow @prefix`,e)}_readPrefixIRI(e){if(e.type!==`IRI`)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){let t=e.type===`IRI`&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error(`Expected valid IRI to follow base declaration`,e)}_isValidVersion(t){return this._parseUnsupportedVersions||e.SUPPORTED_VERSIONS.includes(t)}_readVersion(e){return e.type===`literal`?e.end-e.start===e.value.length+2?(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,e)):this._error(`Version declarations must use single quotes`,e):this._error(`Expected literal to follow version declaration`,e)}_readNamedGraphLabel(e){switch(e.type){case`IRI`:case`blank`:case`prefixed`:return this._readSubject(e),this._readGraph;case`[`:return this._readNamedGraphBlankLabel;default:return this._error(`Invalid graph label`,e)}}_readNamedGraphBlankLabel(e){return e.type===`]`?(this._subject=this._factory.blankNode(),this._readGraph):this._error(`Invalid graph label`,e)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type===`.`?this._readInTopContext:this._error(`Expected declaration to end with a dot`,e)}_readQuantifierList(e){let t;switch(e.type){case`IRI`:case`prefixed`:if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===`,`?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case`!`:return this._readForwardPath;case`^`:return this._readBackwardPath;default:let t=this._contextStack,n=t.length&&t[t.length-1];if(n&&n.type===`item`){let t=this._subject;this._restoreContext(`item`,e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n,r=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){let t=this._factory.blankNode(),n,r;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==`)>>`)return this._error(`Expected )>> but got ${e.type}`,e);let t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(`<<(`,e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type===`~`?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==`>>`)return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let t=this._readTripleTerm();this._restoreContext(`<<`,e);let n=this._contextStack,r=n.length&&n[n.length-1];return r&&r.type===`list`?(this._emit(this._subject,this.RDF_FIRST,t,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=t,this._readPredicateOrReifierTripleEnd):(this._object=t,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type===`.`?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return e.type===`IRI`||e.type===`typeIRI`||e.type===`type`||e.type===`prefixed`||e.type===`blank`||e.type===`var`?(this._reifier=this._readEntity(e),this._readPunctuation):(this._readTripleTerm(),this._subject=null,this._readPunctuation(e))}_readTripleTerm(){let e=this._contextStack,t=e.length&&e[e.length-1],n=t?t.graph:void 0,r=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._factory.quad(this._subject,this._predicate,this._object),this._emit(r,this.RDF_REIFIES,this._tripleTerm,n||this.DEFAULTGRAPH),r}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case`blank`:return this._readBlankNodeTail;case`list`:return this._readListItem;case`formula`:return this._readFormulaTail;case`<<(`:return this._readTripleTermTail;case`<<`:return this._readReifiedTripleTailOrReifier}}_emit(e,t,n,r){this._callback(null,this._factory.quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){let n=Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=rn}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case`#`:return this._base+e;case`?`:return this._base.replace(/(?:\?.*)?$/,e);case`/`:return(e[1]===`/`?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let t=e.length,n=``,r=-1,i=-1,a=0,o=`/`;for(;r<t;){switch(o){case`:`:if(i<0&&e[++r]===`/`&&e[++r]===`/`)for(;(i=r+1)<t&&e[i]!==`/`;)r=i;break;case`?`:case`#`:r=t;break;case`/`:if(e[r+1]===`.`)switch(o=e[++r+1],o){case`/`:n+=e.substring(a,r-1),a=r+1;break;case void 0:case`?`:case`#`:return n+e.substring(a,r)+e.substr(r+1);case`.`:if(o=e[++r+1],o===void 0||o===`/`||o===`?`||o===`#`){if(n+=e.substring(a,r-2),(a=n.lastIndexOf(`/`))>=i&&(n=n.substr(0,a)),o!==`/`)return`${n}/${e.substr(r+1)}`;a=r+1}}}o=e[++r]}return n+e.substring(a)}parse(e,t,n,r){let i,a,o,s;if(t&&(t.onQuad||t.onPrefix||t.onComment||t.onVersion)?(i=t.onQuad,a=t.onPrefix,o=t.onComment,s=t.onVersion):(i=t,a=n,s=r),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${tn++}_`,this._prefixCallback=a||rn,this._versionCallback=s||rn,this._inversePredicate=!1,this._quantified=Object.create(null),!i){let t=[],n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every(e=>this._readCallback=this._readCallback(e)),n)throw n;return t}let c=(e,t)=>{e===null?this._readCallback&&=this._readCallback(t):(this._callback(e),this._callback=rn)};o&&(this._lexer.comments=!0,c=(e,t)=>{e===null?this._readCallback&&(t.type===`comment`?o(t.value):this._readCallback=this._readCallback(t)):(this._callback(e),this._callback=rn)}),this._callback=i,this._lexer.tokenize(e,c)}};function rn(){}function an(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(Z.rdf.first),e.RDF_REST=t.namedNode(Z.rdf.rest),e.RDF_NIL=t.namedNode(Z.rdf.nil),e.RDF_REIFIES=t.namedNode(Z.rdf.reifies),e.N3_FORALL=t.namedNode(Z.r.forAll),e.N3_FORSOME=t.namedNode(Z.r.forSome),e.ABBREVIATIONS={a:t.namedNode(Z.rdf.type),"=":t.namedNode(Z.owl.sameAs),">":t.namedNode(Z.log.implies),"<":t.namedNode(Z.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode(`urn:n3:quantifiers`)}nn.SUPPORTED_VERSIONS=[`1.2`,`1.2-basic`,`1.1`],an(nn.prototype,Rt);function on(e){return!!e&&e.termType===`DefaultGraph`}function sn(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,`\\$&`)}var cn=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ln=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,un=`./`,dn=`../`,fn=`?`,pn=`#`,mn=class e{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=Array(e.length+1)}static supports(e){return!cn.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!e.supports(this.base))return this._baseMatcher=/.^/;let t=/^[^:]*:\/*/.exec(this.base)[0],n=[`^`,sn(t)],r=[],i=[],a=/[^/?#]*([/?#])/y,o,s=0,c=0,l=a.lastIndex=t.length;for(;!s&&!c&&(o=a.exec(this.base));)o[1]===pn?c=a.lastIndex-1:(n.push(sn(o[0]),`(?:`),r.push(`)?`),o[1]===fn?(s=l=a.lastIndex,c=this.base.indexOf(pn,s),this._pathReplacements[s]=fn):i.push(l=a.lastIndex));for(let e=0;e<i.length;e++)this._pathReplacements[i[e]]=dn.repeat(i.length-e-1);return this._pathReplacements[i[i.length-1]]=un,this._baseLength=c>0?c:this.base.length,n.push(sn(this.base.substring(l,this._baseLength)),s?`(?:#|$)`:`(?:[?#]|$)`),this._baseMatcher=new RegExp([...n,...r].join(``))}toRelative(e){let t=this._getBaseMatcher().exec(e);if(!t)return e;let n=t[0].length;if(n===this._baseLength&&n===e.length)return``;let r=this._pathReplacements[n];if(r){let t=e.substring(n);return r!==fn&&!ln.test(t)?e:r===un&&/^[^?#]/.test(t)?t:r+t}return e.substring(n-1)}},hn=Rt.defaultGraph(),{rdf:gn,xsd:_n}=Z,vn=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,yn=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,bn={"\\":`\\\\`,'"':`\\"`," ":`\\t`,"\n":`\\n`,"\r":`\\r`,"\b":`\\b`,"\f":`\\f`},xn=class extends zt{equals(e){return e===this}},Sn=class{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!=`function`&&(t=e,e=null),t||={},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let e=``;this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=hn,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new mn(t.baseIRI)))}get _inDefaultGraph(){return hn.equals(this._graph)}_write(e,t){this._outputStream.write(e,`utf8`,t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((this._subject===null?``:this._inDefaultGraph?`.
730
- `:`
731
- }
732
- `)+(hn.equals(r)?``:`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(this._subject===null?``:`.
733
- `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:` .
734
- `}`}quadsToString(e){let t=``;for(let n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_encodeSubject(e){return e.termType===`Quad`?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!==`NamedNode`)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),`id`in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),vn.test(t)&&(t=t.replace(yn,Cn));let n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;vn.test(t)&&(t=t.replace(yn,Cn));let n=e.direction?`--${e.direction}`:``;if(e.language)return`"${t}"@${e.language}${n}`;if(this._lineMode){if(e.datatype.value===_n.string)return`"${t}"`}else switch(e.datatype.value){case _n.string:return`"${t}"`;case _n.boolean:if(t===`true`||t===`false`)return t;break;case _n.integer:if(/^[+-]?\d+$/.test(t))return t;break;case _n.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case _n.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===gn.type?`a`:this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case`Quad`:return this._encodeQuad(e);case`Literal`:return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<(${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${on(r)?``:` ${this._encodeIriOrBlank(r)}`})>>`}_blockedWrite(){throw Error(`Cannot write because the writer has been closed.`)}addQuad(e,t,n,r,i){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof r==`function`?this._writeQuad(e,t,n,hn,r):this._writeQuad(e,t,n,r||hn,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){let r={};r[e]=t,this.addPrefixes(r,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let t in e){let r=e[t];typeof r!=`string`&&(r=r.value),n=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
735
- `:`
736
- }
737
- `),this._subject=null,this._graph=``),this._prefixIRIs[r]=t+=`:`,this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e=``,t=``;for(let n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?`|`:``)+this._prefixIRIs[n];e=sn(e,/[\]\/\(\)\*\+\?\.\\\$]/g,`\\$&`),this._prefixRegex=RegExp(`^(?:${t})[^\/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?`
738
- `:``,t)}blank(e,t){let n=e,r,i;switch(e===void 0?n=[]:e.termType?n=[{predicate:e,object:t}]:`length`in e||(n=[e]),i=n.length){case 0:return new xn(`[]`);case 1:if(r=n[0],!(r.object instanceof xn))return new xn(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t=`[`;for(let a=0;a<i;a++)r=n[a],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(a?`;
739
- `:`
740
- `)+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new xn(`${t}\n]`)}}list(e){let t=e&&e.length||0,n=Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new xn(`(${n.join(` `)})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
741
- `:`
742
- }
743
- `),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,r)=>{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}};function Cn(e){let t=bn[e];return t===void 0&&(e.length===1?(t=e.charCodeAt(0).toString(16),t=`\\u0000`.substr(0,6-t.length)+t):(t=((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)+9216).toString(16),t=`\\U00000000`.substr(0,10-t.length)+t)),t}var Q=t(((e,t)=>{t.exports={AggregateError:class extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t=``;for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name=`AggregateError`,this.errors=e}},ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:2**53-1,NumberMIN_SAFE_INTEGER:-(2**53-1),NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol(`Symbol.dispose`),SymbolAsyncDispose:Symbol.asyncDispose||Symbol(`Symbol.asyncDispose`),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array}})),wn=t(((e,t)=>{t.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[e,n]){let r=t.shift();return n===`f`?r.toFixed(6):n===`j`?JSON.stringify(r):n===`s`&&typeof r==`object`?`${r.constructor===Object?``:r.constructor.name} {}`.trim():r.toString()})},inspect(e){switch(typeof e){case`string`:if(e.includes(`'`)){if(!e.includes(`"`))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case`number`:return isNaN(e)?`NaN`:Object.is(e,-0)?String(e):e;case`bigint`:return`${String(e)}n`;case`boolean`:case`undefined`:return String(e);case`object`:return`{}`}}}})),Tn=t(((e,t)=>{var{format:n,inspect:r}=wn(),{AggregateError:i}=Q(),a=globalThis.AggregateError||i,o=Symbol(`kIsNodeError`),s=[`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`],c=/^([A-Z][a-z0-9]*)+$/,l=`__node_internal_`,u={};function d(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function f(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function p(e,t,r){if(typeof t==`function`)return d(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:n(t,...r)}function m(e,t,n){n||=Error;class r extends n{constructor(...n){super(p(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[o]=!0,u[e]=r}function h(e){let t=l+e.name;return Object.defineProperty(e,`name`,{value:t}),e}function g(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let n=new a([t,e],t.message);return n.code=t.code,n}return e||t}var _=class extends Error{constructor(e=`The operation was aborted`,t=void 0){if(t!==void 0&&typeof t!=`object`)throw new u.ERR_INVALID_ARG_TYPE(`options`,`Object`,t);super(e,t),this.code=`ABORT_ERR`,this.name=`AbortError`}};m(`ERR_ASSERTION`,`%s`,Error),m(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{d(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let i=`The `;e.endsWith(` argument`)?i+=`${e} `:i+=`"${e}" ${e.includes(`.`)?`property`:`argument`} `,i+=`must be `;let a=[],o=[],l=[];for(let e of t)d(typeof e==`string`,`All expected entries have to be of type string`),s.includes(e)?a.push(e.toLowerCase()):c.test(e)?o.push(e):(d(e!==`object`,`The value "object" should be written as "Object"`),l.push(e));if(o.length>0){let e=a.indexOf(`object`);e!==-1&&(a.splice(a,e,1),o.push(`Object`))}if(a.length>0){switch(a.length){case 1:i+=`of type ${a[0]}`;break;case 2:i+=`one of type ${a[0]} or ${a[1]}`;break;default:{let e=a.pop();i+=`one of type ${a.join(`, `)}, or ${e}`}}(o.length>0||l.length>0)&&(i+=` or `)}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`an instance of ${o.join(`, `)}, or ${e}`}}l.length>0&&(i+=` or `)}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(i+=`an `),i+=`${l[0]}`;break;case 2:i+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();i+=`one of ${l.join(`, `)}, or ${e}`}}if(n==null)i+=`. Received ${n}`;else if(typeof n==`function`&&n.name)i+=`. Received function ${n.name}`;else if(typeof n==`object`){var u;if((u=n.constructor)!=null&&u.name)i+=`. Received an instance of ${n.constructor.name}`;else{let e=r(n,{depth:-1});i+=`. Received ${e}`}}else{let e=r(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof n} (${e})`}return i},TypeError),m(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let i=r(t);return i.length>128&&(i=i.slice(0,128)+`...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${i}`},TypeError),m(`ERR_INVALID_RETURN_VALUE`,(e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${n!=null&&(r=n.constructor)!=null&&r.name?`instance of ${n.constructor.name}`:`type ${typeof n}`}.`},TypeError),m(`ERR_MISSING_ARGS`,(...e)=>{d(e.length>0,`At least one arg needs to be specified`);let t,n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(` or `),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(`, `)}, and ${n} arguments`}break}return`${t} must be specified`},TypeError),m(`ERR_OUT_OF_RANGE`,(e,t,n)=>{d(t,`Missing "range" argument`);let i;if(Number.isInteger(n)&&Math.abs(n)>2**32)i=f(String(n));else if(typeof n==`bigint`){i=String(n);let e=BigInt(2)**BigInt(32);(n>e||n<-e)&&(i=f(i)),i+=`n`}else i=r(n);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),m(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`,Error),m(`ERR_METHOD_NOT_IMPLEMENTED`,`The %s method is not implemented`,Error),m(`ERR_STREAM_ALREADY_FINISHED`,`Cannot call %s after a stream was finished`,Error),m(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`,Error),m(`ERR_STREAM_DESTROYED`,`Cannot call %s after a stream was destroyed`,Error),m(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),m(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`,Error),m(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`,Error),m(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`,Error),m(`ERR_STREAM_WRITE_AFTER_END`,`write after end`,Error),m(`ERR_UNKNOWN_ENCODING`,`Unknown encoding: %s`,TypeError),t.exports={AbortError:_,aggregateTwoErrors:h(g),hideStackFrames:h,codes:u}})),En=t(((e,t)=>{var{AbortController:n,AbortSignal:r}=typeof self<`u`?self:typeof window<`u`?window:void 0;t.exports=n,t.exports.AbortSignal=r,t.exports.default=n})),Dn=t(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),On=t(((e,t)=>{var n=St(),{format:r,inspect:i}=wn(),{codes:{ERR_INVALID_ARG_TYPE:a}}=Tn(),{kResistStopPropagation:o,AggregateError:s,SymbolDispose:c}=Q(),l=globalThis.AbortSignal||En().AbortSignal,u=globalThis.AbortController||En().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||n.Blob,p=f===void 0?function(e){return!1}:function(e){return e instanceof f},m=(e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new a(t,`AbortSignal`,e)},h=(e,t)=>{if(typeof e!=`function`)throw new a(t,`Function`,e)};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},promisify(e){return new Promise((t,n)=>{e((e,...r)=>e?n(e):t(...r))})},debuglog(){return function(){}},format:r,inspect:i,types:{isAsyncFunction(e){return e instanceof d},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:p,deprecate(e,t){return e},addAbortListener:Dn().addAbortListener||function(e,t){if(e===void 0)throw new a(`signal`,`AbortSignal`,e);m(e,`signal`),h(t,`listener`);let n;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener(`abort`,t,{__proto__:null,once:!0,[o]:!0}),n=()=>{e.removeEventListener(`abort`,t)}),{__proto__:null,[c](){var e;(e=n)==null||e()}}},AbortSignalAny:l.any||function(e){if(e.length===1)return e[0];let t=new u,n=()=>t.abort();return e.forEach(e=>{m(e,`signals`),e.addEventListener(`abort`,n,{once:!0})}),t.signal.addEventListener(`abort`,()=>{e.forEach(e=>e.removeEventListener(`abort`,n))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for(`nodejs.util.promisify.custom`)})),kn=t(((e,t)=>{var{ArrayIsArray:n,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:o,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:l,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:h}=Q(),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:y,ERR_OUT_OF_RANGE:b,ERR_UNKNOWN_SIGNAL:x}}=Tn(),{normalizeEncoding:S}=On(),{isAsyncFunction:C,isArrayBufferView:w}=On().types,T={};function E(e){return e===(e|0)}function D(e){return e===e>>>0}var ee=/^[0-7]+$/,O=`must be a 32-bit unsigned integer or an octal string`;function k(e,t,n){if(e===void 0&&(e=n),typeof e==`string`){if(f(ee,e)===null)throw new y(t,e,O);e=u(e,8)}return M(e,t),e}var A=g((e,t,n=l,r=c)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);if(e<n||e>r)throw new b(t,`>= ${n} && <= ${r}`,e)}),j=g((e,t,n=-2147483648,r=2147483647)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);if(e<n||e>r)throw new b(t,`>= ${n} && <= ${r}`,e)}),M=g((e,t,n=!1)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);let r=+!!n,i=4294967295;if(e<r||e>i)throw new b(t,`>= ${r} && <= ${i}`,e)});function N(e,t){if(typeof e!=`string`)throw new v(t,`string`,e)}function P(e,t,n=void 0,r){if(typeof e!=`number`)throw new v(t,`number`,e);if(n!=null&&e<n||r!=null&&e>r||(n!=null||r!=null)&&s(e))throw new b(t,`${n==null?``:`>= ${n}`}${n!=null&&r!=null?` && `:``}${r==null?``:`<= ${r}`}`,e)}var te=g((e,t,n)=>{if(!r(n,e))throw new y(t,e,`must be one of: `+i(a(n,e=>typeof e==`string`?`'${e}'`:p(e)),`, `))});function F(e,t){if(typeof e!=`boolean`)throw new v(t,`boolean`,e)}function I(e,t,n){return e==null||!d(e,t)?n:e[t]}var ne=g((e,t,r=null)=>{let i=I(r,`allowArray`,!1),a=I(r,`allowFunction`,!1);if(!I(r,`nullable`,!1)&&e===null||!i&&n(e)||typeof e!=`object`&&(!a||typeof e!=`function`))throw new v(t,`Object`,e)}),re=g((e,t)=>{if(e!=null&&typeof e!=`object`&&typeof e!=`function`)throw new v(t,`a dictionary`,e)}),L=g((e,t,r=0)=>{if(!n(e))throw new v(t,`Array`,e);if(e.length<r)throw new y(t,e,`must be longer than ${r}`)});function R(e,t){L(e,t);for(let n=0;n<e.length;n++)N(e[n],`${t}[${n}]`)}function ie(e,t){L(e,t);for(let n=0;n<e.length;n++)F(e[n],`${t}[${n}]`)}function z(e,t){L(e,t);for(let n=0;n<e.length;n++){let r=e[n],i=`${t}[${n}]`;if(r==null)throw new v(i,`AbortSignal`,r);le(r,i)}}function ae(e,t=`signal`){if(N(e,t),T[e]===void 0)throw T[m(e)]===void 0?new x(e):new x(e+` (signals must use all capital letters)`)}var oe=g((e,t=`buffer`)=>{if(!w(e))throw new v(t,[`Buffer`,`TypedArray`,`DataView`],e)});function se(e,t){let n=S(t),r=e.length;if(n===`hex`&&r%2!=0)throw new y(`encoding`,t,`is invalid for data of length ${r}`)}function ce(e,t=`Port`,n=!0){if(typeof e!=`number`&&typeof e!=`string`||typeof e==`string`&&h(e).length===0||+e!=e>>>0||e>65535||e===0&&!n)throw new _(t,e,n);return e|0}var le=g((e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new v(t,`AbortSignal`,e)}),ue=g((e,t)=>{if(typeof e!=`function`)throw new v(t,`Function`,e)}),de=g((e,t)=>{if(typeof e!=`function`||C(e))throw new v(t,`Function`,e)}),fe=g((e,t)=>{if(e!==void 0)throw new v(t,`undefined`,e)});function pe(e,t,n){if(!r(n,e))throw new v(t,`('${i(n,`|`)}')`,e)}var me=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function he(e,t){if(e===void 0||!f(me,e))throw new y(t,e,`must be an array or string of format "</styles.css>; rel=preload; as=style"`)}function ge(e){if(typeof e==`string`)return he(e,`hints`),e;if(n(e)){let t=e.length,n=``;if(t===0)return n;for(let r=0;r<t;r++){let i=e[r];he(i,`hints`),n+=i,r!==t-1&&(n+=`, `)}return n}throw new y(`hints`,e,`must be an array or string of format "</styles.css>; rel=preload; as=style"`)}t.exports={isInt32:E,isUint32:D,parseFileMode:k,validateArray:L,validateStringArray:R,validateBooleanArray:ie,validateAbortSignalArray:z,validateBoolean:F,validateBuffer:oe,validateDictionary:re,validateEncoding:se,validateFunction:ue,validateInt32:j,validateInteger:A,validateNumber:P,validateObject:ne,validateOneOf:te,validatePlainFunction:de,validatePort:ce,validateSignalName:ae,validateString:N,validateUint32:M,validateUndefined:fe,validateUnion:pe,validateAbortSignal:le,validateLinkHeaderValue:ge}})),An=t(((e,t)=>{var n=t.exports={},r,i;function a(){throw Error(`setTimeout has not been defined`)}function o(){throw Error(`clearTimeout has not been defined`)}(function(){try{r=typeof setTimeout==`function`?setTimeout:a}catch{r=a}try{i=typeof clearTimeout==`function`?clearTimeout:o}catch{i=o}})();function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}function c(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch{try{return i.call(null,e)}catch{return i.call(this,e)}}}var l=[],u=!1,d,f=-1;function p(){!u||!d||(u=!1,d.length?l=d.concat(l):f=-1,l.length&&m())}function m(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(d=l,l=[];++f<t;)d&&d[f].run();f=-1,t=l.length}d=null,u=!1,c(e)}}n.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),l.length===1&&!u&&s(m)};function h(e,t){this.fun=e,this.array=t}h.prototype.run=function(){this.fun.apply(null,this.array)},n.title=`browser`,n.browser=!0,n.env={},n.argv=[],n.version=``,n.versions={};function g(){}n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(e){return[]},n.binding=function(e){throw Error(`process.binding is not supported`)},n.cwd=function(){return`/`},n.chdir=function(e){throw Error(`process.chdir is not supported`)},n.umask=function(){return 0}})),jn=t(((e,t)=>{var{SymbolAsyncIterator:n,SymbolIterator:r,SymbolFor:i}=Q(),a=i(`nodejs.stream.destroyed`),o=i(`nodejs.stream.errored`),s=i(`nodejs.stream.readable`),c=i(`nodejs.stream.writable`),l=i(`nodejs.stream.disturbed`),u=i(`nodejs.webstream.isClosedPromise`),d=i(`nodejs.webstream.controllerErrorFunction`);function f(e,t=!1){return!!(e&&typeof e.pipe==`function`&&typeof e.on==`function`&&(!t||typeof e.pause==`function`&&typeof e.resume==`function`)&&(!e._writableState||e._readableState?.readable!==!1)&&(!e._writableState||e._readableState))}function p(e){return!!(e&&typeof e.write==`function`&&typeof e.on==`function`&&(!e._readableState||e._writableState?.writable!==!1))}function m(e){return!!(e&&typeof e.pipe==`function`&&e._readableState&&typeof e.on==`function`&&typeof e.write==`function`)}function h(e){return e&&(e._readableState||e._writableState||typeof e.write==`function`&&typeof e.on==`function`||typeof e.pipe==`function`&&typeof e.on==`function`)}function g(e){return!!(e&&!h(e)&&typeof e.pipeThrough==`function`&&typeof e.getReader==`function`&&typeof e.cancel==`function`)}function _(e){return!!(e&&!h(e)&&typeof e.getWriter==`function`&&typeof e.abort==`function`)}function v(e){return!!(e&&!h(e)&&typeof e.readable==`object`&&typeof e.writable==`object`)}function y(e){return g(e)||_(e)||v(e)}function b(e,t){return e==null?!1:t===!0?typeof e[n]==`function`:t===!1?typeof e[r]==`function`:typeof e[n]==`function`||typeof e[r]==`function`}function x(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[a]||r!=null&&r.destroyed)}function S(e){if(!p(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function C(e,t){if(!p(e))return null;if(e.writableFinished===!0)return!0;let n=e._writableState;return n!=null&&n.errored?!1:typeof n?.finished==`boolean`?!!(n.finished||t===!1&&n.ended===!0&&n.length===0):null}function w(e){if(!f(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function T(e,t){if(!f(e))return null;let n=e._readableState;return n!=null&&n.errored?!1:typeof n?.endEmitted==`boolean`?!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0):null}function E(e){return e&&e[s]!=null?e[s]:typeof e?.readable==`boolean`?x(e)?!1:f(e)&&e.readable&&!T(e):null}function D(e){return e&&e[c]!=null?e[c]:typeof e?.writable==`boolean`?x(e)?!1:p(e)&&e.writable&&!S(e):null}function ee(e,t){return h(e)?x(e)?!0:!(t?.readable!==!1&&E(e)||t?.writable!==!1&&D(e)):null}function O(e){return h(e)?e.writableErrored?e.writableErrored:e._writableState?.errored??null:null}function k(e){return h(e)?e.readableErrored?e.readableErrored:e._readableState?.errored??null:null}function A(e){if(!h(e))return null;if(typeof e.closed==`boolean`)return e.closed;let t=e._writableState,n=e._readableState;return typeof t?.closed==`boolean`||typeof n?.closed==`boolean`?t?.closed||n?.closed:typeof e._closed==`boolean`&&j(e)?e._closed:null}function j(e){return typeof e._closed==`boolean`&&typeof e._defaultKeepAlive==`boolean`&&typeof e._removedConnection==`boolean`&&typeof e._removedContLen==`boolean`}function M(e){return typeof e._sent100==`boolean`&&j(e)}function N(e){return typeof e._consuming==`boolean`&&typeof e._dumped==`boolean`&&e.req?.upgradeOrConnect===void 0}function P(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!r&&M(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function te(e){return!!(e&&(e[l]??(e.readableDidRead||e.readableAborted)))}function F(e){return!!(e&&(e[o]??e.readableErrored??e.writableErrored??e._readableState?.errorEmitted??e._writableState?.errorEmitted??e._readableState?.errored??e._writableState?.errored))}t.exports={isDestroyed:x,kIsDestroyed:a,isDisturbed:te,kIsDisturbed:l,isErrored:F,kIsErrored:o,isReadable:E,kIsReadable:s,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:c,isClosed:A,isDuplexNodeStream:m,isFinished:ee,isIterable:b,isReadableNodeStream:f,isReadableStream:g,isReadableEnded:w,isReadableFinished:T,isReadableErrored:k,isNodeStream:h,isWebStream:y,isWritable:D,isWritableNodeStream:p,isWritableStream:_,isWritableEnded:S,isWritableFinished:C,isWritableErrored:O,isServerRequest:N,isServerResponse:M,willEmitClose:P,isTransformStream:v}})),Mn=t(((e,t)=>{var n=An(),{AbortError:r,codes:i}=Tn(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:s,once:c}=On(),{validateAbortSignal:l,validateFunction:u,validateObject:d,validateBoolean:f}=kn(),{Promise:p,PromisePrototypeThen:m,SymbolDispose:h}=Q(),{isClosed:g,isReadable:_,isReadableNodeStream:v,isReadableStream:y,isReadableFinished:b,isReadableErrored:x,isWritable:S,isWritableNodeStream:C,isWritableStream:w,isWritableFinished:T,isWritableErrored:E,isNodeStream:D,willEmitClose:ee,kIsClosedPromise:O}=jn(),k;function A(e){return e.setHeader&&typeof e.abort==`function`}var j=()=>{};function M(e,t,i){if(arguments.length===2?(i=t,t=s):t==null?t=s:d(t,`options`),u(i,`callback`),l(t.signal,`options.signal`),i=c(i),y(e)||w(e))return N(e,t,i);if(!D(e))throw new a(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],e);let f=t.readable??v(e),p=t.writable??C(e),m=e._writableState,O=e._readableState,M=()=>{e.writable||F()},P=ee(e)&&v(e)===f&&C(e)===p,te=T(e,!1),F=()=>{te=!0,e.destroyed&&(P=!1),!(P&&(!e.readable||f))&&(!f||I)&&i.call(e)},I=b(e,!1),ne=()=>{I=!0,e.destroyed&&(P=!1),!(P&&(!e.writable||p))&&(!p||te)&&i.call(e)},re=t=>{i.call(e,t)},L=g(e),R=()=>{L=!0;let t=E(e)||x(e);if(t&&typeof t!=`boolean`)return i.call(e,t);if(f&&!I&&v(e,!0)&&!b(e,!1)||p&&!te&&!T(e,!1))return i.call(e,new o);i.call(e)},ie=()=>{L=!0;let t=E(e)||x(e);if(t&&typeof t!=`boolean`)return i.call(e,t);i.call(e)},z=()=>{e.req.on(`finish`,F)};A(e)?(e.on(`complete`,F),P||e.on(`abort`,R),e.req?z():e.on(`request`,z)):p&&!m&&(e.on(`end`,M),e.on(`close`,M)),!P&&typeof e.aborted==`boolean`&&e.on(`aborted`,R),e.on(`end`,ne),e.on(`finish`,F),t.error!==!1&&e.on(`error`,re),e.on(`close`,R),L?n.nextTick(R):m!=null&&m.errorEmitted||O!=null&&O.errorEmitted?P||n.nextTick(ie):(!f&&(!P||_(e))&&(te||S(e)===!1)||!p&&(!P||S(e))&&(I||_(e)===!1)||O&&e.req&&e.aborted)&&n.nextTick(ie);let ae=()=>{i=j,e.removeListener(`aborted`,R),e.removeListener(`complete`,F),e.removeListener(`abort`,R),e.removeListener(`request`,z),e.req&&e.req.removeListener(`finish`,F),e.removeListener(`end`,M),e.removeListener(`close`,M),e.removeListener(`finish`,F),e.removeListener(`end`,ne),e.removeListener(`error`,re),e.removeListener(`close`,R)};if(t.signal&&!L){let a=()=>{let n=i;ae(),n.call(e,new r(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{k||=On().addAbortListener;let n=k(t.signal,a),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}}return ae}function N(e,t,i){let a=!1,o=j;if(t.signal)if(o=()=>{a=!0,i.call(e,new r(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(o);else{k||=On().addAbortListener;let n=k(t.signal,o),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}let s=(...t)=>{a||n.nextTick(()=>i.apply(e,t))};return m(e[O].promise,s,s),j}function P(e,t){var n;let r=!1;return t===null&&(t=s),(n=t)!=null&&n.cleanup&&(f(t.cleanup,`cleanup`),r=t.cleanup),new p((n,i)=>{let a=M(e,t,e=>{r&&a(),e?i(e):n()})})}t.exports=M,t.exports.finished=P})),Nn=t(((e,t)=>{var n=An(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=Tn(),{Symbol:o}=Q(),{kIsDestroyed:s,isDestroyed:c,isFinished:l,isServerRequest:u}=jn(),d=o(`kDestroy`),f=o(`kConstruct`);function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function m(e,t){let n=this._readableState,i=this._writableState,a=i||n;return i!=null&&i.destroyed||n!=null&&n.destroyed?(typeof t==`function`&&t(),this):(p(e,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),a.constructed?h(this,e,t):this.once(d,function(n){h(this,r(n,e),t)}),this)}function h(e,t,r){let i=!1;function a(t){if(i)return;i=!0;let a=e._readableState,o=e._writableState;p(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),typeof r==`function`&&r(t),t?n.nextTick(g,e,t):n.nextTick(_,e)}try{e._destroy(t||null,a)}catch(e){a(e)}}function g(e,t){v(e,t),_(e)}function _(e){let t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit(`close`)}function v(e,t){let n=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||n!=null&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit(`error`,t))}function y(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function b(e,t,r){let i=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(v,e,t):v(e,t))}function x(e,t){if(typeof e._construct!=`function`)return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(f,t),!(e.listenerCount(f)>1)&&n.nextTick(S,e)}function S(e){let t=!1;function r(r){if(t){b(e,r??new i);return}t=!0;let a=e._readableState,o=e._writableState,s=o||a;a&&(a.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(d,r):r?b(e,r,!0):n.nextTick(C,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function C(e){e.emit(f)}function w(e){return e?.setHeader&&typeof e.abort==`function`}function T(e){e.emit(`close`)}function E(e,t){e.emit(`error`,t),n.nextTick(T,e)}function D(e,t){!e||c(e)||(!t&&!l(e)&&(t=new a),u(e)?(e.socket=null,e.destroy(t)):w(e)?e.abort():w(e.req)?e.req.abort():typeof e.destroy==`function`?e.destroy(t):typeof e.close==`function`?e.close():t?n.nextTick(E,e,t):n.nextTick(T,e),e.destroyed||(e[s]=!0))}t.exports={construct:x,destroyer:D,destroy:m,undestroy:y,errorOrDestroy:b}})),Pn=t(((e,t)=>{var{ArrayIsArray:n,ObjectSetPrototypeOf:r}=Q(),{EventEmitter:i}=Dn();function a(e){i.call(this,e)}r(a.prototype,i.prototype),r(a,i),a.prototype.pipe=function(e,t){let n=this;function r(t){e.writable&&e.write(t)===!1&&n.pause&&n.pause()}n.on(`data`,r);function a(){n.readable&&n.resume&&n.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(n.on(`end`,c),n.on(`close`,l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy==`function`&&e.destroy())}function u(e){d(),i.listenerCount(this,`error`)===0&&this.emit(`error`,e)}o(n,`error`,u),o(e,`error`,u);function d(){n.removeListener(`data`,r),e.removeListener(`drain`,a),n.removeListener(`end`,c),n.removeListener(`close`,l),n.removeListener(`error`,u),e.removeListener(`error`,u),n.removeListener(`end`,d),n.removeListener(`close`,d),e.removeListener(`close`,d)}return n.on(`end`,d),n.on(`close`,d),e.on(`close`,d),e.emit(`pipe`,n),e};function o(e,t,r){if(typeof e.prependListener==`function`)return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}t.exports={Stream:a,prependListener:o}})),Fn=t(((e,t)=>{var{SymbolDispose:n}=Q(),{AbortError:r,codes:i}=Tn(),{isNodeStream:a,isWebStream:o,kControllerErrorFunction:s}=jn(),c=Mn(),{ERR_INVALID_ARG_TYPE:l}=i,u,d=(e,t)=>{if(typeof e!=`object`||!(`aborted`in e))throw new l(t,`AbortSignal`,e)};t.exports.addAbortSignal=function(e,n){if(d(e,`signal`),!a(n)&&!o(n))throw new l(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!=`object`||!(`aborted`in e))return t;let i=a(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?i():(u||=On().addAbortListener,c(t,u(e,i)[n])),t}})),In=t(((e,t)=>{var{StringPrototypeSlice:n,SymbolIterator:r,TypedArrayPrototypeSet:i,Uint8Array:a}=Q(),{Buffer:o}=St(),{inspect:s}=On();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return``;let t=this.head,n=``+t.data;for(;(t=t.next)!==null;)n+=e+t.data;return n}concat(e){if(this.length===0)return o.alloc(0);let t=o.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)i(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){let n=this.head.data;if(e<n.length){let t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[r](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t=``,r=this.head,i=0;do{let a=r.data;if(e>a.length)t+=a,e-=a.length;else{e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){let t=o.allocUnsafe(e),n=e,r=this.head,s=0;do{let o=r.data;if(e>o.length)i(t,o,n-e),e-=o.length;else{e===o.length?(i(t,o,n-e),++s,r.next?this.head=r.next:this.head=this.tail=null):(i(t,new a(o.buffer,o.byteOffset,e),n-e),this.head=r,r.data=o.slice(e));break}++s}while((r=r.next)!==null);return this.length-=s,t}[Symbol.for(`nodejs.util.inspect.custom`)](e,t){return s(this,{...t,depth:0,customInspect:!1})}}})),Ln=t(((e,t)=>{var{MathFloor:n,NumberIsInteger:r}=Q(),{validateInteger:i}=kn(),{ERR_INVALID_ARG_VALUE:a}=Tn().codes,o=16*1024,s=16;function c(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function l(e){return e?s:o}function u(e,t){i(t,`value`,0),e?s=t:o=t}function d(e,t,i,o){let s=c(t,o,i);if(s!=null){if(!r(s)||s<0)throw new a(o?`options.${i}`:`options.highWaterMark`,s);return n(s)}return l(e.objectMode)}t.exports={getHighWaterMark:d,getDefaultHighWaterMark:l,setDefaultHighWaterMark:u}})),Rn=t(((e,t)=>{var n=St(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),zn=t((e=>{var t=Rn().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}})),Bn=t(((e,t)=>{var n=An(),{PromisePrototypeThen:r,SymbolAsyncIterator:i,SymbolIterator:a}=Q(),{Buffer:o}=St(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:c}=Tn().codes;function l(e,t,l){let u;if(typeof t==`string`||t instanceof o)return new e({objectMode:!0,...l,read(){this.push(t),this.push(null)}});let d;if(t&&t[i])d=!0,u=t[i]();else if(t&&t[a])d=!1,u=t[a]();else throw new s(`iterable`,[`Iterable`],t);let f=new e({objectMode:!0,highWaterMark:1,...l}),p=!1;f._read=function(){p||(p=!0,h())},f._destroy=function(e,t){r(m(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))};async function m(e){let t=e!=null,n=typeof u.throw==`function`;if(t&&n){let{value:t,done:n}=await u.throw(e);if(await t,n)return}if(typeof u.return==`function`){let{value:e}=await u.return();await e}}async function h(){for(;;){try{let{value:e,done:t}=d?await u.next():u.next();if(t)f.push(null);else{let t=e&&typeof e.then==`function`?await e:e;if(t===null)throw p=!1,new c;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}return f}t.exports=l})),Vn=t(((e,t)=>{var n=An(),{ArrayPrototypeIndexOf:r,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:o,ObjectDefineProperties:s,ObjectKeys:c,ObjectSetPrototypeOf:l,Promise:u,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:m}=Q();t.exports=V,V.ReadableState=ve;var{EventEmitter:h}=Dn(),{Stream:g,prependListener:_}=Pn(),{Buffer:v}=St(),{addAbortSignal:y}=Fn(),b=Mn(),x=On().debuglog(`stream`,e=>{x=e}),S=In(),C=Nn(),{getHighWaterMark:w,getDefaultHighWaterMark:T}=Ln(),{aggregateTwoErrors:E,codes:{ERR_INVALID_ARG_TYPE:D,ERR_METHOD_NOT_IMPLEMENTED:ee,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:A},AbortError:j}=Tn(),{validateObject:M}=kn(),N=m(`kPaused`),{StringDecoder:P}=zn(),te=Bn();l(V.prototype,g.prototype),l(V,g);var F=()=>{},{errorOrDestroy:I}=C,ne=1,re=2,L=4,R=8,ie=16,z=32,ae=64,oe=128,se=256,ce=512,le=1024,ue=2048,de=4096,fe=8192,pe=16384,me=32768,he=65536,ge=1<<17,_e=1<<18;function B(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}s(ve.prototype,{objectMode:B(ne),ended:B(re),endEmitted:B(L),reading:B(R),constructed:B(ie),sync:B(z),needReadable:B(ae),emittedReadable:B(oe),readableListening:B(se),resumeScheduled:B(ce),errorEmitted:B(le),emitClose:B(ue),autoDestroy:B(de),destroyed:B(fe),closed:B(pe),closeEmitted:B(me),multiAwaitDrain:B(he),readingMore:B(ge),dataEmitted:B(_e)});function ve(e,t,n){typeof n!=`boolean`&&(n=t instanceof Wn()),this.state=6192,e&&e.objectMode&&(this.state|=ne),n&&e&&e.readableObjectMode&&(this.state|=ne),this.highWaterMark=e?w(this,e,`readableHighWaterMark`,n):T(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[N]=null,e&&e.emitClose===!1&&(this.state&=~ue),e&&e.autoDestroy===!1&&(this.state&=~de),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new P(e.encoding),this.encoding=e.encoding)}function V(e){if(!(this instanceof V))return new V(e);let t=this instanceof Wn();this._readableState=new ve(e,this,t),e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&!t&&y(e.signal,this)),g.call(this,e),C.construct(this,()=>{this._readableState.needReadable&&Ee(this,this._readableState)})}V.prototype.destroy=C.destroy,V.prototype._undestroy=C.undestroy,V.prototype._destroy=function(e,t){t(e)},V.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},V.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new u((t,n)=>b(this,r=>r&&r!==e?n(r):t(null)))},V.prototype.push=function(e,t){return ye(this,e,t,!1)},V.prototype.unshift=function(e,t){return ye(this,e,t,!0)};function ye(e,t,n,r){x(`readableAddChunk`,t);let i=e._readableState,a;if((i.state&ne)===0&&(typeof t==`string`?(n||=i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=v.from(t,n).toString(i.encoding):(t=v.from(t,n),n=``))):t instanceof v?n=``:g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),n=``):t!=null&&(a=new D(`chunk`,[`string`,`Buffer`,`Uint8Array`],t))),a)I(e,a);else if(t===null)i.state&=~R,Ce(e,i);else if((i.state&ne)!==0||t&&t.length>0)if(r)if((i.state&L)!==0)I(e,new A);else if(i.destroyed||i.errored)return!1;else be(e,i,t,!0);else if(i.ended)I(e,new k);else if(i.destroyed||i.errored)return!1;else i.state&=~R,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||t.length!==0?be(e,i,t,!1):Ee(e,i)):be(e,i,t,!1);else r||(i.state&=~R,Ee(e,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function be(e,t,n,r){t.flowing&&t.length===0&&!t.sync&&e.listenerCount(`data`)>0?((t.state&he)===0?t.awaitDrainWriters=null:t.awaitDrainWriters.clear(),t.dataEmitted=!0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),(t.state&ae)!==0&&we(e)),Ee(e,t)}V.prototype.isPaused=function(){let e=this._readableState;return e[N]===!0||e.flowing===!1},V.prototype.setEncoding=function(e){let t=new P(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer,r=``;for(let e of n)r+=t.write(e);return n.clear(),r!==``&&n.push(r),this._readableState.length=r.length,this};var H=1073741824;function xe(e){if(e>H)throw new O(`size`,`<= 1GiB`,e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function Se(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&ne)===0?a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0:1}V.prototype.read=function(e){x(`read`,e),e===void 0?e=NaN:i(e)||(e=o(e,10));let t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=xe(e)),e!==0&&(t.state&=~oe),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return x(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?Le(this):we(this),null;if(e=Se(e,t),e===0&&t.ended)return t.length===0&&Le(this),null;let r=(t.state&ae)!==0;if(x(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,x(`length less than watermark`,r)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)r=!1,x(`reading, ended or constructing`,r);else if(r){x(`do read`),t.state|=R|z,t.length===0&&(t.state|=ae);try{this._read(t.highWaterMark)}catch(e){I(this,e)}t.state&=~z,t.reading||(e=Se(n,t))}let a;return a=e>0?Ie(e,t):null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Le(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit(`data`,a)),a};function Ce(e,t){if(x(`onEofChunk`),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?we(e):(t.needReadable=!1,t.emittedReadable=!0,Te(e))}}function we(e){let t=e._readableState;x(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x(`emitReadable`,t.flowing),t.emittedReadable=!0,n.nextTick(Te,e))}function Te(e){let t=e._readableState;x(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ne(e)}function Ee(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(De,e,t))}function De(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let n=t.length;if(x(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}V.prototype._read=function(e){throw new ee(`_read()`)},V.prototype.pipe=function(e,t){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),x(`pipe count=%d opts=%j`,i.pipes.length,t);let a=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr?s:v;i.endEmitted?n.nextTick(a):r.once(`end`,a),e.on(`unpipe`,o);function o(e,t){x(`onunpipe`),e===r&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,u())}function s(){x(`onend`),e.end()}let c,l=!1;function u(){x(`cleanup`),e.removeListener(`close`,h),e.removeListener(`finish`,g),c&&e.removeListener(`drain`,c),e.removeListener(`error`,m),e.removeListener(`unpipe`,o),r.removeListener(`end`,s),r.removeListener(`end`,v),r.removeListener(`data`,p),l=!0,c&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&c()}function f(){l||(i.pipes.length===1&&i.pipes[0]===e?(x(`false write response, pause`,0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(x(`false write response, pause`,i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=Oe(r,e),e.on(`drain`,c))}r.on(`data`,p);function p(t){x(`ondata`);let n=e.write(t);x(`dest.write`,n),n===!1&&f()}function m(t){if(x(`onerror`,t),v(),e.removeListener(`error`,m),e.listenerCount(`error`)===0){let n=e._writableState||e._readableState;n&&!n.errorEmitted?I(e,t):e.emit(`error`,t)}}_(e,`error`,m);function h(){e.removeListener(`finish`,g),v()}e.once(`close`,h);function g(){x(`onfinish`),e.removeListener(`close`,h),v()}e.once(`finish`,g);function v(){x(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),e.writableNeedDrain===!0?f():i.flowing||(x(`pipe resume`),r.resume()),e};function Oe(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(x(`pipeOnDrain`,1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(x(`pipeOnDrain`,n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount(`data`)&&e.resume()}}V.prototype.unpipe=function(e){let t=this._readableState,n={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit(`unpipe`,this,{hasUnpiped:!1});return this}let i=r(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipes.length===0&&this.pause(),e.emit(`unpipe`,this,n),this)},V.prototype.on=function(e,t){let r=g.prototype.on.call(this,e,t),i=this._readableState;return e===`data`?(i.readableListening=this.listenerCount(`readable`)>0,i.flowing!==!1&&this.resume()):e===`readable`&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x(`on readable`,i.length,i.reading),i.length?we(this):i.reading||n.nextTick(Ae,this)),r},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(e,t){let r=g.prototype.removeListener.call(this,e,t);return e===`readable`&&n.nextTick(ke,this),r},V.prototype.off=V.prototype.removeListener,V.prototype.removeAllListeners=function(e){let t=g.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&n.nextTick(ke,this),t};function ke(e){let t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&t[N]===!1?t.flowing=!0:e.listenerCount(`data`)>0?e.resume():t.readableListening||(t.flowing=null)}function Ae(e){x(`readable nexttick read 0`),e.read(0)}V.prototype.resume=function(){let e=this._readableState;return e.flowing||(x(`resume`),e.flowing=!e.readableListening,je(this,e)),e[N]=!1,this};function je(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(Me,e,t))}function Me(e,t){x(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),Ne(e),t.flowing&&!t.reading&&e.read(0)}V.prototype.pause=function(){return x(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(x(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState[N]=!0,this};function Ne(e){let t=e._readableState;for(x(`flow`,t.flowing);t.flowing&&e.read()!==null;);}V.prototype.wrap=function(e){let t=!1;e.on(`data`,n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on(`end`,()=>{this.push(null)}),e.on(`error`,e=>{I(this,e)}),e.on(`close`,()=>{this.destroy()}),e.on(`destroy`,()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let n=c(e);for(let t=1;t<n.length;t++){let r=n[t];this[r]===void 0&&typeof e[r]==`function`&&(this[r]=e[r].bind(e))}return this},V.prototype[p]=function(){return Pe(this)},V.prototype.iterator=function(e){return e!==void 0&&M(e,`options`),Pe(this,e)};function Pe(e,t){typeof e.read!=`function`&&(e=V.wrap(e,{objectMode:!0}));let n=Fe(e,t);return n.stream=e,n}async function*Fe(e,t){let n=F;function r(t){this===e?(n(),n=F):n=t}e.on(`readable`,r);let i,a=b(e,{writable:!1},e=>{i=e?E(i,e):null,n(),n=F});try{for(;;){let t=e.destroyed?null:e.read();if(t!==null)yield t;else if(i)throw i;else if(i===null)return;else await new u(r)}}catch(e){throw i=E(i,e),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?C.destroyer(e,null):(e.off(`readable`,r),a())}}s(V.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ve.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[N]!==!1},set(e){this[N]=!!e}}}),V._fromList=Ie;function Ie(e,t){if(t.length===0)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function Le(e){let t=e._readableState;x(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(Re,t,e))}function Re(e,t){if(x(`endReadableNT`,e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit(`end`),t.writable&&t.allowHalfOpen===!1)n.nextTick(ze,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||e.writable===!1))&&t.destroy()}}}function ze(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}V.from=function(e,t){return te(V,e,t)};var U;function Be(){return U===void 0&&(U={}),U}V.fromWeb=function(e,t){return Be().newStreamReadableFromReadableStream(e,t)},V.toWeb=function(e,t){return Be().newReadableStreamFromStreamReadable(e,t)},V.wrap=function(e,t){return new V({objectMode:e.readableObjectMode??e.objectMode??!0,...t,destroy(t,n){C.destroyer(e,t),n(t)}}).wrap(e)}})),Hn=t(((e,t)=>{var n=An(),{ArrayPrototypeSlice:r,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:o,ObjectDefineProperties:s,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:l,Symbol:u,SymbolHasInstance:d}=Q();t.exports=M,M.WritableState=A;var{EventEmitter:f}=Dn(),p=Pn().Stream,{Buffer:m}=St(),h=Nn(),{addAbortSignal:g}=Fn(),{getHighWaterMark:_,getDefaultHighWaterMark:v}=Ln(),{ERR_INVALID_ARG_TYPE:y,ERR_METHOD_NOT_IMPLEMENTED:b,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:C,ERR_STREAM_ALREADY_FINISHED:w,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:E,ERR_UNKNOWN_ENCODING:D}=Tn().codes,{errorOrDestroy:ee}=h;c(M.prototype,p.prototype),c(M,p);function O(){}var k=u(`kOnFinished`);function A(e,t,n){typeof n!=`boolean`&&(n=t instanceof Wn()),this.objectMode=!!(e&&e.objectMode),n&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?_(this,e,`writableHighWaterMark`,n):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(e&&e.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=I.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,j(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[k]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}A.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},o(A.prototype,`bufferedRequestCount`,{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function M(e){let t=this instanceof Wn();if(!t&&!a(M,this))return new M(e);this._writableState=new A(e,this,t),e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&g(e.signal,this)),p.call(this,e),h.construct(this,()=>{let e=this._writableState;e.writing||R(this,e),oe(this,e)})}o(M,d,{__proto__:null,value:function(e){return a(this,e)?!0:this===M?e&&e._writableState instanceof A:!1}}),M.prototype.pipe=function(){ee(this,new S)};function N(e,t,r,i){let a=e._writableState;if(typeof r==`function`)i=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!==`buffer`&&!m.isEncoding(r))throw new D(r);typeof i!=`function`&&(i=O)}if(t===null)throw new T;if(!a.objectMode)if(typeof t==`string`)a.decodeStrings!==!1&&(t=m.from(t,r),r=`buffer`);else if(t instanceof m)r=`buffer`;else if(p._isUint8Array(t))t=p._uint8ArrayToBuffer(t),r=`buffer`;else throw new y(`chunk`,[`string`,`Buffer`,`Uint8Array`],t);let o;return a.ending?o=new E:a.destroyed&&(o=new C(`write`)),o?(n.nextTick(i,o),ee(e,o,!0),o):(a.pendingcb++,P(e,a,t,r,i))}M.prototype.write=function(e,t,n){return N(this,e,t,n)===!0},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||R(this,e))},M.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=l(e)),!m.isEncoding(e))throw new D(e);return this._writableState.defaultEncoding=e,this};function P(e,t,n,r,i){let a=t.objectMode?1:n.length;t.length+=a;let o=t.length<t.highWaterMark;return o||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&r!==`buffer`&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=a,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1),o&&!t.errored&&!t.destroyed}function te(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new C(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function F(e,t,n,r){--t.pendingcb,r(n),L(t),ee(e,n)}function I(e,t){let r=e._writableState,i=r.sync,a=r.writecb;if(typeof a!=`function`){ee(e,new x);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||=t,e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(F,e,r,t,a):F(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&R(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(ne,r.afterWriteTickInfo)):re(e,r,1,a))}function ne({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,re(e,t,n,r)}function re(e,t,n,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`));n-- >0;)t.pendingcb--,r();t.destroyed&&L(t),oe(e,t)}function L(e){if(e.writing)return;for(let t=e.bufferedIndex;t<e.buffered.length;++t){let{chunk:n,callback:r}=e.buffered[t],i=e.objectMode?1:n.length;e.length-=i,r(e.errored??new C(`write`))}let t=e[k].splice(0);for(let n=0;n<t.length;n++)t[n](e.errored??new C(`end`));j(e)}function R(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:n,bufferedIndex:i,objectMode:a}=t,o=n.length-i;if(!o)return;let s=i;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let i=t.allNoop?O:e=>{for(let t=s;t<n.length;++t)n[t].callback(e)},a=t.allNoop&&s===0?n:r(n,s);a.allBuffers=t.allBuffers,te(e,t,!0,t.length,a,``,i),j(t)}else{do{let{chunk:r,encoding:i,callback:o}=n[s];n[s++]=null,te(e,t,!1,a?1:r.length,r,i,o)}while(s<n.length&&!t.writing);s===n.length?j(t):s>256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}M.prototype._write=function(e,t,n){if(this._writev)this._writev([{chunk:e,encoding:t}],n);else throw new b(`_write()`)},M.prototype._writev=null,M.prototype.end=function(e,t,r){let a=this._writableState;typeof e==`function`?(r=e,e=null,t=null):typeof t==`function`&&(r=t,t=null);let o;if(e!=null){let n=N(this,e,t);n instanceof i&&(o=n)}return a.corked&&(a.corked=1,this.uncork()),o||(!a.errored&&!a.ending?(a.ending=!0,oe(this,a,!0),a.ended=!0):a.finished?o=new w(`end`):a.destroyed&&(o=new C(`end`))),typeof r==`function`&&(o||a.finished?n.nextTick(r,o):a[k].push(r)),this};function ie(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function z(e,t){let r=!1;function i(i){if(r){ee(e,i??x());return}if(r=!0,t.pendingcb--,i){let n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e](i);ee(e,i,t.sync)}else ie(t)&&(t.prefinished=!0,e.emit(`prefinish`),t.pendingcb++,n.nextTick(se,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}function ae(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.finalCalled=!0,z(e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function oe(e,t,r){ie(t)&&(ae(e,t),t.pendingcb===0&&(r?(t.pendingcb++,n.nextTick((e,t)=>{ie(t)?se(e,t):t.pendingcb--},e,t)):ie(t)&&(t.pendingcb++,se(e,t))))}function se(e,t){t.pendingcb--,t.finished=!0;let n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit(`finish`),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||t.readable===!1))&&e.destroy()}}s(M.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ce=h.destroy;M.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[k].length)&&n.nextTick(L,r),ce.call(this,e,t),this},M.prototype._undestroy=h.undestroy,M.prototype._destroy=function(e,t){t(e)},M.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)};var le;function ue(){return le===void 0&&(le={}),le}M.fromWeb=function(e,t){return ue().newStreamWritableFromWritableStream(e,t)},M.toWeb=function(e){return ue().newWritableStreamFromStreamWritable(e)}})),Un=t(((e,t)=>{var n=An(),r=St(),{isReadable:i,isWritable:a,isIterable:o,isNodeStream:s,isReadableNodeStream:c,isWritableNodeStream:l,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:f}=jn(),p=Mn(),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:g}}=Tn(),{destroyer:_}=Nn(),v=Wn(),y=Vn(),b=Hn(),{createDeferredPromise:x}=On(),S=Bn(),C=globalThis.Blob||r.Blob,w=C===void 0?function(e){return!1}:function(e){return e instanceof C},T=globalThis.AbortController||En().AbortController,{FunctionPrototypeCall:E}=Q(),D=class extends v{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function e(t,r){if(u(t))return t;if(c(t))return O({readable:t});if(l(t))return O({writable:t});if(s(t))return O({writable:!1,readable:!1});if(d(t))return O({readable:y.fromWeb(t)});if(f(t))return O({writable:b.fromWeb(t)});if(typeof t==`function`){let{value:e,write:i,final:a,destroy:s}=ee(t);if(o(e))return S(D,e,{objectMode:!0,write:i,final:a,destroy:s});let c=e?.then;if(typeof c==`function`){let t,r=E(c,e,e=>{if(e!=null)throw new g(`nully`,`body`,e)},e=>{_(t,e)});return t=new D({objectMode:!0,readable:!1,write:i,final(e){a(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new g(`Iterable, AsyncIterable or AsyncFunction`,r,e)}if(w(t))return e(t.arrayBuffer());if(o(t))return S(D,t,{objectMode:!0,writable:!1});if(d(t?.readable)&&f(t?.writable))return D.fromWeb(t);if(typeof t?.writable==`object`||typeof t?.readable==`object`)return O({readable:t!=null&&t.readable?c(t?.readable)?t?.readable:e(t.readable):void 0,writable:t!=null&&t.writable?l(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if(typeof i==`function`){let e;return E(i,t,t=>{t!=null&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new D({objectMode:!0,writable:!1,read(){}})}throw new h(r,[`Blob`,`ReadableStream`,`WritableStream`,`Stream`,`Iterable`,`AsyncIterable`,`Function`,`{ readable, writable } pair`,`Promise`],t)};function ee(e){let{promise:t,resolve:r}=x(),i=new T,a=i.signal;return{value:e((async function*(){for(;;){let e=t;t=null;let{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new m(void 0,{cause:a.reason});({promise:t,resolve:r}=x()),yield i}})(),{signal:a}),write(e,t,n){let i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){let t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}function O(e){let t=e.readable&&typeof e.readable.read!=`function`?y.wrap(e.readable):e.readable,n=e.writable,r=!!i(t),o=!!a(n),s,c,l,u,d;function f(e){let t=u;u=null,t?t(e):e&&d.destroy(e)}return d=new D({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(n!=null&&n.writableObjectMode),readable:r,writable:o}),o&&(p(n,e=>{o=!1,e&&_(t,e),f(e)}),d._write=function(e,t,r){n.write(e,t)?r():s=r},d._final=function(e){n.end(),c=e},n.on(`drain`,function(){if(s){let e=s;s=null,e()}}),n.on(`finish`,function(){if(c){let e=c;c=null,e()}})),r&&(p(t,e=>{r=!1,e&&_(t,e),f(e)}),t.on(`readable`,function(){if(l){let e=l;l=null,e()}}),t.on(`end`,function(){d.push(null)}),d._read=function(){for(;;){let e=t.read();if(e===null){l=d._read;return}if(!d.push(e))return}}),d._destroy=function(e,r){!e&&u!==null&&(e=new m),l=null,s=null,c=null,u===null?r(e):(u=r,_(n,e),_(t,e))},d}})),Wn=t(((e,t)=>{var{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:i,ObjectSetPrototypeOf:a}=Q();t.exports=c;var o=Vn(),s=Hn();a(c.prototype,o.prototype),a(c,o);{let e=i(s.prototype);for(let t=0;t<e.length;t++){let n=e[t];c.prototype[n]||(c.prototype[n]=s.prototype[n])}}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),s.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(c.prototype,{writable:{__proto__:null,...r(s.prototype,`writable`)},writableHighWaterMark:{__proto__:null,...r(s.prototype,`writableHighWaterMark`)},writableObjectMode:{__proto__:null,...r(s.prototype,`writableObjectMode`)},writableBuffer:{__proto__:null,...r(s.prototype,`writableBuffer`)},writableLength:{__proto__:null,...r(s.prototype,`writableLength`)},writableFinished:{__proto__:null,...r(s.prototype,`writableFinished`)},writableCorked:{__proto__:null,...r(s.prototype,`writableCorked`)},writableEnded:{__proto__:null,...r(s.prototype,`writableEnded`)},writableNeedDrain:{__proto__:null,...r(s.prototype,`writableNeedDrain`)},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var l;function u(){return l===void 0&&(l={}),l}c.fromWeb=function(e,t){return u().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return u().newReadableWritablePairFromDuplex(e)};var d;c.from=function(e){return d||=Un(),d(e,`body`)}})),Gn=t(((e,t)=>{var{ObjectSetPrototypeOf:n,Symbol:r}=Q();t.exports=c;var{ERR_METHOD_NOT_IMPLEMENTED:i}=Tn().codes,a=Wn(),{getHighWaterMark:o}=Ln();n(c.prototype,a.prototype),n(c,a);var s=r(`kCallback`);function c(e){if(!(this instanceof c))return new c(e);let t=e?o(this,e,`readableHighWaterMark`,!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[s]=null,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function l(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function u(){this._final!==l&&l.call(this)}c.prototype._final=l,c.prototype._transform=function(e,t,n){throw new i(`_transform()`)},c.prototype._write=function(e,t,n){let r=this._readableState,i=this._writableState,a=r.length;this._transform(e,t,(e,t)=>{if(e){n(e);return}t!=null&&this.push(t),i.ended||a===r.length||r.length<r.highWaterMark?n():this[s]=n})},c.prototype._read=function(){if(this[s]){let e=this[s];this[s]=null,e()}}})),Kn=t(((e,t)=>{var{ObjectSetPrototypeOf:n}=Q();t.exports=i;var r=Gn();n(i.prototype,r.prototype),n(i,r);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),qn=t(((e,t)=>{var n=An(),{ArrayIsArray:r,Promise:i,SymbolAsyncIterator:a,SymbolDispose:o}=Q(),s=Mn(),{once:c}=On(),l=Nn(),u=Wn(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:_}=Tn(),{validateFunction:v,validateAbortSignal:y}=kn(),{isIterable:b,isReadable:x,isReadableNodeStream:S,isNodeStream:C,isTransformStream:w,isWebStream:T,isReadableStream:E,isReadableFinished:D}=jn(),ee=globalThis.AbortController||En().AbortController,O,k,A;function j(e,t,n){let r=!1;return e.on(`close`,()=>{r=!0}),{destroy:t=>{r||(r=!0,l.destroyer(e,t||new h(`pipe`)))},cleanup:s(e,{readable:t,writable:n},e=>{r=!e})}}function M(e){return v(e[e.length-1],`streams[stream.length - 1]`),e.pop()}function N(e){if(b(e))return e;if(S(e))return P(e);throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`],e)}async function*P(e){k||=Vn(),yield*k.prototype[a].call(e)}async function te(e,t,n,{end:r}){let a,o=null,c=e=>{if(e&&(a=e),o){let e=o;o=null,e()}},l=()=>new i((e,t)=>{a?t(a):o=()=>{a?t(a):e()}});t.on(`drain`,c);let u=s(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let n of e)t.write(n)||await l();r&&(t.end(),await l()),n()}catch(e){n(a===e?e:d(a,e))}finally{u(),t.off(`drain`,c)}}async function F(e,t,n,{end:r}){w(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function I(...e){return ne(e,c(M(e)))}function ne(e,t,i){if(e.length===1&&r(e[0])&&(e=e[0]),e.length<2)throw new m(`streams`);let a=new ee,s=a.signal,c=i?.signal,l=[];y(c,`options.signal`);function d(){P(new _)}A||=On().addAbortListener;let h;c&&(h=A(c,d));let g,v,D=[],k=0;function M(e){P(e,--k===0)}function P(e,r){var i;if(e&&(!g||g.code===`ERR_STREAM_PREMATURE_CLOSE`)&&(g=e),!(!g&&!r)){for(;D.length;)D.shift()(g);(i=h)==null||i[o](),a.abort(),r&&(g||l.forEach(e=>e()),n.nextTick(t,g,v))}}let I;for(let t=0;t<e.length;t++){let r=e[t],a=t<e.length-1,o=t>0,c=a||i?.end!==!1,d=t===e.length-1;if(C(r)){if(c){let{destroy:e,cleanup:t}=j(r,a,o);D.push(e),x(r)&&d&&l.push(t)}function e(e){e&&e.name!==`AbortError`&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&M(e)}r.on(`error`,e),x(r)&&d&&l.push(()=>{r.removeListener(`error`,e)})}if(t===0)if(typeof r==`function`){if(I=r({signal:s}),!b(I))throw new p(`Iterable, AsyncIterable or Stream`,`source`,I)}else I=b(r)||S(r)||w(r)?r:u.from(r);else if(typeof r==`function`)if(I=w(I)?N(I?.readable):N(I),I=r(I,{signal:s}),a){if(!b(I,!0))throw new p(`AsyncIterable`,`transform[${t-1}]`,I)}else{O||=Kn();let e=new O({objectMode:!0}),t=I?.then;if(typeof t==`function`)k++,t.call(I,t=>{v=t,t!=null&&e.write(t),c&&e.end(),n.nextTick(M)},t=>{e.destroy(t),n.nextTick(M,t)});else if(b(I,!0))k++,te(I,e,M,{end:c});else if(E(I)||w(I)){let t=I.readable||I;k++,te(t,e,M,{end:c})}else throw new p(`AsyncIterable or Promise`,`destination`,I);I=e;let{destroy:r,cleanup:i}=j(I,!1,!0);D.push(r),d&&l.push(i)}else if(C(r)){if(S(I)){k+=2;let e=re(I,r,M,{end:c});x(r)&&d&&l.push(e)}else if(w(I)||E(I)){let e=I.readable||I;k++,te(e,r,M,{end:c})}else if(b(I))k++,te(I,r,M,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],I);I=r}else if(T(r)){if(S(I))k++,F(N(I),r,M,{end:c});else if(E(I)||b(I))k++,F(I,r,M,{end:c});else if(w(I))k++,F(I.readable,r,M,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],I);I=r}else I=u.from(r)}return(s!=null&&s.aborted||c!=null&&c.aborted)&&n.nextTick(d),I}function re(e,t,r,{end:i}){let a=!1;if(t.on(`close`,()=>{a||r(new g)}),e.pipe(t,{end:!1}),i){function r(){a=!0,t.end()}D(e)?n.nextTick(r):e.once(`end`,r)}else r();return s(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&t.code===`ERR_STREAM_PREMATURE_CLOSE`&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once(`end`,r).once(`error`,r):r(t)}),s(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:ne,pipeline:I}})),Jn=t(((e,t)=>{var{pipeline:n}=qn(),r=Wn(),{destroyer:i}=Nn(),{isNodeStream:a,isReadable:o,isWritable:s,isWebStream:c,isTransformStream:l,isWritableStream:u,isReadableStream:d}=jn(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=Tn(),h=Mn();t.exports=function(...e){if(e.length===0)throw new m(`streams`);if(e.length===1)return r.from(e[0]);let t=[...e];if(typeof e[0]==`function`&&(e[0]=r.from(e[0])),typeof e[e.length-1]==`function`){let t=e.length-1;e[t]=r.from(e[t])}for(let n=0;n<e.length;++n)if(!(!a(e[n])&&!c(e[n]))){if(n<e.length-1&&!(o(e[n])||d(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be readable`);if(n>0&&!(s(e[n])||u(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be writable`)}let g,_,v,y,b;function x(e){let t=y;y=null,t?t(e):e?b.destroy(e):!T&&!w&&b.destroy()}let S=e[0],C=n(e,x),w=!!(s(S)||u(S)||l(S)),T=!!(o(C)||d(C)||l(C));if(b=new r({writableObjectMode:!!(S!=null&&S.writableObjectMode),readableObjectMode:!!(C!=null&&C.readableObjectMode),writable:w,readable:T}),w){if(a(S))b._write=function(e,t,n){S.write(e,t)?n():g=n},b._final=function(e){S.end(),_=e},S.on(`drain`,function(){if(g){let e=g;g=null,e()}});else if(c(S)){let e=(l(S)?S.writable:S).getWriter();b._write=async function(t,n,r){try{await e.ready,e.write(t).catch(()=>{}),r()}catch(e){r(e)}},b._final=async function(t){try{await e.ready,e.close().catch(()=>{}),_=t}catch(e){t(e)}}}h(l(C)?C.readable:C,()=>{if(_){let e=_;_=null,e()}})}if(T){if(a(C))C.on(`readable`,function(){if(v){let e=v;v=null,e()}}),C.on(`end`,function(){b.push(null)}),b._read=function(){for(;;){let e=C.read();if(e===null){v=b._read;return}if(!b.push(e))return}};else if(c(C)){let e=(l(C)?C.readable:C).getReader();b._read=async function(){for(;;)try{let{value:t,done:n}=await e.read();if(!b.push(t))return;if(n){b.push(null);return}}catch{return}}}}return b._destroy=function(e,t){!e&&y!==null&&(e=new f),v=null,g=null,_=null,y===null?t(e):(y=t,a(C)&&i(C,e))},b}})),Yn=t(((e,t)=>{var n=globalThis.AbortController||En().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:o},AbortError:s}=Tn(),{validateAbortSignal:c,validateInteger:l,validateObject:u}=kn(),d=Q().Symbol(`kWeak`),f=Q().Symbol(`kResistStopPropagation`),{finished:p}=Mn(),m=Jn(),{addAbortSignalNoValidate:h}=Fn(),{isWritable:g,isNodeStream:_}=jn(),{deprecate:v}=On(),{ArrayPrototypePush:y,Boolean:b,MathFloor:x,Number:S,NumberIsNaN:C,Promise:w,PromiseReject:T,PromiseResolve:E,PromisePrototypeThen:D,Symbol:ee}=Q(),O=ee(`kEmpty`),k=ee(`kEof`);function A(e,t){if(t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),_(e)&&!g(e))throw new r(`stream`,e,`must be writable`);let n=m(this,e);return t!=null&&t.signal&&h(t.signal,n),n}function j(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`);let n=1;t?.concurrency!=null&&(n=x(t.concurrency));let r=n-1;return t?.highWaterMark!=null&&(r=x(t.highWaterMark)),l(n,`options.concurrency`,1),l(r,`options.highWaterMark`,0),r+=n,async function*(){let i=On().AbortSignalAny([t?.signal].filter(b)),a=this,o=[],c={signal:i},l,u,d=!1,f=0;function p(){d=!0,m()}function m(){--f,h()}function h(){u&&!d&&f<n&&o.length<r&&(u(),u=null)}async function g(){try{for await(let t of a){if(d)return;if(i.aborted)throw new s;try{if(t=e(t,c),t===O)continue;t=E(t)}catch(e){t=T(e)}f+=1,D(t,m,p),o.push(t),l&&=(l(),null),!d&&(o.length>=r||f>=n)&&await new w(e=>{u=e})}o.push(k)}catch(e){let t=T(e);D(t,m,p),o.push(t)}finally{d=!0,l&&=(l(),null)}}g();try{for(;;){for(;o.length>0;){let e=await o[0];if(e===k)return;if(i.aborted)throw new s;e!==O&&(yield e),o.shift(),h()}await new w(e=>{l=e})}}finally{d=!0,u&&=(u(),null)}}.call(this)}function M(e=void 0){return e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`),async function*(){let t=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s({cause:e.signal.reason});yield[t++,r]}}.call(this)}async function N(e,t=void 0){for await(let n of I.call(this,e,t))return!0;return!1}async function P(e,t=void 0){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);return!await N.call(this,async(...t)=>!await e(...t),t)}async function te(e,t){for await(let n of I.call(this,e,t))return n}async function F(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n),O}for await(let e of j.call(this,n,t));}function I(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n)?t:O}return j.call(this,n,t)}var ne=class extends a{constructor(){super(`reduce`),this.message=`Reduce of an empty stream requires an initial value`}};async function re(e,t,r){var a;if(typeof e!=`function`)throw new i(`reducer`,[`Function`,`AsyncFunction`],e);r!=null&&u(r,`options`),r?.signal!=null&&c(r.signal,`options.signal`);let o=arguments.length>1;if(r!=null&&(a=r.signal)!=null&&a.aborted){let e=new s(void 0,{cause:r.signal.reason});throw this.once(`error`,()=>{}),await p(this.destroy(e)),e}let l=new n,m=l.signal;if(r!=null&&r.signal){let e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener(`abort`,()=>l.abort(),e)}let h=!1;try{for await(let n of this){var g;if(h=!0,r!=null&&(g=r.signal)!=null&&g.aborted)throw new s;o?t=await e(t,n,{signal:m}):(t=n,o=!0)}if(!h&&!o)throw new ne}finally{l.abort()}return t}async function L(e){e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`);let t=[];for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s(void 0,{cause:e.signal.reason});y(t,r)}return t}function R(e,t){let n=j.call(this,e,t);return async function*(){for await(let e of n)yield*e}.call(this)}function ie(e){if(e=S(e),C(e))return 0;if(e<0)throw new o(`number`,`>= 0`,e);return e}function z(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ie(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;e--<=0&&(yield n)}}.call(this)}function ae(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ie(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;if(e-- >0&&(yield n),e<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:v(M,`readable.asIndexedPairs will be removed in a future version.`),drop:z,filter:I,flatMap:R,map:j,take:ae,compose:A},t.exports.promiseReturningOperators={every:P,forEach:F,reduce:re,toArray:L,some:N,find:te}})),Xn=t(((e,t)=>{var{ArrayPrototypePop:n,Promise:r}=Q(),{isIterable:i,isNodeStream:a,isWebStream:o}=jn(),{pipelineImpl:s}=qn(),{finished:c}=Mn();Zn();function l(...e){return new r((t,r)=>{let c,l,u=e[e.length-1];if(u&&typeof u==`object`&&!a(u)&&!i(u)&&!o(u)){let t=n(e);c=t.signal,l=t.end}s(e,(e,n)=>{e?r(e):t(n)},{signal:c,end:l})})}t.exports={finished:c,pipeline:l}})),Zn=t(((e,t)=>{var{Buffer:n}=St(),{ObjectDefineProperty:r,ObjectKeys:i,ReflectApply:a}=Q(),{promisify:{custom:o}}=On(),{streamReturningOperators:s,promiseReturningOperators:c}=Yn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=Tn(),u=Jn(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=Ln(),{pipeline:p}=qn(),{destroyer:m}=Nn(),h=Mn(),g=Xn(),_=jn(),v=t.exports=Pn().Stream;v.isDestroyed=_.isDestroyed,v.isDisturbed=_.isDisturbed,v.isErrored=_.isErrored,v.isReadable=_.isReadable,v.isWritable=_.isWritable,v.Readable=Vn();for(let e of i(s)){let t=s[e];function n(...e){if(new.target)throw l();return v.Readable.from(a(t,this,e))}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(v.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(c)){let t=c[e];function n(...e){if(new.target)throw l();return a(t,this,e)}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(v.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Hn(),v.Duplex=Wn(),v.Transform=Gn(),v.PassThrough=Kn(),v.pipeline=p;var{addAbortSignal:y}=Fn();v.addAbortSignal=y,v.finished=h,v.destroy=m,v.compose=u,v.setDefaultHighWaterMark=d,v.getDefaultHighWaterMark=f,r(v,`promises`,{__proto__:null,configurable:!0,enumerable:!0,get(){return g}}),r(p,o,{__proto__:null,enumerable:!0,get(){return g.pipeline}}),r(h,o,{__proto__:null,enumerable:!0,get(){return g.finished}}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}})),Qn=t(((e,t)=>{var n=Zn(),r=Xn(),i=n.Readable.destroy;t.exports=n.Readable,t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.destroy=i,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,`promises`,{configurable:!0,enumerable:!0,get(){return r}}),t.exports.Stream=n.Stream,t.exports.default=t.exports}))(),$n=Symbol(`iter`);function er(e,t,n=4){if(n===0)return Object.assign(e,t);for(let r in t)e[r]=er(e[r]||Object.create(null),t[r],n-1);return e}function tr(e,t,n=4){let r=!1;for(let i in e)if(i in t){let a=n===0?null:tr(e[i],t[i],n-1);if(a!==!1)r||=Object.create(null),r[i]=a;else if(n===3)return!1}return r}function nr(e,t,n=4){let r=!1;for(let i in e)if(!(i in t))r||=Object.create(null),r[i]=n===0?null:er({},e[i],n-1);else if(n!==0){let a=nr(e[i],t[i],n-1);if(a!==!1)r||=Object.create(null),r[i]=a;else if(n===3)return!1}return r}var rr=class{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[``]=1,this._entities=Object.create(null),this._entities[1]=``,this._blankNodeIndex=0,this._factory=e.factory||Rt}_termFromId(e){if(e[0]===`.`){let t=this._entities,n=e.split(`.`);return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return Wt(e,this._factory)}_termToNumericId(e){if(e.termType===`Quad`){let t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object),i;return t&&n&&r&&(on(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[Gt(e)]}_termToNewNumericId(e){let t=e&&e.termType===`Quad`?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${on(e.graph)?``:`.${this._termToNewNumericId(e.graph)}`}`:Gt(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+ n++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}},ir=class e{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!=`function`&&(t=e,e=null),t||={},this._factory=t.factory||Rt,this._entityIndex=t.entityIndex||new rr({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;let t=this._graphs,n,r;for(let i in t)for(let a in n=t[i].subjects)for(let t in r=n[a])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){let i=e[t]||(e[t]={}),a=i[n]||(i[n]={}),o=r in a;return o||(a[r]=null),!o}_removeFromIndex(e,t,n,r){let i=e[t],a=i[n];delete a[r];for(let e in a)return;delete i[n];for(let e in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,a,o,s){let c,l,u,d=this._entities,f=this._termFromId(d[s]),p={subject:null,predicate:null,object:null};t&&((c=e,e={})[t]=c[t]);for(let t in e)if(l=e[t]){p[i]=this._termFromId(d[t]),n&&((c=l,l={})[n]=c[n]);for(let e in l)if(u=l[e]){p[a]=this._termFromId(d[e]);let t=r?r in u?[r]:[]:Object.keys(u);for(let e=0;e<t.length;e++)p[o]=this._termFromId(d[t[e]]),yield this._factory.quad(p.subject,p.predicate,p.object,f)}}}_loop(e,t){for(let n in e)t(n)}_loopByKey0(e,t,n){let r,i;if(r=e[t])for(i in r)n(i)}_loopByKey1(e,t,n){let r,i;for(r in e)i=e[r],i[t]&&n(r)}_loopBy2Keys(e,t,n,r){let i,a,o;if((i=e[t])&&(a=i[n]))for(o in a)r(o)}_countInIndex(e,t,n,r){let i=0,a,o,s;t&&((a=e,e={})[t]=a[t]);for(let t in e)if(o=e[t]){n&&((a=o,o={})[n]=a[n]);for(let e in o)(s=o[e])&&(r?r in s&&i++:i+=Object.keys(s).length)}return i}_getGraphs(e){return e=e===``?1:e&&(this._termToNumericId(e)||-1),typeof e==`number`?{[e]:this._graphs[e]}:this._graphs}_uniqueEntities(e){let t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r?this._termToNewNumericId(r):1;let i=this._graphs[r];return i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),this._addToIndex(i.subjects,e,t,n)?(this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.objects,n,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,r){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:r}=e),!this.readQuads(e,t,n,r).next().done}import(e){return e.on(`data`,e=>{this.addQuad(e)}),e}removeQuad(e,t,n,r){t||({subject:e,predicate:t,object:n,graph:r}=e),r=r?this._termToNumericId(r):1;let i=this._graphs,a,o,s;if(!(e&&=this._termToNumericId(e))||!(t&&=this._termToNumericId(t))||!(n&&=this._termToNumericId(n))||!(a=i[r])||!(o=a.subjects[e])||!(s=o[t])||!(n in s))return!1;for(e in this._removeFromIndex(a.subjects,e,t,n),this._removeFromIndex(a.predicates,t,n,e),this._removeFromIndex(a.objects,n,e,t),this._size!==null&&this._size--,a.subjects)return!0;return delete i[r],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on(`data`,e=>{this.removeQuad(e)}),e}removeMatches(e,t,n,r){let i=new Qn.Readable({objectMode:!0}),a=this.readQuads(e,t,n,r);return i._read=e=>{for(;--e>=0;){let{done:e,value:t}=a.next();if(e){i.push(null);return}i.push(t)}},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){return[...this.readQuads(e,t,n,r)]}*readQuads(e,t,n,r){let i=this._getGraphs(r),a,o,s,c;if(!(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||n&&!(c=this._termToNumericId(n))))for(let e in i)(a=i[e])&&(o?c?yield*this._findInIndex(a.objects,c,o,s,`object`,`subject`,`predicate`,e):yield*this._findInIndex(a.subjects,o,s,null,`subject`,`predicate`,`object`,e):s?yield*this._findInIndex(a.predicates,s,c,null,`predicate`,`object`,`subject`,e):c?yield*this._findInIndex(a.objects,c,null,null,`object`,`subject`,`predicate`,e):yield*this._findInIndex(a.subjects,null,null,null,`subject`,`predicate`,`object`,e))}match(e,t,n,r){return new or(this,e,t,n,r,{entityIndex:this._entityIndex})}countQuads(e,t,n,r){let i=this._getGraphs(r),a=0,o,s,c,l;if(e&&!(s=this._termToNumericId(e))||t&&!(c=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(let r in i)(o=i[r])&&(e?n?a+=this._countInIndex(o.objects,l,s,c):a+=this._countInIndex(o.subjects,s,c,l):t?a+=this._countInIndex(o.predicates,c,l,s):a+=this._countInIndex(o.objects,l,s,c));return a}forEach(e,t,n,r,i){this.some(t=>(e(t,this),!1),t,n,r,i)}every(e,t,n,r,i){return!this.some(t=>!e(t,this),t,n,r,i)}some(e,t,n,r,i){for(let a of this.readQuads(t,n,r,i))if(e(a,this))return!0;return!1}getSubjects(e,t,n){let r=[];return this.forSubjects(e=>{r.push(e)},e,t,n),r}forSubjects(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.predicates,o,s,e):this._loopByKey1(a.subjects,o,e):s?this._loopByKey0(a.objects,s,e):this._loop(a.subjects,e))}getPredicates(e,t,n){let r=[];return this.forPredicates(e=>{r.push(e)},e,t,n),r}forPredicates(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.objects,s,o,e):this._loopByKey0(a.subjects,o,e):s?this._loopByKey1(a.predicates,s,e):this._loop(a.predicates,e))}getObjects(e,t,n){let r=[];return this.forObjects(e=>{r.push(e)},e,t,n),r}forObjects(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.subjects,o,s,e):this._loopByKey1(a.objects,o,e):s?this._loopByKey0(a.predicates,s,e):this._loop(a.objects,e))}getGraphs(e,t,n){let r=[];return this.forGraphs(e=>{r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(let i in this._graphs)this.some(t=>(e(t.graph),!0),t,n,r,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){let n={},r=t?(()=>!0):((e,t)=>{throw Error(`${e.value} ${t}`)}),i=this.getQuads(null,Z.rdf.rest,Z.rdf.nil,null),a=e?[...i]:[];return i.forEach(t=>{let i=[],o=!1,s,c,l=t.graph,u=t.subject;for(;u&&!o;){let e=this.getQuads(null,null,u,null),t=this.getQuads(u,null,null,null),n,d=null,f=null,p=null;for(let i=0;i<t.length&&!o;i++)n=t[i],n.graph.equals(l)?s?o=r(u,`has non-list arcs out`):n.predicate.value===Z.rdf.first?d?o=r(u,`has multiple rdf:first arcs`):a.push(d=n):n.predicate.value===Z.rdf.rest?f?o=r(u,`has multiple rdf:rest arcs`):a.push(f=n):e.length?o=r(u,`can't be subject and object`):(s=n,c=`subject`):o=r(u,`not confined to single graph`);for(let t=0;t<e.length&&!o;++t)n=e[t],s?o=r(u,`can't have coreferences`):n.predicate.value===Z.rdf.rest?p?o=r(u,`has incoming rdf:rest arcs`):p=n:(s=n,c=`object`);d?i.unshift(d.object):o=r(u,`has no list head`),u=p&&p.subject}o?e=!1:s&&(n[s[c].value]=i)}),e&&this.removeQuads(a),n}addAll(t){if(t instanceof or&&(t=t.filtered),Array.isArray(t))this.addQuads(t);else if(t instanceof e&&t._entityIndex===this._entityIndex)t._size!==0&&(this._graphs=er(this._graphs,t._graphs),this._size=null);else for(let e of t)this.add(e);return this}contains(t){if(t instanceof or&&(t=t.filtered),t===this)return!0;if(!(t instanceof e)||this._entityIndex!==t._entityIndex)return t.every(e=>this.has(e));let n=this._graphs,r=t._graphs,i,a,o,s,c;for(let e in r){if(!(i=n[e]))return!1;i=i.subjects;for(let t in a=r[e].subjects){if(!(o=i[t]))return!1;for(let e in s=a[t]){if(!(c=o[e]))return!1;for(let t in s[e])if(!(t in c))return!1}}}return!0}deleteMatches(e,t,n,r){for(let i of this.match(e,t,n,r))this.removeQuad(i);return this}difference(t){if(t&&t instanceof or&&(t=t.filtered),t===this)return new e({entityIndex:this._entityIndex});if(t instanceof e&&t._entityIndex===this._entityIndex){let n=new e({entityIndex:this._entityIndex}),r=nr(this._graphs,t._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(e=>!t.has(e))}equals(e){return e instanceof or&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(t){let n=new e({entityIndex:this._entityIndex});for(let e of this)t(e,this)&&n.add(e);return n}intersection(t){if(t instanceof or&&(t=t.filtered),t===this){let t=new e({entityIndex:this._entityIndex});return t._graphs=er(Object.create(null),this._graphs),t._size=this._size,t}else if(t instanceof e&&this._entityIndex===t._entityIndex){let n=new e({entityIndex:this._entityIndex}),r=tr(t._graphs,this._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(e=>t.has(e))}map(t){let n=new e({entityIndex:this._entityIndex});for(let e of this)n.add(t(e,this));return n}reduce(e,t){let n=this.readQuads(),r=t===void 0?n.next().value:t;for(let t of n)r=e(r,t,this);return r}toArray(){return this.getQuads()}toCanonical(){throw Error(`not implemented`)}toStream(){return this.match()}toString(){return new Sn().quadsToString(this)}union(t){let n=new e({entityIndex:this._entityIndex});return n._graphs=er(Object.create(null),this._graphs),n._size=this._size,n.addAll(t),n}*[Symbol.iterator](){yield*this.readQuads()}};function ar(e,t,n=0){let r=t[n];if(r&&!(r in e))return!1;let i=!1;for(let a in r?{[r]:e[r]}:e){let r=n===2?null:ar(e[a],t,n+1);r!==!1&&(i||=Object.create(null),i[a]=r)}return i}var or=class e extends Qn.Readable{constructor(e,t,n,r,i,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:r,graph:i,options:a})}get filtered(){if(!this._filtered){let{n3Store:e,graph:t,object:n,predicate:r,subject:i}=this,a=this._filtered=new ir({factory:e._factory,entityIndex:this.options.entityIndex}),o,s,c;if(i&&!(o=a._termToNumericId(i))||r&&!(s=a._termToNumericId(r))||n&&!(c=a._termToNumericId(n)))return a;let l=e._getGraphs(t);for(let e in l){let t,n,r,i;(i=l[e])&&(!o&&s?(n=ar(i.predicates,[s,c,o]))&&(t=ar(i.subjects,[o,s,c]),r=ar(i.objects,[c,o,s])):c?(r=ar(i.objects,[c,o,s]))&&(t=ar(i.subjects,[o,s,c]),n=ar(i.predicates,[s,c,o])):(t=ar(i.subjects,[o,s,c]))&&(n=ar(i.predicates,[s,c,o]),r=ar(i.objects,[c,o,s])),t&&(a._graphs[e]={subjects:t,predicates:n,objects:r}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[$n]&&(this[$n]=this[Symbol.iterator]());let t=this[$n];for(;--e>=0;){let{done:e,value:n}=t.next();if(e){this.push(null);return}this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,r){return this.filtered.deleteMatches(e,t,n,r)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,r,i){return this.filtered.every(e,t,n,r,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,r,i){return this.filtered.forEach(e,t,n,r,i)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,r,i){return this.filtered.some(e,t,n,r,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new Sn().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(t,n,r,i){return new e(this.filtered,t,n,r,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}},sr={};function cr(e){let t=sr[e];if(t)return t;t=sr[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function lr(e,t){typeof t!=`string`&&(t=lr.defaultChars);let n=cr(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}lr.defaultChars=`;/?:@&=+$,#`,lr.componentChars=``;var ur={};function dr(e){let t=ur[e];if(t)return t;t=ur[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function fr(e,t,n){typeof t!=`string`&&(n=t,t=fr.defaultChars),n===void 0&&(n=!0);let r=dr(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}fr.defaultChars=`;/?:@&=+$,-_.!~*'()#`,fr.componentChars=`-_.!~*'()`;function pr(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function mr(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var hr=/^([a-z0-9.+-]+:)/i,gr=/:[0-9]*$/,_r=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,vr=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
744
- `,` `],yr=[`/`,`?`,`#`],br=255,xr=/^[+a-z0-9A-Z_-]{0,63}$/,Sr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Cr={javascript:!0,"javascript:":!0},wr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Tr(e,t){if(e&&e instanceof mr)return e;let n=new mr;return n.parse(e,t),n}mr.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=_r.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=hr.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Cr[o])&&(a=a.substr(2),this.slashes=!0)),!Cr[o]&&(i||o&&!wr[o])){let e=-1;for(let t=0;t<yr.length;t++)r=a.indexOf(yr[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<vr.length;t++)r=a.indexOf(vr[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(xr)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(xr)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Sr);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>br&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),wr[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},mr.prototype.parseHost=function(e){let t=gr.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Er=n({decode:()=>lr,encode:()=>fr,format:()=>pr,parse:()=>Tr}),Dr=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Or=/[\0-\x1F\x7F-\x9F]/,kr=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ar=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,jr=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Mr=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Nr=n({Any:()=>Dr,Cc:()=>Or,Cf:()=>kr,P:()=>Ar,S:()=>jr,Z:()=>Mr}),Pr=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Fr=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Ir=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Lr=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Rr(e){return e>=55296&&e<=57343||e>1114111?65533:Ir.get(e)??e}var zr;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(zr||={});var Br=32,Vr;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Vr||={});function Hr(e){return e>=zr.ZERO&&e<=zr.NINE}function Ur(e){return e>=zr.UPPER_A&&e<=zr.UPPER_F||e>=zr.LOWER_A&&e<=zr.LOWER_F}function Wr(e){return e>=zr.UPPER_A&&e<=zr.UPPER_Z||e>=zr.LOWER_A&&e<=zr.LOWER_Z||Hr(e)}function Gr(e){return e===zr.EQUALS||Wr(e)}var Kr;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Kr||={});var qr;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(qr||={});var Jr=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Kr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qr.Strict}startEntity(e){this.decodeMode=e,this.state=Kr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Kr.EntityStart:return e.charCodeAt(t)===zr.NUM?(this.state=Kr.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Kr.NamedEntity,this.stateNamedEntity(e,t));case Kr.NumericStart:return this.stateNumericStart(e,t);case Kr.NumericDecimal:return this.stateNumericDecimal(e,t);case Kr.NumericHex:return this.stateNumericHex(e,t);case Kr.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Br)===zr.LOWER_X?(this.state=Kr.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Kr.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Hr(r)||Ur(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Hr(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===zr.SEMI)this.consumed+=1;else if(this.decodeMode===qr.Strict)return 0;return this.emitCodePoint(Rr(this.result),this.consumed),this.errors&&(e!==zr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Vr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Xr(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===qr.Attribute&&(i===0||Gr(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Vr.VALUE_LENGTH)>>14,i!==0){if(a===zr.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==qr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Vr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Vr.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Kr.NamedEntity:return this.result!==0&&(this.decodeMode!==qr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Kr.NumericDecimal:return this.emitNumericEntity(0,2);case Kr.NumericHex:return this.emitNumericEntity(0,3);case Kr.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Kr.EntityStart:return 0}}};function Yr(e){let t=``,n=new Jr(e,e=>t+=Lr(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Xr(e,t,n,r){let i=(t&Vr.BRANCH_LENGTH)>>7,a=t&Vr.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var Zr=Yr(Pr);Yr(Fr);function Qr(e,t=qr.Legacy){return Zr(e,t)}var $r=n({arrayReplaceAt:()=>ai,assign:()=>ii,escapeHtml:()=>vi,escapeRE:()=>bi,fromCodePoint:()=>si,has:()=>ri,isMdAsciiPunct:()=>Ci,isPunctChar:()=>Si,isSpace:()=>$,isString:()=>ti,isValidEntityCode:()=>oi,isWhiteSpace:()=>xi,lib:()=>Ti,normalizeReference:()=>wi,unescapeAll:()=>pi,unescapeMd:()=>fi});function ei(e){return Object.prototype.toString.call(e)}function ti(e){return ei(e)===`[object String]`}var ni=Object.prototype.hasOwnProperty;function ri(e,t){return ni.call(e,t)}function ii(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function ai(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function oi(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function si(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var ci=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,li=RegExp(ci.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),ui=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function di(e,t){if(t.charCodeAt(0)===35&&ui.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return oi(n)?si(n):e}let n=Qr(e);return n===e?e:n}function fi(e){return e.indexOf(`\\`)<0?e:e.replace(ci,`$1`)}function pi(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(li,function(e,t,n){return t||di(e,n)})}var mi=/[&<>"]/,hi=/[&<>"]/g,gi={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function _i(e){return gi[e]}function vi(e){return mi.test(e)?e.replace(hi,_i):e}var yi=/[.?*+^$[\]\\(){}|-]/g;function bi(e){return e.replace(yi,`\\$&`)}function $(e){switch(e){case 9:case 32:return!0}return!1}function xi(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Si(e){return Ar.test(e)||jr.test(e)}function Ci(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function wi(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var Ti={mdurl:Er,ucmicro:Nr};function Ei(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Di(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=pi(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=pi(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function Oi(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=pi(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=pi(e.slice(t,a)),o}var ki=n({parseLinkDestination:()=>Di,parseLinkLabel:()=>Ei,parseLinkTitle:()=>Oi}),Ai={};Ai.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+vi(a.content)+`</code>`},Ai.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+vi(e[t].content)+`</code></pre>
745
- `},Ai.fence=function(e,t,n,r,i){let a=e[t],o=a.info?pi(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||vi(a.content),l.indexOf(`<pre`)===0)return l+`
746
- `;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},Ai.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},Ai.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
747
- `:`<br>
748
- `},Ai.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
749
- `:`<br>
750
- `:`
751
- `},Ai.text=function(e,t){return vi(e[t].content)},Ai.html_block=function(e,t){return e[t].content},Ai.html_inline=function(e,t){return e[t].content};function ji(){this.rules=ii({},Ai)}ji.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+vi(e.attrs[t][0])+`="`+vi(e.attrs[t][1])+`"`;return r},ji.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
752
- `),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
753
- `:`>`,i},ji.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},ji.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
754
- `;break;default:}return r},ji.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function Mi(){this.__rules__=[],this.__cache__=null}Mi.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Mi.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Mi.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Mi.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Mi.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Mi.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Mi.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Mi.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Mi.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Mi.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Ni(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}Ni.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},Ni.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Ni.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Ni.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},Ni.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function Pi(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Pi.prototype.Token=Ni;var Fi=/\r\n?|\n/g,Ii=/\0/g;function Li(e){let t;t=e.src.replace(Fi,`
755
- `),t=t.replace(Ii,`�`),e.src=t}function Ri(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function zi(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function Bi(e){return/^<a[>\s]/i.test(e)}function Vi(e){return/^<\/a\s*>/i.test(e)}function Hi(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(Bi(o.content)&&i>0&&i--,Vi(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=ai(r,a,c)}}}}var Ui=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Wi=/\((c|tm|r)\)/i,Gi=/\((c|tm|r)\)/gi,Ki={c:`©`,r:`®`,tm:`™`};function qi(e,t){return Ki[t.toLowerCase()]}function Ji(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(Gi,qi)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Yi(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Ui.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Xi(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(Wi.test(e.tokens[t].content)&&Ji(e.tokens[t].children),Ui.test(e.tokens[t].content)&&Yi(e.tokens[t].children))}var Zi=/['"]/,Qi=/['"]/g,$i=`’`;function ea(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ta(e,t){let n,r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){Qi.lastIndex=c;let u=Qi.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=i-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Ci(m)||Si(String.fromCharCode(m)),_=Ci(h)||Si(String.fromCharCode(h)),v=xi(m),y=xi(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=ea(a.content,u.index,$i));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=t.md.options.quotes[2],f=t.md.options.quotes[3]):(o=t.md.options.quotes[0],f=t.md.options.quotes[1]),a.content=ea(a.content,u.index,f),e[d.token].content=ea(e[d.token].content,d.pos,o),c+=f.length-1,d.token===i&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:i,pos:u.index,single:p,level:o}):f&&p&&(a.content=ea(a.content,u.index,$i))}}}function na(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!Zi.test(e.tokens[t].content)||ta(e.tokens[t].children,e)}function ra(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var ia=[[`normalize`,Li],[`block`,Ri],[`inline`,zi],[`linkify`,Hi],[`replacements`,Xi],[`smartquotes`,na],[`text_join`,ra]];function aa(){this.ruler=new Mi;for(let e=0;e<ia.length;e++)this.ruler.push(ia[e][0],ia[e][1])}aa.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},aa.prototype.State=Pi;function oa(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if($(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}oa.prototype.push=function(e,t,n){let r=new Ni(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},oa.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},oa.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},oa.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&$(this.src.charCodeAt(e));e++);return e},oa.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!$(this.src.charCodeAt(--e)))return e+1;return e},oa.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},oa.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},oa.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if($(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},oa.prototype.Token=Ni;var sa=65536;function ca(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function la(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function ua(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!$(s)||o===45&&$(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!$(t))return!1;a++}let c=ca(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=ca(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=la(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=ca(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=la(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>sa))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function da(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
756
- `,a.map=[t,e.line],!0}function fa(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function pa(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if($(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function ma(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!$(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function ha(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!$(e.src.charCodeAt(r))?-1:r}function ga(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!$(a))?-1:i}function _a(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function va(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=ga(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=ha(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=ga(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=ha(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&_a(e,h),!0}function ya(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!$(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!$(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&$(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&$(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=wi(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var ba=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),xa=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Sa=RegExp(`^(?:`+xa+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|\x3C!---?>|\x3C!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Ca=RegExp(`^(?:`+xa+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),wa=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^\x3C!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+ba.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Ca.source+`\\s*$`),/^$/,!1]];function Ta(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<wa.length&&!wa[s][0].test(o);s++);if(s===wa.length)return!1;if(r)return wa[s][2];let c=t+1;if(!wa[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),wa[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Ea(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!$(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&$(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Da(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Oa(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var ka=[[`table`,ua,[`paragraph`,`reference`]],[`code`,da],[`fence`,fa,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,pa,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,ma,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,va,[`paragraph`,`reference`,`blockquote`]],[`reference`,ya],[`html_block`,Ta,[`paragraph`,`reference`,`blockquote`]],[`heading`,Ea,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Da],[`paragraph`,Oa]];function Aa(){this.ruler=new Mi;for(let e=0;e<ka.length;e++)this.ruler.push(ka[e][0],ka[e][1],{alt:(ka[e][2]||[]).slice()})}Aa.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Aa.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Aa.prototype.State=oa;function ja(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}ja.prototype.pushPending=function(){let e=new Ni(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},ja.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new Ni(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},ja.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32,c=Ci(i)||Si(String.fromCharCode(i)),l=Ci(s)||Si(String.fromCharCode(s)),u=xi(i),d=xi(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},ja.prototype.Token=Ni;function Ma(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Na(e,t){let n=e.pos;for(;n<e.posMax&&!Ma(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Pa=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Fa(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(Pa);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function Ia(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&$(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var La=[];for(let e=0;e<256;e++)La.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){La[e.charCodeAt(0)]=1});function Ra(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),$(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&La[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function za(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function Ba(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Va(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function Ha(e){let t=e.tokens_meta,n=e.tokens_meta.length;Va(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Va(e,t[r].delimiters)}var Ua={tokenize:Ba,postProcess:Ha};function Wa(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Ga(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function Ka(e){let t=e.tokens_meta,n=e.tokens_meta.length;Ga(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Ga(e,t[r].delimiters)}var qa={tokenize:Wa,postProcess:Ka};function Ja(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!$(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!$(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!$(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[wi(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function Ya(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!$(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!$(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!$(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[wi(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var Xa=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Za=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Qa(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(Za.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(Xa.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function $a(e){return/^<a[>\s]/i.test(e)}function eo(e){return/^<\/a\s*>/i.test(e)}function to(e){let t=e|32;return t>=97&&t<=122}function no(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!to(i))return!1;let a=e.src.slice(r).match(Sa);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],$a(t.content)&&e.linkLevel++,eo(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var ro=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,io=/^&([a-z][a-z0-9]{1,31});/i;function ao(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(ro);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=oi(t)?si(t):si(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(io);if(r){let n=Qr(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function oo(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function so(e){let t=e.tokens_meta,n=e.tokens_meta.length;oo(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&oo(t[e].delimiters)}function co(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var lo=[[`text`,Na],[`linkify`,Fa],[`newline`,Ia],[`escape`,Ra],[`backticks`,za],[`strikethrough`,Ua.tokenize],[`emphasis`,qa.tokenize],[`link`,Ja],[`image`,Ya],[`autolink`,Qa],[`html_inline`,no],[`entity`,ao]],uo=[[`balance_pairs`,so],[`strikethrough`,Ua.postProcess],[`emphasis`,qa.postProcess],[`fragments_join`,co]];function fo(){this.ruler=new Mi;for(let e=0;e<lo.length;e++)this.ruler.push(lo[e][0],lo[e][1]);this.ruler2=new Mi;for(let e=0;e<uo.length;e++)this.ruler2.push(uo[e][0],uo[e][1])}fo.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},fo.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},fo.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},fo.prototype.State=ja;function po(e){let t={};e||={},t.src_Any=Dr.source,t.src_Cc=Or.source,t.src_Z=Mr.source,t.src_P=Ar.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function mo(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function ho(e){return Object.prototype.toString.call(e)}function go(e){return ho(e)===`[object String]`}function _o(e){return ho(e)===`[object Object]`}function vo(e){return ho(e)===`[object RegExp]`}function yo(e){return ho(e)===`[object Function]`}function bo(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var xo={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function So(e){return Object.keys(e||{}).reduce(function(e,t){return e||xo.hasOwnProperty(t)},!1)}var Co={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},wo=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,To=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Eo(e){e.__index__=-1,e.__text_cache__=``}function Do(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Oo(){return function(e,t){t.normalize(e)}}function ko(e){let t=e.re=po(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(wo),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,_o(n)){vo(n.validate)?r.validate=Do(n.validate):yo(n.validate)?r.validate=n.validate:a(t,n),yo(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Oo();return}if(go(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Oo()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(bo).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),Eo(e)}function Ao(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function jo(e,t){let n=new Ao(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Mo(e,t){if(!(this instanceof Mo))return new Mo(e,t);t||So(e)&&(t=e,e={}),this.__opts__=mo({},xo,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=mo({},Co,e),this.__compiled__={},this.__tlds__=To,this.__tlds_replaced__=!1,this.re={},ko(this)}Mo.prototype.add=function(e,t){return this.__schemas__[e]=t,ko(this),this},Mo.prototype.set=function(e){return this.__opts__=mo(this.__opts__,e),this},Mo.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},Mo.prototype.pretest=function(e){return this.re.pretest.test(e)},Mo.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Mo.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(jo(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(jo(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},Mo.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,jo(this,0)):null},Mo.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),ko(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ko(this),this)},Mo.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},Mo.prototype.onCompile=function(){};var No=2147483647,Po=36,Fo=1,Io=26,Lo=38,Ro=700,zo=72,Bo=128,Vo=`-`,Ho=/^xn--/,Uo=/[^\0-\x7F]/,Wo=/[\x2E\u3002\uFF0E\uFF61]/g,Go={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Ko=Po-Fo,qo=Math.floor,Jo=String.fromCharCode;function Yo(e){throw RangeError(Go[e])}function Xo(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Zo(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Wo,`.`);let i=Xo(e.split(`.`),t).join(`.`);return r+i}function Qo(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var $o=e=>String.fromCodePoint(...e),es=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Po},ts=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},ns=function(e,t,n){let r=0;for(e=n?qo(e/Ro):e>>1,e+=qo(e/t);e>Ko*Io>>1;r+=Po)e=qo(e/Ko);return qo(r+(Ko+1)*e/(e+Lo))},rs=function(e){let t=[],n=e.length,r=0,i=Bo,a=zo,o=e.lastIndexOf(Vo);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&Yo(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=Po;;i+=Po){s>=n&&Yo(`invalid-input`);let o=es(e.charCodeAt(s++));o>=Po&&Yo(`invalid-input`),o>qo((No-r)/t)&&Yo(`overflow`),r+=o*t;let c=i<=a?Fo:i>=a+Io?Io:i-a;if(o<c)break;let l=Po-c;t>qo(No/l)&&Yo(`overflow`),t*=l}let c=t.length+1;a=ns(r-o,c,o==0),qo(r/c)>No-i&&Yo(`overflow`),i+=qo(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},is=function(e){let t=[];e=Qo(e);let n=e.length,r=Bo,i=0,a=zo;for(let n of e)n<128&&t.push(Jo(n));let o=t.length,s=o;for(o&&t.push(Vo);s<n;){let n=No;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>qo((No-i)/c)&&Yo(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>No&&Yo(`overflow`),n===r){let e=i;for(let n=Po;;n+=Po){let r=n<=a?Fo:n>=a+Io?Io:n-a;if(e<r)break;let i=e-r,o=Po-r;t.push(Jo(ts(r+i%o,0))),e=qo(i/o)}t.push(Jo(ts(e,0))),a=ns(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},as={version:`2.3.1`,ucs2:{decode:Qo,encode:$o},decode:rs,encode:is,toASCII:function(e){return Zo(e,function(e){return Uo.test(e)?`xn--`+is(e):e})},toUnicode:function(e){return Zo(e,function(e){return Ho.test(e)?rs(e.slice(4).toLowerCase()):e})}},os={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},ss=/^(vbscript|javascript|file|data):/,cs=/^data:image\/(gif|png|jpeg|webp);/;function ls(e){let t=e.trim().toLowerCase();return ss.test(t)?cs.test(t):!0}var us=[`http:`,`https:`,`mailto:`];function ds(e){let t=Tr(e,!0);if(t.hostname&&(!t.protocol||us.indexOf(t.protocol)>=0))try{t.hostname=as.toASCII(t.hostname)}catch{}return fr(pr(t))}function fs(e){let t=Tr(e,!0);if(t.hostname&&(!t.protocol||us.indexOf(t.protocol)>=0))try{t.hostname=as.toUnicode(t.hostname)}catch{}return lr(pr(t),lr.defaultChars+`%`)}function ps(e,t){if(!(this instanceof ps))return new ps(e,t);t||ti(e)||(t=e||{},e=`default`),this.inline=new fo,this.block=new Aa,this.core=new aa,this.renderer=new ji,this.linkify=new Mo,this.validateLink=ls,this.normalizeLink=ds,this.normalizeLinkText=fs,this.utils=$r,this.helpers=ii({},ki),this.options={},this.configure(e),t&&this.set(t)}ps.prototype.set=function(e){return ii(this.options,e),this},ps.prototype.configure=function(e){let t=this;if(ti(e)){let t=e;if(e=os[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},ps.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},ps.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},ps.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},ps.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},ps.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},ps.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},ps.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var ms={minimal:`[my] <tag:alice@example.com,2026:minimal/>
757
-
758
- # Simple Note {=my:note .prov:Entity label}
759
-
760
- This demonstrates basic MD-LD annotation patterns.
761
-
762
- ## Basic Properties
763
-
764
- Title: [Hello World] {my:title}
765
- Status: *draft* {my:status}
766
- Priority: **medium** {my:priority}
767
-
768
- ## Typed Values
769
-
770
- Created: \`2026-05-06\` {my:created ^^xsd:date}
771
- Count: \`42\` {my:count ^^xsd:integer}
772
- Rating: __4.5__ {my:rating ^^xsd:decimal}
773
- Active: **true** {my:active ^^xsd:boolean}
774
-
775
- ## Simple Link
776
-
777
- Related to: [Example Project] {+my:example-project ?my:relatedTo .prov:Project label}
778
-
779
- `,journal:`[j] <tag:alice@example.com,2026:journal:>
780
-
781
- # Personal Journal {=j:index .prov:Collection label}
782
-
783
- Alice's daily journal, structured as a hierarchy of collections. The top-level index contains [2026] {+j:2026/index ?prov:hadMember label}.
784
-
785
- ## Year 2026 {=j:2026/index .prov:Collection label}
786
-
787
- 2026 is organised into monthly collections: [January] {+j:2026/01/index ?prov:hadMember label}, [February] {+j:2026/02/index ?prov:hadMember label}, [March] {+j:2026/03/index ?prov:hadMember label}, [April] {+j:2026/04/index ?prov:hadMember label}, and [May] {+j:2026/05/index ?prov:hadMember label}.
788
-
789
- ## May 2026 {=j:2026/05/index .prov:Collection label}
790
-
791
- May started on [2026-05-01] {prov:startedAtTime ^^xsd:date} and is divided into five weekly collections: days [1–3] {+j:2026/05/week-1/index ?prov:hadMember label}, [4–10] {+j:2026/05/week-2/index ?prov:hadMember label}, [11–17] {+j:2026/05/week-3/index ?prov:hadMember label}, [18–24] {+j:2026/05/week-4/index ?prov:hadMember label}, and [25–31] {+j:2026/05/week-5/index ?prov:hadMember label}.
792
-
793
- ## Week 2, May 2026 {=j:2026/05/week-2/index .prov:Collection label}
794
-
795
- The second week of May ran from [2026-05-04] {prov:startedAtTime ^^xsd:date} through [2026-05-10] {prov:endedAtTime ^^xsd:date}. It contained [6] {j:totalActivities ^^xsd:integer} logged activities across [5] {j:readingHours ^^xsd:integer} hours of reading, [8] {j:workHours ^^xsd:integer} hours of work, and [3] {j:exerciseHours ^^xsd:integer} hours of exercise. Of [5] {j:goalsTotal ^^xsd:integer} weekly goals set on Monday, [4] {j:goalsCompleted ^^xsd:integer} were completed and [1] {j:goalsCarryOver ^^xsd:integer} carried over.
796
-
797
- The week's daily entries are members of this collection:
798
-
799
- ======
800
-
801
- ### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
802
-
803
- A productive Wednesday. The day ran from [2026-05-06T08:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime} to [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime} and is a [member] {+j:2026/05/week-2/index ?prov:hadMember} of week 2. It produced a [daily summary] {+j:2026/05/06/summary .prov:Entity ?prov:generated label} capturing mood and locations visited.
804
-
805
- The day flowed through three phases, each informing the next: [morning] {+#morning ?prov:wasInformedBy}, then [afternoon] {+#afternoon ?prov:wasInformedBy}, then [social] {+#social ?prov:wasInformedBy}.
806
-
807
- #### Morning {=#morning .prov:Activity label}
808
-
809
- The morning started with a [walk] {+#walk ?prov:wasInformedBy} and then [coffee] {+#coffee-prep ?prov:wasInformedBy}.
810
-
811
- ##### Morning Walk {=#walk .prov:Activity label}
812
-
813
- A [45] {j:durationMin ^^xsd:integer}-minute run covering [2.5] {j:distanceMiles ^^xsd:decimal} miles through [Central Park] {+j:place/central-park .prov:Location ?prov:atLocation label}, wearing [running shoes] {+j:shoes/running .prov:Entity ?prov:used label}. The watch generated [heart rate data] {+j:2026/05/06/hr-data .prov:Entity ?prov:generated label} for the session.
814
-
815
- ##### Coffee Preparation {=#coffee-prep .prov:Activity label}
816
-
817
- Back [home] {+j:place/home .prov:Location ?prov:atLocation label}, ground [coffee beans] {+j:coffee/beans .prov:Entity ?prov:used label} with [water] {+j:coffee/water .prov:Entity ?prov:used label} and produced a [morning coffee] {+#morning-coffee .prov:Entity ?prov:generated label}.
818
-
819
- #### Afternoon {=#afternoon .prov:Activity ?prov:wasInformedBy label}
820
-
821
- The afternoon split between reading and a work session.
822
-
823
- ##### Reading Session {=#reading .prov:Activity label}
824
-
825
- Read [42] {j:pages ^^xsd:integer} pages of [Dune] {+j:dune-book .prov:Entity ?prov:used label} over [2] {j:durationHours ^^xsd:integer} hours, producing [reading notes] {+j:reading-notes .prov:Entity ?prov:generated label}.
826
-
827
- ##### Work Session {=#work .prov:Activity ?prov:wasInformedBy label}
828
-
829
- Spent [3] {j:durationHours ^^xsd:integer} hours on [API documentation] {+j:api-docs .prov:Entity ?prov:used label}, generating [documentation updates] {+j:doc-updates .prov:Entity ?prov:generated label}.
830
-
831
- #### Social {=#social .prov:Activity ?prov:wasInformedBy label}
832
-
833
- Met [Sam] {+j:sam .prov:Person ?prov:wasAssociatedWith label} at the [local café] {+j:place/cafe .prov:Location ?prov:atLocation label} for [30] {j:durationMin ^^xsd:integer} minutes to talk through [career changes] {j:topic}.
834
-
835
- ### Daily Summary {=j:2026/05/06/summary .prov:Entity label}
836
-
837
- End-of-day reflection, generated by the day's activity. Mood: [happy] {j:mood}, energy [8] {j:energy ^^xsd:integer}/10, stress [2] {j:stress ^^xsd:integer}/10. Places visited today: [Central Park] {+j:place/central-park ?j:visited}, [home] {+j:place/home ?j:visited}, and [local café] {+j:place/cafe ?j:visited}.
838
-
839
- `,recipe:`[food] <tag:alice@example.com,2026:food/>
840
- [schema] <http://schema.org/>
841
-
842
- # Grandma's Apple Pie {=food:apple-pie .schema:Recipe .prov:Entity label}
843
-
844
- > Delicious apple pie as gradma used to make it autumn. {comment}
845
-
846
- This is a [American] {food:cuisine} family recipe that Grandma Rose has been making since the 1960s. It takes about [45] {food:prepTime ^^xsd:integer} minutes to prepare and [55] {food:cookTime ^^xsd:integer} minutes to bake, making [8] {food:servings ^^xsd:integer} generous slices. It's a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?schema:isBasedOn label} — her version adds more cinnamon and uses a butter crust rather than shortening. You might also like [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe label} or [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe label} if you want something in the same family.
847
-
848
- Per serving this comes in at around [320] {food:calories ^^xsd:integer} calories, [14g] {food:fat} fat, [42g] {food:carbs} carbs, and [2g] {food:protein} protein.
849
-
850
- ## Ingredients
851
-
852
- ### Crust
853
-
854
- **Flour** {=food:flour}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#flour ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2.5] {food:amount ^^xsd:decimal} [cups] {+food:cup ?food:unit} of *flour* {+food:flour ?prov:entity}.
855
-
856
- **Butter** {=food:butter}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#butter ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *cold* {food:temperature} *butter* {+food:butter ?prov:entity}.
857
-
858
- **Eggs** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#eggs ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} *eggs* {+food:egg ?prov:entity}.
859
-
860
- **Sugar** {=food:sugar}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#sugar ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *butter* {+food:sugar ?prov:entity}.
861
-
862
- **Salt** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#salt ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [0.5] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *salt* {+food:salt ?prov:entity}.
863
-
864
- **Vanilla** {=food:vanilla}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#vanilla ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *vanilla* {+food:vanilla ?prov:entity}.
865
-
866
- ### Filling
867
-
868
- **Apples** {=food:apples}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#apples ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [6] {food:amount ^^xsd:integer} medium *apples* {+food:apple ?prov:entity}, peeled and sliced.
869
-
870
- **Cinnamon** {=food:cinnamon}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#cinnamon ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} [tsp] {+food:tsp ?food:unit} ground *cinnamon* {+food:cinnamon ?prov:entity}.
871
-
872
- **Lemon Juice** {=food:lemon-juice}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#lemon-juice ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:integer} [tbsp] {+food:tbsp ?food:unit} *lemon juice* {+food:lemon-juice ?prov:entity}.
873
-
874
- ## Making the Crust {=#step-crust .prov:Activity label}
875
-
876
- Mix [flour] {+#flour ?prov:qualifiedUsage}, [sugar] {+#sugar ?prov:qualifiedUsage}, and [salt] {+#salt ?prov:qualifiedUsage} together, then cut in [cold butter] {+#butter ?prov:qualifiedUsage} until the mixture looks like coarse crumbs. Press into your [pie dish] {+food:pie-dish .food:Equipment ?prov:used label} and set aside. This produces the [unbaked crust] {+#unbaked-crust .prov:Entity ?prov:generated label}.
877
-
878
- ## Making the Filling {=#step-filling .prov:Activity ?prov:wasInformedBy label}
879
-
880
- Toss [apples] {+#apples ?prov:qualifiedUsage} with [cinnamon] {+#cinnamon ?prov:qualifiedUsage} and [lemon juice] {+#lemon-juice ?prov:qualifiedUsage}. Let it sit for [10] {food:restTime ^^xsd:integer} minutes so the flavours start to meld — you'll see some juice pool at the bottom, that's what makes it bubbly in the oven. This gives you the [spiced filling] {+#spiced-filling .prov:Entity ?prov:generated label}.
881
-
882
- ## Assembly and Baking {=#step-baking .prov:Activity ?prov:wasInformedBy label}
883
-
884
- Spoon the [spiced filling] {+#spiced-filling ?prov:used} into the [unbaked crust] {+#unbaked-crust ?prov:used}, cover with a [top crust] {+#top-crust ?prov:used label}, and cut a few vent holes so steam can escape. Bake at [375] {food:bakeTempF ^^xsd:integer}°F for [50] {food:bakeTimeMin ^^xsd:integer} minutes until [golden brown] {food:color}. This produces the [finished pie] {+#finished-pie .prov:Entity ?prov:generated label}.
885
-
886
- ## How This Recipe Came to Be {=#creation .prov:Activity ?prov:wasInformedBy label}
887
-
888
- [Grandma Rose] {+food:grandma-rose .prov:Person ?prov:wasAssociatedWith label} developed this version over many years, working from the [Family Recipe Book] {+food:recipe-book .prov:Entity ?prov:used label} she brought from her childhood home. [Alice] {+food:alice .prov:Person ?prov:wasAssociatedWith label} wrote it down on [2026-05-06] {prov:endedAtTime ^^xsd:date} to make sure it wouldn't be lost, producing this [recipe documentation] {+#recipe-docs .prov:Entity ?prov:generated label}.`,project:`[proj] <tag:alice@example.com,2026:project/>
889
-
890
- # Website Redesign {=proj:website .proj:Project .prov:Plan label}
891
-
892
- The Q2 2026 website redesign is a [$25,000] {proj:budget ^^xsd:decimal} initiative running from [2026-06-01] {prov:startedAtTime ^^xsd:date} through [2026-08-31] {prov:endedAtTime ^^xsd:date}, currently in [planning] {proj:status} status. It is backed by the [Marketing Department] {+proj:marketing ?proj:sponsor .prov:Organization label} and [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization label}, both of whom provided the brief.
893
-
894
- ## Team
895
-
896
- Three people assembled under the [Q2 Website Plan] {+proj:q2-plan .prov:Plan label} to staff this project.
897
-
898
- ### Alice Johnson {=proj:alice .prov:Person label}
899
-
900
- [alice@example.com] {proj:email} — [Project Manager] {proj:role}, responsible for overall delivery and stakeholder communication.
901
-
902
- ### Bob Smith {=proj:bob .prov:Person label}
903
-
904
- [bob@example.com] {proj:email} — [Lead Developer] {proj:role}, leading all frontend and backend implementation work. Bob acts on behalf of [Alice] {+proj:alice ?prov:actedOnBehalfOf} as the technical authority for the project.
905
-
906
- ### Carol Davis {=proj:carol .prov:Person label}
907
-
908
- [carol@example.com] {proj:email} — [UX Designer] {proj:role}, responsible for user research through to final visual design.
909
-
910
- ## Team Formation {=proj:team-formation .prov:Activity label}
911
-
912
- On [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime} Alice convened the team and formalised the plan. She was [associated with] {+proj:alice ?prov:wasAssociatedWith} the activity directly, and it produced the [assembled team entity] {+proj:team-structure .prov:Entity ?prov:generated label} — the agreed roster and responsibility assignments that subsequent phases depend on.
913
-
914
- ## Design Phase {=proj:design-phase .prov:Activity ?prov:wasInformedBy label}
915
-
916
- Kicking off on [2026-06-01] {prov:startedAtTime ^^xsd:date} and wrapping by [2026-06-15] {prov:endedAtTime ^^xsd:date}, the design phase was led by [Carol] {+proj:carol ?prov:wasAssociatedWith}. It drew on the [assembled team entity] {+proj:team-structure ?prov:used} established during team formation and consumed the [existing design system] {+proj:design-system .prov:Entity ?prov:used label} as a constraint baseline. The phase moved from user interviews through wireframes to polished mockups, producing the [design documentation] {+proj:design-docs .prov:Entity ?prov:generated label} that development would build from.
917
-
918
- ## Development Phase {=proj:dev-phase .prov:Activity ?prov:wasInformedBy label}
919
-
920
- Development ran from [2026-06-16] {prov:startedAtTime ^^xsd:date} to [2026-07-30] {prov:endedAtTime ^^xsd:date}, led by [Bob] {+proj:bob ?prov:wasAssociatedWith}. The team used the [design documentation] {+proj:design-docs ?prov:used} directly — no redesign, just implementation — alongside the [API documentation] {+proj:api-docs .prov:Entity ?prov:used label} for backend contracts. The phase generated the [working prototype] {+proj:prototype .prov:Entity ?prov:generated label} deployed to staging.
921
-
922
- ## Validation Shapes
923
-
924
- Every project document should be self-consistent. These shapes enforce the minimum structural expectations for a project, its team, and its deliverables.
925
-
926
- ### Project Shape {=proj:ProjectShape .sh:NodeShape label}
927
-
928
- Validates every [proj:Project] {+proj:Project ?sh:targetClass} to carry a [budget] {+#budget ?sh:property sh:name}, a [status] {+#status ?sh:property sh:name}, and at least one [sponsor] {+#sponsor ?sh:property sh:name}.
929
-
930
- #### Budget is required {=#budget .sh:PropertyShape sh:message}
931
- [proj:budget] {+proj:budget ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and be a [decimal] {+xsd:decimal ?sh:datatype}.
932
-
933
- #### Status is required {=#status .sh:PropertyShape sh:message}
934
- [proj:status] {+proj:status ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
935
-
936
- #### Sponsor is required {=#sponsor .sh:PropertyShape sh:message}
937
- A project must be backed by at least [1] {sh:minCount ^^xsd:integer} [proj:sponsor] {+proj:sponsor ?sh:path}.
938
-
939
- ### Team Member Shape {=proj:PersonShape .sh:NodeShape label}
940
-
941
- Validates every [prov:Person] {+prov:Person ?sh:targetClass} in this project to have an [email] {+#email ?sh:property sh:name} and a [role] {+#role ?sh:property sh:name}.
942
-
943
- #### Email is required {=#email .sh:PropertyShape sh:message}
944
- [proj:email] {+proj:email ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and match the pattern [^.+@.+$] {sh:pattern}.
945
-
946
- #### Role is required {=#role .sh:PropertyShape sh:message}
947
- [proj:role] {+proj:role ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
948
-
949
- ### Deliverable Shape {=proj:DeliverableShape .sh:NodeShape label}
950
-
951
- Validates every [prov:Entity] {+prov:Entity ?sh:targetClass} produced by a project activity to have a [label] {+#dlabel ?sh:property sh:name} and a [wasGeneratedBy] {+#generated ?sh:property sh:name} link.
952
-
953
- #### Label is required {=#dlabel .sh:PropertyShape sh:message}
954
- Every deliverable must have exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} [rdfs:label] {+rdfs:label ?sh:path}.
955
-
956
- #### Generation link is required {=#generated .sh:PropertyShape sh:message}
957
- Every deliverable must trace back to at least [1] {sh:minCount ^^xsd:integer} [prov:wasGeneratedBy] {+prov:wasGeneratedBy ?sh:path} activity.
958
-
959
- ## Project Is On Schedule {=proj:stmt-schedule .rdf:Statement .prov:Entity label}
960
-
961
- **The working prototype** {+proj:prototype ?rdf:subject} *was delivered by* {+proj:deliveredBy ?rdf:predicate} **2026-07-30, within the original timeline** {+proj:original-timeline ?rdf:object}.
962
- Generated by: [Development Phase] {+proj:dev-phase ?prov:wasGeneratedBy}
963
- Derived from: [Design Documentation] {+proj:design-docs ?prov:wasDerivedFrom}
964
- Established: [2026-07-30T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
965
-
966
- ## Design System Adopted as Foundation {=proj:stmt-design-system .rdf:Statement .prov:Entity label}
967
-
968
- **The design documentation** {+proj:design-docs ?rdf:subject} *was derived from* {+prov:wasDerivedFrom ?rdf:predicate} **the existing design system** {+proj:design-system ?rdf:object}.
969
- Generated by: [Design Phase] {+proj:design-phase ?prov:wasGeneratedBy}
970
- Derived from: [Team Formation] {+proj:team-formation ?prov:wasDerivedFrom}
971
- Established: [2026-06-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
972
- `,"space-mission":`[cassini] <https://nasa.gov/cassini/>
973
- [xsd] <http://www.w3.org/2001/XMLSchema#>
974
-
975
- # Cassini-Huygens Mission {=cassini:mission .prov:Activity label}
976
-
977
- > Cassini-Huygens was a joint NASA/ESA/ASI mission to Saturn, running from launch in 1997 to a deliberate atmospheric entry in 2017. {comment}
978
-
979
- Over nearly two decades it reshaped our understanding of the ringed planet, its moons, and the potential for life in the outer solar system. This document traces the mission's major phases as a provenance chain, with the spacecraft's modules modelled as the agents responsible for each phase of science.
980
-
981
- ## Spacecraft Modules {=cassini:spacecraft .prov:Entity label}
982
-
983
- The spacecraft comprised two largely independent systems that separated after arrival at Saturn.
984
-
985
- ### Cassini Orbiter {=cassini:orbiter .prov:Agent label}
986
-
987
- Built by NASA's Jet Propulsion Laboratory, it spent thirteen years in Saturn orbit carrying twelve science instruments. Its mass was [2,523] {cassini:massKg ^^xsd:decimal} kg at launch and it was operated by [JPL] {+cassini:jpl ?prov:actedOnBehalfOf .prov:Organization label}.
988
-
989
- ### Huygens Probe {=cassini:huygens .prov:Agent label}
990
-
991
- An ESA-built atmospheric entry vehicle designed for a single-use descent through Titan's thick nitrogen atmosphere. It carried [six] {cassini:instrumentCount ^^xsd:integer} dedicated instruments and acted on behalf of [ESA] {+cassini:esa ?prov:actedOnBehalfOf .prov:Organization label}.
992
-
993
- ## Mission Timeline
994
-
995
- The mission unfolded in four major phases, each building on the last through a clean provenance chain.
996
-
997
- ### Launch and Cruise {=cassini:launch-cruise .prov:Activity label}
998
-
999
- Cassini lifted off on [1997-10-15T08:43:00Z] {prov:startedAtTime ^^xsd:dateTime} and spent seven years on a gravity-assist trajectory through the inner solar system. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} and [Huygens probe] {+cassini:huygens ?prov:wasAssociatedWith} traveled together. The cruise ended on [2004-07-01T02:12:00Z] {prov:endedAtTime ^^xsd:dateTime} when the main engine fired for Saturn Orbit Insertion, producing the [Saturn approach dataset] {+cassini:cruise-data .prov:Entity ?prov:generated label} — dust measurements, solar wind readings, and the first distant imaging of the Saturn system.
1000
-
1001
- ### Saturn Orbit Insertion {=cassini:soi .prov:Activity ?prov:wasInformedBy label}
1002
-
1003
- The engine burn on [2004-07-01T02:12:00Z] {prov:startedAtTime ^^xsd:dateTime} lasting 96 minutes placed Cassini into Saturn orbit. It ended at [2004-07-01T03:48:00Z] {prov:endedAtTime ^^xsd:dateTime}. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} executed the manoeuvre autonomously. This generated the [initial ring-crossing observations] {+cassini:ring-crossing-data .prov:Entity ?prov:generated label} — the first in-situ measurements of ring particle composition.
1004
-
1005
- ### Huygens Titan Descent {=cassini:titan-descent .prov:Activity ?prov:wasInformedBy label}
1006
-
1007
- The Huygens probe was released on [2004-12-25] {prov:startedAtTime ^^xsd:date} and entered Titan's atmosphere on [2005-01-14T09:10:00Z] {prov:endedAtTime ^^xsd:dateTime}. The [Huygens probe] {+cassini:huygens ?prov:wasAssociatedWith} descended for 72 minutes through hydrocarbon haze, producing the [Titan atmosphere profile] {+cassini:titan-atmos-data .prov:Entity ?prov:generated label} — temperature, pressure, and wind measurements from 1,270 km altitude down to the surface, along with the first images of Titan's surface from inside the atmosphere.
1008
-
1009
- ### Extended Orbital Science {=cassini:orbital-science .prov:Activity ?prov:wasInformedBy label}
1010
-
1011
- The Cassini orbiter conducted [294] {cassini:titanFlybys ^^xsd:integer} Titan flybys and numerous close encounters with Enceladus, Iapetus, and Rhea from [2004-07-01] {prov:startedAtTime ^^xsd:date} through [2017-09-15] {prov:endedAtTime ^^xsd:date}. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} generated the [Enceladus plume dataset] {+cassini:enceladus-data .prov:Entity ?prov:generated label} during six dedicated low-altitude passes through the southern polar geysers.
1012
-
1013
- ## Key Findings
1014
-
1015
- Two results stood out above all others and are elevated here as the mission's golden graph — the facts everything else builds toward.
1016
-
1017
- ## Enceladus Hosts a Subsurface Ocean {=cassini:stmt-ocean .rdf:Statement .prov:Entity label}
1018
-
1019
- **The Enceladus plume dataset** {+cassini:enceladus-data ?rdf:subject} *confirmed* {+cassini:hasSubsurfaceOcean ?rdf:predicate} **a global liquid water ocean beneath its ice shell** {+cassini:enceladus-ocean ?rdf:object}.
1020
- Generated by: [Extended Orbital Science] {+cassini:orbital-science ?prov:wasGeneratedBy}
1021
- Derived from: [Saturn Orbit Insertion] {+cassini:soi ?prov:wasDerivedFrom}
1022
- Established: [2014-04-03T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
1023
-
1024
- ## Titan Has a Methane Hydrological Cycle {=cassini:stmt-methane .rdf:Statement .prov:Entity label}
1025
-
1026
- **The Titan atmosphere profile** {+cassini:titan-atmos-data ?rdf:subject} *revealed* {+cassini:hasMethaneHydrologicalCycle ?rdf:predicate} **a full methane rain-lake-evaporation cycle on Titan's surface** {+cassini:titan-methane-cycle ?rdf:object}.
1027
- Generated by: [Huygens Titan Descent] {+cassini:titan-descent ?prov:wasGeneratedBy}
1028
- Derived from: [Saturn Orbit Insertion] {+cassini:soi ?prov:wasDerivedFrom}
1029
- Established: [2005-01-14T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
1030
- `,research:`[research] <https://research.example.org/>
1031
- [data] <https://research.example.org/datasets/>
1032
-
1033
- # Medical Imaging AI Research {=research:paper .prov:Entity label}
1034
-
1035
- This paper explores how deep learning attention mechanisms can improve automated diagnosis from medical imaging data, covering the full arc from dataset assembly through model training to peer-reviewed publication.
1036
-
1037
- ## Authors {=research:authors .prov:Entity label}
1038
-
1039
- The work was led by **[Dr. Sarah Martinez](mailto:sarah.martinez@mit.edu)** {rdfs:label} {research:email} at MIT, who served as [Lead Researcher] {research:role} and was responsible for [methodology development] {research:contribution}. Joining her was **[Dr. James Liu](mailto:james.liu@mit.edu)** {=research:james-liu .prov:Person rdfs:label research:email}, the team's [ML Engineer] {research:role}, who took charge of [model implementation] {research:contribution}.
1040
-
1041
- ## Research Activity {=research:research-activity .prov:Activity label}
1042
-
1043
- The project ran from [2024-01-01] {prov:startedAtTime ^^xsd:date} through [2024-03-15] {prov:endedAtTime ^^xsd:date}, carried out by the [Research Team] {+research:authors ?prov:wasAssociatedWith} according to the [Medical AI Research Plan] {+research:plan .prov:Plan ?prov:hadPlan} they had drafted the previous autumn.
1044
-
1045
- ## Dataset Collection {=research:dataset-collection .prov:Activity label}
1046
-
1047
- Assembling a dataset of sufficient quality and scale was the first major challenge.
1048
-
1049
- ### Primary Dataset {=data:primary-dataset .research:Dataset .prov:Entity label}
1050
-
1051
- The team sourced [80,000] {data:trainCount ^^xsd:integer} DICOM training images from the [GitHub Medical Imaging Repository] {research:source}, setting aside [10,000] {data:valCount ^^xsd:integer} for validation and another [10,000] {data:testCount ^^xsd:integer} for final testing. The images span [15] {data:classCount ^^xsd:integer} anatomical structures. It was assembled during the [dataset collection phase] {+research:dataset-collection ?prov:wasGeneratedBy}.
1052
-
1053
- ### Augmented Dataset {=data:augmented-dataset .research:Dataset .prov:Entity label}
1054
-
1055
- Working from that [primary collection] {+data:primary-dataset ?prov:wasDerivedFrom}, the team produced a [512x512] {data:resolution} grayscale augmented set enriched with [patient metadata] {data:features}, covering [1,000] {data:patientCount ^^xsd:integer} individual patients to reduce demographic bias. This derived set was also [generated] {+research:dataset-collection ?prov:wasGeneratedBy} as part of the same collection activity.
1056
-
1057
- ## Model Development {=research:model-development .prov:Activity label}
1058
-
1059
- Training ran through February — from [2024-02-01] {prov:startedAtTime ^^xsd:date} to [2024-02-28] {prov:endedAtTime ^^xsd:date}. [Dr. James Liu] {+research:james-liu ?prov:wasAssociatedWith} drove the implementation, feeding the model both the [raw] {+data:primary-dataset ?prov:used} and [augmented] {+data:augmented-dataset ?prov:used} datasets. The process produced a [trained model artifact] {+research:trained-model ?prov:generated} ready for evaluation.
1060
-
1061
- ## Model Evaluation {=research:evaluation .prov:Activity label}
1062
-
1063
- Evaluation began on [2024-03-01] {prov:startedAtTime ^^xsd:date}. The [trained model] {+research:trained-model ?prov:used} was put through a comprehensive test suite that yielded the [evaluation results] {+research:eval-results ?prov:generated} reported below.
1064
-
1065
- ### Performance Metrics {=research:metrics .prov:Entity label}
1066
-
1067
- The results were strong across the board. Training accuracy reached [94.5%] {research:trainAcc ^^xsd:decimal}, with validation holding at [92.3%] {research:valAcc ^^xsd:decimal} and the held-out test set at [91.8%] {research:testAcc ^^xsd:decimal}. The F1 score came in at [0.89] {research:f1 ^^xsd:decimal} and AUC-ROC at [0.93] {research:auc ^^xsd:decimal}, both statistically significant at [p < 0.05] {research:significance} across a sample of [1,000] {research:sampleSize ^^xsd:integer} patients.
1068
-
1069
- ## Paper Reports Clinical Accuracy {=research:stmt-accuracy .rdf:Statement .prov:Entity label}
1070
-
1071
- **The research paper** {+research:paper ?rdf:subject} *reports* {+research:testAcc ?rdf:predicate} **91.8% test accuracy** {+research:metrics ?rdf:object}.
1072
- Derived from: [Evaluation Results] {+research:eval-results ?prov:wasDerivedFrom}
1073
- Generated by: [Model Evaluation] {+research:evaluation ?prov:wasGeneratedBy}
1074
- Established: [2024-03-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
1075
-
1076
- ## Paper Was NASA-Funded {=research:stmt-publication .rdf:Statement .prov:Entity label}
1077
- **The research paper** {+research:paper ?rdf:subject} *was funded by* {+prov:wasAttributedTo ?rdf:predicate} **NASA Space Medicine** {+research:nasa ?rdf:object}.
1078
- Generated by: [Publication Activity] {+research:publication ?prov:wasGeneratedBy}
1079
- Derived from: [Research Activity] {+research:research-activity ?prov:wasDerivedFrom}
1080
- Established: [2024-04-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
1081
-
1082
- ## SHACL Validation Shapes
1083
-
1084
- ### Paper Validation Shape {=research:PaperShape .sh:NodeShape label}
1085
-
1086
- To ensure the graph stays consistent, we defined a shape targeting every [Paper] {+research:Paper ?sh:targetClass} in the graph. Any paper must carry exactly [one title] {+#title ?sh:property sh:name}, at least [one author] {+#author ?sh:property sh:name}, and at least [one citation] {+#citation ?sh:property sh:name} — otherwise it isn't a complete scientific record.
1087
-
1088
- ### Paper must have exactly one title. {=#title .sh:PropertyShape sh:message}
1089
- The [rdfs:label] {+rdfs:label ?sh:path} property holds the title — exactly [1] {sh:minCount sh:maxCount ^^xsd:integer}.
1090
-
1091
- ## Paper must have at least one author. {=#author .sh:PropertyShape sh:message}
1092
- Every paper needs at least [1] {sh:minCount ^^xsd:integer} value on [author] {+research:author ?sh:path}.
1093
-
1094
- ## Paper must have at least one citation. {=#citation .sh:PropertyShape sh:message}
1095
- Same idea for citations: [citation] {+research:citation ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
1096
-
1097
- ### Test Data
1098
-
1099
- #### Valid Paper {=research:valid-paper .research:Paper label}
1100
- This is **[Medical Imaging AI Research] {rdfs:label}**, authored by [Dr. Sarah Martinez] {+research:sarah-martinez ?research:author} and carrying [15] {research:citation ^^xsd:integer} citations — it should pass all three constraints cleanly.
1101
-
1102
- #### Invalid Paper {=research:invalid-paper .research:Paper label}
1103
- This stub has a title of [Untitled] {rdfs:label} but no author and no citation value — [intentionally incomplete] {research:citation} to demonstrate what a violation looks like.
1104
-
1105
- ## Funding and Provenance
1106
-
1107
- ### Funding Entity {=research:funding .prov:Entity label}
1108
-
1109
- The work was made possible by grant [NRA-2024-12345] {research:grantNumber}, a [$500,000] {research:amount ^^xsd:decimal} award from [NASA Space Medicine] {+research:nasa ?prov:wasAttributedTo .prov:Organization} running from [2024 to 2026] {research:period}.
1110
-
1111
- ### Publication Activity {=research:publication .prov:Activity label}
1112
-
1113
- On [2024-04-15] {prov:startedAtTime ^^xsd:date} the team submitted [Medical Imaging AI Research] {+research:paper ?prov:used} and it was accepted by [Medical Journal] {+research:journal ?prov:wasGeneratedBy}. The funding, the data, the model, and the results all now have a complete provenance trail traceable through this document.
1114
- `,index:`# MD-LD Demo Examples
1115
-
1116
- Quick start examples demonstrating core MD-LD patterns and features.
1117
-
1118
- ## Demo Examples
1119
-
1120
- ### 🎯 Getting Started
1121
-
1122
- **[minimal.md](./minimal.md)** Minimal document with subject and author
1123
- **[journal.md](./journal.md)** Personal journal with activities, reflections, and related events
1124
-
1125
- ### 🍳 Everyday Examples
1126
-
1127
- **[recipe.md](./recipe.md)** Complete recipe with ingredients, equipment, and nutritional information
1128
- **[project.md](./project.md)** Weekend project with tasks, resources, team, and blocking issues
1129
-
1130
- ### 🚀 Advanced Examples
1131
-
1132
- **[space-mission.md](./space-mission.md)** Apollo 11 mission with crew, equipment, and objectives
1133
- **[research.md](./research.md)** Scientific paper with datasets, methodology, and organizations
1134
-
1135
- ## Key Features Demonstrated
1136
-
1137
- ✅ **Explicit Annotations** All semantic data comes from \`{...}\` blocks
1138
- ✅ **Subject Chaining** Using \`{=IRI}\` and \`{+IRI}\` for context
1139
- ✅ **List Items** Explicit annotations per list item (no semantic propagation)
1140
- ✅ **Nested Structures** Hierarchical data organization
1141
- ✅ **PROV-O Integration** Complete provenance tracking
1142
- ✅ **Fragment Subjects** Document structuring with \`{=#fragment}\`
1143
- ✅ **Reverse Relations** Using \`!p\` for inverse relationships
1144
- ✅ **Datatypes & Languages** \`^^xsd:types\` and \`@lang\` tags
1145
-
1146
- ---
1147
-
1148
- *Each demo is a complete, working MD-LD document that can be parsed and round-tripped safely.*
1149
- `};function hs(e){return ms[e]||null}var gs=window;function _s(e,t,n={}){let r={tab:` `,indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:gs,autoclose:{open:`([{'"`,close:`)]}'"`},...n},i=r.window,a=i.document,o=[],s=[],c=-1,l=!1,u=()=>void 0,d;e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(`spellcheck`,r.spellcheck?`true`:`false`),e.style.outline=`none`,e.style.overflowWrap=`break-word`,e.style.overflowY=`auto`,e.style.whiteSpace=`pre-wrap`;let f=(e,n)=>{t(e,n)},p=i.navigator.userAgent.match(/Firefox\/([0-9]+)\./),m=p?parseInt(p[1]):0,h=!1;(e.contentEditable!==`plaintext-only`||m>=136)&&(h=!0),h&&e.setAttribute(`contenteditable`,`true`);let g=L(()=>{let t=x();f(e,t),S(t)},30),_=!1,v=e=>!te(e)&&!F(e)&&e.key!==`Meta`&&e.key!==`Control`&&e.key!==`Alt`&&!e.key.startsWith(`Arrow`),y=L(e=>{v(e)&&(A(),_=!1)},300),b=(t,n)=>{o.push([t,n]),e.addEventListener(t,n)};b(`keydown`,e=>{e.defaultPrevented||(d=ie(),r.preserveIdent?E(e):D(e),r.catchTab&&O(e),r.addClosing&&ee(e),r.history&&(k(e),v(e)&&!_&&(A(),_=!0)),h&&!I(e)&&S(x()))}),b(`keyup`,e=>{e.defaultPrevented||e.isComposing||(d!==ie()&&g(),y(e),u(ie()))}),b(`focus`,e=>{l=!0}),b(`blur`,e=>{l=!1}),b(`paste`,e=>{A(),j(e),A(),u(ie())}),b(`cut`,e=>{A(),M(e),A(),u(ie())});function x(){let t=ae(),n={start:0,end:0,dir:void 0},{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=t;if(!r||!o)throw`error1`;if(r===e&&o===e)return n.start=i>0&&e.textContent?e.textContent.length:0,n.end=s>0&&e.textContent?e.textContent.length:0,n.dir=s>=i?`->`:`<-`,n;if(r.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);r.insertBefore(e,r.childNodes[i]),r=e,i=0}if(o.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);o.insertBefore(e,o.childNodes[s]),o=e,s=0}return N(e,e=>{if(e===r&&e===o)return n.start+=i,n.end+=s,n.dir=i<=s?`->`:`<-`,`stop`;if(e===r)if(n.start+=i,!n.dir)n.dir=`->`;else return`stop`;else if(e===o)if(n.end+=s,!n.dir)n.dir=`<-`;else return`stop`;e.nodeType===Node.TEXT_NODE&&(n.dir!=`->`&&(n.start+=e.nodeValue.length),n.dir!=`<-`&&(n.end+=e.nodeValue.length))}),e.normalize(),n}function S(t){let n=ae(),r,i=0,o,s=0;if(t.dir||=`->`,t.start<0&&(t.start=0),t.end<0&&(t.end=0),t.dir==`<-`){let{start:e,end:n}=t;t.start=n,t.end=e}let c=0;N(e,e=>{if(e.nodeType!==Node.TEXT_NODE)return;let n=(e.nodeValue||``).length;if(c+n>t.start&&(r||(r=e,i=t.start-c),c+n>t.end))return o=e,s=t.end-c,`stop`;c+=n}),r||(r=e,i=e.childNodes.length),o||(o=e,s=e.childNodes.length),t.dir==`<-`&&([r,i,o,s]=[o,s,r,i]);{let e=C(r);if(e){let t=a.createTextNode(``);e.parentNode?.insertBefore(t,e),r=t,i=0}let t=C(o);if(t){let e=a.createTextNode(``);t.parentNode?.insertBefore(e,t),o=e,s=0}}n.setBaseAndExtent(r,i,o,s),e.normalize()}function C(t){for(;t&&t!==e;){if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(e.getAttribute(`contenteditable`)==`false`)return e}t=t.parentNode}}function w(){let t=ae().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),n.toString()}function T(){let t=ae().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setStart(t.endContainer,t.endOffset),n.toString()}function E(e){if(e.key===`Enter`){let t=w(),n=T(),[i]=R(t),a=i;if(r.indentOn.test(t)&&(a+=r.tab),a.length>0?(z(e),e.stopPropagation(),re(`
1150
- `+a)):D(e),a!==i&&r.moveToNewLine.test(n)){let e=x();re(`
1151
- `+i),S(e)}}}function D(e){if(h&&e.key===`Enter`)if(z(e),e.stopPropagation(),T()==``){re(`
1152
- `);let e=x();e.start=--e.end,S(e)}else re(`
1153
- `)}function ee(e){let t=r.autoclose.open,n=r.autoclose.close;if(t.includes(e.key)){z(e);let r=x(),i=r.start==r.end?``:ae().toString();re(e.key+i+(n[t.indexOf(e.key)]??``)),r.start++,r.end++,S(r)}}function O(e){if(e.key===`Tab`)if(z(e),e.shiftKey){let[e,t]=R(w());if(e.length>0){let n=x(),i=Math.min(r.tab.length,e.length);S({start:t,end:t+i}),a.execCommand(`delete`),n.start-=i,n.end-=i,S(n)}}else re(r.tab)}function k(t){if(te(t)){z(t),c--;let n=s[c];n&&(e.innerHTML=n.html,S(n.pos)),c<0&&(c=0)}if(F(t)){z(t),c++;let n=s[c];n&&(e.innerHTML=n.html,S(n.pos)),c>=s.length&&c--}}function A(){if(!l)return;let t=e.innerHTML,n=x(),r=s[c];r&&r.html===t&&r.pos.start===n.start&&r.pos.end===n.end||(c++,s[c]={html:t,pos:n},s.splice(c+1),c>300&&(c=300,s.splice(0,1)))}function j(t){if(t.defaultPrevented)return;z(t);let n=(t.originalEvent??t).clipboardData.getData(`text/plain`).replace(/\r\n?/g,`
1154
- `),r=x();re(n),f(e),S({start:Math.min(r.start,r.end)+n.length,end:Math.min(r.start,r.end)+n.length,dir:`<-`})}function M(t){let n=x(),r=ae();(t.originalEvent??t).clipboardData.setData(`text/plain`,r.toString()),a.execCommand(`delete`),f(e),S({start:Math.min(n.start,n.end),end:Math.min(n.start,n.end),dir:`<-`}),z(t)}function N(e,t){let n=[];e.firstChild&&n.push(e.firstChild);let r=n.pop();for(;r&&t(r)!==`stop`;)r.nextSibling&&n.push(r.nextSibling),r.firstChild&&n.push(r.firstChild),r=n.pop()}function P(e){return e.metaKey||e.ctrlKey}function te(e){return P(e)&&!e.shiftKey&&ne(e)===`Z`}function F(e){return P(e)&&e.shiftKey&&ne(e)===`Z`}function I(e){return P(e)&&ne(e)===`C`}function ne(e){let t=e.key||e.keyCode||e.which;if(t)return(typeof t==`string`?t:String.fromCharCode(t)).toUpperCase()}function re(e){e=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`),a.execCommand(`insertHTML`,!1,e)}function L(e,t){let n=0;return(...r)=>{clearTimeout(n),n=i.setTimeout(()=>e(...r),t)}}function R(e){let t=e.length-1;for(;t>=0&&e[t]!==`
1155
- `;)t--;t++;let n=t;for(;n<e.length&&/[ \t]/.test(e[n]);)n++;return[e.substring(t,n)||``,t,n]}function ie(){return e.textContent||``}function z(e){e.preventDefault()}function ae(){return e.getRootNode().getSelection()}return{updateOptions(e){Object.assign(r,e)},updateCode(t,n=!0){e.textContent=t,f(e),n&&u(t)},onUpdate(e){u=e},toString:ie,save:x,restore:S,recordHistory:A,destroy(){for(let[t,n]of o)e.removeEventListener(t,n)}}}var vs=[[`#534AB7`,`#AFA9EC`],[`#0F6E56`,`#5DCAA5`],[`#993C1D`,`#F0997B`],[`#993556`,`#ED93B1`],[`#185FA5`,`#85B7EB`],[`#3B6D11`,`#97C459`],[`#854F0B`,`#EF9F27`],[`#A32D2D`,`#F09595`]],ys=`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,bs=`http://www.w3.org/2000/01/rdf-schema#label`,xs=`http://www.w3.org/2000/svg`;function Ss(e,t){if(!e||typeof e!=`string`)return e;if(t){for(let[n,r]of Object.entries(t))if(e.startsWith(r))return n+`:`+e.slice(r.length)}let n=e.match(/[#\/:]([^#\/:]+)$/);return n?n[1]:e}function Cs(e){let t=5381;for(let n=0;n<e.length;n++)t=(t*33^e.charCodeAt(n))>>>0;return t}var ws=class extends HTMLElement{static get observedAttributes(){return[`height`,`charge`,`link-dist`]}constructor(){super(),this._quads=[],this._ctx={},this._nodes=[],this._links=[],this._sim=null,this._raf=null,this._alpha=0,this._sleeping=!1,this._drag=null,this._grid=new Map,this._gridKeyBuffer=``,this._chargeCache=-120,this._linkDistCache=180,this._transformBuffer=``,this._colorBuffer=``,this._gridArrays=new Map}connectedCallback(){this._build()}attributeChangedCallback(){this._svg&&this._restart()}set quads(e){this._quads=e||[],this._build()}set context(e){this._ctx=e||{},this._build()}_build(){let e=new Map,t=new Map,n=new Map,r=new Map,i=new Map,a=[];for(let o of this._quads){if(!o||o.termType!==`Quad`)continue;let s=o.subject.value,c=o.predicate.value,l=o.object;if(e.has(s)||e.set(s,{id:s,size:10,r:10}),c===bs&&l.termType===`Literal`&&r.set(s,l.value),i.has(c)||i.set(c,null),c===ys&&l.termType===`NamedNode`)t.set(s,l.value),e.has(l.value)||e.set(l.value,{id:l.value,size:8,r:8}),a.push({source:s,target:l.value,iri:c});else if(l.termType===`NamedNode`)e.has(l.value)||e.set(l.value,{id:l.value,size:8,r:8}),a.push({source:s,target:l.value,iri:c});else if(l.termType===`Literal`){let e=n.get(s)||0;n.set(s,e+1)}}for(let e of this._quads){if(!e||e.termType!==`Quad`)continue;let t=e.subject.value,n=e.predicate.value,r=e.object;n===bs&&r.termType===`Literal`&&i.has(t)&&i.set(t,r.value)}for(let[t,r]of n){let n=e.get(t);n&&(n.size=Math.min(10+r*3,26))}let o=new Map,s=0;for(let[,e]of t)o.has(e)||o.set(e,vs[s++%vs.length]);for(let[n,r]of e){let e=t.get(n);r.color=e?o.get(e):vs[7],r.r=r.size}for(let e of a)e.label=i.get(e.iri)||Ss(e.iri,this._ctx);this._types=t,this._nodes=[...e.values()],this._links=a,this._typeColors=o,this._nodeLabels=r,this._renderSvg(),this._initSim()}_renderSvg(){this.innerHTML=``;let e=parseInt(this.getAttribute(`height`)||`480`),t=document.createElement(`div`);t.className=`rdf-wrap`,t.style.height=e+`px`;let n=document.createElement(`div`);n.className=`rdf-hud`,this._statEl=document.createElement(`span`),this._statEl.textContent=this._nodes.length+`n · `+this._links.length+`e`;let r=document.createElement(`div`);r.className=`rdf-energy`,this._ebar=document.createElement(`div`),this._ebar.className=`rdf-ebar`,this._ebar.style.width=`100%`,r.appendChild(this._ebar),n.appendChild(this._statEl),n.appendChild(r),t.appendChild(n);let i=document.createElementNS(xs,`svg`);i.setAttribute(`width`,`100%`),i.setAttribute(`height`,`100%`);let a=document.createElementNS(xs,`defs`),o=new Set([...this._typeColors.values()].map(e=>e[0]));o.add(`#888`);for(let e of o){let t=document.createElementNS(xs,`marker`),n=`arr`+Cs(e);t.setAttribute(`id`,n),t.setAttribute(`viewBox`,`0 0 10 10`),t.setAttribute(`refX`,`9`),t.setAttribute(`refY`,`5`),t.setAttribute(`markerWidth`,`5`),t.setAttribute(`markerHeight`,`5`),t.setAttribute(`orient`,`auto-start-reverse`);let r=document.createElementNS(xs,`path`);r.setAttribute(`d`,`M2 1L8 5L2 9`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`gray`),r.setAttribute(`stroke-width`,`1.5`),r.setAttribute(`stroke-linecap`,`round`),t.appendChild(r),a.appendChild(t)}i.appendChild(a),this._gLinks=document.createElementNS(xs,`g`),this._gLinkLabels=document.createElementNS(xs,`g`),this._gNodes=document.createElementNS(xs,`g`),this._linkEls=this._links.map(e=>{let t=document.createElementNS(xs,`line`),n=this._nodeById(e.source),r=`arr`+Cs(n&&n.color?n.color[0]:`#888`);if(t.setAttribute(`stroke`,$e(e?.iri||``)),t.setAttribute(`stroke-width`,`0.8`),t.setAttribute(`stroke-opacity`,`0.55`),t.setAttribute(`marker-end`,`url(#`+r+`)`),this._gLinks.appendChild(t),e.label){let t=document.createElementNS(xs,`text`);t.setAttribute(`font-size`,`8`),t.setAttribute(`fill`,$e(e?.iri||``)),t.setAttribute(`text-anchor`,`middle`),t.setAttribute(`dominant-baseline`,`central`),t.setAttribute(`pointer-events`,`none`),t.setAttribute(`opacity`,`0.7`),t.textContent=e.label,this._gLinkLabels.appendChild(t),e._labelEl=t}return e._el=t,t}),this._nodeElMap=new Map;for(let e of this._nodes){let t=$e(e?.id),n=$e(this._types.get(e?.id)||e?.id),r=document.createElementNS(xs,`g`);r.style.cursor=`grab`;let i=document.createElementNS(xs,`circle`);i.setAttribute(`r`,e.r),i.setAttribute(`fill`,t),i.setAttribute(`stroke`,n),i.setAttribute(`stroke-width`,`2`),i.setAttribute(`fill-opacity`,`0.85`);let a=document.createElementNS(xs,`text`);a.setAttribute(`font-size`,`8`),a.setAttribute(`font-weight`,`bold`),a.setAttribute(`fill`,$e(e?.id)),a.setAttribute(`text-anchor`,`middle`),a.setAttribute(`dominant-baseline`,`central`),a.setAttribute(`dy`,-e.r-10),a.setAttribute(`pointer-events`,`none`),a.setAttribute(`opacity`,`0.75`),a.textContent=this._nodeLabels.get(e.id)||Ss(e.id,this._ctx),r.appendChild(i),r.appendChild(a),this._gNodes.appendChild(r),this._nodeElMap.set(e.id,r),e._el=r,e._c=i,r.addEventListener(`pointerdown`,t=>this._dragStart(t,e))}i.appendChild(this._gLinks),i.appendChild(this._gLinkLabels),i.appendChild(this._gNodes),i.addEventListener(`pointermove`,e=>this._dragMove(e)),i.addEventListener(`pointerup`,e=>this._dragEnd(e)),i.addEventListener(`pointerleave`,e=>this._dragEnd(e)),t.appendChild(i),this.appendChild(t),this._svg=i,this._wrap=t}_nodeById(e){return this._nodes.find(t=>t.id===e)}_initSim(){let e=this._wrap.clientWidth||600,t=this._wrap.clientHeight||480;for(let n of this._nodes)n.x??(n.x=e/2+(Math.random()-.5)*200,n.y=t/2+(Math.random()-.5)*200),n.vx=n.vx||0,n.vy=n.vy||0,n.mass=Math.max(1,n.size/8);this._W=e,this._H=t,this._alpha=1,this._sleeping=!1,this._wake()}_restart(){this._alpha=Math.max(this._alpha,.8),this._sleeping=!1,this._wake()}_wake(){this._raf||=requestAnimationFrame(()=>{this._raf=null,this._tick()})}_tick(){if(this._sleeping){this._raf=null;return}let e=this._chargeCache===parseFloat(this.getAttribute(`charge`)||-120)?this._chargeCache:this._chargeCache=parseFloat(this.getAttribute(`charge`)||-120),t=this._linkDistCache===parseFloat(this.getAttribute(`link-dist`)||180)?this._linkDistCache:this._linkDistCache=parseFloat(this.getAttribute(`link-dist`)||180),n=this._nodes,r=this._links,i=this._W,a=this._H,o=this._alpha;for(let e of n)e.fx=0,e.fy=0;let s=Math.max(50,Math.sqrt(i*a/n.length)),c=this._grid;for(let[e,t]of c)t.length===0&&c.delete(e);let l=1/s;for(let e of n){let t=e.x*l|0,n=e.y*l|0;this._gridKeyBuffer=t+`,`+n;let r=c.get(this._gridKeyBuffer);r||(r=this._gridArrays.get(this._gridKeyBuffer),r||(r=[],this._gridArrays.set(this._gridKeyBuffer,r)),c.set(this._gridKeyBuffer,r)),r.length=0,r.push(e)}for(let t of n){let n=t.x*l|0,r=t.y*l|0;for(let i=-1;i<=1;i++)for(let a=-1;a<=1;a++){this._gridKeyBuffer=n+i+`,`+(r+a);let l=c.get(this._gridKeyBuffer);if(l)for(let n of l){if(t===n)continue;let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i||1,c=Math.sqrt(a);if(c>s*2){let n=e*o/(a*l.length);t.fx-=r/c*n/t.mass,t.fy-=i/c*n/t.mass}else{let n=e*o/a;t.fx-=r/c*n/t.mass,t.fy-=i/c*n/t.mass}}}}for(let e of r){let n=typeof e.source==`object`?e.source:this._nodeById(e.source),r=typeof e.target==`object`?e.target:this._nodeById(e.target);if(!n||!r)continue;e.source=n,e.target=r;let i=r.x-n.x,a=r.y-n.y,s=Math.sqrt(i*i+a*a)||1,c=(s-t)*.02*o,l=i/s,u=a/s;n.fx+=l*c/n.mass,n.fy+=u*c/n.mass,r.fx-=l*c/r.mass,r.fy-=u*c/r.mass}let u=0,d=0;for(let e of n)u+=e.x,d+=e.y;u/=n.length||1,d/=n.length||1;let f=i/2-u,p=a/2-d;for(let e of n)e.fx+=f*.008*o,e.fy+=p*.008*o;let m=0;for(let e of n){if(e._pinned){e.vx=0,e.vy=0,e.fx=0,e.fy=0;continue}e.vx=(e.vx+e.fx)*.85,e.vy=(e.vy+e.fy)*.85;let t=Math.sqrt(e.vx*e.vx+e.vy*e.vy);t>8&&(e.vx=e.vx/t*8,e.vy=e.vy/t*8),e.x+=e.vx,e.y+=e.vy,e.x=Math.max(e.r+5,Math.min(i-e.r-5,e.x)),e.y=Math.max(e.r+5,Math.min(a-e.r-5,e.y)),m+=e.vx*e.vx+e.vy*e.vy}this._alpha*=.985;let h=Math.min(1,Math.sqrt(m/Math.max(n.length,1))/3),g=Math.round(h*100);if(h>.3?this._colorBuffer=`#1D9E75`:h>.08?this._colorBuffer=`#BA7517`:this._colorBuffer=`#888780`,this._ebar.style.width=g+`%`,this._ebar.style.background=this._colorBuffer,this._draw(),this._alpha<.002&&!this._drag){this._sleeping=!0,this._ebar.style.width=`0%`,this._raf=null;return}this._raf=requestAnimationFrame(()=>{this._raf=null,this._tick()})}_draw(){for(let e of this._links){let t=e.source,n=e.target;if(!t||!n||typeof t!=`object`)continue;let r=n.x-t.x,i=n.y-t.y,a=Math.sqrt(r*r+i*i)||1,o=r/a,s=i/a,c=t.x+o*(t.r+1),l=t.y+s*(t.r+1),u=n.x-o*(n.r+6),d=n.y-s*(n.r+6),f=e._el;f.setAttribute(`x1`,c),f.setAttribute(`y1`,l),f.setAttribute(`x2`,u),f.setAttribute(`y2`,d),e._labelEl&&(e._labelEl.setAttribute(`x`,(c+u)*.5),e._labelEl.setAttribute(`y`,(l+d)*.5-4))}for(let e of this._nodes)e._el&&(this._transformBuffer=`translate(`+e.x+`,`+e.y+`)`,e._el.setAttribute(`transform`,this._transformBuffer))}_dragStart(e,t){e.preventDefault(),this._drag={node:t,id:e.pointerId,startX:e.clientX,startY:e.clientY,moved:!1},this._svg.setPointerCapture(e.pointerId),t._pinned=!0,t._el.style.cursor=`grabbing`,this._sleeping=!1,this._alpha=Math.max(this._alpha,.5),this._wake()}_dragMove(e){if(!this._drag||e.pointerId!==this._drag.id)return;let t=this._svg.getBoundingClientRect(),n=this._svg.viewBox?.baseVal?.width||this._W,r=this._svg.viewBox?.baseVal?.height||this._H,i=(n||this._W)/t.width,a=(r||this._H)/t.height,o=this._drag.node;o.x=(e.clientX-t.left)*i,o.y=(e.clientY-t.top)*a,o.vx=0,o.vy=0;let s=e.clientX-this._drag.startX,c=e.clientY-this._drag.startY;(Math.abs(s)>3||Math.abs(c)>3)&&(this._drag.moved=!0),this._sleeping&&(this._sleeping=!1,this._alpha=.3,this._wake())}_dragEnd(e){if(!this._drag)return;let t=this._drag.node,n=this._drag.moved;t._pinned=!1,t._el.style.cursor=`grab`,t.vx=(Math.random()-.5)*.5,t.vy=(Math.random()-.5)*.5,this._alpha=Math.max(this._alpha,.25),this._drag=null,n||this.dispatchEvent(new CustomEvent(`node-click`,{detail:t.id,bubbles:!0})),this._wake()}};window&&customElements.define(`rdf-graph`,ws);var Ts=[],Es=null,Ds=e=>{e.innerHTML=rt(Es.toString())};document.addEventListener(`DOMContentLoaded`,function(){let e=document.getElementById(`rendered-section`);e&&(e.style.display=`none`)}),window.loadExample=function(e){let t=hs(e);t&&Es?(Es.updateCode(t),parseMDLD()):console.warn(Es?`Example not found: ${e}`:`CodeJar editor not initialized`)};var Os=null;function ks(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.map(e=>`${e.subject.value}|${e.predicate.value}|${e.object.termType}|${e.object.value}|${e.object.language||``}|${e.object.datatype?.value||``}`).sort().join(`
1156
- `)===t.map(e=>`${e.subject.value}|${e.predicate.value}|${e.object.termType}|${e.object.value}|${e.object.language||``}|${e.object.datatype?.value||``}`).sort().join(`
1157
- `)}window.parseMDLD=function(){let e=Es?Es.toString():``,t=document.getElementById(`output`);document.getElementById(`rendered-output`);let n=document.getElementById(`parse-stats`);if(!e.trim()){t.textContent=`Quads will appear here...`,n.textContent=``;let e=document.getElementById(`primary-subject`);e&&(e.textContent=`No primary subject found...`,e.style.color=`var(--text-secondary, #6b7280)`);let r=document.getElementById(`statements-graph`),i=document.getElementById(`statements-stats`);r&&(r.quads=[],r.context={}),i&&(i.textContent=``);return}try{let t=performance.now(),r=H({text:e}),i=Math.round(performance.now()-t),{quads:a,context:o,primarySubject:s}=r;delete o[`@vocab`];let c=!ks(a,Os);Os=a;let l=new Sn({format:`Turtle`,prefixes:o}),u=new ir;u.addQuads(a),l.addQuads(u.getQuads()),l.end((e,t)=>{let n=document.getElementById(`ttl`);e?(n.textContent=`Error: `+e,zs=``):(n.textContent=t||`No TTL output generated`,zs=t||``)});try{let{text:e}=We({quads:a,context:o,primarySubject:s}),t=document.getElementById(`mdld`);t&&(t.textContent=e||`No MDLD output generated`,Bs=e||``)}catch(e){console.error(`Error generating MDLD:`,e);let t=document.getElementById(`mdld`);t&&(t.textContent=`Error generating MDLD: `+e.message,Bs=``)}if(c){let e=document.getElementById(`rdf-graph`);e&&(e.quads=a,e.context=o)}let d=document.getElementById(`primary-subject`);s?(d.textContent=s,d.style.color=$e(s)):(d.textContent=`No primary subject found in this document`,d.style.color=`var(--text-secondary, #6b7280)`);let f=document.getElementById(`statements-graph`),p=document.getElementById(`statements-stats`);f&&r.statements&&r.statements.length>0?(f.quads=r.statements,f.context=o,p.textContent=`${r.statements.length} elevated statements`):f&&(f.quads=[],f.context=o,p.textContent=`No elevated statements`),n.textContent=`${r.quads.length} quads • ${i}ms${c?``:` (no change)`}`}catch(e){t.textContent=`Error: ${e.message}`,n.textContent=``}},window.parseTTL=async function(e){let t=e.target.files[0];if(t){try{let e=await t.text(),n=new nn,r=await new Promise((t,r)=>{let i=[];n.parse(e,(e,n)=>{if(e){r(e);return}n?i.push(n):t(i)})}),i=As(e),a=We({quads:r,context:i}),o=a.text||a;Es&&Es.updateCode(o),parseMDLD(),console.log(`Successfully imported ${r.length} quads from TTL file with ${Object.keys(i).length} prefixes`)}catch(e){console.error(`Error parsing TTL file:`,e),alert(`Error parsing TTL file: ${e.message}`)}e.target.value=``}};function As(e){let t={},n=/@prefix\s+(\w+):\s*<([^>]+)>\s*\./gi,r;for(;(r=n.exec(e))!==null;){let e=r[1];t[e]=r[2]}return t}document.addEventListener(`DOMContentLoaded`,()=>{document.getElementById(`import-ttl-btn`).querySelector(`input[type="file"]`).addEventListener(`change`,window.parseTTL)});function js(e){let t=`"${e.value.replace(/"/g,`\\"`)}"`;return e.language?t+=`@${e.language}`:e.datatype&&e.datatype.value&&e.datatype.value!==`http://www.w3.org/2001/XMLSchema#string`&&(t+=`^^<${e.datatype.value}>`),t}window.clearPlayground=function(){Es&&Es.updateCode(``),document.getElementById(`output`).textContent=`Quads will appear here...`,document.getElementById(`parse-stats`).textContent=``,zs=``;let e=document.getElementById(`ttl`);e&&(e.textContent=`TTL loading...`);let t=document.getElementById(`rdf-graph`);t&&(t.quads=[],t.context={}),Os=null},window.runAllTests=async function(){Ts=[];let e=document.getElementById(`test-progress`),t=document.getElementById(`test-progress-bar`),n=document.getElementById(`test-stats`),r=document.getElementById(`test-list`),i=document.getElementById(`test-status`);e.style.display=`block`,n.style.display=`grid`,r.innerHTML=``,i.textContent=`Running tests...`;let a=0,o=0,s=0;for(let e=0;e<gt.length;e++){let n=gt[e],r=performance.now();try{let e=n.fn(),t=Math.round(performance.now()-r);s+=t,Ts.push({name:n.name,status:`passed`,duration:t,result:e}),a++,Ms(n.name,`passed`,t,e)}catch(e){let t=Math.round(performance.now()-r);s+=t,Ts.push({name:n.name,status:`failed`,duration:t,error:e.message}),o++,Ms(n.name,`failed`,t,null,e.message)}let i=(e+1)/gt.length*100;t.style.width=`${i}%`,document.getElementById(`passed-count`).textContent=a,document.getElementById(`failed-count`).textContent=o,document.getElementById(`total-count`).textContent=gt.length,await new Promise(e=>setTimeout(e,5))}document.getElementById(`duration`).textContent=`${Math.round(s)}ms`,setTimeout(()=>{e.style.display=`none`,i.textContent=`Completed: ${a} passed, ${o} failed`},500)};function Ms(e,t,n,r,i=null){let a=document.getElementById(`test-list`),o=document.createElement(`div`),s=``;t===`passed`?s=`passed`:t===`failed`&&(s=`failed`),o.className=`test-item ${s}`,o.innerHTML=`
1158
- <div class="flex items-center gap-2 mb-2">
1159
- <span class="text-base">${t===`passed`?`✅`:`❌`}</span>
1160
- <span class="flex-1 font-medium text-sm">${e}</span>
1161
- <span class="text-xs text-gray-600 dark:text-gray-400">${n}ms</span>
1162
- </div>
1163
- <div class="mt-2 pt-2 border-t border-gray-600 dark:border-gray-400 hidden" id="details-${e.replace(/\s+/g,`-`)}">
1164
- ${r?`
1165
- <div class="output small">${r.input}</div>
1166
- <div class="output small">${(r.output.quads||[]).map(e=>`${e.subject.value} -> ${e.predicate.value} -> ${e.object.termType===`Literal`?js(e.object):`<${e.object.value}>`}`).join(`
1167
- `)}</div>
1168
- `:``}
1169
- ${i?`<div class="text-red-600 dark:text-red-400 font-mono text-xs">${i}</div>`:``}
1170
- </div>
1171
- `,o.addEventListener(`click`,()=>{o.querySelector(`#details-${e.replace(/\s+/g,`-`)}`).classList.toggle(`hidden`)}),a.appendChild(o)}window.clearTests=function(){Ts=[],document.getElementById(`test-list`).innerHTML=`<p class="text-center text-gray-600 dark:text-gray-400 p-4">Click "Run Tests" to see results</p>`,document.getElementById(`test-stats`).classList.add(`hidden`),document.getElementById(`test-progress`).classList.add(`hidden`),document.getElementById(`test-status`).textContent=``};var Ns=()=>{Es&&Es.onUpdate(e=>{clearTimeout(window.parseTimeout),window.parseTimeout=setTimeout(parseMDLD,300)})};window.addEventListener(`load`,()=>{let e=document.getElementById(`editor`);e&&(Es=new _s(e,Ds,{tab:` `,indentOn:/[(\[{]$/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0}),Es.updateCode(``),Ns()),loadExample(`recipe`),setTimeout(()=>{runAllTests(),setTimeout(()=>Rs(),100)},500)}),window.addEventListener(`hashchange`,Ls);var Ps=new ps({html:!0,linkify:!0,typographer:!0,breaks:!0});async function Fs(e){let t=document.getElementById(`spec-content`),n=document.getElementById(`spec-status`);n.textContent=`Loading ${e}...`,t.innerHTML=`<p class="text-center text-gray-600 dark:text-gray-400 p-8">Loading markdown...</p>`;try{let r=await fetch(e);if(!r.ok)throw Error(`Failed to fetch ${e}: ${r.status}`);let i=await r.text();requestIdleCallback(()=>{Is(i,e,t,n)},{timeout:100})}catch(r){n.textContent=`Error loading ${e}`,t.innerHTML=`<p class="text-center text-red-600 dark:text-red-400 p-8">Error: ${r.message}</p>`}}function Is(e,t,n,r){try{n.innerHTML=`
1172
- <style>
1173
- #spec-content h1 { color: var(--error, #dc2626); border-bottom: 2px solid var(--border-primary, #d1d5db); padding-bottom: 0.5rem; margin: 1.5rem 0 1rem 0; }
1174
- #spec-content h2 { color: var(--text-primary, #111827); border-bottom: 1px solid var(--border-primary, #d1d5db); padding-bottom: 0.25rem; margin: 1.25rem 0 0.75rem 0; }
1175
- #spec-content h3 { color: var(--text-primary, #111827); margin: 1rem 0 0.5rem 0; }
1176
- #spec-content h4 { color: var(--text-secondary, #6b7280); margin: 0.75rem 0 0.25rem 0; }
1177
- #spec-content p { margin-bottom: 0.75rem; }
1178
- #spec-content ul, #spec-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
1179
- #spec-content li { margin-bottom: 0.25rem; }
1180
- #spec-content code { background: var(--bg-tertiary, #f3f4f6); padding: 0.125rem 0.25rem; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-size: 0.875em; }
1181
- #spec-content pre { background: var(--bg-tertiary, #f3f4f6); padding: 0.75rem; border-radius: 4px; overflow-x: auto; margin: 0.75rem 0; }
1182
- #spec-content pre code { background: none; padding: 0; }
1183
- #spec-content blockquote { border-left: 3px solid var(--error, #dc2626); padding-left: 1rem; margin: 0.75rem 0; color: var(--text-secondary, #6b7280); font-style: italic; }
1184
- #spec-content a { color: var(--error, #dc2626); text-decoration: none; }
1185
- #spec-content a:hover { text-decoration: underline; }
1186
- #spec-content table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; }
1187
- #spec-content th, #spec-content td { border: 1px solid var(--border-primary, #d1d5db); padding: 0.5rem; text-align: left; }
1188
- #spec-content th { background: var(--bg-tertiary, #f3f4f6); color: var(--text-primary, #111827); font-weight: 600; }
1189
- #spec-content hr { border: none; border-top: 1px solid var(--border-primary, #d1d5db); margin: 1.5rem 0; }
1190
- </style>
1191
- ${Ps.render(e)}
1192
- `,requestIdleCallback(()=>{n.querySelectorAll(`a[href$=".md"]`).forEach(e=>{e.addEventListener(`click`,t=>{t.preventDefault();let n=e.getAttribute(`href`),r=decodeURIComponent(window.location.hash.slice(1))||`./README.md`,i;i=n.startsWith(`./`)?r.substring(0,r.lastIndexOf(`/`)+1)+n.slice(2):n.startsWith(`/`)?`.`+n:r.substring(0,r.lastIndexOf(`/`)+1)+n,window.location.hash=`#`+i})})},{timeout:50}),r.textContent=`Loaded ${t}`}catch(e){console.error(`Error loading markdown:`,e),n.innerHTML=`<p style="text-align: center; color: var(--color-error); padding: 2rem;">Error loading ${t}: ${e.message}</p>`,r.textContent=`Error loading ${t}`}}function Ls(){let e=window.location.hash.slice(1);if(e===`test`){let e=document.getElementById(`tests`);if(e){e.scrollIntoView({behavior:`smooth`});let t=document.getElementById(`test-list`);t&&t.innerHTML.includes(`Tests will run automatically`)&&runAllTests()}return}if(e===`index.md`||e===`README.md`){Fs(`./README.md`);return}if(e)try{let t=decodeURIComponent(e);t.endsWith(`.md`)?Fs(t):Fs(t+`.md`)}catch{console.error(`Invalid hash:`,e),Fs(`./README.md`)}else Fs(`./README.md`)}async function Rs(){requestIdleCallback(()=>{Ls()},{timeout:200})}var zs=``,Bs=``;document.getElementById(`copy-ttl-btn`).addEventListener(`click`,async()=>{if(!zs){Vs(`No TTL content to copy`,`error`);return}try{await navigator.clipboard.writeText(zs),Vs(`TTL copied to clipboard!`,`success`)}catch{let e=document.createElement(`textarea`);e.value=zs,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),Vs(`TTL copied to clipboard!`,`success`)}}),document.getElementById(`download-ttl-btn`).addEventListener(`click`,()=>{if(!zs){Vs(`No TTL content to download`,`error`);return}let e=new Blob([zs],{type:`text/turtle`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`output.ttl`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t),Vs(`TTL file downloaded`,`success`)}),document.getElementById(`copy-mdld-btn`).addEventListener(`click`,async()=>{if(!Bs){Vs(`No MDLD content to copy`,`error`);return}try{await navigator.clipboard.writeText(Bs),Vs(`MDLD copied to clipboard`,`success`)}catch(e){Vs(`Failed to copy MDLD: `+e.message,`error`)}}),document.getElementById(`download-mdld-btn`).addEventListener(`click`,()=>{if(!Bs){Vs(`No MDLD content to download`,`error`);return}let e=new Blob([Bs],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`output.mdld.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t),Vs(`MDLD file downloaded`,`success`)});function Vs(e,t=`info`){let n=document.createElement(`div`);n.style.cssText=`
1193
- position: fixed;
1194
- bottom: 20px;
1195
- right: 20px;
1196
- padding: 12px 24px;
1197
- background: ${t===`success`?`#22c55e`:t===`error`?`#ef4444`:`#3b82f6`};
1198
- color: white;
1199
- border-radius: 8px;
1200
- font-weight: 500;
1201
- z-index: 1000;
1202
- opacity: 0;
1203
- transition: opacity 0.3s;
1204
- `,n.textContent=e,document.body.appendChild(n),setTimeout(()=>n.style.opacity=`1`,10),setTimeout(()=>{n.style.opacity=`0`,setTimeout(()=>document.body.removeChild(n),300)},3e3)}</script>
1205
- <style rel="stylesheet" crossorigin>/* CSS Reset - Base styles */
1206
- *,
1207
- *::before,
1208
- *::after {
1209
- box-sizing: border-box;
1210
- }
1211
-
1212
- html {
1213
- line-height: 1.15;
1214
- -webkit-text-size-adjust: 100%;
1215
- tab-size: 4;
1216
- }
1217
-
1218
- body {
1219
- margin: 0;
1220
- font-family: system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
1221
- font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
1222
- }
1223
-
1224
- #primary-subject {
1225
- position: relative;
1226
- }
1227
-
1228
- #primary-subject::before {
1229
- content: "Primary Subject";
1230
- position: absolute;
1231
- top: 0;
1232
- font-size: 0.7em;
1233
- font-weight: normal;
1234
- opacity: 0.65;
1235
- }
1236
-
1237
- /* Dark mode variables and base styles */
1238
- :root {
1239
- --color-primary: #f97316;
1240
- --color-primary-dark: #fb923c;
1241
- --bg-primary: #ffffff;
1242
- --bg-primary-dark: #111827;
1243
- --bg-secondary: #f9fafb;
1244
- --bg-secondary-dark: #1f2937;
1245
- --bg-tertiary: #f3f4f6;
1246
- --bg-tertiary-dark: #374151;
1247
- --text-primary: #111827;
1248
- --text-primary-dark: #f9fafb;
1249
- --text-secondary: #6b7280;
1250
- --text-secondary-dark: #9ca3af;
1251
- --text-tertiary: #9ca3af;
1252
- --text-tertiary-dark: #6b7280;
1253
- --border-primary: #d1d5db;
1254
- --border-primary-dark: #4b5563;
1255
- --border-secondary: #e5e7eb;
1256
- --border-secondary-dark: #6b7280;
1257
- --border-tertiary: #9ca3af;
1258
- --border-tertiary-dark: #9ca3af;
1259
- --success: #16a34a;
1260
- --success-dark: #22c55e;
1261
- --error: #dc2626;
1262
- --error-dark: #ef4444;
1263
- --warning: #ca8a04;
1264
- --warning-dark: #f59e0b;
1265
- --info: #2563eb;
1266
- --info-dark: #3b82f6;
1267
- }
1268
-
1269
- /* Dark mode support - only apply when .dark class is present */
1270
- .dark {
1271
- --bg-primary: var(--bg-primary-dark);
1272
- --bg-secondary: var(--bg-secondary-dark);
1273
- --bg-tertiary: var(--bg-tertiary-dark);
1274
- --text-primary: var(--text-primary-dark);
1275
- --text-secondary: var(--text-secondary-dark);
1276
- --text-tertiary: var(--text-tertiary-dark);
1277
- --border-primary: var(--border-primary-dark);
1278
- --border-secondary: var(--border-secondary-dark);
1279
- --border-tertiary: var(--border-tertiary-dark);
1280
- }
1281
-
1282
-
1283
-
1284
- /* Semantic Component Classes */
1285
- .main-content {
1286
- background-color: var(--bg-primary);
1287
- color: var(--text-primary);
1288
- min-height: 100vh;
1289
- }
1290
-
1291
- .header {
1292
- top: 3em;
1293
- text-align: center;
1294
- margin-bottom: 1rem;
1295
- padding-bottom: 1rem;
1296
- border-bottom: 1px solid var(--border-secondary);
1297
- }
1298
-
1299
- .logo {
1300
- font-size: 6rem;
1301
- font-weight: 700;
1302
- margin: 2rem 0;
1303
- }
1304
-
1305
- .title {
1306
- font-size: 3.75rem;
1307
- font-weight: 700;
1308
- margin-bottom: 0.5rem;
1309
- background: linear-gradient(to right, var(--color-primary), var(--color-primary-dark));
1310
- background-clip: text;
1311
- -webkit-background-clip: text;
1312
- color: transparent;
1313
- }
1314
-
1315
- .subtitle {
1316
- font-size: 1.5rem;
1317
- font-weight: 500;
1318
- margin-bottom: 0.5rem;
1319
- color: var(--text-secondary);
1320
- }
1321
-
1322
- .tagline {
1323
- font-size: 1.25rem;
1324
- color: var(--color-primary);
1325
- margin-bottom: 1rem;
1326
- }
1327
-
1328
- .nav {
1329
- display: flex;
1330
- gap: 0.5rem;
1331
- justify-content: center;
1332
- flex-wrap: wrap;
1333
- margin-bottom: 1rem;
1334
- }
1335
-
1336
- .nav-link {
1337
- color: var(--color-primary);
1338
- text-decoration: none;
1339
- padding: 0.25rem 0.75rem;
1340
- border: 1px solid var(--border-primary);
1341
- border-radius: 0.25rem;
1342
- font-size: 0.875rem;
1343
- transition: all 200ms;
1344
- }
1345
-
1346
- .nav-link:hover {
1347
- background-color: var(--bg-tertiary);
1348
- border-color: var(--color-primary);
1349
- }
1350
-
1351
- .section {
1352
- background-color: var(--bg-tertiary);
1353
- border-radius: 0.5rem;
1354
- padding: 1rem;
1355
- margin-bottom: 1rem;
1356
- display: flex;
1357
- flex-wrap: wrap;
1358
- gap: 1em;
1359
- }
1360
-
1361
- .section-title {
1362
- font-weight: 700;
1363
- font-size: 1.25rem;
1364
- margin-bottom: 0.5rem;
1365
- color: var(--text-primary);
1366
- }
1367
-
1368
- .feature-grid {
1369
- display: flex;
1370
- flex-wrap: wrap;
1371
- gap: 0.5rem;
1372
- }
1373
-
1374
- .feature-card {
1375
- background-color: var(--bg-secondary);
1376
- border-radius: 0.5rem;
1377
- padding: 0.5rem;
1378
- flex: 1;
1379
- }
1380
-
1381
- .feature-title {
1382
- font-weight: 500;
1383
- font-size: 0.875rem;
1384
- margin-bottom: 0.25rem;
1385
- color: var(--text-primary);
1386
- }
1387
-
1388
- .feature-desc {
1389
- font-size: 0.75rem;
1390
- color: var(--text-secondary);
1391
- }
1392
-
1393
- .playground {
1394
- display: flex;
1395
- flex-direction: column;
1396
-
1397
- }
1398
-
1399
- .controls {
1400
- display: flex;
1401
- justify-content: space-between;
1402
- align-items: center;
1403
- margin-bottom: 0.5rem;
1404
- }
1405
-
1406
- .button {
1407
- background-color: var(--bg-tertiary);
1408
- color: var(--text-primary);
1409
- border: 1px solid var(--border-primary);
1410
- padding: 0.25rem 0.5rem;
1411
- border-radius: 0.5rem;
1412
- cursor: pointer;
1413
- font-size: 0.85rem;
1414
- transition: all 200ms;
1415
- }
1416
-
1417
- .button:hover {
1418
- transform: translateY(-1px);
1419
- }
1420
-
1421
- .button.primary {
1422
- background-color: var(--success);
1423
- color: white;
1424
- }
1425
-
1426
- .button.primary:hover {
1427
- background-color: var(--success-dark);
1428
- }
1429
-
1430
- .button.secondary {
1431
- background-color: var(--info);
1432
- color: white;
1433
- }
1434
-
1435
- .button.secondary:hover {
1436
- background-color: var(--info-dark);
1437
- }
1438
-
1439
- .textarea {
1440
- width: 100%;
1441
- min-height: 60svh;
1442
- padding: 0.75rem;
1443
- border: 1px solid var(--border-primary);
1444
- border-radius: 0.25rem;
1445
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
1446
- font-size: 0.875rem;
1447
- resize: vertical;
1448
- background-color: var(--bg-secondary);
1449
- color: var(--text-primary);
1450
- }
1451
-
1452
- .details {
1453
- background-color: var(--bg-secondary);
1454
- border-radius: 0.5rem;
1455
- }
1456
-
1457
- .details summary {
1458
- display: flex;
1459
- gap: .3em;
1460
- cursor: pointer;
1461
- user-select: none;
1462
- font-weight: 700;
1463
- font-size: 1rem;
1464
- padding: 1rem;
1465
- background-color: var(--bg-secondary);
1466
- border-radius: 0.5rem;
1467
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
1468
- }
1469
-
1470
- .details summary:hover {
1471
- box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
1472
- }
1473
-
1474
- .details summary::-webkit-details-marker {
1475
- display: none;
1476
- }
1477
-
1478
- .details summary::before {
1479
- content: '▶';
1480
- display: inline-block;
1481
- margin-right: 0.5rem;
1482
- transition: transform 200ms;
1483
- }
1484
-
1485
- .details[open] summary::before {
1486
- transform: rotate(90deg);
1487
- }
1488
-
1489
- .output {
1490
- background-color: var(--bg-secondary);
1491
- border: 1px solid var(--border-primary);
1492
- border-radius: 0.25rem;
1493
- padding: 0.75rem;
1494
- height: 24rem;
1495
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
1496
- font-size: 0.875rem;
1497
- white-space: pre-wrap;
1498
- overflow: auto;
1499
- color: var(--text-primary);
1500
- }
1501
-
1502
- .output.small {
1503
- height: auto;
1504
- max-height: 4rem;
1505
- margin-bottom: 0.5rem;
1506
- }
1507
-
1508
- .stats {
1509
- font-size: 0.875rem;
1510
- color: var(--text-secondary);
1511
- }
1512
-
1513
- .test-grid {
1514
- display: grid;
1515
- grid-template-columns: repeat(4, minmax(0, 1fr));
1516
- gap: 0.5rem;
1517
- margin-bottom: 0.5rem;
1518
- }
1519
-
1520
- .stat-card {
1521
- background-color: var(--bg-secondary);
1522
- border: 1px solid var(--border-primary);
1523
- border-radius: 0.25rem;
1524
- padding: 0.5rem;
1525
- text-align: center;
1526
- }
1527
-
1528
- .stat-number {
1529
- font-size: 1.25rem;
1530
- font-weight: 700;
1531
- margin-bottom: 0.25rem;
1532
- }
1533
-
1534
- .stat-label {
1535
- font-size: 0.75rem;
1536
- color: var(--text-secondary);
1537
- }
1538
-
1539
- .test-item {
1540
- background-color: var(--bg-secondary);
1541
- border: 1px solid var(--border-primary);
1542
- border-radius: 0.25rem;
1543
- padding: 0.75rem;
1544
- margin-bottom: 0.25rem;
1545
- transition: all 200ms;
1546
- }
1547
-
1548
- .test-item.passed {
1549
- border-left: 4px solid var(--success);
1550
- }
1551
-
1552
- .test-item.failed {
1553
- border-left: 4px solid var(--error);
1554
- }
1555
-
1556
- .dark .test-item.passed {
1557
- border-left-color: var(--success-dark);
1558
- }
1559
-
1560
- .dark .test-item.failed {
1561
- border-left-color: var(--error-dark);
1562
- }
1563
-
1564
- .spec-content {
1565
- background-color: var(--bg-secondary);
1566
- border: 1px solid var(--border-primary);
1567
- border-radius: 0.25rem;
1568
- padding: 1rem;
1569
- max-height: 24rem;
1570
- overflow-y: scroll;
1571
- font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
1572
- line-height: 1.625;
1573
- color: var(--text-primary);
1574
- }
1575
-
1576
- .test-list {
1577
- max-height: 20rem;
1578
- overflow-y: auto;
1579
- }
1580
-
1581
- .test-progress {
1582
- height: 0.25rem;
1583
- background-color: var(--border-primary);
1584
- border-radius: 0.125rem;
1585
- overflow: hidden;
1586
- margin-bottom: 0.5rem;
1587
- }
1588
-
1589
- .test-progress-bar {
1590
- height: 100%;
1591
- background-color: var(--success);
1592
- transition: all 300ms;
1593
- }
1594
-
1595
- /* Utility classes */
1596
- .container {
1597
- max-width: 1200px;
1598
- margin: 0 auto;
1599
- padding: 0 1rem;
1600
- }
1601
-
1602
- .max-w-4xl {
1603
- max-width: 896px;
1604
- }
1605
-
1606
- .mx-auto {
1607
- margin-left: auto;
1608
- margin-right: auto;
1609
- }
1610
-
1611
- .p-4 {
1612
- padding: 1rem;
1613
- }
1614
-
1615
- .mb-8 {
1616
- margin-bottom: 2rem;
1617
- }
1618
-
1619
- .mb-4 {
1620
- margin-bottom: 1rem;
1621
- }
1622
-
1623
- .mb-2 {
1624
- margin-bottom: 0.5rem;
1625
- }
1626
-
1627
- .mb-1 {
1628
- margin-bottom: 0.25rem;
1629
- }
1630
-
1631
- .text-center {
1632
- text-align: center;
1633
- }
1634
-
1635
- .font-bold {
1636
- font-weight: 700;
1637
- }
1638
-
1639
- .font-medium {
1640
- font-weight: 500;
1641
- }
1642
-
1643
- .text-sm {
1644
- font-size: 0.875rem;
1645
- line-height: 1.25rem;
1646
- }
1647
-
1648
- .text-xs {
1649
- font-size: 0.75rem;
1650
- line-height: 1rem;
1651
- }
1652
-
1653
- .text-xl {
1654
- font-size: 1.25rem;
1655
- line-height: 1.75rem;
1656
- }
1657
-
1658
-
1659
-
1660
- .bg-gradient-to-r {
1661
- background-image: linear-gradient(to right, var(--tw-gradient-stops));
1662
- }
1663
-
1664
- .from-orange-500 {
1665
- --tw-gradient-from: #f97316;
1666
- --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(251 146 60 / 0));
1667
- }
1668
-
1669
- .to-orange-600 {
1670
- --tw-gradient-to: #ea580c;
1671
- }
1672
-
1673
- .bg-clip-text {
1674
- background-clip: text;
1675
- -webkit-background-clip: text;
1676
- }
1677
-
1678
- .text-transparent {
1679
- color: transparent;
1680
- }
1681
-
1682
- .border-b {
1683
- border-bottom-width: 1px;
1684
- }
1685
-
1686
- .border-gray-300 {
1687
- border-color: #d1d5db;
1688
- }
1689
-
1690
- .dark .border-gray-300 {
1691
- border-color: #4b5563;
1692
- }
1693
-
1694
- .dark\:border-gray-600 {
1695
- border-color: #4b5563;
1696
- }
1697
-
1698
- .dark\:border-gray-500 {
1699
- border-color: #6b7280;
1700
- }
1701
-
1702
- .dark\:border-gray-400 {
1703
- border-color: #9ca3af;
1704
- }
1705
-
1706
- .flex {
1707
- display: flex;
1708
- }
1709
-
1710
- .flex-col {
1711
- flex-direction: column;
1712
- }
1713
-
1714
- .flex-wrap {
1715
- flex-wrap: wrap;
1716
- }
1717
-
1718
- .flex-1 {
1719
- flex: 1 1 0%;
1720
- }
1721
-
1722
- .flex-auto {
1723
- flex: 1 1 auto;
1724
- }
1725
-
1726
- .gap-2 {
1727
- gap: 0.5rem;
1728
- }
1729
-
1730
- .gap-1 {
1731
- gap: 0.25rem;
1732
- }
1733
-
1734
- .justify-center {
1735
- justify-content: center;
1736
- }
1737
-
1738
- .justify-between {
1739
- justify-content: space-between;
1740
- }
1741
-
1742
- .items-center {
1743
- align-items: center;
1744
- }
1745
-
1746
- .rounded-lg {
1747
- border-radius: 0.5rem;
1748
- }
1749
-
1750
- .rounded {
1751
- border-radius: 0.25rem;
1752
- }
1753
-
1754
- .rounded-full {
1755
- border-radius: 9999px;
1756
- }
1757
-
1758
- .bg-gray-50 {
1759
- background-color: #f9fafb;
1760
- }
1761
-
1762
- .dark .bg-gray-50 {
1763
- background-color: #111827;
1764
- }
1765
-
1766
- .bg-gray-600 {
1767
- background-color: #4b5563;
1768
- }
1769
-
1770
- .bg-green-600 {
1771
- background-color: #16a34a;
1772
- }
1773
-
1774
- .bg-blue-600 {
1775
- background-color: #2563eb;
1776
- }
1777
-
1778
- .hover\:bg-gray-200:hover {
1779
- background-color: #e5e7eb;
1780
- }
1781
-
1782
- .hover\:bg-gray-700:hover {
1783
- background-color: #374151;
1784
- }
1785
-
1786
- .hover\:bg-green-700:hover {
1787
- background-color: #15803d;
1788
- }
1789
-
1790
- .hover\:bg-blue-700:hover {
1791
- background-color: #1d4ed8;
1792
- }
1793
-
1794
- .hover\:bg-gray-300:hover {
1795
- background-color: #d1d5db;
1796
- }
1797
-
1798
- .hover\:bg-gray-800:hover {
1799
- background-color: #1f2937;
1800
- }
1801
-
1802
- .hover\:border-orange-500:hover {
1803
- border-color: #f97316;
1804
- }
1805
-
1806
-
1807
- .text-gray-600 {
1808
- color: #4b5563;
1809
- }
1810
-
1811
- .text-orange-600 {
1812
- color: #ea580c;
1813
- }
1814
-
1815
-
1816
- .dark .text-gray-600 {
1817
- color: #9ca3af;
1818
- }
1819
-
1820
- .dark .text-orange-600 {
1821
- color: #fb923c;
1822
- }
1823
-
1824
- .dark\:text-white {
1825
- color: #ffffff;
1826
- }
1827
-
1828
- .dark\:text-gray-100 {
1829
- color: #f3f4f6;
1830
- }
1831
-
1832
- .dark\:text-gray-200 {
1833
- color: #e5e7eb;
1834
- }
1835
-
1836
- .dark\:text-gray-300 {
1837
- color: #d1d5db;
1838
- }
1839
-
1840
- .dark\:text-gray-400 {
1841
- color: #9ca3af;
1842
- }
1843
-
1844
- .dark\:text-orange-400 {
1845
- color: #fb923c;
1846
- }
1847
-
1848
- .dark\:text-green-400 {
1849
- color: #4ade80;
1850
- }
1851
-
1852
- .dark\:text-red-400 {
1853
- color: #f87171;
1854
- }
1855
-
1856
- .dark\:text-blue-400 {
1857
- color: #60a5fa;
1858
- }
1859
-
1860
- .dark\:bg-gray-800 {
1861
- background-color: #1f2937;
1862
- }
1863
-
1864
- .dark\:bg-gray-900 {
1865
- background-color: #111827;
1866
- }
1867
-
1868
- .dark\:bg-gray-700 {
1869
- background-color: #374151;
1870
- }
1871
-
1872
- .dark\:bg-blue-900 {
1873
- background-color: #1e3a8a;
1874
- }
1875
-
1876
- .dark\:bg-green-900 {
1877
- background-color: #14532d;
1878
- }
1879
-
1880
- .dark\:bg-amber-900 {
1881
- background-color: #1f2937;
1882
- }
1883
-
1884
- .dark\:bg-amber-800 {
1885
- background-color: #374151;
1886
- }
1887
-
1888
- .dark\:border-l-green-400 {
1889
- border-left-color: #4ade80;
1890
- }
1891
-
1892
- .dark\:border-l-red-400 {
1893
- border-left-color: #f87171;
1894
- }
1895
-
1896
- .opacity-50 {
1897
- opacity: 0.5;
1898
- }
1899
-
1900
- .w-full {
1901
- width: 100%;
1902
- }
1903
-
1904
- .h-96 {
1905
- height: 24rem;
1906
- }
1907
-
1908
- .h-1 {
1909
- height: 0.25rem;
1910
- }
1911
-
1912
- .min-h-40svh {
1913
- min-height: 40svh;
1914
- }
1915
-
1916
- .min-w-0 {
1917
- min-width: 0px;
1918
- }
1919
-
1920
- .max-h-96 {
1921
- max-height: 24rem;
1922
- }
1923
-
1924
- .max-h-80 {
1925
- max-height: 20rem;
1926
- }
1927
-
1928
- .max-h-72 {
1929
- max-height: 18rem;
1930
- }
1931
-
1932
- .max-h-36 {
1933
- max-height: 9rem;
1934
- }
1935
-
1936
- .max-w-full {
1937
- max-width: 100%;
1938
- }
1939
-
1940
- .max-w-48 {
1941
- max-width: 12rem;
1942
- }
1943
-
1944
- .border {
1945
- border-width: 1px;
1946
- }
1947
-
1948
- .border-gray-600 {
1949
- border-color: #4b5563;
1950
- }
1951
-
1952
- .border-gray-500 {
1953
- border-color: #6b7280;
1954
- }
1955
-
1956
- .border-blue-700 {
1957
- border-color: #1d4ed8;
1958
- }
1959
-
1960
- .border-blue-300 {
1961
- border-color: #93c5fd;
1962
- }
1963
-
1964
- .border-green-700 {
1965
- border-color: #15803d;
1966
- }
1967
-
1968
- .border-green-300 {
1969
- border-color: #86efac;
1970
- }
1971
-
1972
- .border-amber-700 {
1973
- border-color: #6b7280;
1974
- }
1975
-
1976
- .border-amber-300 {
1977
- border-color: #d1d5db;
1978
- }
1979
-
1980
- .border-l-4 {
1981
- border-left-width: 4px;
1982
- }
1983
-
1984
- .border-l-green-600 {
1985
- border-left-color: #16a34a;
1986
- }
1987
-
1988
- .border-l-red-600 {
1989
- border-left-color: #dc2626;
1990
- }
1991
-
1992
- .border-dashed {
1993
- border-style: dashed;
1994
- }
1995
-
1996
- .border-t {
1997
- border-top-width: 1px;
1998
- }
1999
-
2000
- .rounded-sm {
2001
- border-radius: 0.125rem;
2002
- }
2003
-
2004
- .rounded-t {
2005
- border-top-left-radius: 0.25rem;
2006
- border-top-right-radius: 0.25rem;
2007
- }
2008
-
2009
- .rounded-b {
2010
- border-bottom-left-radius: 0.25rem;
2011
- border-bottom-right-radius: 0.25rem;
2012
- }
2013
-
2014
-
2015
- .py-0\.5 {
2016
- padding-top: 0.125rem;
2017
- padding-bottom: 0.125rem;
2018
- }
2019
-
2020
- .px-2 {
2021
- padding-left: 0.5rem;
2022
- padding-right: 0.5rem;
2023
- }
2024
-
2025
- .px-3 {
2026
- padding-left: 0.75rem;
2027
- padding-right: 0.75rem;
2028
- }
2029
-
2030
- .px-4 {
2031
- padding-left: 1rem;
2032
- padding-right: 1rem;
2033
- }
2034
-
2035
- .p-2 {
2036
- padding: 0.5rem;
2037
- }
2038
-
2039
- .p-3 {
2040
- padding: 0.75rem;
2041
- }
2042
-
2043
- .pt-2 {
2044
- padding-top: 0.5rem;
2045
- }
2046
-
2047
- .mt-2 {
2048
- margin-top: 0.5rem;
2049
- }
2050
-
2051
- .ml-2 {
2052
- margin-left: 0.5rem;
2053
- }
2054
-
2055
- .m-2 {
2056
- margin: 0.5rem;
2057
- }
2058
-
2059
- .mb-1 {
2060
- margin-bottom: 0.25rem;
2061
- }
2062
-
2063
- .overflow-auto {
2064
- overflow: auto;
2065
- }
2066
-
2067
- .overflow-y-auto {
2068
- overflow-y: auto;
2069
- }
2070
-
2071
- .overflow-y-scroll {
2072
- overflow-y: scroll;
2073
- }
2074
-
2075
- .overflow-hidden {
2076
- overflow: hidden;
2077
- }
2078
-
2079
- .whitespace-pre-wrap {
2080
- white-space: pre-wrap;
2081
- }
2082
-
2083
- .whitespace-nowrap {
2084
- white-space: nowrap;
2085
- }
2086
-
2087
- .text-ellipsis {
2088
- text-overflow: ellipsis;
2089
- }
2090
-
2091
- .font-mono {
2092
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
2093
- }
2094
-
2095
- .font-sans {
2096
- font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
2097
- }
2098
-
2099
- .leading-relaxed {
2100
- line-height: 1.625;
2101
- }
2102
-
2103
- .select-text {
2104
- user-select: text;
2105
- }
2106
-
2107
- .resize-vertical {
2108
- resize: vertical;
2109
- }
2110
-
2111
- .cursor-pointer {
2112
- cursor: pointer;
2113
- }
2114
-
2115
- .cursor-default {
2116
- cursor: default;
2117
- }
2118
-
2119
- .cursor-grab {
2120
- cursor: grab;
2121
- }
2122
-
2123
- .cursor-grabbing {
2124
- cursor: grabbing;
2125
- }
2126
-
2127
- .no-underline {
2128
- text-decoration: none;
2129
- }
2130
-
2131
- .transition-all {
2132
- transition-property: all;
2133
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2134
- transition-duration: 150ms;
2135
- }
2136
-
2137
- .transition {
2138
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
2139
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2140
- transition-duration: 150ms;
2141
- }
2142
-
2143
- .duration-200 {
2144
- transition-duration: 200ms;
2145
- }
2146
-
2147
- .duration-300 {
2148
- transition-duration: 300ms;
2149
- }
2150
-
2151
- .duration-500 {
2152
- transition-duration: 500ms;
2153
- }
2154
-
2155
- .hover\:-translate-y-px:hover {
2156
- transform: translateY(-1px);
2157
- }
2158
-
2159
- .hover\:shadow-lg:hover {
2160
- box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2161
- }
2162
-
2163
- .shadow-sm {
2164
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
2165
- }
2166
-
2167
- .shadow-xs {
2168
- box-shadow: 0 0 0 1px rgb(0 0 0 / 0.05);
2169
- }
2170
-
2171
- .hidden {
2172
- display: none;
2173
- }
2174
-
2175
- .grid {
2176
- display: grid;
2177
- }
2178
-
2179
- .grid-cols-4 {
2180
- grid-template-columns: repeat(4, minmax(0, 1fr));
2181
- }
2182
-
2183
- .lg\:col-span-1 {
2184
- grid-column: span 1 / span 1;
2185
- }
2186
-
2187
- .inline-flex {
2188
- display: inline-flex;
2189
- }
2190
-
2191
- .fixed {
2192
- position: fixed;
2193
- }
2194
-
2195
- .top-4 {
2196
- top: 1rem;
2197
- }
2198
-
2199
- .right-4 {
2200
- right: 1rem;
2201
- }
2202
-
2203
- .z-50 {
2204
- z-index: 50;
2205
- }
2206
-
2207
- .bg-blue-600 {
2208
- background-color: #2563eb;
2209
- }
2210
-
2211
- .bg-red-600 {
2212
- background-color: #dc2626;
2213
- }
2214
-
2215
- .bg-green-600 {
2216
- background-color: #16a34a;
2217
- }
2218
-
2219
- .text-white {
2220
- color: #ffffff;
2221
- }
2222
-
2223
- .text-red-600 {
2224
- color: #dc2626;
2225
- }
2226
-
2227
- .text-green-600 {
2228
- color: #16a34a;
2229
- }
2230
-
2231
- .text-blue-600 {
2232
- color: #2563eb;
2233
- }
2234
-
2235
- .text-base {
2236
- font-size: 1rem;
2237
- line-height: 1.5rem;
2238
- }
2239
-
2240
- .border-none {
2241
- border-style: none;
2242
- }
2243
-
2244
- .border-l {
2245
- border-left-width: 1px;
2246
- }
2247
-
2248
- .border-t {
2249
- border-top-width: 1px;
2250
- }
2251
-
2252
- .block {
2253
- display: block;
2254
- }
2255
-
2256
- .relative {
2257
- position: relative;
2258
- }
2259
-
2260
- .absolute {
2261
- position: absolute;
2262
- }
2263
-
2264
- .top-8 {
2265
- top: 2rem;
2266
- }
2267
-
2268
- .right-8 {
2269
- right: 2rem;
2270
- }
2271
-
2272
- .text-gray-500 {
2273
- color: #6b7280;
2274
- }
2275
-
2276
- .dark .text-gray-500 {
2277
- color: #6b7280;
2278
- }
2279
-
2280
- .py-0\.5 {
2281
- padding-top: 0.125rem;
2282
- padding-bottom: 0.125rem;
2283
- }
2284
-
2285
-
2286
-
2287
- /* Component-specific styles */
2288
- .link-hover {
2289
- color: #ea580c;
2290
- text-decoration: none;
2291
- padding: 0.25rem 0.75rem;
2292
- border: 1px solid #4b5563;
2293
- border-radius: 0.25rem;
2294
- font-size: 0.875rem;
2295
- transition: all 200ms;
2296
- }
2297
-
2298
- .dark .link-hover {
2299
- color: #fb923c;
2300
- border-color: #9ca3af;
2301
- }
2302
-
2303
- .link-hover:hover {
2304
- background-color: #e5e7eb;
2305
- border-color: #f97316;
2306
- }
2307
-
2308
- .dark .link-hover:hover {
2309
- background-color: #374151;
2310
- border-color: #f97316;
2311
- }
2312
-
2313
- .btn-hover {
2314
- background-color: #4b5563;
2315
- color: #ffffff;
2316
- border: none;
2317
- padding: 0.25rem 0.5rem;
2318
- border-radius: 0.25rem;
2319
- cursor: pointer;
2320
- font-size: 0.75rem;
2321
- transition: all 200ms;
2322
- }
2323
-
2324
- .btn-hover:hover {
2325
- transform: translateY(-1px);
2326
- }
2327
-
2328
- .btn-hover.bg-green-600:hover {
2329
- background-color: #15803d;
2330
- }
2331
-
2332
- .btn-hover.bg-gray-600:hover {
2333
- background-color: #374151;
2334
- }
2335
-
2336
- .btn-hover.bg-blue-600:hover {
2337
- background-color: #1d4ed8;
2338
- }
2339
-
2340
- .btn-hover.bg-green-600:hover {
2341
- background-color: #15803d;
2342
- }
2343
-
2344
- .btn-hover.bg-green-600:hover {
2345
- background-color: #15803d;
2346
- }
2347
-
2348
- details summary {
2349
- cursor: pointer;
2350
- user-select: none;
2351
- }
2352
-
2353
- details summary::-webkit-details-marker {
2354
- display: none;
2355
- }
2356
-
2357
- details summary::before {
2358
- content: '▶';
2359
- display: inline-block;
2360
- margin-right: 0.5rem;
2361
- transition: transform 200ms;
2362
- }
2363
-
2364
- details[open] summary::before {
2365
- transform: rotate(90deg);
2366
- }
2367
-
2368
- /* RDF Graph Viewer Styles */
2369
- rdf-graph {
2370
- display: block;
2371
- width: 100%;
2372
- font-family: var(--font-mono, monospace)
2373
- }
2374
-
2375
- rdf-graph svg {
2376
- width: 100%;
2377
- height: 100%;
2378
- cursor: default
2379
- }
2380
-
2381
- .rdf-wrap {
2382
- position: relative;
2383
- overflow: hidden;
2384
- background: var(--color-background-primary, #ffffff)
2385
- }
2386
-
2387
- .rdf-hud {
2388
- position: absolute;
2389
- top: 8px;
2390
- right: 8px;
2391
- display: flex;
2392
- gap: 6px;
2393
- align-items: center
2394
- }
2395
-
2396
- .rdf-hud span {
2397
- font-size: 11px;
2398
- color: var(--color-text-secondary, #6b7280);
2399
- background: var(--color-background-secondary, #f9fafb);
2400
- padding: 2px 7px;
2401
- border-radius: 20px;
2402
- border: 0.5px solid var(--color-border-tertiary, #d1d5db)
2403
- }
2404
-
2405
- .rdf-energy {
2406
- width: 48px;
2407
- height: 6px;
2408
- border-radius: 3px;
2409
- border: 0.5px solid var(--color-border-tertiary, #d1d5db);
2410
- overflow: hidden;
2411
- background: var(--color-background-secondary, #f9fafb)
2412
- }
2413
-
2414
- .rdf-ebar {
2415
- height: 100%;
2416
- border-radius: 3px;
2417
- transition: width .4s, background .4s
2418
- }
2419
-
2420
- .dark .rdf-wrap {
2421
- border-color: var(--color-border-tertiary, #4b5563);
2422
- background: var(--color-background-primary, #1f2937)
2423
- }
2424
-
2425
- .dark .rdf-hud span {
2426
- color: var(--color-text-secondary, #9ca3af);
2427
- background: var(--color-background-secondary, #374151)
2428
- }
2429
-
2430
- .dark .rdf-energy {
2431
- border-color: var(--color-border-tertiary, #4b5563);
2432
- background: var(--color-background-secondary, #374151)
2433
- }
2434
-
2435
- /* Custom scrollbar styles */
2436
- ::-webkit-scrollbar {
2437
- width: 8px;
2438
- height: 8px;
2439
- }
2440
-
2441
- ::-webkit-scrollbar-track {
2442
- background: var(--bg-secondary);
2443
- }
2444
-
2445
- ::-webkit-scrollbar-thumb {
2446
- background: var(--border-primary);
2447
- border-radius: 4px;
2448
- }
2449
-
2450
- ::-webkit-scrollbar-thumb:hover {
2451
- background: var(--border-secondary);
2452
- }
2453
-
2454
- /* Focus styles */
2455
- :focus-visible {
2456
- outline: 2px solid var(--color-primary);
2457
- outline-offset: 2px;
2458
- }
2459
-
2460
- /* Selection styles */
2461
- ::selection {
2462
- background-color: var(--color-primary);
2463
- color: white;
2464
- }
2465
-
2466
- .dark ::selection {
2467
- background-color: var(--color-primary-dark);
2468
- color: white;
2469
- }
2470
-
2471
-
2472
- .dark .token.comment,
2473
- .dark .token.prolog,
2474
- .dark .token.doctype,
2475
- .dark .token.cdata {
2476
- color: #6a737d;
2477
- }
2478
-
2479
- .dark .token.punctuation {
2480
- color: #e1e4e8;
2481
- }
2482
-
2483
- .dark .token.property,
2484
- .dark .token.tag,
2485
- .dark .token.boolean,
2486
- .dark .token.number,
2487
- .dark .token.constant,
2488
- .dark .token.symbol,
2489
- .dark .token.deleted {
2490
- color: #79c0ff;
2491
- }
2492
-
2493
- .dark .token.selector,
2494
- .dark .token.attr-name,
2495
- .dark .token.string,
2496
- .dark .token.char,
2497
- .dark .token.builtin,
2498
- .dark .token.inserted {
2499
- color: #a5d6ff;
2500
- }
2501
-
2502
- .dark .token.operator,
2503
- .dark .token.entity,
2504
- .dark .token.url,
2505
- .dark .language-css .token.string,
2506
- .dark .style .token.string {
2507
- color: #ff7b72;
2508
- }
2509
-
2510
- .dark .token.atrule,
2511
- .dark .token.attr-value,
2512
- .dark .token.keyword {
2513
- color: #ff7b72;
2514
- }
2515
-
2516
- .dark .token.function,
2517
- .dark .token.class-name {
2518
- color: #d2a8ff;
2519
- }
2520
-
2521
- .dark .token.regex,
2522
- .dark .token.important,
2523
- .dark .token.variable {
2524
- color: #ffa657;
2525
- }
2526
-
2527
- /* Prevent layout jumping in collapsed sections */
2528
- .details {
2529
- min-height: fit-content;
2530
- contain: layout;
2531
- margin-bottom: 0.5rem;
2532
- border: 1px solid var(--border-primary, #d1d5db);
2533
- border-radius: 0.5rem;
2534
- background: var(--bg-secondary, #f9fafb);
2535
- overflow: hidden;
2536
- }
2537
-
2538
- .details[open] {
2539
- min-height: auto;
2540
- }
2541
-
2542
- .details summary {
2543
- min-height: 2.75rem;
2544
- display: flex;
2545
- align-items: center;
2546
- padding: 0.75rem 1rem;
2547
- font-weight: 600;
2548
- cursor: pointer;
2549
- user-select: none;
2550
- background: var(--bg-secondary, #f9fafb);
2551
- border-bottom: 1px solid transparent;
2552
- transition: all 0.2s ease;
2553
- }
2554
-
2555
- .details[open] summary {
2556
- border-bottom-color: var(--border-primary, #d1d5db);
2557
- background: var(--bg-tertiary, #f3f4f6);
2558
- }
2559
-
2560
- .details summary:hover {
2561
- background: var(--bg-tertiary, #f3f4f6);
2562
- }
2563
-
2564
- .details[open] summary:hover {
2565
- background: var(--bg-primary, #ffffff);
2566
- }
2567
-
2568
- /* Fixed dimensions for content containers */
2569
- .details[open]>div {
2570
- contain: layout;
2571
- padding: 1rem;
2572
- min-height: 0;
2573
- }
2574
-
2575
- /* Fixed heights for graph containers */
2576
- .rdf-wrap {
2577
- contain: strict;
2578
- overflow: hidden;
2579
- border-radius: 0.375rem;
2580
- }
2581
-
2582
- .details[open] .rdf-wrap {
2583
- height: inherit;
2584
- min-height: inherit;
2585
- }
2586
-
2587
- /* Consistent heights for output areas */
2588
- .output.small {
2589
- min-height: 72px;
2590
- max-height: 144px;
2591
- contain: layout;
2592
- overflow-y: auto;
2593
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
2594
- font-size: 0.875rem;
2595
- line-height: 1.25;
2596
- padding: 0.75rem;
2597
- border-radius: 0.375rem;
2598
- background: var(--bg-primary, #ffffff);
2599
- border: 1px solid var(--border-primary, #d1d5db);
2600
- }
2601
-
2602
- .output {
2603
- min-height: 384px;
2604
- /* 24rem */
2605
- max-height: 384px;
2606
- contain: layout;
2607
- overflow-y: auto;
2608
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
2609
- font-size: 0.875rem;
2610
- line-height: 1.25;
2611
- padding: 0.75rem;
2612
- border-radius: 0.375rem;
2613
- background: var(--bg-primary, #ffffff);
2614
- border: 1px solid var(--border-primary, #d1d5db);
2615
- white-space: pre-wrap;
2616
- word-wrap: break-word;
2617
- word-break: break-word;
2618
- overflow-wrap: break-word;
2619
- }
2620
-
2621
- /* Fixed graph container heights */
2622
- .details[open] .bg-gray-50,
2623
- .details[open] .bg-gray-900 {
2624
- height: 400px !important;
2625
- min-height: 400px !important;
2626
- max-height: 400px !important;
2627
- }
2628
-
2629
- .details[open] .rdf-graph[height="300"] {
2630
- height: 400px !important;
2631
- min-height: 400px !important;
2632
- max-height: 400px !important;
2633
- }
2634
-
2635
- /* Reserve space for collapsed content to prevent jumping */
2636
- .details:not([open]) {
2637
- min-height: 2.75rem;
2638
- /* Just enough for summary */
2639
- }
2640
-
2641
- /* Dark mode adjustments */
2642
- .dark .details {
2643
- background: var(--bg-secondary-dark, #1f2937);
2644
- border-color: var(--border-primary-dark, #4b5563);
2645
- }
2646
-
2647
- .dark .details summary {
2648
- background: var(--bg-secondary-dark, #1f2937);
2649
- color: var(--text-primary-dark, #f9fafb);
2650
- }
2651
-
2652
- .dark .details[open] summary {
2653
- background: var(--bg-tertiary-dark, #374151);
2654
- border-bottom-color: var(--border-primary-dark, #4b5563);
2655
- }
2656
-
2657
- .dark .details summary:hover {
2658
- background: var(--bg-tertiary-dark, #374151);
2659
- }
2660
-
2661
- .dark .details[open] summary:hover {
2662
- background: var(--bg-primary-dark, #111827);
2663
- }
2664
-
2665
- .dark .output,
2666
- .dark .output.small {
2667
- background: var(--bg-primary-dark, #111827);
2668
- border-color: var(--border-primary-dark, #4b5563);
2669
- color: var(--text-primary-dark, #f9fafb);
2670
- }
2671
-
2672
- /* TTL and MDLD output blocks - proper word wrapping */
2673
- .details pre {
2674
- margin: 0;
2675
- white-space: pre-wrap;
2676
- word-wrap: break-word;
2677
- word-break: break-word;
2678
- overflow-wrap: break-word;
2679
- max-width: 100%;
2680
- }
2681
-
2682
- .details pre code {
2683
- white-space: pre-wrap;
2684
- word-wrap: break-word;
2685
- word-break: break-word;
2686
- overflow-wrap: break-word;
2687
- display: block;
2688
- max-width: 100%;
2689
- }
2690
-
2691
- /* Specific TTL styling */
2692
- #ttl {
2693
- white-space: pre-wrap;
2694
- word-wrap: break-word;
2695
- word-break: break-word;
2696
- overflow-wrap: break-word;
2697
- max-width: 100%;
2698
- padding: 1em;
2699
- }
2700
-
2701
- /* Specific MDLD styling */
2702
- #mdld {
2703
- white-space: pre-wrap;
2704
- word-wrap: break-word;
2705
- word-break: break-word;
2706
- overflow-wrap: break-word;
2707
- max-width: 100%;
2708
- }
2709
-
2710
- /* Specific quads output styling - prevent layout shifts */
2711
- #output {
2712
- white-space: pre-wrap !important;
2713
- word-wrap: break-word !important;
2714
- word-break: break-word !important;
2715
- overflow-wrap: break-word !important;
2716
- max-width: 100% !important;
2717
- }
2718
-
2719
- /* Fix quads flex layout to prevent width expansion */
2720
- #output .flex {
2721
- flex-wrap: wrap !important;
2722
- max-width: 100% !important;
2723
- min-width: 0 !important;
2724
- }
2725
-
2726
- #output .inline-flex {
2727
- flex-wrap: wrap !important;
2728
- max-width: 100% !important;
2729
- min-width: 0 !important;
2730
- }
2731
-
2732
- /* Constrain chip elements in quads output */
2733
- #output .inline-flex.items-center {
2734
- max-width: 100% !important;
2735
- min-width: 0 !important;
2736
- flex-wrap: wrap !important;
2737
- }
2738
-
2739
- #output .max-w-48 {
2740
- max-width: calc(100% - 2rem) !important;
2741
- min-width: 0 !important;
2742
- flex-shrink: 1 !important;
2743
- }
2744
-
2745
- #output .gap-1 {
2746
- gap: 0.25rem !important;
2747
- }
2748
-
2749
- /* Ensure arrow separators don't cause overflow */
2750
- #output .text-gray-500 {
2751
- flex-shrink: 0 !important;
2752
- min-width: auto !important;
2753
- }
2754
-
2755
- /* Smooth transitions for details */
2756
- .details {
2757
- transition: all 0.2s ease;
2758
- }
2759
-
2760
- .details[open] {
2761
- animation: fadeIn 0.2s ease;
2762
- }
2763
-
2764
- @keyframes fadeIn {
2765
- from {
2766
- opacity: 0;
2767
- transform: translateY(-8px);
2768
- }
2769
-
2770
- to {
2771
- opacity: 1;
2772
- transform: translateY(0);
2773
- }
2774
- }
2775
-
2776
- /* Prevent text overflow in summaries */
2777
- .details summary span {
2778
- white-space: nowrap;
2779
- overflow: hidden;
2780
- text-overflow: ellipsis;
2781
- min-width: 0;
2782
- }
2783
-
2784
- .details summary span[style*="flex"] {
2785
- flex: 1;
2786
- min-width: 0;
2787
- }/*$vite$:1*/</style>
2788
- </head>
2789
-
2790
- <body class="main-content">
2791
- <main class="container max-w-4xl mx-auto p-4">
2792
- <header class="header">
2793
- <div class="logo">
2794
- <span class="opacity-50">{</span><span class="text-orange-600 dark:text-orange-400">=+ .?!</span><span
2795
- class="opacity-50">}</span>
2796
- </div>
2797
- <h1 class="title">MD-LD</h1>
2798
- <h2 class="subtitle">Markdown Linked Data</h2>
2799
- <p class="tagline">Human-friendly knowledge graph authoring</p>
2800
- <nav class="nav">
2801
- <a href="https://github.com/davay42/mdld-parse" target="blank" class="nav-link">📦 GitHub</a>
2802
- <a href="https://www.npmjs.com/package/mdld-parse" target="blank" class="nav-link">📦 npm</a>
2803
- </nav>
2804
- </header>
2805
-
2806
- <div id="example-selector" class="p-2 mb-4 flex gap-2 justify-center flex-wrap">
2807
- <button class="button" onclick="loadExample('minimal')">Minimal</button>
2808
- <button class="button" onclick="loadExample('journal')">Journal</button>
2809
- <button class="button" onclick="loadExample('recipe')">Recipe</button>
2810
- <button class="button" onclick="loadExample('project')">Project</button>
2811
- <button class="button" onclick="loadExample('space-mission')">Space Mission</button>
2812
- <button class="button" onclick="loadExample('research')">Research</button>
2813
- <button class="button" style="background-color: #E006;" onclick="clearPlayground()">
2814
- 🗑️ Clear
2815
- </button>
2816
- </div>
2817
-
2818
-
2819
- <section id="playground" class="section">
2820
- <!-- MD-LD Input Section -->
2821
- <div style="flex: 1 0 220px; max-width:100%;">
2822
- <div class="editor-container" style="position: relative;">
2823
- <div id="editor" class="editor"
2824
- style="min-width: 100%;max-height:90svh; min-height: 400px;hyphens: auto; overflow-wrap:break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-size: 14px; line-height: 1.5; padding: 12px; background: var(--bg-primary, white); color: var(--text-primary, #1f2937); border: 1px solid var(--border-primary, #d1d5db); border-radius: 6px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word;">
2825
- </div>
2826
- <style>
2827
- .editor {
2828
- tab-size: 2;
2829
- }
2830
-
2831
- .editor:focus {
2832
- outline: 2px solid var(--accent, #3b82f6);
2833
- outline-offset: -2px;
2834
- }
2835
-
2836
- .editor ::selection {
2837
- background: var(--accent, #3b82f6);
2838
- color: white;
2839
- }
2840
- </style>
2841
- </div>
2842
- </div>
2843
-
2844
- <!-- Preview Section with Graph and Quads -->
2845
- <div class="playground" style="flex: 1 0 220px;">
2846
- <div id="primary-subject" class="p-4 font-bold" style="word-break: break-all;">No
2847
- primary subject found...</div>
2848
- <details class="details" open>
2849
- <summary>
2850
- <span>Graph</span>
2851
- <span style="flex:auto;"></span>
2852
- <span id="parse-stats" class="stats"></span>
2853
- </summary>
2854
- <!-- Interactive Graph (Primary) -->
2855
- <div class="flex-auto w-full p-2">
2856
-
2857
- <div class="bg-gray-50 dark:bg-gray-900 border border-gray-600 dark:border-gray-500 w-full"
2858
- style="height: 400px;">
2859
- <rdf-graph id="rdf-graph" height="400" charge="-120" link-dist="180"></rdf-graph>
2860
- </div>
2861
- </div>
2862
- </details>
2863
-
2864
-
2865
- <!-- Statements Graph Display -->
2866
- <details class="details">
2867
- <summary>
2868
- <span>Statements Graph</span>
2869
- <span style="flex: auto;"></span>
2870
- <span id="statements-stats" class="stats"></span>
2871
- </summary>
2872
- <div class="m-2">
2873
- <div class="bg-gray-50 dark:bg-gray-900 border border-gray-600 dark:border-gray-500 w-full"
2874
- style="height: 300px; min-height: 300px;">
2875
- <rdf-graph id="statements-graph" height="300" charge="-120" link-dist="180"></rdf-graph>
2876
- </div>
2877
- </div>
2878
- </details>
2879
-
2880
- <details class="details">
2881
- <summary>
2882
- <span>TTL</span>
2883
- <span style="flex: 1"></span>
2884
- <label id="import-ttl-btn" class="button secondary" title="Convert TTL to MDLD">🗂️
2885
- Import
2886
- <input type="file" accept=".ttl" style="display:none">
2887
- </label>
2888
- <button id="copy-ttl-btn" class="button secondary" title="Copy TTL to clipboard">
2889
- 📋 Copy
2890
- </button>
2891
- <button id="download-ttl-btn" class="button primary" title="Download TTL file">
2892
- 💾 Download
2893
- </button>
2894
- </summary>
2895
- <!-- TTL Output Section (Collapsible) -->
2896
- <div class="m-2 flex flex-col">
2897
- <div class="flex gap-2"></div>
2898
- <pre
2899
- class="w-full min-h-32 max-h-72 overflow-y-auto bg-gray-50 dark:bg-gray-900 border border-gray-600 dark:border-gray-500 rounded text-white">
2900
- <code id="ttl" class="language-turtle text-xs block">
2901
- TTL loading...</code>
2902
- </pre>
2903
- </div>
2904
- </details>
2905
-
2906
- <!-- MDLD Output Section -->
2907
- <details class="details">
2908
- <summary>
2909
- <span>MDLD</span>
2910
- <span style="flex: 1"></span>
2911
- <button id="copy-mdld-btn" class="button secondary" title="Copy MDLD to clipboard">
2912
- 📋 Copy
2913
- </button>
2914
- <button id="download-mdld-btn" class="button primary" title="Download MDLD file">
2915
- 💾 Download
2916
- </button>
2917
- </summary>
2918
- <div class="m-2 flex flex-col">
2919
- <div class="flex gap-2"></div>
2920
- <pre
2921
- class="w-full min-h-32 max-h-72 overflow-y-auto bg-gray-50 dark:bg-gray-900 border border-gray-600 dark:border-gray-500 rounded text-white">
2922
- <code id="mdld" class="language-markdown text-xs block">
2923
- MDLD will appear here...</code>
2924
- </pre>
2925
- </div>
2926
- </details>
2927
-
2928
- </div>
2929
- </section>
2930
-
2931
-
2932
- <section class="section">
2933
- <section id="format">
2934
- <h3 class="section-title">📖 What is MD-LD?</h3>
2935
- <p class="text-gray-600 dark:text-gray-400 text-sm mb-2">MD-LD extends Markdown with
2936
- semantic annotations using <code class="font-mono text-sm">{...}</code> blocks. Write natural
2937
- language
2938
- documents while embedding structured RDF data.</p>
2939
-
2940
- <div class="feature-grid">
2941
- <article class="feature-card">
2942
- <h4 class="feature-title">📝 Natural Syntax</h4>
2943
- <p class="feature-desc">Write semantic data in familiar Markdown</p>
2944
- </article>
2945
- <article class="feature-card">
2946
- <h4 class="feature-title">🔗 RDF Output</h4>
2947
- <p class="feature-desc">Parse to standard RDF triples</p>
2948
- </article>
2949
- <article class="feature-card">
2950
- <h4 class="feature-title">⚡ Zero Dependencies</h4>
2951
- <p class="feature-desc">Lightweight parser</p>
2952
- </article>
2953
- <article class="feature-card">
2954
- <h4 class="feature-title">🔄 Bidirectional</h4>
2955
- <p class="feature-desc">Parse & serialize round-trip</p>
2956
- </article>
2957
- </div>
2958
- </section>
2959
-
2960
-
2961
- <details class="w-full details max-w-4xl mx-auto" id="spec">
2962
- <summary class="font-bold text-xl cursor-pointer">
2963
- <span>MD-LD Specification</span>
2964
- <span style="flex:1"></span>
2965
- <span id="spec-status" class="stats"></span>
2966
- </summary>
2967
-
2968
- <div class="flex gap-2 mb-2 items-center"></div>
2969
- <article id="spec-content" class="max-h-96 overflow-y-scroll rounded p-4 ">
2970
- <p class="text-center text-gray-600 dark:text-gray-400 p-8">Loading specification...</p>
2971
- </article>
2972
- </details>
2973
-
2974
- <details class="details mx-auto w-full" id="tests">
2975
- <summary class="p-4 text-xl font-bold cursor-pointer">
2976
- <span>Test Suite</span>
2977
- <span style="flex:1"></span>
2978
- <span id="test-status" class="stats"></span>
2979
- </summary>
2980
- <div class="p-2">
2981
- <div class="flex gap-2 m-2 items-center">
2982
- <button onclick="runAllTests()" class="button primary">▶ Run Tests</button>
2983
- <button onclick="clearTests()" class="button">🗑️ Clear</button>
2984
- </div>
2985
- <div id="test-progress"
2986
- class="h-1 bg-gray-600 dark:bg-gray-500 rounded-sm overflow-hidden mb-2 hidden">
2987
- <progress id="test-progress-bar" class="h-full bg-green-600 transition-all duration-300"
2988
- role="progressbar" aria-label="Test progress"></progress>
2989
- </div>
2990
- <div id="test-stats" class="test-grid hidden">
2991
- <article class="stat-card">
2992
- <div id="passed-count" class="stat-number text-green-600 dark:text-green-400">0</div>
2993
- <div class="stat-label">Passed</div>
2994
- </article>
2995
- <article class="stat-card">
2996
- <div id="failed-count" class="stat-number text-red-600 dark:text-red-400">0</div>
2997
- <div class="stat-label">Failed</div>
2998
- </article>
2999
- <article class="stat-card">
3000
- <div id="total-count" class="stat-number text-blue-600 dark:text-blue-400">0</div>
3001
- <div class="stat-label">Total</div>
3002
- </article>
3003
- <article class="stat-card">
3004
- <div id="duration" class="stat-number">0ms</div>
3005
- <div class="stat-label">Duration</div>
3006
- </article>
3007
- </div>
3008
- <div id="test-list" class="max-h-80 overflow-y-auto">
3009
- <p class="text-center text-gray-600 dark:text-gray-400 p-4">Tests will run automatically on page
3010
- load...</p>
3011
- </div>
3012
- </div>
3013
- </details>
3014
- </section>
3015
- </main>
3016
-
3017
-
3018
-
3019
-
3020
-
3021
- </body>
3022
-
3023
- </html>