diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/converter/assets/CustomJsonLdSerializer-eGWsaUBU.js b/converter/assets/CustomJsonLdSerializer-eGWsaUBU.js new file mode 100644 index 0000000..c591105 --- /dev/null +++ b/converter/assets/CustomJsonLdSerializer-eGWsaUBU.js @@ -0,0 +1 @@ +import{S as u}from"./index-BOvYCoiN.js";import{a as l}from"./index-DtgbetCt.js";class h{constructor(e){this.stream=e,this.array=[]}push(e){this.array.push(e)}end(){this.stream.push(this.array),this.stream.push(null)}}class o{constructor(e){this.stream=e,this.first=!0,this.stream.push("[")}push(e){this.first?this.first=!1:this.stream.push(","),this.stream.push(JSON.stringify(e))}end(){this.stream.push("]"),this.stream.push(null)}}class r extends l.Readable{constructor(e,{encoding:n="object"}={}){if(super({objectMode:!0,read:()=>{}}),n==="object"&&(this.encoder=new h(this)),n==="string"&&(this.encoder=new o(this)),!this.encoder)throw new Error(`unknown encoding: ${n}`);e.on("data",t=>{const s={};let a=s;t.graph.termType!=="DefaultGraph"&&(s["@id"]=t.graph.value,s["@graph"]={},a=s["@graph"]),a["@id"]=r.subjectValue(t.subject),t.predicate.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"?a["@type"]=r.subjectValue(t.object):a[t.predicate.value]=r.objectValue(t.object),this.encoder.push(s)}),e.on("end",()=>this.encoder.end()),e.on("error",t=>this.emit("error",t))}static subjectValue(e){return e.termType==="BlankNode"?"_:"+e.value:e.value}static objectValue(e){return e.termType==="NamedNode"?{"@id":e.value}:e.termType==="BlankNode"?{"@id":"_:"+e.value}:e.language?{"@language":e.language,"@value":e.value}:e.datatype&&e.datatype.value!=="http://www.w3.org/2001/XMLSchema#string"?{"@type":e.datatype.value,"@value":e.value}:e.value}}class p extends u{constructor(e){super(r,e)}}class f extends p{constructor({...e}={}){super({encoding:"string",...e})}}export{f as default}; diff --git a/converter/assets/CustomRdfXmlParser-lwfOQbte.js b/converter/assets/CustomRdfXmlParser-lwfOQbte.js new file mode 100644 index 0000000..c7c0fcc --- /dev/null +++ b/converter/assets/CustomRdfXmlParser-lwfOQbte.js @@ -0,0 +1,27 @@ +import{c as N,a as Kt}from"./index-DtgbetCt.js";import{r as Yt,a as Zt}from"./index-70bBVy50.js";var Nt={},v={},P={},gt={};(function(r){/** + * Character classes and associated utilities for the 5th edition of XML 1.0. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR=` +\r -퟿-�𐀀-􏿿`,r.S=` \r +`,r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u");var t=9,e=10,i=13,a=32;r.S_LIST=[a,e,i,t];function n(h){return h>=a&&h<=55295||h===e||h===i||h===t||h>=57344&&h<=65533||h>=65536&&h<=1114111}r.isChar=n;function o(h){return h===a||h===e||h===i||h===t}r.isS=o;function l(h){return h>=65&&h<=90||h>=97&&h<=122||h===58||h===95||h===8204||h===8205||h>=192&&h<=214||h>=216&&h<=246||h>=248&&h<=767||h>=880&&h<=893||h>=895&&h<=8191||h>=8304&&h<=8591||h>=11264&&h<=12271||h>=12289&&h<=55295||h>=63744&&h<=64975||h>=65008&&h<=65533||h>=65536&&h<=983039}r.isNameStartChar=l;function u(h){return l(h)||h>=48&&h<=57||h===45||h===46||h===183||h>=768&&h<=879||h>=8255&&h<=8256}r.isNameChar=u})(gt);var At={};(function(r){/** + * Character classes and associated utilities for the 2nd edition of XML 1.1. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR="-퟿-�𐀀-􏿿",r.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",r.S=` \r +`,r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.RESTRICTED_CHAR_RE=new RegExp("^["+r.RESTRICTED_CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u");var t=9,e=10,i=13,a=32;r.S_LIST=[a,e,i,t];function n(s){return s>=1&&s<=55295||s>=57344&&s<=65533||s>=65536&&s<=1114111}r.isChar=n;function o(s){return s>=1&&s<=8||s===11||s===12||s>=14&&s<=31||s>=127&&s<=132||s>=134&&s<=159}r.isRestrictedChar=o;function l(s){return s===9||s===10||s===13||s>31&&s<127||s===133||s>159&&s<=55295||s>=57344&&s<=65533||s>=65536&&s<=1114111}r.isCharAndNotRestricted=l;function u(s){return s===a||s===e||s===i||s===t}r.isS=u;function h(s){return s>=65&&s<=90||s>=97&&s<=122||s===58||s===95||s===8204||s===8205||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=880&&s<=893||s>=895&&s<=8191||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533||s>=65536&&s<=983039}r.isNameStartChar=h;function p(s){return h(s)||s>=48&&s<=57||s===45||s===46||s===183||s>=768&&s<=879||s>=8255&&s<=8256}r.isNameChar=p})(At);var Tt={};(function(r){/** + * Character class utilities for XML NS 1.0 edition 3. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NC_NAME_CHAR="-"+r.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.NC_NAME_START_CHAR_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]$","u"),r.NC_NAME_CHAR_RE=new RegExp("^["+r.NC_NAME_CHAR+"]$","u"),r.NC_NAME_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]["+r.NC_NAME_CHAR+"]*$","u");function t(i){return i>=65&&i<=90||i===95||i>=97&&i<=122||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}r.isNCNameStartChar=t;function e(i){return t(i)||i===45||i===46||i>=48&&i<=57||i===183||i>=768&&i<=879||i>=8255&&i<=8256}r.isNCNameChar=e})(Tt);Object.defineProperty(P,"__esModule",{value:!0});P.SaxesParser=P.EVENTS=void 0;const y=gt,Jt=At,nt=Tt;var D=y.isS,te=y.isChar,$=y.isNameStartChar,ht=y.isNameChar,Rt=y.S_LIST,ee=y.NAME_RE,ie=Jt.isChar,se=nt.isNCNameStartChar,ae=nt.isNCNameChar,re=nt.NC_NAME_RE;const U="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",ne={__proto__:null,xml:U,xmlns:I},oe={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},F=-1,_=-2,lt=0,he=1,G=2,le=3,T=4,ue=5,ce=6,de=7,Q=8,fe=9,Fe=10,pe=11,me=12,E=13,k=14,z=15,xe=16,K=17,Ee=18,De=19,Y=20,Ce=21,_e=22,be=23,ut=24,Z=25,B=26,ct=27,Se=28,Ne=29,dt=30,ge=31,Ae=32,g=33,Te=34,J=35,M=36,tt=37,Re=38,ft=39,Ft=40,we=41,pt=42,Ie=43,ve=44,et=9,C=10,it=13,mt=32,xt=33,wt=34,O=38,It=39,H=45,j=47,Pe=59,S=60,R=61,m=62,x=63,vt=91,w=93,Et=133,Dt=8232,V=r=>r===wt||r===It,Pt=[wt,It],ye=[...Pt,vt,m],$e=[...Pt,S,w],Me=[R,x,...Rt],Oe=[...Rt,m,O,S];function rt(r,t,e){switch(t){case"xml":e!==U&&r.fail(`xml prefix must be bound to ${U}.`);break;case"xmlns":e!==I&&r.fail(`xmlns prefix must be bound to ${I}.`);break}switch(e){case I:r.fail(t===""?`the default namespace may not be set to ${e}.`:`may not assign a prefix (even "xmlns") to the URI ${I}.`);break;case U:switch(t){case"xml":break;case"":r.fail(`the default namespace may not be set to ${e}.`);break;default:r.fail("may not assign the xml namespace to another prefix.")}break}}function Le(r,t){for(const e of Object.keys(t))rt(r,e,t[e])}const ke=r=>re.test(r),Be=r=>ee.test(r),A=0,Ct=1,st=2;P.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const _t={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class He{get closed(){return this._closed}constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,e){this.nameStartCheck=se,this.nameCheck=ae,this.isName=ke,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},ne);const i=this.opt.additionalNamespaces;i!=null&&(Le(this,i),Object.assign(this.ns,i))}else this.nameStartCheck=$,this.nameCheck=ht,this.isName=Be,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=A,this.attribList=[];const{fragmentOpt:e}=this;this.state=e?E:lt,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=e,this.xmlDeclPossible=!e,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:i}=this.opt;if(i===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");i="1.0"}this.setXMLVersion(i),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(oe),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[_t[t]]=e}off(t){this[_t[t]]=void 0}makeError(t){var e;let i=(e=this.fileName)!==null&&e!==void 0?e:"";return this.trackPosition&&(i.length>0&&(i+=":"),i+=`${this.line}:${this.column}`),i.length>0&&(i+=": "),new Error(i+t)}fail(t){const e=this.makeError(t),i=this.errorHandler;if(i===void 0)throw e;return i(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;t===null?(e=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let i=t.length;const a=t.charCodeAt(i-1);!e&&(a===it||a>=55296&&a<=56319)&&(this.carriedFromPrevious=t[i-1],i--,t=t.slice(0,i));const{stateTable:n}=this;for(this.chunk=t,this.i=0;this.i=t.length)return F;const i=t.charCodeAt(e);if(this.column++,i<55296){if(i>=mt||i===et)return i;switch(i){case C:return this.line++,this.column=0,this.positionAtNewLine=this.position,C;case it:return t.charCodeAt(e+1)===C&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,_;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;const a=65536+(i-55296)*1024+(t.charCodeAt(e+1)-56320);return this.i=e+2,a>1114111&&this.fail("disallowed character."),a}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return F;const i=t.charCodeAt(e);if(this.column++,i<55296){if(i>31&&i<127||i>159&&i!==Dt||i===et)return i;switch(i){case C:return this.line++,this.column=0,this.positionAtNewLine=this.position,C;case it:{const n=t.charCodeAt(e+1);(n===C||n===Et)&&(this.i=e+2)}case Et:case Dt:return this.line++,this.column=0,this.positionAtNewLine=this.position,_;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;const a=65536+(i-55296)*1024+(t.charCodeAt(e+1)-56320);return this.i=e+2,a>1114111&&this.fail("disallowed character."),a}getCodeNorm(){const t=this.getCode();return t===_?C:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:i}=this;for(;;){const a=this.getCode(),n=a===_,o=n?C:a;if(o===F||t.includes(o))return this.text+=i.slice(e,this.prevI),o;n&&(this.text+=`${i.slice(e,this.prevI)} +`,e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:i}=this;for(;;){let a=this.getCode();switch(a){case _:this.text+=`${i.slice(e,this.prevI)} +`,e=this.i,a=C;break;case F:return this.text+=i.slice(e),!1}if(a===t)return this.text+=i.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const i=this.getCode();if(i===F)return this.name+=t.slice(e),F;if(!ht(i))return this.name+=t.slice(e,this.prevI),i===_?C:i}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===F||!D(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,t==="1.0"?(this.isChar=te,this.getCode=this.getCode10):(this.isChar=ie,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=he}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case S:if(this.state=z,this.text.length!==0)throw new Error("no-empty text at start");break;case F:break;default:this.unget(),this.state=E,this.xmlDeclPossible=!1}}sDoctype(){var t;const e=this.captureTo(ye);switch(e){case m:{(t=this.doctypeHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=E,this.doctype=!0;break}case F:break;default:this.text+=String.fromCodePoint(e),e===vt?this.state=T:V(e)&&(this.state=le,this.q=e)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=G)}sDTD(){const t=this.captureTo($e);t!==F&&(this.text+=String.fromCodePoint(t),t===w?this.state=G:t===S?this.state=ce:V(t)&&(this.state=ue,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=T,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case xt:this.state=de,this.openWakaBang="";break;case x:this.state=pe;break;default:this.state=T}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,e!=="-"&&(this.state=e==="--"?Q:T,this.openWakaBang="")}sDTDComment(){this.captureToChar(H)&&(this.text+="-",this.state=fe)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=t===H?Fe:Q}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===m?this.state=T:(this.fail("malformed comment."),this.state=Q)}sDTDPI(){this.captureToChar(x)&&(this.text+="?",this.state=me)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===m&&(this.state=T)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case _:this.entity+=`${e.slice(t,this.prevI)} +`,t=this.i;break;case Pe:{const{entityReturnState:i}=this,a=this.entity+e.slice(t,this.prevI);this.state=i;let n;a===""?(this.fail("empty entity name."),n="&;"):(n=this.parseEntity(a),this.entity=""),(i!==E||this.textHandler!==void 0)&&(this.text+=n);break t}case F:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if($(t))this.state=Te,this.unget(),this.xmlDeclPossible=!1;else switch(t){case j:this.state=Ie,this.xmlDeclPossible=!1;break;case xt:this.state=xe,this.openWakaBang="",this.xmlDeclPossible=!1;break;case x:this.state=be;break;default:this.fail("disallowed character in tag name"),this.state=E,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=Y,this.openWakaBang="";break;case"--":this.state=K,this.openWakaBang="";break;case"DOCTYPE":this.state=G,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(H)&&(this.state=Ee)}sCommentEnding(){var t;const e=this.getCodeNorm();e===H?(this.state=De,(t=this.commentHandler)===null||t===void 0||t.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(e)}`,this.state=K)}sCommentEnded(){const t=this.getCodeNorm();t!==m?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=K):this.state=E}sCData(){this.captureToChar(w)&&(this.state=Ce)}sCDataEnding(){const t=this.getCodeNorm();t===w?this.state=_e:(this.text+=`]${String.fromCodePoint(t)}`,this.state=Y)}sCDataEnding2(){var t;const e=this.getCodeNorm();switch(e){case m:{(t=this.cdataHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=E;break}case w:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(e)}`,this.state=Y}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=ut):t===x||D(t)?(this.fail("processing instruction without a target."),this.state=t===x?B:Z):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=ut)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const i=this.getCodeNorm();if(i===F){this.piTarget+=t.slice(e);return}if(!this.nameCheck(i)){this.piTarget+=t.slice(e,this.prevI);const a=i===x;a||D(i)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=a?g:ct):this.state=a?B:Z:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(i));break}}}sPIBody(){if(this.text.length===0){const t=this.getCodeNorm();t===x?this.state=B:D(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(x)&&(this.state=B)}sPIEnding(){var t;const e=this.getCodeNorm();if(e===m){const{piTarget:i}=this;i.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(t=this.piHandler)===null||t===void 0||t.call(this,{target:i,body:this.text}),this.piTarget=this.text="",this.state=E}else e===x?this.text+="?":(this.text+=`?${String.fromCodePoint(e)}`,this.state=Z);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();if(t===x){this.state=g;return}t!==F&&(this.state=Se,this.name=String.fromCodePoint(t))}sXMLDeclName(){const t=this.captureTo(Me);if(t===x){this.state=g,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(D(t)||t===R){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=t===R?dt:Ne}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===x){this.state=g,this.fail("XML declaration is incomplete.");return}D(t)||(t!==R&&this.fail("value required."),this.state=dt)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===x){this.state=g,this.fail("XML declaration is incomplete.");return}D(t)||(V(t)?this.q=t:(this.fail("value must be quoted."),this.q=mt),this.state=ge)}sXMLDeclValue(){const t=this.captureTo([this.q,x]);if(t===x){this.state=g,this.text="",this.fail("XML declaration is incomplete.");return}if(t===F)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const i=e;this.xmlDecl.version=i,/^1\.[0-9]+$/.test(i)?this.opt.forceXMLVersion||this.setXMLVersion(i):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":e!=="yes"&&e!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e;break}this.name="",this.state=Ae}sXMLDeclSeparator(){const t=this.getCodeNorm();if(t===x){this.state=g;return}D(t)||(this.fail("whitespace required."),this.unget()),this.state=ct}sXMLDeclEnding(){var t;this.getCodeNorm()===m?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(t=this.xmldeclHandler)===null||t===void 0||t.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=E):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var t;const e=this.captureNameChars();if(e===F)return;const i=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=i.ns=Object.create(null)),(t=this.openTagStartHandler)===null||t===void 0||t.call(this,i),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),e){case m:this.openTag();break;case j:this.state=J;break;default:D(e)||this.fail("disallowed character in tag name."),this.state=M}}sOpenTagSlash(){this.getCode()===m?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=M)}sAttrib(){const t=this.skipSpaces();t!==F&&($(t)?(this.unget(),this.state=tt):t===m?this.openTag():t===j?this.state=J:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===R?this.state=ft:D(t)?this.state=Re:t===m?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==F&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case F:return;case R:this.state=ft;break;default:this.fail("attribute without value."),this.text="",this.name="",t===m?this.openTag():$(t)?(this.unget(),this.state=tt):(this.fail("disallowed character in attribute name."),this.state=M)}}sAttribValue(){const t=this.getCodeNorm();V(t)?(this.q=t,this.state=Ft):D(t)||(this.fail("unquoted attribute value."),this.state=pt,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i}=this;for(;;)switch(this.getCode()){case t:this.pushAttrib(this.name,this.text+e.slice(i,this.prevI)),this.name=this.text="",this.q=null,this.state=we;return;case O:this.text+=e.slice(i,this.prevI),this.state=k,this.entityReturnState=Ft;return;case C:case _:case et:this.text+=`${e.slice(i,this.prevI)} `,i=this.i;break;case S:this.text+=e.slice(i,this.prevI),this.fail("disallowed character.");return;case F:this.text+=e.slice(i);return}}sAttribValueClosed(){const t=this.getCodeNorm();D(t)?this.state=M:t===m?this.openTag():t===j?this.state=J:$(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=tt):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(Oe);switch(t){case O:this.state=k,this.entityReturnState=pt;break;case S:this.fail("disallowed character.");break;case F:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===m?this.openTag():this.state=M}}sCloseTag(){const t=this.captureNameChars();t===m?this.closeTag():D(t)?this.state=ve:t!==F&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case m:this.closeTag();break;case F:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:i,textHandler:a}=this;t:for(;;)switch(this.getCode()){case S:{if(this.state=z,a!==void 0){const{text:n}=this,o=i.slice(t,this.prevI);n.length!==0?(a(n+o),this.text=""):o.length!==0&&a(o)}e=A;break t}case O:this.state=k,this.entityReturnState=E,a!==void 0&&(this.text+=i.slice(t,this.prevI)),e=A;break t;case w:switch(e){case A:e=Ct;break;case Ct:e=st;break;case st:break;default:throw new Error("impossible state")}break;case m:e===st&&this.fail('the string "]]>" is disallowed in char data.'),e=A;break;case _:a!==void 0&&(this.text+=`${i.slice(t,this.prevI)} +`),t=this.i,e=A;break;case F:a!==void 0&&(this.text+=i.slice(t));break t;default:e=A}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:i}=this;let a=!1;t:for(;;){const n=this.getCode();switch(n){case S:{if(this.state=z,i!==void 0){const{text:o}=this,l=e.slice(t,this.prevI);o.length!==0?(i(o+l),this.text=""):l.length!==0&&i(l)}break t}case O:this.state=k,this.entityReturnState=E,i!==void 0&&(this.text+=e.slice(t,this.prevI)),a=!0;break t;case _:i!==void 0&&(this.text+=`${e.slice(t,this.prevI)} +`),t=this.i;break;case F:i!==void 0&&(this.text+=e.slice(t));break t;default:D(n)||(a=!0)}}a&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,e){var i;const{prefix:a,local:n}=this.qname(t),o={name:t,prefix:a,local:n,value:e};if(this.attribList.push(o),(i=this.attributeHandler)===null||i===void 0||i.call(this,o),a==="xmlns"){const l=e.trim();this.currentXMLVersion==="1.0"&&l===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[n]=l,rt(this,n,l)}else if(t==="xmlns"){const l=e.trim();this.topNS[""]=l,rt(this,"",l)}}pushAttribPlain(t,e){var i;const a={name:t,value:e};this.attribList.push(a),(i=this.attributeHandler)===null||i===void 0||i.call(this,a)}end(){var t,e;this.sawRoot||this.fail("document must contain a root element.");const{tags:i}=this;for(;i.length>0;){const n=i.pop();this.fail(`unclosed tag: ${n.name}`)}this.state!==lt&&this.state!==E&&this.fail("unexpected end.");const{text:a}=this;return a.length!==0&&((t=this.textHandler)===null||t===void 0||t.call(this,a),this.text=""),this._closed=!0,(e=this.endHandler)===null||e===void 0||e.call(this),this._init(),this}resolve(t){var e,i;let a=this.topNS[t];if(a!==void 0)return a;const{tags:n}=this;for(let o=n.length-1;o>=0;o--)if(a=n[o].ns[t],a!==void 0)return a;return a=this.ns[t],a!==void 0?a:(i=(e=this.opt).resolvePrefix)===null||i===void 0?void 0:i.call(e,t)}qname(t){const e=t.indexOf(":");if(e===-1)return{prefix:"",local:t};const i=t.slice(e+1),a=t.slice(0,e);return(a===""||i===""||i.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:a,local:i}}processAttribsNS(){var t;const{attribList:e}=this,i=this.tag;{const{prefix:o,local:l}=this.qname(i.name);i.prefix=o,i.local=l;const u=i.uri=(t=this.resolve(o))!==null&&t!==void 0?t:"";o!==""&&(o==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),u===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(o)}.`),i.uri=o))}if(e.length===0)return;const{attributes:a}=i,n=new Set;for(const o of e){const{name:l,prefix:u,local:h}=o;let p,s;u===""?(p=l==="xmlns"?I:"",s=l):(p=this.resolve(u),p===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(u)}.`),p=u),s=`{${p}}${h}`),n.has(s)&&this.fail(`duplicate attribute: ${s}.`),n.add(s),o.uri=p,a[l]=o}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:i,value:a}of t)e[i]!==void 0&&this.fail(`duplicate attribute: ${i}.`),e[i]=a;this.attribList=[]}openTag(){var t;this.processAttribs();const{tags:e}=this,i=this.tag;i.isSelfClosing=!1,(t=this.openTagHandler)===null||t===void 0||t.call(this,i),e.push(i),this.state=E,this.name=""}openSelfClosingTag(){var t,e,i;this.processAttribs();const{tags:a}=this,n=this.tag;n.isSelfClosing=!0,(t=this.openTagHandler)===null||t===void 0||t.call(this,n),(e=this.closeTagHandler)===null||e===void 0||e.call(this,n),(this.tag=(i=a[a.length-1])!==null&&i!==void 0?i:null)===null&&(this.closedRoot=!0),this.state=E,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=E,this.name="",e===""){this.fail("weird empty close tag."),this.text+="";return}const i=this.closeTagHandler;let a=t.length;for(;a-- >0;){const n=this.tag=t.pop();if(this.topNS=n.ns,i==null||i(n),n.name===e)break;this.fail("unexpected close tag.")}a===0?this.closedRoot=!0:a<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=``)}parseEntity(t){if(t[0]!=="#"){const i=this.ENTITIES[t];return i!==void 0?i:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return t[1]==="x"&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}P.SaxesParser=He;var X={};Object.defineProperty(X,"__esModule",{value:!0});X.ParseError=void 0;class je extends Error{constructor(t,e){const i=t.saxParser;super(t.trackPosition?`Line ${i.line} column ${i.column+1}: ${e}`:e)}}X.ParseError=je;var yt={},$t={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateIri=r.IriValidationStrategy=void 0;function t(){const l="[!$&'()*+,;=]",u="%[a-fA-F0-9]{2}",h="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",p=`${h}\\.${h}\\.${h}\\.${h}`,s="[a-fA-F0-9]{1,4}",f=`(${s}:${s}|${p})`,d=`((${s}:){6}${f}|::(${s}:){5}${f}|(${s})?::(${s}:){4}${f}|((${s}:){0,1}${s})?::(${s}:){3}${f}|((${s}:){0,2}${s})?::(${s}:){2}${f}|((${s}:){0,3}${s})?::${s}:${f}|((${s}:){0,4}${s})?::${f}|((${s}:){0,5}${s})?::${s}|((${s}:){0,6}${s})?::)`,Mt=`v[a-fA-F0-9]+\\.(${l}|${l}|":)+`,Ot=`\\[(${d}|${Mt})\\]`,Lt="[0-9]*",kt="[a-zA-Z][a-zA-Z0-9+\\-.]*",Bt="[-󰀀-󿿽􀀀-􏿽]",W="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",L=`(${W}|${u}|${l}|[:@])*`,Ht=`(${L}|[\\/?])*`,jt=`(${L}|${Bt}|[\\/?])*`,ot=`(${L})+`,q=`(${L})*`,Vt="",Ut=`${ot}(\\/${q})*`,Xt=`\\/(${ot}(\\/${q})*)?`,Wt=`(\\/${q})*`,qt=`(${W}|${u}|${l})*`,Gt=`(${Ot}|${p}|${qt})`,Qt=`(\\/\\/${`(${`(${W}|${u}|${l}|:)*`}@)?${Gt}(:${Lt})?`}${Wt}|${Xt}|${Ut}|${Vt})`,zt=`^${kt}:${Qt}(\\?${jt})?(#${Ht})?$`;return new RegExp(zt,"u")}const e=t(),i=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var a;(function(o){o.Strict="strict",o.Pragmatic="pragmatic",o.None="none"})(a=r.IriValidationStrategy||(r.IriValidationStrategy={}));function n(o,l=a.Strict){switch(l){case a.Strict:return e.test(o)?void 0:new Error(`Invalid IRI according to RFC 3987: '${o}'`);case a.Pragmatic:return i.test(o)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${o}'`);case a.None:return;default:return new Error(`Not supported validation strategy "${l}"`)}}r.validateIri=n})($t);(function(r){var t=N&&N.__createBinding||(Object.create?function(i,a,n,o){o===void 0&&(o=n);var l=Object.getOwnPropertyDescriptor(a,n);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[n]}}),Object.defineProperty(i,o,l)}:function(i,a,n,o){o===void 0&&(o=n),i[o]=a[n]}),e=N&&N.__exportStar||function(i,a){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(a,n)&&t(a,i,n)};Object.defineProperty(r,"__esModule",{value:!0}),e($t,r)})(yt);Object.defineProperty(v,"__esModule",{value:!0});v.ParseType=v.RdfXmlParser=void 0;const bt=Yt,Ve=P,St=Kt,Ue=X,Xe=Zt,at=yt;class c extends St.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new Xe.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?at.IriValidationStrategy.Pragmatic:at.IriValidationStrategy.None),this.saxParser=new Ve.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(t){const e=new St.PassThrough({readableObjectMode:!0});t.on("error",a=>i.emit("error",a)),t.on("data",a=>e.push(a)),t.on("end",()=>e.push(null));const i=e.pipe(new c(this.options));return i}_transform(t,e,i){try{this.saxParser.write(t)}catch(a){return i(a)}i()}newParseError(t){return new Ue.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode((0,bt.resolve)(t,e.baseIRI))}uriToNamedNode(t){const e=(0,at.validateIri)(t,this.iriValidationStrategy);if(e instanceof Error)throw this.newParseError(e.message);return this.dataFactory.namedNode(t)}validateNcname(t){if(!c.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxParser.on("error",t=>this.emit("error",t)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let i=b.RESOURCE;if(e&&(e.hadChildren=!0,i=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let o="";for(const p in t.attributes)o+=` ${p}="${t.attributes[p].value}"`;const u=`<${`${n}${o}`}>`;e.childrenStringTags.push(u);const h={childrenStringTags:e.childrenStringTags};h.childrenStringEmitClosingTag=``,this.activeTagStack.push(h);return}const a={};e?(a.language=e.language,a.baseIRI=e.baseIRI):a.baseIRI=this.baseIRI,this.activeTagStack.push(a),i===b.RESOURCE?this.onTagResource(t,a,e,!e):this.onTagProperty(t,a,e)}onTagResource(t,e,i,a){e.childrenParseType=b.PROPERTY;let n=!0;if(t.uri===c.RDF){if(!a&&c.FORBIDDEN_NODE_ELEMENTS.indexOf(t.local)>=0)throw this.newParseError(`Illegal node element name: ${t.local}`);switch(t.local){case"RDF":e.childrenParseType=b.RESOURCE;case"Description":n=!1}}const o=[],l=[];let u=null,h=!1,p=!1,s=null;for(const f in t.attributes){const d=t.attributes[f];if(i&&d.uri===c.RDF)switch(d.local){case"about":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);u=d.value;continue;case"ID":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);this.validateNcname(d.value),u="#"+d.value,h=!0;continue;case"nodeID":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);this.validateNcname(d.value),u=d.value,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":s=d.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(d.uri===c.XML){if(d.local==="lang"){e.language=d.value===""?null:d.value.toLowerCase();continue}else if(d.local==="base"){e.baseIRI=(0,bt.resolve)(d.value,e.baseIRI);continue}}d.prefix!=="xml"&&d.prefix!=="xmlns"&&(d.prefix!==""||d.local!=="xmlns")&&d.uri&&(o.push(this.uriToNamedNode(d.uri+d.local)),l.push(d.value))}if(u!==null&&(e.subject=p?this.dataFactory.blankNode(u):this.valueToUri(u,e),h&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),n){const f=this.uriToNamedNode(t.uri+t.local);this.emitTriple(e.subject,this.dataFactory.namedNode(c.RDF+"type"),f,i?i.reifiedStatementId:null)}if(i){if(i.predicate)if(i.childrenCollectionSubject){const f=this.dataFactory.blankNode();this.emitTriple(i.childrenCollectionSubject,i.childrenCollectionPredicate,f,i.reifiedStatementId),this.emitTriple(f,this.dataFactory.namedNode(c.RDF+"first"),e.subject,e.reifiedStatementId),i.childrenCollectionSubject=f,i.childrenCollectionPredicate=this.dataFactory.namedNode(c.RDF+"rest")}else{this.emitTriple(i.subject,i.predicate,e.subject,i.reifiedStatementId);for(let f=0;f=0)throw this.newParseError(`Illegal property element name: ${t.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let a=!1,n=!1,o=null,l=!0;const u=[],h=[];for(const p in t.attributes){const s=t.attributes[p];if(s.uri===c.RDF)switch(s.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${s.value}) and rdf:nodeID (${o}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${s.value})`);e.hadChildren=!0,o=s.value,l=!1;continue;case"datatype":if(n)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${s.value}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${s.value})`);e.datatype=this.valueToUri(s.value,e);continue;case"nodeID":if(n)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${s.value}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${s.value}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${s.value})`);this.validateNcname(s.value),e.hadChildren=!0,o=s.value,l=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(n)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if(s.value==="Resource"){a=!0,e.childrenParseType=b.PROPERTY;const f=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,f,e.reifiedStatementId),e.subject=f,e.predicate=null}else s.value==="Collection"?(a=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,l=!1):s.value==="Literal"&&(a=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(s.value),e.reifiedStatementId=this.valueToUri("#"+s.value,e),this.claimNodeId(e.reifiedStatementId);continue}else if(s.uri===c.XML&&s.local==="lang"){e.language=s.value===""?null:s.value.toLowerCase();continue}if(s.prefix!=="xml"&&s.prefix!=="xmlns"&&(s.prefix!==""||s.local!=="xmlns")&&s.uri){if(a||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${s.value}`);e.hadChildren=!0,n=!0,u.push(this.uriToNamedNode(s.uri+s.local)),h.push(this.dataFactory.literal(s.value,e.datatype||e.language))}}if(o!==null){const p=e.subject;e.subject=l?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(p,e.predicate,e.subject,e.reifiedStatementId);for(let s=0;s/g,(e,i,a)=>(this.saxParser.ENTITIES[i]=a,""))}}v.RdfXmlParser=c;c.MIME_TYPE="application/rdf+xml";c.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#";c.XML="http://www.w3.org/XML/1998/namespace";c.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"];c.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"];c.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u;var b;(function(r){r[r.RESOURCE=0]="RESOURCE",r[r.PROPERTY=1]="PROPERTY"})(b||(v.ParseType=b={}));(function(r){var t=N&&N.__createBinding||(Object.create?function(i,a,n,o){o===void 0&&(o=n);var l=Object.getOwnPropertyDescriptor(a,n);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[n]}}),Object.defineProperty(i,o,l)}:function(i,a,n,o){o===void 0&&(o=n),i[o]=a[n]}),e=N&&N.__exportStar||function(i,a){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(a,n)&&t(a,i,n)};Object.defineProperty(r,"__esModule",{value:!0}),e(v,r)})(Nt);class Ze extends Nt.RdfXmlParser{constructor({factory:t,...e}={}){super({...e,dataFactory:t})}}export{Ze as default}; diff --git a/converter/assets/browser-BwSN-dYO.js b/converter/assets/browser-BwSN-dYO.js new file mode 100644 index 0000000..596d467 --- /dev/null +++ b/converter/assets/browser-BwSN-dYO.js @@ -0,0 +1 @@ +var a={exports:{}};typeof Object.create=="function"?a.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:a.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var c=a.exports,s=i;function i(t,e){if(o("noDeprecation"))return t;var r=!1;function n(){if(!r){if(o("throwDeprecation"))throw new Error(e);o("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function o(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}export{s as b,c as i}; diff --git a/converter/assets/canonicalize-DMjjQ0zD.js b/converter/assets/canonicalize-DMjjQ0zD.js new file mode 100644 index 0000000..ee44283 --- /dev/null +++ b/converter/assets/canonicalize-DMjjQ0zD.js @@ -0,0 +1 @@ +var l=function(f){return n(f);function n(r){if(r===null||typeof r!="object"||r.toJSON!=null)return JSON.stringify(r);if(Array.isArray(r)&&r.length===0)return"[]";if(Array.isArray(r)&&r.length===1)return"["+n(r[0])+"]";if(Array.isArray(r))return"["+r.reduce((i,e,a)=>(i=a===1?n(i):i,i+","+n(e)))+"]";const u=Object.keys(r);return u.length===0?"{}":u.length===1?"{"+n(u[0])+":"+n(r[u[0]])+"}":"{"+u.sort().reduce((i,e,a)=>(i=a===1?n(i)+":"+n(r[i]):i,i+","+n(e)+":"+n(r[e])))+"}"}};export{l as c}; diff --git a/converter/assets/index-70bBVy50.js b/converter/assets/index-70bBVy50.js new file mode 100644 index 0000000..b2ce278 --- /dev/null +++ b/converter/assets/index-70bBVy50.js @@ -0,0 +1 @@ +import{c as _}from"./index-DtgbetCt.js";var P={},c={};Object.defineProperty(c,"__esModule",{value:!0});function S(t,e){e=e||"";const r=e.indexOf("#");if(r>0&&(e=e.substr(0,r)),!t.length){if(e.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);return e}if(t.startsWith("?")){const i=e.indexOf("?");return i>0&&(e=e.substr(0,i)),e+t}if(t.startsWith("#"))return e+t;if(!e.length){const i=t.indexOf(":");if(i<0)throw new Error(`Found invalid relative IRI '${t}' for a missing baseIRI`);return d(t,i)}const a=t.indexOf(":");if(a>=0)return d(t,a);const u=e.indexOf(":");if(u<0)throw new Error(`Found invalid baseIRI '${e}' for value '${t}'`);const s=e.substr(0,u+1);if(t.indexOf("//")===0)return s+d(t,a);let n;if(e.indexOf("//",u)===u+1){if(n=e.indexOf("/",u+3),n<0)return e.length>u+3?e+"/"+d(t,a):s+d(t,a)}else if(n=e.indexOf("/",u+1),n<0)return s+d(t,a);if(t.indexOf("/")===0)return e.substr(0,n)+v(t);let f=e.substr(n);const T=f.lastIndexOf("/");return T>=0&&Ta.join("")).join("/")}c.removeDotSegments=v;function d(t,e){let r=e+1;e>=0?t[e+1]==="/"&&t[e+2]==="/"&&(r=e+3):t[0]==="/"&&t[1]==="/"&&(r=2);const a=t.indexOf("/",r);if(a<0)return t;const u=t.substr(0,a),s=t.substr(a);return u+v(s)}c.removeDotSegmentsOfPath=d;function O(t){return!t||t==="#"||t==="?"||t==="/"}(function(t){function e(r){for(var a in r)t.hasOwnProperty(a)||(t[a]=r[a])}Object.defineProperty(t,"__esModule",{value:!0}),e(c)})(P);var G={},h={};Object.defineProperty(h,"__esModule",{value:!0});h.BlankNode=void 0;class D{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}}h.BlankNode=D;var y={},m={};Object.defineProperty(m,"__esModule",{value:!0});m.DefaultGraph=void 0;class w{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}}m.DefaultGraph=w;w.INSTANCE=new w;var N={},l={};Object.defineProperty(l,"__esModule",{value:!0});l.NamedNode=void 0;class k{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}}l.NamedNode=k;Object.defineProperty(N,"__esModule",{value:!0});N.Literal=void 0;const j=l;class o{constructor(e,r){this.termType="Literal",this.value=e,typeof r=="string"?(this.language=r,this.datatype=o.RDF_LANGUAGE_STRING):r?(this.language="",this.datatype=r):(this.language="",this.datatype=o.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}N.Literal=o;o.RDF_LANGUAGE_STRING=new j.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");o.XSD_STRING=new j.NamedNode("http://www.w3.org/2001/XMLSchema#string");var p={};Object.defineProperty(p,"__esModule",{value:!0});p.Quad=void 0;class ${constructor(e,r,a,u){this.termType="Quad",this.value="",this.subject=e,this.predicate=r,this.object=a,this.graph=u}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}p.Quad=$;var b={};Object.defineProperty(b,"__esModule",{value:!0});b.Variable=void 0;class q{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}}b.Variable=q;Object.defineProperty(y,"__esModule",{value:!0});y.DataFactory=void 0;const B=h,C=m,g=N,F=l,L=p,x=b;let M=0;class Q{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${M++}_`}namedNode(e){return new F.NamedNode(e)}blankNode(e){return new B.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,r){return new g.Literal(e,r)}variable(e){return new x.Variable(e)}defaultGraph(){return C.DefaultGraph.INSTANCE}quad(e,r,a,u){return new L.Quad(e,r,a,u||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(g.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}y.DataFactory=Q;(function(t){var e=_&&_.__createBinding||(Object.create?function(a,u,s,n){n===void 0&&(n=s),Object.defineProperty(a,n,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,n){n===void 0&&(n=s),a[n]=u[s]}),r=_&&_.__exportStar||function(a,u){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(u,s)&&e(u,a,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(h,t),r(y,t),r(m,t),r(N,t),r(l,t),r(p,t),r(b,t)})(G);export{G as a,P as r}; diff --git a/converter/assets/index-BOvYCoiN.js b/converter/assets/index-BOvYCoiN.js new file mode 100644 index 0000000..4a20221 --- /dev/null +++ b/converter/assets/index-BOvYCoiN.js @@ -0,0 +1 @@ +class i{constructor(o,r){this.Impl=o,this.options=r}import(o,r){const t=new this.Impl(o,{...this.options,...r});return o.on("end",()=>{t.readable||t.emit("end")}),o.on("error",e=>{t.emit("error",e)}),t}}export{i as S}; diff --git a/converter/assets/index-BU-jGoQy.js b/converter/assets/index-BU-jGoQy.js new file mode 100644 index 0000000..d130e0d --- /dev/null +++ b/converter/assets/index-BU-jGoQy.js @@ -0,0 +1,3 @@ +import{S as $t}from"./index-BOvYCoiN.js";import{b as kt,c as M,a as Ot,f as Mt}from"./index-DtgbetCt.js";import{r as Jt}from"./readable-BmS1kvD9.js";import{r as Me,a as Xt}from"./index-70bBVy50.js";import{c as xt}from"./canonicalize-DMjjQ0zD.js";var mt={},re={},{Buffer:X}=kt,S={},St=S.LEFT_BRACE=1,we=S.RIGHT_BRACE=2,Tt=S.LEFT_BRACKET=3,$e=S.RIGHT_BRACKET=4,Ie=S.COLON=5,_e=S.COMMA=6,Nt=S.TRUE=7,At=S.FALSE=8,vt=S.NULL=9,be=S.STRING=10,Dt=S.NUMBER=11,Y=S.START=17,Lt=S.STOP=18,We=S.TRUE1=33,Ye=S.TRUE2=34,qe=S.TRUE3=35,ze=S.FALSE1=49,Qe=S.FALSE2=50,Ze=S.FALSE3=51,et=S.FALSE4=52,tt=S.NULL1=65,rt=S.NULL2=66,nt=S.NULL3=67,it=S.NUMBER1=81,He=S.NUMBER3=83,H=S.STRING1=97,at=S.STRING2=98,st=S.STRING3=99,Wt=S.STRING4=100,Yt=S.STRING5=101,ot=S.STRING6=102,Z=S.VALUE=113,Ke=S.KEY=114,ue=S.OBJECT=129,he=S.ARRAY=130,qt=92,zt=47,Qt=8,Zt=12,er=10,tr=13,rr=9,Je=64*1024;function Ee(l){return X.alloc?X.alloc(l):new X(l)}function W(){this.tState=Y,this.value=void 0,this.string=void 0,this.stringBuffer=Ee(Je),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=Z,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:Ee(2),3:Ee(3),4:Ee(4)},this.offset=-1}W.toknam=function(l){for(var t=Object.keys(S),r=0,E=t.length;r=Je&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=l};F.appendStringBuf=function(l,t,r){var E=l.length;typeof t=="number"&&(typeof r=="number"?r<0?E=l.length-t+r:E=r-t:E=l.length-t),E<0&&(E=0),this.stringBufferOffset+E>Je&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),l.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=E};F.write=function(l){typeof l=="string"&&(l=new X(l));for(var t,r=0,E=l.length;r=48&&t<64)this.string=String.fromCharCode(t),this.tState=He;else if(!(t===32||t===9||t===10||t===13))return this.charError(l,r)}else if(this.tState===H)if(t=l[r],this.bytes_remaining>0){for(var f=0;f=128){if(t<=193||t>244)return this.onError(new Error("Invalid UTF-8 character at position "+r+" in state "+W.toknam(this.tState)));if(t>=194&&t<=223&&(this.bytes_in_sequence=2),t>=224&&t<=239&&(this.bytes_in_sequence=3),t>=240&&t<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>l.length){for(var o=0;o<=l.length-1-r;o++)this.temp_buffs[this.bytes_in_sequence][o]=l[r+o];this.bytes_remaining=r+this.bytes_in_sequence-l.length,r=l.length-1}else this.appendStringBuf(l,r,r+this.bytes_in_sequence),r=r+this.bytes_in_sequence-1}else if(t===34)this.tState=Y,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(be,this.string),this.offset+=X.byteLength(this.string,"utf8")+1,this.string=void 0;else if(t===92)this.tState=at;else if(t>=32)this.appendStringChar(t);else return this.charError(l,r);else if(this.tState===at)if(t=l[r],t===34)this.appendStringChar(t),this.tState=H;else if(t===92)this.appendStringChar(qt),this.tState=H;else if(t===47)this.appendStringChar(zt),this.tState=H;else if(t===98)this.appendStringChar(Qt),this.tState=H;else if(t===102)this.appendStringChar(Zt),this.tState=H;else if(t===110)this.appendStringChar(er),this.tState=H;else if(t===114)this.appendStringChar(tr),this.tState=H;else if(t===116)this.appendStringChar(rr),this.tState=H;else if(t===117)this.unicode="",this.tState=st;else return this.charError(l,r);else if(this.tState===st||this.tState===Wt||this.tState===Yt||this.tState===ot)if(t=l[r],t>=48&&t<64||t>64&&t<=70||t>96&&t<=102){if(this.unicode+=String.fromCharCode(t),this.tState++===ot){var e=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&e>=56320&&e<57344?(this.appendStringBuf(new X(String.fromCharCode(this.highSurrogate,e))),this.highSurrogate=void 0):this.highSurrogate===void 0&&e>=55296&&e<56320?this.highSurrogate=e:(this.highSurrogate!==void 0&&(this.appendStringBuf(new X(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new X(String.fromCharCode(e)))),this.tState=H}}else return this.charError(l,r);else if(this.tState===it||this.tState===He)switch(t=l[r],t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t),this.tState=He;break;default:this.tState=Y;var a=this.numberReviver(this.string);if(a)return a;this.offset+=this.string.length-1,this.string=void 0,r--;break}else if(this.tState===We)if(l[r]===114)this.tState=Ye;else return this.charError(l,r);else if(this.tState===Ye)if(l[r]===117)this.tState=qe;else return this.charError(l,r);else if(this.tState===qe)if(l[r]===101)this.tState=Y,this.onToken(Nt,!0),this.offset+=3;else return this.charError(l,r);else if(this.tState===ze)if(l[r]===97)this.tState=Qe;else return this.charError(l,r);else if(this.tState===Qe)if(l[r]===108)this.tState=Ze;else return this.charError(l,r);else if(this.tState===Ze)if(l[r]===115)this.tState=et;else return this.charError(l,r);else if(this.tState===et)if(l[r]===101)this.tState=Y,this.onToken(At,!1),this.offset+=4;else return this.charError(l,r);else if(this.tState===tt)if(l[r]===117)this.tState=rt;else return this.charError(l,r);else if(this.tState===rt)if(l[r]===108)this.tState=nt;else return this.charError(l,r);else if(this.tState===nt)if(l[r]===108)this.tState=Y,this.onToken(vt,null),this.offset+=3;else return this.charError(l,r)};F.onToken=function(l,t){};F.parseError=function(l,t){this.tState=Lt,this.onError(new Error("Unexpected "+W.toknam(l)+(t?"("+JSON.stringify(t)+")":"")+" in state "+W.toknam(this.state)))};F.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};F.pop=function(){var l=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(l),this.mode||(this.state=Z)};F.emit=function(l){this.mode&&(this.state=_e),this.onValue(l)};F.onValue=function(l){};F.onToken=function(l,t){if(this.state===Z)if(l===be||l===Dt||l===Nt||l===At||l===vt)this.value&&(this.value[this.key]=t),this.emit(t);else if(l===St)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=Ke,this.mode=ue;else if(l===Tt)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=he,this.state=Z;else if(l===we)if(this.mode===ue)this.pop();else return this.parseError(l,t);else if(l===$e)if(this.mode===he)this.pop();else return this.parseError(l,t);else return this.parseError(l,t);else if(this.state===Ke)if(l===be)this.key=t,this.state=Ie;else if(l===we)this.pop();else return this.parseError(l,t);else if(this.state===Ie)if(l===Ie)this.state=Z;else return this.parseError(l,t);else if(this.state===_e)if(l===_e)this.mode===he?(this.key++,this.state=Z):this.mode===ue&&(this.state=Ke);else if(l===$e&&this.mode===he||l===we&&this.mode===ue)this.pop();else return this.parseError(l,t);else return this.parseError(l,t)};F.numberReviver=function(l){var t=Number(l);if(isNaN(t))return this.charError(buffer,i);l.match(/[0-9]+/)==l&&t.toString()!=l?this.onToken(be,l):this.onToken(Dt,t)};W.C=S;var nr=W,j={},Ge={};(function(){(function(l){(function(t){var r={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function E(h){return h&&DataView.prototype.isPrototypeOf(h)}if(r.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function e(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function a(h){return typeof h!="string"&&(h=String(h)),h}function s(h){var g={next:function(){var x=h.shift();return{done:x===void 0,value:x}}};return r.iterable&&(g[Symbol.iterator]=function(){return g}),g}function n(h){this.map={},h instanceof n?h.forEach(function(g,x){this.append(x,g)},this):Array.isArray(h)?h.forEach(function(g){this.append(g[0],g[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(g){this.append(g,h[g])},this)}n.prototype.append=function(h,g){h=e(h),g=a(g);var x=this.map[h];this.map[h]=x?x+", "+g:g},n.prototype.delete=function(h){delete this.map[e(h)]},n.prototype.get=function(h){return h=e(h),this.has(h)?this.map[h]:null},n.prototype.has=function(h){return this.map.hasOwnProperty(e(h))},n.prototype.set=function(h,g){this.map[e(h)]=a(g)},n.prototype.forEach=function(h,g){for(var x in this.map)this.map.hasOwnProperty(x)&&h.call(g,this.map[x],x,this)},n.prototype.keys=function(){var h=[];return this.forEach(function(g,x){h.push(x)}),s(h)},n.prototype.values=function(){var h=[];return this.forEach(function(g){h.push(g)}),s(h)},n.prototype.entries=function(){var h=[];return this.forEach(function(g,x){h.push([x,g])}),s(h)},r.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);function d(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function c(h){return new Promise(function(g,x){h.onload=function(){g(h.result)},h.onerror=function(){x(h.error)}})}function u(h){var g=new FileReader,x=c(g);return g.readAsArrayBuffer(h),x}function y(h){var g=new FileReader,x=c(g);return g.readAsText(h),x}function I(h){for(var g=new Uint8Array(h),x=new Array(g.length),N=0;N-1?g:h}function m(h,g){g=g||{};var x=g.body;if(h instanceof m){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,g.headers||(this.headers=new n(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!x&&h._bodyInit!=null&&(x=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new n(g.headers)),this.method=T(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})};function A(h){var g=new FormData;return h.trim().split("&").forEach(function(x){if(x){var N=x.split("="),D=N.shift().replace(/\+/g," "),O=N.join("=").replace(/\+/g," ");g.append(decodeURIComponent(D),decodeURIComponent(O))}}),g}function w(h){var g=new n,x=h.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(N){var D=N.split(":"),O=D.shift().trim();if(O){var U=D.join(":").trim();g.append(O,U)}}),g}b.call(m.prototype);function C(h,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new n(g.headers),this.url=g.url||"",this._initBody(h)}b.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},C.error=function(){var h=new C(null,{status:0,statusText:""});return h.type="error",h};var R=[301,302,303,307,308];C.redirect=function(h,g){if(R.indexOf(g)===-1)throw new RangeError("Invalid status code");return new C(null,{status:g,headers:{location:h}})},t.DOMException=l.DOMException;try{new t.DOMException}catch{t.DOMException=function(g,x){this.message=g,this.name=x;var N=Error(g);this.stack=N.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(h,g){return new Promise(function(x,N){var D=new m(h,g);if(D.signal&&D.signal.aborted)return N(new t.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function U(){O.abort()}O.onload=function(){var V={status:O.status,statusText:O.statusText,headers:w(O.getAllResponseHeaders()||"")};V.url="responseURL"in O?O.responseURL:V.headers.get("X-Request-URL");var Be="response"in O?O.response:O.responseText;x(new C(Be,V))},O.onerror=function(){N(new TypeError("Network request failed"))},O.ontimeout=function(){N(new TypeError("Network request failed"))},O.onabort=function(){N(new t.DOMException("Aborted","AbortError"))},O.open(D.method,D.url,!0),D.credentials==="include"?O.withCredentials=!0:D.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&r.blob&&(O.responseType="blob"),D.headers.forEach(function(V,Be){O.setRequestHeader(Be,V)}),D.signal&&(D.signal.addEventListener("abort",U),O.onreadystatechange=function(){O.readyState===4&&D.signal.removeEventListener("abort",U)}),O.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return v.polyfill=!0,l.fetch||(l.fetch=v,l.Headers=n,l.Request=m,l.Response=C),t.Headers=n,t.Request=m,t.Response=C,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(typeof self<"u"?self:M)})();var ee={};(function(l){Object.defineProperty(l,"__esModule",{value:!0}),l.ERROR_CODES=l.ErrorCoded=void 0;class t extends Error{constructor(E,f){super(E),this.code=f}}l.ErrorCoded=t,function(r){r.COLLIDING_KEYWORDS="colliding keywords",r.CONFLICTING_INDEXES="conflicting indexes",r.CYCLIC_IRI_MAPPING="cyclic IRI mapping",r.INVALID_ID_VALUE="invalid @id value",r.INVALID_INDEX_VALUE="invalid @index value",r.INVALID_NEST_VALUE="invalid @nest value",r.INVALID_PREFIX_VALUE="invalid @prefix value",r.INVALID_PROPAGATE_VALUE="invalid @propagate value",r.INVALID_REVERSE_VALUE="invalid @reverse value",r.INVALID_IMPORT_VALUE="invalid @import value",r.INVALID_VERSION_VALUE="invalid @version value",r.INVALID_BASE_IRI="invalid base IRI",r.INVALID_CONTAINER_MAPPING="invalid container mapping",r.INVALID_CONTEXT_ENTRY="invalid context entry",r.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",r.INVALID_DEFAULT_LANGUAGE="invalid default language",r.INVALID_INCLUDED_VALUE="invalid @included value",r.INVALID_IRI_MAPPING="invalid IRI mapping",r.INVALID_JSON_LITERAL="invalid JSON literal",r.INVALID_KEYWORD_ALIAS="invalid keyword alias",r.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",r.INVALID_LANGUAGE_MAPPING="invalid language mapping",r.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",r.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",r.INVALID_LOCAL_CONTEXT="invalid local context",r.INVALID_REMOTE_CONTEXT="invalid remote context",r.INVALID_REVERSE_PROPERTY="invalid reverse property",r.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",r.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",r.INVALID_SCOPED_CONTEXT="invalid scoped context",r.INVALID_SCRIPT_ELEMENT="invalid script element",r.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",r.INVALID_TERM_DEFINITION="invalid term definition",r.INVALID_TYPE_MAPPING="invalid type mapping",r.INVALID_TYPE_VALUE="invalid type value",r.INVALID_TYPED_VALUE="invalid typed value",r.INVALID_VALUE_OBJECT="invalid value object",r.INVALID_VALUE_OBJECT_VALUE="invalid value object value",r.INVALID_VOCAB_MAPPING="invalid vocab mapping",r.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",r.KEYWORD_REDEFINITION="keyword redefinition",r.LOADING_DOCUMENT_FAILED="loading document failed",r.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",r.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",r.PROCESSING_MODE_CONFLICT="processing mode conflict",r.PROTECTED_TERM_REDEFINITION="protected term redefinition",r.CONTEXT_OVERFLOW="context overflow",r.INVALID_BASE_DIRECTION="invalid base direction",r.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",r.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",r.INVALID_EMBEDDED_NODE="invalid embedded node",r.INVALID_ANNOTATION="invalid annotation"}(l.ERROR_CODES||(l.ERROR_CODES={}))})(ee);var fe={},ir=/^utf-?8|ascii|utf-?16-?le|ucs-?2|base-?64|latin-?1$/i,ar=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,sr=/\s|\uFEFF|\xA0/,or=/\r?\n[\x20\x09]+/g,lr=/[;,"]/,dr=/[;,"]|\s/,cr=/^[!#$%&'*+\-\.^_`|~\da-zA-Z]+$/,$={IDLE:1,URI:2,ATTR:4};function lt(l){return l.replace(ar,"")}function Ce(l){return sr.test(l)}function fr(l,t){for(;Ce(l[t]);)t++;return t}function dt(l){return dr.test(l)||!cr.test(l)}class P{constructor(t){this.refs=[],t&&this.parse(t)}rel(t){for(var r=[],E=t.toLowerCase(),f=0;f",o);if(a===-1)throw new Error("Expected end of URI delimiter at offset "+o);e={uri:t.slice(o+1,a)},o=a,E=$.URI}else throw new Error('Unexpected character "'+t[o]+'" at offset '+o);o++}else if(E===$.URI)if(Ce(t[o])){o++;continue}else if(t[o]===";")E=$.ATTR,o++;else if(t[o]===",")E=$.IDLE,o++;else throw new Error('Unexpected character "'+t[o]+'" at offset '+o);else if(E===$.ATTR){if(t[o]===";"||Ce(t[o])){o++;continue}var a=t.indexOf("=",o);if(a===-1)throw new Error("Expected attribute delimiter at offset "+o);var s=lt(t.slice(o,a)).toLowerCase(),n="";if(o=a+1,o=fr(t,o),t[o]==='"')for(o++;o"),t.push(r);return t.join(", ")}}P.isCompatibleEncoding=function(l){return ir.test(l)};P.parse=function(l,t){return new P().parse(l,t)};P.isSingleOccurenceAttr=function(l){return l==="rel"||l==="type"||l==="media"||l==="title"||l==="title*"};P.isTokenAttr=function(l){return l==="rel"||l==="type"||l==="anchor"};P.escapeQuotes=function(l){return l.replace(/"/g,'\\"')};P.expandRelations=function(l){var t=l.rel.split(" ");return t.map(function(r){var E=Object.assign({},l);return E.rel=r,E})};P.parseExtendedValue=function(l){var t=/([^']+)?(?:'([^']*)')?(.+)/.exec(l);return{language:t[2].toLowerCase(),encoding:P.isCompatibleEncoding(t[1])?null:t[1].toLowerCase(),value:P.isCompatibleEncoding(t[1])?decodeURIComponent(t[3]):t[3]}};P.formatExtendedAttribute=function(l,t){var r=(t.encoding||"utf-8").toUpperCase(),E=t.language||"en",f="";return Buffer.isBuffer(t.value)&&P.isCompatibleEncoding(r)?f=t.value.toString(r):Buffer.isBuffer(t.value)?f=t.value.toString("hex").replace(/[0-9a-f]{2}/gi,"%$1"):f=encodeURIComponent(t.value),l+"="+r+"'"+E+"'"+f};P.formatAttribute=function(l,t){return Array.isArray(t)?t.map(r=>P.formatAttribute(l,r)).join("; "):l[l.length-1]==="*"||typeof t!="string"?P.formatExtendedAttribute(l,t):(P.isTokenAttr(l)?t=dt(t)?'"'+P.escapeQuotes(t)+'"':P.escapeQuotes(t):dt(t)&&(t=encodeURIComponent(t),t=t.replace(/%20/g," ").replace(/%2C/g,",").replace(/%3B/g,";"),t='"'+t+'"'),l+"="+t)};var Pt=P;Object.defineProperty(fe,"__esModule",{value:!0});fe.FetchDocumentLoader=void 0;const ct=ee,ur=Pt,hr=Me;class Er{constructor(t){this.fetcher=t}async load(t){const r=await(this.fetcher||fetch)(t,{headers:new Headers({accept:"application/ld+json"})});if(r.ok&&r.headers){let E=r.headers.get("Content-Type");if(E){const f=E.indexOf(";");f>0&&(E=E.substr(0,f))}if(E==="application/ld+json")return await r.json();if(r.headers.has("Link")){let f;if(r.headers.forEach((o,e)=>{if(e==="link"){const a=(0,ur.parse)(o);for(const s of a.get("type","application/ld+json"))if(s.rel==="alternate"){if(f)throw new Error("Multiple JSON-LD alternate links were found on "+t);f=(0,hr.resolve)(s.uri,t)}}}),f)return this.load(f)}throw new ct.ErrorCoded(`Unsupported JSON-LD media type ${E}`,ct.ERROR_CODES.LOADING_DOCUMENT_FAILED)}else throw new Error(r.statusText||`Status code: ${r.status}`)}}fe.FetchDocumentLoader=Er;var ne={},te={};Object.defineProperty(te,"__esModule",{value:!0});te.Util=void 0;let B=class k{static isCompactIri(t){return t.indexOf(":")>0&&!(t&&t[0]==="#")}static getPrefix(t,r){if(t&&t[0]==="#")return null;const E=t.indexOf(":");if(E>=0){if(t.length>E+1&&t.charAt(E+1)==="/"&&t.charAt(E+2)==="/")return null;const f=t.substr(0,E);if(f==="_")return null;if(r[f])return f}return null}static getContextValueId(t){if(t===null||typeof t=="string")return t;const r=t["@id"];return r||null}static isSimpleTermDefinitionPrefix(t,r){return!k.isPotentialKeyword(t)&&(t[0]==="_"||r.allowPrefixNonGenDelims||k.isPrefixIriEndingWithGenDelim(t))}static isPotentialKeyword(t){return typeof t=="string"&&k.KEYWORD_REGEX.test(t)}static isPrefixIriEndingWithGenDelim(t){return k.ENDS_WITH_GEN_DELIM.test(t)}static isPrefixValue(t){return t&&(typeof t=="string"||t&&typeof t=="object")}static isValidIri(t){return!!(t&&k.IRI_REGEX.test(t))}static isValidIriWeak(t){return!!t&&t[0]!==":"&&k.IRI_REGEX_WEAK.test(t)}static isValidKeyword(t){return k.VALID_KEYWORDS[t]}static isTermProtected(t,r){const E=t[r];return typeof E!="string"&&E&&E["@protected"]}static hasProtectedTerms(t){for(const r of Object.keys(t))if(k.isTermProtected(t,r))return!0;return!1}static isReservedInternalKeyword(t){return t.startsWith("@__")}};te.Util=B;B.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/;B.IRI_REGEX_WEAK=/(?::[^:])|\//;B.KEYWORD_REGEX=/^@[a-z]+$/i;B.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/;B.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/;B.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/;B.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0};B.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"];B.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"];B.ALIAS_RANGE_BLACKLIST=["@context","@preserve"];B.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"];B.CONTAINERS_1_0=["@list","@set","@index"];var ft;function Vt(){if(ft)return ne;ft=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.JsonLdContextNormalized=void 0;const l=Me,t=Ut(),r=ee,E=te;let f=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,a,s=t.defaultExpandOptions){const n=this.contextRaw[e];if(n===null||n&&n["@id"]===null)return null;let d=!0;if(n&&a){const b=E.Util.getContextValueId(n);if(b&&b!==e)if(typeof b!="string"||!E.Util.isValidIri(b)&&!E.Util.isValidKeyword(b))E.Util.isPotentialKeyword(b)||(d=!1);else return b}const c=E.Util.getPrefix(e,this.contextRaw),u=this.contextRaw["@vocab"],y=(!!u||u==="")&&u.indexOf(":")<0,I=this.contextRaw["@base"],p=E.Util.isPotentialKeyword(e);if(c){const b=this.contextRaw[c],_=E.Util.getContextValueId(b);if(_){if(typeof b=="string"||!s.allowPrefixForcing){if(!E.Util.isSimpleTermDefinitionPrefix(_,s))return e}else if(_[0]!=="_"&&!p&&!b["@prefix"]&&!(e in this.contextRaw))return e;return _+e.substr(c.length+1)}}else if(a&&(u||u===""||s.allowVocabRelativeToBase&&I&&y)&&!p&&!E.Util.isCompactIri(e))if(y){if(s.allowVocabRelativeToBase)return(u||I?(0,l.resolve)(u,I):"")+e;throw new r.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${u}' is not allowed.`,r.ERROR_CODES.INVALID_VOCAB_MAPPING)}else return u+e;else if(!a&&I&&!p&&!E.Util.isCompactIri(e))return(0,l.resolve)(e,I);if(d)return e;throw new r.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(n)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,a){if(a&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!a&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const s={prefix:"",suffix:e};for(const n in this.contextRaw){const d=this.contextRaw[n];if(d&&!E.Util.isPotentialKeyword(n)){const c=E.Util.getContextValueId(d);if(e.startsWith(c)){const u=e.substr(c.length);if(u)u.length=0&&(u!=="@type"||typeof c[u]=="object"&&!(c[u]["@protected"]||c[u]["@container"]==="@set")))throw new r.ErrorCoded(`Keywords can not be aliased to something else. +Tried mapping ${u} to ${JSON.stringify(y)}`,r.ERROR_CODES.KEYWORD_REDEFINITION);if(o.Util.ALIAS_RANGE_BLACKLIST.indexOf(o.Util.getContextValueId(y))>=0)throw new r.ErrorCoded(`Aliasing to certain keywords is not allowed. +Tried mapping ${u} to ${JSON.stringify(y)}`,r.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(y&&o.Util.isPotentialKeyword(o.Util.getContextValueId(y))&&y["@prefix"]===!0)throw new r.ErrorCoded(`Tried to use keyword aliases as prefix: '${u}': '${JSON.stringify(y)}'`,r.ERROR_CODES.INVALID_TERM_DEFINITION);for(;o.Util.isPrefixValue(c[u]);){const I=c[u];let p=!1;if(typeof I=="string")c[u]=n.expandTerm(I,!0),p=p||I!==c[u];else{const b=I["@id"],_=I["@type"],T=!("@prefix"in I)||o.Util.isValidIri(u);if("@id"in I)b!=null&&typeof b=="string"&&(c[u]["@id"]=n.expandTerm(b,!0),p=p||b!==c[u]["@id"]);else if(!o.Util.isPotentialKeyword(u)&&T){const m=n.expandTerm(u,!0);m!==u&&(c[u]["@id"]=m,p=!0)}_&&typeof _=="string"&&_!=="@vocab"&&(!I["@container"]||!I["@container"]["@type"])&&T&&(c[u]["@type"]=n.expandTerm(_,!0),d&&_===c[u]["@type"]&&(c[u]["@type"]=n.expandTerm(_,!1)),p=p||_!==c[u]["@type"])}if(!p)break}}}normalize(n,{processingMode:d,normalizeLanguageTags:c}){if(c||d===1)for(const u of Object.keys(n))if(u==="@language"&&typeof n[u]=="string")n[u]=n[u].toLowerCase();else{const y=n[u];y&&typeof y=="object"&&typeof y["@language"]=="string"&&(y["@language"]=y["@language"].toLowerCase())}}containersToHash(n){for(const d of Object.keys(n)){const c=n[d];if(c&&typeof c=="object"){if(typeof c["@container"]=="string")c["@container"]={[c["@container"]]:!0};else if(Array.isArray(c["@container"])){const u={};for(const y of c["@container"])u[y]=!0;c["@container"]=u}}}}applyScopedProtected(n,{processingMode:d}){if(d&&d>=1.1&&n["@protected"]){for(const c of Object.keys(n))if(!o.Util.isReservedInternalKeyword(c)&&!o.Util.isPotentialKeyword(c)&&!o.Util.isTermProtected(n,c)){const u=n[c];u&&typeof u=="object"?"@protected"in n[c]||(n[c]["@protected"]=!0):n[c]={"@id":u,"@protected":!0}}delete n["@protected"]}}validateKeywordRedefinitions(n,d,c){for(const u of Object.keys(d))if(o.Util.isTermProtected(n,u)){if(typeof d[u]=="string"){const p=o.Util.isSimpleTermDefinitionPrefix(d[u],c);d[u]={"@id":d[u]},p&&(d[u]["@prefix"]=!0,n[u]["@prefix"]=!0)}const y=e(n[u]);d[u]["@protected"]=!0;const I=e(d[u]);if(y!==I)throw new r.ErrorCoded(`Attempted to override the protected keyword ${u} from ${JSON.stringify(o.Util.getContextValueId(n[u]))} to ${JSON.stringify(o.Util.getContextValueId(d[u]))}`,r.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}}validate(n,{processingMode:d}){for(const c of Object.keys(n)){if(o.Util.isReservedInternalKeyword(c))continue;if(c==="")throw new r.ErrorCoded(`The empty term is not allowed, got: '${c}': '${JSON.stringify(n[c])}'`,r.ERROR_CODES.INVALID_TERM_DEFINITION);const u=n[c],y=typeof u;if(o.Util.isPotentialKeyword(c)){switch(c.substr(1)){case"vocab":if(u!==null&&y!=="string")throw new r.ErrorCoded(`Found an invalid @vocab IRI: ${u}`,r.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(u!==null&&y!=="string")throw new r.ErrorCoded(`Found an invalid @base IRI: ${n[c]}`,r.ERROR_CODES.INVALID_BASE_IRI);break;case"language":u!==null&&a.validateLanguage(u,!0,r.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(u!==null&&y!=="number")throw new r.ErrorCoded(`Found an invalid @version number: ${u}`,r.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":u!==null&&a.validateDirection(u,!0);break;case"propagate":if(d===1)throw new r.ErrorCoded(`Found an illegal @propagate keyword: ${u}`,r.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(u!==null&&y!=="boolean")throw new r.ErrorCoded(`Found an invalid @propagate value: ${u}`,r.ERROR_CODES.INVALID_PROPAGATE_VALUE);break}if(o.Util.isValidKeyword(c)&&o.Util.isValidKeyword(o.Util.getContextValueId(u)))throw new r.ErrorCoded(`Illegal keyword alias in term value, found: '${c}': '${o.Util.getContextValueId(u)}'`,r.ERROR_CODES.KEYWORD_REDEFINITION);continue}if(u!==null)switch(y){case"string":if(o.Util.getPrefix(u,n)===c)throw new r.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.CYCLIC_IRI_MAPPING);if(o.Util.isValidIriWeak(c)){if(u==="@type")throw new r.ErrorCoded(`IRIs can not be mapped to @type, found: '${c}': '${u}'`,r.ERROR_CODES.INVALID_IRI_MAPPING);if(o.Util.isValidIri(u)&&u!==new f.JsonLdContextNormalized(n).expandTerm(c))throw new r.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${c}': '${u}'`,r.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!o.Util.isCompactIri(c)&&!("@id"in u)&&(u["@type"]==="@id"?!n["@base"]:!n["@vocab"]))throw new r.ErrorCoded(`Missing @id in context entry: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING);for(const I of Object.keys(u)){const p=u[I];if(p)switch(I){case"@id":if(o.Util.isValidKeyword(p)&&p!=="@type"&&p!=="@id"&&p!=="@graph"&&p!=="@nest")throw new r.ErrorCoded(`Illegal keyword alias in term value, found: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING);if(o.Util.isValidIriWeak(c)){if(p==="@type")throw new r.ErrorCoded(`IRIs can not be mapped to @type, found: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING);if(o.Util.isValidIri(p)&&p!==new f.JsonLdContextNormalized(n).expandTerm(c))throw new r.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING)}if(typeof p!="string")throw new r.ErrorCoded(`Detected non-string @id in context entry: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_IRI_MAPPING);if(o.Util.getPrefix(p,n)===c)throw new r.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if(u["@container"]==="@type"&&p!=="@id"&&p!=="@vocab")throw new r.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${c}': '${p}'`,r.ERROR_CODES.INVALID_TYPE_MAPPING);if(typeof p!="string")throw new r.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(y)}'`,r.ERROR_CODES.INVALID_TYPE_MAPPING);if(p!=="@id"&&p!=="@vocab"&&(d===1||p!=="@json")&&(d===1||p!=="@none")&&(p[0]==="_"||!o.Util.isValidIri(p)))throw new r.ErrorCoded(`A context @type must be an absolute IRI, found: '${c}': '${p}'`,r.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if(typeof p=="string"&&u["@id"]&&u["@id"]!==p)throw new r.ErrorCoded(`Found non-matching @id and @reverse term values in '${c}':'${p}' and '${u["@id"]}'`,r.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in u)throw new r.ErrorCoded(`@nest is not allowed in the reverse property '${c}'`,r.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(d===1&&(Object.keys(p).length>1||o.Util.CONTAINERS_1_0.indexOf(Object.keys(p)[0])<0))throw new r.ErrorCoded(`Invalid term @container for '${c}' ('${Object.keys(p)}') in 1.0, must be only one of ${o.Util.CONTAINERS_1_0.join(", ")}`,r.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const b of Object.keys(p)){if(b==="@list"&&u["@reverse"])throw new r.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${c}'`,r.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(o.Util.CONTAINERS.indexOf(b)<0)throw new r.ErrorCoded(`Invalid term @container for '${c}' ('${b}'), must be one of ${o.Util.CONTAINERS.join(", ")}`,r.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":a.validateLanguage(p,!0,r.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":a.validateDirection(p,!0);break;case"@prefix":if(p!==null&&typeof p!="boolean")throw new r.ErrorCoded(`Found an invalid term @prefix boolean in: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in u)&&!o.Util.isValidIri(c))throw new r.ErrorCoded(`Invalid @prefix definition for '${c}' ('${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(d===1||!u["@container"]||!u["@container"]["@index"])throw new r.ErrorCoded(`Attempt to add illegal key to value object: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(o.Util.isPotentialKeyword(p)&&p!=="@nest")throw new r.ErrorCoded(`Found an invalid term @nest value in: '${c}': '${JSON.stringify(u)}'`,r.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new r.ErrorCoded(`Found an invalid term value: '${c}': '${u}'`,r.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(n,d,c){return typeof n=="string"||(c&&!("@base"in n)&&d.parentContext&&typeof d.parentContext=="object"&&"@base"in d.parentContext&&(n["@base"]=d.parentContext["@base"],d.parentContext["@__baseDocument"]&&(n["@__baseDocument"]=!0)),d.baseIRI&&!d.external&&("@base"in n?n["@base"]!==null&&typeof n["@base"]=="string"&&!o.Util.isValidIri(n["@base"])&&(n["@base"]=(0,t.resolve)(n["@base"],d.parentContext&&d.parentContext["@base"]||d.baseIRI)):(n["@base"]=d.baseIRI,n["@__baseDocument"]=!0))),n}normalizeContextIri(n,d){if(!o.Util.isValidIri(n))try{n=(0,t.resolve)(n,d)}catch{throw new Error(`Invalid context IRI: ${n}`)}return this.redirectSchemaOrgHttps&&n.startsWith("http://schema.org")&&(n="https://schema.org/"),n}async parseInnerContexts(n,d){for(const c of Object.keys(n)){const u=n[c];if(u&&typeof u=="object"&&"@context"in u&&u["@context"]!==null&&!d.ignoreScopedContexts){if(this.validateContext)try{const y=Object.assign({},n);y[c]=Object.assign({},y[c]),delete y[c]["@context"],await this.parse(u["@context"],Object.assign(Object.assign({},d),{external:!1,parentContext:y,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(y){throw new r.ErrorCoded(y.message,r.ERROR_CODES.INVALID_SCOPED_CONTEXT)}u["@context"]=(await this.parse(u["@context"],Object.assign(Object.assign({},d),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:n}))).getContextRaw()}}return n}async parse(n,d={}){const{baseIRI:c,parentContext:u,external:y,processingMode:I=a.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:p,ignoreProtection:b,minimalProcessing:_}=d;let T=u;const m=d.remoteContexts||{};if(Object.keys(m).length>=this.remoteContextsDepthLimit)throw new r.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(m),r.ERROR_CODES.CONTEXT_OVERFLOW);if(n==null){if(!b&&T&&o.Util.hasProtectedTerms(T))throw new r.ErrorCoded("Illegal context nullification when terms are protected",r.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new f.JsonLdContextNormalized(this.applyBaseEntry({},d,!1))}else if(typeof n=="string"){const A=this.normalizeContextIri(n,c),w=this.getOverriddenLoad(A,d);if(w)return new f.JsonLdContextNormalized(w);const C=await this.parse(await this.load(A),Object.assign(Object.assign({},d),{baseIRI:A,external:!0,remoteContexts:Object.assign(Object.assign({},m),{[A]:!0})}));return this.applyBaseEntry(C.getContextRaw(),d,!0),C}else if(Array.isArray(n)){const A=[],w=await Promise.all(n.map((R,v)=>{if(typeof R=="string"){const h=this.normalizeContextIri(R,c);A[v]=h;const g=this.getOverriddenLoad(h,d);return g||this.load(h)}else return R}));if(_)return new f.JsonLdContextNormalized(w);const C=await w.reduce((R,v,h)=>R.then(g=>this.parse(v,Object.assign(Object.assign({},d),{baseIRI:A[h]||d.baseIRI,external:!!A[h]||d.external,parentContext:g.getContextRaw(),remoteContexts:A[h]?Object.assign(Object.assign({},m),{[A[h]]:!0}):m}))),Promise.resolve(new f.JsonLdContextNormalized(T||{})));return this.applyBaseEntry(C.getContextRaw(),d,!0),C}else if(typeof n=="object"){if("@context"in n)return await this.parse(n["@context"],d);n=JSON.parse(JSON.stringify(n)),T&&!_&&(T=JSON.parse(JSON.stringify(T)));let A={};if(y&&delete n["@base"],this.applyBaseEntry(n,d,!0),this.containersToHash(n),_)return new f.JsonLdContextNormalized(n);let w={};if("@import"in n)if(I>=1.1){if(typeof n["@import"]!="string")throw new r.ErrorCoded("An @import value must be a string, but got "+typeof n["@import"],r.ERROR_CODES.INVALID_IMPORT_VALUE);w=await this.loadImportContext(this.normalizeContextIri(n["@import"],c)),delete n["@import"]}else throw new r.ErrorCoded("Context importing is not supported in JSON-LD 1.0",r.ERROR_CODES.INVALID_CONTEXT_ENTRY);A=Object.assign(Object.assign(Object.assign(Object.assign({},A),typeof T=="object"?T:{}),w),n);const C=new f.JsonLdContextNormalized(A);return await this.parseInnerContexts(A,d),(A&&A["@version"]||a.DEFAULT_PROCESSING_MODE)>=1.1&&(n["@vocab"]&&typeof n["@vocab"]=="string"||n["@vocab"]==="")&&(T&&"@vocab"in T&&n["@vocab"].indexOf(":")<0?A["@vocab"]=T["@vocab"]+n["@vocab"]:(o.Util.isCompactIri(n["@vocab"])||n["@vocab"]in C.getContextRaw())&&(A["@vocab"]=C.expandTerm(n["@vocab"],!0))),this.idifyReverseTerms(A),this.expandPrefixedTerms(C,this.expandContentTypeToBase),!b&&T&&I>=1.1&&this.validateKeywordRedefinitions(T,A,l.defaultExpandOptions),this.normalize(A,{processingMode:I,normalizeLanguageTags:p}),this.applyScopedProtected(A,{processingMode:I}),this.validateContext&&this.validate(A,{processingMode:I}),C}else throw new r.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${n}`,r.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(n){const d=this.documentCache[n];if(d)return typeof d=="string"?d:Array.isArray(d)?d.slice():Object.assign({},d);let c;try{c=await this.documentLoader.load(n)}catch(u){throw new r.ErrorCoded(`Failed to load remote context ${n}: ${u.message}`,r.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in c))throw new r.ErrorCoded(`Missing @context in remote context at ${n}`,r.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[n]=c["@context"]}getOverriddenLoad(n,d){if(n in(d.remoteContexts||{})){if(d.ignoreRemoteScopedContexts)return n;throw new r.ErrorCoded("Detected a cyclic context inclusion of "+n,r.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(n){const d=await this.load(n);if(typeof d!="object"||Array.isArray(d))throw new r.ErrorCoded("An imported context must be a single object: "+n,r.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in d)throw new r.ErrorCoded("An imported context can not import another context: "+n,r.ERROR_CODES.INVALID_CONTEXT_ENTRY);return this.containersToHash(d),d}}l.ContextParser=a,a.DEFAULT_PROCESSING_MODE=1.1,l.defaultExpandOptions={allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}}(Ge)),Ge}var jt={};Object.defineProperty(jt,"__esModule",{value:!0});var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});(function(l){var t=M&&M.__createBinding||(Object.create?function(E,f,o,e){e===void 0&&(e=o);var a=Object.getOwnPropertyDescriptor(f,o);(!a||("get"in a?!f.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return f[o]}}),Object.defineProperty(E,e,a)}:function(E,f,o,e){e===void 0&&(e=o),E[e]=f[o]}),r=M&&M.__exportStar||function(E,f){for(var o in E)o!=="default"&&!Object.prototype.hasOwnProperty.call(f,o)&&t(f,E,o)};Object.defineProperty(l,"__esModule",{value:!0}),r(Ut(),l),r(ee,l),r(fe,l),r(jt,l),r(Ft,l),r(Vt(),l),r(te,l)})(j);var Re={},ie={},ae={},Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ContainerHandlerIdentifier=void 0;class yr{canCombineWithGraph(){return!0}async handle(t,r,E,f,o,e){let a;if(r.emittedStack[e+1]&&r.idStack[e+1])a=r.idStack[e+1][0];else{const d=await E.getContainerKey(f[e],f,e)!==null?await E.resourceToTerm(await r.getContext(f),f[e]):E.dataFactory.blankNode();if(!d){r.emittedStack[e]=!1;return}a=d,r.idStack[e+1]=[a]}let s=r.idStack[e];s||(s=r.idStack[e]=[]),s.some(n=>n.equals(a))||s.push(a),await r.handlePendingContainerFlushBuffers()||(r.emittedStack[e]=!1)}}Oe.ContainerHandlerIdentifier=yr;var se={},oe={},ht;function xe(){if(ht)return oe;ht=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.EntryHandlerPredicate=void 0;const l=j,t=q();let r=class Bt{static async handlePredicateObject(f,o,e,a,s,n,d,c,u){const y=await o.getPropertiesDepth(e,a),I=await o.getDepthOffsetGraph(a,e),p=a-I,b=f.idStack[y];if(b&&!u)for(const _ of b)if(I>=0){const m=f.idStack[p-1];if(m)for(const A of m)o.emitQuadChecked(a,_,s,n,A,d,c);else d?(o.validateReverseSubject(n),f.getUnidentifiedGraphBufferSafe(p-1).push({subject:n,predicate:s,object:_,isEmbedded:c})):f.getUnidentifiedGraphBufferSafe(p-1).push({subject:_,predicate:s,object:n,isEmbedded:c})}else{const m=await o.getGraphContainerValue(e,y);o.emitQuadChecked(a,_,s,n,m,d,c)}else if(d&&o.validateReverseSubject(n),u){if(f.rdfstar){f.idStack[a]&&f.emitError(new l.ErrorCoded(`Found an illegal @id inside an annotation: ${f.idStack[a][0].value}`,l.ERROR_CODES.INVALID_ANNOTATION));for(let m=0;m=0;m--){const A=_[m];A.depth>y&&(T.nestedAnnotations.push(A),_.splice(m,1))}}}else f.getUnidentifiedValueBufferSafe(y).push({predicate:s,object:n,reverse:d,isEmbedded:c})}isPropertyHandler(){return!0}isStackProcessor(){return!0}async validate(f,o,e,a,s){const n=e[a];if(n){const d=await f.getContext(e);if(!f.jsonLiteralStack[a]&&await o.predicateToTerm(d,e[a]))return t.Util.getContextValueType(d,n)==="@json"&&(f.jsonLiteralStack[a+1]=!0),!0}return!1}async test(f,o,e,a,s){return a[s]}async handle(f,o,e,a,s,n,d){const c=a[n],u=await f.getContext(a),y=await o.predicateToTerm(u,e);if(y){const I=await o.valueToTerm(u,e,s,n,a);if(I.length)for(let p of I){let b=await o.unaliasKeywordParent(a,n);const _=t.Util.isPropertyReverse(u,c,b);let T=0;for(;b==="@reverse"||typeof b=="number";)typeof b=="number"?T++:n--,b=await o.unaliasKeywordParent(a,n-T);const m=t.Util.isPropertyInEmbeddedNode(b);o.validateReverseInEmbeddedNode(e,_,m);const A=t.Util.isPropertyInAnnotationObject(b);if(s){const w="@list"in t.Util.getContextValueContainer(u,e);if(w||s["@list"]){if((w&&!Array.isArray(s)&&!s["@list"]||s["@list"]&&!Array.isArray(s["@list"]))&&p!==o.rdfNil){const C=o.dataFactory.blankNode();f.emitQuad(n,o.dataFactory.quad(C,o.rdfRest,o.rdfNil,o.getDefaultGraph())),f.emitQuad(n,o.dataFactory.quad(C,o.rdfFirst,p,o.getDefaultGraph())),p=C}if(_&&!f.allowSubjectList)throw new l.ErrorCoded(`Found illegal list value in subject position at ${e}`,l.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}}await Bt.handlePredicateObject(f,o,a,n,y,p,_,m,A)}}}};return oe.EntryHandlerPredicate=r,oe}var Et;function gr(){if(Et)return se;Et=1,Object.defineProperty(se,"__esModule",{value:!0}),se.ContainerHandlerIndex=void 0;const l=j,t=xe(),r=q();let E=class{canCombineWithGraph(){return!0}async handle(o,e,a,s,n,d){if(!Array.isArray(n)){const c="@graph"in o,u=await e.getContext(s),y=s[d-1],I=r.Util.getContextValueIndex(u,y);if(I){if(l.Util.isPotentialKeyword(I))throw new l.ErrorCoded(`Keywords can not be used as @index value, got: ${I}`,l.ERROR_CODES.INVALID_TERM_DEFINITION);if(typeof I!="string")throw new l.ErrorCoded(`@index values must be strings, got: ${I}`,l.ERROR_CODES.INVALID_TERM_DEFINITION);if(typeof n!="object"){if(r.Util.getContextValueType(u,y)!=="@id")throw new l.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${n}`,l.ERROR_CODES.INVALID_VALUE_OBJECT);const _=a.resourceToTerm(u,n);_&&(e.idStack[d+1]=[_])}const b=a.createVocabOrBaseTerm(u,I);if(b){const _=await a.valueToTerm(u,I,await a.getContainerKey(s[d],s,d),d,s);if(c){const T=await a.getGraphContainerValue(s,d+1);for(const m of _)e.emitQuad(d,a.dataFactory.quad(T,b,m,a.getDefaultGraph()))}else for(const T of _)await t.EntryHandlerPredicate.handlePredicateObject(e,a,s,d+1,b,T,!1,!1,!1)}}const p=c?2:1;await e.newOnValueJob(s.slice(0,s.length-p),n,d-p,!0),await e.handlePendingContainerFlushBuffers()}e.emittedStack[d]=!1}};return se.ContainerHandlerIndex=E,se}var me={};Object.defineProperty(me,"__esModule",{value:!0});me.ContainerHandlerLanguage=void 0;const yt=j;class pr{canCombineWithGraph(){return!1}async handle(t,r,E,f,o,e){const a=await E.getContainerKey(f[e],f,e);if(Array.isArray(o))o=o.map(s=>({"@value":s,"@language":a}));else{if(typeof o!="string")throw new yt.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(o)}', but expected string`,yt.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);o={"@value":o,"@language":a}}await r.newOnValueJob(f.slice(0,f.length-1),o,e-1,!0),r.emittedStack[e]=!1}}me.ContainerHandlerLanguage=pr;var le={},gt;function wr(){if(gt)return le;gt=1,Object.defineProperty(le,"__esModule",{value:!0}),le.ContainerHandlerType=void 0;const l=xe(),t=q();let r=class{canCombineWithGraph(){return!1}async handle(f,o,e,a,s,n){if(!Array.isArray(s)){if(typeof s=="string"){const u=await o.getContext(a),I=t.Util.getContextValueType(u,a[n-1])==="@vocab"?await e.createVocabOrBaseTerm(u,s):await e.resourceToTerm(u,s);if(I){const p={"@id":I.termType==="NamedNode"?I.value:s};await o.newOnValueJob(a.slice(0,a.length-1),p,n-1,!0),o.idStack[n+1]=[I]}}else{const u=!!o.idStack[n+1];u||delete o.idStack[n],await o.newOnValueJob(a.slice(0,a.length-1),s,n-1,!0),u||(o.idStack[n+1]=o.idStack[n])}const d=await e.getContainerKey(a[n],a,n),c=d!==null?e.createVocabOrBaseTerm(await o.getContext(a),d):null;c&&await l.EntryHandlerPredicate.handlePredicateObject(o,e,a,n+1,e.rdfType,c,!1,!1,!1),await o.handlePendingContainerFlushBuffers()}o.emittedStack[n]=!1}};return le.ContainerHandlerType=r,le}var pt;function Ht(){if(pt)return ae;pt=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.EntryHandlerContainer=void 0;const l=Oe,t=gr(),r=me,E=wr(),f=q();let o=class J{static isSimpleGraphContainer(a){return"@graph"in a&&("@set"in a&&Object.keys(a).length===2||Object.keys(a).length===1)}static isComplexGraphContainer(a){return"@graph"in a&&("@set"in a&&Object.keys(a).length>2||!("@set"in a)&&Object.keys(a).length>1)}static getContainerGraphIndex(a,s,n){let d=J.isSimpleGraphContainer(a),c="";for(let u=s;u=0;y--)if(typeof s[y]!="number"){const I=f.Util.getContextValue(u,"@container",s[y],!1);if(I&&J.isSimpleGraphContainer(I))return{containers:I,depth:y+1,fallback:!1};const p=f.Util.getContextValue(u,"@container",s[y-1],!1);if(p){const b="@graph"in p;for(const _ in J.CONTAINER_HANDLERS)if(p[_])return b?J.CONTAINER_HANDLERS[_].canCombineWithGraph()?{containers:p,depth:y,fallback:!1}:d:c?d:{containers:p,depth:y,fallback:!1};return d}else{if(c)return d;c=!0}}return d}static async isBufferableContainerHandler(a,s,n){const d=await J.getContainerHandler(a,s,n);return!d.fallback&&!("@graph"in d.containers)}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(a,s,n,d,c){return!!await this.test(a,s,null,n,d)}async test(a,s,n,d,c){const u=f.Util.getContextValueContainer(await a.getContext(d,2),d[c-1]);for(const y in J.CONTAINER_HANDLERS)if(u[y])return{containers:u,handler:J.CONTAINER_HANDLERS[y]};return null}async handle(a,s,n,d,c,u,y){return y.handler.handle(y.containers,a,s,d,c,u)}};return ae.EntryHandlerContainer=o,o.CONTAINER_HANDLERS={"@id":new l.ContainerHandlerIdentifier,"@index":new t.ContainerHandlerIndex,"@language":new r.ContainerHandlerLanguage,"@type":new E.ContainerHandlerType},ae}var wt;function q(){if(wt)return ie;wt=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.Util=void 0;const l=j,t=Xt,r=Ht(),E=xt;let f=class L{constructor(e){this.parsingContext=e.parsingContext,this.dataFactory=e.dataFactory||new t.DataFactory,this.rdfFirst=this.dataFactory.namedNode(L.RDF+"first"),this.rdfRest=this.dataFactory.namedNode(L.RDF+"rest"),this.rdfNil=this.dataFactory.namedNode(L.RDF+"nil"),this.rdfType=this.dataFactory.namedNode(L.RDF+"type"),this.rdfJson=this.dataFactory.namedNode(L.RDF+"JSON")}static getContextValue(e,a,s,n){const d=e.getContextRaw()[s];if(!d)return n;const c=d[a];return c===void 0?n:c}static getContextValueContainer(e,a){return L.getContextValue(e,"@container",a,{"@set":!0})}static getContextValueType(e,a){const s=L.getContextValue(e,"@type",a,null);return s==="@none"?null:s}static getContextValueLanguage(e,a){return L.getContextValue(e,"@language",a,e.getContextRaw()["@language"]||null)}static getContextValueDirection(e,a){return L.getContextValue(e,"@direction",a,e.getContextRaw()["@direction"]||null)}static isContextValueReverse(e,a){return!!L.getContextValue(e,"@reverse",a,null)}static getContextValueIndex(e,a){return L.getContextValue(e,"@index",a,e.getContextRaw()["@index"]||null)}static isPropertyReverse(e,a,s){return s==="@reverse"!==L.isContextValueReverse(e,a)}static isPropertyInEmbeddedNode(e){return e==="@id"}static isPropertyInAnnotationObject(e){return e==="@annotation"}static isValidIri(e){return e!==null&&l.Util.isValidIri(e)}static isPrefixArray(e,a){if(e.length>a.length)return!1;for(let s=0;s1)throw new l.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${a}'`,l.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);return[]}else if("@list"in s){if(Object.keys(s).length>1)throw new l.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${a}'`,l.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);const u=s["@list"];return Array.isArray(u)?u.length===0?[this.rdfNil]:this.parsingContext.idStack[n+1]||[]:await this.valueToTerm(await this.parsingContext.getContext(d),a,u,n-1,d.slice(0,-1))}else{if("@reverse"in s&&typeof s["@reverse"]=="boolean")return[];if("@graph"in L.getContextValueContainer(await this.parsingContext.getContext(d),a)){const u=this.parsingContext.graphContainerTermStack[n+1];return u?Object.values(u):[this.dataFactory.blankNode()]}else if("@id"in s){if(Object.keys(s).length>1&&(e=await this.parsingContext.getContext(d,0)),"@context"in s&&(e=await this.parsingContext.parseContext(s["@context"],e.getContextRaw())),s["@type"]==="@vocab")return this.nullableTermToArray(this.createVocabOrBaseTerm(e,s["@id"]));{const u=s["@id"];let y;if(typeof u=="object")if(this.parsingContext.rdfstar)y=this.parsingContext.idStack[n+1][0];else throw new l.ErrorCoded(`Found illegal @id '${s}'`,l.ERROR_CODES.INVALID_ID_VALUE);else y=this.resourceToTerm(e,u);return this.nullableTermToArray(y)}}else return this.parsingContext.emittedStack[n+1]||s&&typeof s=="object"&&Object.keys(s).length===0?this.parsingContext.idStack[n+1]||(this.parsingContext.idStack[n+1]=[this.dataFactory.blankNode()]):[]}case"string":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(e,a),a,s,null));case"boolean":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(e,a),a,(!!s).toString(),this.dataFactory.namedNode(L.XSD_BOOLEAN)));case"number":return this.nullableTermToArray(this.stringValueToTerm(n,await this.getContextSelfOrPropertyScoped(e,a),a,s,this.dataFactory.namedNode(s%1===0&&s<1e21?L.XSD_INTEGER:L.XSD_DOUBLE)));default:return this.parsingContext.emitError(new Error(`Could not determine the RDF type of a ${c}`)),[]}}async getContextSelfOrPropertyScoped(e,a){const s=e.getContextRaw()[a];return s&&typeof s=="object"&&"@context"in s&&(e=await this.parsingContext.parseContext(s,e.getContextRaw(),!0)),e}nullableTermToArray(e){return e?[e]:[]}predicateToTerm(e,a){const s=e.expandTerm(a,!0,this.parsingContext.getExpandOptions());if(!s)return null;if(s[0]==="_"&&s[1]===":")return this.parsingContext.produceGeneralizedRdf?this.dataFactory.blankNode(s.substr(2)):null;if(L.isValidIri(s))return this.dataFactory.namedNode(s);if(s&&this.parsingContext.strictValues)this.parsingContext.emitError(new l.ErrorCoded(`Invalid predicate IRI: ${s}`,l.ERROR_CODES.INVALID_IRI_MAPPING));else return null;return null}resourceToTerm(e,a){if(a.startsWith("_:"))return this.dataFactory.blankNode(a.substr(2));const s=e.expandTerm(a,!1,this.parsingContext.getExpandOptions());if(!L.isValidIri(s))if(s&&this.parsingContext.strictValues)this.parsingContext.emitError(new Error(`Invalid resource IRI: ${s}`));else return null;return this.dataFactory.namedNode(s)}createVocabOrBaseTerm(e,a){if(a.startsWith("_:"))return this.dataFactory.blankNode(a.substr(2));const s=this.parsingContext.getExpandOptions();let n=e.expandTerm(a,!0,s);if(n===a&&(n=e.expandTerm(a,!1,s)),!L.isValidIri(n))if(n&&this.parsingContext.strictValues&&!n.startsWith("@"))this.parsingContext.emitError(new Error(`Invalid term IRI: ${n}`));else return null;return this.dataFactory.namedNode(n)}intToString(e,a){return typeof e=="number"?Number.isFinite(e)?e%1===0&&(!a||a.value!==L.XSD_DOUBLE)?Number(e).toString():e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"):e>0?"INF":"-INF":e}stringValueToTerm(e,a,s,n,d){const c=L.getContextValueType(a,s);if(c)if(c==="@id"){if(!d)return this.resourceToTerm(a,this.intToString(n,d))}else if(c==="@vocab"){if(!d)return this.createVocabOrBaseTerm(a,this.intToString(n,d))}else d=this.dataFactory.namedNode(c);if(!d){const u=L.getContextValueLanguage(a,s),y=L.getContextValueDirection(a,s);return y&&this.parsingContext.rdfDirection?this.createLanguageDirectionLiteral(e,this.intToString(n,d),u,y):this.dataFactory.literal(this.intToString(n,d),u)}return this.dataFactory.literal(this.intToString(n,d),d)}createLanguageDirectionLiteral(e,a,s,n){if(this.parsingContext.rdfDirection==="i18n-datatype")return s||(s=""),this.dataFactory.literal(a,this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${s}_${n}`));{const d=this.dataFactory.blankNode(),c=this.getDefaultGraph();return this.parsingContext.emitQuad(e,this.dataFactory.quad(d,this.dataFactory.namedNode(L.RDF+"value"),this.dataFactory.literal(a),c)),s&&this.parsingContext.emitQuad(e,this.dataFactory.quad(d,this.dataFactory.namedNode(L.RDF+"language"),this.dataFactory.literal(s),c)),this.parsingContext.emitQuad(e,this.dataFactory.quad(d,this.dataFactory.namedNode(L.RDF+"direction"),this.dataFactory.literal(n),c)),d}}valueToJsonString(e){return E(e)}async unaliasKeyword(e,a,s,n,d){if(Number.isInteger(e))return e;if(!n){const c=this.parsingContext.unaliasedKeywordCacheStack[s];if(c)return c}if(!l.Util.isPotentialKeyword(e)){d=d||await this.parsingContext.getContext(a);let c=d.getContextRaw()[e];c&&typeof c=="object"&&(c=c["@id"]),l.Util.isValidKeyword(c)&&(e=c)}return n?e:this.parsingContext.unaliasedKeywordCacheStack[s]=e}async unaliasKeywordParent(e,a){return await this.unaliasKeyword(a>0&&e[a-1],e,a-1)}async unaliasKeywords(e,a,s,n){const d={};for(const c in e)d[await this.unaliasKeyword(c,a,s+1,!0,n)]=e[c];return d}async isLiteral(e,a){for(let s=a;s>=0;s--){if(await this.unaliasKeyword(e[s],e,s)==="@annotation")return!1;if(this.parsingContext.literalStack[s]||this.parsingContext.jsonLiteralStack[s])return!0}return!1}async getDepthOffsetGraph(e,a){for(let s=e-1;s>0;s--)if(await this.unaliasKeyword(a[s],a,s)==="@graph"){const n=(await r.EntryHandlerContainer.getContainerHandler(this.parsingContext,a,s)).containers;return r.EntryHandlerContainer.isComplexGraphContainer(n)?-1:e-s-1}return-1}validateReverseSubject(e){if(e.termType==="Literal")throw new l.ErrorCoded(`Found illegal literal in subject position: ${e.value}`,l.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}getDefaultGraph(){return this.parsingContext.defaultGraph||this.dataFactory.defaultGraph()}async getGraphContainerValue(e,a){let s=this.getDefaultGraph();const{containers:n,depth:d}=await r.EntryHandlerContainer.getContainerHandler(this.parsingContext,e,a);if("@graph"in n){const c=r.EntryHandlerContainer.getContainerGraphIndex(n,d,e),u=this.parsingContext.graphContainerTermStack[d];if(s=u?u[c]:null,!s){let y=null;if("@id"in n){const I=await this.getContainerKey(e[d],e,d);I!==null&&(y=await this.resourceToTerm(await this.parsingContext.getContext(e),I))}y||(y=this.dataFactory.blankNode()),this.parsingContext.graphContainerTermStack[d]||(this.parsingContext.graphContainerTermStack[d]={}),s=this.parsingContext.graphContainerTermStack[d][c]=y}}return s}async getPropertiesDepth(e,a){let s=a;for(let n=a-1;n>0;n--)if(typeof e[n]!="number"){const d=await this.unaliasKeyword(e[n],e,n);if(d==="@reverse")return n;if(d==="@nest")s=n;else return s}return s}async getContainerKey(e,a,s){const n=await this.unaliasKeyword(e,a,s);return n==="@none"?null:n}validateReverseInEmbeddedNode(e,a,s){if(s&&a&&!this.parsingContext.rdfstarReverseInEmbedded)throw new l.ErrorCoded(`Illegal reverse property in embedded node in ${e}`,l.ERROR_CODES.INVALID_EMBEDDED_NODE)}emitQuadChecked(e,a,s,n,d,c,u){let y;if(c?(this.validateReverseSubject(n),y=this.dataFactory.quad(n,s,a,d)):y=this.dataFactory.quad(a,s,n,d),u){if(y.graph.termType!=="DefaultGraph"&&(y=this.dataFactory.quad(y.subject,y.predicate,y.object)),this.parsingContext.idStack[e-1])throw new l.ErrorCoded("Illegal multiple properties in an embedded node",l.ERROR_CODES.INVALID_EMBEDDED_NODE);this.parsingContext.idStack[e-1]=[y]}else this.parsingContext.emitQuad(e,y);const I=this.parsingContext.annotationsBuffer[e];if(I){for(const p of I)this.emitAnnotation(e,y,p);delete this.parsingContext.annotationsBuffer[e]}}emitAnnotation(e,a,s){let n;s.reverse?(this.validateReverseSubject(s.object),n=this.dataFactory.quad(s.object,s.predicate,a)):n=this.dataFactory.quad(a,s.predicate,s.object),this.parsingContext.emitQuad(e,n);for(const d of s.nestedAnnotations)this.emitAnnotation(e,n,d)}};return ie.Util=f,f.XSD="http://www.w3.org/2001/XMLSchema#",f.XSD_BOOLEAN=f.XSD+"boolean",f.XSD_INTEGER=f.XSD+"integer",f.XSD_DOUBLE=f.XSD+"double",f.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ie}Object.defineProperty(Re,"__esModule",{value:!0});Re.EntryHandlerArrayValue=void 0;const Ir=q(),It=j;class Cr{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,r,E,f,o){return this.test(t,r,null,E,f)}async test(t,r,E,f,o){return typeof f[o]=="number"}async handle(t,r,E,f,o,e){let a=await r.unaliasKeywordParent(f,e);if(a==="@list"){let s=null,n=0;for(let d=e-2;d>0;d--){const c=f[d];if(typeof c=="string"||typeof c=="number"){n=d,s=c;break}}if(s!==null){const d=await r.valueToTerm(await t.getContext(f),s,o,e,f);for(const c of d)await this.handleListElement(t,r,c,o,e,f.slice(0,n),n);d.length===0&&await this.handleListElement(t,r,null,o,e,f.slice(0,n),n)}}else if(a==="@set")await t.newOnValueJob(f.slice(0,-2),o,e-2,!1);else if(a!==void 0&&a!=="@type"){for(let n=e-1;n>0;n--)if(typeof f[n]!="number"){a=await r.unaliasKeyword(f[n],f,n);break}const s=await t.getContext(f.slice(0,-1));if("@list"in Ir.Util.getContextValueContainer(s,a)){t.emittedStack[e+1]=!0;const n=await r.valueToTerm(await t.getContext(f),a,o,e,f);for(const d of n)await this.handleListElement(t,r,d,o,e,f.slice(0,-1),e-1);n.length===0&&await this.handleListElement(t,r,null,o,e,f.slice(0,-1),e-1)}else t.shiftStack(e,1),await t.newOnValueJob(f.slice(0,-1),o,e-1,!1),t.contextTree.removeContext(f.slice(0,-1))}}async handleListElement(t,r,E,f,o,e,a){let s=t.listPointerStack[o];if(f!==null&&(await r.unaliasKeywords(f,e,o))["@value"]!==null){if(!s||!s.value){const n=r.dataFactory.blankNode();s={value:n,listRootDepth:a,listId:n}}else{const n=r.dataFactory.blankNode();t.emitQuad(o,r.dataFactory.quad(s.value,r.rdfRest,n,r.getDefaultGraph())),s.value=n}E&&t.emitQuad(o,r.dataFactory.quad(s.value,r.rdfFirst,E,r.getDefaultGraph()))}else s||(s={listRootDepth:a,listId:r.rdfNil});t.listPointerStack[o]=s,t.rdfstar&&t.annotationsBuffer[o]&&t.emitError(new It.ErrorCoded("Found an illegal annotation inside a list",It.ERROR_CODES.INVALID_ANNOTATION))}}Re.EntryHandlerArrayValue=Cr;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.EntryHandlerInvalidFallback=void 0;class _r{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,r,E,f,o){return!1}async test(t,r,E,f,o){return!0}async handle(t,r,E,f,o,e){t.emittedStack[e]=!1}}Se.EntryHandlerInvalidFallback=_r;var Te={},K={};Object.defineProperty(K,"__esModule",{value:!0});K.EntryHandlerKeyword=void 0;class br{constructor(t){this.keyword=t}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,r,E,f,o){return!1}async test(t,r,E,f,o){return E===this.keyword}}K.EntryHandlerKeyword=br;Object.defineProperty(Te,"__esModule",{value:!0});Te.EntryHandlerKeywordContext=void 0;const Ct=j,Rr=K;class Or extends Rr.EntryHandlerKeyword{constructor(){super("@context")}isStackProcessor(){return!1}async handle(t,r,E,f,o,e){t.streamingProfile&&(t.processingStack[e]||t.processingType[e]||t.idStack[e]!==void 0)&&t.emitError(new Ct.ErrorCoded("Found an out-of-order context, while streaming is enabled.(disable `streamingProfile`)",Ct.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));const a=t.getContext(f),s=t.parseContext(o,(await a).getContextRaw());t.contextTree.setContext(f.slice(0,-1),s),t.emitContext(o),await t.validateContext(await s)}}Te.EntryHandlerKeywordContext=Or;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.EntryHandlerKeywordGraph=void 0;const xr=K;class mr extends xr.EntryHandlerKeyword{constructor(){super("@graph")}async handle(t,r,E,f,o,e){t.graphStack[e+1]=!0}}Ne.EntryHandlerKeywordGraph=mr;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.EntryHandlerKeywordId=void 0;const G=j,Sr=K;class Tr extends Sr.EntryHandlerKeyword{constructor(){super("@id")}isStackProcessor(){return!1}async handle(t,r,E,f,o,e){if(typeof o!="string"){if(t.rdfstar&&typeof o=="object"){const s=Object.keys(o);s.length===1&&s[0]==="@id"&&t.emitError(new G.ErrorCoded(`Invalid embedded node without property with @id ${o["@id"]}`,G.ERROR_CODES.INVALID_EMBEDDED_NODE))}else t.emitError(new G.ErrorCoded(`Found illegal @id '${o}'`,G.ERROR_CODES.INVALID_ID_VALUE));return}const a=await r.getPropertiesDepth(f,e);if(t.idStack[a]!==void 0&&(t.idStack[a][0].listHead?t.emitError(new G.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${f[e-1]}'`,G.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT)):t.emitError(new G.ErrorCoded(`Found duplicate @ids '${t.idStack[a][0].value}' and '${o}'`,G.ERROR_CODES.COLLIDING_KEYWORDS))),t.rdfstar&&t.annotationsBuffer[e])for(const s of t.annotationsBuffer[e])s.depth===e&&t.emitError(new G.ErrorCoded(`Found an illegal @id inside an annotation: ${o}`,G.ERROR_CODES.INVALID_ANNOTATION));t.idStack[a]=r.nullableTermToArray(await r.resourceToTerm(await t.getContext(f),o))}}Ae.EntryHandlerKeywordId=Tr;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.EntryHandlerKeywordIncluded=void 0;const z=j,Nr=K;class Ar extends Nr.EntryHandlerKeyword{constructor(){super("@included")}async handle(t,r,E,f,o,e){typeof o!="object"&&t.emitError(new z.ErrorCoded(`Found illegal @included '${o}'`,z.ERROR_CODES.INVALID_INCLUDED_VALUE));const a=await r.unaliasKeywords(o,f,e,await t.getContext(f));"@value"in a&&t.emitError(new z.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(o)}'`,z.ERROR_CODES.INVALID_INCLUDED_VALUE)),"@list"in a&&t.emitError(new z.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(o)}'`,z.ERROR_CODES.INVALID_INCLUDED_VALUE)),t.emittedStack[e]=!1}}ve.EntryHandlerKeywordIncluded=Ar;var De={};Object.defineProperty(De,"__esModule",{value:!0});De.EntryHandlerKeywordNest=void 0;const ye=j,vr=K;class Dr extends vr.EntryHandlerKeyword{constructor(){super("@nest")}async handle(t,r,E,f,o,e){typeof o!="object"&&t.emitError(new ye.ErrorCoded(`Found invalid @nest entry for '${E}': '${o}'`,ye.ERROR_CODES.INVALID_NEST_VALUE)),"@value"in await r.unaliasKeywords(o,f,e,await t.getContext(f))&&t.emitError(new ye.ErrorCoded(`Found an invalid @value node for '${E}'`,ye.ERROR_CODES.INVALID_NEST_VALUE)),t.emittedStack[e]=!1}}De.EntryHandlerKeywordNest=Dr;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.EntryHandlerKeywordType=void 0;const ge=j,pe=q(),Lr=xe(),Pr=K;class Vr extends Pr.EntryHandlerKeyword{constructor(){super("@type")}isStackProcessor(){return!1}async handle(t,r,E,f,o,e){const a=f[e],s=await t.getContext(f),n=r.rdfType,d=await r.unaliasKeywordParent(f,e),c=pe.Util.isPropertyReverse(s,a,d),u=pe.Util.isPropertyInEmbeddedNode(d);r.validateReverseInEmbeddedNode(E,c,u);const y=pe.Util.isPropertyInAnnotationObject(d),I=Array.isArray(o)?o:[o];for(const _ of I){typeof _!="string"&&t.emitError(new ge.ErrorCoded(`Found illegal @type '${_}'`,ge.ERROR_CODES.INVALID_TYPE_VALUE));const T=r.createVocabOrBaseTerm(s,_);T&&await Lr.EntryHandlerPredicate.handlePredicateObject(t,r,f,e,n,T,c,u,y)}let p=Promise.resolve(s),b=!1;for(const _ of I.sort()){const T=pe.Util.getContextValue(s,"@context",_,null);T&&(b=!0,p=p.then(m=>t.parseContext(T,m.getContextRaw())))}t.streamingProfile&&(b||!t.streamingProfileAllowOutOfOrderPlainType)&&(t.processingStack[e]||t.idStack[e])&&t.emitError(new ge.ErrorCoded("Found an out-of-order type-scoped context, while streaming is enabled.(disable `streamingProfile`)",ge.ERROR_CODES.INVALID_STREAMING_KEY_ORDER)),b&&(p=p.then(_=>("@propagate"in _.getContextRaw()||(_.getContextRaw()["@propagate"]=!1),_.getContextRaw()["@propagate"]===!1&&(_.getContextRaw()["@__propagateFallback"]=s.getContextRaw()),_)),t.contextTree.setContext(f.slice(0,f.length-1),p)),t.processingType[e]=!0}}Le.EntryHandlerKeywordType=Vr;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.EntryHandlerKeywordUnknownFallback=void 0;const ce=j;class Ve{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(t,r,E,f,o){const e=await r.unaliasKeyword(E[f],E,f);return ce.Util.isPotentialKeyword(e)?!(!o&&e==="@list"):!1}async test(t,r,E,f,o){return ce.Util.isPotentialKeyword(E)}async handle(t,r,E,f,o,e){const a=Ve.VALID_KEYWORDS_TYPES[E];a!==void 0?a&&typeof o!==a.type&&t.emitError(new ce.ErrorCoded(`Invalid value type for '${E}' with value '${o}'`,a.errorCode)):t.strictValues&&t.emitError(new Error(`Unknown keyword '${E}' with value '${o}'`)),t.emittedStack[e]=!1}}Pe.EntryHandlerKeywordUnknownFallback=Ve;Ve.VALID_KEYWORDS_TYPES={"@index":{type:"string",errorCode:ce.ERROR_CODES.INVALID_INDEX_VALUE},"@list":null,"@reverse":{type:"object",errorCode:ce.ERROR_CODES.INVALID_REVERSE_VALUE},"@set":null,"@value":null};var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.EntryHandlerKeywordValue=void 0;const Ur=K;class jr extends Ur.EntryHandlerKeyword{constructor(){super("@value")}async validate(t,r,E,f,o){const e=E[f];return e&&!t.literalStack[f]&&await this.test(t,r,e,E,f)&&(t.literalStack[f]=!0),super.validate(t,r,E,f,o)}async test(t,r,E,f,o){return await r.unaliasKeyword(f[o],f.slice(0,f.length-1),o-1,!0)==="@value"}async handle(t,r,E,f,o,e){t.literalStack[e]=!0,delete t.unidentifiedValuesBuffer[e],delete t.unidentifiedGraphsBuffer[e],t.emittedStack[e]=!1}}Ue.EntryHandlerKeywordValue=jr;var de={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.ContextTree=void 0;class Xe{constructor(){this.subTrees={}}getContext(t){if(t.length>0){const[r,...E]=t,f=this.subTrees[r];if(f){const o=f.getContext(E);if(o)return o.then(({context:e,depth:a})=>({context:e,depth:a+1}))}}return this.context?this.context.then(r=>({context:r,depth:0})):null}setContext(t,r){if(t.length===0)this.context=r;else{const[E,...f]=t;let o=this.subTrees[E];o||(o=this.subTrees[E]=new Xe),o.setContext(f,r)}}removeContext(t){this.setContext(t,null)}}je.ContextTree=Xe;var _t;function Fr(){if(_t)return de;_t=1,Object.defineProperty(de,"__esModule",{value:!0}),de.ParsingContext=void 0;const l=j,t=ee,r=je,E=Gt();let f=class Kt{constructor(e){this.contextParser=new l.ContextParser({documentLoader:e.documentLoader,skipValidation:e.skipContextValidation}),this.streamingProfile=!!e.streamingProfile,this.baseIRI=e.baseIRI,this.produceGeneralizedRdf=!!e.produceGeneralizedRdf,this.allowSubjectList=!!e.allowSubjectList,this.processingMode=e.processingMode||E.JsonLdParser.DEFAULT_PROCESSING_MODE,this.strictValues=!!e.strictValues,this.validateValueIndexes=!!e.validateValueIndexes,this.defaultGraph=e.defaultGraph,this.rdfDirection=e.rdfDirection,this.normalizeLanguageTags=e.normalizeLanguageTags,this.streamingProfileAllowOutOfOrderPlainType=e.streamingProfileAllowOutOfOrderPlainType,this.rdfstar=e.rdfstar!==!1,this.rdfstarReverseInEmbedded=e.rdfstarReverseInEmbedded,this.topLevelProperties=!1,this.activeProcessingMode=parseFloat(this.processingMode),this.processingStack=[],this.processingType=[],this.emittedStack=[],this.idStack=[],this.graphStack=[],this.graphContainerTermStack=[],this.listPointerStack=[],this.contextTree=new r.ContextTree,this.literalStack=[],this.validationStack=[],this.unaliasedKeywordCacheStack=[],this.jsonLiteralStack=[],this.unidentifiedValuesBuffer=[],this.unidentifiedGraphsBuffer=[],this.annotationsBuffer=[],this.pendingContainerFlushBuffers=[],this.parser=e.parser,e.context?(this.rootContext=this.parseContext(e.context),this.rootContext.then(a=>this.validateContext(a))):this.rootContext=Promise.resolve(new l.JsonLdContextNormalized(this.baseIRI?{"@base":this.baseIRI,"@__baseDocument":!0}:{}))}async parseContext(e,a,s){return this.contextParser.parse(e,{baseIRI:this.baseIRI,ignoreProtection:s,normalizeLanguageTags:this.normalizeLanguageTags,parentContext:a,processingMode:this.activeProcessingMode})}validateContext(e){const a=e.getContextRaw()["@version"];if(a){if(this.activeProcessingMode&&a>this.activeProcessingMode)throw new t.ErrorCoded(`Unsupported JSON-LD version '${a}' under active processing mode ${this.activeProcessingMode}.`,t.ERROR_CODES.PROCESSING_MODE_CONFLICT);if(this.activeProcessingMode&&a0&&s.context.getContextRaw()["@propagate"]===!1&&s.depth!==a&&!n);return s.depth===0&&s.context.getContextRaw()["@propagate"]===!1&&s.depth!==a&&(s.context=new l.JsonLdContextNormalized({})),s}async newOnValueJob(e,a,s,n){await this.parser.newOnValueJob(e,a,s,n)}async handlePendingContainerFlushBuffers(){if(this.pendingContainerFlushBuffers.length>0){for(const e of this.pendingContainerFlushBuffers)await this.parser.flushBuffer(e.depth,e.keys),this.parser.flushStacks(e.depth);return this.pendingContainerFlushBuffers.splice(0,this.pendingContainerFlushBuffers.length),!0}else return!1}emitQuad(e,a){e===1&&(this.topLevelProperties=!0),this.parser.push(a)}emitError(e){this.parser.emit("error",e)}emitContext(e){this.parser.emit("context",e)}getUnidentifiedValueBufferSafe(e){let a=this.unidentifiedValuesBuffer[e];return a||(a=[],this.unidentifiedValuesBuffer[e]=a),a}getUnidentifiedGraphBufferSafe(e){let a=this.unidentifiedGraphsBuffer[e];return a||(a=[],this.unidentifiedGraphsBuffer[e]=a),a}getAnnotationsBufferSafe(e){let a=this.annotationsBuffer[e];return a||(a=[],this.annotationsBuffer[e]=a),a}getExpandOptions(){return Kt.EXPAND_OPTIONS[this.activeProcessingMode]}shiftStack(e,a){const s=this.idStack[e+a];if(s&&(this.idStack[e]=s,this.emittedStack[e]=!0,delete this.idStack[e+a]),this.pendingContainerFlushBuffers.length)for(const n of this.pendingContainerFlushBuffers)n.depth>=e+a&&(n.depth-=a,n.keys.splice(e,a));this.unidentifiedValuesBuffer[e+a]&&(this.unidentifiedValuesBuffer[e]=this.unidentifiedValuesBuffer[e+a],delete this.unidentifiedValuesBuffer[e+a]),this.annotationsBuffer[e+a-1]&&(this.annotationsBuffer[e-1]||(this.annotationsBuffer[e-1]=[]),this.annotationsBuffer[e-1]=[...this.annotationsBuffer[e-1],...this.annotationsBuffer[e+a-1]],delete this.annotationsBuffer[e+a-1])}};return de.ParsingContext=f,f.EXPAND_OPTIONS={1:{allowPrefixForcing:!1,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!1},1.1:{allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}},de}var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.EntryHandlerKeywordAnnotation=void 0;const Br=K,bt=j;class Hr extends Br.EntryHandlerKeyword{constructor(){super("@annotation")}async handle(t,r,E,f,o,e){(typeof o=="string"||typeof o=="object"&&o["@value"])&&t.emitError(new bt.ErrorCoded(`Found illegal annotation value: ${JSON.stringify(o)}`,bt.ERROR_CODES.INVALID_ANNOTATION))}}Fe.EntryHandlerKeywordAnnotation=Hr;var Rt;function Gt(){if(Rt)return re;Rt=1,Object.defineProperty(re,"__esModule",{value:!0}),re.JsonLdParser=void 0;const l=nr,t=j,r=Ot,E=Re,f=Ht(),o=Se,e=xe(),a=Te,s=Ne,n=Ae,d=ve,c=De,u=Le,y=Pe,I=Ue,p=Fr(),b=q(),_=Pt,T=Fe;let m=class Q extends r.Transform{constructor(w){super({readableObjectMode:!0}),w=w||{},this.options=w,this.parsingContext=new p.ParsingContext(Object.assign({parser:this},w)),this.util=new b.Util({dataFactory:w.dataFactory,parsingContext:this.parsingContext}),this.jsonParser=new l,this.contextJobs=[],this.typeJobs=[],this.contextAwaitingJobs=[],this.lastDepth=0,this.lastKeys=[],this.lastOnValueJob=Promise.resolve(),this.attachJsonParserListeners(),this.on("end",()=>{typeof this.jsonParser.mode<"u"&&this.emit("error",new Error("Unclosed document"))})}static fromHttpResponse(w,C,R,v){let h;if(C!=="application/ld+json"){if(C!=="application/json"&&!C.endsWith("+json"))throw new t.ErrorCoded(`Unsupported JSON-LD media type ${C}`,t.ERROR_CODES.LOADING_DOCUMENT_FAILED);if(R&&R.has("Link")&&R.forEach((x,N)=>{if(N==="link"){const D=(0,_.parse)(x);for(const O of D.get("rel","http://www.w3.org/ns/json-ld#context")){if(h)throw new t.ErrorCoded("Multiple JSON-LD context link headers were found on "+w,t.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);h=O.uri}}}),!h&&!(v!=null&&v.ignoreMissingContextLinkHeader))throw new t.ErrorCoded(`Missing context link header for media type ${C} on ${w}`,t.ERROR_CODES.LOADING_DOCUMENT_FAILED)}let g;if(R&&R.has("Content-Type")){const x=R.get("Content-Type"),N=/; *profile=([^"]*)/.exec(x);N&&N[1]==="http://www.w3.org/ns/json-ld#streaming"&&(g=!0)}return new Q(Object.assign({baseIRI:w,context:h,streamingProfile:g},v||{}))}import(w){if("pipe"in w){w.on("error",R=>C.emit("error",R));const C=w.pipe(new Q(this.options));return C}else{const C=new r.PassThrough({readableObjectMode:!0});w.on("error",v=>R.emit("error",v)),w.on("data",v=>C.push(v)),w.on("end",()=>C.push(null));const R=C.pipe(new Q(this.options));return R}}_transform(w,C,R){this.jsonParser.write(w),this.lastOnValueJob.then(()=>R(),v=>R(v))}async newOnValueJob(w,C,R,v){let h=!0;if(v&&R1&&(D=this.parsingContext.validationStack[this.parsingContext.validationStack.length-1].property);for(let O=Math.max(1,this.parsingContext.validationStack.length-1);O=0?this.parsingContext.idStack[w-D-1]:[await this.util.getGraphContainerValue(C,w)];if(O)for(const U of O){this.parsingContext.emittedStack[w]=!0;for(const V of h)this.util.emitQuadChecked(w,N,V.predicate,V.object,U,V.reverse,V.isEmbedded)}else{const U=this.parsingContext.getUnidentifiedGraphBufferSafe(w-await this.util.getDepthOffsetGraph(w,C)-1);for(const V of h)V.reverse?U.push({object:N,predicate:V.predicate,subject:V.object,isEmbedded:V.isEmbedded}):U.push({object:V.object,predicate:V.predicate,subject:N,isEmbedded:V.isEmbedded})}}this.parsingContext.unidentifiedValuesBuffer.splice(w,1),this.parsingContext.literalStack.splice(w,1),this.parsingContext.jsonLiteralStack.splice(w,1)}const g=this.parsingContext.unidentifiedGraphsBuffer[w];if(g){for(const N of R){const D=w===1&&N.termType==="BlankNode"&&!this.parsingContext.topLevelProperties?this.util.getDefaultGraph():N;this.parsingContext.emittedStack[w]=!0;for(const O of g)this.parsingContext.emitQuad(w,this.util.dataFactory.quad(O.subject,O.predicate,O.object,D))}this.parsingContext.unidentifiedGraphsBuffer.splice(w,1)}const x=this.parsingContext.annotationsBuffer[w];if(x){x.length>0&&w===1&&this.parsingContext.emitError(new t.ErrorCoded("Annotations can not be made on top-level nodes",t.ERROR_CODES.INVALID_ANNOTATION));const N=this.parsingContext.getAnnotationsBufferSafe(w-1);for(const D of x)N.push(D);delete this.parsingContext.annotationsBuffer[w]}}async validateKey(w,C,R){for(const v of Q.ENTRY_HANDLERS)if(await v.validate(this.parsingContext,this.util,w,C,R))return{valid:!0,property:R||v.isPropertyHandler()};return{valid:!1,property:!1}}attachJsonParserListeners(){this.jsonParser.onValue=w=>{const C=this.jsonParser.stack.length,R=new Array(C+1).fill(0).map((v,h)=>h===C?this.jsonParser.key:this.jsonParser.stack[h].key);if(!this.isParsingContextInner(C)){const v=()=>this.newOnValueJob(R,w,C,!0);if(!this.parsingContext.streamingProfile&&!this.parsingContext.contextTree.getContext(R.slice(0,-1)))if(R[C]==="@context"){let h=this.contextJobs[C];h||(h=this.contextJobs[C]=[]),h.push(v)}else R[C]==="@type"||typeof R[C]=="number"&&R[C-1]==="@type"?this.typeJobs.push({job:v,keys:R.slice(0,R.length-1)}):this.contextAwaitingJobs.push({job:v,keys:R});else this.lastOnValueJob=this.lastOnValueJob.then(v);!this.parsingContext.streamingProfile&&C===0&&(this.lastOnValueJob=this.lastOnValueJob.then(()=>this.executeBufferedJobs()))}},this.jsonParser.onError=w=>{this.emit("error",w)}}isParsingContextInner(w){for(let C=w;C>0;C--)if(this.jsonParser.stack[C-1].key==="@context")return!0;return!1}async executeBufferedJobs(){for(const w of this.contextJobs)if(w)for(const C of w)await C();this.parsingContext.unaliasedKeywordCacheStack.splice(0);for(const w of this.contextAwaitingJobs){if(this.typeJobs.length>0){const C=[],R=[];for(let g=0;gg.keys.length-x.keys.length);for(const g of v)await g.job();const h=R.sort().reverse();for(const g of h)this.typeJobs.splice(g,1)}await w.job()}}};return re.JsonLdParser=m,m.DEFAULT_PROCESSING_MODE="1.1",m.ENTRY_HANDLERS=[new E.EntryHandlerArrayValue,new a.EntryHandlerKeywordContext,new n.EntryHandlerKeywordId,new d.EntryHandlerKeywordIncluded,new s.EntryHandlerKeywordGraph,new c.EntryHandlerKeywordNest,new u.EntryHandlerKeywordType,new I.EntryHandlerKeywordValue,new T.EntryHandlerKeywordAnnotation,new f.EntryHandlerContainer,new y.EntryHandlerKeywordUnknownFallback,new e.EntryHandlerPredicate,new o.EntryHandlerInvalidFallback],re}(function(l){var t=M&&M.__createBinding||(Object.create?function(E,f,o,e){e===void 0&&(e=o);var a=Object.getOwnPropertyDescriptor(f,o);(!a||("get"in a?!f.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return f[o]}}),Object.defineProperty(E,e,a)}:function(E,f,o,e){e===void 0&&(e=o),E[e]=f[o]}),r=M&&M.__exportStar||function(E,f){for(var o in E)o!=="default"&&!Object.prototype.hasOwnProperty.call(f,o)&&t(f,E,o)};Object.defineProperty(l,"__esModule",{value:!0}),r(Gt(),l)})(mt);const ke="null:";function Kr(l){return t=>t.termType!=="NamedNode"||!t.value.startsWith(ke)?null:l.namedNode(t.value.slice(ke.length))}function Gr(l){const t=Kr(l);return r=>{const E=t(r.subject),f=t(r.predicate),o=t(r.object),e=t(r.graph);return E||f||o||e?l.quad(E||r.subject,f||r.predicate,o||r.object,e||r.graph):r}}class $r{constructor(t,{baseIRI:r=ke,context:E=null,documentLoader:f,factory:o=Mt}={}){const e=new mt.JsonLdParser({baseIRI:r,context:E,dataFactory:o,documentLoader:f,streamingProfile:!1});t.pipe(e);const a=Gr(o),s=new Ot.Transform({objectMode:!0,transform:(n,d,c)=>{c(null,a(n))}});return e.on("context",n=>{Object.entries(n).forEach(([d,c])=>{s.emit("prefix",d,o.namedNode(c))})}),e.on("error",n=>s.destroy(n)),e.pipe(s),Jt(s)}}class Qr extends $t{constructor(t){super($r,t)}}export{Qr as default}; diff --git a/converter/assets/index-Bk1OmMYS.js b/converter/assets/index-Bk1OmMYS.js new file mode 100644 index 0000000..0254e18 --- /dev/null +++ b/converter/assets/index-Bk1OmMYS.js @@ -0,0 +1,2 @@ +import{S as D}from"./index-BOvYCoiN.js";import{g as M,a as $,f as O}from"./index-DtgbetCt.js";import{r as q}from"./readable-BmS1kvD9.js";const g="http://www.w3.org/1999/02/22-rdf-syntax-ns#",m="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/",f={xsd:{decimal:`${m}decimal`,boolean:`${m}boolean`,double:`${m}double`,integer:`${m}integer`,string:`${m}string`},rdf:{type:`${g}type`,nil:`${g}nil`,first:`${g}first`,rest:`${g}rest`,langString:`${g}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}};/*! queue-microtask. MIT License. Feross Aboukhadijeh */let I;var B=typeof queueMicrotask=="function"?queueMicrotask:u=>(I||(I=Promise.resolve())).then(u).catch(e=>setTimeout(()=>{throw e},0));const G=M(B),{xsd:R}=f,U=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,F={"\\":"\\","'":"'",'"':'"',n:` +`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},z=/[\x00-\x20<>\\"\{\}\|\^\`]/,Q={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},H=/$0^/;class Z{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._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._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|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=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const i in this)!(i in Q)&&this[i]instanceof RegExp&&(this[i]=H)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,i){let t=this._input,s=t.length;for(;;){let n,_;for(;n=this._newline.exec(t);)this._comments&&(_=this._comment.exec(n[0]))&&a("comment",_[1],"",this._line,n[0].length),t=t.substr(n[0].length,t.length),s=t.length,this._line++;if(!n&&(n=this._whitespace.exec(t))&&(t=t.substr(n[0].length,t.length)),this._endOfFile.test(t))return i&&(this._comments&&(_=this._comment.exec(t))&&a("comment",_[1],"",this._line,t.length),t=null,a("eof","","",this._line,0)),this._input=t;const y=this._line,N=t[0];let l="",d="",p="",h=null,c=0,b=!1;switch(N){case"^":if(t.length<3)break;if(t[1]==="^"){if(this._previousMarker="^^",t=t.substr(2),t[0]!=="<"){b=!0;break}}else{this._n3Mode&&(c=1,l="^");break}case"<":if(h=this._unescapedIri.exec(t))l="IRI",d=h[1];else if(h=this._iri.exec(t)){if(d=this._unescape(h[1]),d===null||z.test(d))return r(this);l="IRI"}else t.length>1&&t[1]==="<"?(l="<<",c=2):this._n3Mode&&t.length>1&&t[1]==="="&&(l="inverse",c=2,d=">");break;case">":t.length>1&&t[1]===">"&&(l=">>",c=2);break;case"_":((h=this._blank.exec(t))||i&&(h=this._blank.exec(`${t} `)))&&(l="blank",p="_",d=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(t))d=h[1];else if({value:d,matchLength:c}=this._parseLiteral(t),d===null)return r(this);(h!==null||c!==0)&&(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(t))d=h[1];else if({value:d,matchLength:c}=this._parseLiteral(t),d===null)return r(this);(h!==null||c!==0)&&(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(t))&&(l="var",d=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(t))?(l="langcode",d=h[1]):(h=this._keyword.exec(t))&&(l=h[0]);break;case".":if(t.length===1?i:t[1]<"0"||t[1]>"9"){l=".",c=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(t)||i&&(h=this._number.exec(`${t} `)))&&(l="literal",d=h[0],p=typeof h[1]=="string"?R.double:typeof h[2]=="string"?R.decimal:R.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(t))?l=h[0].toUpperCase():b=!0;break;case"f":case"t":(h=this._boolean.exec(t))?(l="literal",d=h[0],p=R.boolean):b=!0;break;case"a":(h=this._shortPredicates.exec(t))?(l="abbreviation",d="a"):b=!0;break;case"=":this._n3Mode&&t.length>1&&(l="abbreviation",t[1]!==">"?(c=1,d="="):(c=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(c=1,l=N);break;default:b=!0}if(b&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(h=this._prefix.exec(t))?(l="prefix",d=h[1]||""):((h=this._prefixed.exec(t))||i&&(h=this._prefixed.exec(`${t} `)))&&(l="prefixed",p=h[1]||"",d=this._unescape(h[2]))),this._previousMarker==="^^")switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return i||!/^'''|^"""/.test(t)&&/\n|\r/.test(t)?r(this):this._input=t;const w=c||h[0].length,A=a(l,d,p,y,w);this.previousToken=A,this._previousMarker=l,t=t.substr(w,t.length)}function a(n,_,y,N,l){const d=t?s-t.length:s,p=d+l,h={type:n,value:_,prefix:y,line:N,start:d,end:p};return e(null,h),h}function r(n){e(n._syntaxError(/^\S*/.exec(t)[0]))}}_unescape(e){let i=!1;const t=e.replace(U,(s,a,r,n)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof r=="string"){let _=Number.parseInt(r,16);return _<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((_-=65536)>>10),56320+(_&1023))}return n in F?F[n]:(i=!0,"")});return i?null:t}_parseLiteral(e){if(e.length>=3){const i=e.match(/^(?:"""|"|'''|'|)/)[0],t=i.length;let s=Math.max(this._literalClosingPos,t);for(;(s=e.indexOf(i,s))>0;){let a=0;for(;e[s-a-1]==="\\";)a++;if(a%2===0){const r=e.substring(t,s),n=r.split(/\r\n|\r|\n/).length-1,_=s+t;if(t===1&&n!==0||t===3&&this._lineMode)break;return this._line+=n,{value:this._unescape(r),matchLength:_}}s++}this._literalClosingPos=e.length-t+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const i=new Error(`Unexpected "${e}" on line ${this._line}.`);return i.context={token:void 0,line:this._line,previousToken:this.previousToken},i}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,i){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof i=="function")G(()=>this._tokenizeToEnd(i,!0));else{const t=[];let s;if(this._tokenizeToEnd((a,r)=>a?s=a:t.push(r),!0),s)throw s;return t}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",t=>{this._input!==null&&t.length!==0&&(this._pendingBuffer&&(t=Buffer.concat([this._pendingBuffer,t]),this._pendingBuffer=null),t[t.length-1]&128?this._pendingBuffer=t:(typeof this._input>"u"?this._input=this._readStartingBom(typeof t=="string"?t:t.toString()):this._input+=t,this._tokenizeToEnd(i,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(i,!0)}),e.on("error",i)}}const{rdf:V,xsd:x}=f;let S,J=0;const X={namedNode:ie,blankNode:se,variable:ae,literal:re,defaultGraph:ue,quad:T,triple:T},K=X;class o{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof o?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class k extends o{get termType(){return"NamedNode"}}class j extends o{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let i=e.lastIndexOf('"')+1;return i0?"INF":"-INF")))),i===""||i===x.string?new j(`"${u}"`):new j(`"${u}"^^${i}`)}function ae(u){return new Y(u)}function ue(){return S}function T(u,e,i,t){return new te(u,e,i,t)}let E=0;class C{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&L(this,e.factory);const i=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",t=/turtle/.test(i),s=/trig/.test(i),a=/triple/.test(i),r=/quad/.test(i),n=this._n3Mode=/n3/.test(i),_=a||r;(this._supportsNamedGraphs=!(t||n))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(t||s||a||n),this._supportsRDFStar=i===""||/star|\*$/.test(i),_&&(this._resolveRelativeIRI=y=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Z({lineMode:_,n3:n}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){E=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const i=e.indexOf("#");i>=0&&(e=e.substr(0,i)),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,i,t,s,a){const r=this._n3Mode;this._contextStack.push({type:e,subject:t,predicate:s,object:a,graph:i,inverse:r?this._inversePredicate:!1,blankPrefix:r?this._prefixes._:"",quantified:r?this._quantified:null}),r&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,i){const t=this._contextStack.pop();if(!t||t.type!==e)return this._error(`Unexpected ${i.type}`,i);this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,this._n3Mode&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;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,i){let t;switch(e.type){case"IRI":case"typeIRI":const s=this._resolveIRI(e.value);if(s===null)return this._error("Invalid IRI",e);t=this._namedNode(s);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);t=this._namedNode(a+e.value);break;case"blank":t=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":t=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!i&&this._n3Mode&&t.id in this._quantified&&(t=this._quantified[t.id]),t}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return 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._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=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._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._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const i=e.type;switch(i){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${i}`,e):(this._subject=null,i==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._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._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return 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._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);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._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(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);const i=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:i?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let i=null,t=null,s=this._readListItem;const a=this._subject,r=this._contextStack,n=r[r.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,t=this._blankNode(),this.RDF_FIRST,this._subject=i=this._blankNode()),s=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,t=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),r.length!==0&&r[r.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(s=this._readPredicate,this._subject===this.RDF_NIL)return s}else if(s=this._getContextEndReader(),this._object===this.RDF_NIL)return s;t=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,s=this._readListItemDataTypeOrLang):(i=this._literal(e.value,this._namedNode(e.prefix)),s=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((i=this._readEntity(e))===void 0)return}if(t===null&&(this._subject=t=this._blankNode()),a===null?n.predicate===null?n.subject=t:n.object=t:this._emit(a,this.RDF_REST,t,this._graph),i!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,t,this.RDF_FIRST,i),this._subject=i,this._predicate=null,this._getPathReader(this._readListItem);this._emit(t,this.RDF_FIRST,i,this._graph)}return s}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let i=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const t=this._readEntity(e);if(t===void 0)return;i=this._literal(this._literalValue,t),e=null;break;case"langcode":i=this._literal(this._literalValue,e.value),e=null;break}return{token:e,literal:i}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,i){const t=this._completeLiteral(e);if(t)return this._object=t.literal,i&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),t.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(t.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let i,t=this._graph;const s=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,i=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":i=this._readPredicate;break;case",":i=this._readObject;break;default:if(this._supportsQuads&&this._graph===null&&(t=this._readEntity(e))!==void 0){i=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null){const r=this._predicate,n=this._object;a?this._emit(n,r,s,t):this._emit(s,r,n,t)}return i}_readBlankNodePunctuation(e){let i;switch(e.type){case";":i=this._readPredicate;break;case",":i=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),i}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const i=this._readEntity(e);return this._prefixes[this._prefix]=i.value,this._prefixCallback(this._prefix,i),this._readDeclarationPunctuation}_readBaseIRI(e){const i=e.type==="IRI"&&this._resolveIRI(e.value);return i?(this._setBase(i),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base 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._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let i;switch(e.type){case"IRI":case"prefixed":if((i=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._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,i,this.QUANTIFIERS_GRAPH)):this._quantified[i.id]=this._quantifier(this._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:const i=this._contextStack,t=i.length&&i[i.length-1];if(t&&t.type==="item"){const s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let i,t;const s=this._blankNode();if((t=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=s):(i=this._object,this._object=s),this._emit(i,t,s,this._graph),this._readPath}_readBackwardPath(e){const i=this._blankNode();let t,s;if((t=this._readEntity(e))!==void 0)return this._predicate===null?(s=this._subject,this._subject=i):(s=this._object,this._object=i),this._emit(i,t,s,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const i=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=i,this._readPredicate):(this._object=i,this._getContextEndReader())}_getContextEndReader(){const 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._readRDFStarTailOrGraph}}_emit(e,i,t,s){this._callback(null,this._quad(e,i,t,s||this.DEFAULTGRAPH))}_error(e,i){const t=new Error(`${e} on line ${i.line}.`);t.context={token:i,line:i.line,previousToken:this._lexer.previousToken},this._callback(t),this._callback=v}_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;const i=e.length;let t="",s=-1,a=-1,r=0,n="/";for(;s=a&&(t=t.substr(0,r)),n!=="/")return`${t}/${e.substr(s+1)}`;r=s+1}}}n=e[++s]}return t+e.substring(r)}parse(e,i,t){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${E++}_`,this._prefixCallback=t||v,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const s=[];let a;if(this._callback=(r,n)=>{r?a=r:n&&s.push(n)},this._lexer.tokenize(e).every(r=>this._readCallback=this._readCallback(r)),a)throw a;return s}this._callback=i,this._lexer.tokenize(e,(s,a)=>{s!==null?(this._callback(s),this._callback=v):this._readCallback&&(this._readCallback=this._readCallback(a))})}}function v(){}function L(u,e){const i=e.namedNode;u._namedNode=i,u._blankNode=e.blankNode,u._literal=e.literal,u._variable=e.variable,u._quad=e.quad,u.DEFAULTGRAPH=e.defaultGraph(),u.RDF_FIRST=i(f.rdf.first),u.RDF_REST=i(f.rdf.rest),u.RDF_NIL=i(f.rdf.nil),u.N3_FORALL=i(f.r.forAll),u.N3_FORSOME=i(f.r.forSome),u.ABBREVIATIONS={a:i(f.rdf.type),"=":i(f.owl.sameAs),">":i(f.log.implies)},u.QUANTIFIERS_GRAPH=i("urn:n3:quantifiers")}L(C.prototype,K);class ne extends $.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const i=new C(e);let t,s;i.parse({on:(a,r)=>{switch(a){case"data":t=r;break;case"end":s=r;break}}},(a,r)=>{a&&this.emit("error",a)||r&&this.push(r)},(a,r)=>{this.emit("prefix",a,r)}),this._transform=(a,r,n)=>{t(a),n()},this._flush=a=>{s(),a()}}import(e){return e.on("data",i=>{this.write(i)}),e.on("end",()=>{this.end()}),e.on("error",i=>{this.emit("error",i)}),this}}class he{constructor(e,{baseIRI:i="",factory:t=O,...s}={}){const a={blankNode:t.blankNode.bind(t),defaultGraph:t.defaultGraph.bind(t),literal:t.literal.bind(t),namedNode:t.namedNode.bind(t),quad:t.quad.bind(t)},r=new ne({baseIRI:i,factory:a,...s});return e.pipe(r),q(r)}}class ce extends D{constructor(e){super(he,e)}}export{ce as default}; diff --git a/converter/assets/index-Bt-DoqtB.js b/converter/assets/index-Bt-DoqtB.js new file mode 100644 index 0000000..662dbc5 --- /dev/null +++ b/converter/assets/index-Bt-DoqtB.js @@ -0,0 +1,48 @@ +import{S as hr}from"./index-BOvYCoiN.js";import{c as pr,r as gr,g as yr,a as mr}from"./index-DtgbetCt.js";import{c as vr}from"./canonicalize-DMjjQ0zD.js";var en=class Bn{constructor(t,n=new Map,r=0){this.prefix=t,this._existing=n,this.counter=r}clone(){const{prefix:t,_existing:n,counter:r}=this;return new Bn(t,new Map(n),r)}getId(t){const n=t&&this._existing.get(t);if(n)return n;const r=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,r),r}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}};(function(e,t){if(e.setImmediate)return;var n=1,r={},i=!1,a=e.document,s;function o(v){typeof v!="function"&&(v=new Function(""+v));for(var x=new Array(arguments.length-1),b=0;b"u"?typeof window>"u"?pr:window:self);const bt=self.crypto||self.msCrypto;var Pn=class{constructor(t){if(!(bt&&bt.subtle))throw new Error("crypto.subtle not found.");if(t==="sha256")this.algorithm={name:"SHA-256"};else if(t==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupport algorithm "${t}".`);this._content=""}update(t){this._content+=t}async digest(){const t=new TextEncoder().encode(this._content),n=new Uint8Array(await bt.subtle.digest(this.algorithm,t));let r="";for(let i=0;ii)&&(c&&o>0&&d>t[o-1]||!c&&ot[o+1])&&(i=d,a=o)}if(i===null)this.done=!0;else{const o=n.get(i)?a-1:a+1;t[a]=t[o],t[o]=i;for(const d of t)d>i&&n.set(d,!n.get(d))}return r}};const br="http://www.w3.org/1999/02/22-rdf-syntax-ns#",wt=br+"langString",xt="http://www.w3.org/2001/XMLSchema#string",ee="NamedNode",Ie="BlankNode",ot="Literal",cn="DefaultGraph",Me={};(()=>{const e="(?:<([^:]+:[^>]*)>)",n="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�"+"_",r=n+"0-9-·̀-ͯ‿-⁀",a="(_:(?:["+n+"0-9])(?:(?:["+r+".])*(?:["+r+"]))?)",s='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',o="(?:\\^\\^"+e+")",c="(?:"+s+"(?:"+o+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",p="[ \\t]+",h="[ \\t]*",f="(?:"+e+"|"+a+")"+p,l=e+p,u="(?:"+e+"|"+a+"|"+c+")"+h,g="(?:\\.|(?:(?:"+e+"|"+a+")"+h+"\\.))";Me.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,Me.empty=new RegExp("^"+h+"$"),Me.quad=new RegExp("^"+h+f+l+u+g+h+"$")})();var tn=class qt{static parse(t){const n=[],r={},i=t.split(Me.eoln);let a=0;for(const s of i){if(a++,Me.empty.test(s))continue;const o=s.match(Me.quad);if(o===null)throw new Error("N-Quads parse error on line "+a+".");const d={subject:null,predicate:null,object:null,graph:null};if(o[1]!==void 0?d.subject={termType:ee,value:o[1]}:d.subject={termType:Ie,value:o[2]},d.predicate={termType:ee,value:o[3]},o[4]!==void 0?d.object={termType:ee,value:o[4]}:o[5]!==void 0?d.object={termType:Ie,value:o[5]}:(d.object={termType:ot,value:void 0,datatype:{termType:ee}},o[7]!==void 0?d.object.datatype.value=o[7]:o[8]!==void 0?(d.object.datatype.value=wt,d.object.language=o[8]):d.object.datatype.value=xt,d.object.value=Nr(o[6])),o[9]!==void 0?d.graph={termType:ee,value:o[9]}:o[10]!==void 0?d.graph={termType:Ie,value:o[10]}:d.graph={termType:cn,value:""},!(d.graph.value in r))r[d.graph.value]=[d],n.push(d);else{let c=!0;const p=r[d.graph.value];for(const h of p)if(wr(h,d)){c=!1;break}c&&(p.push(d),n.push(d))}}return n}static serialize(t){Array.isArray(t)||(t=qt.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(qt.serializeQuad(r));return n.sort().join("")}static serializeQuad(t){const n=t.subject,r=t.predicate,i=t.object,a=t.graph;let s="";return n.termType===ee?s+=`<${n.value}>`:s+=`${n.value}`,s+=` <${r.value}> `,i.termType===ee?s+=`<${i.value}>`:i.termType===Ie?s+=i.value:(s+=`"${Ir(i.value)}"`,i.datatype.value===wt?i.language&&(s+=`@${i.language}`):i.datatype.value!==xt&&(s+=`^^<${i.datatype.value}>`)),a.termType===ee?s+=` <${a.value}>`:a.termType===Ie&&(s+=` ${a.value}`),s+=` . +`,s}static legacyDatasetToQuads(t){const n=[],r={"blank node":Ie,IRI:ee,literal:ot};for(const i in t)t[i].forEach(s=>{const o={};for(const d in s){const c=s[d],p={termType:r[c.type],value:c.value};p.termType===ot&&(p.datatype={termType:ee},"datatype"in c&&(p.datatype.value=c.datatype),"language"in c?("datatype"in c||(p.datatype.value=wt),p.language=c.language):"datatype"in c||(p.datatype.value=xt)),o[d]=p}i==="@default"?o.graph={termType:cn,value:""}:o.graph={termType:i.startsWith("_:")?Ie:ee,value:i},n.push(o)});return n}};function wr(e,t){return!(e.subject.termType===t.subject.termType&&e.object.termType===t.object.termType)||!(e.subject.value===t.subject.value&&e.predicate.value===t.predicate.value&&e.object.value===t.object.value)?!1:e.object.termType!==ot?!0:e.object.datatype.termType===t.object.datatype.termType&&e.object.language===t.object.language&&e.object.datatype.value===t.object.datatype.value}const xr=/["\\\n\r]/g;function Ir(e){return e.replace(xr,function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case` +`:return"\\n";case"\r":return"\\r"}})}const Er=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function Nr(e){return e.replace(Er,function(t,n,r,i){if(n)switch(n){case"t":return" ";case"b":return"\b";case"n":return` +`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(i)throw new Error("Unsupported U escape")})}const dn=en,It=Pn,_r=qn,un=tn;var Un=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new dn("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}async main(t){this.quads=t;for(const d of t)this._addBlankNodeQuadInfo({quad:d,component:d.subject}),this._addBlankNodeQuadInfo({quad:d,component:d.object}),this._addBlankNodeQuadInfo({quad:d,component:d.graph});const n=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const d of r)++i%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:d,hashToBlankNodes:n});const a=[...n.keys()].sort(),s=[];for(const d of a){const c=n.get(d);if(c.length>1){s.push(c);continue}const p=c[0];this.canonicalIssuer.getId(p)}for(const d of s){const c=[];for(const p of d){if(this.canonicalIssuer.hasId(p))continue;const h=new dn("_:b");h.getId(p);const f=await this.hashNDegreeQuads(p,h);c.push(f)}c.sort(jr);for(const p of c){const h=p.issuer.getOldIds();for(const f of h)this.canonicalIssuer.getId(f)}}const o=[];for(const d of this.quads){const c={...d};c.subject=this._useCanonicalId({component:c.subject}),c.object=this._useCanonicalId({component:c.object}),c.graph=this._useCanonicalId({component:c.graph}),o.push(un.serializeQuad(c))}return o.sort(),o.join("")}async hashFirstDegreeQuads(t){const n=[],r=this.blankNodeInfo.get(t),i=r.quads;for(const s of i){const o={subject:null,predicate:s.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(t,s.subject,"subject"),o.object=this.modifyFirstDegreeComponent(t,s.object,"object"),o.graph=this.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(un.serializeQuad(o))}n.sort();const a=new It(this.hashAlgorithm);for(const s of n)a.update(s);return r.hash=await a.digest(),r.hash}async hashRelatedBlankNode(t,n,r,i){let a;this.canonicalIssuer.hasId(t)?a=this.canonicalIssuer.getId(t):r.hasId(t)?a=r.getId(t):a=this.blankNodeInfo.get(t).hash;const s=new It(this.hashAlgorithm);return s.update(i),i!=="g"&&s.update(this.getRelatedPredicate(n)),s.update(a),s.digest()}async hashNDegreeQuads(t,n){const r=new It(this.hashAlgorithm),i=await this.createHashToRelated(t,n),a=[...i.keys()].sort();for(const s of a){r.update(s);let o="",d;const c=new _r(i.get(s));let p=0;for(;c.hasNext();){const h=c.next();++p%3===0&&await this._yield();let f=n.clone(),l="";const u=[];let g=!1;for(const y of h)if(this.canonicalIssuer.hasId(y)?l+=this.canonicalIssuer.getId(y):(f.hasId(y)||u.push(y),l+=f.getId(y)),o.length!==0&&l>o){g=!0;break}if(!g){for(const y of u){const m=await this.hashNDegreeQuads(y,f);if(l+=f.getId(y),l+=`<${m.hash}>`,f=m.issuer,o.length!==0&&l>o){g=!0;break}}g||(o.length===0||l`}async createHashToRelated(t,n){const r=new Map,i=this.blankNodeInfo.get(t).quads;let a=0;for(const s of i)++a%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:s,component:s.subject,position:"s",id:t,issuer:n,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:s,component:s.object,position:"o",id:t,issuer:n,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:s,component:s.graph,position:"g",id:t,issuer:n,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:t,hashToBlankNodes:n}){const r=await this.hashFirstDegreeQuads(t),i=n.get(r);i?i.push(t):n.set(r,[t])}_addBlankNodeQuadInfo({quad:t,component:n}){if(n.termType!=="BlankNode")return;const r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}async _addRelatedBlankNodeHash({quad:t,component:n,position:r,id:i,issuer:a,hashToRelated:s}){if(!(n.termType==="BlankNode"&&n.value!==i))return;const o=n.value,d=await this.hashRelatedBlankNode(o,t,a,r),c=s.get(d);c?c.push(o):s.set(d,[o])}_useCanonicalId({component:t}){return t.termType==="BlankNode"&&!t.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}:t}async _yield(){return new Promise(t=>setImmediate(t))}};function jr(e,t){return e.hasht.hash?1:0}const Sr=Un;var Or=class extends Sr{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,n,r){return n.termType!=="BlankNode"?n:r==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:n.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}async createHashToRelated(t,n){const r=new Map,i=this.blankNodeInfo.get(t).quads;let a=0;for(const s of i){let o,d;if(s.subject.termType==="BlankNode"&&s.subject.value!==t)d=s.subject.value,o="p";else if(s.object.termType==="BlankNode"&&s.object.value!==t)d=s.object.value,o="r";else continue;++a%100===0&&await this._yield();const c=await this.hashRelatedBlankNode(d,s,n,o),p=r.get(c);p?p.push(d):r.set(c,[d])}return r}};const fn=en,Et=Pn,Dr=qn,hn=tn;var Vn=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new fn("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){this.quads=t;for(const o of t)this._addBlankNodeQuadInfo({quad:o,component:o.subject}),this._addBlankNodeQuadInfo({quad:o,component:o.object}),this._addBlankNodeQuadInfo({quad:o,component:o.graph});const n=new Map,r=[...this.blankNodeInfo.keys()];for(const o of r)this._hashAndTrackBlankNode({id:o,hashToBlankNodes:n});const i=[...n.keys()].sort(),a=[];for(const o of i){const d=n.get(o);if(d.length>1){a.push(d);continue}const c=d[0];this.canonicalIssuer.getId(c)}for(const o of a){const d=[];for(const c of o){if(this.canonicalIssuer.hasId(c))continue;const p=new fn("_:b");p.getId(c);const h=this.hashNDegreeQuads(c,p);d.push(h)}d.sort(Rr);for(const c of d){const p=c.issuer.getOldIds();for(const h of p)this.canonicalIssuer.getId(h)}}const s=[];for(const o of this.quads){const d={...o};d.subject=this._useCanonicalId({component:d.subject}),d.object=this._useCanonicalId({component:d.object}),d.graph=this._useCanonicalId({component:d.graph}),s.push(hn.serializeQuad(d))}return s.sort(),s.join("")}hashFirstDegreeQuads(t){const n=[],r=this.blankNodeInfo.get(t),i=r.quads;for(const s of i){const o={subject:null,predicate:s.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(t,s.subject,"subject"),o.object=this.modifyFirstDegreeComponent(t,s.object,"object"),o.graph=this.modifyFirstDegreeComponent(t,s.graph,"graph"),n.push(hn.serializeQuad(o))}n.sort();const a=new Et(this.hashAlgorithm);for(const s of n)a.update(s);return r.hash=a.digest(),r.hash}hashRelatedBlankNode(t,n,r,i){let a;this.canonicalIssuer.hasId(t)?a=this.canonicalIssuer.getId(t):r.hasId(t)?a=r.getId(t):a=this.blankNodeInfo.get(t).hash;const s=new Et(this.hashAlgorithm);return s.update(i),i!=="g"&&s.update(this.getRelatedPredicate(n)),s.update(a),s.digest()}hashNDegreeQuads(t,n){const r=new Et(this.hashAlgorithm),i=this.createHashToRelated(t,n),a=[...i.keys()].sort();for(const s of a){r.update(s);let o="",d;const c=new Dr(i.get(s));for(;c.hasNext();){const p=c.next();let h=n.clone(),f="";const l=[];let u=!1;for(const g of p)if(this.canonicalIssuer.hasId(g)?f+=this.canonicalIssuer.getId(g):(h.hasId(g)||l.push(g),f+=h.getId(g)),o.length!==0&&f>o){u=!0;break}if(!u){for(const g of l){const y=this.hashNDegreeQuads(g,h);if(f+=h.getId(g),f+=`<${y.hash}>`,h=y.issuer,o.length!==0&&f>o){u=!0;break}}u||(o.length===0||f`}createHashToRelated(t,n){const r=new Map,i=this.blankNodeInfo.get(t).quads;for(const a of i)this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:t,issuer:n,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:t,issuer:n,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:t,issuer:n,hashToRelated:r});return r}_hashAndTrackBlankNode({id:t,hashToBlankNodes:n}){const r=this.hashFirstDegreeQuads(t),i=n.get(r);i?i.push(t):n.set(r,[t])}_addBlankNodeQuadInfo({quad:t,component:n}){if(n.termType!=="BlankNode")return;const r=n.value,i=this.blankNodeInfo.get(r);i?i.quads.add(t):this.blankNodeInfo.set(r,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:n,position:r,id:i,issuer:a,hashToRelated:s}){if(!(n.termType==="BlankNode"&&n.value!==i))return;const o=n.value,d=this.hashRelatedBlankNode(o,t,a,r),c=s.get(d);c?c.push(o):s.set(d,[o])}_useCanonicalId({component:t}){return t.termType==="BlankNode"&&!t.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}:t}};function Rr(e,t){return e.hasht.hash?1:0}const Lr=Vn;var Ar=class extends Lr{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(t,n,r){return n.termType!=="BlankNode"?n:r==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:n.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,n){const r=new Map,i=this.blankNodeInfo.get(t).quads;for(const a of i){let s,o;if(a.subject.termType==="BlankNode"&&a.subject.value!==t)o=a.subject.value,s="p";else if(a.object.termType==="BlankNode"&&a.object.value!==t)o=a.object.value,s="r";else continue;const d=this.hashRelatedBlankNode(o,a,n,s),c=r.get(d);c?c.push(o):r.set(d,[o])}return r}};const Tr=Un,kr=Or,$r=Vn,Jr=Ar;let De;try{De=gr}catch{}const we={};var Mr=we;we.NQuads=tn;we.IdentifierIssuer=en;we._rdfCanonizeNative=function(e){return e&&(De=e),De};we.canonize=async function(e,t){if(Array.isArray(e)||(e=we.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!De)throw new Error("rdf-canonize-native not available");return new Promise((n,r)=>De.canonize(e,t,(i,a)=>i?r(i):n(a)))}if(t.algorithm==="URDNA2015")return new Tr(t).main(e);if(t.algorithm==="URGNA2012")return new kr(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")};we._canonizeSync=function(e,t){if(Array.isArray(e)||(e=we.NQuads.legacyDatasetToQuads(e)),t.useNative){if(De)return De.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if(t.algorithm==="URDNA2015")return new $r(t).main(e);if(t.algorithm==="URGNA2012")return new Jr(t).main(e);throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")};var nn=Mr;const Z={};var G=Z;Z.isArray=Array.isArray;Z.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]";Z.isDouble=e=>Z.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21);Z.isEmptyObject=e=>Z.isObject(e)&&Object.keys(e).length===0;Z.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]";Z.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e);Z.isObject=e=>Object.prototype.toString.call(e)==="[object Object]";Z.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]";Z.isUndefined=e=>typeof e>"u";const Re=G,he={};var pe=he;he.isSubject=e=>Re.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)?Object.keys(e).length>1||!("@id"in e):!1;he.isSubjectReference=e=>Re.isObject(e)&&Object.keys(e).length===1&&"@id"in e;he.isValue=e=>Re.isObject(e)&&"@value"in e;he.isList=e=>Re.isObject(e)&&"@list"in e;he.isGraph=e=>Re.isObject(e)&&"@graph"in e&&Object.keys(e).filter(t=>t!=="@id"&&t!=="@index").length===1;he.isSimpleGraph=e=>he.isGraph(e)&&!("@id"in e);he.isBlankNode=e=>{if(Re.isObject(e)){if("@id"in e){const t=e["@id"];return!Re.isString(t)||t.indexOf("_:")===0}return Object.keys(e).length===0||!("@value"in e||"@set"in e||"@list"in e)}return!1};var se=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",n="jsonld.Error",r={}){super(t),this.name=n,this.message=t,this.details=r}};const Ze=pe,M=G,Gn=nn.IdentifierIssuer,Fr=se,Hr=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,Br=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,Pr=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,qr=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,Ur=/^@[a-zA-Z]+$/,pn={headers:{accept:"application/ld+json, application/json"}},j={};var C=j;j.IdentifierIssuer=Gn;j.REGEX_BCP47=Hr;j.REGEX_KEYWORD=Ur;j.clone=function(e){if(e&&typeof e=="object"){let t;if(M.isArray(e)){t=[];for(let n=0;n{if(Object.keys(e).some(n=>n.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+pn.headers.accept+'" is supported.');return Object.assign({Accept:pn.headers.accept},e)};j.parseLinkHeader=e=>{const t={},n=e.match(Br);for(let r=0;r{if(!M.isString(e)&&!(M.isArray(e)&&e.every(n=>M.isString(n)))){if(t&&M.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&j.asArray(e["@default"]).every(n=>M.isString(n)))return}throw new Fr('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}};j.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!M.isArray(n)||n.length>0}return!1};j.hasValue=(e,t,n)=>{if(j.hasProperty(e,t)){let r=e[t];const i=Ze.isList(r);if(M.isArray(r)||i){i&&(r=r["@list"]);for(let a=0;a{if(r=r||{},"propertyIsArray"in r||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(M.isArray(n)){n.length===0&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]);j.removeProperty=(e,t)=>{delete e[t]};j.removeValue=(e,t,n,r)=>{r=r||{},"propertyIsArray"in r||(r.propertyIsArray=!1);const i=j.getValues(e,t).filter(a=>!j.compareValues(a,n));i.length===0?j.removeProperty(e,t):i.length===1&&!r.propertyIsArray?e[t]=i[0]:e[t]=i};j.relabelBlankNodes=(e,t)=>{t=t||{};const n=t.issuer||new Gn("_:b");return lt(n,e)};j.compareValues=(e,t)=>e===t||Ze.isValue(e)&&Ze.isValue(t)&&e["@value"]===t["@value"]&&e["@type"]===t["@type"]&&e["@language"]===t["@language"]&&e["@index"]===t["@index"]?!0:M.isObject(e)&&"@id"in e&&M.isObject(t)&&"@id"in t?e["@id"]===t["@id"]:!1;j.compareShortestLeast=(e,t)=>e.length{const n={},r=F.parsers[t||"full"],i=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=i[a]===void 0?null:i[a];return(n.scheme==="https"&&n.port==="443"||n.scheme==="http"&&n.port==="80")&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=F.removeDotSegments(n.path),n};F.prependBase=(e,t)=>{if(e===null||F.isAbsolute(t))return t;(!e||mt.isString(e))&&(e=F.parse(e||""));const n=F.parse(t),r={protocol:e.protocol||""};if(n.authority!==null)r.authority=n.authority,r.path=n.path,r.query=n.query;else if(r.authority=e.authority,n.path==="")r.path=e.path,n.query!==null?r.query=n.query:r.query=e.query;else{if(n.path.indexOf("/")===0)r.path=n.path;else{let a=e.path;a=a.substr(0,a.lastIndexOf("/")+1),(a.length>0||e.authority)&&a.substr(-1)!=="/"&&(a+="/"),a+=n.path,r.path=a}r.query=n.query}n.path!==""&&(r.path=F.removeDotSegments(r.path));let i=r.protocol;return r.authority!==null&&(i+="//"+r.authority),i+=r.path,r.query!==null&&(i+="?"+r.query),n.fragment!==null&&(i+="#"+n.fragment),i===""&&(i="./"),i};F.removeBase=(e,t)=>{if(e===null)return t;(!e||mt.isString(e))&&(e=F.parse(e||""));let n="";if(e.href!==""?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),t.indexOf(n)!==0)return t;const r=F.parse(t.substr(n.length)),i=e.normalizedPath.split("/"),a=r.normalizedPath.split("/"),s=r.fragment||r.query?0:1;for(;i.length>0&&a.length>s&&i[0]===a[0];)i.shift(),a.shift();let o="";if(i.length>0){i.pop();for(let d=0;d{if(e.length===0)return"";const t=e.split("/"),n=[];for(;t.length>0;){const r=t.shift(),i=t.length===0;if(r==="."){i&&n.push("");continue}if(r===".."){n.pop(),i&&n.push("");continue}n.push(r)}return e[0]==="/"&&n.length>0&&n[0]!==""&&n.unshift(""),n.length===1&&n[0]===""?"/":n.join("/")};const Vr=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;F.isAbsolute=e=>mt.isString(e)&&Vr.test(e);F.isRelative=e=>mt.isString(e);const{parseLinkHeader:Gr,buildHeaders:Xr}=C,{LINK_HEADER_CONTEXT:zr}=rn,Pe=se,Qr=Xn(),{prependBase:Kr}=xe,Wr=/(^|(\r\n))link:/i;var Yr=({secure:e,headers:t={},xhr:n}={headers:{}})=>{return t=Xr(t),new Qr().wrapLoader(i);async function i(a){if(a.indexOf("http:")!==0&&a.indexOf("https:")!==0)throw new Pe('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&a.indexOf("https")!==0)throw new Pe(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:a});let s;try{s=await Zr(n,a,t)}catch(h){throw new Pe("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:h})}if(s.status>=400)throw new Pe("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:s.status});let o={contextUrl:null,documentUrl:a,document:s.response},d=null;const c=s.getResponseHeader("Content-Type");let p;if(Wr.test(s.getAllResponseHeaders())&&(p=s.getResponseHeader("Link")),p&&c!=="application/ld+json"){const h=Gr(p),f=h[zr];if(Array.isArray(f))throw new Pe("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});f&&(o.contextUrl=f.target),d=h.alternate,d&&d.type=="application/ld+json"&&!(c||"").match(/^application\/(\w*\+)?json$/)&&(o=await i(Kr(a,d.target)))}return o}};function Zr(e,t,n){e=e||XMLHttpRequest;const r=new e;return new Promise((i,a)=>{r.onload=()=>i(r),r.onerror=s=>a(s),r.open("GET",t,!0);for(const s in n)r.setRequestHeader(s,n[s]);r.send()})}const Cr=Yr,sn={};var es=sn;sn.setupDocumentLoaders=function(e){typeof XMLHttpRequest<"u"&&(e.documentLoaders.xhr=Cr,e.useDocumentLoader("xhr"))};sn.setupGlobals=function(e){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})};var _t,yn;function ts(){return yn||(yn=1,_t=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),_t}var ns=_;_.Node=Le;_.create=_;function _(e){var t=this;if(t instanceof _||(t=new _),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};_.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};_.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};_.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};_.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new _;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};_.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r1;class os{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[_e]=t.max||1/0;const n=t.length||jt;if(this[ke]=typeof n!="function"?jt:n,this[Xe]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Se]=t.maxAge||0,this[de]=t.dispose,this[mn]=t.noDisposeOnSet||!1,this[zn]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[_e]=t||1/0,qe(this)}get max(){return this[_e]}set allowStale(t){this[Xe]=!!t}get allowStale(){return this[Xe]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Se]=t,qe(this)}get maxAge(){return this[Se]}set lengthCalculator(t){typeof t!="function"&&(t=jt),t!==this[ke]&&(this[ke]=t,this[ue]=0,this[k].forEach(n=>{n.length=this[ke](n.value,n.key),this[ue]+=n.length})),qe(this)}get lengthCalculator(){return this[ke]}get length(){return this[ue]}get itemCount(){return this[k].length}rforEach(t,n){n=n||this;for(let r=this[k].tail;r!==null;){const i=r.prev;vn(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[k].head;r!==null;){const i=r.next;vn(this,t,r,n),r=i}}keys(){return this[k].toArray().map(t=>t.key)}values(){return this[k].toArray().map(t=>t.value)}reset(){this[de]&&this[k]&&this[k].length&&this[k].forEach(t=>this[de](t.key,t.value)),this[re]=new Map,this[k]=new as,this[ue]=0}dump(){return this[k].map(t=>ht(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[k]}set(t,n,r){if(r=r||this[Se],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,a=this[ke](n,t);if(this[re].has(t)){if(a>this[_e])return Fe(this,this[re].get(t)),!1;const d=this[re].get(t).value;return this[de]&&(this[mn]||this[de](t,d.value)),d.now=i,d.maxAge=r,d.value=n,this[ue]+=a-d.length,d.length=a,this.get(t),qe(this),!0}const s=new ls(t,n,a,i,r);return s.length>this[_e]?(this[de]&&this[de](t,n),!1):(this[ue]+=s.length,this[k].unshift(s),this[re].set(t,this[k].head),qe(this),!0)}has(t){if(!this[re].has(t))return!1;const n=this[re].get(t).value;return!ht(this,n)}get(t){return St(this,t,!0)}peek(t){return St(this,t,!1)}pop(){const t=this[k].tail;return t?(Fe(this,t),t.value):null}del(t){Fe(this,this[re].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],a=i.e||0;if(a===0)this.set(i.k,i.v);else{const s=a-n;s>0&&this.set(i.k,i.v,s)}}}prune(){this[re].forEach((t,n)=>St(this,n,!1))}}const St=(e,t,n)=>{const r=e[re].get(t);if(r){const i=r.value;if(ht(e,i)){if(Fe(e,r),!e[Xe])return}else n&&(e[zn]&&(r.value.now=Date.now()),e[k].unshiftNode(r));return i.value}},ht=(e,t)=>{if(!t||!t.maxAge&&!e[Se])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Se]&&n>e[Se]},qe=e=>{if(e[ue]>e[_e])for(let t=e[k].tail;e[ue]>e[_e]&&t!==null;){const n=t.prev;Fe(e,t),t=n}},Fe=(e,t)=>{if(t){const n=t.value;e[de]&&e[de](n.key,n.value),e[ue]-=n.length,e[re].delete(n.key),e[k].removeNode(t)}};class ls{constructor(t,n,r,i,a){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=a||0}}const vn=(e,t,n,r)=>{let i=n.value;ht(e,i)&&(Fe(e,n),e[Xe]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var Qn=os;const cs=Qn,ds=10;var us=class{constructor({document:t}){this.document=t,this.cache=new cs({max:ds})}getProcessed(t){return this.cache.get(t)}setProcessed(t,n){this.cache.set(t,n)}};const{isArray:Ut,isObject:ze,isString:pt}=G,{asArray:fs}=C,{prependBase:Vt}=xe,Ve=se,bn=us,wn=10;var hs=class{constructor({sharedCache:t}){this.perOpCache=new Map,this.sharedCache=t}async resolve({activeCtx:t,context:n,documentLoader:r,base:i,cycles:a=new Set}){n&&ze(n)&&n["@context"]&&(n=n["@context"]),n=fs(n);const s=[];for(const o of n){if(pt(o)){let p=this._get(o);p||(p=await this._resolveRemoteContext({activeCtx:t,url:o,documentLoader:r,base:i,cycles:a})),Ut(p)?s.push(...p):s.push(p);continue}if(o===null){s.push(new bn({document:null}));continue}ze(o)||ps(n);const d=JSON.stringify(o);let c=this._get(d);c||(c=new bn({document:o}),this._cacheResolvedContext({key:d,resolved:c,tag:"static"})),s.push(c)}return s}_get(t){let n=this.perOpCache.get(t);if(!n){const r=this.sharedCache.get(t);r&&(n=r.get("static"),n&&this.perOpCache.set(t,n))}return n}_cacheResolvedContext({key:t,resolved:n,tag:r}){if(this.perOpCache.set(t,n),r!==void 0){let i=this.sharedCache.get(t);i||(i=new Map,this.sharedCache.set(t,i)),i.set(r,n)}return n}async _resolveRemoteContext({activeCtx:t,url:n,documentLoader:r,base:i,cycles:a}){n=Vt(i,n);const{context:s,remoteDoc:o}=await this._fetchContext({activeCtx:t,url:n,documentLoader:r,cycles:a});i=o.documentUrl||n,Gt({context:s,base:i});const d=await this.resolve({activeCtx:t,context:s,documentLoader:r,base:i,cycles:a});return this._cacheResolvedContext({key:n,resolved:d,tag:o.tag}),d}async _fetchContext({activeCtx:t,url:n,documentLoader:r,cycles:i}){if(i.size>wn)throw new Ve("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:t.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:wn});if(i.has(n))throw new Ve("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:t.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:n});i.add(n);let a,s;try{s=await r(n),a=s.document||null,pt(a)&&(a=JSON.parse(a))}catch(o){throw new Ve("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:o})}if(!ze(a))throw new Ve("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});return"@context"in a?a={"@context":a["@context"]}:a={"@context":{}},s.contextUrl&&(Ut(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(s.contextUrl)),{context:a,remoteDoc:s}}};function ps(e){throw new Ve("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function Gt({context:e,base:t}){if(!e)return;const n=e["@context"];if(pt(n)){e["@context"]=Vt(t,n);return}if(Ut(n)){for(let r=0;r{const t=[].concat(e.safe?V.safeEventHandler:[],e.eventHandler?Kn(e.eventHandler):[],V.defaultEventHandler?V.defaultEventHandler:[]);return t.length===0?null:t};V.handleEvent=({event:e,options:t})=>{Wn({event:e,handlers:t.eventHandler})};function Wn({event:e,handlers:t}){let n=!0;for(let r=0;n&&r{n=!0}});else if(typeof i=="object")e.code in i?i[e.code]({event:e,next:()=>{n=!0}}):n=!0;else throw new an("Invalid event handler.","jsonld.InvalidEventHandler",{event:e})}return n}const ms=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference"]);V.safeEventHandler=function({event:t,next:n}){if(t.level==="warning"&&ms.has(t.code))throw new an("Safe mode validation error.","jsonld.ValidationError",{event:t});n()};V.logEventHandler=function({event:t,next:n}){console.log(`EVENT: ${t.message}`,{event:t}),n()};V.logWarningEventHandler=function({event:t,next:n}){t.level==="warning"&&console.warn(`WARNING: ${t.message}`,{event:t}),n()};V.unhandledEventHandler=function({event:t}){throw new an("No handler for event.","jsonld.UnhandledEvent",{event:t})};V.setDefaultEventHandler=function({eventHandler:e}={}){V.defaultEventHandler=e?Kn(e):null};const xn=C,E=se,{isArray:Yn,isObject:me,isString:P,isUndefined:vs}=G,{isAbsolute:Oe,isRelative:bs,prependBase:Qe}=xe,{handleEvent:He}=Ce,{REGEX_BCP47:ws,REGEX_KEYWORD:ct,asArray:Zn,compareShortestLeast:xs}=C,tt=new Map,Is=1e4,D={};var Ae=D;D.process=async({activeCtx:e,localCtx:t,options:n,propagate:r=!0,overrideProtected:i=!1,cycles:a=new Set})=>{if(me(t)&&"@context"in t&&Yn(t["@context"])&&(t=t["@context"]),Zn(t).length===0)return e;const o=[],d=[({event:f,next:l})=>{o.push(f),l()}];n.eventHandler&&d.push(n.eventHandler);const c=n;n={...n,eventHandler:d};const p=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});me(p[0].document)&&typeof p[0].document["@propagate"]=="boolean"&&(r=p[0].document["@propagate"]);let h=e;!r&&!h.previousContext&&(h=h.clone(),h.previousContext=e);for(const f of p){let{document:l}=f;if(e=h,l===null){if(!i&&Object.keys(e.protected).length!==0)throw new E("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});h=e=D.getInitialContext(n).clone();continue}const u=f.getProcessed(e);if(u){if(c.eventHandler)for(const y of u.events)He({event:y,options:c});h=e=u.context;continue}if(me(l)&&"@context"in l&&(l=l["@context"]),!me(l))throw new E("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:l});h=h.clone();const g=new Map;if("@version"in l){if(l["@version"]!==1.1)throw new E("Unsupported JSON-LD version: "+l["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:l});if(e.processingMode&&e.processingMode==="json-ld-1.0")throw new E("@version: "+l["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:l});h.processingMode="json-ld-1.1",h["@version"]=l["@version"],g.set("@version",!0)}if(h.processingMode=h.processingMode||e.processingMode,"@base"in l){let y=l["@base"];if(!(y===null||Oe(y)))if(bs(y))y=Qe(h["@base"],y);else throw new E('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:l});h["@base"]=y,g.set("@base",!0)}if("@vocab"in l){const y=l["@vocab"];if(y===null)delete h["@vocab"];else if(P(y)){if(!Oe(y)&&D.processingMode(h,1))throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:l});{const m=Je(h,y,{vocab:!0,base:!0},void 0,void 0,n);Oe(m)||n.eventHandler&&He({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:m}},options:n}),h["@vocab"]=m}}else throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:l});g.set("@vocab",!0)}if("@language"in l){const y=l["@language"];if(y===null)delete h["@language"];else if(P(y))y.match(ws)||n.eventHandler&&He({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:y}},options:n}),h["@language"]=y.toLowerCase();else throw new E('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:l});g.set("@language",!0)}if("@direction"in l){const y=l["@direction"];if(e.processingMode==="json-ld-1.0")throw new E("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:l});if(y===null)delete h["@direction"];else{if(y!=="ltr"&&y!=="rtl")throw new E('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:l});h["@direction"]=y}g.set("@direction",!0)}if("@propagate"in l){const y=l["@propagate"];if(e.processingMode==="json-ld-1.0")throw new E("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:l});if(typeof y!="boolean")throw new E("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});g.set("@propagate",!0)}if("@import"in l){const y=l["@import"];if(e.processingMode==="json-ld-1.0")throw new E("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:l});if(!P(y))throw new E("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const m=await n.contextResolver.resolve({activeCtx:e,context:y,documentLoader:n.documentLoader,base:n.base});if(m.length!==1)throw new E("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const v=m[0].getProcessed(e);if(v)l=v;else{const x=m[0].document;if("@import"in x)throw new E("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const b in x)l.hasOwnProperty(b)||(l[b]=x[b]);m[0].setProcessed(e,l)}g.set("@import",!0)}g.set("@protected",l["@protected"]||!1);for(const y in l)if(D.createTermDefinition({activeCtx:h,localCtx:l,term:y,defined:g,options:n,overrideProtected:i}),me(l[y])&&"@context"in l[y]){const m=l[y]["@context"];let v=!0;if(P(m)){const x=Qe(n.base,m);a.has(x)?v=!1:a.add(x)}if(v)try{await D.process({activeCtx:h.clone(),localCtx:l[y]["@context"],overrideProtected:!0,options:n,cycles:a})}catch{throw new E("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:l[y]["@context"],term:y})}}f.setProcessed(e,{context:h,events:o})}return h};D.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:i,overrideProtected:a=!1})=>{if(r.has(n)){if(r.get(n))return;throw new E("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}r.set(n,!1);let s;if(t.hasOwnProperty(n)&&(s=t[n]),n==="@type"&&me(s)&&(s["@container"]||"@set")==="@set"&&D.processingMode(e,1.1)){const l=["@container","@id","@protected"],u=Object.keys(s);if(u.length===0||u.some(g=>!l.includes(g)))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(D.isKeyword(n))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(ct)){i.eventHandler&&He({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:i});return}else if(n==="")throw new E("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const o=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let d=!1;if((P(s)||s===null)&&(d=!0,s={"@id":s}),!me(s))throw new E("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const c={};e.mappings.set(n,c),c.reverse=!1;const p=["@container","@id","@language","@reverse","@type"];D.processingMode(e,1.1)&&p.push("@context","@direction","@index","@nest","@prefix","@protected");for(const l in s)if(!p.includes(l))throw new E("Invalid JSON-LD syntax; a term definition must not contain "+l,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const h=n.indexOf(":");if(c._termHasColon=h>0,"@reverse"in s){if("@id"in s)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in s)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const l=s["@reverse"];if(!P(l))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(l.match(ct)){i.eventHandler&&He({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:l}},options:i}),o?e.mappings.set(n,o):e.mappings.delete(n);return}const u=Je(e,l,{vocab:!0,base:!1},t,r,i);if(!Oe(u))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});c["@id"]=u,c.reverse=!0}else if("@id"in s){let l=s["@id"];if(l&&!P(l))throw new E("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(l===null)c["@id"]=null;else if(!D.isKeyword(l)&&l.match(ct)){i.eventHandler&&He({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:l}},options:i}),o?e.mappings.set(n,o):e.mappings.delete(n);return}else if(l!==n){if(l=Je(e,l,{vocab:!0,base:!1},t,r,i),!Oe(l)&&!D.isKeyword(l))throw new E("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)){const u=new Map(r).set(n,!0);if(Je(e,n,{vocab:!0,base:!1},t,u,i)!==l)throw new E("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t})}c["@id"]=l,c._prefix=d&&!c._termHasColon&&l.match(/[:\/\?#\[\]@]$/)}}if(!("@id"in c))if(c._termHasColon){const l=n.substr(0,h);if(t.hasOwnProperty(l)&&D.createTermDefinition({activeCtx:e,localCtx:t,term:l,defined:r,options:i}),e.mappings.has(l)){const u=n.substr(h+1);c["@id"]=e.mappings.get(l)["@id"]+u}else c["@id"]=n}else if(n==="@type")c["@id"]=n;else{if(!("@vocab"in e))throw new E("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});c["@id"]=e["@vocab"]+n}if((s["@protected"]===!0||r.get("@protected")===!0&&s["@protected"]!==!1)&&(e.protected[n]=!0,c.protected=!0),r.set(n,!0),"@type"in s){let l=s["@type"];if(!P(l))throw new E("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(l==="@json"||l==="@none"){if(D.processingMode(e,1))throw new E(`Invalid JSON-LD syntax; an @context @type value must not be "${l}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if(l!=="@id"&&l!=="@vocab"){if(l=Je(e,l,{vocab:!0,base:!1},t,r,i),!Oe(l))throw new E("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(l.indexOf("_:")===0)throw new E("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}c["@type"]=l}if("@container"in s){const l=P(s["@container"])?[s["@container"]]:s["@container"]||[],u=["@list","@set","@index","@language"];let g=!0;const y=l.includes("@set");if(D.processingMode(e,1.1)){if(u.push("@graph","@id","@type"),l.includes("@list")){if(l.length!==1)throw new E("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(l.includes("@graph")){if(l.some(m=>m!=="@graph"&&m!=="@id"&&m!=="@index"&&m!=="@set"))throw new E("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else g&=l.length<=(y?2:1);if(l.includes("@type")&&(c["@type"]=c["@type"]||"@id",!["@id","@vocab"].includes(c["@type"])))throw new E("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else g&=!Yn(s["@container"]),g&=l.length<=1;if(g&=l.every(m=>u.includes(m)),g&=!(y&&l.includes("@list")),!g)throw new E("Invalid JSON-LD syntax; @context @container value must be one of the following: "+u.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(c.reverse&&!l.every(m=>["@index","@set"].includes(m)))throw new E("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});c["@container"]=l}if("@index"in s){if(!("@container"in s)||!c["@container"].includes("@index"))throw new E(`Invalid JSON-LD syntax; @index without @index in @container: "${s["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!P(s["@index"])||s["@index"].indexOf("@")===0)throw new E(`Invalid JSON-LD syntax; @index must expand to an IRI: "${s["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});c["@index"]=s["@index"]}if("@context"in s&&(c["@context"]=s["@context"]),"@language"in s&&!("@type"in s)){let l=s["@language"];if(l!==null&&!P(l))throw new E("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});l!==null&&(l=l.toLowerCase()),c["@language"]=l}if("@prefix"in s){if(n.match(/:|\//))throw new E("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(D.isKeyword(c["@id"]))throw new E("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(typeof s["@prefix"]=="boolean")c._prefix=s["@prefix"]===!0;else throw new E("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t})}if("@direction"in s){const l=s["@direction"];if(l!==null&&l!=="ltr"&&l!=="rtl")throw new E('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});c["@direction"]=l}if("@nest"in s){const l=s["@nest"];if(!P(l)||l!=="@nest"&&l.indexOf("@")===0)throw new E("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});c["@nest"]=l}// disallow aliasing @context and @preserve +const f=c["@id"];if(f==="@context"||f==="@preserve")throw new E("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(o&&o.protected&&!a&&(e.protected[n]=!0,c.protected=!0,!Xt(o,c)))throw new E("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})};D.expandIri=(e,t,n,r)=>Je(e,t,n,void 0,void 0,r);function Je(e,t,n,r,i,a){if(t===null||!P(t)||D.isKeyword(t))return t;if(t.match(ct))return null;if(r&&r.hasOwnProperty(t)&&i.get(t)!==!0&&D.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:a}),n=n||{},n.vocab){const o=e.mappings.get(t);if(o===null)return null;if(me(o)&&"@id"in o)return o["@id"]}const s=t.indexOf(":");if(s>0){const o=t.substr(0,s),d=t.substr(s+1);if(o==="_"||d.indexOf("//")===0)return t;r&&r.hasOwnProperty(o)&&D.createTermDefinition({activeCtx:e,localCtx:r,term:o,defined:i,options:a});const c=e.mappings.get(o);if(c&&c._prefix)return c["@id"]+d;if(Oe(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let o,d;"@base"in e?e["@base"]?(d=Qe(a.base,e["@base"]),o=Qe(d,t)):(d=e["@base"],o=t):(d=a.base,o=Qe(a.base,t)),t=o}return t}D.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=tt.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:i,clone:o,revertToPreviousContext:d,protected:{}};return tt.size===Is&&tt.clear(),tt.set(t,r),r;function i(){const c=this;if(c.inverse)return c.inverse;const p=c.inverse={},h=c.fastCurieMap={},f={},l=(c["@language"]||"@none").toLowerCase(),u=c["@direction"],g=c.mappings,y=[...g.keys()].sort(xs);for(const m of y){const v=g.get(m);if(v===null)continue;let x=v["@container"]||"@none";if(x=[].concat(x).sort().join(""),v["@id"]===null)continue;const b=Zn(v["@id"]);for(const I of b){let w=p[I];const T=D.isKeyword(I);if(w)!T&&!v._termHasColon&&f[I].push(m);else if(p[I]=w={},!T&&!v._termHasColon){f[I]=[m];const O={iri:I,terms:f[I]};I[0]in h?h[I[0]].push(O):h[I[0]]=[O]}if(w[x]||(w[x]={"@language":{},"@type":{},"@any":{}}),w=w[x],s(m,w["@any"],"@none"),v.reverse)s(m,w["@type"],"@reverse");else if(v["@type"]==="@none")s(m,w["@any"],"@none"),s(m,w["@language"],"@none"),s(m,w["@type"],"@none");else if("@type"in v)s(m,w["@type"],v["@type"]);else if("@language"in v&&"@direction"in v){const O=v["@language"],A=v["@direction"];O&&A?s(m,w["@language"],`${O}_${A}`.toLowerCase()):O?s(m,w["@language"],O.toLowerCase()):A?s(m,w["@language"],`_${A}`):s(m,w["@language"],"@null")}else"@language"in v?s(m,w["@language"],(v["@language"]||"@null").toLowerCase()):"@direction"in v?v["@direction"]?s(m,w["@language"],`_${v["@direction"]}`):s(m,w["@language"],"@none"):u?(s(m,w["@language"],`_${u}`),s(m,w["@language"],"@none"),s(m,w["@type"],"@none")):(s(m,w["@language"],l),s(m,w["@language"],"@none"),s(m,w["@type"],"@none"))}}for(const m in h)a(h,m,1);return p}function a(c,p,h){const f=c[p],l=c[p]={};let u,g;for(const y of f)u=y.iri,h>=u.length?g="":g=u[h],g in l?l[g].push(y):l[g]=[y];for(const y in l)y!==""&&a(l,y,h+1)}function s(c,p,h){p.hasOwnProperty(h)||(p[h]=c)}function o(){const c={};return c.mappings=xn.clone(this.mappings),c.clone=this.clone,c.inverse=null,c.getInverse=this.getInverse,c.protected=xn.clone(this.protected),this.previousContext&&(c.previousContext=this.previousContext.clone()),c.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(c["@base"]=this["@base"]),"@language"in this&&(c["@language"]=this["@language"]),"@vocab"in this&&(c["@vocab"]=this["@vocab"]),c}function d(){return this.previousContext?this.previousContext.clone():this}};D.getContextValue=(e,t,n)=>{if(t===null)return n==="@context"?void 0:null;if(e.mappings.has(t)){const r=e.mappings.get(t);if(vs(n))return r;if(r.hasOwnProperty(n))return r[n]}if(n==="@language"&&n in e||n==="@direction"&&n in e)return e[n];if(n!=="@context")return null};D.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():e.processingMode==="json-ld-1.0";D.isKeyword=e=>{if(!P(e)||e[0]!=="@")return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};function Xt(e,t){if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let a=0;a{if(n==null)return null;if(t==="@default"&&(r=Object.assign({},r,{isFrame:!1})),!W(n)&&!X(n))return!i&&(t===null||L(e,t,{vocab:!0},r)==="@graph")?(r.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:r}),null):tr({activeCtx:e,activeProperty:t,value:n,options:r});if(W(n)){let u=[];const g=Y(e,t,"@container")||[];i=i||g.includes("@list");for(let y=0;y1?y.slice().sort():y:[y];for(const v of m){const x=Y(s,v,"@context");gt(x)||(e=await Ke({activeCtx:e,localCtx:x,options:r,propagate:!1}))}}let f={};await er({activeCtx:e,activeProperty:t,expandedActiveProperty:o,element:n,expandedParent:f,options:r,insideList:i,typeKey:h,typeScopedContext:s}),c=Object.keys(f);let l=c.length;if("@value"in f){if("@type"in f&&("@language"in f||"@direction"in f))throw new R('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:f});let u=l-1;if("@type"in f&&(u-=1),"@index"in f&&(u-=1),"@language"in f&&(u-=1),"@direction"in f&&(u-=1),u!==0)throw new R('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:f});const g=f["@value"]===null?[]:ne(f["@value"]),y=js(f,"@type");if(!(dt(e,1.1)&&y.includes("@json")&&y.length===1))if(g.length===0)r.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:f}},options:r}),f=null;else{if(!g.every(m=>J(m)||zt(m))&&"@language"in f)throw new R("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:f});if(!y.every(m=>ut(m)&&!(J(m)&&m.indexOf("_:")===0)||zt(m)))throw new R('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:f})}}else if("@type"in f&&!W(f["@type"]))f["@type"]=[f["@type"]];else if("@set"in f||"@list"in f){if(l>1&&!(l===2&&"@index"in f))throw new R('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:f});"@set"in f&&(f=f["@set"],c=Object.keys(f),l=c.length)}else l===1&&"@language"in f&&(r.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:f}},options:r}),f=null);if(X(f)&&!r.keepFreeFloatingNodes&&!i&&(t===null||o==="@graph")&&(l===0||"@value"in f||"@list"in f||l===1&&"@id"in f)){if(r.eventHandler){let u,g;l===0?(u="empty object",g="Dropping empty object."):"@value"in f?(u="object with only @value",g="Dropping object with only @value."):"@list"in f?(u="object with only @list",g="Dropping object with only @list."):l===1&&"@id"in f&&(u="object with only @id",g="Dropping object with only @id."),Q({event:{type:["JsonLdEvent"],code:u,level:"warning",message:g,details:{value:f}},options:r})}f=null}return f};async function er({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:i,options:a={},insideList:s,typeKey:o,typeScopedContext:d}){const c=Object.keys(r).sort(),p=[];let h;const f=r[o]&&L(e,W(r[o])?r[o][0]:r[o],{vocab:!0},{...a,typeExpansion:!0})==="@json";for(const l of c){let u=r[l],g;if(l==="@context")continue;const y=L(e,l,{vocab:!0},a);if(y===null||!(ut(y)||Kt(y))){a.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:l,expandedProperty:y}},options:a});continue}if(Kt(y)){if(n==="@reverse")throw new R("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:u});if(y in i&&y!=="@included"&&y!=="@type")throw new R("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:y})}if(y==="@id"){if(!J(u)){if(!a.isFrame)throw new R('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:u});if(X(u)){if(!zt(u))throw new R('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:u})}else if(W(u)){if(!u.every(b=>J(b)))throw new R('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:u})}else throw new R('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:u})}U(i,"@id",ne(u).map(b=>{if(J(b)){const I=L(e,b,{base:!0},a);return a.eventHandler&&(I===null?Q(b===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:b}},options:a}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:b}},options:a}):ut(I)||Q({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:b,expandedId:I}},options:a})),I}return b}),{propertyIsArray:a.isFrame});continue}if(y==="@type"){X(u)&&(u=Object.fromEntries(Object.entries(u).map(([b,I])=>[L(d,b,{vocab:!0}),ne(I).map(w=>L(d,w,{base:!0,vocab:!0},{...a,typeExpansion:!0}))]))),Ss(u,a.isFrame),U(i,"@type",ne(u).map(b=>{if(J(b)){const I=L(d,b,{base:!0,vocab:!0},{...a,typeExpansion:!0});return I!=="@json"&&!ut(I)&&a.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:b}},options:a}),I}return b}),{propertyIsArray:a.isFrame});continue}if(y==="@included"&&dt(e,1.1)){const b=ne(await ve.expand({activeCtx:e,activeProperty:t,element:u,options:a}));if(!b.every(I=>Ns(I)))throw new R("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:u});U(i,"@included",b,{propertyIsArray:!0});continue}if(y==="@graph"&&!(X(u)||W(u)))throw new R('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:u});if(y==="@value"){h=u,f&&dt(e,1.1)?i["@value"]=u:U(i,"@value",u,{propertyIsArray:a.isFrame});continue}if(y==="@language"){if(u===null)continue;if(!J(u)&&!a.isFrame)throw new R('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:u});u=ne(u).map(b=>J(b)?b.toLowerCase():b);for(const b of u)J(b)&&!b.match(Cn)&&a.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:b}},options:a});U(i,"@language",u,{propertyIsArray:a.isFrame});continue}if(y==="@direction"){if(!J(u)&&!a.isFrame)throw new R('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:u});u=ne(u);for(const b of u)if(J(b)&&b!=="ltr"&&b!=="rtl")throw new R('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:u});U(i,"@direction",u,{propertyIsArray:a.isFrame});continue}if(y==="@index"){if(!J(u))throw new R('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:u});U(i,"@index",u);continue}if(y==="@reverse"){if(!X(u))throw new R('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:u});if(g=await ve.expand({activeCtx:e,activeProperty:"@reverse",element:u,options:a}),"@reverse"in g)for(const I in g["@reverse"])U(i,I,g["@reverse"][I],{propertyIsArray:!0});let b=i["@reverse"]||null;for(const I in g){if(I==="@reverse")continue;b===null&&(b=i["@reverse"]={}),U(b,I,[],{propertyIsArray:!0});const w=g[I];for(let T=0;Tb==="@id"||b==="@index")&&(g=ne(g).map(b=>({"@graph":ne(b)}))),m.mappings.has(l)&&m.mappings.get(l).reverse){const b=i["@reverse"]=i["@reverse"]||{};g=ne(g);for(let I=0;IL(e,y,{vocab:!0},a)==="@value"))throw new R("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:g});await er({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:g,expandedParent:i,options:a,insideList:s,typeScopedContext:d,typeKey:o})}}}function tr({activeCtx:e,activeProperty:t,value:n,options:r}){if(n==null)return null;const i=L(e,t,{vocab:!0},r);if(i==="@id")return L(e,n,{base:!0},r);if(i==="@type")return L(e,n,{vocab:!0,base:!0},{...r,typeExpansion:!0});const a=Y(e,t,"@type");if((a==="@id"||i==="@graph")&&J(n)){const o=L(e,n,{base:!0},r);return o===null&&n.match(_s)&&r.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}),{"@id":o}}if(a==="@vocab"&&J(n))return{"@id":L(e,n,{vocab:!0,base:!0},r)};if(Kt(i))return n;const s={};if(a&&!["@id","@vocab","@none"].includes(a))s["@type"]=a;else if(J(n)){const o=Y(e,t,"@language");o!==null&&(s["@language"]=o);const d=Y(e,t,"@direction");d!==null&&(s["@direction"]=d)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),s["@value"]=n,s}function Ds(e,t,n,r){const i=[],a=Object.keys(t).sort();for(const s of a){const o=L(e,s,{vocab:!0},r);let d=t[s];W(d)||(d=[d]);for(const c of d){if(c===null)continue;if(!J(c))throw new R("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const p={"@value":c};o!=="@none"&&(s.match(Cn)||r.eventHandler&&Q({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:s}},options:r}),p["@language"]=s.toLowerCase()),n&&(p["@direction"]=n),i.push(p)}}return i}async function Dt({activeCtx:e,options:t,activeProperty:n,value:r,asGraph:i,indexKey:a,propertyIndex:s}){const o=[],d=Object.keys(r).sort(),c=a==="@type";for(let p of d){if(c){const l=Y(e,p,"@context");gt(l)||(e=await Ke({activeCtx:e,localCtx:l,propagate:!1,options:t}))}let h=r[p];W(h)||(h=[h]),h=await ve.expand({activeCtx:e,activeProperty:n,element:h,options:t,insideList:!1,insideIndex:!0});let f;s?p==="@none"?f="@none":f=tr({activeCtx:e,activeProperty:a,value:p,options:t}):f=L(e,p,{vocab:!0},t),a==="@id"?p=L(e,p,{base:!0},t):c&&(p=f);for(let l of h){if(i&&!Es(l)&&(l={"@graph":[l]}),a==="@type")f==="@none"||(l["@type"]?l["@type"]=[p].concat(l["@type"]):l["@type"]=[p]);else{if(Qt(l)&&!["@language","@type","@index"].includes(a))throw new R(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:l});s?f!=="@none"&&U(l,s,f,{propertyIsArray:!0,prependValue:!0}):f!=="@none"&&!(a in l)&&(l[a]=p)}o.push(l)}}return o}const{isKeyword:nr}=Ae,oe=pe,Rt=G,le=C,Rs=se,B={};var vt=B;B.createMergedNodeMap=(e,t)=>{t=t||{};const n=t.issuer||new le.IdentifierIssuer("_:b"),r={"@default":{}};return B.createNodeMap(e,r,"@default",n),B.mergeNodeMaps(r)};B.createNodeMap=(e,t,n,r,i,a)=>{if(Rt.isArray(e)){for(const c of e)B.createNodeMap(c,t,n,r,void 0,a);return}if(!Rt.isObject(e)){a&&a.push(e);return}if(oe.isValue(e)){if("@type"in e){let c=e["@type"];c.indexOf("_:")===0&&(e["@type"]=c=r.getId(c))}a&&a.push(e);return}else if(a&&oe.isList(e)){const c=[];B.createNodeMap(e["@list"],t,n,r,i,c),a.push({"@list":c});return}if("@type"in e){const c=e["@type"];for(const p of c)p.indexOf("_:")===0&&r.getId(p)}Rt.isUndefined(i)&&(i=oe.isBlankNode(e)?r.getId(e["@id"]):e["@id"]),a&&a.push({"@id":i});const s=t[n],o=s[i]=s[i]||{};o["@id"]=i;const d=Object.keys(e).sort();for(let c of d){if(c==="@id")continue;if(c==="@reverse"){const h={"@id":i},f=e["@reverse"];for(const l in f){const u=f[l];for(const g of u){let y=g["@id"];oe.isBlankNode(g)&&(y=r.getId(y)),B.createNodeMap(g,t,n,r,y),le.addValue(s[y],l,h,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(c==="@graph"){i in t||(t[i]={}),B.createNodeMap(e[c],t,i,r);continue}if(c==="@included"){B.createNodeMap(e[c],t,n,r);continue}if(c!=="@type"&&nr(c)){if(c==="@index"&&c in o&&(e[c]!==o[c]||e[c]["@id"]!==o[c]["@id"]))throw new Rs("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:o});o[c]=e[c];continue}const p=e[c];if(c.indexOf("_:")===0&&(c=r.getId(c)),p.length===0){le.addValue(o,c,[],{propertyIsArray:!0});continue}for(let h of p)if(c==="@type"&&(h=h.indexOf("_:")===0?r.getId(h):h),oe.isSubject(h)||oe.isSubjectReference(h)){if("@id"in h&&!h["@id"])continue;const f=oe.isBlankNode(h)?r.getId(h["@id"]):h["@id"];le.addValue(o,c,{"@id":f},{propertyIsArray:!0,allowDuplicate:!1}),B.createNodeMap(h,t,n,r,f)}else if(oe.isValue(h))le.addValue(o,c,h,{propertyIsArray:!0,allowDuplicate:!1});else if(oe.isList(h)){const f=[];B.createNodeMap(h["@list"],t,n,r,i,f),h={"@list":f},le.addValue(o,c,h,{propertyIsArray:!0,allowDuplicate:!1})}else B.createNodeMap(h,t,n,r,i),le.addValue(o,c,h,{propertyIsArray:!0,allowDuplicate:!1})}};B.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const r of Object.keys(e[n]).sort()){const i=e[n][r];r in t||(t[r]={"@id":r});const a=t[r];for(const s of Object.keys(i).sort())if(nr(s)&&s!=="@type")a[s]=le.clone(i[s]);else for(const o of i[s])le.addValue(a,s,le.clone(o),{propertyIsArray:!0,allowDuplicate:!1})}return t};B.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if(r==="@default")continue;const i=e[r];let a=t[r];a?"@graph"in a||(a["@graph"]=[]):t[r]=a={"@id":r,"@graph":[]};const s=a["@graph"];for(const o of Object.keys(i).sort()){const d=i[o];oe.isSubjectReference(d)||s.push(d)}}return t};const{isSubjectReference:Ls}=pe,{createMergedNodeMap:As}=vt,rr={};var Ts=rr;rr.flatten=e=>{const t=As(e),n=[],r=Object.keys(t).sort();for(let i=0;i{const n={},r={"@default":n},i={},{useRdfType:a=!1,useNativeTypes:s=!1,rdfDirection:o=null}=t;for(const p of e){const h=p.graph.termType==="DefaultGraph"?"@default":p.graph.value;h in r||(r[h]={}),h!=="@default"&&!(h in n)&&(n[h]={"@id":h});const f=r[h],l=p.subject.value,u=p.predicate.value,g=p.object;l in f||(f[l]={"@id":l});const y=f[l],m=g.termType.endsWith("Node");if(m&&!(g.value in f)&&(f[g.value]={"@id":g.value}),u===Js&&!a&&m){En(y,"@type",g.value,{propertyIsArray:!0});continue}const v=Hs(g,s,o,t);if(En(y,u,v,{propertyIsArray:!0}),m)if(g.value===kt){const x=f[g.value];"usages"in x||(x.usages=[]),x.usages.push({node:y,property:u,value:v})}else g.value in i?i[g.value]=!1:i[g.value]={node:y,property:u,value:v}}for(const p in r){const h=r[p];if(!(kt in h))continue;const f=h[kt];if(f.usages){for(let l of f.usages){let u=l.node,g=l.property,y=l.value;const m=[],v=[];let x=Object.keys(u).length;for(;g===Tt&&Ge.isObject(i[u["@id"]])&&Ge.isArray(u[At])&&u[At].length===1&&Ge.isArray(u[Tt])&&u[Tt].length===1&&(x===3||x===4&&Ge.isArray(u["@type"])&&u["@type"].length===1&&u["@type"][0]===$s)&&(m.push(u[At][0]),v.push(u["@id"]),l=i[u["@id"]],u=l.node,g=l.property,y=l.value,x=Object.keys(u).length,!!Lt.isBlankNode(u)););delete y["@id"],y["@list"]=m.reverse();for(const b of v)delete h[b]}delete f.usages}}const d=[],c=Object.keys(n).sort();for(const p of c){const h=n[p];if(p in r){const f=h["@graph"]=[],l=r[p],u=Object.keys(l).sort();for(const g of u){const y=l[g];Lt.isSubjectReference(y)||f.push(y)}}Lt.isSubjectReference(h)||d.push(h)}return d};function Hs(e,t,n,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const i={"@value":e.value};if(e.language)e.language.match(In)||r.eventHandler&&Nn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:r}),i["@language"]=e.language;else{let a=e.datatype.value;if(a||(a=$t),a===Ms){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(s){throw new ks("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:s})}}if(t){if(a===_n)i["@value"]==="true"?i["@value"]=!0:i["@value"]==="false"&&(i["@value"]=!1);else if(Ge.isNumeric(i["@value"]))if(a===Sn){const s=parseInt(i["@value"],10);s.toFixed(0)===i["@value"]&&(i["@value"]=s)}else a===jn&&(i["@value"]=parseFloat(i["@value"]));[_n,Sn,jn,$t].includes(a)||(i["@type"]=a)}else if(n==="i18n-datatype"&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,s,o]=a.split(/[#_]/);s.length>0&&(i["@language"]=s,s.match(In)||r.eventHandler&&Nn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:s}},options:r})),i["@direction"]=o}else a!==$t&&(i["@type"]=a)}return i}const{createNodeMap:Bs}=vt,{isKeyword:Ps}=Ae,On=pe,qs=vr,Ue=G,Us=C,{handleEvent:We}=Ce,{RDF_FIRST:Vs,RDF_REST:Gs,RDF_NIL:Xs,RDF_TYPE:zs,RDF_JSON_LITERAL:Qs,RDF_LANGSTRING:Ks,XSD_BOOLEAN:Ws,XSD_DOUBLE:Dn,XSD_INTEGER:Ys,XSD_STRING:Zs}=rn,{isAbsolute:yt}=xe,ir={};var Cs=ir;ir.toRDF=(e,t)=>{const n=new Us.IdentifierIssuer("_:b"),r={"@default":{}};Bs(e,r,"@default",n);const i=[],a=Object.keys(r).sort();for(const s of a){let o;if(s==="@default")o={termType:"DefaultGraph",value:""};else if(yt(s))s.startsWith("_:")?o={termType:"BlankNode"}:o={termType:"NamedNode"},o.value=s;else{t.eventHandler&&We({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:s}},options:t});continue}ei(i,r[s],o,n,t)}return i};function ei(e,t,n,r,i){const a=Object.keys(t).sort();for(const s of a){const o=t[s],d=Object.keys(o).sort();for(let c of d){const p=o[c];if(c==="@type")c=zs;else if(Ps(c))continue;for(const h of p){const f={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!yt(s)){i.eventHandler&&We({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:i});continue}const l={termType:c.startsWith("_:")?"BlankNode":"NamedNode",value:c};if(!yt(c)){i.eventHandler&&We({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:c}},options:i});continue}if(l.termType==="BlankNode"&&!i.produceGeneralizedRdf){i.eventHandler&&We({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:r.getOldIds().find(g=>r.getId(g)===c)}},options:i});continue}const u=Wt(h,r,e,n,i.rdfDirection,i);u&&e.push({subject:f,predicate:l,object:u,graph:n})}}}}function ti(e,t,n,r,i,a){const s={termType:"NamedNode",value:Vs},o={termType:"NamedNode",value:Gs},d={termType:"NamedNode",value:Xs},c=e.pop(),p=c?{termType:"BlankNode",value:t.getId()}:d;let h=p;for(const f of e){const l=Wt(f,t,n,r,i,a),u={termType:"BlankNode",value:t.getId()};n.push({subject:h,predicate:s,object:l,graph:r}),n.push({subject:h,predicate:o,object:u,graph:r}),h=u}if(c){const f=Wt(c,t,n,r,i,a);n.push({subject:h,predicate:s,object:f,graph:r}),n.push({subject:h,predicate:o,object:d,graph:r})}return p}function Wt(e,t,n,r,i,a){const s={};if(On.isValue(e)){s.termType="Literal",s.value=void 0,s.datatype={termType:"NamedNode"};let o=e["@value"];const d=e["@type"]||null;if(d==="@json")s.value=qs(o),s.datatype.value=Qs;else if(Ue.isBoolean(o))s.value=o.toString(),s.datatype.value=d||Ws;else if(Ue.isDouble(o)||d===Dn)Ue.isDouble(o)||(o=parseFloat(o)),s.value=o.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),s.datatype.value=d||Dn;else if(Ue.isNumber(o))s.value=o.toFixed(0),s.datatype.value=d||Ys;else if(i==="i18n-datatype"&&"@direction"in e){const c="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;s.datatype.value=c,s.value=o}else"@language"in e?(s.value=o,s.datatype.value=d||Ks,s.language=e["@language"]):(s.value=o,s.datatype.value=d||Zs)}else if(On.isList(e)){const o=ti(e["@list"],t,n,r,i,a);s.termType=o.termType,s.value=o.value}else{const o=Ue.isObject(e)?e["@id"]:e;s.termType=o.startsWith("_:")?"BlankNode":"NamedNode",s.value=o}return s.termType==="NamedNode"&&!yt(s.value)?(a.eventHandler&&We({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:s.value}},options:a}),null):s}const{isKeyword:Yt}=Ae,z=pe,S=G,$=C,Rn=xe,Ye=se,{createNodeMap:ni,mergeNodeMapGraphs:ri}=vt,K={};var si=K;K.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new $.IdentifierIssuer("_:b");ni(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=ri(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const a=[];K.frame(r,Object.keys(r.subjects).sort(),t,a),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(s=>r.bnodeMap[s].length===1));// remove @preserve from results +return n.link={},ft(a,n)};K.frame=(e,t,n,r,i=null)=>{ar(n),n=n[0];const a=e.options,s={embed:nt(n,a,"embed"),explicit:nt(n,a,"explicit"),requireAll:nt(n,a,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const o=e.link[e.graph],d=ai(e,t,n,s),c=Object.keys(d).sort();for(const p of c){const h=d[p];if(i===null?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},s.embed==="@link"&&p in o){Ee(r,i,o[p]);continue}const f={"@id":p};if(p.indexOf("_:")===0&&$.addValue(e.bnodeMap,p,f,{propertyIsArray:!0}),o[p]=f,(s.embed==="@first"||s.embed==="@last")&&e.is11)throw new Ye("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(!(!e.embedded&&e.uniqueEmbeds[e.graph].hasOwnProperty(p))){if(e.embedded&&(s.embed==="@never"||ii(h,e.graph,e.subjectStack))){Ee(r,i,f);continue}if(e.embedded&&(s.embed=="@first"||s.embed=="@once")&&e.uniqueEmbeds[e.graph].hasOwnProperty(p)){Ee(r,i,f);continue}if(s.embed==="@last"&&p in e.uniqueEmbeds[e.graph]&&oi(e,p),e.uniqueEmbeds[e.graph][p]={parent:r,property:i},e.subjectStack.push({subject:h,graph:e.graph}),p in e.graphMap){let l=!1,u=null;"@graph"in n?(u=n["@graph"][0],l=!(p==="@merged"||p==="@default"),S.isObject(u)||(u={})):(l=e.graph!=="@merged",u={}),l&&K.frame({...e,graph:p,embedded:!1},Object.keys(e.graphMap[p]).sort(),[u],f,"@graph")}"@included"in n&&K.frame({...e,embedded:!1},t,n["@included"],f,"@included");for(const l of Object.keys(h).sort()){if(Yt(l)){if(f[l]=$.clone(h[l]),l==="@type")for(const u of h["@type"])u.indexOf("_:")===0&&$.addValue(e.bnodeMap,u,f,{propertyIsArray:!0});continue}if(!(s.explicit&&!(l in n)))for(const u of h[l]){const g=l in n?n[l]:Ln(s);if(z.isList(u)){const y=n[l]&&n[l][0]&&n[l][0]["@list"]?n[l][0]["@list"]:Ln(s),m={"@list":[]};Ee(f,l,m);const v=u["@list"];for(const x of v)z.isSubjectReference(x)?K.frame({...e,embedded:!0},[x["@id"]],y,m,"@list"):Ee(m,"@list",$.clone(x))}else z.isSubjectReference(u)?K.frame({...e,embedded:!0},[u["@id"]],g,f,l):Zt(g[0],u)&&Ee(f,l,$.clone(u))}}for(const l of Object.keys(n).sort()){if(l==="@type"){if(!S.isObject(n[l][0])||!("@default"in n[l][0]))continue}else if(Yt(l))continue;const u=n[l][0]||{};if(!nt(u,a,"omitDefault")&&!(l in f)){let y="@null";"@default"in u&&(y=$.clone(u["@default"])),S.isArray(y)||(y=[y]),f[l]=[{"@preserve":y}]}}for(const l of Object.keys(n["@reverse"]||{}).sort()){const u=n["@reverse"][l];for(const g of Object.keys(e.subjects))$.getValues(e.subjects[g],l).some(m=>m["@id"]===p)&&(f["@reverse"]=f["@reverse"]||{},$.addValue(f["@reverse"],l,[],{propertyIsArray:!0}),K.frame({...e,embedded:!0},[g],u,f["@reverse"][l],i))}Ee(r,i,f),e.subjectStack.pop()}}};K.cleanupNull=(e,t)=>{if(S.isArray(e))return e.map(r=>K.cleanupNull(r,t)).filter(r=>r);if(e==="@null")return null;if(S.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(r!==-1)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=K.cleanupNull(e[n],t)}return e};function Ln(e){const t={};for(const n in e)e[n]!==void 0&&(t["@"+n]=[e[n]]);return[t]}function ii(e,t,n){for(let r=n.length-1;r>=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function nt(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if(n==="embed"){if(i===!0)i="@once";else if(i===!1)i="@never";else if(i!=="@always"&&i!=="@never"&&i!=="@link"&&i!=="@first"&&i!=="@last"&&i!=="@once")throw new Ye("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e})}return i}function ar(e){if(!S.isArray(e)||e.length!==1||!S.isObject(e[0]))throw new Ye("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){for(const t of $.asArray(e[0]["@id"]))if(!(S.isObject(t)||Rn.isAbsolute(t))||S.isString(t)&&t.indexOf("_:")===0)throw new Ye("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}if("@type"in e[0]){for(const t of $.asArray(e[0]["@type"]))if(!(S.isObject(t)||Rn.isAbsolute(t))||S.isString(t)&&t.indexOf("_:")===0)throw new Ye("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}function ai(e,t,n,r){const i={};for(const a of t){const s=e.graphMap[e.graph][a];or(e,s,n,r)&&(i[a]=s)}return i}function or(e,t,n,r){let i=!0,a=!1;for(const s in n){let o=!1;const d=$.getValues(t,s),c=$.getValues(n,s).length===0;if(s==="@id"){if(S.isEmptyObject(n["@id"][0]||{})?o=!0:n["@id"].length>=0&&(o=n["@id"].includes(d[0])),!r.requireAll)return o}else if(s==="@type"){if(i=!1,c){if(d.length>0)return!1;o=!0}else if(n["@type"].length===1&&S.isEmptyObject(n["@type"][0]))o=d.length>0;else for(const p of n["@type"])S.isObject(p)&&"@default"in p?o=!0:o=o||d.some(h=>h===p);if(!r.requireAll)return o}else{if(Yt(s))continue;{const p=$.getValues(n,s)[0];let h=!1;if(p&&(ar([p]),h="@default"in p),i=!1,d.length===0&&h)continue;if(d.length>0&&c)return!1;if(p===void 0){if(d.length>0)return!1;o=!0}else if(z.isList(p)){const f=p["@list"][0];if(z.isList(d[0])){const l=d[0]["@list"];z.isValue(f)?o=l.some(u=>Zt(f,u)):(z.isSubject(f)||z.isSubjectReference(f))&&(o=l.some(u=>An(e,f,u,r)))}}else z.isValue(p)?o=d.some(f=>Zt(p,f)):z.isSubjectReference(p)?o=d.some(f=>An(e,p,f,r)):S.isObject(p)?o=d.length>0:o=!1}}if(!o&&r.requireAll)return!1;a=a||o}return i||a}function oi(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,s={"@id":t};if(S.isArray(i)){for(let d=0;d{const c=Object.keys(n);for(const p of c)p in n&&S.isObject(n[p].parent)&&n[p].parent["@id"]===d&&(delete n[p],o(p))};o(t)}/** + * Removes the @preserve keywords from expanded result of framing. + * + * @param input the framed, framed output. + * @param options the framing options used. + * + * @return the resulting output. + */function ft(e,t){if(S.isArray(e))return e.map(n=>ft(n,t));if(S.isObject(e)){// remove @preserve +if("@preserve"in e)return e["@preserve"][0];if(z.isValue(e))return e;if(z.isList(e))return e["@list"]=ft(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(r!==-1)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e){if(n==="@id"&&t.bnodesToClear.includes(e[n])){delete e["@id"];continue}e[n]=ft(e[n],t)}}return e}function Ee(e,t,n){S.isObject(e)?$.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function An(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&or(e,i,t,r)}function Zt(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?S.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?S.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],o=e["@language"]?S.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return a.length===0&&s.length===0&&o.length===0?!0:!(!(a.includes(n)||S.isEmptyObject(a[0]))||!(!r&&s.length===0||s.includes(r)||r&&S.isEmptyObject(s[0]))||!(!i&&o.length===0||o.includes(i)||i&&S.isEmptyObject(o[0])))}const on=se,{isArray:ge,isObject:be,isString:lr,isUndefined:Jt}=G,{isList:Ct,isValue:fe,isGraph:cr,isSimpleGraph:Tn,isSubjectReference:Mt}=pe,{expandIri:dr,getContextValue:H,isKeyword:ur,process:Ft,processingMode:li}=Ae,{removeBase:kn,prependBase:ci}=xe,{REGEX_KEYWORD:di,addValue:q,asArray:rt,compareShortestLeast:ui}=C,N={};var fi=N;N.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:r={}})=>{if(ge(n)){let a=[];for(let s=0;s1&&(c=Array.from(c).sort());const p=e;for(const f of c){const l=N.compactIri({activeCtx:p,iri:f,relativeTo:{vocab:!0}}),u=H(o,l,"@context");Jt(u)||(e=await Ft({activeCtx:e,localCtx:u,options:r,propagate:!1}))}const h=Object.keys(n).sort();for(const f of h){const l=n[f];if(f==="@id"){let u=rt(l).map(y=>N.compactIri({activeCtx:e,iri:y,relativeTo:{vocab:!1},base:r.base}));u.length===1&&(u=u[0]);const g=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});s[g]=u;continue}if(f==="@type"){let u=rt(l).map(x=>N.compactIri({activeCtx:o,iri:x,relativeTo:{vocab:!0}}));u.length===1&&(u=u[0]);const g=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),v=(H(e,g,"@container")||[]).includes("@set")&&li(e,1.1)||ge(u)&&l.length===0;q(s,g,u,{propertyIsArray:v});continue}if(f==="@reverse"){const u=await N.compact({activeCtx:e,activeProperty:"@reverse",element:l,options:r});for(const g in u)if(e.mappings.has(g)&&e.mappings.get(g).reverse){const y=u[g],v=(H(e,g,"@container")||[]).includes("@set")||!r.compactArrays;q(s,g,y,{propertyIsArray:v}),delete u[g]}if(Object.keys(u).length>0){const g=N.compactIri({activeCtx:e,iri:f,relativeTo:{vocab:!0}});q(s,g,u)}continue}if(f==="@preserve"){const u=await N.compact({activeCtx:e,activeProperty:t,element:l,options:r});ge(u)&&u.length===0||q(s,f,u);continue}if(f==="@index"){if((H(e,t,"@container")||[]).includes("@index"))continue;const g=N.compactIri({activeCtx:e,iri:f,relativeTo:{vocab:!0}});q(s,g,l);continue}if(f!=="@graph"&&f!=="@list"&&f!=="@included"&&ur(f)){const u=N.compactIri({activeCtx:e,iri:f,relativeTo:{vocab:!0}});q(s,u,l);continue}if(!ge(l))throw new on("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(l.length===0){const u=N.compactIri({activeCtx:e,iri:f,value:l,relativeTo:{vocab:!0},reverse:a}),g=e.mappings.has(u)?e.mappings.get(u)["@nest"]:null;let y=s;g&&($n(e,g,r),be(s[g])||(s[g]={}),y=s[g]),q(y,u,l,{propertyIsArray:!0})}for(const u of l){const g=N.compactIri({activeCtx:e,iri:f,value:u,relativeTo:{vocab:!0},reverse:a}),y=e.mappings.has(g)?e.mappings.get(g)["@nest"]:null;let m=s;y&&($n(e,y,r),be(s[y])||(s[y]={}),m=s[y]);const v=H(e,g,"@container")||[],x=cr(u),b=Ct(u);let I;b?I=u["@list"]:x&&(I=u["@graph"]);let w=await N.compact({activeCtx:e,activeProperty:g,element:b||x?I:u,options:r});if(b)if(ge(w)||(w=[w]),!v.includes("@list"))w={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:w},"@index"in u&&(w[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=u["@index"]);else{q(m,g,w,{valueIsArray:!0,allowDuplicate:!0});continue}if(x)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&Tn(u))){let T;m.hasOwnProperty(g)?T=m[g]:m[g]=T={};const O=(v.includes("@id")?u["@id"]:u["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});q(T,O,w,{propertyIsArray:!r.compactArrays||v.includes("@set")})}else v.includes("@graph")&&Tn(u)?(ge(w)&&w.length>1&&(w={"@included":w}),q(m,g,w,{propertyIsArray:!r.compactArrays||v.includes("@set")})):(ge(w)&&w.length===1&&r.compactArrays&&(w=w[0]),w={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:w},"@id"in u&&(w[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=u["@id"]),"@index"in u&&(w[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=u["@index"]),q(m,g,w,{propertyIsArray:!r.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let T;m.hasOwnProperty(g)?T=m[g]:m[g]=T={};let O;if(v.includes("@language"))fe(w)&&(w=w["@value"]),O=u["@language"];else if(v.includes("@index")){const A=H(e,g,"@index")||"@index",Te=N.compactIri({activeCtx:e,iri:A,relativeTo:{vocab:!0}});if(A==="@index")O=u["@index"],delete w[Te];else{let et;if([O,...et]=rt(w[A]||[]),!lr(O))O=null;else switch(et.length){case 0:delete w[A];break;case 1:w[A]=et[0];break;default:w[A]=et;break}}}else if(v.includes("@id")){const A=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});O=w[A],delete w[A]}else if(v.includes("@type")){const A=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let Te;switch([O,...Te]=rt(w[A]||[]),Te.length){case 0:delete w[A];break;case 1:w[A]=Te[0];break;default:w[A]=Te;break}Object.keys(w).length===1&&"@id"in u&&(w=await N.compact({activeCtx:e,activeProperty:g,element:{"@id":u["@id"]},options:r}))}O||(O=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),q(T,O,w,{propertyIsArray:v.includes("@set")})}else{const T=!r.compactArrays||v.includes("@set")||v.includes("@list")||ge(w)&&w.length===0||f==="@list"||f==="@graph";q(m,g,w,{propertyIsArray:T})}}}return s}return n};N.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:i=!1,base:a=null})=>{if(t===null)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const s=e.getInverse();if(ur(t)&&t in s&&"@none"in s[t]&&"@type"in s[t]["@none"]&&"@none"in s[t]["@none"]["@type"])return s[t]["@none"]["@type"]["@none"];if(r.vocab&&t in s){const h=e["@language"]||"@none",f=[];be(n)&&"@index"in n&&!("@graph"in n)&&f.push("@index","@index@set"),be(n)&&"@preserve"in n&&(n=n["@preserve"][0]),cr(n)?("@index"in n&&f.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&f.push("@graph@id","@graph@id@set"),f.push("@graph","@graph@set","@set"),"@index"in n||f.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||f.push("@graph@id","@graph@id@set")):be(n)&&!fe(n)&&f.push("@id","@id@set","@type","@set@type");let l="@language",u="@null";if(i)l="@type",u="@reverse",f.push("@set");else if(Ct(n)){"@index"in n||f.push("@list");const y=n["@list"];if(y.length===0)l="@any",u="@none";else{let m=y.length===0?h:null,v=null;for(let x=0;x=0;--h){const f=d[h],l=f.terms;for(const u of l){const g=u+":"+t.substr(f.iri.length);e.mappings.get(u)._prefix&&(!e.mappings.has(g)||n===null&&e.mappings.get(g)["@id"]===t)&&(o===null||ui(g,o)<0)&&(o=g)}}if(o!==null)return o;for(const[h,f]of e.mappings)if(f&&f._prefix&&t.startsWith(h+":"))throw new on(`Absolute IRI "${t}" confused with prefix "${h}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!r.vocab)if("@base"in e)if(e["@base"]){const h=kn(ci(a,e["@base"]),t);return di.test(h)?`./${h}`:h}else return t;else return kn(a,t);return t};N.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(fe(n)){const o=H(e,t,"@type"),d=H(e,t,"@language"),c=H(e,t,"@direction"),p=H(e,t,"@container")||[],h="@index"in n&&!p.includes("@index");if(!h&&o!=="@none"&&(n["@type"]===o||"@language"in n&&n["@language"]===d&&"@direction"in n&&n["@direction"]===c||"@language"in n&&n["@language"]===d||"@direction"in n&&n["@direction"]===c))return n["@value"];const f=Object.keys(n).length,l=f===1||f===2&&"@index"in n&&!h,u="@language"in e,g=lr(n["@value"]),y=e.mappings.has(t)&&e.mappings.get(t)["@language"]===null;if(l&&o!=="@none"&&(!u||!g||y))return n["@value"];const m={};return h&&(m[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?m[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(m[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(m[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),m[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],m}const i=dr(e,t,{vocab:!0},r),a=H(e,t,"@type"),s=N.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:a==="@vocab"},base:r.base});return a==="@id"||a==="@vocab"||i==="@graph"?s:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}};function hi(e,t,n,r,i,a){a===null&&(a="@null");const s=[];if((a==="@id"||a==="@reverse")&&be(n)&&"@id"in n){a==="@reverse"&&s.push("@reverse");const d=N.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(d)&&e.mappings.get(d)&&e.mappings.get(d)["@id"]===n["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const d=s.find(c=>c.includes("_"));d&&s.push(d.replace(/^[^_]+_/,"_"))}s.push("@none");const o=e.inverse[t];for(const d of r){if(!(d in o))continue;const c=o[d][i];for(const p of s)if(p in c)return c[p]}return null}function $n(e,t,n){if(dr(e,t,{vocab:!0},n)!=="@nest")throw new on("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}var Ht,Jn;function pi(){return Jn||(Jn=1,Ht=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(n,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(n,r)},t.expand=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(n)},t.flatten=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(n)},t}),Ht}/** + * A JavaScript implementation of the JSON-LD API. + * + * @author Dave Longley + * + * @license BSD 3-Clause License + * Copyright (c) 2011-2022 Digital Bazaar, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the Digital Bazaar, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */const Mn=nn,Fn=es,ye=C,ce=hs,Bt=ye.IdentifierIssuer,ie=se,gi=Qn,st=gs,{expand:yi}=Os,{flatten:mi}=Ts,{fromRDF:vi}=Fs,{toRDF:bi}=Cs,{frameMergedOrDefault:wi,cleanupNull:xi}=si,{isArray:$e,isObject:Ne,isString:ae}=G,{isSubjectReference:Ii}=pe,{expandIri:Ei,getInitialContext:it,process:Hn,processingMode:Pt}=Ae,{compact:Ni,compactIri:_i}=fi,{createNodeMap:ji,createMergedNodeMap:Si,mergeNodeMaps:Oi}=vt,{logEventHandler:Di,logWarningEventHandler:Ri,safeEventHandler:Li,setDefaultEventHandler:Ai,setupEventHandler:Ti,strictEventHandler:ki,unhandledEventHandler:$i}=Ce,fr=function(e){const t={},r=new gi({max:100});e.compact=async function(a,s,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(s===null)throw new ie("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(a===null)return null;o=i(o,{base:ae(a)?a:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new Bt("_:b"),contextResolver:new ce({sharedCache:r})}),o.link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base;let d;o.skipExpansion?d=a:d=await e.expand(a,o);const c=await e.processContext(it(o),s,o);let p=await Ni({activeCtx:c,element:d,options:o});o.compactArrays&&!o.graph&&$e(p)?p.length===1?p=p[0]:p.length===0&&(p={}):o.graph&&Ne(p)&&(p=[p]),Ne(s)&&"@context"in s&&(s=s["@context"]),s=ye.clone(s),$e(s)||(s=[s]);const h=s;s=[];for(let l=0;l0)&&s.push(h[l]);const f=s.length>0;if(s.length===1&&(s=s[0]),$e(p)){const l=_i({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),u=p;p={},f&&(p["@context"]=s),p[l]=u}else if(Ne(p)&&f){const l=p;p={"@context":s};for(const u in l)p[u]=l[u]}return p},e.expand=async function(a,s){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");s=i(s,{keepFreeFloatingNodes:!1,contextResolver:new ce({sharedCache:r})});const o={},d=[];if("expandContext"in s){const f=ye.clone(s.expandContext);Ne(f)&&"@context"in f?o.expandContext=f:o.expandContext={"@context":f},d.push(o.expandContext)}let c;if(!ae(a))o.input=ye.clone(a);else{const f=await e.get(a,s);c=f.documentUrl,o.input=f.document,f.contextUrl&&(o.remoteContext={"@context":f.contextUrl},d.push(o.remoteContext))}"base"in s||(s.base=c||"");let p=it(s);for(const f of d)p=await Hn({activeCtx:p,localCtx:f,options:s});let h=await yi({activeCtx:p,element:o.input,options:s});return Ne(h)&&"@graph"in h&&Object.keys(h).length===1?h=h["@graph"]:h===null&&(h=[]),$e(h)||(h=[h]),h},e.flatten=async function(a,s,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof s=="function"?s=null:s=s||null,o=i(o,{base:ae(a)?a:"",contextResolver:new ce({sharedCache:r})});const d=await e.expand(a,o),c=mi(d);return s===null?c:(o.graph=!0,o.skipExpansion=!0,await e.compact(c,s,o))},e.frame=async function(a,s,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=i(o,{base:ae(a)?a:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new ce({sharedCache:r})}),ae(s)){const y=await e.get(s,o);if(s=y.document,y.contextUrl){let m=s["@context"];m?$e(m)?m.push(y.contextUrl):m=[m,y.contextUrl]:m=y.contextUrl,s["@context"]=m}}const d=s?s["@context"]||{}:{},c=await e.processContext(it(o),d,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=Pt(c,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=Pt(c,1.1));const p=await e.expand(a,o),h={...o};h.isFrame=!0,h.keepFreeFloatingNodes=!0;const f=await e.expand(s,h),l=Object.keys(s).map(y=>Ei(c,y,{vocab:!0}));h.merged=!l.includes("@graph"),h.is11=Pt(c,1.1);const u=wi(p,f,h);h.graph=!o.omitGraph,h.skipExpansion=!0,h.link={},h.framing=!0;let g=await e.compact(u,d,h);return h.link={},g=xi(g,h),g},e.link=async function(a,s,o){const d={};return s&&(d["@context"]=s),d["@embed"]="@link",e.frame(a,d,o)},e.normalize=e.canonize=async function(a,s){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(s=i(s,{base:ae(a)?a:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new ce({sharedCache:r})}),"inputFormat"in s){if(s.inputFormat!=="application/n-quads"&&s.inputFormat!=="application/nquads")throw new ie("Unknown canonicalization input format.","jsonld.CanonizeError");const c=st.parse(a);return Mn.canonize(c,s)}const o={...s};delete o.format,o.produceGeneralizedRdf=!1;const d=await e.toRDF(a,o);return Mn.canonize(d,s)},e.fromRDF=async function(a,s){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");s=i(s,{format:ae(a)?"application/n-quads":void 0});const{format:o}=s;let{rdfParser:d}=s;if(o){if(d=d||t[o],!d)throw new ie("Unknown input format.","jsonld.UnknownFormat",{format:o})}else d=()=>a;const c=await d(a);return vi(c,s)},e.toRDF=async function(a,s){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");s=i(s,{base:ae(a)?a:"",skipExpansion:!1,contextResolver:new ce({sharedCache:r})});let o;s.skipExpansion?o=a:o=await e.expand(a,s);const d=bi(o,s);if(s.format){if(s.format==="application/n-quads"||s.format==="application/nquads")return st.serialize(d);throw new ie("Unknown output format.","jsonld.UnknownFormat",{format:s.format})}return d},e.createNodeMap=async function(a,s){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");s=i(s,{base:ae(a)?a:"",contextResolver:new ce({sharedCache:r})});const o=await e.expand(a,s);return Si(o,s)},e.merge=async function(a,s,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!$e(a))throw new TypeError('Could not merge, "docs" must be an array.');typeof s=="function"?s=null:s=s||null,o=i(o,{contextResolver:new ce({sharedCache:r})});const d=await Promise.all(a.map(y=>{const m={...o};return e.expand(y,m)}));let c=!0;"mergeNodes"in o&&(c=o.mergeNodes);const p=o.issuer||new Bt("_:b"),h={"@default":{}};for(let y=0;ye._documentLoader,set:a=>e._documentLoader=a}),e.documentLoader=async a=>{throw new ie("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:a})},e.get=async function(a,s){let o;typeof s.documentLoader=="function"?o=s.documentLoader:o=e.documentLoader;const d=await o(a);try{if(!d.document)throw new ie("No remote document found at the given URL.","jsonld.NullRemoteDocument");ae(d.document)&&(d.document=JSON.parse(d.document))}catch(c){throw new ie("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:c,remoteDoc:d})}return d},e.processContext=async function(a,s,o){return o=i(o,{base:"",contextResolver:new ce({sharedCache:r})}),s===null?it(o):(s=ye.clone(s),Ne(s)&&"@context"in s||(s={"@context":s}),Hn({activeCtx:a,localCtx:s,options:o}))},e.getContextValue=Ae.getContextValue,e.documentLoaders={},e.useDocumentLoader=function(a){if(!(a in e.documentLoaders))throw new ie('Unknown document loader type: "'+a+'"',"jsonld.UnknownDocumentLoader",{type:a});e.documentLoader=e.documentLoaders[a].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(a,s){t[a]=s},e.unregisterRDFParser=function(a){delete t[a]},e.registerRDFParser("application/n-quads",st.parse),e.registerRDFParser("application/nquads",st.parse),e.url=xe,e.logEventHandler=Di,e.logWarningEventHandler=Ri,e.safeEventHandler=Li,e.setDefaultEventHandler=Ai,e.strictEventHandler=ki,e.unhandledEventHandler=$i,e.util=ye,Object.assign(e,ye),e.promises=e,e.RequestQueue=Xn(),e.JsonLdProcessor=pi()(e),Fn.setupGlobals(e),Fn.setupDocumentLoaders(e);function i(a,{documentLoader:s=e.documentLoader,...o}){if(a&&"compactionMap"in a)throw new ie('"compactionMap" not supported.',"jsonld.OptionsError");if(a&&"expansionMap"in a)throw new ie('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:s},o,a,{eventHandler:Ti({options:a})})}return e},ln=function(){return fr(function(){return ln()})};fr(ln);var Ji=ln;const at=yr(Ji);async function Mi(e){const t=[];for await(const n of e)t.push(n);return t}class je extends mr.Readable{constructor(t,{baseIRI:n,compact:r,context:i={},encoding:a="object",flatten:s,frame:o,prettyPrint:d,skipContext:c}={}){super({objectMode:!0,read:()=>{}}),this.compact=r,this.context=i,this.encoding=a,this.flatten=s,this.frame=o,this.prettyPrint=d,this.skipContext=c,n&&(this.context["@base"]=n.value||n.toString()),t.on("prefix",(p,h)=>{this.context[p]||(this.context[p]=h.value)}),this.handleData(t)}async handleData(t){try{const n=(await Mi(t)).map(je.toJsonldQuad),r=await at.fromRDF(n),i=await this.transform(r,this.options);this.push(i),this.push(null)}catch(n){this.emit("error",n)}}async transform(t){return this.compact&&(t=await at.compact(t,this.context)),this.flatten&&(t=await at.flatten(t,this.context)),this.frame&&(t=await at.frame(t,this.context)),this.skipContext&&t["@context"]&&delete t["@context"],this.encoding==="string"?this.prettyPrint?JSON.stringify(t,null,2):JSON.stringify(t):t}static toJsonldQuad(t){return{subject:je.toJsonldTerm(t.subject),predicate:je.toJsonldTerm(t.predicate),object:je.toJsonldTerm(t.object),graph:je.toJsonldTerm(t.graph)}}static toJsonldTerm(t){return t.termType==="BlankNode"?{termType:"BlankNode",value:`_:${t.value}`}:t}}class Yi extends hr{constructor(t){super(je,t)}}export{Yi as default}; diff --git a/converter/assets/index-DRb_7OTM.js b/converter/assets/index-DRb_7OTM.js new file mode 100644 index 0000000..2fdd4e9 --- /dev/null +++ b/converter/assets/index-DRb_7OTM.js @@ -0,0 +1,2 @@ +import{S as a}from"./index-BOvYCoiN.js";import{a as n,t as i}from"./index-DtgbetCt.js";import{r as m}from"./readable-BmS1kvD9.js";class c{constructor(o){const r=new n.Transform({objectMode:!0,transform:(t,l,s)=>{s(null,`${i(t)} +`)}});return o.pipe(r),m(r)}}class d extends a{constructor(){super(c)}}export{d as default}; diff --git a/converter/assets/index-DtgbetCt.js b/converter/assets/index-DtgbetCt.js new file mode 100644 index 0000000..28529b7 --- /dev/null +++ b/converter/assets/index-DtgbetCt.js @@ -0,0 +1,483 @@ +const __vite__fileDeps=["assets/index-BU-jGoQy.js","assets/index-BOvYCoiN.js","assets/readable-BmS1kvD9.js","assets/index-70bBVy50.js","assets/canonicalize-DMjjQ0zD.js","assets/index-Bk1OmMYS.js","assets/CustomRdfXmlParser-lwfOQbte.js","assets/index-DRb_7OTM.js","assets/CustomJsonLdSerializer-eGWsaUBU.js","assets/main-B4ltdbX3.js","assets/main-B9Y9bPv0.js","assets/main-B06IXfHH.js","assets/main-9bW7T1LR.js","assets/browser-BwSN-dYO.js","assets/main-BXAPmmD-.js","assets/main-Cwp2YZyg.js","assets/main-DYtbBt7L.js","assets/main-CRBhJGQX.js","assets/index-Bt-DoqtB.js","assets/stream-BoghbXpd.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +const Vs=Object.freeze(Object.defineProperty({__proto__:null,get _void(){return Cx},get acl(){return Yy},get as(){return Zy},get bibo(){return eb},get cc(){return rb},get cert(){return nb},get cnt(){return lb},get constant(){return ab},get crm(){return fb},get csvw(){return db},get ctag(){return pb},get dash(){return bb},get dashSparql(){return wb},get dbo(){return vb},get dc11(){return Sb},get dcam(){return Eb},get dcat(){return Tb},get dcmitype(){return Ab},get dcterms(){return Rb},get default(){return qy},get dig(){return Nb},get discipline(){return Ib},get doap(){return Db},get dpv(){return Bb},get dqv(){return Wb},get dtype(){return Ub},get duv(){return zb},get earl(){return qb},get ebucore(){return Xb},get exif(){return Yb},get foaf(){return Zb},get frbr(){return em},get geo(){return rm},get geof(){return nm},get geor(){return lm},get gml(){return am},get gn(){return fm},get gr(){return dm},get grddl(){return pm},get gs1(){return wm},get gtfs(){return bm},get http(){return vm},get hydra(){return Sm},get ical(){return Em},get la(){return Tm},get ldp(){return Am},get list(){return Rm},get locn(){return Nm},get log(){return Im},get lvont(){return Dm},get m4i(){return Bm},get ma(){return Wm},get mads(){return Um},get math(){return zm},get oa(){return qm},get og(){return Xm},get oidc(){return Ym},get org(){return Zm},get owl(){return ev},get pim(){return rv},get prefix(){return nv},get prov(){return lv},get qb(){return av},get qkdv(){return fv},get quantitykind(){return dv},get qudt(){return pv},get rdau(){return wv},get rdf(){return $t},get rdfa(){return mv},get rdfs(){return xv},get rev(){return _v},get rico(){return Cv},get rif(){return Bx},get rr(){return kv},get rss(){return Lv},get schema(){return Mv},get sd(){return $v},get sdmx(){return Ov},get sem(){return Pv},get set(){return Fv},get sf(){return Hv},get sh(){return jv},get shex(){return Gv},get shsh(){return Kv},get sioc(){return Vv},get skos(){return Jv},get skosxl(){return Qv},get solid(){return tx},get sosa(){return ix},get sou(){return ox},get ssn(){return sx},get stat(){return ux},get string(){return cx},get test(){return hx},get time(){return gx},get unit(){return yx},get v(){return Wx},get vaem(){return mx},get vann(){return xx},get vcard(){return _x},get vs(){return kx},get wdr(){return Ux},get wdrs(){return Lx},get wgs(){return Mx},get xhv(){return $x},get xkos(){return Ox},get xml(){return zx},get xsd(){return yn}},Symbol.toStringTag,{value:"Module"}));(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ys=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Js=Symbol(),fu=new Map;let ac=class{constructor(t,r){if(this._$cssResult$=!0,r!==Js)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=fu.get(this.cssText);return Ys&&t===void 0&&(fu.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}};const kp=e=>new ac(typeof e=="string"?e:e+"",Js),uc=(e,...t)=>{const r=e.length===1?e[0]:t.reduce((i,n,o)=>i+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[o+1],e[0]);return new ac(r,Js)},Ap=(e,t)=>{Ys?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{const i=document.createElement("style"),n=window.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,e.appendChild(i)})},cu=Ys?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return kp(r)})(e):e;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Nl;const du=window.trustedTypes,Lp=du?du.emptyScript:"",hu=window.reactiveElementPolyfillSupport,cs={toAttribute(e,t){switch(t){case Boolean:e=e?Lp:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},fc=(e,t)=>t!==e&&(t==t||e==e),$l={attribute:!0,type:String,converter:cs,reflect:!1,hasChanged:fc};let mi=class extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var r;(r=this.l)!==null&&r!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Eh(i,r);n!==void 0&&(this._$Eu.set(n,i),t.push(n))}),t}static createProperty(t,r=$l){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,r);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,r,i){return{get(){return this[r]},set(n){const o=this[t];this[r]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||$l}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const r=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)r.unshift(cu(n))}else t!==void 0&&r.push(cu(t));return r}static _$Eh(t,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,i;((r=this._$Eg)!==null&&r!==void 0?r:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var r;(r=this._$Eg)===null||r===void 0||r.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Et.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;const r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return Ap(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$ES(t,r,i=$l){var n,o;const l=this.constructor._$Eh(t,i);if(l!==void 0&&i.reflect===!0){const s=((o=(n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==null&&o!==void 0?o:cs.toAttribute)(r,i.type);this._$Ei=t,s==null?this.removeAttribute(l):this.setAttribute(l,s),this._$Ei=null}}_$AK(t,r){var i,n,o;const l=this.constructor,s=l._$Eu.get(t);if(s!==void 0&&this._$Ei!==s){const a=l.getPropertyOptions(s),u=a.converter,d=(o=(n=(i=u)===null||i===void 0?void 0:i.fromAttribute)!==null&&n!==void 0?n:typeof u=="function"?u:null)!==null&&o!==void 0?o:cs.fromAttribute;this._$Ei=s,this[s]=d(r,a.type),this._$Ei=null}}requestUpdate(t,r,i){let n=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||fc)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$Ei!==t&&(this._$E_===void 0&&(this._$E_=new Map),this._$E_.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(r){Promise.reject(r)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((n,o)=>this[o]=n),this._$Et=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(n=>{var o;return(o=n.hostUpdate)===null||o===void 0?void 0:o.call(n)}),this.update(i)):this._$EU()}catch(n){throw r=!1,this._$EU(),n}r&&this._$AE(i)}willUpdate(t){}_$AE(t){var r;(r=this._$Eg)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$E_!==void 0&&(this._$E_.forEach((r,i)=>this._$ES(i,this[i],r)),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}};mi.finalized=!0,mi.elementProperties=new Map,mi.elementStyles=[],mi.shadowRootOptions={mode:"open"},hu==null||hu({ReactiveElement:mi}),((Nl=globalThis.reactiveElementVersions)!==null&&Nl!==void 0?Nl:globalThis.reactiveElementVersions=[]).push("1.0.2");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Il;const Oi=globalThis.trustedTypes,pu=Oi?Oi.createPolicy("lit-html",{createHTML:e=>e}):void 0,Sr=`lit$${(Math.random()+"").slice(9)}$`,cc="?"+Sr,Rp=`<${cc}>`,Di=document,kn=(e="")=>Di.createComment(e),An=e=>e===null||typeof e!="object"&&typeof e!="function",dc=Array.isArray,Mp=e=>{var t;return dc(e)||typeof((t=e)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},on=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gu=/-->/g,wu=/>/g,Br=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,yu=/'/g,bu=/"/g,hc=/^(?:script|style|textarea)$/i,Np=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),pc=Np(1),Pi=Symbol.for("lit-noChange"),Ve=Symbol.for("lit-nothing"),mu=new WeakMap,$p=(e,t,r)=>{var i,n;const o=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:t;let l=o._$litPart$;if(l===void 0){const s=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:null;o._$litPart$=l=new Kn(t.insertBefore(kn(),s),s,void 0,r??{})}return l._$AI(e),l},Ti=Di.createTreeWalker(Di,129,null,!1),Ip=(e,t)=>{const r=e.length-1,i=[];let n,o=t===2?"":"",l=on;for(let a=0;a"?(l=n??on,g=-1):h[1]===void 0?g=-2:(g=l.lastIndex-h[2].length,d=h[1],l=h[3]===void 0?Br:h[3]==='"'?bu:yu):l===bu||l===yu?l=Br:l===gu||l===wu?l=on:(l=Br,n=void 0);const m=l===Br&&e[a+1].startsWith("/>")?" ":"";o+=l===on?u+Rp:g>=0?(i.push(d),u.slice(0,g)+"$lit$"+u.slice(g)+Sr+m):u+Sr+(g===-2?(i.push(void 0),a):m)}const s=o+(e[r]||"")+(t===2?"":"");return[pu!==void 0?pu.createHTML(s):s,i]};class Ln{constructor({strings:t,_$litType$:r},i){let n;this.parts=[];let o=0,l=0;const s=t.length-1,a=this.parts,[u,d]=Ip(t,r);if(this.el=Ln.createElement(u,i),Ti.currentNode=this.el.content,r===2){const h=this.el.content,g=h.firstChild;g.remove(),h.append(...g.childNodes)}for(;(n=Ti.nextNode())!==null&&a.length0){n.textContent=Oi?Oi.emptyScript:"";for(let p=0;p2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Ve}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,i,n){const o=this.strings;let l=!1;if(o===void 0)t=Bi(this,t,r,0),l=!An(t)||t!==this._$AH&&t!==Pi,l&&(this._$AH=t);else{const s=t;let a,u;for(t=o[0],a=0;a0){const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));n=Promise.all(r.map(a=>{if(a=qp(a),a in _u)return;_u[a]=!0;const u=a.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!i)for(let p=o.length-1;p>=0;p--){const m=o[p];if(m.href===a&&(!u||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${d}`))return;const g=document.createElement("link");if(g.rel=u?"stylesheet":Gp,u||(g.as="script",g.crossOrigin=""),g.href=a,s&&g.setAttribute("nonce",s),document.head.appendChild(g),u)return new Promise((p,m)=>{g.addEventListener("load",p),g.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${a}`)))})}))}return n.then(()=>t()).catch(o=>{const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o})},Kp=(e,t,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const n=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!Xp(n,o)&&i||Object.defineProperty(e,r,o)},Xp=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Vp=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Yp=(e,t)=>`/* Wrapped ${e}*/ +${t}`,Jp=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Zp=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Qp=(e,t,r)=>{const i=r===""?"":`with ${r.trim()}() `,n=Yp.bind(null,i,t.toString());Object.defineProperty(n,"name",Zp),Object.defineProperty(e,"toString",{...Jp,value:n})};function eg(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:i}=e;for(const n of Reflect.ownKeys(t))Kp(e,t,n,r);return Vp(e,t),Qp(e,t,i),e}const Mo=new WeakMap,bc=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,i=0;const n=e.displayName||e.name||"",o=function(...l){if(Mo.set(o,++i),i===1)r=e.apply(this,l),e=null;else if(t.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return r};return eg(o,e),Mo.set(o,i),o};bc.callCount=e=>{if(!Mo.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Mo.get(e)};var ME=typeof globalThis<"u"?globalThis:typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{};function ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),r}var mc={exports:{}},Pl={exports:{}},gr={},Vo={};Vo.byteLength=ng;Vo.toByteArray=lg;Vo.fromByteArray=ug;var Kt=[],St=[],rg=typeof Uint8Array<"u"?Uint8Array:Array,Bl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var yi=0,ig=Bl.length;yi0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var i=r===t?0:4-r%4;return[r,i]}function ng(e){var t=vc(e),r=t[0],i=t[1];return(r+i)*3/4-i}function og(e,t,r){return(t+r)*3/4-r}function lg(e){var t,r=vc(e),i=r[0],n=r[1],o=new rg(og(e,i,n)),l=0,s=n>0?i-4:i,a;for(a=0;a>16&255,o[l++]=t>>8&255,o[l++]=t&255;return n===2&&(t=St[e.charCodeAt(a)]<<2|St[e.charCodeAt(a+1)]>>4,o[l++]=t&255),n===1&&(t=St[e.charCodeAt(a)]<<10|St[e.charCodeAt(a+1)]<<4|St[e.charCodeAt(a+2)]>>2,o[l++]=t>>8&255,o[l++]=t&255),o}function sg(e){return Kt[e>>18&63]+Kt[e>>12&63]+Kt[e>>6&63]+Kt[e&63]}function ag(e,t,r){for(var i,n=[],o=t;os?s:l+o));return i===1?(t=e[r-1],n.push(Kt[t>>2]+Kt[t<<4&63]+"==")):i===2&&(t=(e[r-2]<<8)+e[r-1],n.push(Kt[t>>10]+Kt[t>>4&63]+Kt[t<<2&63]+"=")),n.join("")}var ia={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ia.read=function(e,t,r,i,n){var o,l,s=n*8-i-1,a=(1<>1,d=-7,h=r?n-1:0,g=r?-1:1,p=e[t+h];for(h+=g,o=p&(1<<-d)-1,p>>=-d,d+=s;d>0;o=o*256+e[t+h],h+=g,d-=8);for(l=o&(1<<-d)-1,o>>=-d,d+=i;d>0;l=l*256+e[t+h],h+=g,d-=8);if(o===0)o=1-u;else{if(o===a)return l?NaN:(p?-1:1)*(1/0);l=l+Math.pow(2,i),o=o-u}return(p?-1:1)*l*Math.pow(2,o-i)};ia.write=function(e,t,r,i,n,o){var l,s,a,u=o*8-n-1,d=(1<>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,C=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,l=d):(l=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-l))<1&&(l--,a*=2),l+h>=1?t+=g/a:t+=g*Math.pow(2,1-h),t*a>=2&&(l++,a/=2),l+h>=d?(s=0,l=d):l+h>=1?(s=(t*a-1)*Math.pow(2,n),l=l+h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),l=0));n>=8;e[r+p]=s&255,p+=m,s/=256,n-=8);for(l=l<0;e[r+p]=l&255,p+=m,l/=256,u-=8);e[r+p-m]|=C*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const t=Vo,r=ia,i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=o(),!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 o(){try{const y=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(y,f),y.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 l(y){if(y>n)throw new RangeError('The value "'+y+'" is invalid for option "size"');const f=new Uint8Array(y);return Object.setPrototypeOf(f,s.prototype),f}function s(y,f,c){if(typeof y=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(y)}return a(y,f,c)}s.poolSize=8192;function a(y,f,c){if(typeof y=="string")return g(y,f);if(ArrayBuffer.isView(y))return m(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(te(y,ArrayBuffer)||y&&te(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(te(y,SharedArrayBuffer)||y&&te(y.buffer,SharedArrayBuffer)))return C(y,f,c);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=y.valueOf&&y.valueOf();if(x!=null&&x!==y)return s.from(x,f,c);const k=T(y);if(k)return k;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return s.from(y[Symbol.toPrimitive]("string"),f,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y)}s.from=function(y,f,c){return a(y,f,c)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function d(y,f,c){return u(y),y<=0?l(y):f!==void 0?typeof c=="string"?l(y).fill(f,c):l(y).fill(f):l(y)}s.alloc=function(y,f,c){return d(y,f,c)};function h(y){return u(y),l(y<0?0:R(y)|0)}s.allocUnsafe=function(y){return h(y)},s.allocUnsafeSlow=function(y){return h(y)};function g(y,f){if((typeof f!="string"||f==="")&&(f="utf8"),!s.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const c=N(y,f)|0;let x=l(c);const k=x.write(y,f);return k!==c&&(x=x.slice(0,k)),x}function p(y){const f=y.length<0?0:R(y.length)|0,c=l(f);for(let x=0;x=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return y|0}function A(y){return+y!=y&&(y=0),s.alloc(+y)}s.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==s.prototype},s.compare=function(f,c){if(te(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),te(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),!s.isBuffer(f)||!s.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===c)return 0;let x=f.length,k=c.length;for(let $=0,I=Math.min(x,k);$k.length?(s.isBuffer(I)||(I=s.from(I)),I.copy(k,$)):Uint8Array.prototype.set.call(k,I,$);else if(s.isBuffer(I))I.copy(k,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=I.length}return k};function N(y,f){if(s.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||te(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);const c=y.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&c===0)return 0;let k=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Y(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return Ee(y).length;default:if(k)return x?-1:Y(y).length;f=(""+f).toLowerCase(),k=!0}}s.byteLength=N;function H(y,f,c){let x=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,f>>>=0,c<=f))return"";for(y||(y="utf8");;)switch(y){case"hex":return we(this,f,c);case"utf8":case"utf-8":return oe(this,f,c);case"ascii":return be(this,f,c);case"latin1":case"binary":return Le(this,f,c);case"base64":return D(this,f,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,f,c);default:if(x)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),x=!0}}s.prototype._isBuffer=!0;function U(y,f,c){const x=y[f];y[f]=y[c],y[c]=x}s.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;cc&&(f+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(f,c,x,k,$){if(te(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(c===void 0&&(c=0),x===void 0&&(x=f?f.length:0),k===void 0&&(k=0),$===void 0&&($=this.length),c<0||x>f.length||k<0||$>this.length)throw new RangeError("out of range index");if(k>=$&&c>=x)return 0;if(k>=$)return-1;if(c>=x)return 1;if(c>>>=0,x>>>=0,k>>>=0,$>>>=0,this===f)return 0;let I=$-k,pe=x-c;const Te=Math.min(I,pe),ke=this.slice(k,$),me=f.slice(c,x);for(let _e=0;_e2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,Ye(c)&&(c=k?0:y.length-1),c<0&&(c=y.length+c),c>=y.length){if(k)return-1;c=y.length-1}else if(c<0)if(k)c=0;else return-1;if(typeof f=="string"&&(f=s.from(f,x)),s.isBuffer(f))return f.length===0?-1:le(y,f,c,x,k);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?k?Uint8Array.prototype.indexOf.call(y,f,c):Uint8Array.prototype.lastIndexOf.call(y,f,c):le(y,[f],c,x,k);throw new TypeError("val must be string, number or Buffer")}function le(y,f,c,x,k){let $=1,I=y.length,pe=f.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(y.length<2||f.length<2)return-1;$=2,I/=2,pe/=2,c/=2}function Te(me,_e){return $===1?me[_e]:me.readUInt16BE(_e*$)}let ke;if(k){let me=-1;for(ke=c;keI&&(c=I-pe),ke=c;ke>=0;ke--){let me=!0;for(let _e=0;_ek&&(x=k)):x=k;const $=f.length;x>$/2&&(x=$/2);let I;for(I=0;I>>0,isFinite(x)?(x=x>>>0,k===void 0&&(k="utf8")):(k=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-c;if((x===void 0||x>$)&&(x=$),f.length>0&&(x<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");k||(k="utf8");let I=!1;for(;;)switch(k){case"hex":return ce(this,f,c,x);case"utf8":case"utf-8":return S(this,f,c,x);case"ascii":case"latin1":case"binary":return O(this,f,c,x);case"base64":return v(this,f,c,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,f,c,x);default:if(I)throw new TypeError("Unknown encoding: "+k);k=(""+k).toLowerCase(),I=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(y,f,c){return f===0&&c===y.length?t.fromByteArray(y):t.fromByteArray(y.slice(f,c))}function oe(y,f,c){c=Math.min(y.length,c);const x=[];let k=f;for(;k239?4:$>223?3:$>191?2:1;if(k+pe<=c){let Te,ke,me,_e;switch(pe){case 1:$<128&&(I=$);break;case 2:Te=y[k+1],(Te&192)===128&&(_e=($&31)<<6|Te&63,_e>127&&(I=_e));break;case 3:Te=y[k+1],ke=y[k+2],(Te&192)===128&&(ke&192)===128&&(_e=($&15)<<12|(Te&63)<<6|ke&63,_e>2047&&(_e<55296||_e>57343)&&(I=_e));break;case 4:Te=y[k+1],ke=y[k+2],me=y[k+3],(Te&192)===128&&(ke&192)===128&&(me&192)===128&&(_e=($&15)<<18|(Te&63)<<12|(ke&63)<<6|me&63,_e>65535&&_e<1114112&&(I=_e))}}I===null?(I=65533,pe=1):I>65535&&(I-=65536,x.push(I>>>10&1023|55296),I=56320|I&1023),x.push(I),k+=pe}return fe(x)}const se=4096;function fe(y){const f=y.length;if(f<=se)return String.fromCharCode.apply(String,y);let c="",x=0;for(;xx)&&(c=x);let k="";for(let $=f;$x&&(f=x),c<0?(c+=x,c<0&&(c=0)):c>x&&(c=x),cc)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(f,c,x){f=f>>>0,c=c>>>0,x||J(f,c,this.length);let k=this[f],$=1,I=0;for(;++I>>0,c=c>>>0,x||J(f,c,this.length);let k=this[f+--c],$=1;for(;c>0&&($*=256);)k+=this[f+--c]*$;return k},s.prototype.readUint8=s.prototype.readUInt8=function(f,c){return f=f>>>0,c||J(f,1,this.length),this[f]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(f,c){return f=f>>>0,c||J(f,2,this.length),this[f]|this[f+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(f,c){return f=f>>>0,c||J(f,2,this.length),this[f]<<8|this[f+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(f,c){return f=f>>>0,c||J(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(f,c){return f=f>>>0,c||J(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},s.prototype.readBigUInt64LE=Xe(function(f){f=f>>>0,L(f,"offset");const c=this[f],x=this[f+7];(c===void 0||x===void 0)&&M(f,this.length-8);const k=c+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,$=this[++f]+this[++f]*2**8+this[++f]*2**16+x*2**24;return BigInt(k)+(BigInt($)<>>0,L(f,"offset");const c=this[f],x=this[f+7];(c===void 0||x===void 0)&&M(f,this.length-8);const k=c*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],$=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+x;return(BigInt(k)<>>0,c=c>>>0,x||J(f,c,this.length);let k=this[f],$=1,I=0;for(;++I=$&&(k-=Math.pow(2,8*c)),k},s.prototype.readIntBE=function(f,c,x){f=f>>>0,c=c>>>0,x||J(f,c,this.length);let k=c,$=1,I=this[f+--k];for(;k>0&&($*=256);)I+=this[f+--k]*$;return $*=128,I>=$&&(I-=Math.pow(2,8*c)),I},s.prototype.readInt8=function(f,c){return f=f>>>0,c||J(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},s.prototype.readInt16LE=function(f,c){f=f>>>0,c||J(f,2,this.length);const x=this[f]|this[f+1]<<8;return x&32768?x|4294901760:x},s.prototype.readInt16BE=function(f,c){f=f>>>0,c||J(f,2,this.length);const x=this[f+1]|this[f]<<8;return x&32768?x|4294901760:x},s.prototype.readInt32LE=function(f,c){return f=f>>>0,c||J(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},s.prototype.readInt32BE=function(f,c){return f=f>>>0,c||J(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},s.prototype.readBigInt64LE=Xe(function(f){f=f>>>0,L(f,"offset");const c=this[f],x=this[f+7];(c===void 0||x===void 0)&&M(f,this.length-8);const k=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(x<<24);return(BigInt(k)<>>0,L(f,"offset");const c=this[f],x=this[f+7];(c===void 0||x===void 0)&&M(f,this.length-8);const k=(c<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(k)<>>0,c||J(f,4,this.length),r.read(this,f,!0,23,4)},s.prototype.readFloatBE=function(f,c){return f=f>>>0,c||J(f,4,this.length),r.read(this,f,!1,23,4)},s.prototype.readDoubleLE=function(f,c){return f=f>>>0,c||J(f,8,this.length),r.read(this,f,!0,52,8)},s.prototype.readDoubleBE=function(f,c){return f=f>>>0,c||J(f,8,this.length),r.read(this,f,!1,52,8)};function X(y,f,c,x,k,$){if(!s.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>k||f<$)throw new RangeError('"value" argument is out of bounds');if(c+x>y.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(f,c,x,k){if(f=+f,c=c>>>0,x=x>>>0,!k){const pe=Math.pow(2,8*x)-1;X(this,f,c,x,pe,0)}let $=1,I=0;for(this[c]=f&255;++I>>0,x=x>>>0,!k){const pe=Math.pow(2,8*x)-1;X(this,f,c,x,pe,0)}let $=x-1,I=1;for(this[c+$]=f&255;--$>=0&&(I*=256);)this[c+$]=f/I&255;return c+x},s.prototype.writeUint8=s.prototype.writeUInt8=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,1,255,0),this[c]=f&255,c+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,2,65535,0),this[c]=f&255,this[c+1]=f>>>8,c+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,2,65535,0),this[c]=f>>>8,this[c+1]=f&255,c+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,4,4294967295,0),this[c+3]=f>>>24,this[c+2]=f>>>16,this[c+1]=f>>>8,this[c]=f&255,c+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,4,4294967295,0),this[c]=f>>>24,this[c+1]=f>>>16,this[c+2]=f>>>8,this[c+3]=f&255,c+4};function G(y,f,c,x,k){et(f,x,k,y,c,7);let $=Number(f&BigInt(4294967295));y[c++]=$,$=$>>8,y[c++]=$,$=$>>8,y[c++]=$,$=$>>8,y[c++]=$;let I=Number(f>>BigInt(32)&BigInt(4294967295));return y[c++]=I,I=I>>8,y[c++]=I,I=I>>8,y[c++]=I,I=I>>8,y[c++]=I,c}function re(y,f,c,x,k){et(f,x,k,y,c,7);let $=Number(f&BigInt(4294967295));y[c+7]=$,$=$>>8,y[c+6]=$,$=$>>8,y[c+5]=$,$=$>>8,y[c+4]=$;let I=Number(f>>BigInt(32)&BigInt(4294967295));return y[c+3]=I,I=I>>8,y[c+2]=I,I=I>>8,y[c+1]=I,I=I>>8,y[c]=I,c+8}s.prototype.writeBigUInt64LE=Xe(function(f,c=0){return G(this,f,c,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Xe(function(f,c=0){return re(this,f,c,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(f,c,x,k){if(f=+f,c=c>>>0,!k){const Te=Math.pow(2,8*x-1);X(this,f,c,x,Te-1,-Te)}let $=0,I=1,pe=0;for(this[c]=f&255;++$>0)-pe&255;return c+x},s.prototype.writeIntBE=function(f,c,x,k){if(f=+f,c=c>>>0,!k){const Te=Math.pow(2,8*x-1);X(this,f,c,x,Te-1,-Te)}let $=x-1,I=1,pe=0;for(this[c+$]=f&255;--$>=0&&(I*=256);)f<0&&pe===0&&this[c+$+1]!==0&&(pe=1),this[c+$]=(f/I>>0)-pe&255;return c+x},s.prototype.writeInt8=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,1,127,-128),f<0&&(f=255+f+1),this[c]=f&255,c+1},s.prototype.writeInt16LE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,2,32767,-32768),this[c]=f&255,this[c+1]=f>>>8,c+2},s.prototype.writeInt16BE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,2,32767,-32768),this[c]=f>>>8,this[c+1]=f&255,c+2},s.prototype.writeInt32LE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,4,2147483647,-2147483648),this[c]=f&255,this[c+1]=f>>>8,this[c+2]=f>>>16,this[c+3]=f>>>24,c+4},s.prototype.writeInt32BE=function(f,c,x){return f=+f,c=c>>>0,x||X(this,f,c,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[c]=f>>>24,this[c+1]=f>>>16,this[c+2]=f>>>8,this[c+3]=f&255,c+4},s.prototype.writeBigInt64LE=Xe(function(f,c=0){return G(this,f,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Xe(function(f,c=0){return re(this,f,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Se(y,f,c,x,k,$){if(c+x>y.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function Lt(y,f,c,x,k){return f=+f,c=c>>>0,k||Se(y,f,c,4),r.write(y,f,c,x,23,4),c+4}s.prototype.writeFloatLE=function(f,c,x){return Lt(this,f,c,!0,x)},s.prototype.writeFloatBE=function(f,c,x){return Lt(this,f,c,!1,x)};function ge(y,f,c,x,k){return f=+f,c=c>>>0,k||Se(y,f,c,8),r.write(y,f,c,x,52,8),c+8}s.prototype.writeDoubleLE=function(f,c,x){return ge(this,f,c,!0,x)},s.prototype.writeDoubleBE=function(f,c,x){return ge(this,f,c,!1,x)},s.prototype.copy=function(f,c,x,k){if(!s.isBuffer(f))throw new TypeError("argument should be a Buffer");if(x||(x=0),!k&&k!==0&&(k=this.length),c>=f.length&&(c=f.length),c||(c=0),k>0&&k=this.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("sourceEnd out of bounds");k>this.length&&(k=this.length),f.length-c>>0,x=x===void 0?this.length:x>>>0,f||(f=0);let $;if(typeof f=="number")for($=c;$2**32?k=ir(String(c)):typeof c=="bigint"&&(k=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(k=ir(k)),k+="n"),x+=` It must be ${f}. Received ${k}`,x},RangeError);function ir(y){let f="",c=y.length;const x=y[0]==="-"?1:0;for(;c>=x+4;c-=3)f=`_${y.slice(c-3,c)}${f}`;return`${y.slice(0,c)}${f}`}function Rt(y,f,c){L(f,"offset"),(y[f]===void 0||y[f+c]===void 0)&&M(f,y.length-(c+1))}function et(y,f,c,x,k,$){if(y>c||y3?f===0||f===BigInt(0)?pe=`>= 0${I} and < 2${I} ** ${($+1)*8}${I}`:pe=`>= -(2${I} ** ${($+1)*8-1}${I}) and < 2 ** ${($+1)*8-1}${I}`:pe=`>= ${f}${I} and <= ${c}${I}`,new Ne.ERR_OUT_OF_RANGE("value",pe,y)}Rt(x,k,$)}function L(y,f){if(typeof y!="number")throw new Ne.ERR_INVALID_ARG_TYPE(f,"number",y)}function M(y,f,c){throw Math.floor(y)!==y?(L(y,c),new Ne.ERR_OUT_OF_RANGE(c||"offset","an integer",y)):f<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${f}`,y)}const W=/[^+/0-9A-Za-z-_]/g;function Q(y){if(y=y.split("=")[0],y=y.trim().replace(W,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function Y(y,f){f=f||1/0;let c;const x=y.length;let k=null;const $=[];for(let I=0;I55295&&c<57344){if(!k){if(c>56319){(f-=3)>-1&&$.push(239,191,189);continue}else if(I+1===x){(f-=3)>-1&&$.push(239,191,189);continue}k=c;continue}if(c<56320){(f-=3)>-1&&$.push(239,191,189),k=c;continue}c=(k-55296<<10|c-56320)+65536}else k&&(f-=3)>-1&&$.push(239,191,189);if(k=null,c<128){if((f-=1)<0)break;$.push(c)}else if(c<2048){if((f-=2)<0)break;$.push(c>>6|192,c&63|128)}else if(c<65536){if((f-=3)<0)break;$.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((f-=4)<0)break;$.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return $}function Re(y){const f=[];for(let c=0;c>8,k=c%256,$.push(k),$.push(x);return $}function Ee(y){return t.toByteArray(Q(y))}function tt(y,f,c,x){let k;for(k=0;k=f.length||k>=y.length);++k)f[k+c]=y[k];return k}function te(y,f){return y instanceof f||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===f.name}function Ye(y){return y!==y}const Or=function(){const y="0123456789abcdef",f=new Array(256);for(let c=0;c<16;++c){const x=c*16;for(let k=0;k<16;++k)f[x+k]=y[c]+y[k]}return f}();function Xe(y){return typeof BigInt>"u"?Fe:y}function Fe(){throw new Error("BigInt not supported")}})(gr);var We={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,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},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,r){return e.then(t,r)},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,r){return e.slice(t,r)},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,r){return e.set(t,r)},Boolean,Uint8Array},xc={exports:{}},ln={exports:{}},Eu;function Rn(){if(Eu)return ln.exports;Eu=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return ln.exports=e,ln.exports.AbortSignal=t,ln.exports.default=e,ln.exports}var na={exports:{}},Ai=typeof Reflect=="object"?Reflect:null,Cu=Ai&&typeof Ai.apply=="function"?Ai.apply:function(t,r,i){return Function.prototype.apply.call(t,r,i)},xo;Ai&&typeof Ai.ownKeys=="function"?xo=Ai.ownKeys:Object.getOwnPropertySymbols?xo=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:xo=function(t){return Object.getOwnPropertyNames(t)};function fg(e){console&&console.warn&&console.warn(e)}var Sc=Number.isNaN||function(t){return t!==t};function $e(){$e.init.call(this)}na.exports=$e;na.exports.once=pg;$e.EventEmitter=$e;$e.prototype._events=void 0;$e.prototype._eventsCount=0;$e.prototype._maxListeners=void 0;var Tu=10;function Yo(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty($e,"defaultMaxListeners",{enumerable:!0,get:function(){return Tu},set:function(e){if(typeof e!="number"||e<0||Sc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Tu=e}});$e.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};$e.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Sc(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function _c(e){return e._maxListeners===void 0?$e.defaultMaxListeners:e._maxListeners}$e.prototype.getMaxListeners=function(){return _c(this)};$e.prototype.emit=function(t){for(var r=[],i=1;i0&&(l=r[0]),l instanceof Error)throw l;var s=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw s.context=l,s}var a=o[t];if(a===void 0)return!1;if(typeof a=="function")Cu(a,this,r);else for(var u=a.length,d=Ac(a,u),i=0;i0&&l.length>n&&!l.warned){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=l.length,fg(s)}return e}$e.prototype.addListener=function(t,r){return Ec(this,t,r,!1)};$e.prototype.on=$e.prototype.addListener;$e.prototype.prependListener=function(t,r){return Ec(this,t,r,!0)};function cg(){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 Cc(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=cg.bind(i);return n.listener=r,i.wrapFn=n,n}$e.prototype.once=function(t,r){return Yo(r),this.on(t,Cc(this,t,r)),this};$e.prototype.prependOnceListener=function(t,r){return Yo(r),this.prependListener(t,Cc(this,t,r)),this};$e.prototype.removeListener=function(t,r){var i,n,o,l,s;if(Yo(r),n=this._events,n===void 0)return this;if(i=n[t],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||r));else if(typeof i!="function"){for(o=-1,l=i.length-1;l>=0;l--)if(i[l]===r||i[l].listener===r){s=i[l].listener,o=l;break}if(o<0)return this;o===0?i.shift():dg(i,o),i.length===1&&(n[t]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",t,s||r)}return this};$e.prototype.off=$e.prototype.removeListener;$e.prototype.removeAllListeners=function(t){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[t]),this;if(arguments.length===0){var o=Object.keys(i),l;for(n=0;n=0;n--)this.removeListener(t,r[n]);return this};function Tc(e,t,r){var i=e._events;if(i===void 0)return[];var n=i[t];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?hg(n):Ac(n,n.length)}$e.prototype.listeners=function(t){return Tc(this,t,!0)};$e.prototype.rawListeners=function(t){return Tc(this,t,!1)};$e.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):kc.call(e,t)};$e.prototype.listenerCount=kc;function kc(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}$e.prototype.eventNames=function(){return this._eventsCount>0?xo(this._events):[]};function Ac(e,t){for(var r=new Array(t),i=0;i{if(g!==void 0&&(g===null||typeof g!="object"||!("aborted"in g)))throw new ERR_INVALID_ARG_TYPE(p,"AbortSignal",g)},d=(g,p)=>{if(typeof g!="function")throw new ERR_INVALID_ARG_TYPE(p,"Function",g)};class h extends Error{constructor(p){if(!Array.isArray(p))throw new TypeError(`Expected input to be an Array, got ${typeof p}`);let m="";for(let C=0;C{g=C,p=T}),resolve:g,reject:p}},promisify(g){return new Promise((p,m)=>{g((C,...T)=>C?m(C):p(...T))})},debuglog(){return function(){}},format(g,...p){return g.replace(/%([sdifj])/g,function(...[m,C]){const T=p.shift();return C==="f"?T.toFixed(6):C==="j"?JSON.stringify(T):C==="s"&&typeof T=="object"?`${T.constructor!==Object?T.constructor.name:""} {}`.trim():T.toString()})},inspect(g){switch(typeof g){case"string":if(g.includes("'"))if(g.includes('"')){if(!g.includes("`")&&!g.includes("${"))return`\`${g}\``}else return`"${g}"`;return`'${g}'`;case"number":return isNaN(g)?"NaN":Object.is(g,-0)?String(g):g;case"bigint":return`${String(g)}n`;case"boolean":case"undefined":return String(g);case"object":return"{}"}},types:{isAsyncFunction(g){return g instanceof l},isArrayBufferView(g){return ArrayBuffer.isView(g)}},isBlob:a,deprecate(g,p){return g},addAbortListener:Jo.addAbortListener||function(p,m){if(p===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",p);u(p,"signal"),d(m,"listener");let C;return p.aborted?queueMicrotask(()=>m()):(p.addEventListener("abort",m,{__proto__:null,once:!0,[r]:!0}),C=()=>{p.removeEventListener("abort",m)}),{__proto__:null,[i](){var T;(T=C)===null||T===void 0||T()}}},AbortSignalAny:n.any||function(p){if(p.length===1)return p[0];const m=new o,C=()=>m.abort();return p.forEach(T=>{u(T,"signals"),T.addEventListener("abort",C,{once:!0})}),m.signal.addEventListener("abort",()=>{p.forEach(T=>T.removeEventListener("abort",C))},{once:!0}),m.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(xc);var ft=xc.exports,oa={};const{format:wg,inspect:No,AggregateError:yg}=ft,bg=globalThis.AggregateError||yg,mg=Symbol("kIsNodeError"),vg=["string","function","number","object","Function","Object","boolean","bigint","symbol"],xg=/^([A-Z][a-z0-9]*)+$/,Sg="__node_internal_",Zo={};function qr(e,t){if(!e)throw new Zo.ERR_INTERNAL_ASSERTION(t)}function ku(e){let t="",r=e.length;const i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function _g(e,t,r){if(typeof t=="function")return qr(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return qr(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:wg(t,...r)}function Qe(e,t,r){r||(r=Error);class i extends r{constructor(...o){super(_g(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[mg]=!0,Zo[e]=i}function Au(e){const t=Sg+e.name;return Object.defineProperty(e,"name",{value:t}),e}function Eg(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new bg([t,e],t.message);return r.code=t.code,r}return e||t}let Cg=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Zo.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Qe("ERR_ASSERTION","%s",Error);Qe("ERR_INVALID_ARG_TYPE",(e,t,r)=>{qr(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 ";const n=[],o=[],l=[];for(const a of t)qr(typeof a=="string","All expected entries have to be of type string"),vg.includes(a)?n.push(a.toLowerCase()):xg.test(a)?o.push(a):(qr(a!=="object",'The value "object" should be written as "Object"'),l.push(a));if(o.length>0){const a=n.indexOf("object");a!==-1&&(n.splice(n,a,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{const a=n.pop();i+=`one of type ${n.join(", ")}, or ${a}`}}(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:{const a=o.pop();i+=`an instance of ${o.join(", ")}, or ${a}`}}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:{const a=l.pop();i+=`one of ${l.join(", ")}, or ${a}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var s;if((s=r.constructor)!==null&&s!==void 0&&s.name)i+=`. Received an instance of ${r.constructor.name}`;else{const a=No(r,{depth:-1});i+=`. Received ${a}`}}else{let a=No(r,{colors:!1});a.length>25&&(a=`${a.slice(0,25)}...`),i+=`. Received type ${typeof r} (${a})`}return i},TypeError);Qe("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=No(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError);Qe("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var i;const n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError);Qe("ERR_MISSING_ARGS",(...e)=>{qr(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(i=>`"${i}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const i=e.pop();t+=`The ${e.join(", ")}, and ${i} arguments`}break}return`${t} must be specified`},TypeError);Qe("ERR_OUT_OF_RANGE",(e,t,r)=>{qr(t,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=ku(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=ku(i)),i+="n"):i=No(r),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError);Qe("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Qe("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Qe("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Qe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Qe("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Qe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Qe("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Qe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Qe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Qe("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Qe("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var pt={AbortError:Cg,aggregateTwoErrors:Au(Eg),hideStackFrames:Au,codes:Zo};const{ArrayIsArray:la,ArrayPrototypeIncludes:Rc,ArrayPrototypeJoin:Mc,ArrayPrototypeMap:Tg,NumberIsInteger:sa,NumberIsNaN:kg,NumberMAX_SAFE_INTEGER:Ag,NumberMIN_SAFE_INTEGER:Lg,NumberParseInt:Rg,ObjectPrototypeHasOwnProperty:Mg,RegExpPrototypeExec:Nc,String:Ng,StringPrototypeToUpperCase:$g,StringPrototypeTrim:Ig}=We,{hideStackFrames:kt,codes:{ERR_SOCKET_BAD_PORT:Og,ERR_INVALID_ARG_TYPE:nt,ERR_INVALID_ARG_VALUE:qi,ERR_OUT_OF_RANGE:Qr,ERR_UNKNOWN_SIGNAL:Lu}}=pt,{normalizeEncoding:Dg}=ft,{isAsyncFunction:Pg,isArrayBufferView:Bg}=ft.types,Ru={};function Fg(e){return e===(e|0)}function Wg(e){return e===e>>>0}const Hg=/^[0-7]+$/,Ug="must be a 32-bit unsigned integer or an octal string";function jg(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Nc(Hg,e)===null)throw new qi(t,e,Ug);e=Rg(e,8)}return $c(e,t),e}const zg=kt((e,t,r=Lg,i=Ag)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!sa(e))throw new Qr(t,"an integer",e);if(ei)throw new Qr(t,`>= ${r} && <= ${i}`,e)}),Gg=kt((e,t,r=-2147483648,i=2147483647)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!sa(e))throw new Qr(t,"an integer",e);if(ei)throw new Qr(t,`>= ${r} && <= ${i}`,e)}),$c=kt((e,t,r=!1)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!sa(e))throw new Qr(t,"an integer",e);const i=r?1:0,n=4294967295;if(en)throw new Qr(t,`>= ${i} && <= ${n}`,e)});function aa(e,t){if(typeof e!="string")throw new nt(t,"string",e)}function qg(e,t,r=void 0,i){if(typeof e!="number")throw new nt(t,"number",e);if(r!=null&&ei||(r!=null||i!=null)&&kg(e))throw new Qr(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}const Kg=kt((e,t,r)=>{if(!Rc(r,e)){const n="must be one of: "+Mc(Tg(r,o=>typeof o=="string"?`'${o}'`:Ng(o)),", ");throw new qi(t,e,n)}});function Ic(e,t){if(typeof e!="boolean")throw new nt(t,"boolean",e)}function Fl(e,t,r){return e==null||!Mg(e,t)?r:e[t]}const Xg=kt((e,t,r=null)=>{const i=Fl(r,"allowArray",!1),n=Fl(r,"allowFunction",!1);if(!Fl(r,"nullable",!1)&&e===null||!i&&la(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new nt(t,"Object",e)}),Vg=kt((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new nt(t,"a dictionary",e)}),Qo=kt((e,t,r=0)=>{if(!la(e))throw new nt(t,"Array",e);if(e.length{if(!Bg(e))throw new nt(t,["Buffer","TypedArray","DataView"],e)});function t0(e,t){const r=Dg(t),i=e.length;if(r==="hex"&&i%2!==0)throw new qi("encoding",t,`is invalid for data of length ${i}`)}function r0(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&Ig(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new Og(t,e,r);return e|0}const Oc=kt((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new nt(t,"AbortSignal",e)}),i0=kt((e,t)=>{if(typeof e!="function")throw new nt(t,"Function",e)}),n0=kt((e,t)=>{if(typeof e!="function"||Pg(e))throw new nt(t,"Function",e)}),o0=kt((e,t)=>{if(e!==void 0)throw new nt(t,"undefined",e)});function l0(e,t,r){if(!Rc(r,e))throw new nt(t,`('${Mc(r,"|")}')`,e)}const s0=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Mu(e,t){if(typeof e>"u"||!Nc(s0,e))throw new qi(t,e,'must be an array or string of format "; rel=preload; as=style"')}function a0(e){if(typeof e=="string")return Mu(e,"hints"),e;if(la(e)){const t=e.length;let r="";if(t===0)return r;for(let i=0;i; rel=preload; as=style"')}var Xn={isInt32:Fg,isUint32:Wg,parseFileMode:jg,validateArray:Qo,validateStringArray:Yg,validateBooleanArray:Jg,validateAbortSignalArray:Zg,validateBoolean:Ic,validateBuffer:e0,validateDictionary:Vg,validateEncoding:t0,validateFunction:i0,validateInt32:Gg,validateInteger:zg,validateNumber:qg,validateObject:Xg,validateOneOf:Kg,validatePlainFunction:n0,validatePort:r0,validateSignalName:Qg,validateString:aa,validateUint32:$c,validateUndefined:o0,validateUnion:l0,validateAbortSignal:Oc,validateLinkHeaderValue:a0},ua={exports:{}},Dc={exports:{}},Ue=Dc.exports={},zt,Gt;function hs(){throw new Error("setTimeout has not been defined")}function ps(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?zt=setTimeout:zt=hs}catch{zt=hs}try{typeof clearTimeout=="function"?Gt=clearTimeout:Gt=ps}catch{Gt=ps}})();function Pc(e){if(zt===setTimeout)return setTimeout(e,0);if((zt===hs||!zt)&&setTimeout)return zt=setTimeout,setTimeout(e,0);try{return zt(e,0)}catch{try{return zt.call(null,e,0)}catch{return zt.call(this,e,0)}}}function u0(e){if(Gt===clearTimeout)return clearTimeout(e);if((Gt===ps||!Gt)&&clearTimeout)return Gt=clearTimeout,clearTimeout(e);try{return Gt(e)}catch{try{return Gt.call(null,e)}catch{return Gt.call(this,e)}}}var lr=[],Li=!1,jr,So=-1;function f0(){!Li||!jr||(Li=!1,jr.length?lr=jr.concat(lr):So=-1,lr.length&&Bc())}function Bc(){if(!Li){var e=Pc(f0);Li=!0;for(var t=lr.length;t;){for(jr=lr,lr=[];++So1)for(var r=1;r{};function ed(e,t,r){var i,n;if(arguments.length===2?(r=t,t=ys):t==null?t=ys:R0(t,"options"),L0(r,"callback"),A0(t.signal,"options.signal"),r=bs(r),O0(e)||D0(e))return H0(e,t,r);if(!P0(e))throw new k0("stream",["ReadableStream","WritableStream","Stream"],e);const o=(i=t.readable)!==null&&i!==void 0?i:Wl(e),l=(n=t.writable)!==null&&n!==void 0?n:Fu(e),s=e._writableState,a=e._readableState,u=()=>{e.writable||g()};let d=B0(e)&&Wl(e)===o&&Fu(e)===l,h=Wu(e,!1);const g=()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&r.call(e)};let p=Du(e,!1);const m=()=>{p=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||l))&&(!l||h)&&r.call(e)},C=U=>{r.call(e,U)};let T=I0(e);const R=()=>{T=!0;const U=Hu(e)||Pu(e);if(U&&typeof U!="boolean")return r.call(e,U);if(o&&!p&&Wl(e,!0)&&!Du(e,!1))return r.call(e,new Iu);if(l&&!h&&!Wu(e,!1))return r.call(e,new Iu);r.call(e)},A=()=>{T=!0;const U=Hu(e)||Pu(e);if(U&&typeof U!="boolean")return r.call(e,U);r.call(e)},N=()=>{e.req.on("finish",g)};W0(e)?(e.on("complete",g),d||e.on("abort",R),e.req?N():e.on("request",N)):l&&!s&&(e.on("end",u),e.on("close",u)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",R),e.on("end",m),e.on("finish",g),t.error!==!1&&e.on("error",C),e.on("close",R),T?vr.nextTick(R):s!=null&&s.errorEmitted||a!=null&&a.errorEmitted?d||vr.nextTick(A):(!o&&(!d||Ou(e))&&(h||Bu(e)===!1)||!l&&(!d||Bu(e))&&(p||Ou(e)===!1)||a&&e.req&&e.aborted)&&vr.nextTick(A);const H=()=>{r=ms,e.removeListener("aborted",R),e.removeListener("complete",g),e.removeListener("abort",R),e.removeListener("request",N),e.req&&e.req.removeListener("finish",g),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",g),e.removeListener("end",m),e.removeListener("error",C),e.removeListener("close",R)};if(t.signal&&!T){const U=()=>{const Z=r;H(),Z.call(e,new Zc(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)vr.nextTick(U);else{Ri=Ri||ft.addAbortListener;const Z=Ri(t.signal,U),le=r;r=bs((...ce)=>{Z[Qc](),le.apply(e,ce)})}}return H}function H0(e,t,r){let i=!1,n=ms;if(t.signal)if(n=()=>{i=!0,r.call(e,new Zc(void 0,{cause:t.signal.reason}))},t.signal.aborted)vr.nextTick(n);else{Ri=Ri||ft.addAbortListener;const l=Ri(t.signal,n),s=r;r=bs((...a)=>{l[Qc](),s.apply(e,a)})}const o=(...l)=>{i||vr.nextTick(()=>r.apply(e,l))};return $0(e[F0].promise,o,o),ms}function U0(e,t){var r;let i=!1;return t===null&&(t=ys),(r=t)!==null&&r!==void 0&&r.cleanup&&(M0(t.cleanup,"cleanup"),i=t.cleanup),new N0((n,o)=>{const l=ed(e,t,s=>{i&&l(),s?o(s):n()})})}ua.exports=ed;ua.exports.finished=U0;var Mr=ua.exports;const Xt=ni,{aggregateTwoErrors:j0,codes:{ERR_MULTIPLE_CALLBACK:z0},AbortError:G0}=pt,{Symbol:td}=We,{kIsDestroyed:q0,isDestroyed:K0,isFinished:X0,isServerRequest:V0}=yr,rd=td("kDestroy"),vs=td("kConstruct");function id(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function Y0(e,t){const r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(id(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Uu(this,e,t):this.once(rd,function(o){Uu(this,j0(o,e),t)}),this)}function Uu(e,t,r){let i=!1;function n(o){if(i)return;i=!0;const l=e._readableState,s=e._writableState;id(o,s,l),s&&(s.closed=!0),l&&(l.closed=!0),typeof r=="function"&&r(o),o?Xt.nextTick(J0,e,o):Xt.nextTick(nd,e)}try{e._destroy(t||null,n)}catch(o){n(o)}}function J0(e,t){xs(e,t),nd(e)}function nd(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function xs(e,t){const r=e._readableState,i=e._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function Z0(){const 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 Ss(e,t,r){const i=e._readableState,n=e._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?e.destroy(t):t&&(t.stack,n&&!n.errored&&(n.errored=t),i&&!i.errored&&(i.errored=t),r?Xt.nextTick(xs,e,t):xs(e,t))}function Q0(e,t){if(typeof e._construct!="function")return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(vs,t),!(e.listenerCount(vs)>1)&&Xt.nextTick(ew,e)}function ew(e){let t=!1;function r(i){if(t){Ss(e,i??new z0);return}t=!0;const n=e._readableState,o=e._writableState,l=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),l.destroyed?e.emit(rd,i):i?Ss(e,i,!0):Xt.nextTick(tw,e)}try{e._construct(i=>{Xt.nextTick(r,i)})}catch(i){Xt.nextTick(r,i)}}function tw(e){e.emit(vs)}function ju(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function od(e){e.emit("close")}function rw(e,t){e.emit("error",t),Xt.nextTick(od,e)}function iw(e,t){!e||K0(e)||(!t&&!X0(e)&&(t=new G0),V0(e)?(e.socket=null,e.destroy(t)):ju(e)?e.abort():ju(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Xt.nextTick(rw,e,t):Xt.nextTick(od,e),e.destroyed||(e[q0]=!0))}var Ki={construct:Q0,destroyer:iw,destroy:Y0,undestroy:Z0,errorOrDestroy:Ss};const{ArrayIsArray:nw,ObjectSetPrototypeOf:ld}=We,{EventEmitter:il}=Jo;function nl(e){il.call(this,e)}ld(nl.prototype,il.prototype);ld(nl,il);nl.prototype.pipe=function(e,t){const r=this;function i(d){e.writable&&e.write(d)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",l),r.on("close",s));let o=!1;function l(){o||(o=!0,e.end())}function s(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function a(d){u(),il.listenerCount(this,"error")===0&&this.emit("error",d)}_s(r,"error",a),_s(e,"error",a);function u(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",l),r.removeListener("close",s),r.removeListener("error",a),e.removeListener("error",a),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function _s(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):nw(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var fa={Stream:nl,prependListener:_s},sd={exports:{}};(function(e){const{SymbolDispose:t}=We,{AbortError:r,codes:i}=pt,{isNodeStream:n,isWebStream:o,kControllerErrorFunction:l}=yr,s=Mr,{ERR_INVALID_ARG_TYPE:a}=i;let u;const d=(h,g)=>{if(typeof h!="object"||!("aborted"in h))throw new a(g,"AbortSignal",h)};e.exports.addAbortSignal=function(g,p){if(d(g,"signal"),!n(p)&&!o(p))throw new a("stream",["ReadableStream","WritableStream","Stream"],p);return e.exports.addAbortSignalNoValidate(g,p)},e.exports.addAbortSignalNoValidate=function(h,g){if(typeof h!="object"||!("aborted"in h))return g;const p=n(g)?()=>{g.destroy(new r(void 0,{cause:h.reason}))}:()=>{g[l](new r(void 0,{cause:h.reason}))};if(h.aborted)p();else{u=u||ft.addAbortListener;const m=u(h,p);s(g,m[t])}return g}})(sd);var ol=sd.exports;const{StringPrototypeSlice:zu,SymbolIterator:ow,TypedArrayPrototypeSet:lo,Uint8Array:lw}=We,{Buffer:Hl}=gr,{inspect:sw}=ft;var aw=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=t+r.data;return i}concat(t){if(this.length===0)return Hl.alloc(0);const r=Hl.allocUnsafe(t>>>0);let i=this.head,n=0;for(;i;)lo(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(t,r){const i=this.head.data;if(to.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=zu(o,0,t),this.head=i,i.data=zu(o,t));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(t){const r=Hl.allocUnsafe(t),i=t;let n=this.head,o=0;do{const l=n.data;if(t>l.length)lo(r,l,i-t),t-=l.length;else{t===l.length?(lo(r,l,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(lo(r,new lw(l.buffer,l.byteOffset,t),i-t),this.head=n,n.data=l.slice(t));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return sw(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:uw,NumberIsInteger:fw}=We,{validateInteger:cw}=Xn,{ERR_INVALID_ARG_VALUE:dw}=pt.codes;let ad=16*1024,ud=16;function hw(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function fd(e){return e?ud:ad}function pw(e,t){cw(t,"value",0),e?ud=t:ad=t}function gw(e,t,r,i){const n=hw(t,i,r);if(n!=null){if(!fw(n)||n<0){const o=i?`options.${r}`:"options.highWaterMark";throw new dw(o,n)}return uw(n)}return fd(e.objectMode)}var ll={getHighWaterMark:gw,getDefaultHighWaterMark:fd,setDefaultHighWaterMark:pw},cd={},Es={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=gr,i=r.Buffer;function n(l,s){for(var a in l)s[a]=l[a]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o);function o(l,s,a){return i(l,s,a)}o.prototype=Object.create(i.prototype),n(i,o),o.from=function(l,s,a){if(typeof l=="number")throw new TypeError("Argument must not be a number");return i(l,s,a)},o.alloc=function(l,s,a){if(typeof l!="number")throw new TypeError("Argument must be a number");var u=i(l);return s!==void 0?typeof a=="string"?u.fill(s,a):u.fill(s):u.fill(0),u},o.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return i(l)},o.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}})(Es,Es.exports);var ww=Es.exports,ca=ww.Buffer,Gu=ca.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 yw(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 bw(e){var t=yw(e);if(typeof t!="string"&&(ca.isEncoding===Gu||!Gu(e)))throw new Error("Unknown encoding: "+e);return t||e}cd.StringDecoder=Vn;function Vn(e){this.encoding=bw(e);var t;switch(this.encoding){case"utf16le":this.text=Ew,this.end=Cw,t=4;break;case"utf8":this.fillLast=xw,t=4;break;case"base64":this.text=Tw,this.end=kw,t=3;break;default:this.write=Aw,this.end=Lw;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ca.allocUnsafe(t)}Vn.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function mw(e,t,r){var i=t.length-1;if(i=0?(n>0&&(e.lastNeed=n-1),n):--i=0?(n>0&&(e.lastNeed=n-2),n):--i=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function vw(e,t,r){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 xw(e){var t=this.lastTotal-this.lastNeed,r=vw(this,e);if(r!==void 0)return r;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 Sw(e,t){var r=mw(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function _w(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function Ew(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Cw(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Tw(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===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-r))}function kw(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Aw(e){return e.toString(this.encoding)}function Lw(e){return e&&e.length?this.write(e):""}const qu=ni,{PromisePrototypeThen:Rw,SymbolAsyncIterator:Ku,SymbolIterator:Xu}=We,{Buffer:Mw}=gr,{ERR_INVALID_ARG_TYPE:Nw,ERR_STREAM_NULL_VALUES:$w}=pt.codes;function Iw(e,t,r){let i;if(typeof t=="string"||t instanceof Mw)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let n;if(t&&t[Ku])n=!0,i=t[Ku]();else if(t&&t[Xu])n=!1,i=t[Xu]();else throw new Nw("iterable",["Iterable"],t);const o=new e({objectMode:!0,highWaterMark:1,...r});let l=!1;o._read=function(){l||(l=!0,a())},o._destroy=function(u,d){Rw(s(u),()=>qu.nextTick(d,u),h=>qu.nextTick(d,h||u))};async function s(u){const d=u!=null,h=typeof i.throw=="function";if(d&&h){const{value:g,done:p}=await i.throw(u);if(await g,p)return}if(typeof i.return=="function"){const{value:g}=await i.return();await g}}async function a(){for(;;){try{const{value:u,done:d}=n?await i.next():i.next();if(d)o.push(null);else{const h=u&&typeof u.then=="function"?await u:u;if(h===null)throw l=!1,new $w;if(o.push(h))continue;l=!1}}catch(u){o.destroy(u)}break}}return o}var dd=Iw,jl,Vu;function sl(){if(Vu)return jl;Vu=1;const e=ni,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:i,NumberParseInt:n,ObjectDefineProperties:o,ObjectKeys:l,ObjectSetPrototypeOf:s,Promise:a,SafeSet:u,SymbolAsyncDispose:d,SymbolAsyncIterator:h,Symbol:g}=We;jl=te,te.ReadableState=tt;const{EventEmitter:p}=Jo,{Stream:m,prependListener:C}=fa,{Buffer:T}=gr,{addAbortSignal:R}=ol,A=Mr;let N=ft.debuglog("stream",b=>{N=b});const H=aw,U=Ki,{getHighWaterMark:Z,getDefaultHighWaterMark:le}=ll,{aggregateTwoErrors:ce,codes:{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:v,ERR_STREAM_PUSH_AFTER_EOF:j,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:D},AbortError:oe}=pt,{validateObject:se}=Xn,fe=g("kPaused"),{StringDecoder:be}=cd,Le=dd;s(te.prototype,m.prototype),s(te,m);const we=()=>{},{errorOrDestroy:xe}=U,J=1,X=2,G=4,re=8,Se=16,Lt=32,ge=64,Ne=128,gt=256,ir=512,Rt=1024,et=2048,L=4096,M=8192,W=16384,Q=32768,Y=65536,Re=1<<17,Ie=1<<18;function Ee(b){return{enumerable:!1,get(){return(this.state&b)!==0},set(E){E?this.state|=b:this.state&=~b}}}o(tt.prototype,{objectMode:Ee(J),ended:Ee(X),endEmitted:Ee(G),reading:Ee(re),constructed:Ee(Se),sync:Ee(Lt),needReadable:Ee(ge),emittedReadable:Ee(Ne),readableListening:Ee(gt),resumeScheduled:Ee(ir),errorEmitted:Ee(Rt),emitClose:Ee(et),autoDestroy:Ee(L),destroyed:Ee(M),closed:Ee(W),closeEmitted:Ee(Q),multiAwaitDrain:Ee(Y),readingMore:Ee(Re),dataEmitted:Ee(Ie)});function tt(b,E,K){typeof K!="boolean"&&(K=E instanceof ur()),this.state=et|L|Se|Lt,b&&b.objectMode&&(this.state|=J),K&&b&&b.readableObjectMode&&(this.state|=J),this.highWaterMark=b?Z(this,b,"readableHighWaterMark",K):le(!1),this.buffer=new H,this.length=0,this.pipes=[],this.flowing=null,this[fe]=null,b&&b.emitClose===!1&&(this.state&=~et),b&&b.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=b&&b.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,b&&b.encoding&&(this.decoder=new be(b.encoding),this.encoding=b.encoding)}function te(b){if(!(this instanceof te))return new te(b);const E=this instanceof ur();this._readableState=new tt(b,this,E),b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy),typeof b.construct=="function"&&(this._construct=b.construct),b.signal&&!E&&R(b.signal,this)),m.call(this,b),U.construct(this,()=>{this._readableState.needReadable&&k(this,this._readableState)})}te.prototype.destroy=U.destroy,te.prototype._undestroy=U.undestroy,te.prototype._destroy=function(b,E){E(b)},te.prototype[p.captureRejectionSymbol]=function(b){this.destroy(b)},te.prototype[d]=function(){let b;return this.destroyed||(b=this.readableEnded?null:new oe,this.destroy(b)),new a((E,K)=>A(this,q=>q&&q!==b?K(q):E(null)))},te.prototype.push=function(b,E){return Ye(this,b,E,!1)},te.prototype.unshift=function(b,E){return Ye(this,b,E,!0)};function Ye(b,E,K,q){N("readableAddChunk",E);const V=b._readableState;let Be;if(V.state&J||(typeof E=="string"?(K=K||V.defaultEncoding,V.encoding!==K&&(q&&V.encoding?E=T.from(E,K).toString(V.encoding):(E=T.from(E,K),K=""))):E instanceof T?K="":m._isUint8Array(E)?(E=m._uint8ArrayToBuffer(E),K=""):E!=null&&(Be=new S("chunk",["string","Buffer","Uint8Array"],E))),Be)xe(b,Be);else if(E===null)V.state&=~re,f(b,V);else if(V.state&J||E&&E.length>0)if(q)if(V.state&G)xe(b,new D);else{if(V.destroyed||V.errored)return!1;Or(b,V,E,!0)}else if(V.ended)xe(b,new j);else{if(V.destroyed||V.errored)return!1;V.state&=~re,V.decoder&&!K?(E=V.decoder.write(E),V.objectMode||E.length!==0?Or(b,V,E,!1):k(b,V)):Or(b,V,E,!1)}else q||(V.state&=~re,k(b,V));return!V.ended&&(V.length0?(E.state&Y?E.awaitDrainWriters.clear():E.awaitDrainWriters=null,E.dataEmitted=!0,b.emit("data",K)):(E.length+=E.objectMode?1:K.length,q?E.buffer.unshift(K):E.buffer.push(K),E.state&ge&&c(b)),k(b,E)}te.prototype.isPaused=function(){const b=this._readableState;return b[fe]===!0||b.flowing===!1},te.prototype.setEncoding=function(b){const E=new be(b);this._readableState.decoder=E,this._readableState.encoding=this._readableState.decoder.encoding;const K=this._readableState.buffer;let q="";for(const V of K)q+=E.write(V);return K.clear(),q!==""&&K.push(q),this._readableState.length=q.length,this};const Xe=1073741824;function Fe(b){if(b>Xe)throw new v("size","<= 1GiB",b);return b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++,b}function y(b,E){return b<=0||E.length===0&&E.ended?0:E.state&J?1:i(b)?E.flowing&&E.length?E.buffer.first().length:E.length:b<=E.length?b:E.ended?E.length:0}te.prototype.read=function(b){N("read",b),b===void 0?b=NaN:r(b)||(b=n(b,10));const E=this._readableState,K=b;if(b>E.highWaterMark&&(E.highWaterMark=Fe(b)),b!==0&&(E.state&=~Ne),b===0&&E.needReadable&&((E.highWaterMark!==0?E.length>=E.highWaterMark:E.length>0)||E.ended))return N("read: emitReadable",E.length,E.ended),E.length===0&&E.ended?ot(this):c(this),null;if(b=y(b,E),b===0&&E.ended)return E.length===0&&ot(this),null;let q=(E.state&ge)!==0;if(N("need readable",q),(E.length===0||E.length-b0?V=pi(b,E):V=null,V===null?(E.needReadable=E.length<=E.highWaterMark,b=0):(E.length-=b,E.multiAwaitDrain?E.awaitDrainWriters.clear():E.awaitDrainWriters=null),E.length===0&&(E.ended||(E.needReadable=!0),K!==b&&E.ended&&ot(this)),V!==null&&!E.errorEmitted&&!E.closeEmitted&&(E.dataEmitted=!0,this.emit("data",V)),V};function f(b,E){if(N("onEofChunk"),!E.ended){if(E.decoder){const K=E.decoder.end();K&&K.length&&(E.buffer.push(K),E.length+=E.objectMode?1:K.length)}E.ended=!0,E.sync?c(b):(E.needReadable=!1,E.emittedReadable=!0,x(b))}}function c(b){const E=b._readableState;N("emitReadable",E.needReadable,E.emittedReadable),E.needReadable=!1,E.emittedReadable||(N("emitReadable",E.flowing),E.emittedReadable=!0,e.nextTick(x,b))}function x(b){const E=b._readableState;N("emitReadable_",E.destroyed,E.length,E.ended),!E.destroyed&&!E.errored&&(E.length||E.ended)&&(b.emit("readable"),E.emittedReadable=!1),E.needReadable=!E.flowing&&!E.ended&&E.length<=E.highWaterMark,_e(b)}function k(b,E){!E.readingMore&&E.constructed&&(E.readingMore=!0,e.nextTick($,b,E))}function $(b,E){for(;!E.reading&&!E.ended&&(E.length1&&q.pipes.includes(b)&&(N("false write response, pause",q.awaitDrainWriters.size),q.awaitDrainWriters.add(b)),K.pause()),nr||(nr=I(K,b),b.on("drain",nr))}K.on("data",Pr);function Pr(Ut){N("ondata");const Mt=b.write(Ut);N("dest.write",Mt),Mt===!1&&xt()}function rn(Ut){if(N("onerror",Ut),Ht(),b.removeListener("error",rn),b.listenerCount("error")===0){const Mt=b._writableState||b._readableState;Mt&&!Mt.errorEmitted?xe(b,Ut):b.emit("error",Ut)}}C(b,"error",rn);function wi(){b.removeListener("finish",nn),Ht()}b.once("close",wi);function nn(){N("onfinish"),b.removeListener("close",wi),Ht()}b.once("finish",nn);function Ht(){N("unpipe"),K.unpipe(b)}return b.emit("pipe",K),b.writableNeedDrain===!0?xt():q.flowing||(N("pipe resume"),K.resume()),b};function I(b,E){return function(){const q=b._readableState;q.awaitDrainWriters===E?(N("pipeOnDrain",1),q.awaitDrainWriters=null):q.multiAwaitDrain&&(N("pipeOnDrain",q.awaitDrainWriters.size),q.awaitDrainWriters.delete(E)),(!q.awaitDrainWriters||q.awaitDrainWriters.size===0)&&b.listenerCount("data")&&b.resume()}}te.prototype.unpipe=function(b){const E=this._readableState,K={hasUnpiped:!1};if(E.pipes.length===0)return this;if(!b){const V=E.pipes;E.pipes=[],this.pause();for(let Be=0;Be0,q.flowing!==!1&&this.resume()):b==="readable"&&!q.endEmitted&&!q.readableListening&&(q.readableListening=q.needReadable=!0,q.flowing=!1,q.emittedReadable=!1,N("on readable",q.length,q.reading),q.length?c(this):q.reading||e.nextTick(Te,this)),K},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(b,E){const K=m.prototype.removeListener.call(this,b,E);return b==="readable"&&e.nextTick(pe,this),K},te.prototype.off=te.prototype.removeListener,te.prototype.removeAllListeners=function(b){const E=m.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&e.nextTick(pe,this),E};function pe(b){const E=b._readableState;E.readableListening=b.listenerCount("readable")>0,E.resumeScheduled&&E[fe]===!1?E.flowing=!0:b.listenerCount("data")>0?b.resume():E.readableListening||(E.flowing=null)}function Te(b){N("readable nexttick read 0"),b.read(0)}te.prototype.resume=function(){const b=this._readableState;return b.flowing||(N("resume"),b.flowing=!b.readableListening,ke(this,b)),b[fe]=!1,this};function ke(b,E){E.resumeScheduled||(E.resumeScheduled=!0,e.nextTick(me,b,E))}function me(b,E){N("resume",E.reading),E.reading||b.read(0),E.resumeScheduled=!1,b.emit("resume"),_e(b),E.flowing&&!E.reading&&b.read(0)}te.prototype.pause=function(){return N("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(N("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[fe]=!0,this};function _e(b){const E=b._readableState;for(N("flow",E.flowing);E.flowing&&b.read()!==null;);}te.prototype.wrap=function(b){let E=!1;b.on("data",q=>{!this.push(q)&&b.pause&&(E=!0,b.pause())}),b.on("end",()=>{this.push(null)}),b.on("error",q=>{xe(this,q)}),b.on("close",()=>{this.destroy()}),b.on("destroy",()=>{this.destroy()}),this._read=()=>{E&&b.resume&&(E=!1,b.resume())};const K=l(b);for(let q=1;q{V=lt?ce(V,lt):null,K(),K=we});try{for(;;){const lt=b.destroyed?null:b.read();if(lt!==null)yield lt;else{if(V)throw V;if(V===null)return;await new a(q)}}}catch(lt){throw V=ce(V,lt),V}finally{(V||(E==null?void 0:E.destroyOnReturn)!==!1)&&(V===void 0||b._readableState.autoDestroy)?U.destroyer(b,null):(b.off("readable",q),Be())}}o(te.prototype,{readable:{__proto__:null,get(){const b=this._readableState;return!!b&&b.readable!==!1&&!b.destroyed&&!b.errorEmitted&&!b.endEmitted},set(b){this._readableState&&(this._readableState.readable=!!b)}},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(b){this._readableState&&(this._readableState.flowing=b)}},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(b){this._readableState&&(this._readableState.destroyed=b)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(tt.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[fe]!==!1},set(b){this[fe]=!!b}}}),te._fromList=pi;function pi(b,E){if(E.length===0)return null;let K;return E.objectMode?K=E.buffer.shift():!b||b>=E.length?(E.decoder?K=E.buffer.join(""):E.buffer.length===1?K=E.buffer.first():K=E.buffer.concat(E.length),E.buffer.clear()):K=E.buffer.consume(b,E.decoder),K}function ot(b){const E=b._readableState;N("endReadable",E.endEmitted),E.endEmitted||(E.ended=!0,e.nextTick(no,E,b))}function no(b,E){if(N("endReadableNT",b.endEmitted,b.length),!b.errored&&!b.closeEmitted&&!b.endEmitted&&b.length===0){if(b.endEmitted=!0,E.emit("end"),E.writable&&E.allowHalfOpen===!1)e.nextTick(Rl,E);else if(b.autoDestroy){const K=E._writableState;(!K||K.autoDestroy&&(K.finished||K.writable===!1))&&E.destroy()}}}function Rl(b){b.writable&&!b.writableEnded&&!b.destroyed&&b.end()}te.from=function(b,E){return Le(te,b,E)};let vt;function oo(){return vt===void 0&&(vt={}),vt}return te.fromWeb=function(b,E){return oo().newStreamReadableFromReadableStream(b,E)},te.toWeb=function(b,E){return oo().newReadableStreamFromStreamReadable(b,E)},te.wrap=function(b,E){var K,q;return new te({objectMode:(K=(q=b.readableObjectMode)!==null&&q!==void 0?q:b.objectMode)!==null&&K!==void 0?K:!0,...E,destroy(V,Be){U.destroyer(b,V),Be(V)}}).wrap(b)},jl}var zl,Yu;function da(){if(Yu)return zl;Yu=1;const e=ni,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:i,ObjectDefineProperty:n,ObjectDefineProperties:o,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:s,Symbol:a,SymbolHasInstance:u}=We;zl=se,se.WritableState=D;const{EventEmitter:d}=Jo,h=fa.Stream,{Buffer:g}=gr,p=Ki,{addAbortSignal:m}=ol,{getHighWaterMark:C,getDefaultHighWaterMark:T}=ll,{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_MULTIPLE_CALLBACK:N,ERR_STREAM_CANNOT_PIPE:H,ERR_STREAM_DESTROYED:U,ERR_STREAM_ALREADY_FINISHED:Z,ERR_STREAM_NULL_VALUES:le,ERR_STREAM_WRITE_AFTER_END:ce,ERR_UNKNOWN_ENCODING:S}=pt.codes,{errorOrDestroy:O}=p;l(se.prototype,h.prototype),l(se,h);function v(){}const j=a("kOnFinished");function D(L,M,W){typeof W!="boolean"&&(W=M instanceof ur()),this.objectMode=!!(L&&L.objectMode),W&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?C(this,L,"writableHighWaterMark",W):T(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const Q=!!(L&&L.decodeStrings===!1);this.decodeStrings=!Q,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=xe.bind(void 0,M),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,oe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[j]=[]}function oe(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}D.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},n(D.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(L){const M=this instanceof ur();if(!M&&!i(se,this))return new se(L);this._writableState=new D(L,this,M),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&m(L.signal,this)),h.call(this,L),p.construct(this,()=>{const W=this._writableState;W.writing||re(this,W),Ne(this,W)})}n(se,u,{__proto__:null,value:function(L){return i(this,L)?!0:this!==se?!1:L&&L._writableState instanceof D}}),se.prototype.pipe=function(){O(this,new H)};function fe(L,M,W,Q){const Y=L._writableState;if(typeof W=="function")Q=W,W=Y.defaultEncoding;else{if(!W)W=Y.defaultEncoding;else if(W!=="buffer"&&!g.isEncoding(W))throw new S(W);typeof Q!="function"&&(Q=v)}if(M===null)throw new le;if(!Y.objectMode)if(typeof M=="string")Y.decodeStrings!==!1&&(M=g.from(M,W),W="buffer");else if(M instanceof g)W="buffer";else if(h._isUint8Array(M))M=h._uint8ArrayToBuffer(M),W="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],M);let Re;return Y.ending?Re=new ce:Y.destroyed&&(Re=new U("write")),Re?(e.nextTick(Q,Re),O(L,Re,!0),Re):(Y.pendingcb++,be(L,Y,M,W,Q))}se.prototype.write=function(L,M,W){return fe(this,L,M,W)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const L=this._writableState;L.corked&&(L.corked--,L.writing||re(this,L))},se.prototype.setDefaultEncoding=function(M){if(typeof M=="string"&&(M=s(M)),!g.isEncoding(M))throw new S(M);return this._writableState.defaultEncoding=M,this};function be(L,M,W,Q,Y){const Re=M.objectMode?1:W.length;M.length+=Re;const Ie=M.lengthW.bufferedIndex&&re(L,W),Q?W.afterWriteTickInfo!==null&&W.afterWriteTickInfo.cb===Y?W.afterWriteTickInfo.count++:(W.afterWriteTickInfo={count:1,cb:Y,stream:L,state:W},e.nextTick(J,W.afterWriteTickInfo)):X(L,W,1,Y))}function J({stream:L,state:M,count:W,cb:Q}){return M.afterWriteTickInfo=null,X(L,M,W,Q)}function X(L,M,W,Q){for(!M.ending&&!L.destroyed&&M.length===0&&M.needDrain&&(M.needDrain=!1,L.emit("drain"));W-- >0;)M.pendingcb--,Q();M.destroyed&&G(M),Ne(L,M)}function G(L){if(L.writing)return;for(let Y=L.bufferedIndex;Y1&&L._writev){M.pendingcb-=Re-1;const Ee=M.allNoop?v:te=>{for(let Ye=Ie;Ye256?(W.splice(0,Ie),M.bufferedIndex=0):M.bufferedIndex=Ie}M.bufferProcessing=!1}se.prototype._write=function(L,M,W){if(this._writev)this._writev([{chunk:L,encoding:M}],W);else throw new A("_write()")},se.prototype._writev=null,se.prototype.end=function(L,M,W){const Q=this._writableState;typeof L=="function"?(W=L,L=null,M=null):typeof M=="function"&&(W=M,M=null);let Y;if(L!=null){const Re=fe(this,L,M);Re instanceof r&&(Y=Re)}return Q.corked&&(Q.corked=1,this.uncork()),Y||(!Q.errored&&!Q.ending?(Q.ending=!0,Ne(this,Q,!0),Q.ended=!0):Q.finished?Y=new Z("end"):Q.destroyed&&(Y=new U("end"))),typeof W=="function"&&(Y||Q.finished?e.nextTick(W,Y):Q[j].push(W)),this};function Se(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function Lt(L,M){let W=!1;function Q(Y){if(W){O(L,Y??N());return}if(W=!0,M.pendingcb--,Y){const Re=M[j].splice(0);for(let Ie=0;Ie{Se(Y)?gt(Q,Y):Y.pendingcb--},L,M)):Se(M)&&(M.pendingcb++,gt(L,M))))}function gt(L,M){M.pendingcb--,M.finished=!0;const W=M[j].splice(0);for(let Q=0;Q{if(G!=null)throw new m("nully","body",G)},G=>{C(J,G)});return J=new S({objectMode:!0,readable:!1,write:be,final(G){Le(async()=>{try{await X,e.nextTick(G,null)}catch(re){e.nextTick(G,re)}})},destroy:we})}throw new m("Iterable, AsyncIterable or AsyncFunction",oe,fe)}if(Z(D))return j(D.arrayBuffer());if(n(D))return H(S,D,{objectMode:!0,writable:!1});if(u(D==null?void 0:D.readable)&&d(D==null?void 0:D.writable))return S.fromWeb(D);if(typeof(D==null?void 0:D.writable)=="object"||typeof(D==null?void 0:D.readable)=="object"){const fe=D!=null&&D.readable?l(D==null?void 0:D.readable)?D==null?void 0:D.readable:j(D.readable):void 0,be=D!=null&&D.writable?s(D==null?void 0:D.writable)?D==null?void 0:D.writable:j(D.writable):void 0;return v({readable:fe,writable:be})}const se=D==null?void 0:D.then;if(typeof se=="function"){let fe;return ce(se,D,be=>{be!=null&&fe.push(be),fe.push(null)},be=>{C(fe,be)}),fe=new S({objectMode:!0,writable:!1,read(){}})}throw new p(oe,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],D)};function O(j){let{promise:D,resolve:oe}=N();const se=new le,fe=se.signal;return{value:j(async function*(){for(;;){const Le=D;D=null;const{chunk:we,done:xe,cb:J}=await Le;if(e.nextTick(J),xe)return;if(fe.aborted)throw new g(void 0,{cause:fe.reason});({promise:D,resolve:oe}=N()),yield we}}(),{signal:fe}),write(Le,we,xe){const J=oe;oe=null,J({chunk:Le,done:!1,cb:xe})},final(Le){const we=oe;oe=null,we({done:!0,cb:Le})},destroy(Le,we){se.abort(),we(Le)}}}function v(j){const D=j.readable&&typeof j.readable.read!="function"?R.wrap(j.readable):j.readable,oe=j.writable;let se=!!r(D),fe=!!i(oe),be,Le,we,xe,J;function X(G){const re=xe;xe=null,re?re(G):G&&J.destroy(G)}return J=new S({readableObjectMode:!!(D!=null&&D.readableObjectMode),writableObjectMode:!!(oe!=null&&oe.writableObjectMode),readable:se,writable:fe}),fe&&(h(oe,G=>{fe=!1,G&&C(D,G),X(G)}),J._write=function(G,re,Se){oe.write(G,re)?Se():be=Se},J._final=function(G){oe.end(),Le=G},oe.on("drain",function(){if(be){const G=be;be=null,G()}}),oe.on("finish",function(){if(Le){const G=Le;Le=null,G()}})),se&&(h(D,G=>{se=!1,G&&C(D,G),X(G)}),D.on("readable",function(){if(we){const G=we;we=null,G()}}),D.on("end",function(){J.push(null)}),J._read=function(){for(;;){const G=D.read();if(G===null){we=J._read;return}if(!J.push(G))return}}),J._destroy=function(G,re){!G&&xe!==null&&(G=new g),we=null,be=null,Le=null,xe===null?re(G):(xe=re,C(oe,G),C(D,G))},J}return Gl}var ql,Zu;function ur(){if(Zu)return ql;Zu=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:i}=We;ql=l;const n=sl(),o=da();i(l.prototype,n.prototype),i(l,n);{const d=r(o.prototype);for(let h=0;h{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function Fw(){this._final!==Cs&&Cs.call(this)}fr.prototype._final=Cs;fr.prototype._transform=function(e,t,r){throw new Pw("_transform()")};fr.prototype._write=function(e,t,r){const i=this._readableState,n=this._writableState,o=i.length;this._transform(e,t,(l,s)=>{if(l){r(l);return}s!=null&&this.push(s),n.ended||o===i.length||i.length{i=!0});const n=$o(e,{readable:t,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,Gw.destroyer(e,o||new Xw("pipe")))},cleanup:n}}function ry(e){return Jw(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Ql(e){if(Hr(e))return e;if(_o(e))return iy(e);throw new Ts("val",["Readable","Iterable","AsyncIterable"],e)}async function*iy(e){Jl||(Jl=sl()),yield*Jl.prototype[Uw].call(e)}async function so(e,t,r,{end:i}){let n,o=null;const l=u=>{if(u&&(n=u),o){const d=o;o=null,d()}},s=()=>new Hw((u,d)=>{n?d(n):o=()=>{n?d(n):u()}});t.on("drain",l);const a=$o(t,{readable:!1},l);try{t.writableNeedDrain&&await s();for await(const u of e)t.write(u)||await s();i&&(t.end(),await s()),r()}catch(u){r(n!==u?qw(n,u):u)}finally{a(),t.off("drain",l)}}async function es(e,t,r,{end:i}){vi(t)&&(t=t.writable);const n=t.getWriter();try{for await(const o of e)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(l){r(l)}}}function ny(...e){return yd(e,zw(ry(e)))}function yd(e,t,r){if(e.length===1&&Ww(e[0])&&(e=e[0]),e.length<2)throw new Kw("streams");const i=new ty,n=i.signal,o=r==null?void 0:r.signal,l=[];Zw(o,"options.signal");function s(){m(new Yw)}Zl=Zl||ft.addAbortListener;let a;o&&(a=Zl(o,s));let u,d;const h=[];let g=0;function p(A){m(A,--g===0)}function m(A,N){var H;if(A&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=A),!(!u&&!N)){for(;h.length;)h.shift()(u);(H=a)===null||H===void 0||H[jw](),i.abort(),N&&(u||l.forEach(U=>U()),fn.nextTick(t,u,d))}}let C;for(let A=0;A0,Z=H||(r==null?void 0:r.end)!==!1,le=A===e.length-1;if(ef(N)){let ce=function(S){S&&S.name!=="AbortError"&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(S)};if(Z){const{destroy:S,cleanup:O}=tf(N,H,U);h.push(S),Xl(N)&&le&&l.push(O)}N.on("error",ce),Xl(N)&&le&&l.push(()=>{N.removeListener("error",ce)})}if(A===0)if(typeof N=="function"){if(C=N({signal:n}),!Hr(C))throw new Kl("Iterable, AsyncIterable or Stream","source",C)}else Hr(N)||_o(N)||vi(N)?C=N:C=Qu.from(N);else if(typeof N=="function"){if(vi(C)){var T;C=Ql((T=C)===null||T===void 0?void 0:T.readable)}else C=Ql(C);if(C=N(C,{signal:n}),H){if(!Hr(C,!0))throw new Kl("AsyncIterable",`transform[${A-1}]`,C)}else{var R;Yl||(Yl=wd);const ce=new Yl({objectMode:!0}),S=(R=C)===null||R===void 0?void 0:R.then;if(typeof S=="function")g++,S.call(C,j=>{d=j,j!=null&&ce.write(j),Z&&ce.end(),fn.nextTick(p)},j=>{ce.destroy(j),fn.nextTick(p,j)});else if(Hr(C,!0))g++,so(C,ce,p,{end:Z});else if(Vl(C)||vi(C)){const j=C.readable||C;g++,so(j,ce,p,{end:Z})}else throw new Kl("AsyncIterable or Promise","destination",C);C=ce;const{destroy:O,cleanup:v}=tf(C,!1,!0);h.push(O),le&&l.push(v)}}else if(ef(N)){if(_o(C)){g+=2;const ce=oy(C,N,p,{end:Z});Xl(N)&&le&&l.push(ce)}else if(vi(C)||Vl(C)){const ce=C.readable||C;g++,so(ce,N,p,{end:Z})}else if(Hr(C))g++,so(C,N,p,{end:Z});else throw new Ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=N}else if(Qw(N)){if(_o(C))g++,es(Ql(C),N,p,{end:Z});else if(Vl(C)||Hr(C))g++,es(C,N,p,{end:Z});else if(vi(C))g++,es(C.readable,N,p,{end:Z});else throw new Ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=N}else C=Qu.from(N)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&fn.nextTick(s),C}function oy(e,t,r,{end:i}){let n=!1;if(t.on("close",()=>{n||r(new Vw)}),e.pipe(t,{end:!1}),i){let o=function(){n=!0,t.end()};ey(e)?fn.nextTick(o):e.once("end",o)}else r();return $o(e,{readable:!0,writable:!1},o=>{const l=e._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?e.once("end",r).once("error",r):r(o)}),$o(t,{readable:!1,writable:!0},r)}var ga={pipelineImpl:yd,pipeline:ny};const{pipeline:ly}=ga,ao=ur(),{destroyer:sy}=Ki,{isNodeStream:uo,isReadable:rf,isWritable:nf,isWebStream:ts,isTransformStream:Fr,isWritableStream:of,isReadableStream:lf}=yr,{AbortError:ay,codes:{ERR_INVALID_ARG_VALUE:sf,ERR_MISSING_ARGS:uy}}=pt,fy=Mr;var bd=function(...t){if(t.length===0)throw new uy("streams");if(t.length===1)return ao.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=ao.from(t[0])),typeof t[t.length-1]=="function"){const p=t.length-1;t[p]=ao.from(t[p])}for(let p=0;p0&&!(nf(t[p])||of(t[p])||Fr(t[p])))throw new sf(`streams[${p}]`,r[p],"must be writable")}let i,n,o,l,s;function a(p){const m=l;l=null,m?m(p):p?s.destroy(p):!g&&!h&&s.destroy()}const u=t[0],d=ly(t,a),h=!!(nf(u)||of(u)||Fr(u)),g=!!(rf(d)||lf(d)||Fr(d));if(s=new ao({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:g}),h){if(uo(u))s._write=function(m,C,T){u.write(m,C)?T():i=T},s._final=function(m){u.end(),n=m},u.on("drain",function(){if(i){const m=i;i=null,m()}});else if(ts(u)){const C=(Fr(u)?u.writable:u).getWriter();s._write=async function(T,R,A){try{await C.ready,C.write(T).catch(()=>{}),A()}catch(N){A(N)}},s._final=async function(T){try{await C.ready,C.close().catch(()=>{}),n=T}catch(R){T(R)}}}const p=Fr(d)?d.readable:d;fy(p,()=>{if(n){const m=n;n=null,m()}})}if(g){if(uo(d))d.on("readable",function(){if(o){const p=o;o=null,p()}}),d.on("end",function(){s.push(null)}),s._read=function(){for(;;){const p=d.read();if(p===null){o=s._read;return}if(!s.push(p))return}};else if(ts(d)){const m=(Fr(d)?d.readable:d).getReader();s._read=async function(){for(;;)try{const{value:C,done:T}=await m.read();if(!s.push(C))return;if(T){s.push(null);return}}catch{return}}}}return s._destroy=function(p,m){!p&&l!==null&&(p=new ay),o=null,i=null,n=null,l===null?m(p):(l=m,uo(d)&&sy(d,p))},s};const cy=globalThis.AbortController||Rn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:dy,ERR_INVALID_ARG_TYPE:Yn,ERR_MISSING_ARGS:hy,ERR_OUT_OF_RANGE:py},AbortError:Yt}=pt,{validateAbortSignal:li,validateInteger:af,validateObject:si}=Xn,gy=We.Symbol("kWeak"),wy=We.Symbol("kResistStopPropagation"),{finished:yy}=Mr,by=bd,{addAbortSignalNoValidate:my}=ol,{isWritable:vy,isNodeStream:xy}=yr,{deprecate:Sy}=ft,{ArrayPrototypePush:_y,Boolean:Ey,MathFloor:uf,Number:Cy,NumberIsNaN:Ty,Promise:ff,PromiseReject:cf,PromiseResolve:ky,PromisePrototypeThen:df,Symbol:md}=We,Io=md("kEmpty"),hf=md("kEof");function Ay(e,t){if(t!=null&&si(t,"options"),(t==null?void 0:t.signal)!=null&&li(t.signal,"options.signal"),xy(e)&&!vy(e))throw new dy("stream",e,"must be writable");const r=by(this,e);return t!=null&&t.signal&&my(t.signal,r),r}function al(e,t){if(typeof e!="function")throw new Yn("fn",["Function","AsyncFunction"],e);t!=null&&si(t,"options"),(t==null?void 0:t.signal)!=null&&li(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=uf(t.concurrency));let i=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(i=uf(t.highWaterMark)),af(r,"options.concurrency",1),af(i,"options.highWaterMark",0),i+=r,(async function*(){const o=ft.AbortSignalAny([t==null?void 0:t.signal].filter(Ey)),l=this,s=[],a={signal:o};let u,d,h=!1,g=0;function p(){h=!0,m()}function m(){g-=1,C()}function C(){d&&!h&&g=i||g>=r)&&await new ff(A=>{d=A})}s.push(hf)}catch(R){const A=cf(R);df(A,m,p),s.push(A)}finally{h=!0,u&&(u(),u=null)}}T();try{for(;;){for(;s.length>0;){const R=await s[0];if(R===hf)return;if(o.aborted)throw new Yt;R!==Io&&(yield R),s.shift(),C()}await new ff(R=>{u=R})}}finally{h=!0,d&&(d(),d=null)}}).call(this)}function Ly(e=void 0){return e!=null&&si(e,"options"),(e==null?void 0:e.signal)!=null&&li(e.signal,"options.signal"),(async function*(){let r=0;for await(const n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Yt({cause:e.signal.reason});yield[r++,n]}}).call(this)}async function vd(e,t=void 0){for await(const r of wa.call(this,e,t))return!0;return!1}async function Ry(e,t=void 0){if(typeof e!="function")throw new Yn("fn",["Function","AsyncFunction"],e);return!await vd.call(this,async(...r)=>!await e(...r),t)}async function My(e,t){for await(const r of wa.call(this,e,t))return r}async function Ny(e,t){if(typeof e!="function")throw new Yn("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n),Io}for await(const i of al.call(this,r,t));}function wa(e,t){if(typeof e!="function")throw new Yn("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n)?i:Io}return al.call(this,r,t)}class $y extends hy{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Iy(e,t,r){var i;if(typeof e!="function")throw new Yn("reducer",["Function","AsyncFunction"],e);r!=null&&si(r,"options"),(r==null?void 0:r.signal)!=null&&li(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){const u=new Yt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await yy(this.destroy(u)),u}const o=new cy,l=o.signal;if(r!=null&&r.signal){const u={once:!0,[gy]:this,[wy]:!0};r.signal.addEventListener("abort",()=>o.abort(),u)}let s=!1;try{for await(const u of this){var a;if(s=!0,r!=null&&(a=r.signal)!==null&&a!==void 0&&a.aborted)throw new Yt;n?t=await e(t,u,{signal:l}):(t=u,n=!0)}if(!s&&!n)throw new $y}finally{o.abort()}return t}async function Oy(e){e!=null&&si(e,"options"),(e==null?void 0:e.signal)!=null&&li(e.signal,"options.signal");const t=[];for await(const i of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Yt(void 0,{cause:e.signal.reason});_y(t,i)}return t}function Dy(e,t){const r=al.call(this,e,t);return(async function*(){for await(const n of r)yield*n}).call(this)}function xd(e){if(e=Cy(e),Ty(e))return 0;if(e<0)throw new py("number",">= 0",e);return e}function Py(e,t=void 0){return t!=null&&si(t,"options"),(t==null?void 0:t.signal)!=null&&li(t.signal,"options.signal"),e=xd(e),(async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Yt;for await(const o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Yt;e--<=0&&(yield o)}}).call(this)}function By(e,t=void 0){return t!=null&&si(t,"options"),(t==null?void 0:t.signal)!=null&&li(t.signal,"options.signal"),e=xd(e),(async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Yt;for await(const o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Yt;if(e-- >0&&(yield o),e<=0)return}}).call(this)}oa.streamReturningOperators={asIndexedPairs:Sy(Ly,"readable.asIndexedPairs will be removed in a future version."),drop:Py,filter:wa,flatMap:Dy,map:al,take:By,compose:Ay};oa.promiseReturningOperators={every:Ry,forEach:Ny,reduce:Iy,toArray:Oy,some:vd,find:My};var rs,pf;function Sd(){if(pf)return rs;pf=1;const{ArrayPrototypePop:e,Promise:t}=We,{isIterable:r,isNodeStream:i,isWebStream:n}=yr,{pipelineImpl:o}=ga,{finished:l}=Mr;_d();function s(...a){return new t((u,d)=>{let h,g;const p=a[a.length-1];if(p&&typeof p=="object"&&!i(p)&&!r(p)&&!n(p)){const m=e(a);h=m.signal,g=m.end}o(a,(m,C)=>{m?d(m):u(C)},{signal:h,end:g})})}return rs={finished:l,pipeline:s},rs}var gf;function _d(){if(gf)return Pl.exports;gf=1;const{Buffer:e}=gr,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:i}=We,{promisify:{custom:n}}=ft,{streamReturningOperators:o,promiseReturningOperators:l}=oa,{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=pt,a=bd,{setDefaultHighWaterMark:u,getDefaultHighWaterMark:d}=ll,{pipeline:h}=ga,{destroyer:g}=Ki,p=Mr,m=Sd(),C=yr,T=Pl.exports=fa.Stream;T.isDestroyed=C.isDestroyed,T.isDisturbed=C.isDisturbed,T.isErrored=C.isErrored,T.isReadable=C.isReadable,T.isWritable=C.isWritable,T.Readable=sl();for(const A of r(o)){let H=function(...U){if(new.target)throw s();return T.Readable.from(i(N,this,U))};const N=o[A];t(H,"name",{__proto__:null,value:N.name}),t(H,"length",{__proto__:null,value:N.length}),t(T.Readable.prototype,A,{__proto__:null,value:H,enumerable:!1,configurable:!0,writable:!0})}for(const A of r(l)){let H=function(...U){if(new.target)throw s();return i(N,this,U)};const N=l[A];t(H,"name",{__proto__:null,value:N.name}),t(H,"length",{__proto__:null,value:N.length}),t(T.Readable.prototype,A,{__proto__:null,value:H,enumerable:!1,configurable:!0,writable:!0})}T.Writable=da(),T.Duplex=ur(),T.Transform=pd,T.PassThrough=wd,T.pipeline=h;const{addAbortSignal:R}=ol;return T.addAbortSignal=R,T.finished=p,T.destroy=g,T.compose=a,T.setDefaultHighWaterMark=u,T.getDefaultHighWaterMark=d,t(T,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),t(h,n,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),t(p,n,{__proto__:null,enumerable:!0,get(){return m.finished}}),T.Stream=T,T._isUint8Array=function(N){return N instanceof Uint8Array},T._uint8ArrayToBuffer=function(N){return e.from(N.buffer,N.byteOffset,N.byteLength)},Pl.exports}(function(e){const t=_d(),r=Sd(),i=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=i,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(mc);var Ed=mc.exports;const Fy=ra(Ed);class Wy{constructor(t,...r){this.load=bc(async()=>{const i=await t();return new i(...r)})}import(t,r){const i=new Ed.PassThrough({objectMode:!0});return Promise.resolve().then(async()=>{const o=(await this.load()).import(t,r);o.on("prefix",(l,s)=>{i.emit("prefix",l,s)}),o.on("error",l=>{i.emit("error",l),i.emit("end")}),o.pipe(i)}),i}}function Bt(e){return class extends Wy{constructor(...t){super(e,...t)}}}const Hy=new Ro,Uy=new Ro,mt={parsers:Hy,serializers:Uy},jy=Bt(async()=>(await ht(()=>import("./index-BU-jGoQy.js"),__vite__mapDeps([0,1,2,3,4]))).default),Jn=Bt(async()=>(await ht(()=>import("./index-Bk1OmMYS.js"),__vite__mapDeps([5,1,2]))).default),zy=Bt(async()=>(await ht(()=>import("./CustomRdfXmlParser-lwfOQbte.js"),__vite__mapDeps([6,3]))).default),ul=Bt(async()=>(await ht(()=>import("./index-DRb_7OTM.js"),__vite__mapDeps([7,1,2]))).default),Gy=Bt(async()=>(await ht(()=>import("./CustomJsonLdSerializer-eGWsaUBU.js"),__vite__mapDeps([8,1]))).default);mt.parsers.set("application/ld+json",new jy);mt.parsers.set("application/trig",new Jn);mt.parsers.set("application/n-quads",new Jn);mt.parsers.set("application/n-triples",new Jn);mt.parsers.set("text/n3",new Jn);mt.parsers.set("text/turtle",new Jn);mt.parsers.set("application/rdf+xml",new zy);mt.serializers.set("application/ld+json",new Gy);mt.serializers.set("application/n-quads",new ul);mt.serializers.set("application/n-triples",new ul);mt.serializers.set("text/n3",new ul);mt.serializers.set("text/turtle",new ul);class qy{init(){this.ns=Vs}}const Ky=new ta,Xy={apply:(e,t,r)=>e(r[0]),get:(e,t)=>e(t)};function B(e,{factory:t=Ky}={}){const r=(i="")=>t.namedNode(`${e}${i.raw||i}`);return typeof Proxy>"u"?r:new Proxy(r,Xy)}const Vy=B("http://www.w3.org/ns/auth/acl#"),Yy=Vy,Jy=B("https://www.w3.org/ns/activitystreams#"),Zy=Jy,Qy=B("http://purl.org/ontology/bibo/"),eb=Qy,tb=B("http://creativecommons.org/ns#"),rb=tb,ib=B("http://www.w3.org/ns/auth/cert#"),nb=ib,ob=B("http://www.w3.org/2011/content#"),lb=ob,sb=B("http://qudt.org/vocab/constant/"),ab=sb,ub=B("http://www.cidoc-crm.org/cidoc-crm/"),fb=ub,cb=B("http://www.w3.org/ns/csvw#"),db=cb,hb=B("http://commontag.org/ns#"),pb=hb,gb=B("http://datashapes.org/sparql#"),wb=gb,yb=B("http://datashapes.org/dash#"),bb=yb,mb=B("http://dbpedia.org/ontology/"),vb=mb,xb=B("http://purl.org/dc/elements/1.1/"),Sb=xb,_b=B("http://purl.org/dc/dcam/"),Eb=_b,Cb=B("http://www.w3.org/ns/dcat#"),Tb=Cb,kb=B("http://purl.org/dc/dcmitype/"),Ab=kb,Lb=B("http://purl.org/dc/terms/"),Rb=Lb,Mb=B("http://www.ics.forth.gr/isl/CRMdig/"),Nb=Mb,$b=B("http://qudt.org/vocab/discipline/"),Ib=$b,Ob=B("http://usefulinc.com/ns/doap#"),Db=Ob,Pb=B("http://www.w3.org/ns/dpv#"),Bb=Pb,Fb=B("http://www.w3.org/ns/dqv#"),Wb=Fb,Hb=B("http://www.linkedmodel.org/schema/dtype#"),Ub=Hb,jb=B("http://www.w3.org/ns/duv#"),zb=jb,Gb=B("http://www.w3.org/ns/earl#"),qb=Gb,Kb=B("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#"),Xb=Kb,Vb=B("http://www.w3.org/2003/12/exif/ns#"),Yb=Vb,Jb=B("http://xmlns.com/foaf/0.1/"),Zb=Jb,Qb=B("http://purl.org/vocab/frbr/core#"),em=Qb,tm=B("http://www.opengis.net/ont/geosparql#"),rm=tm,im=B("http://www.opengis.net/def/function/geosparql/"),nm=im,om=B("http://www.opengis.net/def/rule/geosparql/"),lm=om,sm=B("http://www.opengis.net/ont/gml#"),am=sm,um=B("http://www.geonames.org/ontology#"),fm=um,cm=B("http://purl.org/goodrelations/v1#"),dm=cm,hm=B("http://www.w3.org/2003/g/data-view#"),pm=hm,gm=B("https://gs1.org/voc/"),wm=gm,ym=B("http://vocab.gtfs.org/terms#"),bm=ym,mm=B("http://www.w3.org/2011/http#"),vm=mm,xm=B("http://www.w3.org/ns/hydra/core#"),Sm=xm,_m=B("http://www.w3.org/2002/12/cal/icaltzd#"),Em=_m,Cm=B("https://linked.art/ns/terms/"),Tm=Cm,km=B("http://www.w3.org/ns/ldp#"),Am=km,Lm=B("http://www.w3.org/2000/10/swap/list#"),Rm=Lm,Mm=B("http://www.w3.org/ns/locn#"),Nm=Mm,$m=B("http://www.w3.org/2000/10/swap/log#"),Im=$m,Om=B("http://lexvo.org/ontology#"),Dm=Om,Pm=B("http://w3id.org/nfdi4ing/metadata4ing#"),Bm=Pm,Fm=B("http://www.w3.org/ns/ma-ont#"),Wm=Fm,Hm=B("http://www.loc.gov/mads/rdf/v1#"),Um=Hm,jm=B("http://www.w3.org/2000/10/swap/math#"),zm=jm,Gm=B("http://www.w3.org/ns/oa#"),qm=Gm,Km=B("http://ogp.me/ns#"),Xm=Km,Vm=B("http://www.w3.org/ns/solid/oidc#"),Ym=Vm,Jm=B("http://www.w3.org/ns/org#"),Zm=Jm,Qm=B("http://www.w3.org/2002/07/owl#"),ev=Qm,tv=B("http://www.w3.org/ns/pim/space#"),rv=tv,iv=B("http://qudt.org/vocab/prefix/"),nv=iv,ov=B("http://www.w3.org/ns/prov#"),lv=ov,sv=B("http://purl.org/linked-data/cube#"),av=sv,uv=B("http://qudt.org/vocab/dimensionvector/"),fv=uv,cv=B("http://qudt.org/vocab/quantitykind/"),dv=cv,hv=B("http://qudt.org/schema/qudt/"),pv=hv,gv=B("http://rdaregistry.info/Elements/u/"),wv=gv,yv=B("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),$t=yv,bv=B("http://www.w3.org/ns/rdfa#"),mv=bv,vv=B("http://www.w3.org/2000/01/rdf-schema#"),xv=vv,Sv=B("http://purl.org/stuff/rev#"),_v=Sv,Ev=B("https://www.ica.org/standards/RiC/ontology#"),Cv=Ev,Tv=B("http://www.w3.org/ns/r2rml#"),kv=Tv,Av=B("http://purl.org/rss/1.0/"),Lv=Av,Rv=B("http://schema.org/"),Mv=Rv,Nv=B("http://www.w3.org/ns/sparql-service-description#"),$v=Nv,Iv=B("http://purl.org/linked-data/sdmx#"),Ov=Iv,Dv=B("http://semanticweb.cs.vu.nl/2009/11/sem/"),Pv=Dv,Bv=B("http://www.w3.org/2000/10/swap/set#"),Fv=Bv,Wv=B("http://www.opengis.net/ont/sf#"),Hv=Wv,Uv=B("http://www.w3.org/ns/shacl#"),jv=Uv,zv=B("http://www.w3.org/ns/shex#"),Gv=zv,qv=B("https://www.w3.org/ns/shacl-shacl#"),Kv=qv,Xv=B("http://rdfs.org/sioc/ns#"),Vv=Xv,Yv=B("http://www.w3.org/2004/02/skos/core#"),Jv=Yv,Zv=B("http://www.w3.org/2008/05/skos-xl#"),Qv=Zv,ex=B("http://www.w3.org/ns/solid/terms#"),tx=ex,rx=B("http://www.w3.org/ns/sosa/"),ix=rx,nx=B("http://qudt.org/vocab/sou/"),ox=nx,lx=B("http://www.w3.org/ns/ssn/"),sx=lx,ax=B("http://www.w3.org/ns/posix/stat#"),ux=ax,fx=B("http://www.w3.org/2000/10/swap/string#"),cx=fx,dx=B("http://www.w3.org/2006/03/test-description#"),hx=dx,px=B("http://www.w3.org/2006/time#"),gx=px,wx=B("http://qudt.org/vocab/unit/"),yx=wx,bx=B("http://www.linkedmodel.org/schema/vaem#"),mx=bx,vx=B("http://purl.org/vocab/vann/"),xx=vx,Sx=B("http://www.w3.org/2006/vcard/ns#"),_x=Sx,Ex=B("http://rdfs.org/ns/void#"),Cx=Ex,Tx=B("http://www.w3.org/2003/06/sw-vocab-status/ns#"),kx=Tx,Ax=B("http://www.w3.org/2007/05/powder-s#"),Lx=Ax,Rx=B("http://www.w3.org/2003/01/geo/wgs84_pos#"),Mx=Rx,Nx=B("http://www.w3.org/1999/xhtml/vocab#"),$x=Nx,Ix=B("http://rdf-vocabulary.ddialliance.org/xkos#"),Ox=Ix,Dx=B("http://www.w3.org/2001/XMLSchema#"),yn=Dx,Px=B("http://www.w3.org/2007/rif#"),Bx=Px,Fx=B("http://rdf.data-vocabulary.org/#"),Wx=Fx,Hx=B("http://www.w3.org/2007/05/powder#"),Ux=Hx,jx=B("http://www.w3.org/XML/1998/namespace/"),zx=jx;function Gx(e){return"_:"+e.value}var qx=Gx;function Kx(e,t){return[...e].map(r=>t(r)).join(` +`)+` +`}var Xx=Kx;function Vx(){return""}var Yx=Vx;function Jx(e){return"<"+e.value+">"}var Cd=Jx;const Zx=Cd,Qx=/["\\\\\n\r]/,e1=/["\\\\\n\r]/g,t1={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function r1(e){return t1[e]}function i1(e){return Qx.test(e)?e.replace(e1,r1):e}function n1(e){const t=i1(e.value);return e.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+t+'"':e.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+t+'"@'+e.language:'"'+t+'"^^'+Zx(e.datatype)}var o1=n1;function l1(e,t){const r=t(e.subject),i=t(e.predicate),n=t(e.object),o=t(e.graph);return`${r} ${i} ${n} ${o?o+" ":""}.`}var s1=l1;function a1(e){return"?"+e.value}var u1=a1;const f1=qx,c1=Xx,d1=Yx,h1=o1,p1=Cd,g1=s1,w1=u1;function ks(e){if(!e)return null;if(e.termType==="BlankNode")return f1(e);if(e.termType==="DefaultGraph")return d1();if(e.termType==="Literal")return h1(e);if(e.termType==="NamedNode")return p1(e);if(e.termType==="Quad"||e.subject&&e.predicate&&e.object&&e.graph)return g1(e,ks);if(e.termType==="Variable")return w1(e);if(e[Symbol.iterator])return c1(e,ks);throw new Error(`unknown termType ${e.termType}`)}var y1=ks;const fo=ra(y1);class co{constructor(t){if(this.index=new Map,t)for(const[r,i]of t)this.set(r,i)}get size(){return this.index.size}clear(){this.index.clear()}delete(t){return this.index.delete(fo(t))}*entries(){for(const[,{term:t,value:r}]of this.index)yield[t,r]}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}get(t){const r=this.index.get(fo(t));return r&&r.value}has(t){return this.index.has(fo(t))}*keys(){for(const[,{term:t}]of this.index)yield t}set(t,r){const i=fo(t);return this.index.set(i,{term:t,value:r}),this}*values(){for(const[,{value:t}]of this.index)yield t}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}var Td={exports:{}};const b1={},m1=Object.freeze(Object.defineProperty({__proto__:null,default:b1},Symbol.toStringTag,{value:"Module"})),v1=tg(m1),x1=v1,S1=/([\x00-\x20<>"{}|^`\\]|%(?![0-9A-F][0-9A-F]))/g,_1=(e,t)=>{let r=t.codePointAt(0).toString(16)+"";return r.length>4?"\\U"+r.padStart(8,"0"):"\\u"+r.padStart(4,"0")},Oo=e=>e.replace(S1,_1),ya=/^(?:[\u0000-@[-`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?[\u0000-,\/:-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].*)|.+\.)$/,kd=/^(?:\\|[\u0000-\/;-@[-^`{-\u00bf\u00d7\u00f7\u0300-\u306f\u037e\u2000-\u200b\u200e-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff].+|(?:.+?(?:\\|[\u0000-,\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff]).+)|(?:.+?(?:\\|[\u0000-,.\/;-@[-^`{-\u00b6\u00b8-\u00bf\u00d7\u00f7\u037e\u2000-\u200b\u200e-\u203e\u2041-\u206f\u2190-\u2bff\u2ff0-\u3000\ud800-\uf8ff\ufdd0-\ufddf\ufffe\uffff])))$/,E1=/^([Tt](rue)?|TRUE)$/,C1=/^([Ff](alse)?|FALSE)$/,T1="xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx",k1=/[xy]/g,cn=()=>{let e=Date.now();return typeof performance<"u"&&(e+=performance.now()),T1.replace(k1,t=>{let r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?r:r&3|8).toString(16)})},fl=Symbol("prefix-cache"),A1=/[$^*()+[\\{}|.?]/g,L1="((?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\u{1fff}\\u{200c}-\\u{200d}\\u{2070}-\\u{218f}\\u{2c00}-\\u{2fef}\\u{3001}-\\u{d7ff}\\u{f900}-\\u{fdcf}\\u{fdf0}-\\u{fffd}\\u{10000}-\\u{effff}_:0-9]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])(?:(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\u{1fff}\\u{200c}-\\u{200d}\\u{2070}-\\u{218f}\\u{2c00}-\\u{2fef}\\u{3001}-\\u{d7ff}\\u{f900}-\\u{fdcf}\\u{fdf0}-\\u{fffd}\\u{10000}-\\u{effff}_\\-0-9\\xb7\\u{0300}-\\u{036f}\\u{203f}-\\u{2040}.:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%])*(?:[A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u{02ff}\\u{0370}-\\u{037d}\\u{037f}-\\u{1fff}\\u{200c}-\\u{200d}\\u{2070}-\\u{218f}\\u{2c00}-\\u{2fef}\\u{3001}-\\u{d7ff}\\u{f900}-\\u{fdcf}\\u{fdf0}-\\u{fffd}\\u{10000}-\\u{effff}_\\-0-9\\xb7\\u{0300}-\\u{036f}\\u{203f}-\\u{2040}:]|%[A-Fa-f0-9]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]))?)$";function wf(e,t=!1){let r=[],i={};for(let n in e){let o=e[n];t&&ya.test(n)||(i[o]=n,r.push(o.replace(A1,"\\$&")))}return r.length?(e[fl]={_r_iris:new RegExp(`^(${r.join("|")})${L1}`,"u"),_h_inverse:i},Object.freeze(e)):e}const Ad=(e,t)=>{let r=t[fl];if(r){let i=r._r_iris.exec(e);if(i)return r._h_inverse[i[1]]+":"+i[2]}else{let i="",n="",o=-1;for(let l in t){let s=t[l];if(e.indexOf(s)===0&&s.length>o&&!ya.test(l)){let a=e.slice(s.length);kd.test(a)||(n=a,i=l,o=s.length)}}if(o!==-1)return i+":"+n}return"<"+e+">"},Zn=(e,t={})=>{let r=t[fl];if(r){let i=r._r_iris.exec(e);if(i)return r._h_inverse[i[1]]+":"+i[2]}else{let i="",n=-1;for(let o in t){let l=t[o];e.startsWith(l)&&l.length>n&&(i=o,n=l.length)}if(n!==-1)return i+":"+e.slice(n)}return">"+e},R1=/^([^:]*):(.*)$/;function Ld(e,t={},r=!1){switch(e[0]){case">":return"<"+e.slice(1)+">";case"_":return e.length<=2||e[2]==="#"?new Mn()[r?"verbose":"terse"]():e;case'"':return JSON.stringify(e.slice(1));case"@":{let i=e.indexOf('"');return JSON.stringify(e.slice(i+1))+e.slice(0,i)}case"^":{let i=e.indexOf('"');return JSON.stringify(e.slice(i+1))+"^^"+Ld(e.slice(1,i),t,r)}case"*":return"";case"<":case"`":return he.c1(e).terse(t);default:{if(e==="a")return r?"":"a";let[,i,n]=R1.exec(e);return r||kd.test(n)||ya.test(i)?"<"+t[i]+n+">":e}}}class Nr{valueOf(){return this.concise()}toString(){return this.concise()}equals(t){return t?this===t||t.termType===this.termType&&t.value===this.value:!1}}Object.assign(Nr.prototype,{isGraphyTerm:!0});class Ge extends Nr{constructor(t){super(),this.value=t}concise(t={}){return Zn(this.value,t)}terse(t={},r=!1){return Ad(Oo(this.value),t)}verbose(){return"<"+Oo(this.value)+">"}isolate(){return{termType:"NamedNode",value:this.value}}}Object.assign(Ge.prototype,{termType:"NamedNode",isNamedNode:!0});const As=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");As.isRdfTypeAlias=!0;const Rd=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),M1=Rd.isolate(),N1=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),yf=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),$1=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),I1=new Ge("http://www.w3.org/2001/XMLSchema#date"),O1=new Ge("http://www.w3.org/2001/XMLSchema#dateTime"),_r=new Ge("http://www.w3.org/2001/XMLSchema#string");class cl extends Nr{equals(t){return t?this===t||t.termType==="Literal"&&t.value===this.value&&this.datatype.equals(t.datatype)&&t.language===this.language:!1}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(t){return this.language?"@"+this.language+'"'+this.value:"^"+Zn(this.datatype.value,t)+'"'+this.value}terse(t={}){let r=this.datatype.terse(t);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+r)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(cl.prototype,{datatype:_r,language:"",termType:"Literal",isLiteral:!0,isSimple:!1});class dn extends cl{constructor(t,r){super(),this.value=t,this.language=(r[0]==="@"?r.slice(1):r).toLowerCase()}verbose(){return JSON.stringify(this.value)+"@"+this.language}concise(){return"@"+this.language+'"'+this.value}terse(){return JSON.stringify(this.value)+"@"+this.language}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:M1}}}Object.assign(dn.prototype,{datatype:Rd,isLanguaged:!0});class Xi extends cl{verbose(){return JSON.stringify(this.value)+"^^"+this.datatype.verbose()}concise(t){return"^"+Zn(this.datatype.value,t)+'"'+this.value}terse(t={}){let r=this.datatype.terse(t);return JSON.stringify(this.value)+"^^"+r}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(Xi.prototype,{isDatatyped:!0});class ho extends Xi{constructor(t,r){super(),this.value=t,this.datatype=r}}class Md extends Nr{constructor(t){super(),this.value=t}get isSimple(){return!this.language&&!this.datatype.equals(_r)}get isLanguaged(){return!!this.language}get isDatatyped(){return _r.equals(this.datatype)}equals(t){return t?this===t||t.termType==="Literal"&&t.value===this.value&&this.datatype.equals(t.datatype)&&t.language===this.language:!1}verbose(){return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+this.datatype.verbose())}concise(t){return this.language?"@"+this.language+'"'+this.value:"^"+Zn(this.datatype.value,t)+'"'+this.value}terse(t={}){let r=this.datatype.terse(t);return JSON.stringify(this.value)+(this.language?"@"+this.language:"^^"+r)}isolate(){return{termType:"Literal",value:this.value,language:this.language,datatype:this.datatype.isolate()}}}Object.assign(Md.prototype,{datatype:_r,language:"",termType:"Literal",isLiteral:!0});class Ur extends cl{constructor(t){super(),this.value=t}verbose(){return JSON.stringify(this.value)}concise(){return'"'+this.value}terse(){return JSON.stringify(this.value)}}Object.assign(Ur.prototype,{isSimple:!0});const Nd=new Ge("http://www.w3.org/2001/XMLSchema#integer");class Kr extends Xi{static from(t){let r=new Kr(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.number=t}concise(t={}){return"^"+Nd.concise(t)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value}}Object.assign(Kr.prototype,{datatype:Nd,isNumeric:!0,isInteger:!0});const Qn=new Ge("http://www.w3.org/2001/XMLSchema#double");class Vt extends Xi{static from(t){let r=new Vt(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.number=t}concise(t={}){return"^"+Qn.concise(t)+'"'+this.value}terse(){return this.number.toExponential()}}Object.assign(Vt.prototype,{datatype:Qn,isNumeric:!0,isDouble:!0});const $d=new Ge("http://www.w3.org/2001/XMLSchema#decimal");class Xr extends Xi{static from(t){let r=new Xr(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.number=t}concise(t={}){return"^"+$d.concise(t)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value+(this.value.includes(".")?"":".0")}}Object.assign(Xr.prototype,{datatype:$d,isNumeric:!0,isDecimal:!0});const Id=new Ge("http://www.w3.org/2001/XMLSchema#boolean");class qt extends Xi{static from(t){let r=new qt(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.boolean=t}concise(t={}){return"^"+Id.concise(t)+'"'+this.value}terse(){return this.value+""}}Object.assign(qt.prototype,{datatype:Id,isBoolean:!0});class Od extends Vt{constructor(){super(1/0),this.value="INF"}terse(t){return'"INF"^^'+Qn.terse(t)}}Object.assign(Od.prototype,{isInfinite:!0});class Dd extends Vt{constructor(){super(-1/0),this.value="-INF"}terse(t){return'"-INF"^^'+Qn.terse(t)}}Object.assign(Dd.prototype,{isInfinite:!0});class Pd extends Vt{constructor(){super(NaN),this.value="NaN"}terse(t){return'"NaN"^^'+Qn.terse(t)}}Object.assign(Pd.prototype,{isNaN:!0});function zr(e,t=!1){this.value=e,this.isAnonymous=t}zr.prototype=Object.assign(Object.create(Nr.prototype),{termType:"BlankNode",isBlankNode:!0,concise(){return"_:"+this.value},terse(){return"_:"+this.value},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}}});function Mn(){}Mn.prototype=Object.assign(Object.create(zr.prototype),{isAnonymous:!0,isEphemeral:!0,concise(){return"_:#"+this.value},terse(){return"[]"},verbose(){return"_:"+this.value},isolate(){return{termType:"BlankNode",value:this.value}},equals(){return!1}});Object.defineProperty(Mn.prototype,"value",{get(){return"_"+cn()}});class Bd extends Nr{constructor(t){super(),this.value=t}concise(){return"?"+this.value}terse(){throw new Error("Cannot call .terse() on 'Variable' term type")}verbose(){throw new Error("Cannot call .verbose() on 'Variable' term type")}isolate(){return{termType:"Variable",value:this.value}}}Object.assign(Bd.prototype,{termType:"Variable",isVariable:!0});function Nn(){}Nn.prototype=Object.assign(Object.create(Nr.prototype),{value:"",termType:"DefaultGraph",isDefaultGraph:!0,concise(){return"*"},terse(){return""},verbose(){return""},isolate(){return{termType:"DefaultGraph",value:""}}});Object.assign(Object.create(Nr.prototype),{value:"",termType:"NoGraph",concise(){return""},terse(){return""},verbose(){return""},isolate(){return{termType:"NoGraph",value:""}}});const Do=new Nn;function Nt(e,t,r,i=Do){this.subject=e,this.predicate=t,this.object=r,this.graph=i}Object.assign(Nt.prototype,{isGraphyQuad:!0,equals(e){return e?this===e||this.object.equals(e.object)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.graph.equals(e.graph):!1},valueOf(){return this.verbose()},concise(e={}){return[this.subject.concise(e),this.predicate.concise(e),this.object.concise(e),this.graph.concise(e)]},terse(e){let t=this.graph.isDefaultGraph;return(t?"":this.graph.terse(e)+" { ")+this.subject.terse(e)+" "+this.predicate.terse(e)+" "+this.object.terse(e)+" ."+(t?"":" }")},verbose(){return this.subject.verbose()+" "+this.predicate.verbose()+" "+this.object.verbose()+" "+(this.graph.isDefaultGraph?"":this.graph.verbose()+" ")+"."},isolate(){return{subject:this.subject.isolate(),predicate:this.predicate.isolate(),object:this.object.isolate(),graph:this.graph.isolate()}}});let bf={namedNode(e){return new Ge(e)},blankNode(e,t){return new zr(e,t)},literal(e){return new Md(e)},defaultGraph(){return new Nn},quad(e,t,r,i){return new Nt(e,t,r,i||Do)},integer(e){return Kr.from(e)},double(e){return Vt.from(e)},decimal(e){return Xr.from(e)},boolean(e){return new qt(e)}};const he=Td.exports={concise:Zn,adopt(e){let t=Object.create(e),r=!1;if(typeof e.boolean!="function"){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#boolean");t.boolean=n=>e.literal(n+"",i),r=!0}if(typeof e.double!="function"){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#double");t.double=n=>e.literal(n+"",i),r=!0}if(typeof e.decimal!="function"){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#decimal");t.decimal=n=>e.literal(n+"",i),r=!0}if(typeof e.integer!="function"){let i=e.namedNode("http://www.w3.org/2001/XMLSchema#integer");t.integer=n=>e.literal(n+"",i),r=!0}return typeof e.simpleLiteral!="function"&&(t.simpleLiteral=i=>e.literal(i),r=!0),typeof e.languagedLiteral!="function"&&(t.languagedLiteral=(i,n)=>e.literal(i,n),r=!0),typeof e.datatypedLiteral!="function"&&(t.datatypedLiteral=(i,n)=>e.literal(i,n),r=!0),r?t:e},raw:bf,unfiltered:{...bf,literal(e,t){return!t||_r.equals(t)?new Ur(e):typeof t=="string"?new dn(e,t):_r.equals(t)?new Ur(e):new ho(e,t)},simpleLiteral(e){return new Ur(e)},languagedLiteral(e,t){return new dn(e,t)},datatypedLiteral(e,t){return _r.equals(t)?new Ur(e):new ho(e,t)}},number(e){return typeof e=="number"&&(!Number.isFinite(e)||Number.isNaN(e))?he.double(e):Number.isInteger(e)||typeof e=="bigint"?he.integer(e):he.decimal(e)},date(e){return he.literal(e.toISOString().replace(/T.+$/,"Z"),I1)},dateTime(e){return he.literal(e.toISOString(),O1)},namedNode(e){return new Ge(e)},ephemeral(){return new Mn},anonymous(){return new Mn},blankNode(e){if(e){if(typeof e=="string")return new zr(e)}else return new zr("_"+cn(),!0);throw new TypeError(`factory.blankNode(label) expects 'label' parameter to be falsy or a string; instead found: ${e}`)},literal(e,t){return!t||_r.equals(t)?new Ur(e):typeof t=="string"?new dn(e,t):new ho(e,t)},integer(e){let t=typeof e;if(t==="number"){if(Number.isFinite(e)){if(!Number.isInteger(e))throw new Error("Number is not an integer: "+e)}else throw Number.isNaN(e)?new Error("XSD integer cannot encode NaN. Try using double"):new Error("XSD integer cannot encode +/-infinity. Try using double");return new Kr(e)}else if(t==="string"){if(e==="")throw new Error("Refusing to serialize empty string as xsd:integer");let r=+e;if(Number.isNaN(r)||!Number.isInteger(r))throw new Error("Invalid integer string: "+e);return new Kr(r)}else throw t==="undefined"?new Error("Refusing to serialize undefined value as xsd:integer"):e===null?new Error("Refusing to serialize null value as xsd:integer"):new Error("XSD integer expects a number type or integer string")},double(e){let t=typeof e;if(t==="number")return Number.isFinite(e)?new Vt(e):Number.isNaN(e)?new Pd:e>0?new Od:new Dd;if(t==="string"){if(e==="")throw new Error("Refusing to serialize empty string as xsd:double");let r=+e;if(Number.isNaN(r))throw new Error("Invalid decimal string: "+e);return new Vt(r)}else throw t==="undefined"?new Error("Refusing to serialize undefined value as xsd:double"):e===null?new Error("Refusing to serialize null value as xsd:double"):new Error("XSD double expects a number type or double string")},decimal(e){let t=typeof e;if(t==="number"){if(!Number.isFinite(e))throw Number.isNaN(e)?new Error("XSD decimal cannot encode NaN. Try using double"):new Error("XSD decimal cannot encode +/-infinity. Try using double");return new Xr(e)}else if(t==="string"){if(e==="")throw new Error("Refusing to serialize empty string as xsd:decimal");let r=+e;if(Number.isNaN(r))throw new Error("Invalid decimal string: "+e);return new Xr(r)}else throw t==="undefined"?new Error("Refusing to serialize undefined value as xsd:decimal"):e===null?new Error("Refusing to serialize null value as xsd:decimal"):new Error("XSD decimal expects a number type or decimal string")},boolean(e){let t=typeof e;if(t==="boolean")return new qt(e);if(t==="number"){if(e===1)return new qt(!0);if(e===0)return new qt(!1);throw new Error("Boolean value 'w_value' must be either a '1' or '0' if using numbers")}else if(t==="string"){if(E1.test(e))return new qt(!0);if(C1.test(e))return new qt(!1);throw e===""?new Error("Refusing to serialize empty string as xsd:boolean"):new Error("Invalid boolean string: "+e)}else throw t==="undefined"?new Error("Refusing to serialize undefined value as xsd:boolean"):e===null?new Error("Refusing to serialize null value as xsd:boolean"):new Error("XSD boolean expects a boolean type or boolean string")},defaultGraph(){return new Nn},variable(e){return new Bd(e)},triple(e,t,r){let i=new Error("It is strongly encouraged to use .quad() instead of .triple()");return console.warn(i.stack.replace(/^(\s*)Error:/,"$1Warning:")),new Nt(e,t,r)},quad(e,t,r,i){return new Nt(e,t,r,i||Do)},term(e,t){return typeof e=="string"?he.c1(e,t):he.from.rdfjs_term(e)},c1(e,t={}){switch(e[0]){case"^":{let r=e.indexOf('"');if(r===-1)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let i=e.slice(1,r);return he.literal(e.slice(r+1),he.c1_node_explicit(i,t))}case"@":{let r=e.indexOf('"');if(r===-1)throw new Error(`Invalid concise-term string, no content literal delimiter found: '${e}'`);let i=e.slice(1,r);return he.literal(e.slice(r+1),i)}case'"':return he.literal(e.slice(1));default:return he.c1_node(e,t)}},c1_node(e,t={}){if(e==="a")return As;if(e==="*")return he.defaultGraph();if(e[0]==="_"){if(e[1]!==":")throw new Error(`Invliad concise-term string, prefixes are not allowed to start with an underscore: '${e}'`);return e[2]==="#"||e.length===2?he.ephemeral():he.blankNode(e.slice(2))}return he.c1_node_explicit(e,t)},c1_named_node(e,t={}){return e==="a"?As:he.c1_node_explicit(e,t)},c1_node_explicit(e,t={}){switch(e[0]){case">":return he.namedNode(e.slice(1));case"<":throw new Error(`Whoops! It looks like this concise-term string starts with a '<' character. Remember to use '>' if you are trying to make an absolute IRI reference. +Invalid concise-term string '${e}'`);case"`":throw new Error(`The backtick character '\`' is reserved for concise-struct key directives and should not be used in the object position. +Invalid concise-term string '${e}'`);default:return this.c1_prefixed_node(e,t)}},c1_prefixed_node(e,t={}){let r=e.indexOf(":");if(r===-1)throw new Error(`A relative or prefixed node must include a ':' character. +Invalid concise-term string for node: '${e}'`);let i=e.slice(0,r),n=e.slice(r+1);if(i in t)return he.namedNode(t[i]+n);throw new Error(`Prefix not defined: '${i}'`)},c1_to_nt:Ld,*quads(e,t={}){for(let r in e)yield*he.triples(e[r],t,r)},*triples(e,t={},r="*"){let i=he.c1(r,t);for(let n in e){let o=he.c1(n,t),l=e[n];yield*he.pairs(i,o,l,t)}},*pairs(e,t,r,i={}){for(let n in r){let o=he.c1(n,i),l=r[n];yield*he.objects(e,t,o,l,i)}},*collection(e,t,r,i={}){yield*he.objects(e,t,N1,r[0],i);let n=r.slice(1);if(!n.length)yield new Nt(t,yf,$1,e);else{let o=he.blankNode();yield new Nt(t,yf,o,e),yield*he.collection(e,o,n,i)}},*objects(e,t,r,i,n,o=!1){switch(typeof i){case"string":{yield new Nt(t,r,he.c1(i,n),e);break}case"number":{yield new Nt(t,r,he.number(i),e);break}case"object":{if(Array.isArray(i))if(o){let s=he.blankNode();yield new Nt(t,r,s,e),yield*he.collection(e,s,i,n)}else for(let s of i)yield*he.objects(e,t,r,s,n,!0);else{let s=he.blankNode();yield new Nt(t,r,s,e),yield*he.pairs(e,s,i,n)}break}default:throw new Error(`invalid object type: ${typeof i}`)}},from:{term(e){return e===null||e.isGraphyTerm?e:he.from.rdfjs_term(e)},quad(e){if(e===null||e.isGraphyQuad)return e;let t=he.from;return new Nt(t.rdfjs_term(e.subject),t.rdfjs_term(e.predicate),t.rdfjs_term(e.object),e.graph?t.rdfjs_term(e.graph):Do)},rdfjs_term(e){switch(e.termType){case"NamedNode":return new Ge(e.value);case"BlankNode":return new zr(e.value);case"Literal":return he.literal(e.value,e.language?e.language:e.datatype?new Ge(e.datatype.value):null);case"DefaultGraph":return new Nn;default:throw new TypeError(`invalid termType: ${e.termType}`)}},sparql_result(e){switch(e.type){case"uri":return new Ge(e.value);case"literal":case"typed-literal":return"xml:lang"in e?new dn(e.value,e["xml:lang"]):"datatype"in e&&e.datatype!=="http://www.w3.org/2001/XMLSchema#string"?new ho(e.value,new Ge(e.datatype)):new Ur(e.value);case"bnode":return new zr(e.value);default:throw new Error(`unexpected SPARQL Result JSON Format Term type: ${e.type}`)}}},to:{boolean:e=>qt.from(e),integer:e=>Kr.from(e),decimal:e=>Xr.from(e),double:e=>Vt.from(e)},comment(e={}){return`\`[${cn()}]${JSON.stringify({...e,type:"comment"})}`},newlines(){return`\`[${cn()}]{"type":"newlines"}`},config(e){if(typeof e!="string")throw new TypeError(`Expected 'key' argument to be a string, instead found ${typeof e}`);return`\`[${cn()}]{"type":"config","value":${JSON.stringify(e)}}`},hash(e){let t=he.from.quad(e),r=x1.createHash("sha256");return r.update(t.verbose()),r.digest("hex")},cache_prefixes:wf,cachePrefixes:wf,terse:Ad,clean_iri:Oo,cleanIri:Oo,$_PREFIX_CACHE:fl};Object.assign(he,{c3:he.triples,c4:he.quads,fromTerm:he.from.term,fromQuad:he.from.quad});var D1=Td.exports;const mf=ra(D1),P1={rif:"http://www.w3.org/2007/rif#",v:"http://rdf.data-vocabulary.org/#",wdr:"http://www.w3.org/2007/05/powder#",xml:"http://www.w3.org/XML/1998/namespace/"},B1={acl:"http://www.w3.org/ns/auth/acl#",as:"https://www.w3.org/ns/activitystreams#",bibo:"http://purl.org/ontology/bibo/",cc:"http://creativecommons.org/ns#",cert:"http://www.w3.org/ns/auth/cert#",cnt:"http://www.w3.org/2011/content#",constant:"http://qudt.org/vocab/constant/",crm:"http://www.cidoc-crm.org/cidoc-crm/",csvw:"http://www.w3.org/ns/csvw#",ctag:"http://commontag.org/ns#","dash-sparql":"http://datashapes.org/sparql#",dash:"http://datashapes.org/dash#",dbo:"http://dbpedia.org/ontology/",dc11:"http://purl.org/dc/elements/1.1/",dcam:"http://purl.org/dc/dcam/",dcat:"http://www.w3.org/ns/dcat#",dcmitype:"http://purl.org/dc/dcmitype/",dcterms:"http://purl.org/dc/terms/",dig:"http://www.ics.forth.gr/isl/CRMdig/",discipline:"http://qudt.org/vocab/discipline/",doap:"http://usefulinc.com/ns/doap#",dpv:"http://www.w3.org/ns/dpv#",dqv:"http://www.w3.org/ns/dqv#",dtype:"http://www.linkedmodel.org/schema/dtype#",duv:"http://www.w3.org/ns/duv#",earl:"http://www.w3.org/ns/earl#",ebucore:"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#",exif:"http://www.w3.org/2003/12/exif/ns#",foaf:"http://xmlns.com/foaf/0.1/",frbr:"http://purl.org/vocab/frbr/core#",geo:"http://www.opengis.net/ont/geosparql#",geof:"http://www.opengis.net/def/function/geosparql/",geor:"http://www.opengis.net/def/rule/geosparql/",gml:"http://www.opengis.net/ont/gml#",gn:"http://www.geonames.org/ontology#",gr:"http://purl.org/goodrelations/v1#",grddl:"http://www.w3.org/2003/g/data-view#",gs1:"https://gs1.org/voc/",gtfs:"http://vocab.gtfs.org/terms#",http:"http://www.w3.org/2011/http#",hydra:"http://www.w3.org/ns/hydra/core#",ical:"http://www.w3.org/2002/12/cal/icaltzd#",la:"https://linked.art/ns/terms/",ldp:"http://www.w3.org/ns/ldp#",list:"http://www.w3.org/2000/10/swap/list#",locn:"http://www.w3.org/ns/locn#",log:"http://www.w3.org/2000/10/swap/log#",lvont:"http://lexvo.org/ontology#",m4i:"http://w3id.org/nfdi4ing/metadata4ing#",ma:"http://www.w3.org/ns/ma-ont#",mads:"http://www.loc.gov/mads/rdf/v1#",math:"http://www.w3.org/2000/10/swap/math#",oa:"http://www.w3.org/ns/oa#",og:"http://ogp.me/ns#",oidc:"http://www.w3.org/ns/solid/oidc#",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pim:"http://www.w3.org/ns/pim/space#",prefix:"http://qudt.org/vocab/prefix/",prov:"http://www.w3.org/ns/prov#",qb:"http://purl.org/linked-data/cube#",qkdv:"http://qudt.org/vocab/dimensionvector/",quantitykind:"http://qudt.org/vocab/quantitykind/",qudt:"http://qudt.org/schema/qudt/",rdau:"http://rdaregistry.info/Elements/u/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfa:"http://www.w3.org/ns/rdfa#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rev:"http://purl.org/stuff/rev#",rico:"https://www.ica.org/standards/RiC/ontology#",rr:"http://www.w3.org/ns/r2rml#",rss:"http://purl.org/rss/1.0/",schema:"http://schema.org/",sd:"http://www.w3.org/ns/sparql-service-description#",sdmx:"http://purl.org/linked-data/sdmx#",sem:"http://semanticweb.cs.vu.nl/2009/11/sem/",set:"http://www.w3.org/2000/10/swap/set#",sf:"http://www.opengis.net/ont/sf#",sh:"http://www.w3.org/ns/shacl#",shex:"http://www.w3.org/ns/shex#",shsh:"http://www.w3.org/ns/shacl-shacl#",sioc:"http://rdfs.org/sioc/ns#",skos:"http://www.w3.org/2004/02/skos/core#",skosxl:"http://www.w3.org/2008/05/skos-xl#",solid:"http://www.w3.org/ns/solid/terms#",sosa:"http://www.w3.org/ns/sosa/",sou:"http://qudt.org/vocab/sou/",ssn:"http://www.w3.org/ns/ssn/",stat:"http://www.w3.org/ns/posix/stat#",string:"http://www.w3.org/2000/10/swap/string#",test:"http://www.w3.org/2006/03/test-description#",time:"http://www.w3.org/2006/time#",unit:"http://qudt.org/vocab/unit/",vaem:"http://www.linkedmodel.org/schema/vaem#",vann:"http://purl.org/vocab/vann/",vcard:"http://www.w3.org/2006/vcard/ns#",void:"http://rdfs.org/ns/void#",vs:"http://www.w3.org/2003/06/sw-vocab-status/ns#",vso:"http://purl.org/vso/ns#",wdrs:"http://www.w3.org/2007/05/powder-s#",wgs:"http://www.w3.org/2003/01/geo/wgs84_pos#",xhv:"http://www.w3.org/1999/xhtml/vocab#",xkos:"http://rdf-vocabulary.ddialliance.org/xkos#",xsd:"http://www.w3.org/2001/XMLSchema#"},F1={...B1,...P1};function W1(e,t={}){const r={...F1,...t},i=Array.from(Object.entries(r)).filter(([,n])=>e.startsWith(n));if(i.length){i.sort(([,o],[,l])=>l.length-o.length);const n=i[0];return e.replace(new RegExp(`^${n[1]}`),`${n[0]}:`)}return""}class Fd{constructor(t){this.term=t}toTerm(){const t=`"""${this.term.value.replace(/"$/,'\\"')}"""`;return{terse:r=>t+this.langOrDatatype(r),verbose:r=>t+this.langOrDatatype(r)}}langOrDatatype(t){if(this.term.language)return`@${this.term.language}`;if(this.term.datatype.equals(yn.string))return"";const r=W1(this.term.datatype.value,t);return r?`^^${r}`:`^^<${this.term.datatype.value}>`}}const Wd=new Map([[Fd,e=>e.toTerm()]]);function H1(e){return e.has($t.first)&&e.has($t.rest)}class U1 extends Fy.Transform{constructor({prefixes:t={},strict:r=!1,preserveListNodeProperties:i=!1}={}){super({objectMode:!0}),this.prefixes=t,this.graphs=new co,this.blankNodes=new co,this.strict=r,this.preserveListNodeProperties=i}_transform({subject:t,predicate:r,object:i,graph:n},o,l){const s=this.getGraph(n),a=s.get(t)||{predicates:new co},u=a.predicates.get(r)||[];if(a.predicates.set(r,[...u,i]),i.termType==="BlankNode"){const d=this.blankNodes.get(i)||0;this.blankNodes.set(i,d+1)}s.set(t,a),l()}_flush(){const t=[...this.graphs].reduce((r,[i,n])=>{const o=this.toHashKey(i);let l=r[o]||{};return l=[...n].reduce(this.toConciseHash(i).bind(this),l),{...r,[o]:l}},{});this.push({type:this.strict?"c4r":"c4",value:t}),this.push(null)}toConciseHash(t){return(r,[i,{predicates:n}])=>{if(!this.strict&&this.blankNodes.get(i)===1)return r;const o=this.toHashKey(i);return{...r,[o]:this.createPropertyMap(t,n)}}}createPropertyMap(t,r,i=0){const n=o=>{if(!this.strict&&this.blankNodes.get(o)===1){const l=this.graphs.get(t).get(o);if(l)return this.createPropertyMap(t,l.predicates,i+1)}return this.toHashKey(o)};if(!this.strict&&H1(r)&&!this.preserveListNodeProperties){const[o]=r.get($t.first),[l]=r.get($t.rest);if(i===0){let a;if(l.equals($t.nil))a=this.toHashKey($t.nil);else{const u=n(l);a=Array.isArray(u)?[...u]:[u]}return{[this.toHashKey($t.first)]:[n(o)],[this.toHashKey($t.rest)]:[a]}}if(l.equals($t.nil))return[n(o)];const s=n(l);return[n(o),...s]}return[...r].reduce((o,[l,s])=>{const a=this.toHashKey(l),u=s.map(n.bind(this));return{...o,[a]:u}},{})}getGraph(t){const r=this.graphs.get(t)||new co;return this.graphs.set(t,r),r}literalHash(t){if(t.datatype&&!this.strict)switch(t.datatype.value){case yn.integer.value:{const r=+t.value;if(Number.isInteger(r))return r;break}case yn.decimal.value:{const r=+t.value;if(!Number.isNaN(r)&&!Number.isInteger(r))return r;break}case yn.boolean.value:{if(t.value==="true")return!0;if(t.value==="false")return!1;break}}return t.value.includes(` +`)?new Fd(t):mf.fromTerm(t).concise(this.prefixes)}toHashKey(t){return t.termType==="Literal"?this.literalHash(t):t.equals($t.type)?"a":mf.fromTerm(t).concise(this.prefixes)}}async function ba(e,t={}){const r=(await e).default;return class{constructor(i={}){this.defaults=i}import(i,{preserveListNodeProperties:n,...o}={}){const l={...this.defaults.prefixes||{},...o.prefixes||{}},s=r({prefixes:l,coercions:t.coercions});return i.pipe(new U1({prefixes:l,strict:t.strict,preserveListNodeProperties:n})).pipe(s),s}}}const Hd=Bt(()=>ba(ht(()=>import("./main-B4ltdbX3.js").then(e=>e.m),__vite__mapDeps([9,10,11,12,13])),{coercions:Wd})),j1=Bt(()=>ba(ht(()=>import("./main-BXAPmmD-.js").then(e=>e.m),__vite__mapDeps([14,11,12,13])),{strict:!0})),z1=Bt(()=>ba(ht(()=>import("./main-Cwp2YZyg.js").then(e=>e.m),__vite__mapDeps([15,10,11,12,13])),{strict:!0,coercions:Wd}));async function Ud(e){const t=(await e).default;return class{import(r,i){return r.pipe(i?t(i):t())}}}const ma=Bt(()=>Ud(ht(()=>import("./main-DYtbBt7L.js").then(e=>e.m),__vite__mapDeps([16,12,13])))),jd=Bt(()=>Ud(ht(()=>import("./main-CRBhJGQX.js").then(e=>e.m),__vite__mapDeps([17,12,13])))),G1=Bt(async()=>{const e=(await ht(()=>import("./index-Bt-DoqtB.js"),__vite__mapDeps([18,1,4]))).default;return class extends e{constructor({prefixes:r={},...i}={}){super({compact:!0,skipGraphProperty:!0,encoding:"string",...i}),this.prefixes=r}import(r,{prefixes:i={}}={}){const n={...this.prefixes,...i};return super.import(r,{context:n})}}}),At=new gc({});At.import(mt);const Ft={jsonLd:"application/ld+json",ntriples:"application/n-triples",nquads:"application/n-quads",notation3:"text/n3",rdfXml:"application/rdf+xml",trig:"application/trig",turtle:"text/turtle"};At.serializers.set(Ft.jsonLd,new G1);At.serializers.set(Ft.notation3,new Hd);At.serializers.set(Ft.turtle,new Hd);At.serializers.set(Ft.trig,new z1);At.serializers.set(Ft.rdfXml,new j1);At.parsers.set(Ft.notation3,new ma);At.parsers.set(Ft.turtle,new ma);At.parsers.set(Ft.trig,new ma);At.parsers.set(Ft.ntriples,new jd);At.parsers.set(Ft.nquads,new jd);var ct=navigator.userAgent,zd=navigator.platform,cr=/gecko\/\d/i.test(ct),Gd=/MSIE \d/.test(ct),qd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ct),dl=/Edge\/(\d+)/.exec(ct),ye=Gd||qd||dl,De=ye&&(Gd?document.documentMode||6:+(dl||qd)[1]),it=!dl&&/WebKit\//.test(ct),q1=it&&/Qt\/\d+\.\d+/.test(ct),hl=!dl&&/Chrome\//.test(ct),Pt=/Opera\//.test(ct),pl=/Apple Computer/.test(navigator.vendor),K1=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ct),X1=/PhantomJS/.test(ct),eo=pl&&(/Mobile\/\w+/.test(ct)||navigator.maxTouchPoints>2),gl=/Android/.test(ct),$n=eo||gl||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ct),Ct=eo||/Mac/.test(zd),V1=/\bCrOS\b/.test(ct),Y1=/win/i.test(zd),Vr=Pt&&ct.match(/Version\/(\d*\.\d*)/);Vr&&(Vr=Number(Vr[1]));Vr&&Vr>=15&&(Pt=!1,it=!0);var vf=Ct&&(q1||Pt&&(Vr==null||Vr<12.11)),va=cr||ye&&De>=9;function Wi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ai=function(e,t){let r=e.className,i=Wi(t).exec(r);if(i){let n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function Cr(e){for(let t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function bt(e,t){return Cr(e).appendChild(t)}function ie(e,t,r,i){let n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(let o=0;o=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}var Hi=class{constructor(){this.id=null,this.f=null,this.time=0,this.handler=xa(this.onTimeout,this)}onTimeout(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)}set(e,t){this.f=t;const r=+new Date+e;(!this.id||r=t)return i+Math.min(l,t-n);if(n+=o-i,n+=r-n%r,i=o+1,n>=t)return i}}var po=[""];function Sa(e){for(;po.length<=e;)po.push(Ce(po)+" ");return po[e]}function Ce(e){return e[e.length-1]}function yl(e,t){let r=[];for(let i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||Z1.test(e))}function Eo(e,t){return t?t.source.indexOf("\\w")>-1&&Rs(e)?!0:t.test(e):Rs(e)}function Sf(e){for(let t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Q1=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ms(e){return e.charCodeAt(0)>=768&&Q1.test(e)}function Vd(e,t,r){for(;(r<0?t>0:tr?-1:1;for(;;){if(t==r)return t;let n=(t+r)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+i}}function eS(e,t,r,i){if(!e)return i(t,r,"ltr",0);let n=!1;for(let o=0;ot||t==r&&l.to==t)&&(i(Math.max(l.from,t),Math.min(l.to,r),l.level==1?"rtl":"ltr",o),n=!0)}n||i(t,r,"ltr")}var hn=null;function Dn(e,t,r){let i;hn=null;for(let n=0;nt)return n;o.to==t&&(o.from!=o.to&&r=="before"?i=n:hn=n),o.from==t&&(o.from!=o.to&&r!="before"?i=n:hn=n)}return i??hn}var tS=function(){let e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}let i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;function a(u,d,h){this.level=u,this.from=d,this.to=h}return function(u,d){let h=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!i.test(u))return!1;let g=u.length,p=[];for(let T=0;T-1&&(i[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function He(e,t){let r=_a(e,t);if(!r.length)return;let i=Array.prototype.slice.call(arguments,2);for(let n=0;n0}function Vi(e){e.prototype.on=function(t,r){ne(this,t,r)},e.prototype.off=function(t,r){yt(this,t,r)}}function at(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Zd(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ns(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Pn(e){at(e),Zd(e)}function Ea(e){return e.target||e.srcElement}function Qd(e){let t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Ct&&e.ctrlKey&&t==1&&(t=3),t}var rS=function(){if(ye&&De<9)return!1;let e=ie("div");return"draggable"in e||"dragDrop"in e}(),os;function iS(e){if(os==null){let r=ie("span","​");bt(e,ie("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(os=r.offsetWidth<=1&&r.offsetHeight>2&&!(ye&&De<8))}let t=os?ie("span","​"):ie("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return t.setAttribute("cm-text",""),t}var ls;function nS(e){if(ls!=null)return ls;let t=bt(e,document.createTextNode("AخA")),r=ei(t,0,1).getBoundingClientRect(),i=ei(t,1,2).getBoundingClientRect();return Cr(e),!r||r.left==r.right?!1:ls=i.right-r.right<3}var Ca=` + +b`.split(/\n/).length!=3?e=>{let t=0,r=[],i=e.length;for(;t<=i;){let n=e.indexOf(` +`,t);n==-1&&(n=e.length);let o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),l=o.indexOf("\r");l!=-1?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=n+1)}return r}:e=>e.split(/\r\n?|\n/),oS=window.getSelection?e=>{try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:e=>{let t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},lS=(()=>{let e=ie("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),ss=null;function sS(e){if(ss!=null)return ss;let t=bt(e,ie("span","x")),r=t.getBoundingClientRect(),i=ei(t,0,1).getBoundingClientRect();return ss=Math.abs(r.left-i.left)>1}var Ta={},_i={};function aS(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ta[e]=t}function uS(e,t){_i[e]=t}function Po(e){if(typeof e=="string"&&_i.hasOwnProperty(e))e=_i[e];else if(e&&typeof e.name=="string"&&_i.hasOwnProperty(e.name)){let t=_i[e.name];typeof t=="string"&&(t={name:t}),e=Xd(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Po("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Po("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ka(e,t){t=Po(t);let r=Ta[t.name];if(!r)return ka(e,"text/plain");let i=r(e,t);if(Ni.hasOwnProperty(t.name)){let n=Ni[t.name];for(let o in n)n.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=n[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(let n in t.modeProps)i[n]=t.modeProps[n];return i}var Ni={};function fS(e,t){let r=Ni.hasOwnProperty(e)?Ni[e]:Ni[e]={};ti(t,r)}function Yr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);let r={};for(let i in t){let n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r}function Aa(e,t){let r;for(;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function eh(e,t,r){return e.startState?e.startState(t,r):!0}var cS=class{constructor(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r}eol(){return this.pos>=this.string.length}sol(){return this.pos==this.lineStart}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosr?o.toLowerCase():o,n=this.string.substr(this.pos,e.length);if(i(n)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}hideFirstChars(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}lookAhead(e){let t=this.lineOracle;return t&&t.lookAhead(e)}baseToken(){let e=this.lineOracle;return e&&e.baseToken(this.pos)}},bl=cS;function ee(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");let r=e;for(;!r.lines;)for(let i=0;;++i){let n=r.children[i],o=n.chunkSize();if(t{let l=o.text;n==r.line&&(l=l.slice(0,r.ch)),n==t.line&&(l=l.slice(t.ch)),i.push(l),++n}),i}function as(e,t,r){let i=[];return e.iter(t,r,n=>{i.push(n.text)}),i}function Zt(e,t){let r=t-e.height;if(r)for(let i=e;i;i=i.parent)i.height+=r}function Ae(e){if(e.parent==null)return null;let t=e.parent,r=Ze(t.lines,e);for(let i=t.parent;i;t=i,i=i.parent)for(let n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function Gr(e,t){let r=e.first;e:do{for(let n=0;n=e.first&&tr?F(r,ee(e,r).text.length):dS(t,ee(e,t.line).text.length)}function dS(e,t){let r=e.ch;return r==null||r>t?F(e.line,t):r<0?F(e.line,0):e}function _f(e,t){let r=[];for(let i=0;ithis.maxLookAhead&&(this.maxLookAhead=e),t}baseToken(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;let t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}}nextLine(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--}static fromSaved(e,t,r){return t instanceof Bo?new mn(e,Yr(e.mode,t.state),r,t.lookAhead):new mn(e,Yr(e.mode,t),r)}save(e){let t=e!==!1?Yr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bo(t,this.maxLookAhead):t}};function rh(e,t,r,i){let n=[e.state.modeGen],o={};kf(e,t.text,e.doc.mode,r,(s,a)=>n.push(s,a),o,i);let l=r.state;for(let s=0;s{let p=u;for(;dh&&n.splice(u,1,h,n[u+1],m),u+=2,d=Math.min(h,m)}if(g)if(a.opaque)n.splice(p,u-p,h,"overlay "+g),u=p+2;else for(;pe.options.maxHighlightLength&&Yr(e.doc.mode,i.state),o=rh(e,t,i);n&&(i.state=n),t.stateAfter=i.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function to(e,t,r){let i=e.doc,n=e.display;if(!i.mode.startState)return new mn(i,!0,t);let o=hS(e,t,r),l=o>i.first&&ee(i,o-1).stateAfter,s=l?mn.fromSaved(i,l,o):new mn(i,eh(i.mode),o);return i.iter(o,t,a=>{Ra(e,a.text,s);let u=s.line;a.stateAfter=u==t-1||u%5==0||u>=n.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ef=class{constructor(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r}};function Cf(e,t,r,i){let n=e.doc,o=n.mode,l;t=ae(n,t);let s=ee(n,t.line),a=to(e,t.line,r),u=new bl(s.text,e.options.tabSize,a),d;for(i&&(d=[]);(i||u.pose.options.maxHighlightLength?(s=!1,l&&Ra(e,t,i,d.pos),d.pos=t.length,h=null):h=Tf(Ma(r,d,i.state,g),o),g){let p=g[0].name;p&&(h="m-"+(h?p+" "+h:p))}if(!s||u!=h){for(;al;--s){if(s<=o.first)return o.first;let a=ee(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof Bo?u.lookAhead:0)<=o.modeFrontier))return s;let d=_t(a.text,null,e.options.tabSize);(n==null||i>d)&&(n=s-1,i=d)}return n}function pS(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierr;i--){let n=ee(e,i).stateAfter;if(n&&(!(n instanceof Bo)||i+n.lookAhead=t:o.to>t);(i||(i=[])).push(new xl(l,o.from,a?null:o.to))}}return i}function vS(e,t,r){let i;if(e)for(let n=0;n=t:o.to>t)||o.from==t&&l.type=="bookmark"&&(!r||o.marker.insertLeft)){let a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(let m=0;m{if(o.markedSpans)for(let l=0;l0)continue;let d=[a,1],h=ue(u.from,s.from),g=ue(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&d.push({from:u.from,to:s.from}),(g>0||!l.inclusiveRight&&!g)&&d.push({from:s.to,to:u.to}),n.splice.apply(n,d),a+=d.length-3}}return n}function lh(e){let t=e.markedSpans;if(t){for(let r=0;rt)&&(!i||Na(i,o.marker)<0)&&(i=o.marker)}return i}function Lf(e,t,r,i,n){let o=ee(e,t),l=dr&&o.markedSpans;if(l)for(let s=0;s=0&&h<=0||d<=0&&h>=0)&&(d<=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?ue(u.to,r)>=0:ue(u.to,r)>0)||d>=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?ue(u.from,i)<=0:ue(u.from,i)<0)))return!0}}function Qt(e){let t;for(;t=uh(e);)e=t.find(-1,!0).line;return e}function _S(e){let t;for(;t=Sl(e);)e=t.find(1,!0).line;return e}function ES(e){let t,r;for(;t=Sl(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function $a(e,t){let r=ee(e,t),i=Qt(r);return r==i?t:Ae(i)}function fh(e,t){if(t>e.lastLine())return t;let r=ee(e,t),i;if(!kr(e,r))return t;for(;i=Sl(r);)r=i.find(1,!0).line;return Ae(r)+1}function kr(e,t){let r=dr&&t.markedSpans;if(r){for(let i,n=0;n{let n=Ho(i);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=i)})}var Wn=class{constructor(e,t,r){this.text=e,sh(this,t),this.height=r?r(this):1}lineNo(){return Ae(this)}};Vi(Wn);function CS(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),lh(e),sh(e,r);let n=i?i(e):1;n!=e.height&&Zt(e,n)}function TS(e){e.parent=null,lh(e)}var kS={},AS={};function Rf(e,t){if(!e||/^\s*$/.test(e))return null;let r=t.addModeClass?AS:kS;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ch(e,t){let r=Mi("span",null,null,it?"padding-right: .1px":null),i={pre:Mi("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(let n=0;n<=(t.rest?t.rest.length:0);n++){let o=n?t.rest[n-1]:t.line,l;i.pos=0,i.addToken=RS,nS(e.display.measure)&&(l=br(o,e.doc.direction))&&(i.addToken=NS(i.addToken,l)),i.map=[];let s=t!=e.display.externalMeasured&&Ae(o);$S(o,i,ih(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=is(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=is(o.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(iS(e.display.measure))),n==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(it){let n=i.content.lastChild;(/\bcm-tab\b/.test(n.className)||n.querySelector&&n.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=is(i.pre.className,i.textClass||"")),i}function LS(e){let t=ie("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function RS(e,t,r,i,n,o,l){if(!t)return;let s=e.splitSpaces?MS(t,e.trailingSpace):t,a=e.cm.state.specialChars,u=!1,d;if(!a.test(t))e.col+=t.length,d=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,d),ye&&De<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();let h=0;for(;;){a.lastIndex=h;let g=a.exec(t),p=g?g.index-h:t.length-h;if(p){let C=document.createTextNode(s.slice(h,h+p));ye&&De<9?d.appendChild(ie("span",[C])):d.appendChild(C),e.map.push(e.pos,e.pos+p,C),e.col+=p,e.pos+=p}if(!g)break;h+=p+1;let m;if(g[0]==" "){let C=e.cm.options.tabSize,T=C-e.col%C;m=d.appendChild(ie("span",Sa(T),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text"," "),e.col+=T}else g[0]=="\r"||g[0]==` +`?(m=d.appendChild(ie("span",g[0]=="\r"?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",g[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(g[0]),m.setAttribute("cm-text",g[0]),ye&&De<9?d.appendChild(ie("span",[m])):d.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||i||n||u||o||l){let h=r||"";i&&(h+=i),n&&(h+=n);let g=ie("span",[d],h,o);if(l)for(let p in l)l.hasOwnProperty(p)&&p!="style"&&p!="class"&&g.setAttribute(p,l[p]);return e.content.appendChild(g)}e.content.appendChild(d)}function MS(e,t){if(e.length>1&&!/ /.test(e))return e;let r=t,i="";for(let n=0;n{n=n?n+" cm-force-border":"cm-force-border";let u=r.pos,d=u+i.length;for(;;){let h;for(let g=0;gu&&h.from<=u));g++);if(h.to>=d)return e(r,i,n,o,l,s,a);e(r,i.slice(0,h.to-u),n,o,null,s,a),o=null,i=i.slice(h.to-u),u=h.to}}}function Mf(e,t,r,i){let n=!i&&r.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!i&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",r.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function $S(e,t,r){let i=e.markedSpans,n=e.text,o=0;if(!i){for(let A=1;As||le.collapsed&&Z.to==s&&Z.from==s)){if(Z.to!=null&&Z.to!=s&&g>Z.to&&(g=Z.to,m=""),le.className&&(p+=" "+le.className),le.css&&(h=(h?h+";":"")+le.css),le.startStyle&&Z.from==s&&(C+=" "+le.startStyle),le.endStyle&&Z.to==g&&(H||(H=[])).push(le.endStyle,Z.to),le.title&&((R||(R={})).title=le.title),le.attributes)for(let ce in le.attributes)(R||(R={}))[ce]=le.attributes[ce];le.collapsed&&(!T||Na(T.marker,le)<0)&&(T=Z)}else Z.from>s&&g>Z.from&&(g=Z.from)}if(H)for(let U=0;U=l)break;let A=Math.min(l,g);for(;;){if(u){let N=s+u.length;if(!T){let H=N>A?u.slice(0,A-s):u;t.addToken(t,H,d?d+p:p,C,s+H.length==g?m:"",h,R)}if(N>=A){u=u.slice(A-s),s=A;break}s=N,C=""}u=n.slice(o,o=r[a++]),d=Rf(r[a++],t.cm.options)}}}function dh(e,t,r){this.line=t,this.rest=ES(t),this.size=this.rest?Ae(Ce(this.rest))-r+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function Co(e,t,r){let i=[],n;for(let o=t;or[o].apply(null,i))}function PS(){let e=vn;vn=null;for(let t=0;t2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function bh(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(let i=0;ir)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function zS(e,t){t=Qt(t);let r=Ae(t),i=e.display.externalMeasured=new dh(e.doc,t,r);i.lineN=r;let n=i.built=ch(e,i);return i.text=n.pre,bt(e.display.lineMeasure,n.pre),i}function mh(e,t,r,i){return tr(e,Yi(e,t),r,i)}function Ba(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=a-s,n=o-1,t>=a&&(l="right")),n!=null){if(i=e[u+2],s==a&&r==(i.insertLeft?"left":"right")&&(l=r),r=="left"&&n==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[(u-=3)+2],l="left";if(r=="right"&&n==a-s)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function qS(e,t,r,i){let n=xh(t.map,r,i),o=n.node,l=n.start,s=n.end,a=n.collapse,u;if(o.nodeType==3){for(let A=0;A<4;A++){for(;l&&Ms(t.line.text.charAt(n.coverStart+l));)--l;for(;n.coverStart+s0&&(a=i="right");let A;e.options.lineWrapping&&(A=o.getClientRects()).length>1?u=A[i=="right"?A.length-1:0]:u=o.getBoundingClientRect()}if(ye&&De<9&&!l&&(!u||!u.left&&!u.right)){let A=o.parentNode.getClientRects()[0];A?u={left:A.left,right:A.left+Ji(e.display),top:A.top,bottom:A.bottom}:u=vh}let d=u.top-t.rect.top,h=u.bottom-t.rect.top,g=(d+h)/2,p=t.view.measure.heights,m=0;for(;m=i.text.length?(a=i.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l(u=="before"?a-1:a,u=="before");function d(m,C,T){let R=s[C],A=R.level==1;return l(T?m-1:m,A!=T)}let h=Dn(s,a,u),g=hn,p=d(a,h,u=="before");return g!=null&&(p.other=d(a,g,u!="before")),p}function If(e,t){let r=0;t=ae(e.doc,t),e.options.lineWrapping||(r=Ji(e.display)*t.ch);let i=ee(e.doc,t.line),n=hr(i)+_l(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function Bs(e,t,r,i,n){let o=F(e,t,r);return o.xRel=n,i&&(o.outside=i),o}function Wa(e,t,r){let i=e.doc;if(r+=e.display.viewOffset,r<0)return Bs(i.first,0,null,-1,-1);let n=Gr(i,r),o=i.first+i.size-1;if(n>o)return Bs(i.first+i.size-1,ee(i,o).text.length,null,1,1);t<0&&(t=0);let l=ee(i,n);for(;;){let s=XS(e,l,n,t,r),a=SS(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;let u=a.find(1);if(u.line==n)return u;l=ee(i,n=u.line)}}function Th(e,t,r,i){i-=Fa(t);let n=t.text.length,o=On(l=>tr(e,r,l-1).bottom<=i,n,0);return n=On(l=>tr(e,r,l).top>i,o,n),{begin:o,end:n}}function kh(e,t,r,i){r||(r=Yi(e,t));let n=El(e,t,tr(e,r,i),"line").top;return Th(e,t,r,n)}function Fs(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function XS(e,t,r,i,n){n-=hr(t);let o=Yi(e,t),l=Fa(t),s=0,a=t.text.length,u=!0,d=br(t,e.doc.direction);if(d){let R=(e.options.lineWrapping?YS:VS)(e,t,r,o,d,i,n);u=R.level!=1,s=u?R.from:R.to-1,a=u?R.to:R.from-1}let h=null,g=null,p=On(R=>{let A=tr(e,o,R);return A.top+=l,A.bottom+=l,Fs(A,i,n,!1)?(A.top<=n&&A.left<=i&&(h=R,g=A),!0):!1},s,a),m,C,T=!1;if(g){let R=i-g.left=R.bottom?1:0}return p=Vd(t.text,p,1),Bs(r,p,C,T,i-m)}function VS(e,t,r,i,n,o,l){let s=On(u=>{let d=n[u],h=d.level!=1;return Fs(Ot(e,F(r,h?d.to:d.from,h?"before":"after"),"line",t,i),o,l,!0)},0,n.length-1),a=n[s];if(s>0){let u=a.level!=1,d=Ot(e,F(r,u?a.from:a.to,u?"after":"before"),"line",t,i);Fs(d,o,l,!0)&&d.top>l&&(a=n[s-1])}return a}function YS(e,t,r,i,n,o,l){let{begin:s,end:a}=Th(e,t,i,l);/\s/.test(t.text.charAt(a-1))&&a--;let u=null,d=null;for(let h=0;h=a||g.to<=s)continue;let p=g.level!=1,m=tr(e,i,p?Math.min(a,g.to)-1:Math.max(s,g.from)).right,C=mC)&&(u=g,d=C)}return u||(u=n[n.length-1]),u.froma&&(u={from:u.from,to:a,level:u.level}),u}var Wr;function Ui(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Wr==null){Wr=ie("pre",null,"CodeMirror-line-like");for(let r=0;r<49;++r)Wr.appendChild(document.createTextNode("x")),Wr.appendChild(ie("br"));Wr.appendChild(document.createTextNode("x"))}bt(e.measure,Wr);let t=Wr.offsetHeight/50;return t>3&&(e.cachedTextHeight=t),Cr(e.measure),t||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;let t=ie("span","xxxxxxxxxx"),r=ie("pre",[t],"CodeMirror-line-like");bt(e.measure,r);let i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function Ha(e){let t=e.display,r={},i={},n=t.gutters.clientLeft;for(let o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){let s=e.display.gutterSpecs[l].className;r[s]=o.offsetLeft+o.clientLeft+n,i[s]=o.clientWidth}return{fixedPos:Ua(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ua(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ah(e){let t=Ui(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return n=>{if(kr(e.doc,n))return 0;let o=0;if(n.widgets)for(let l=0;l{let n=r(i);n!=i.height&&Zt(i,n)})}function ri(e,t,r,i){let n=e.display;if(!r&&Ea(t).getAttribute("cm-not-content")=="true")return null;let o,l,s=n.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch{return null}let a=Wa(e,o,l),u;if(i&&a.xRel>0&&(u=ee(e.doc,a.line).text).length==a.ch){let d=_t(u,u.length,e.options.tabSize)-u.length;a=F(a.line,Math.max(0,Math.round((o-yh(e.display).left)/Ji(e.display))-d))}return a}function ii(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;let r=e.display.view;for(let i=0;it)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)dr&&$a(e.doc,t)n.viewFrom?xr(e):(n.viewFrom+=i,n.viewTo+=i);else if(t<=n.viewFrom&&r>=n.viewTo)xr(e);else if(t<=n.viewFrom){let l=go(e,r,r+i,1);l?(n.view=n.view.slice(l.index),n.viewFrom=l.lineN,n.viewTo+=i):xr(e)}else if(r>=n.viewTo){let l=go(e,t,t,-1);l?(n.view=n.view.slice(0,l.index),n.viewTo=l.lineN):xr(e)}else{let l=go(e,t,t,-1),s=go(e,r,r+i,1);l&&s?(n.view=n.view.slice(0,l.index).concat(Co(e,l.lineN,s.lineN)).concat(n.view.slice(s.index)),n.viewTo+=i):xr(e)}let o=n.externalMeasured;o&&(r=n.lineN&&t=i.viewTo)return;let o=i.view[ii(e,t)];if(o.node==null)return;let l=o.changes||(o.changes=[]);Ze(l,r)==-1&&l.push(r)}function xr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function go(e,t,r,i){let n=ii(e,t),o,l=e.display.view;if(!dr||r==e.doc.first+e.doc.size)return{index:n,lineN:r};let s=e.display.viewFrom;for(let a=0;a0){if(n==l.length-1)return null;o=s+l[n].size-t,n++}else o=s-t;t+=o,r+=o}for(;$a(e.doc,r)!=r;){if(n==(i<0?0:l.length-1))return null;r+=i*l[n-(i<0?1:0)].size,n+=i}return{index:n,lineN:r}}function JS(e,t,r){let i=e.display;i.view.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=Co(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=Co(e,t,i.viewFrom).concat(i.view):i.viewFromr&&(i.view=i.view.slice(0,ii(e,r)))),i.viewTo=r}function Of(e){let t=e.display.view,r=0;for(let i=0;i=e.display.viewTo||s.to().line{let j=O=="ltr",D=U(ce,j?"left":"right"),oe=U(S-1,j?"right":"left"),se=C==null&&ce==0,fe=T==null&&S==A,be=v==0,Le=!le||v==le.length-1;if(oe.top-D.top<=3){let we=(u?se:fe)&&be,xe=(u?fe:se)&&Le,J=we?s:(j?D:oe).left,X=xe?a:(j?oe:D).right;d(J,D.top,X-J,D.bottom)}else{let we,xe,J,X;j?(we=u&&se&&be?s:D.left,xe=u?a:Z(ce,O,"before"),J=u?s:Z(S,O,"after"),X=u&&fe&&Le?a:oe.right):(we=u?Z(ce,O,"before"):s,xe=!u&&se&&be?a:D.right,J=!u&&fe&&Le?s:oe.left,X=u?Z(S,O,"after"):a),d(we,D.top,xe-we,D.bottom),D.bottom0?t.blinker=setInterval(()=>{e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Mh(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||qa(e))}function Ga(e){e.state.delayingBlurEvent=!0,setTimeout(()=>{e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zi(e))},100)}function qa(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,ui(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),it&&setTimeout(()=>e.display.input.reset(!0),20)),e.display.input.receivedFocus()),za(e))}function Zi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,ai(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(()=>{e.state.focused||(e.display.shift=!1)},150))}function Cl(e){let t=e.display,r=t.lineDiv.offsetTop;for(let i=0;i.005||a<-.005)&&(Zt(n.line,l),Df(n.line),n.rest))for(let u=0;ue.display.sizerWidth){let u=Math.ceil(s/Ji(e.display));u>e.display.maxLineLength&&(e.display.maxLineLength=u,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}function Df(e){if(e.widgets)for(let t=0;t=l&&(o=Gr(t,hr(ee(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function QS(e,t){if(ze(e,"scrollCursorIntoView"))return;let r=e.display,i=r.sizer.getBoundingClientRect(),n=null;if(t.top+i.top<0?n=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),n!=null&&!X1){let o=ie("div","​",null,`position: absolute; + top: ${t.top-r.viewOffset-_l(e.display)}px; + height: ${t.bottom-t.top+er(e)+r.barHeight}px; + left: ${t.left}px; width: ${Math.max(2,t.right-t.left)}px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}function e_(e,t,r,i){i==null&&(i=0);let n;!e.options.lineWrapping&&t==r&&(t=t.ch?F(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?F(t.line,t.ch+1,"before"):t);for(let o=0;o<5;o++){let l=!1,s=Ot(e,t),a=!r||r==t?s:Ot(e,r);n={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-i,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+i};let u=Ka(e,n),d=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(ro(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(l=!0)),u.scrollLeft!=null&&(ci(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return n}function t_(e,t){let r=Ka(e,t);r.scrollTop!=null&&ro(e,r.scrollTop),r.scrollLeft!=null&&ci(e,r.scrollLeft)}function Ka(e,t){let r=e.display,i=Ui(e.display);t.top<0&&(t.top=0);let n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,o=Pa(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);let s=e.doc.height+Da(r),a=t.tops-i;if(t.topn+o){let m=Math.min(t.top,(u?s:t.bottom)-o);m!=n&&(l.scrollTop=m)}let d=e.options.fixedGutter?0:r.gutters.offsetWidth,h=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-d,g=fi(e)-r.gutters.offsetWidth,p=t.right-t.left>g;return p&&(t.right=t.left+g),t.left<10?l.scrollLeft=0:t.leftg+h-3&&(l.scrollLeft=t.right+(p?0:10)-g),l}function Xa(e,t){t!=null&&(Tl(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Qi(e){Tl(e);let t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Sn(e,t,r){(t!=null||r!=null)&&Tl(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function r_(e,t){Tl(e),e.curOp.scrollToPos=t}function Tl(e){let t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;let r=If(e,t.from),i=If(e,t.to);Nh(e,r,i,t.margin)}}function Nh(e,t,r,i){let n=Ka(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});Sn(e,n.scrollLeft,n.scrollTop)}function ro(e,t){Math.abs(e.doc.scrollTop-t)<2||(cr||Ws(e,{top:t}),$h(e,t,!0),cr&&Ws(e),io(e,100))}function $h(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ci(e,t,r,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)&&(e.doc.scrollLeft=t,Bh(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function zn(e){let t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:i,scrollHeight:i+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var i_=class{constructor(e,t,r){this.cm=r;let i=this.vert=ie("div",[ie("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=ie("div",[ie("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1,e(i),e(n),ne(i,"scroll",()=>{i.clientHeight&&t(i.scrollTop,"vertical")}),ne(n,"scroll",()=>{n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ye&&De<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}update(e){let t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";let n=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";let n=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}}setScrollLeft(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}setScrollTop(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}zeroWidthHack(){let e=Ct&&!K1?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Hi,this.disableVert=new Hi}enableZeroWidthBar(e,t,r){e.style.pointerEvents="auto";function i(){let n=e.getBoundingClientRect();(r=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)}clear(){let e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},n_=class{update(){return{bottom:0,right:0}}setScrollLeft(){}setScrollTop(){}clear(){}};function ji(e,t){t||(t=zn(e));let r=e.display.barWidth,i=e.display.barHeight;Pf(e,t);for(let n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&Cl(e),Pf(e,zn(e)),r=e.display.barWidth,i=e.display.barHeight}function Pf(e,t){let r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Ih={native:i_,null:n_};function Oh(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ai(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ih[e.options.scrollbarStyle](t=>{e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ne(t,"mousedown",()=>{e.state.focused&&setTimeout(()=>e.display.input.focus(),0)}),t.setAttribute("cm-not-content","true")},(t,r)=>{r=="horizontal"?ci(e,t):ro(e,t)},e),e.display.scrollbars.addClass&&ui(e.display.wrapper,e.display.scrollbars.addClass)}var o_=0;function di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++o_},IS(e.curOp)}function hi(e){let t=e.curOp;t&&DS(t,r=>{for(let i=0;i=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Dh(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function a_(e){e.updatedDisplay=e.mustUpdate&&Va(e.cm,e.update)}function u_(e){let t=e.cm,r=t.display;e.updatedDisplay&&Cl(t),e.barMeasure=zn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=mh(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+er(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-fi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function f_(e){let t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;let r=+new Date+e.options.workTime,i=to(e,t.highlightFrontier),n=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),o=>{if(i.line>=e.display.viewFrom){let l=o.styles,s=o.text.length>e.options.maxHighlightLength?Yr(t.mode,i.state):null,a=rh(e,o,i,!0);s&&(i.state=s),o.styles=a.styles;let u=o.styleClasses,d=a.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);let h=!l||l.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass);for(let g=0;!h&&gr)return io(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),n.length&&dt(e,()=>{for(let o=0;o=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&Of(e)==0)return!1;Fh(e)&&(xr(e),t.dims=Ha(e));let n=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),l=Math.min(n,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(n,r.viewTo)),dr&&(o=$a(e.doc,o),l=fh(e.doc,l));let s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;JS(e,o,l),r.viewOffset=hr(ee(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";let a=Of(e);if(!s&&a==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;let u=p_(e);return a>4&&(r.lineDiv.style.display="none"),w_(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,g_(u),Cr(r.cursorDiv),Cr(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,io(e,400)),r.updateLineNumbers=null,!0}function Ph(e,t){let r=t.viewport;for(let i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==fi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Da(e.display)-Pa(e),r.top)}),t.visible=Uo(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Uo(e.display,e.doc,r));if(!Va(e,t))break;Cl(e);let n=zn(e);xn(e),ji(e,n),Ja(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ws(e,t){let r=new Dh(e,t);if(Va(e,r)){Cl(e),Ph(e,r);let i=zn(e);xn(e),ji(e,i),Ja(e,i),r.finish()}}function w_(e,t,r){let i=e.display,n=e.options.lineNumbers,o=i.lineDiv,l=o.firstChild;function s(d){let h=d.nextSibling;return it&&Ct&&e.display.currentWheelTarget==d?d.style.display="none":d.parentNode.removeChild(d),h}let a=i.view,u=i.viewFrom;for(let d=0;d-1&&(g=!1),hh(e,h,u,r)),g&&(Cr(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(La(e.options,u)))),l=h.node.nextSibling}u+=h.size}for(;l;)l=s(l)}function Ya(e){let t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ke(e,"gutterChanged",e)}function Ja(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+er(e)+"px"}function Bh(e){let t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;let i=Ua(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=i+"px";for(let l=0;ll.clientWidth,a=l.scrollHeight>l.clientHeight;if(i&&s||n&&a){if(n&&Ct&&it){e:for(let u=t.target,d=o.view;u!=l;u=u.parentNode)for(let h=0;h{if(o.wheelStartX==null)return;let u=l.scrollLeft-o.wheelStartX,d=l.scrollTop-o.wheelStartY,h=d&&o.wheelDY&&d/o.wheelDY||u&&o.wheelDX&&u/o.wheelDX;o.wheelStartX=o.wheelStartY=null,h&&(wt=(wt*yo+h)/(yo+1),++yo)},200)):(o.wheelDX+=i,o.wheelDY+=n))}}var Ir=class{constructor(e,t){this.ranges=e,this.primIndex=t}primary(){return this.ranges[this.primIndex]}equals(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(let t=0;t=0&&ue(e,i.to())<=0)return r}return-1}},Me=class{constructor(e,t){this.anchor=e,this.head=t}from(){return vl(this.anchor,this.head)}to(){return ml(this.anchor,this.head)}empty(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function Dt(e,t,r){let i=e&&e.options.selectionsMayTouch,n=t[r];t.sort((o,l)=>ue(o.from(),l.from())),r=Ze(t,n);for(let o=1;o0:a>=0){let u=vl(s.from(),l.from()),d=ml(s.to(),l.to()),h=s.empty()?l.from()==l.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new Me(h?d:u,h?u:d))}}return new Ir(t,r)}function Ar(e,t){return new Ir([new Me(e,t||e)],0)}function Lr(e){return e.text?F(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ff(e,t){if(ue(e,t.from)<0)return e;if(ue(e,t.to)<=0)return Lr(t);let r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Lr(t).ch-t.to.ch),F(r,i)}function Za(e,t){let r=[];for(let i=0;i{t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,io(e,100),e.state.modeGen++,e.curOp&&ut(e)}function Uh(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Qa(e,t,r,i){function n(C){return r?r[C]:null}function o(C,T,R){CS(C,T,R,i),Ke(C,"change",C,t)}function l(C,T){let R=[];for(let A=C;A1&&e.remove(s.line+1,m-1),e.insert(s.line+1,C)}Ke(e,"change",e,t)}function Er(e,t,r){function i(n,o,l){if(n.linked)for(let s=0;s{zh(e),ut(e)})}function To(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function js(e,t){let r={from:Is(t.from),to:Lr(t),text:Jr(e,t.from,t.to)};return Hf(e,r,t.from.line,t.to.line+1),Er(e,i=>Hf(i,r,t.from.line,t.to.line+1),!0),r}function Gh(e){for(;e.length&&Ce(e).ranges;)e.pop()}function x_(e,t){if(t)return Gh(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function qh(e,t,r,i){let n=e.history;n.undone.length=0;let o=+new Date,l,s;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=x_(n,n.lastOp==i)))s=Ce(l.changes),ue(t.from,t.to)==0&&ue(t.from,s.to)==0?s.to=Lr(t):l.changes.push(js(e,t));else{let a=Ce(n.done);for((!a||!a.ranges)&&jo(e.sel,n.done),l={changes:[js(e,t)],generation:n.generation},n.done.push(l);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,s||He(e,"historyAdded")}function S_(e,t,r,i){let n=t.charAt(0);return n=="*"||n=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function __(e,t,r,i){let n=e.history,o=i&&i.origin;r==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||S_(e,o,Ce(n.done),t))?n.done[n.done.length-1]=t:jo(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=r,i&&i.clearRedo!==!1&&Gh(n.undone)}function jo(e,t){let r=Ce(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Hf(e,t,r,i){let n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),l=>{l.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function E_(e){if(!e)return null;let t;for(let r=0;r-1&&(Ce(a)[n]=d[n],delete d[n])}}return i}function eu(e,t,r,i){if(i){let n=e.anchor;if(r){let o=ue(t,n)<0;o!=ue(r,n)<0?(n=t,t=r):o!=ue(t,r)<0&&(t=r)}return new Me(n,t)}else return new Me(r||t,t)}function kl(e,t,r,i,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Je(e,new Ir([eu(e.sel.primary(),t,r,n)],0),i)}function jf(e,t,r){let i=[],n=e.cm&&(e.cm.display.shift||e.extend);for(let l=0;l=t.ch:s.to>t.ch))){if(n&&(He(a,"beforeCursorEnter"),a.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!a.atomic)continue;if(r){let g=a.find(i<0?1:-1),p;if((i<0?d:u)&&(g=Gf(e,g,-i,g&&g.line==t.line?o:null)),g&&g.line==t.line&&(p=ue(g,r))&&(i<0?p<0:p>0))return Ei(e,g,t,i,n)}let h=a.find(i<0?-1:1);return(i<0?u:d)&&(h=Gf(e,h,i,h.line==t.line?o:null)),h?Ei(e,h,t,i,n):null}}return t}function zo(e,t,r,i,n){let o=i||1,l=Ei(e,t,r,o,n)||!n&&Ei(e,t,r,o,!0)||Ei(e,t,r,-o,n)||!n&&Ei(e,t,r,-o,!0);return l||(e.cantEdit=!0,F(e.first,0))}function Gf(e,t,r,i){return r<0&&t.ch==0?t.line>e.first?ae(e,F(t.line-1)):null:r>0&&t.ch==(i||ee(e,t.line)).text.length?t.linei.canceled=!0};return r&&(i.update=(n,o,l,s)=>{n&&(i.from=ae(e,n)),o&&(i.to=ae(e,o)),l&&(i.text=l),s!==void 0&&(i.origin=s)}),He(e,"beforeChange",e,i),e.cm&&He(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function zi(e,t,r){if(e.cm){if(!e.cm.curOp)return qe(e.cm,zi)(e,t,r);if(e.cm.state.suppressEdits)return}if((Tt(e,"beforeChange")||e.cm&&Tt(e.cm,"beforeChange"))&&(t=Zh(e,t,!0),!t))return;let i=oh&&!r&&xS(e,t.from,t.to);if(i)for(let n=i.length-1;n>=0;--n)qf(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else qf(e,t)}function qf(e,t){if(t.text.length==1&&t.text[0]==""&&ue(t.from,t.to)==0)return;let r=Za(e,t);qh(e,t,r,e.cm?e.cm.curOp.id:NaN),Gn(e,t,r,Os(e,t));let i=[];Er(e,(n,o)=>{!o&&Ze(i,n.history)==-1&&(Qh(n.history,t),i.push(n.history)),Gn(n,t,null,Os(n,t))})}function bo(e,t,r){let i=e.cm&&e.cm.state.suppressEdits;if(i&&!r)return;let n=e.history,o,l=e.sel,s=t=="undo"?n.done:n.undone,a=t=="undo"?n.undone:n.done,u=0;for(;u=0;--g){let p=o.changes[g];if(p.origin=t,h&&!Zh(e,p,!1)){s.length=0;return}d.push(js(e,p));let m=g?Za(e,p):Ce(s);Gn(e,p,m,Uf(e,p)),!g&&e.cm&&e.cm.scrollIntoView({from:p.from,to:Lr(p)});let C=[];Er(e,(T,R)=>{!R&&Ze(C,T.history)==-1&&(Qh(T.history,p),C.push(T.history)),Gn(T,p,null,Uf(T,p))})}}function Kf(e,t){if(t!=0&&(e.first+=t,e.sel=new Ir(yl(e.sel.ranges,r=>new Me(F(r.anchor.line+t,r.anchor.ch),F(r.head.line+t,r.head.ch))),e.sel.primIndex),e.cm)){ut(e.cm,e.first,e.first-t,t);for(let r=e.cm.display,i=r.viewFrom;ie.lastLine())return;if(t.from.linen&&(t={from:t.from,to:F(n,ee(e,n).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),r||(r=Za(e,t)),e.cm?k_(e.cm,t,i):Qa(e,t,i),Al(e,r,Jt),e.cantEdit&&zo(e,F(e.firstLine(),0))&&(e.cantEdit=!1)}function k_(e,t,r){let i=e.doc,n=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=Ae(Qt(ee(i,o.line))),i.iter(a,l.line+1,g=>{if(g==n.maxLine)return s=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Jd(e),Qa(i,t,r,Ah(e)),e.options.lineWrapping||(i.iter(a,o.line+t.text.length,g=>{let p=Ho(g);p>n.maxLineLength&&(n.maxLine=g,n.maxLineLength=p,n.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),pS(i,o.line),io(e,400);let u=t.text.length-(l.line-o.line)-1;t.full?ut(e):o.line==l.line&&t.text.length==1&&!Uh(e.doc,t)?$r(e,o.line,"text"):ut(e,o.line,l.line+1,u);let d=Tt(e,"changes"),h=Tt(e,"change");if(h||d){let g={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&Ke(e,"change",e,g),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(g)}e.display.selForContextMenu=null}function en(e,t,r,i,n){i||(i=r),ue(i,r)<0&&([r,i]=[i,r]),typeof t=="string"&&(t=e.splitLines(t)),zi(e,{from:r,to:i,text:t,origin:n})}function Xf(e,t,r,i){r1||!(this.children[0]instanceof _n))){let r=[];this.collapse(r),this.children=[new _n(r)],this.children[0].parent=this}},collapse(e){for(let t=0;t50){let l=n.lines.length%25+25;for(let s=l;s10);e.parent.maybeSpill()},iterN(e,t,r){for(let i=0;i{Yf(e,r,-n),$r(e,i,"widget")}),Ke(e,"lineWidgetCleared",e,this,i))}changed(){let e=this.height,t=this.doc.cm,r=this.line;this.height=null;let i=Un(this)-e;i&&(kr(this.doc,r)||Zt(r,r.height+i),t&&dt(t,()=>{t.curOp.forceUpdate=!0,Yf(t,r,i),Ke(t,"lineWidgetChanged",t,this,Ae(r))}))}};Vi(ru);function Yf(e,t,r){hr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Xa(e,r)}function A_(e,t,r,i){let n=new ru(e,r,i),o=e.cm;return o&&n.noHScroll&&(o.display.alignWidgets=!0),gn(e,t,"widget",l=>{let s=l.widgets||(l.widgets=[]);if(n.insertAt==null?s.push(n):s.splice(Math.min(s.length,Math.max(0,n.insertAt)),0,n),n.line=l,o&&!kr(e,l)){let a=hr(l)e.display.maxLineLength&&(e.display.maxLine=o,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ut(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vh(e.doc)),e&&Ke(e,"markerCleared",e,this,r,i),t&&hi(e),this.parent&&this.parent.clear()}find(e,t){e==null&&this.type=="bookmark"&&(e=1);let r,i;for(let n=0;n{let i=e.line,n=Ae(e.line),o=Ba(r,n);if(o&&(Sh(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!kr(t.doc,i)&&t.height!=null){let l=t.height;t.height=null;let s=Un(t)-l;s&&Zt(i,i.height+s)}Ke(r,"markerChanged",r,this)})}attachLine(e){if(!this.lines.length&&this.doc.cm){let t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ze(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)}detachLine(e){if(this.lines.splice(Ze(this.lines,e),1),!this.lines.length&&this.doc.cm){let t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}}};Vi(iu);function Gi(e,t,r,i,n){if(i&&i.shared)return L_(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return qe(e.cm,Gi)(e,t,r,i,n);let o=new iu(e,n),l=ue(t,r);if(i&&ti(i,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Mi("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Lf(e,t.line,t,r,o)||t.line!=r.line&&Lf(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");wS()}o.addToHistory&&qh(e,{from:t,to:r,origin:"markText"},e.sel,NaN);let s=t.line,a=e.cm,u;if(e.iter(s,r.line+1,d=>{a&&o.collapsed&&!a.options.lineWrapping&&Qt(d)==a.display.maxLine&&(u=!0),o.collapsed&&s!=t.line&&Zt(d,0),bS(d,new xl(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,d=>{kr(e,d)&&Zt(d,0)}),o.clearOnEnter&&ne(o,"beforeCursorEnter",()=>o.clear()),o.readOnly&&(gS(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ep,o.atomic=!0),a){if(u&&(a.curOp.updateMaxLine=!0),o.collapsed)ut(a,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(let d=t.line;d<=r.line;d++)$r(a,d,"text");o.atomic&&Vh(a.doc),Ke(a,"markerAdded",a,o)}return o}var nu=class{constructor(e,t){this.markers=e,this.primary=t;for(let r=0;r{s&&(i.widgetNode=s.cloneNode(!0)),o.push(Gi(a,ae(a,t),ae(a,r),i,n));for(let u=0;ut.parent)}function R_(e,t){for(let r=0;ri.push(n));for(let n=0;n=0;l--)zi(this,i[l]);o?Kh(this,o):this.cm&&Qi(this.cm)}),undo:je(function(){bo(this,"undo")}),redo:je(function(){bo(this,"redo")}),undoSelection:je(function(){bo(this,"undo",!0)}),redoSelection:je(function(){bo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){let e=this.history,t=0,r=0;for(let i=0;ie.history=this.history,!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:bi(this.history.done),undone:bi(this.history.undone)}},setHistory:function(e){let t=this.history=new To(this.history);t.done=bi(e.done.slice(0),null,!0),t.undone=bi(e.undone.slice(0),null,!0)},setGutterMarker:je(function(e,t,r){return gn(this,e,"gutter",i=>{let n=i.gutterMarkers||(i.gutterMarkers={});return n[t]=r,!r&&Sf(n)&&(i.gutterMarkers=null),!0})}),clearGutter:je(function(e){this.iter(t=>{t.gutterMarkers&&t.gutterMarkers[e]&&gn(this,t,"gutter",()=>(t.gutterMarkers[e]=null,Sf(t.gutterMarkers)&&(t.gutterMarkers=null),!0))})}),lineInfo:function(e){let t;if(typeof e=="number"){if(!Bn(this,e)||(t=e,e=ee(this,e),!e))return null}else if(t=Ae(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:je(function(e,t,r){return gn(this,e,t=="gutter"?"gutter":"class",i=>{let n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[n])i[n]=r;else{if(Wi(r).test(i[n]))return!1;i[n]+=" "+r}return!0})}),removeLineClass:je(function(e,t,r){return gn(this,e,t=="gutter"?"gutter":"class",i=>{let n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=i[n];if(o)if(r==null)i[n]=null;else{let l=o.match(Wi(r));if(!l)return!1;let s=l.index+l[0].length;i[n]=o.slice(0,l.index)+(!l.index||s==o.length?"":" ")+o.slice(s)||null}else return!1;return!0})}),addLineWidget:je(function(e,t,r){return A_(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Gi(this,ae(this,e),ae(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){let r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ae(this,e),Gi(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ae(this,e);let t=[],r=ee(this,e.line).markedSpans;if(r)for(let i=0;i=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=ae(this,e),t=ae(this,t);let i=[],n=e.line;return this.iter(e.line,t.line+1,o=>{let l=o.markedSpans;if(l)for(let s=0;s=a.to||a.from==null&&n!=e.line||a.from!=null&&n==t.line&&a.from>=t.ch)&&(!r||r(a.marker))&&i.push(a.marker.parent||a.marker)}++n}),i},getAllMarks:function(){let e=[];return this.iter(t=>{let r=t.markedSpans;if(r)for(let i=0;i{let o=n.text.length+i;if(o>e)return t=e,!0;e-=o,++r}),ae(this,F(r,t))},indexFromPos:function(e){e=ae(this,e);let t=e.ch;if(e.line{t+=i.text.length+r}),t},copy:function(e){let t=new sr(as(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});let t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.tot.push(r.id),!0),e.history=new To(null),e.history.done=bi(this.history.done,t),e.history.undone=bi(this.history.undone,t)}},iterLinkedDocs:function(e){Er(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ca(e)},lineSeparator:function(){return this.lineSep||` +`},setDirection:je(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(t=>t.order=null),this.cm&&v_(this.cm))})});sr.prototype.eachLine=sr.prototype.iter;var Zr=sr,tp=0;function $_(e){let t=this;if(rp(t),ze(t,e)||pr(t.display,e))return;at(e),ye&&(tp=+new Date);let r=ri(t,e,!0),i=e.dataTransfer.files;if(!(!r||t.isReadOnly()))if(i&&i.length&&window.FileReader&&window.File){let n=i.length,o=Array(n),l=0;const s=()=>{++l==n&&qe(t,()=>{r=ae(t.doc,r);let u={from:r,to:r,text:t.doc.splitLines(o.filter(d=>d!=null).join(t.doc.lineSeparator())),origin:"paste"};zi(t.doc,u),Kh(t.doc,Ar(ae(t.doc,r),ae(t.doc,Lr(u))))})()},a=(u,d)=>{if(t.options.allowDropFileTypes&&Ze(t.options.allowDropFileTypes,u.type)==-1){s();return}let h=new FileReader;h.onerror=()=>s(),h.onload=()=>{let g=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(g)){s();return}o[d]=g,s()},h.readAsText(u)};for(let u=0;u-1){t.state.draggingText(e),setTimeout(()=>t.display.input.focus(),20);return}try{let n=e.dataTransfer.getData("Text");if(n){let o;if(t.state.draggingText&&!t.state.draggingText.copy&&(o=t.listSelections()),Al(t.doc,Ar(r,r)),o)for(let l=0;l{for(let i=0;i{e==null&&(e=setTimeout(()=>{e=null,Zf(B_)},100))}),ne(window,"blur",()=>Zf(Zi))}function B_(e){let t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}var Rr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(let e=0;e<10;e++)Rr[e+48]=Rr[e+96]=String(e);for(let e=65;e<=90;e++)Rr[e]=String.fromCharCode(e);for(let e=1;e<=12;e++)Rr[e+111]=Rr[e+63235]="F"+e;var ar={};ar.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};ar.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};ar.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};ar.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};ar.default=Ct?ar.macDefault:ar.pcDefault;function F_(e){let t=e.split(/-(?!$)/);e=t[t.length-1];let r,i,n,o;for(let l=0;l{for(let n=i.length-1;n>=0;n--)en(e.doc,"",i[n].from,i[n].to,"+delete");Qi(e)})}function ou(e,t,r){let i=Vd(e.text,t+r,r);return i<0||i>e.text.length?null:i}function zs(e,t,r){let i=ou(e,t.ch,r);return i==null?null:new F(t.line,i,r<0?"after":"before")}function lu(e,t,r,i,n){if(e){t.doc.direction=="rtl"&&(n=-n);let o=br(r,t.doc.direction);if(o){let l=n<0?Ce(o):o[0],a=n<0==(l.level==1)?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){let d=Yi(t,r);u=n<0?r.text.length-1:0;let h=tr(t,d,u).top;u=On(g=>tr(t,d,g).top==h,n<0==(l.level==1)?l.from:l.to-1,u),a=="before"&&(u=ou(r,u,1))}else u=n<0?l.to:l.from;return new F(i,u,a)}}return new F(i,n<0?r.text.length:0,n<0?"before":"after")}function H_(e,t,r,i){let n=br(t,e.doc.direction);if(!n)return zs(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");let o=Dn(n,r.ch,r.sticky),l=n[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(i>0?l.to>r.ch:l.fromou(t,m instanceof F?m.ch:m,C),a,u=m=>e.options.lineWrapping?(a=a||Yi(e,t),kh(e,t,a,m)):{begin:0,end:t.text.length},d=u(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||l.level==1){let m=l.level==1==i<0,C=s(r,m?1:-1);if(C!=null&&(m?C<=l.to&&C<=d.end:C>=l.from&&C>=d.begin)){let T=m?"before":"after";return new F(r.line,C,T)}}let h=(m,C,T)=>{let R=(A,N)=>N?new F(r.line,s(A,1),"before"):new F(r.line,A,"after");for(;m>=0&&m0==(A.level!=1),H=N?T.begin:s(T.end,-1);if(A.from<=H&&H0?d.end:s(d.begin,-1);return p!=null&&!(i>0&&p==t.text.length)&&(g=h(i>0?0:n.length-1,i,u(p)),g)?g:null}var qn={selectAll:Jh,singleSelection:e=>e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Jt),killLine:e=>xi(e,t=>{if(t.empty()){let r=ee(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.linexi(e,t=>({from:F(t.from().line,0),to:ae(e.doc,F(t.to().line+1,0))})),delLineLeft:e=>xi(e,t=>({from:F(t.from().line,0),to:t.from()})),delWrappedLineLeft:e=>xi(e,t=>{let r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}),delWrappedLineRight:e=>xi(e,t=>{let r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}}),undo:e=>e.undo(),redo:e=>e.redo(),undoSelection:e=>e.undoSelection(),redoSelection:e=>e.redoSelection(),goDocStart:e=>e.extendSelection(F(e.firstLine(),0)),goDocEnd:e=>e.extendSelection(F(e.lastLine())),goLineStart:e=>e.extendSelectionsBy(t=>lp(e,t.head.line),{origin:"+move",bias:1}),goLineStartSmart:e=>e.extendSelectionsBy(t=>ec(e,t.head),{origin:"+move",bias:1}),goLineEnd:e=>e.extendSelectionsBy(t=>U_(e,t.head.line),{origin:"+move",bias:-1}),goLineRight:e=>e.extendSelectionsBy(t=>{let r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},bn),goLineLeft:e=>e.extendSelectionsBy(t=>{let r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},bn),goLineLeftSmart:e=>e.extendSelectionsBy(t=>{let r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.che.moveV(-1,"line"),goLineDown:e=>e.moveV(1,"line"),goPageUp:e=>e.moveV(-1,"page"),goPageDown:e=>e.moveV(1,"page"),goCharLeft:e=>e.moveH(-1,"char"),goCharRight:e=>e.moveH(1,"char"),goColumnLeft:e=>e.moveH(-1,"column"),goColumnRight:e=>e.moveH(1,"column"),goWordLeft:e=>e.moveH(-1,"word"),goGroupRight:e=>e.moveH(1,"group"),goGroupLeft:e=>e.moveH(-1,"group"),goWordRight:e=>e.moveH(1,"word"),delCharBefore:e=>e.deleteH(-1,"codepoint"),delCharAfter:e=>e.deleteH(1,"char"),delWordBefore:e=>e.deleteH(-1,"word"),delWordAfter:e=>e.deleteH(1,"word"),delGroupBefore:e=>e.deleteH(-1,"group"),delGroupAfter:e=>e.deleteH(1,"group"),indentAuto:e=>e.indentSelection("smart"),indentMore:e=>e.indentSelection("add"),indentLess:e=>e.indentSelection("subtract"),insertTab:e=>e.replaceSelection(" "),insertSoftTab:e=>{let t=[],r=e.listSelections(),i=e.options.tabSize;for(let n=0;n{e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:e=>dt(e,()=>{let t=e.listSelections(),r=[];for(let i=0;i0)n=new F(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),F(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){let l=ee(e.doc,n.line-1).text;l&&(n=new F(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),F(n.line-1,l.length-1),n,"+transpose"))}}r.push(new Me(n,n))}e.setSelections(r)}),newlineAndIndent:e=>dt(e,()=>{let t=e.listSelections();for(let r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(let r=0;re.replaceSelection(` +`,"start"),toggleOverwrite:e=>e.toggleOverwrite()};function lp(e,t){let r=ee(e.doc,t),i=Qt(r);return i!=r&&(t=Ae(i)),lu(!0,e,i,t,1)}function U_(e,t){let r=ee(e.doc,t),i=_S(r);return i!=r&&(t=Ae(i)),lu(!0,e,r,t,-1)}function ec(e,t){let r=lp(e,t.line),i=ee(e.doc,r.line),n=br(i,e.doc.direction);if(!n||n[0].level==0){let o=Math.max(r.ch,i.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return F(r.line,l?0:o,r.sticky)}return r}function ko(e,t,r){if(typeof t=="string"&&(t=qn[t],!t))return!1;e.display.input.ensurePolled();let i=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=wl}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}function j_(e,t,r){for(let i=0;i{e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),tc(e,n+" "+t,r,i))return!0}return tc(e,t,r,i)}function tc(e,t,r,i){let n=j_(e,t,i);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Ke(e,"keyHandled",e,t,r),(n=="handled"||n=="multi")&&(at(r),za(e)),!!n}function sp(e,t){let r=op(t,!0);return r?t.shiftKey&&!e.state.keySeq?Cn(e,"Shift-"+r,t,i=>ko(e,i,!0))||Cn(e,r,t,i=>{if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return ko(e,i)}):Cn(e,r,t,i=>ko(e,i)):!1}function G_(e,t,r){return Cn(e,"'"+r+"'",t,i=>ko(e,i,!0))}var Gs=null;function ap(e){let t=this;if(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=Et(),ze(t,e)))return;ye&&De<11&&e.keyCode==27&&(e.returnValue=!1);let r=e.keyCode;t.display.shift=r==16||e.shiftKey;let i=sp(t,e);Pt&&(Gs=i?r:null,!i&&r==88&&!lS&&(Ct?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),cr&&!Ct&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&q_(t)}function q_(e){let t=e.display.lineDiv;ui(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(ai(t,"CodeMirror-crosshair"),yt(document,"keyup",r),yt(document,"mouseover",r))}ne(document,"keyup",r),ne(document,"mouseover",r)}function up(e){e.keyCode==16&&(this.doc.sel.shift=!1),ze(this,e)}function fp(e){let t=this;if(e.target&&e.target!=t.display.input.getField()||pr(t.display,e)||ze(t,e)||e.ctrlKey&&!e.altKey||Ct&&e.metaKey)return;let r=e.keyCode,i=e.charCode;if(Pt&&r==Gs){Gs=null,at(e);return}if(Pt&&(!e.which||e.which<10)&&sp(t,e))return;let n=String.fromCharCode(i??r);n!="\b"&&(G_(t,e,n)||t.display.input.onKeyPress(e))}var K_=400,rc=class{constructor(e,t,r){this.time=e,this.pos=t,this.button=r}compare(e,t,r){return this.time+K_>e&&ue(t,this.pos)==0&&r==this.button}},an,un;function X_(e,t){let r=+new Date;return un&&un.compare(r,e,t)?(an=un=null,"triple"):an&&an.compare(r,e,t)?(un=new rc(r,e,t),an=null,"double"):(an=new rc(r,e,t),un=null,"single")}function cp(e){let t=this,r=t.display;if(ze(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,pr(r,e)){it||(r.scroller.draggable=!1,setTimeout(()=>r.scroller.draggable=!0,100));return}if(qs(t,e))return;let i=ri(t,e),n=Qd(e),o=i?X_(i,n):"single";window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&V_(t,n,i,o,e))&&(n==1?i?J_(t,i,o,e):Ea(e)==r.scroller&&at(e):n==2?(i&&kl(t.doc,i),setTimeout(()=>r.input.focus(),20)):n==3&&(va?t.display.input.onContextMenu(e):Ga(t)))}function V_(e,t,r,i,n){let o="Click";return i=="double"?o="Double"+o:i=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Cn(e,np(o,n),n,l=>{if(typeof l=="string"&&(l=qn[l]),!l)return!1;let s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=l(e,r)!=wl}finally{e.state.suppressEdits=!1}return s})}function Y_(e,t,r){let i=e.getOption("configureMouse"),n=i?i(e,t,r):{};if(n.unit==null){let o=V1?r.shiftKey&&r.metaKey:r.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||r.shiftKey),n.addNew==null&&(n.addNew=Ct?r.metaKey:r.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(Ct?r.altKey:r.ctrlKey)),n}function J_(e,t,r,i){ye?setTimeout(xa(Mh,e),0):e.curOp.focus=Et();let n=Y_(e,r,i),o=e.doc.sel,l;e.options.dragDrop&&rS&&!e.isReadOnly()&&r=="single"&&(l=o.contains(t))>-1&&(ue((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(ue(l.to(),t)>0||t.xRel<0)?Z_(e,i,t,n):Q_(e,i,t,n)}function Z_(e,t,r,i){let n=e.display,o=!1,l=qe(e,u=>{it&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ga(e)),yt(n.wrapper.ownerDocument,"mouseup",l),yt(n.wrapper.ownerDocument,"mousemove",s),yt(n.scroller,"dragstart",a),yt(n.scroller,"drop",l),o||(at(u),i.addNew||kl(e.doc,r,null,null,i.extend),it&&!pl||ye&&De==9?setTimeout(()=>{n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),s=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},a=()=>o=!0;it&&(n.scroller.draggable=!0),e.state.draggingText=l,l.copy=!i.moveOnDrag,ne(n.wrapper.ownerDocument,"mouseup",l),ne(n.wrapper.ownerDocument,"mousemove",s),ne(n.scroller,"dragstart",a),ne(n.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(()=>n.input.focus(),20),n.scroller.dragDrop&&n.scroller.dragDrop()}function ic(e,t,r){if(r=="char")return new Me(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Me(F(t.line,0),ae(e.doc,F(t.line+1,0)));let i=r(e,t);return new Me(i.from,i.to)}function Q_(e,t,r,i){ye&&Ga(e);let n=e.display,o=e.doc;at(t);let l,s,a=o.sel,u=a.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(r),s>-1?l=u[s]:l=new Me(r,r)):(l=o.sel.primary(),s=o.sel.primIndex),i.unit=="rectangle")i.addNew||(l=new Me(r,r)),r=ri(e,t,!0,!0),s=-1;else{let A=ic(e,r,i.unit);i.extend?l=eu(l,A.anchor,A.head,i.extend):l=A}i.addNew?s==-1?(s=u.length,Je(o,Dt(e,u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&i.unit=="char"&&!i.extend?(Je(o,Dt(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):tu(o,s,l,ns):(s=0,Je(o,new Ir([l],0),ns),a=o.sel);let d=r;function h(A){if(ue(d,A)!=0)if(d=A,i.unit=="rectangle"){let N=[],H=e.options.tabSize,U=_t(ee(o,r.line).text,r.ch,H),Z=_t(ee(o,A.line).text,A.ch,H),le=Math.min(U,Z),ce=Math.max(U,Z);for(let S=Math.min(r.line,A.line),O=Math.min(e.lastLine(),Math.max(r.line,A.line));S<=O;S++){let v=ee(o,S).text,j=Ls(v,le,H);le==ce?N.push(new Me(F(S,j),F(S,j))):v.length>j&&N.push(new Me(F(S,j),F(S,Ls(v,ce,H))))}N.length||N.push(new Me(r,r)),Je(o,Dt(e,a.ranges.slice(0,s).concat(N),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(A)}else{let N=l,H=ic(e,A,i.unit),U=N.anchor,Z;ue(H.anchor,U)>0?(Z=H.head,U=vl(N.from(),H.anchor)):(Z=H.anchor,U=ml(N.to(),H.head));let le=a.ranges.slice(0);le[s]=eE(e,new Me(ae(o,U),Z)),Je(o,Dt(e,le,s),ns)}}let g=n.wrapper.getBoundingClientRect(),p=0;function m(A){let N=++p,H=ri(e,A,!0,i.unit=="rectangle");if(H)if(ue(H,d)!=0){e.curOp.focus=Et(),h(H);let U=Uo(n,o);(H.line>=U.to||H.line{p==N&&m(A)}),150)}else{let U=A.clientYg.bottom?20:0;U&&setTimeout(qe(e,()=>{p==N&&(n.scroller.scrollTop+=U,m(A))}),50)}}function C(A){e.state.selectingText=!1,p=1/0,A&&(at(A),n.input.focus()),yt(n.wrapper.ownerDocument,"mousemove",T),yt(n.wrapper.ownerDocument,"mouseup",R),o.history.lastSelOrigin=null}let T=qe(e,A=>{A.buttons===0||!Qd(A)?C(A):m(A)}),R=qe(e,C);e.state.selectingText=R,ne(n.wrapper.ownerDocument,"mousemove",T),ne(n.wrapper.ownerDocument,"mouseup",R)}function eE(e,t){let{anchor:r,head:i}=t,n=ee(e.doc,r.line);if(ue(r,i)==0&&r.sticky==i.sticky)return t;let o=br(n);if(!o)return t;let l=Dn(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;let a=l+(s.from==r.ch==(s.level!=1)?0:1);if(a==0||a==o.length)return t;let u;if(i.line!=r.line)u=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{let m=Dn(o,i.ch,i.sticky),C=m-l||(i.ch-r.ch)*(s.level==1?-1:1);m==a-1||m==a?u=C<0:u=C>0}let d=o[a+(u?-1:0)],h=u==(d.level==1),g=h?d.from:d.to,p=h?"after":"before";return r.ch==g&&r.sticky==p?t:new Me(new F(r.line,g,p),i)}function dp(e,t,r,i){let n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&at(t);let l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Tt(e,r))return Ns(t);o-=s.top-l.viewOffset;for(let a=0;a=n){let d=Gr(e.doc,o),h=e.display.gutterSpecs[a];return He(e,r,e,d,h.className,t),Ns(t)}}}function qs(e,t){return dp(e,t,"gutterClick",!0)}function nc(e,t){pr(e.display,t)||tE(e,t)||ze(e,t,"contextmenu")||va||e.display.input.onContextMenu(t)}function tE(e,t){return Tt(e,"gutterContextMenu")?dp(e,t,"gutterContextMenu",!1):!1}function hp(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jn(e)}var Ci={toString:function(){return"CodeMirror.Init"}},pp={},Ao={};function rE(e){let t=e.optionHandlers;function r(i,n,o,l){e.defaults[i]=n,o&&(t[i]=l?(s,a,u)=>{u!=Ci&&o(s,a,u)}:o)}e.defineOption=r,e.Init=Ci,r("value","",(i,n)=>i.setValue(n),!0),r("mode",null,(i,n)=>{i.doc.modeOption=n,Us(i)},!0),r("indentUnit",2,Us,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,i=>{pn(i),jn(i),ut(i)},!0),r("lineSeparator",null,(i,n)=>{if(i.doc.lineSep=n,!n)return;let o=[],l=i.doc.first;i.doc.iter(s=>{for(let a=0;;){let u=s.text.indexOf(n,a);if(u==-1)break;a=u+n.length,o.push(F(l,u))}l++});for(let s=o.length-1;s>=0;s--)en(i.doc,n,o[s],F(o[s].line,o[s].ch+n.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(i,n,o)=>{i.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),o!=Ci&&i.refresh()}),r("specialCharPlaceholder",LS,i=>i.refresh(),!0),r("electricChars",!0),r("inputStyle",$n?"contenteditable":"textarea",()=>{throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,(i,n)=>i.getInputField().spellcheck=n,!0),r("autocorrect",!1,(i,n)=>i.getInputField().autocorrect=n,!0),r("autocapitalize",!1,(i,n)=>i.getInputField().autocapitalize=n,!0),r("rtlMoveVisually",!Y1),r("wholeLineUpdateBefore",!0),r("theme","default",i=>{hp(i),sn(i)},!0),r("keyMap","default",(i,n,o)=>{let l=Go(n),s=o!=Ci&&Go(o);s&&s.detach&&s.detach(i,l),l.attach&&l.attach(i,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,nE,!0),r("gutters",[],(i,n)=>{i.display.gutterSpecs=Hs(n,i.options.lineNumbers),sn(i)},!0),r("fixedGutter",!0,(i,n)=>{i.display.gutters.style.left=n?Ua(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,i=>ji(i),!0),r("scrollbarStyle","native",i=>{Oh(i),ji(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),r("lineNumbers",!1,(i,n)=>{i.display.gutterSpecs=Hs(i.options.gutters,n),sn(i)},!0),r("firstLineNumber",1,sn,!0),r("lineNumberFormatter",i=>i,sn,!0),r("showCursorWhenSelecting",!1,xn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(i,n)=>{n=="nocursor"&&(Zi(i),i.display.input.blur()),i.display.input.readOnlyChanged(n)}),r("screenReaderLabel",null,(i,n)=>{n=n===""?null:n,i.display.input.screenReaderLabelChanged(n)}),r("disableInput",!1,(i,n)=>{n||i.display.input.reset()},!0),r("dragDrop",!0,iE),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,xn,!0),r("singleCursorHeightPerLine",!0,xn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,pn,!0),r("addModeClass",!1,pn,!0),r("pollInterval",100),r("undoDepth",200,(i,n)=>i.doc.history.undoDepth=n),r("historyEventDelay",1250),r("viewportMargin",10,i=>i.refresh(),!0),r("maxHighlightLength",1e4,pn,!0),r("moveInputWithCursor",!0,(i,n)=>{n||i.display.input.resetPosition()}),r("tabindex",null,(i,n)=>i.display.input.getField().tabIndex=n||""),r("autofocus",null),r("direction","ltr",(i,n)=>i.doc.setDirection(n),!0),r("phrases",null)}function iE(e,t,r){let i=r&&r!=Ci;if(!t!=!i){let n=e.display.dragFunctions,o=t?ne:yt;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function nE(e){e.options.lineWrapping?(ui(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ai(e.display.wrapper,"CodeMirror-wrap"),Ia(e)),ja(e),ut(e),jn(e),setTimeout(()=>ji(e),100)}function Pe(e,t){if(!(this instanceof Pe))return new Pe(e,t);this.options=t=t?ti(t):{},ti(pp,t,!1);let r=t.value;typeof r=="string"?r=new Zr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;let i=new Pe.inputStyles[t.inputStyle](this),n=this.display=new y_(e,r,i,t);n.wrapper.CodeMirror=this,hp(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oh(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Hi,keySeq:null,specialChars:null},t.autofocus&&!$n&&n.input.focus(),ye&&De<11&&setTimeout(()=>this.display.input.reset(!0),20),lE(this),D_(),di(this),this.curOp.forceUpdate=!0,jh(this,r),t.autofocus&&!$n||this.hasFocus()?setTimeout(()=>{this.hasFocus()&&!this.state.focused&&qa(this)},20):Zi(this);for(let o in Ao)Ao.hasOwnProperty(o)&&Ao[o](this,t[o],Ci);Fh(this),t.finishInit&&t.finishInit(this);for(let o=0;o{if(ze(e,a))return;let u=ri(e,a);if(!u||qs(e,a)||pr(e.display,a))return;at(a);let d=e.findWordAt(u);kl(e.doc,d.anchor,d.head)})):ne(t.scroller,"dblclick",a=>ze(e,a)||at(a)),ne(t.scroller,"contextmenu",a=>nc(e,a)),ne(t.input.getField(),"contextmenu",a=>{t.scroller.contains(a.target)||nc(e,a)});let r,i={end:0};function n(){t.activeTouch&&(r=setTimeout(()=>t.activeTouch=null,1e3),i=t.activeTouch,i.end=+new Date)}function o(a){if(a.touches.length!=1)return!1;let u=a.touches[0];return u.radiusX<=1&&u.radiusY<=1}function l(a,u){if(u.left==null)return!0;let d=u.left-a.left,h=u.top-a.top;return d*d+h*h>20*20}ne(t.scroller,"touchstart",a=>{if(!ze(e,a)&&!o(a)&&!qs(e,a)){t.input.ensurePolled(),clearTimeout(r);let u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-i.end<=300?i:null},a.touches.length==1&&(t.activeTouch.left=a.touches[0].pageX,t.activeTouch.top=a.touches[0].pageY)}}),ne(t.scroller,"touchmove",()=>{t.activeTouch&&(t.activeTouch.moved=!0)}),ne(t.scroller,"touchend",a=>{let u=t.activeTouch;if(u&&!pr(t,a)&&u.left!=null&&!u.moved&&new Date-u.start<300){let d=e.coordsChar(t.activeTouch,"page"),h;!u.prev||l(u,u.prev)?h=new Me(d,d):!u.prev.prev||l(u,u.prev.prev)?h=e.findWordAt(d):h=new Me(F(d.line,0),ae(e.doc,F(d.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),at(a)}n()}),ne(t.scroller,"touchcancel",n),ne(t.scroller,"scroll",()=>{t.scroller.clientHeight&&(ro(e,t.scroller.scrollTop),ci(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),ne(t.scroller,"mousewheel",a=>Bf(e,a)),ne(t.scroller,"DOMMouseScroll",a=>Bf(e,a)),ne(t.wrapper,"scroll",()=>t.wrapper.scrollTop=t.wrapper.scrollLeft=0),t.dragFunctions={enter:a=>{ze(e,a)||Pn(a)},over:a=>{ze(e,a)||(O_(e,a),Pn(a))},start:a=>I_(e,a),drop:qe(e,$_),leave:a=>{ze(e,a)||rp(e)}};let s=t.input.getField();ne(s,"keyup",a=>up.call(e,a)),ne(s,"keydown",qe(e,ap)),ne(s,"keypress",qe(e,fp)),ne(s,"focus",a=>qa(e,a)),ne(s,"blur",a=>Zi(e,a))}var Ks=[];Pe.defineInitHook=e=>Ks.push(e);function Tn(e,t,r,i){let n=e.doc,o;r==null&&(r="add"),r=="smart"&&(n.mode.indent?o=to(e,t).state:r="prev");let l=e.options.tabSize,s=ee(n,t),a=_t(s.text,null,l);s.stateAfter&&(s.stateAfter=null);let u=s.text.match(/^\s*/)[0],d;if(!i&&!/\S/.test(s.text))d=0,r="not";else if(r=="smart"&&(d=n.mode.indent(o,s.text.slice(u.length),s.text),d==wl||d>150)){if(!i)return;r="prev"}r=="prev"?t>n.first?d=_t(ee(n,t-1).text,null,l):d=0:r=="add"?d=a+e.options.indentUnit:r=="subtract"?d=a-e.options.indentUnit:typeof r=="number"&&(d=a+r),d=Math.max(0,d);let h="",g=0;if(e.options.indentWithTabs)for(let p=Math.floor(d/l);p;--p)g+=l,h+=" ";if(gl,a=Ca(t),u=null;if(s&&i.ranges.length>1)if(It&&It.text.join(` +`)==t){if(i.ranges.length%It.text.length==0){u=[];for(let h=0;h[h]));let d=e.curOp.updateInput;for(let h=i.ranges.length-1;h>=0;h--){let g=i.ranges[h],p=g.from(),m=g.to();g.empty()&&(r&&r>0?p=F(p.line,p.ch-r):e.state.overwrite&&!s?m=F(m.line,Math.min(ee(o,m.line).text.length,m.ch+Ce(a).length)):s&&It&&It.lineWise&&It.text.join(` +`)==a.join(` +`)&&(p=m=F(p.line,0)));let C={from:p,to:m,text:u?u[h%u.length]:a,origin:n||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};zi(e.doc,C),Ke(e,"inputRead",e,C)}t&&!s&&wp(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function gp(e,t){let r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&dt(t,()=>su(t,r,0,null,"paste")),!0}function wp(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;let r=e.doc.sel;for(let i=r.ranges.length-1;i>=0;i--){let n=r.ranges[i];if(n.head.ch>100||i&&r.ranges[i-1].head.line==n.head.line)continue;let o=e.getModeAt(n.head),l=!1;if(o.electricChars){for(let s=0;s-1){l=Tn(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ee(e.doc,n.head.line).text.slice(0,n.head.ch))&&(l=Tn(e,n.head.line,"smart"));l&&Ke(e,"electricInput",e,n.head.line)}}function yp(e){let t=[],r=[];for(let i=0;il.priority),this.state.modeGen++,ut(this)}),removeOverlay:rt(function(i){let n=this.state.overlays;for(let o=0;oo&&(Tn(this,s.head.line,i,!0),o=s.head.line,l==this.doc.sel.primIndex&&Qi(this));else{let a=s.from(),u=s.to(),d=Math.max(o,a.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(let g=d;g0&&tu(this.doc,l,new Me(a,h[l].to()),Jt)}}}),getTokenAt:function(i,n){return Cf(this,i,n)},getLineTokens:function(i,n){return Cf(this,F(i),n,!0)},getTokenTypeAt:function(i){i=ae(this.doc,i);let n=ih(this,ee(this.doc,i.line)),o=0,l=(n.length-1)/2,s=i.ch,a;if(s==0)a=n[2];else for(;;){let d=o+l>>1;if((d?n[d*2-1]:0)>=s)l=d;else if(n[d*2+1]a&&(i=a,l=!0),s=ee(this.doc,i)}else s=i;return El(this,s,{top:0,left:0},n||"page",o||l).top+(l?this.doc.height-hr(s):0)},defaultTextHeight:function(){return Ui(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,n,o,l,s){let a=this.display;i=Ot(this,ae(this.doc,i));let u=i.bottom,d=i.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),a.sizer.appendChild(n),l=="over")u=i.top;else if(l=="above"||l=="near"){let h=Math.max(a.wrapper.clientHeight,this.doc.height),g=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(l=="above"||i.bottom+n.offsetHeight>h)&&i.top>n.offsetHeight?u=i.top-n.offsetHeight:i.bottom+n.offsetHeight<=h&&(u=i.bottom),d+n.offsetWidth>g&&(d=g-n.offsetWidth)}n.style.top=u+"px",n.style.left=n.style.right="",s=="right"?(d=a.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(s=="left"?d=0:s=="middle"&&(d=(a.sizer.clientWidth-n.offsetWidth)/2),n.style.left=d+"px"),o&&t_(this,{left:d,top:u,right:d+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:rt(ap),triggerOnKeyPress:rt(fp),triggerOnKeyUp:up,triggerOnMouseDown:rt(cp),execCommand:function(i){if(qn.hasOwnProperty(i))return qn[i].call(null,this)},triggerElectric:rt(function(i){wp(this,i)}),findPosH:function(i,n,o,l){let s=1;n<0&&(s=-1,n=-n);let a=ae(this.doc,i);for(let u=0;uthis.display.shift||this.doc.extend||o.empty()?us(this.doc,o.head,i,n,this.options.rtlMoveVisually):i<0?o.from():o.to(),bn)}),deleteH:rt(function(i,n){let o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):xi(this,s=>{let a=us(l,s.head,i,n,!1);return i<0?{from:a,to:s.head}:{from:s.head,to:a}})}),findPosV:function(i,n,o,l){let s=1,a=l;n<0&&(s=-1,n=-n);let u=ae(this.doc,i);for(let d=0;d{if(s)return i<0?a.from():a.to();let u=Ot(this,a.head,"div");a.goalColumn!=null&&(u.left=a.goalColumn),l.push(u.left);let d=oc(this,u,i,n);return n=="page"&&a==o.sel.primary()&&Xa(this,Ps(this,d,"div").top-u.top),d},bn),l.length)for(let a=0;aEo(h,a):/\s/.test(u)?h=>/\s/.test(h):h=>!/\s/.test(h)&&!Eo(h);for(;l>0&&d(o.charAt(l-1));)--l;for(;stypeof s=="number"||/^\d+$/.test(String(s))?s+"px":s;i!=null&&(this.display.wrapper.style.width=o(i)),n!=null&&(this.display.wrapper.style.height=o(n)),this.options.lineWrapping&&_h(this);let l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,s=>{if(s.widgets){for(let a=0;a.5||this.options.lineWrapping)&&ja(this),He(this,"refresh",this)}),swapDoc:rt(function(i){let n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),jh(this,i),jn(this),this.display.input.reset(),Sn(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Ke(this,"swapDoc",this,n),n}),phrase:function(i){let n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,i)?n[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Vi(e),e.registerHelper=function(i,n,o){r.hasOwnProperty(i)||(r[i]=e[i]={_global:[]}),r[i][n]=o},e.registerGlobalHelper=function(i,n,o,l){e.registerHelper(i,n,l),r[i]._global.push({pred:o,val:l})}}function us(e,t,r,i,n){let o=t,l=r,s=ee(e,t.line),a=n&&e.direction=="rtl"?-r:r;function u(){let g=t.line+a;return g=e.first+e.size?!1:(t=new F(g,t.ch,t.sticky),s=ee(e,g))}function d(g){let p;if(i=="codepoint"){let m=s.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(m))p=null;else{let C=r>0?m>=55296&&m<56320:m>=56320&&m<57343;p=new F(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(C?2:1))),-r)}}else n?p=H_(e.cm,s,t,r):p=zs(s,t,r);if(p==null)if(!g&&u())t=lu(n,e.cm,s,t.line,a);else return!1;else t=p;return!0}if(i=="char"||i=="codepoint")d();else if(i=="column")d(!0);else if(i=="word"||i=="group"){let g=null,p=i=="group",m=e.cm&&e.cm.getHelper(t,"wordChars");for(let C=!0;!(r<0&&!d(!C));C=!1){let T=s.text.charAt(t.ch)||` +`,R=Eo(T,m)?"w":p&&T==` +`?"n":!p||/\s/.test(T)?null:"p";if(p&&!C&&!R&&(R="s"),g&&g!=R){r<0&&(r=1,d(),t.sticky="after");break}if(R&&(g=R),r>0&&!d(!C))break}}let h=zo(e,t,o,l,!0);return $s(o,h)&&(h.hitSide=!0),h}function oc(e,t,r,i){let n=e.doc,o=t.left,l;if(i=="page"){let a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*Ui(e.display),3);l=(r>0?t.bottom:t.top)+r*u}else i=="line"&&(l=r>0?t.bottom+3:t.top-3);let s;for(;s=Wa(e,o,l),!!s.outside;){if(r<0?l<=0:l>=n.height){s.hitSide=!0;break}l+=r*5}return s}var vp=class{constructor(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Hi,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}init(e){let t=this,r=t.cm,i=t.div=e.lineDiv;i.contentEditable=!0,bp(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function n(l){for(let s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}ne(i,"paste",l=>{!n(l)||ze(r,l)||gp(l,r)||De<=11&&setTimeout(qe(r,()=>this.updateFromDOM()),20)}),ne(i,"compositionstart",l=>{this.composing={data:l.data,done:!1}}),ne(i,"compositionupdate",l=>{this.composing||(this.composing={data:l.data,done:!1})}),ne(i,"compositionend",l=>{this.composing&&(l.data!=this.composing.data&&this.readFromDOMSoon(),this.composing.done=!0)}),ne(i,"touchstart",()=>t.forceCompositionEnd()),ne(i,"input",()=>{this.composing||this.readFromDOMSoon()});function o(l){if(!n(l)||ze(r,l))return;if(r.somethingSelected())qo({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){let d=yp(r);qo({lineWise:!0,text:d.text}),l.type=="cut"&&r.operation(()=>{r.setSelections(d.ranges,0,Jt),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();let d=It.text.join(` +`);if(l.clipboardData.setData("Text",d),l.clipboardData.getData("Text")==d){l.preventDefault();return}}let s=mp(),a=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),a.value=It.text.join(` +`);let u=Et();In(a),setTimeout(()=>{r.display.lineSpace.removeChild(s),u.focus(),u==i&&t.showPrimarySelection()},50)}ne(i,"copy",o),ne(i,"cut",o)}screenReaderLabelChanged(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")}prepareSelection(){let e=Lh(this.cm,!1);return e.focus=Et()==this.div,e}showSelection(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))}getSelection(){return this.cm.display.wrapper.ownerDocument.getSelection()}showPrimarySelection(){let e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),n=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||n.line=t.display.viewFrom&&lc(t,i)||{node:s[0].measure.map[2],offset:0},u=n.line{this.gracePeriod=!1,this.selectionChanged()&&this.cm.operation(()=>this.cm.curOp.selectionChanged=!0)},20)}showMultipleSelections(e){bt(this.cm.display.cursorDiv,e.cursors),bt(this.cm.display.selectionDiv,e.selection)}rememberSelection(){let e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset}selectionInEditor(){let e=this.getSelection();if(!e.rangeCount)return!1;let t=e.getRangeAt(0).commonAncestorContainer;return Tr(this.div,t)}focus(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Et()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())}blur(){this.div.blur()}getField(){return this.div}supportsTouch(){return!0}receivedFocus(){let e=this;this.selectionInEditor()?this.pollSelection():dt(this.cm,()=>e.cm.curOp.selectionChanged=!0);function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)}selectionChanged(){let e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset}pollSelection(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;let e=this.getSelection(),t=this.cm;if(gl&&hl&&this.cm.display.gutterSpecs.length&&uE(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();let r=mo(t,e.anchorNode,e.anchorOffset),i=mo(t,e.focusNode,e.focusOffset);r&&i&&dt(t,()=>{Je(t.doc,Ar(r,i),Jt),(r.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}pollContent(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);let e=this.cm,t=e.display,r=e.doc.sel.primary(),i=r.from(),n=r.to();if(i.ch==0&&i.line>e.firstLine()&&(i=F(i.line-1,ee(e.doc,i.line-1).length)),n.ch==ee(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;let o,l,s;i.line==t.viewFrom||(o=ii(e,i.line))==0?(l=Ae(t.view[0].line),s=t.view[0].node):(l=Ae(t.view[o].line),s=t.view[o-1].node.nextSibling);let a=ii(e,n.line),u,d;if(a==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=Ae(t.view[a+1].line)-1,d=t.view[a+1].node.previousSibling),!s)return!1;let h=e.doc.splitLines(fE(e,s,d,l,u)),g=Jr(e.doc,F(l,0),F(u,ee(e.doc,u).text.length));for(;h.length>1&&g.length>1;)if(Ce(h)==Ce(g))h.pop(),g.pop(),u--;else if(h[0]==g[0])h.shift(),g.shift(),l++;else break;let p=0,m=0,C=h[0],T=g[0],R=Math.min(C.length,T.length);for(;pi.ch&&A.charCodeAt(A.length-m-1)==N.charCodeAt(N.length-m-1);)p--,m++;h[h.length-1]=A.slice(0,A.length-m).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");let U=F(l,p),Z=F(u,g.length?Ce(g).length-m:0);if(h.length>1||h[0]||ue(U,Z))return en(e.doc,h,U,Z,"+input"),!0}ensurePolled(){this.forceCompositionEnd()}reset(){this.forceCompositionEnd()}forceCompositionEnd(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())}readFromDOMSoon(){this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(()=>{if(this.readDOMTimeout=null,this.composing)if(this.composing.done)this.composing=null;else return;this.updateFromDOM()},80))}updateFromDOM(){(this.cm.isReadOnly()||!this.pollContent())&&dt(this.cm,()=>ut(this.cm))}setUneditable(e){e.contentEditable="false"}onKeyPress(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||qe(this.cm,su)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))}readOnlyChanged(e){this.div.contentEditable=String(e!="nocursor")}onContextMenu(){}resetPosition(){}},aE=vp;vp.prototype.needsContentAttribute=!0;function lc(e,t){let r=Ba(e,t.line);if(!r||r.hidden)return null;let i=ee(e.doc,t.line),n=bh(r,i,t.line),o=br(i,e.doc.direction),l="left";o&&(l=Dn(o,t.ch)%2?"right":"left");let s=xh(n.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function uE(e){for(let t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Si(e,t){return t&&(e.bad=!0),e}function fE(e,t,r,i,n){let o="",l=!1,s=e.doc.lineSeparator(),a=!1;function u(p){return m=>m.id==p}function d(){l&&(o+=s,a&&(o+=s),l=a=!1)}function h(p){p&&(d(),o+=p)}function g(p){if(p.nodeType==1){let m=p.getAttribute("cm-text");if(m){h(m);return}let C=p.getAttribute("cm-marker"),T;if(C){let A=e.findMarks(F(i,0),F(n+1,0),u(+C));A.length&&(T=A[0].find(0))&&h(Jr(e.doc,T.from,T.to).join(s));return}if(p.getAttribute("contenteditable")=="false")return;let R=/^(pre|div|p|li|table|br)$/i.test(p.nodeName);if(!/^br$/i.test(p.nodeName)&&p.textContent.length==0)return;R&&d();for(let A=0;A{ye&&De>=9&&this.hasSelection&&(this.hasSelection=null),t.poll()}),ne(i,"paste",o=>{ze(r,o)||gp(o,r)||(r.state.pasteIncoming=+new Date,t.fastPoll())});function n(o){if(!ze(r,o)){if(r.somethingSelected())qo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){let l=yp(r);qo({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,Jt):(t.prevInput="",i.value=l.text.join(` +`),In(i))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}ne(i,"cut",n),ne(i,"copy",n),ne(e.scroller,"paste",o=>{if(pr(e,o)||ze(r,o))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,t.focus();return}const l=new Event("paste");l.clipboardData=o.clipboardData,i.dispatchEvent(l)}),ne(e.lineSpace,"selectstart",o=>{pr(e,o)||at(o)}),ne(i,"compositionstart",()=>{let o=r.getCursor("from");t.composing&&t.composing.range.clear(),t.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ne(i,"compositionend",()=>{t.composing&&(t.poll(),t.composing.range.clear(),t.composing=null)})}createField(e){this.wrapper=mp(),this.textarea=this.wrapper.firstChild}screenReaderLabelChanged(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")}prepareSelection(){let e=this.cm,t=e.display,r=e.doc,i=Lh(e);if(e.options.moveInputWithCursor){let n=Ot(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+l.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+l.left-o.left))}return i}showSelection(e){let t=this.cm,r=t.display;bt(r.cursorDiv,e.cursors),bt(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")}reset(e){if(this.contextMenuPending||this.composing)return;let t=this.cm;if(t.somethingSelected()){this.prevInput="";let r=t.getSelection();this.textarea.value=r,t.state.focused&&In(this.textarea),ye&&De>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",ye&&De>=9&&(this.hasSelection=null))}getField(){return this.textarea}supportsTouch(){return!1}focus(){if(this.cm.options.readOnly!="nocursor"&&(!$n||Et()!=this.textarea))try{this.textarea.focus()}catch{}}blur(){this.textarea.blur()}resetPosition(){this.wrapper.style.top=this.wrapper.style.left=0}receivedFocus(){this.slowPoll()}slowPoll(){this.pollingFast||this.polling.set(this.cm.options.pollInterval,()=>{this.poll(),this.cm.state.focused&&this.slowPoll()})}fastPoll(){let e=!1,t=this;t.pollingFast=!0;function r(){!t.poll()&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)}poll(){let e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||oS(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;let i=t.value;if(i==r&&!e.somethingSelected())return!1;if(ye&&De>=9&&this.hasSelection===i||Ct&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){let l=i.charCodeAt(0);if(l==8203&&!r&&(r="​"),l==8666)return this.reset(),this.cm.execCommand("undo")}let n=0,o=Math.min(r.length,i.length);for(;n{su(e,i.slice(n),r.length-n,null,this.composing?"*compose":null),i.length>1e3||i.indexOf(` +`)>-1?t.value=this.prevInput="":this.prevInput=i,this.composing&&(this.composing.range.clear(),this.composing.range=e.markText(this.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0}ensurePolled(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)}onKeyPress(){ye&&De>=9&&(this.hasSelection=null),this.fastPoll()}onContextMenu(e){let t=this,r=t.cm,i=r.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();let o=ri(r,e),l=i.scroller.scrollTop;if(!o||Pt)return;r.options.resetSelectionOnContextMenu&&r.doc.sel.contains(o)==-1&&qe(r,Je)(r.doc,Ar(o),Jt);let a=n.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; + top: ${e.clientY-d.top-5}px; left: ${e.clientX-d.left-5}px; + z-index: 1000; background: ${ye?"rgba(255, 255, 255, .05)":"transparent"}; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;let h;it&&(h=window.scrollY),i.input.focus(),it&&window.scrollTo(null,h),i.input.reset(),r.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=p,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll);function g(){if(n.selectionStart!=null){let m=r.somethingSelected(),C="​"+(m?n.value:"");n.value="⇚",n.value=C,t.prevInput=m?"":"​",n.selectionStart=1,n.selectionEnd=C.length,i.selForContextMenu=r.doc.sel}}function p(){if(t.contextMenuPending==p&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=a,ye&&De<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),n.selectionStart!=null)){(!ye||ye&&De<9)&&g();let m=0,C=()=>{i.selForContextMenu==r.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"?qe(r,Jh)(r):m++<10?i.detectingSelectAll=setTimeout(C,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(C,200)}}if(ye&&De>=9&&g(),va){Pn(e);let m=()=>{yt(window,"mouseup",m),setTimeout(p,20)};ne(window,"mouseup",m)}else setTimeout(p,50)}readOnlyChanged(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e}setUneditable(){}},dE=xp;xp.prototype.needsContentAttribute=!1;function hE(e,t){if(t=t?ti(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){let o=Et();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function r(){e.value=n.getValue()}let i;if(e.form&&(ne(e.form,"submit",r),!t.leaveSubmitMethodAlone)){let o=e.form;i=o.submit;try{let l=o.submit=()=>{r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=o=>{o.save=r,o.getTextArea=()=>e,o.toTextArea=()=>{o.toTextArea=isNaN,r(),e.parentNode.removeChild(o.getWrapperElement()),e.style.display="",e.form&&(yt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";let n=Pe(o=>e.parentNode.insertBefore(o,e.nextSibling),t);return n}function pE(e){e.off=yt,e.on=ne,e.wheelEventPixels=b_,e.Doc=Zr,e.splitLines=Ca,e.countColumn=_t,e.findColumn=Ls,e.isWordChar=Rs,e.Pass=wl,e.signal=He,e.Line=Wn,e.changeEnd=Lr,e.scrollbarModel=Ih,e.Pos=F,e.cmpPos=ue,e.modes=Ta,e.mimeModes=_i,e.resolveMode=Po,e.getMode=ka,e.modeExtensions=Ni,e.extendMode=fS,e.copyState=Yr,e.startState=eh,e.innerMode=Aa,e.commands=qn,e.keyMap=ar,e.keyName=op,e.isModifierKey=ip,e.lookupKey=Ii,e.normalizeKeyMap=W_,e.StringStream=bl,e.SharedTextMarker=nu,e.TextMarker=iu,e.LineWidget=ru,e.e_preventDefault=at,e.e_stopPropagation=Zd,e.e_stop=Pn,e.addClass=ui,e.contains=Tr,e.rmClass=ai,e.keyNames=Rr}rE(Pe);sE(Pe);var gE="iter insert remove copy getEditor constructor".split(" ");for(let e in Zr.prototype)Zr.prototype.hasOwnProperty(e)&&Ze(gE,e)<0&&(Pe.prototype[e]=function(t){return function(){return t.apply(this.doc,arguments)}}(Zr.prototype[e]));Vi(Zr);Pe.inputStyles={textarea:dE,contenteditable:aE};Pe.defineMode=function(e){!Pe.defaults.mode&&e!="null"&&(Pe.defaults.mode=e),aS.apply(this,arguments)};Pe.defineMIME=uS;Pe.defineMode("null",()=>({token:e=>e.skipToEnd()}));Pe.defineMIME("text/plain","null");Pe.defineExtension=(e,t)=>{Pe.prototype[e]=t};Pe.defineDocExtension=(e,t)=>{Zr.prototype[e]=t};Pe.fromTextArea=hE;pE(Pe);Pe.version="5.61.0";var Lo=Pe;document.body.insertAdjacentHTML("beforeend",` + +`);self.CodeMirror=Lo;var Xs=class extends HTMLElement{static get observedAttributes(){return["src","readonly","mode","theme"]}attributeChangedCallback(e,t,r){this.__initialized&&t!==r&&(e==="readonly"?this[e]=r!==null:this[e]=r)}get readonly(){return this.editor.getOption("readOnly")}set readonly(e){this.editor.setOption("readOnly",e)}get mode(){return this.editor.getOption("mode")}set mode(e){this.editor.setOption("mode",e)}get theme(){return this.editor.getOption("theme")}set theme(e){this.editor.setOption("theme",e)}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e),this.setSrc()}get value(){return this.editor.getValue()}set value(e){this.setValue(e)}constructor(){super();const e=document.createElement("template");e.innerHTML=Xs.template(),this.appendChild(e.content.cloneNode(!0)),this.__initialized=!1,this.__element=null,this.editor=null}async connectedCallback(){this.style.display="block",this.__element=this.querySelector("textarea");const e=this.hasAttribute("mode")?this.getAttribute("mode"):"null",t=this.hasAttribute("theme")?this.getAttribute("theme"):"default";let r=this.getAttribute("readonly");r===""?r=!0:r!=="nocursor"&&(r=!1);let i="";const n=this.querySelector("script");n&&n.getAttribute("type")==="wc-content"&&(i=Xs.dedentText(n.innerHTML),i=i.replace(/<(\/?script)(.*?)>/g,"<$1$2>"));let o=Lo.defaults.viewportMargin;if(this.hasAttribute("viewport-margin")){const l=this.getAttribute("viewport-margin").toLowerCase();o=l==="infinity"?1/0:parseInt(l)}this.editor=Lo.fromTextArea(this.__element,{lineNumbers:!0,readOnly:r,mode:e,theme:t,viewportMargin:o}),this.hasAttribute("src")?this.setSrc(this.getAttribute("src")):(await new Promise(l=>setTimeout(l,50)),this.value=i),this.__initialized=!0}disconnectedCallback(){this.editor&&this.editor.toTextArea(),this.editor=null,this.__initialized=!1}async setSrc(){const e=this.getAttribute("src"),t=await this.fetchSrc(e);this.value=t}async setValue(e){this.editor.swapDoc(Lo.Doc(e,this.getAttribute("mode"))),this.editor.refresh()}async fetchSrc(e){return(await fetch(e)).text()}static template(){return` + + `}static dedentText(e){const t=e.split(` +`);t[0]===""&&t.splice(0,1);const r=t[0];let i=0;const o=r[0]===" "?" ":" ";for(;r[i]===o;)i+=1;const l=[];for(const s of t){let a=s;for(let u=0;ue?C():t!==!0&&(n=setTimeout(i?T:C,i===void 0?e-m:e))}return u.cancel=a,u}function wE(e,t,r){return r===void 0?sc(e,t,!1):sc(e,r,t!==!1)}const mr=Symbol("Initial value"),fs=Symbol("Editor dirty"),or=Symbol("ParseHandler");function yE(e){let i=0;return new Promise((n,o)=>{const l=setInterval(()=>{e()&&(clearInterval(l),n()),i+=1,i===100&&(clearInterval(l),o(new Error("Value did not become truthy in time")))},10)})}class bE extends ki{static get styles(){return uc` + :host { + display: block; + text-align: left; + } + + [part='error'] { + text-decoration: underline; + text-decoration-color: red; + text-decoration-style: wavy; + } + + wc-codemirror, + #wrapper { + width: 100%; + height: 100%; + } + + :host(:not([ready])) #wrapper { + display: none; + } + `}static get properties(){return{value:{type:String,noAccessor:!0},readonly:{type:Boolean,reflect:!0},prefixes:{type:String,attribute:"prefixes"},isParsing:{type:Boolean,attribute:"is-parsing",reflect:!0},autoParse:{type:Boolean,attribute:"auto-parse"},parseDelay:{type:Number},customPrefixes:{type:Object}}}constructor(){super(),this.parseDelay=250,this[mr]="",this.customPrefixes={},this.__style=document.createElement("link"),this.__style.rel="stylesheet",this.__style.href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.61.1/codemirror.min.css"}connectedCallback(){const t=new Promise(r=>{this.__style.onload=r});super.connectedCallback(),this.ready=Promise.resolve().then(async()=>{await t,await this.requestUpdate(),await yE(()=>this.codeMirror&&this.codeMirror.editor&&this.codeMirror.__initialized),await this._initializeCodeMirror(),[...this.renderRoot.querySelectorAll("[class^=CodeMirror]")].forEach(r=>{r.classList.forEach(i=>{i.match(/^CodeMirror/)&&r.setAttribute("part",i)})}),this.setAttribute("ready",""),this.codeMirror.editor.refresh(),this[mr]&&this.codeMirror.editor.setValue(this[mr])})}get _prefixes(){return async()=>{const t=await ht(()=>Promise.resolve().then(()=>Vs),void 0);return(this.prefixes||"").split(",").map(i=>i.trim()).reduce((i,n)=>n in t?{...i,[n]:t[n]().value}:i,{})}}get codeMirror(){return this.renderRoot.querySelector("wc-codemirror")}get value(){return this.hasAttribute("ready")?this.codeMirror.editor.getValue():this[mr]||""}set value(t){typeof t=="string"&&(this.hasAttribute("ready")?this.value!==t&&(this.codeMirror.editor.setValue(t),this[or]()):this[mr]=t)}async firstUpdated(t){super.firstUpdated(t),this[mr]&&(await this.ready,this.codeMirror.editor.setValue(this[mr]),this[or](),this[mr]=void 0)}updated(t){super.updated(t),(t.has("autoParse")||t.has("parseDelay"))&&this.__setParseHandler()}render(){return pc`${this.__style} +
+ + +
`}async parse(){if(!this.isParsing){this.__errorMarker&&this.__errorMarker.clear(),this.isParsing=!0;try{await this._parse()}catch(t){typeof this._errorLine=="function"&&await this.__highlightError(this._errorLine(t)),this.dispatchEvent(new CustomEvent("parsing-failed",{detail:{error:t}}))}finally{this.isParsing=!1}}}async _initializeCodeMirror(){this.codeMirror.editor.setSize("100%","100%"),this.__setParseHandler(),this.codeMirror.editor.on("change",()=>{this[fs]=!0})}__setParseHandler(){this.codeMirror.editor&&(this[or]&&(this.codeMirror.editor.off("blur",this[or]),this.codeMirror.editor.off("change",this[or])),this.autoParse?(this[or]=wE(this.parseDelay,this.__beginParse.bind(this)),this.codeMirror.editor.on("change",this[or])):(this[or]=this.__beginParse.bind(this),this.codeMirror.editor.on("blur",this[or])))}async __beginParse(){this[fs]&&await this.parse(),this[fs]=!1}async __highlightError(t){if(!this.ready)return;let r={line:0,ch:0},i={line:0,ch:Number.MAX_SAFE_INTEGER};t&&t.from&&(r=t.from,this.codeMirror.editor.scrollIntoView(r)),t&&t.to&&(i=t.to);const n=t?t.message:"";await this.ready,this.__errorMarker=this.codeMirror.editor.getDoc().markText(r,i,{attributes:{part:"error",title:n}})}async _combinePrefixes(){return Object.entries(this.customPrefixes).reduce((t,[r,i])=>!i||!r||typeof i!="string"||typeof r!="string"?t:{...t,[r]:i},await this._prefixes())}}window.CodeMirror.defineMode("javascript",function(e,t){var r=e.indentUnit,i=t.statementIndent,n=t.jsonld,o=t.json||n,l=t.typescript,s=t.wordCharacters||/[\w$\xa1-\uffff]/,a=function(){function w(st){return{type:st,style:"keyword"}}var _=w("keyword a"),P=w("keyword b"),z=w("keyword c"),de=w("keyword d"),ve=w("operator"),Oe={type:"atom",style:"atom"};return{if:w("if"),while:_,with:_,else:P,do:P,try:P,finally:P,return:de,break:de,continue:de,new:w("new"),delete:z,void:z,throw:z,debugger:w("debugger"),var:w("var"),const:w("var"),let:w("var"),function:w("function"),catch:w("catch"),for:w("for"),switch:w("switch"),case:w("case"),default:w("default"),in:ve,typeof:ve,instanceof:ve,true:Oe,false:Oe,null:Oe,undefined:Oe,NaN:Oe,Infinity:Oe,this:w("this"),class:w("class"),super:w("atom"),yield:z,export:w("export"),import:w("import"),extends:z,await:z}}(),u=/[+\-*&%=<>!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(w){for(var _=!1,P,z=!1;(P=w.next())!=null;){if(!_){if(P=="/"&&!z)return;P=="["?z=!0:z&&P=="]"&&(z=!1)}_=!_&&P=="\\"}}var g,p;function m(w,_,P){return g=w,p=P,_}function C(w,_){var P=w.next();if(P=='"'||P=="'")return _.tokenize=T(P),_.tokenize(w,_);if(P=="."&&w.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if(P=="."&&w.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(P))return m(P);if(P=="="&&w.eat(">"))return m("=>","operator");if(P=="0"&&w.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(P))return w.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if(P=="/")return w.eat("*")?(_.tokenize=R,R(w,_)):w.eat("/")?(w.skipToEnd(),m("comment","comment")):uu(w,_,1)?(h(w),w.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(w.eat("="),m("operator","operator",w.current()));if(P=="`")return _.tokenize=A,A(w,_);if(P=="#")return w.skipToEnd(),m("error","error");if(P=="<"&&w.match("!--")||P=="-"&&w.match("->"))return w.skipToEnd(),m("comment","comment");if(u.test(P))return(P!=">"||!_.lexical||_.lexical.type!=">")&&(w.eat("=")?(P=="!"||P=="=")&&w.eat("="):/[<>*+\-]/.test(P)&&(w.eat(P),P==">"&&w.eat(P))),m("operator","operator",w.current());if(s.test(P)){w.eatWhile(s);var z=w.current();if(_.lastType!="."){if(a.propertyIsEnumerable(z)){var de=a[z];return m(de.type,de.style,z)}if(z=="async"&&w.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",z)}return m("variable","variable",z)}}function T(w){return function(_,P){var z=!1,de;if(n&&_.peek()=="@"&&_.match(d))return P.tokenize=C,m("jsonld-keyword","meta");for(;(de=_.next())!=null&&!(de==w&&!z);)z=!z&&de=="\\";return z||(P.tokenize=C),m("string","string")}}function R(w,_){for(var P=!1,z;z=w.next();){if(z=="/"&&P){_.tokenize=C;break}P=z=="*"}return m("comment","comment")}function A(w,_){for(var P=!1,z;(z=w.next())!=null;){if(!P&&(z=="`"||z=="$"&&w.eat("{"))){_.tokenize=C;break}P=!P&&z=="\\"}return m("quasi","string-2",w.current())}var N="([{}])";function H(w,_){_.fatArrowAt&&(_.fatArrowAt=null);var P=w.string.indexOf("=>",w.start);if(!(P<0)){if(l){var z=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(w.string.slice(w.start,P));z&&(P=z.index)}for(var de=0,ve=!1,Oe=P-1;Oe>=0;--Oe){var st=w.string.charAt(Oe),jt=N.indexOf(st);if(jt>=0&&jt<3){if(!de){++Oe;break}if(--de==0){st=="("&&(ve=!0);break}}else if(jt>=3&&jt<6)++de;else if(s.test(st))ve=!0;else if(/["'\/`]/.test(st))for(;;--Oe){if(Oe==0)return;var Tp=w.string.charAt(Oe-1);if(Tp==st&&w.string.charAt(Oe-2)!="\\"){Oe--;break}}else if(ve&&!de){++Oe;break}}ve&&!de&&(_.fatArrowAt=Oe)}}var U={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function Z(w,_,P,z,de,ve){this.indented=w,this.column=_,this.type=P,this.prev=de,this.info=ve,z!=null&&(this.align=z)}function le(w,_){for(var P=w.localVars;P;P=P.next)if(P.name==_)return!0;for(var z=w.context;z;z=z.prev)for(var P=z.vars;P;P=P.next)if(P.name==_)return!0}function ce(w,_,P,z,de){var ve=w.cc;for(S.state=w,S.stream=de,S.marked=null,S.cc=ve,S.style=_,w.lexical.hasOwnProperty("align")||(w.lexical.align=!0);;){var Oe=ve.length?ve.pop():o?ge:Se;if(Oe(P,z)){for(;ve.length&&ve[ve.length-1].lex;)ve.pop()();return S.marked?S.marked:P=="variable"&&le(w,z)?"variable-2":_}}}var S={state:null,column:null,marked:null,cc:null};function O(){for(var w=arguments.length-1;w>=0;w--)S.cc.push(arguments[w])}function v(){return O.apply(null,arguments),!0}function j(w,_){for(var P=_;P;P=P.next)if(P.name==w)return!0;return!1}function D(w){var _=S.state;if(S.marked="def",_.context){if(_.lexical.info=="var"&&_.context&&_.context.block){var P=oe(w,_.context);if(P!=null){_.context=P;return}}else if(!j(w,_.localVars)){_.localVars=new be(w,_.localVars);return}}t.globalVars&&!j(w,_.globalVars)&&(_.globalVars=new be(w,_.globalVars))}function oe(w,_){if(_)if(_.block){var P=oe(w,_.prev);return P?P==_.prev?_:new fe(P,_.vars,!0):null}else return j(w,_.vars)?_:new fe(_.prev,new be(w,_.vars),!1);else return null}function se(w){return w=="public"||w=="private"||w=="protected"||w=="abstract"||w=="readonly"}function fe(w,_,P){this.prev=w,this.vars=_,this.block=P}function be(w,_){this.name=w,this.next=_}var Le=new be("this",new be("arguments",null));function we(){S.state.context=new fe(S.state.context,S.state.localVars,!1),S.state.localVars=Le}function xe(){S.state.context=new fe(S.state.context,S.state.localVars,!0),S.state.localVars=null}function J(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}J.lex=!0;function X(w,_){var P=function(){var z=S.state,de=z.indented;if(z.lexical.type=="stat")de=z.lexical.indented;else for(var ve=z.lexical;ve&&ve.type==")"&&ve.align;ve=ve.prev)de=ve.indented;z.lexical=new Z(de,S.stream.column(),w,null,z.lexical,_)};return P.lex=!0,P}function G(){var w=S.state;w.lexical.prev&&(w.lexical.type==")"&&(w.indented=w.lexical.indented),w.lexical=w.lexical.prev)}G.lex=!0;function re(w){function _(P){return P==w?v():w==";"||P=="}"||P==")"||P=="]"?O():v(_)}return _}function Se(w,_){return w=="var"?v(X("vardef",_),pi,re(";"),G):w=="keyword a"?v(X("form"),gt,Se,G):w=="keyword b"?v(X("form"),Se,G):w=="keyword d"?S.stream.match(/^\s*$/,!1)?v():v(X("stat"),Rt,re(";"),G):w=="debugger"?v(re(";")):w=="{"?v(X("}"),xe,f,G,J):w==";"?v():w=="if"?(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==G&&S.state.cc.pop()(),v(X("form"),gt,Se,G,b)):w=="function"?v(V):w=="for"?v(X("form"),E,Se,G):w=="class"||l&&_=="interface"?(S.marked="keyword",v(X("form",w=="class"?w:_),tn,G)):w=="variable"?l&&_=="declare"?(S.marked="keyword",v(Se)):l&&(_=="module"||_=="enum"||_=="type")&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword",_=="enum"?v(au):_=="type"?v(lt,re("operator"),I,re(";")):v(X("form"),ot,re("{"),X("}"),f,G,G)):l&&_=="namespace"?(S.marked="keyword",v(X("form"),ge,Se,G)):l&&_=="abstract"?(S.marked="keyword",v(Se)):v(X("stat"),tt):w=="switch"?v(X("form"),gt,re("{"),X("}","switch"),xe,f,G,G,J):w=="case"?v(ge,re(":")):w=="default"?v(re(":")):w=="catch"?v(X("form"),we,Lt,Se,G,J):w=="export"?v(X("stat"),rn,G):w=="import"?v(X("stat"),nn,G):w=="async"?v(Se):_=="@"?v(ge,Se):O(X("stat"),ge,re(";"),G)}function Lt(w){if(w=="(")return v(Wt,re(")"))}function ge(w,_){return ir(w,_,!1)}function Ne(w,_){return ir(w,_,!0)}function gt(w){return w!="("?O():v(X(")"),ge,re(")"),G)}function ir(w,_,P){if(S.state.fatArrowAt==S.stream.start){var z=P?Y:Q;if(w=="(")return v(we,X(")"),Fe(Wt,")"),G,re("=>"),z,J);if(w=="variable")return O(we,ot,re("=>"),z,J)}var de=P?L:et;return U.hasOwnProperty(w)?v(de):w=="function"?v(V,de):w=="class"||l&&_=="interface"?(S.marked="keyword",v(X("form"),nr,G)):w=="keyword c"||w=="async"?v(P?Ne:ge):w=="("?v(X(")"),Rt,re(")"),G,de):w=="operator"||w=="spread"?v(P?Ne:ge):w=="["?v(X("]"),_p,G,de):w=="{"?y(Ye,"}",null,de):w=="quasi"?O(M,de):w=="new"?v(Re(P)):w=="import"?v(ge):v()}function Rt(w){return w.match(/[;\}\)\],]/)?O():O(ge)}function et(w,_){return w==","?v(ge):L(w,_,!1)}function L(w,_,P){var z=P==!1?et:L,de=P==!1?ge:Ne;if(w=="=>")return v(we,P?Y:Q,J);if(w=="operator")return/\+\+|--/.test(_)||l&&_=="!"?v(z):l&&_=="<"&&S.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?v(X(">"),Fe(I,">"),G,z):_=="?"?v(ge,re(":"),de):v(de);if(w=="quasi")return O(M,z);if(w!=";"){if(w=="(")return y(Ne,")","call",z);if(w==".")return v(te,z);if(w=="[")return v(X("]"),Rt,re("]"),G,z);if(l&&_=="as")return S.marked="keyword",v(I,z);if(w=="regexp")return S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),v(de)}}function M(w,_){return w!="quasi"?O():_.slice(_.length-2)!="${"?v(M):v(ge,W)}function W(w){if(w=="}")return S.marked="string-2",S.state.tokenize=A,v(M)}function Q(w){return H(S.stream,S.state),O(w=="{"?Se:ge)}function Y(w){return H(S.stream,S.state),O(w=="{"?Se:Ne)}function Re(w){return function(_){return _=="."?v(w?Ee:Ie):_=="variable"&&l?v(_e,w?L:et):O(w?Ne:ge)}}function Ie(w,_){if(_=="target")return S.marked="keyword",v(et)}function Ee(w,_){if(_=="target")return S.marked="keyword",v(L)}function tt(w){return w==":"?v(G,Se):O(et,re(";"),G)}function te(w){if(w=="variable")return S.marked="property",v()}function Ye(w,_){if(w=="async")return S.marked="property",v(Ye);if(w=="variable"||S.style=="keyword"){if(S.marked="property",_=="get"||_=="set")return v(Or);var P;return l&&S.state.fatArrowAt==S.stream.start&&(P=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+P[0].length),v(Xe)}else{if(w=="number"||w=="string")return S.marked=n?"property":S.style+" property",v(Xe);if(w=="jsonld-keyword")return v(Xe);if(l&&se(_))return S.marked="keyword",v(Ye);if(w=="[")return v(ge,c,re("]"),Xe);if(w=="spread")return v(Ne,Xe);if(_=="*")return S.marked="keyword",v(Ye);if(w==":")return O(Xe)}}function Or(w){return w!="variable"?O(Xe):(S.marked="property",v(V))}function Xe(w){if(w==":")return v(Ne);if(w=="(")return O(V)}function Fe(w,_,P){function z(de,ve){if(P?P.indexOf(de)>-1:de==","){var Oe=S.state.lexical;return Oe.info=="call"&&(Oe.pos=(Oe.pos||0)+1),v(function(st,jt){return st==_||jt==_?O():O(w)},z)}return de==_||ve==_?v():P&&P.indexOf(";")>-1?O(w):v(re(_))}return function(de,ve){return de==_||ve==_?v():O(w,z)}}function y(w,_,P){for(var z=3;z"),I)}function pe(w){if(w=="=>")return v(I)}function Te(w,_){if(w=="variable"||S.style=="keyword")return S.marked="property",v(Te);if(_=="?"||w=="number"||w=="string")return v(Te);if(w==":")return v(I);if(w=="[")return v(re("variable"),x,re("]"),Te);if(w=="(")return O(Be,Te)}function ke(w,_){return w=="variable"&&S.stream.match(/^\s*[?:]/,!1)||_=="?"?v(ke):w==":"?v(I):w=="spread"?v(ke):O(I)}function me(w,_){if(_=="<")return v(X(">"),Fe(I,">"),G,me);if(_=="|"||w=="."||_=="&")return v(I);if(w=="[")return v(I,re("]"),me);if(_=="extends"||_=="implements")return S.marked="keyword",v(I);if(_=="?")return v(I,re(":"),I)}function _e(w,_){if(_=="<")return v(X(">"),Fe(I,">"),G,me)}function Dr(){return O(I,Ll)}function Ll(w,_){if(_=="=")return v(I)}function pi(w,_){return _=="enum"?(S.marked="keyword",v(au)):O(ot,c,vt,oo)}function ot(w,_){if(l&&se(_))return S.marked="keyword",v(ot);if(w=="variable")return D(_),v();if(w=="spread")return v(ot);if(w=="[")return y(Rl,"]");if(w=="{")return y(no,"}")}function no(w,_){return w=="variable"&&!S.stream.match(/^\s*:/,!1)?(D(_),v(vt)):(w=="variable"&&(S.marked="property"),w=="spread"?v(ot):w=="}"?O():w=="["?v(ge,re("]"),re(":"),no):v(re(":"),ot,vt))}function Rl(){return O(ot,vt)}function vt(w,_){if(_=="=")return v(Ne)}function oo(w){if(w==",")return v(pi)}function b(w,_){if(w=="keyword b"&&_=="else")return v(X("form","else"),Se,G)}function E(w,_){if(_=="await")return v(E);if(w=="(")return v(X(")"),K,G)}function K(w){return w=="var"?v(pi,q):w=="variable"?v(q):O(q)}function q(w,_){return w==")"?v():w==";"?v(q):_=="in"||_=="of"?(S.marked="keyword",v(ge,q)):O(ge,q)}function V(w,_){if(_=="*")return S.marked="keyword",v(V);if(w=="variable")return D(_),v(V);if(w=="(")return v(we,X(")"),Fe(Wt,")"),G,k,Se,J);if(l&&_=="<")return v(X(">"),Fe(Dr,">"),G,V)}function Be(w,_){if(_=="*")return S.marked="keyword",v(Be);if(w=="variable")return D(_),v(Be);if(w=="(")return v(we,X(")"),Fe(Wt,")"),G,k,J);if(l&&_=="<")return v(X(">"),Fe(Dr,">"),G,Be)}function lt(w,_){if(w=="keyword"||w=="variable")return S.marked="type",v(lt);if(_=="<")return v(X(">"),Fe(Dr,">"),G)}function Wt(w,_){return _=="@"&&v(ge,Wt),w=="spread"?v(Wt):l&&se(_)?(S.marked="keyword",v(Wt)):l&&w=="this"?v(c,vt):O(ot,c,vt)}function nr(w,_){return w=="variable"?tn(w,_):gi(w,_)}function tn(w,_){if(w=="variable")return D(_),v(gi)}function gi(w,_){if(_=="<")return v(X(">"),Fe(Dr,">"),G,gi);if(_=="extends"||_=="implements"||l&&w==",")return _=="implements"&&(S.marked="keyword"),v(l?I:ge,gi);if(w=="{")return v(X("}"),xt,G)}function xt(w,_){if(w=="async"||w=="variable"&&(_=="static"||_=="get"||_=="set"||l&&se(_))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return S.marked="keyword",v(xt);if(w=="variable"||S.style=="keyword")return S.marked="property",v(l?Pr:V,xt);if(w=="number"||w=="string")return v(l?Pr:V,xt);if(w=="[")return v(ge,c,re("]"),l?Pr:V,xt);if(_=="*")return S.marked="keyword",v(xt);if(l&&w=="(")return O(Be,xt);if(w==";"||w==",")return v(xt);if(w=="}")return v();if(_=="@")return v(ge,xt)}function Pr(w,_){if(_=="?")return v(Pr);if(w==":")return v(I,vt);if(_=="=")return v(Ne);var P=S.state.lexical.prev,z=P&&P.info=="interface";return O(z?Be:V)}function rn(w,_){return _=="*"?(S.marked="keyword",v(Ml,re(";"))):_=="default"?(S.marked="keyword",v(ge,re(";"))):w=="{"?v(Fe(wi,"}"),Ml,re(";")):O(Se)}function wi(w,_){if(_=="as")return S.marked="keyword",v(re("variable"));if(w=="variable")return O(Ne,wi)}function nn(w){return w=="string"?v():w=="("?O(ge):O(Ht,Ut,Ml)}function Ht(w,_){return w=="{"?y(Ht,"}"):(w=="variable"&&D(_),_=="*"&&(S.marked="keyword"),v(Mt))}function Ut(w){if(w==",")return v(Ht,Ut)}function Mt(w,_){if(_=="as")return S.marked="keyword",v(Ht)}function Ml(w,_){if(_=="from")return S.marked="keyword",v(ge)}function _p(w){return w=="]"?v():O(Fe(Ne,"]"))}function au(){return O(X("form"),ot,re("{"),X("}"),Fe(Ep,"}"),G,G)}function Ep(){return O(ot,vt)}function Cp(w,_){return w.lastType=="operator"||w.lastType==","||u.test(_.charAt(0))||/[,.]/.test(_.charAt(0))}function uu(w,_,P){return _.tokenize==C&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(_.lastType)||_.lastType=="quasi"&&/\{\s*$/.test(w.string.slice(0,w.pos-(P||0)))}return{startState:function(w){var _={tokenize:C,lastType:"sof",cc:[],lexical:new Z((w||0)-r,0,"block",!1),localVars:t.localVars,context:t.localVars&&new fe(null,null,!1),indented:w||0};return t.globalVars&&typeof t.globalVars=="object"&&(_.globalVars=t.globalVars),_},token:function(w,_){if(w.sol()&&(_.lexical.hasOwnProperty("align")||(_.lexical.align=!1),_.indented=w.indentation(),H(w,_)),_.tokenize!=R&&w.eatSpace())return null;var P=_.tokenize(w,_);return g=="comment"?P:(_.lastType=g=="operator"&&(p=="++"||p=="--")?"incdec":g,ce(_,P,g,p,w))},indent:function(w,_){if(w.tokenize==R)return CodeMirror.Pass;if(w.tokenize!=C)return 0;var P=_&&_.charAt(0),z=w.lexical,de;if(!/^\s*else\b/.test(_))for(var ve=w.cc.length-1;ve>=0;--ve){var Oe=w.cc[ve];if(Oe==G)z=z.prev;else if(Oe!=b)break}for(;(z.type=="stat"||z.type=="form")&&(P=="}"||(de=w.cc[w.cc.length-1])&&(de==et||de==L)&&!/^[,\.=+\-*:?[\(]/.test(_));)z=z.prev;i&&z.type==")"&&z.prev.type=="stat"&&(z=z.prev);var st=z.type,jt=P==st;return st=="vardef"?z.indented+(w.lastType=="operator"||w.lastType==","?z.info.length+1:0):st=="form"&&P=="{"?z.indented:st=="form"?z.indented+r:st=="stat"?z.indented+(Cp(w,_)?i||r:0):z.info=="switch"&&!jt&&t.doubleIndentSwitch!=!1?z.indented+(/^(?:case|default)\b/.test(_)?r:2*r):z.align?z.column+(jt?0:1):z.indented+(jt?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:"/*",blockCommentEnd:o?null:"*/",blockCommentContinue:o?null:" * ",lineComment:o?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:o?"json":"javascript",jsonldMode:n,jsonMode:o,expressionAllowed:uu,skipExpression:function(w){var _=w.cc[w.cc.length-1];(_==ge||_==Ne)&&w.cc.pop()}}});CodeMirror.registerHelper("wordChars","javascript",/[\w$]/);CodeMirror.defineMIME("text/javascript","javascript");CodeMirror.defineMIME("text/ecmascript","javascript");CodeMirror.defineMIME("application/javascript","javascript");CodeMirror.defineMIME("application/x-javascript","javascript");CodeMirror.defineMIME("application/ecmascript","javascript");CodeMirror.defineMIME("application/json",{name:"javascript",json:!0});CodeMirror.defineMIME("application/x-json",{name:"javascript",json:!0});CodeMirror.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0});CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0});window.CodeMirror.defineMode("turtle",function(e){var t=e.indentUnit,r;function i(d){return new RegExp("^(?:"+d.join("|")+")$","i")}i([]);var n=i(["@prefix","@base","a"]),o=/[*+\-<>=&|]/;function l(d,h){var g=d.next();if(r=null,g=="<"&&!d.match(/^[\s\u00a0=]/,!1))return d.match(/^[^\s\u00a0>]*>?/),"atom";if(g=='"'||g=="'")return h.tokenize=s(g),h.tokenize(d,h);if(/[{}\(\),\.;\[\]]/.test(g))return r=g,null;if(g=="#")return d.skipToEnd(),"comment";if(o.test(g))return d.eatWhile(o),null;if(g==":")return"operator";if(d.eatWhile(/[_\w\d]/),d.peek()==":")return"variable-3";var p=d.current();return n.test(p)?"meta":g>="A"&&g<="Z"?"comment":"keyword";var p=d.current()}function s(d){return function(h,g){for(var p=!1,m;(m=h.next())!=null;){if(m==d&&!p){g.tokenize=l;break}p=!p&&m=="\\"}return"string"}}function a(d,h,g){d.context={prev:d.context,indent:d.indent,col:g,type:h}}function u(d){d.indent=d.context.indent,d.context=d.context.prev}return{startState:function(){return{tokenize:l,context:null,indent:0,col:0}},token:function(d,h){if(d.sol()&&(h.context&&h.context.align==null&&(h.context.align=!1),h.indent=d.indentation()),d.eatSpace())return null;var g=h.tokenize(d,h);if(g!="comment"&&h.context&&h.context.align==null&&h.context.type!="pattern"&&(h.context.align=!0),r=="(")a(h,")",d.column());else if(r=="[")a(h,"]",d.column());else if(r=="{")a(h,"}",d.column());else if(/[\]\}\)]/.test(r)){for(;h.context&&h.context.type=="pattern";)u(h);h.context&&r==h.context.type&&u(h)}else r=="."&&h.context&&h.context.type=="pattern"?u(h):/atom|string|variable/.test(g)&&h.context&&(/[\}\]]/.test(h.context.type)?a(h,"pattern",d.column()):h.context.type=="pattern"&&!h.context.align&&(h.context.align=!0,h.context.col=d.column()));return g},indent:function(d,h){var g=h&&h.charAt(0),p=d.context;if(/[\]\}]/.test(g))for(;p&&p.type=="pattern";)p=p.prev;var m=p&&g==p.type;return p?p.type=="pattern"?p.col:p.align?p.col+(m?0:1):p.indent+(m?0:t):0},lineComment:"#"}});CodeMirror.defineMIME("text/turtle","turtle");CodeMirror.defineMIME("text/n3","turtle");CodeMirror.defineMIME("application/trig","turtle");window.CodeMirror.defineMode("ntriples",function(){var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};function t(r,i){var n=r.location,o;n==e.PRE_SUBJECT&&i=="<"?o=e.WRITING_SUB_URI:n==e.PRE_SUBJECT&&i=="_"?o=e.WRITING_BNODE_URI:n==e.PRE_PRED&&i=="<"?o=e.WRITING_PRED_URI:n==e.PRE_OBJ&&i=="<"?o=e.WRITING_OBJ_URI:n==e.PRE_OBJ&&i=="_"?o=e.WRITING_OBJ_BNODE:n==e.PRE_OBJ&&i=='"'?o=e.WRITING_OBJ_LITERAL:n==e.WRITING_SUB_URI&&i==">"||n==e.WRITING_BNODE_URI&&i==" "?o=e.PRE_PRED:n==e.WRITING_PRED_URI&&i==">"?o=e.PRE_OBJ:n==e.WRITING_OBJ_URI&&i==">"||n==e.WRITING_OBJ_BNODE&&i==" "||n==e.WRITING_OBJ_LITERAL&&i=='"'||n==e.WRITING_LIT_LANG&&i==" "||n==e.WRITING_LIT_TYPE&&i==">"?o=e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&i=="@"?o=e.WRITING_LIT_LANG:n==e.WRITING_OBJ_LITERAL&&i=="^"?o=e.WRITING_LIT_TYPE:i==" "&&(n==e.PRE_SUBJECT||n==e.PRE_PRED||n==e.PRE_OBJ||n==e.POST_OBJ)?o=n:n==e.POST_OBJ&&i=="."?o=e.PRE_SUBJECT:o=e.ERROR,r.location=o}return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(r,i){var n=r.next();if(n=="<"){t(i,n);var o="";return r.eatWhile(function(d){return d!="#"&&d!=">"?(o+=d,!0):!1}),i.uris.push(o),r.match("#",!1)||(r.next(),t(i,">")),"variable"}if(n=="#"){var l="";return r.eatWhile(function(d){return d!=">"&&d!=" "?(l+=d,!0):!1}),i.anchors.push(l),"variable-2"}if(n==">")return t(i,">"),"variable";if(n=="_"){t(i,n);var s="";return r.eatWhile(function(d){return d!=" "?(s+=d,!0):!1}),i.bnodes.push(s),r.next(),t(i," "),"builtin"}if(n=='"')return t(i,n),r.eatWhile(function(d){return d!='"'}),r.next(),r.peek()!="@"&&r.peek()!="^"&&t(i,'"'),"string";if(n=="@"){t(i,"@");var a="";return r.eatWhile(function(d){return d!=" "?(a+=d,!0):!1}),i.langs.push(a),r.next(),t(i," "),"string-2"}if(n=="^"){r.next(),t(i,"^");var u="";return r.eatWhile(function(d){return d!=">"?(u+=d,!0):!1}),i.types.push(u),r.next(),t(i,">"),"variable"}n==" "&&t(i,n),n=="."&&t(i,n)}}});CodeMirror.defineMIME("application/n-triples","ntriples");CodeMirror.defineMIME("application/n-quads","ntriples");CodeMirror.defineMIME("text/n-triples","ntriples");var mE={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},vE={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};window.CodeMirror.defineMode("xml",function(e,t){var r=e.indentUnit,i={},n=t.htmlMode?mE:vE;for(var o in n)i[o]=n[o];for(var o in t)i[o]=t[o];var l,s;function a(S,O){function v(oe){return O.tokenize=oe,oe(S,O)}var j=S.next();if(j=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?v(h("atom","]]>")):null:S.match("--")?v(h("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),v(g(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),O.tokenize=h("meta","?>"),"meta"):(l=S.eat("/")?"closeTag":"openTag",O.tokenize=u,"tag bracket");if(j=="&"){var D;return S.eat("#")?S.eat("x")?D=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):D=S.eatWhile(/[\d]/)&&S.eat(";"):D=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),D?"atom":"error"}else return S.eatWhile(/[^&<]/),null}a.isInText=!0;function u(S,O){var v=S.next();if(v==">"||v=="/"&&S.eat(">"))return O.tokenize=a,l=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return l="equals",null;if(v=="<"){O.tokenize=a,O.state=T,O.tagName=O.tagStart=null;var j=O.tokenize(S,O);return j?j+" tag error":"tag error"}else return/[\'\"]/.test(v)?(O.tokenize=d(v),O.stringStartCol=S.column(),O.tokenize(S,O)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(S){var O=function(v,j){for(;!v.eol();)if(v.next()==S){j.tokenize=u;break}return"string"};return O.isInAttribute=!0,O}function h(S,O){return function(v,j){for(;!v.eol();){if(v.match(O)){j.tokenize=a;break}v.next()}return S}}function g(S){return function(O,v){for(var j;(j=O.next())!=null;){if(j=="<")return v.tokenize=g(S+1),v.tokenize(O,v);if(j==">")if(S==1){v.tokenize=a;break}else return v.tokenize=g(S-1),v.tokenize(O,v)}return"meta"}}function p(S,O,v){this.prev=S.context,this.tagName=O,this.indent=S.indented,this.startOfLine=v,(i.doNotIndent.hasOwnProperty(O)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function m(S){S.context&&(S.context=S.context.prev)}function C(S,O){for(var v;;){if(!S.context||(v=S.context.tagName,!i.contextGrabbers.hasOwnProperty(v)||!i.contextGrabbers[v].hasOwnProperty(O)))return;m(S)}}function T(S,O,v){return S=="openTag"?(v.tagStart=O.column(),R):S=="closeTag"?A:T}function R(S,O,v){return S=="word"?(v.tagName=O.current(),s="tag",U):i.allowMissingTagName&&S=="endTag"?(s="tag bracket",U(S,O,v)):(s="error",R)}function A(S,O,v){if(S=="word"){var j=O.current();return v.context&&v.context.tagName!=j&&i.implicitlyClosed.hasOwnProperty(v.context.tagName)&&m(v),v.context&&v.context.tagName==j||i.matchClosing===!1?(s="tag",N):(s="tag error",H)}else return i.allowMissingTagName&&S=="endTag"?(s="tag bracket",N(S,O,v)):(s="error",H)}function N(S,O,v){return S!="endTag"?(s="error",N):(m(v),T)}function H(S,O,v){return s="error",N(S,O,v)}function U(S,O,v){if(S=="word")return s="attribute",Z;if(S=="endTag"||S=="selfcloseTag"){var j=v.tagName,D=v.tagStart;return v.tagName=v.tagStart=null,S=="selfcloseTag"||i.autoSelfClosers.hasOwnProperty(j)?C(v,j):(C(v,j),v.context=new p(v,j,D==v.indented)),T}return s="error",U}function Z(S,O,v){return S=="equals"?le:(i.allowMissing||(s="error"),U(S,O,v))}function le(S,O,v){return S=="string"?ce:S=="word"&&i.allowUnquoted?(s="string",U):(s="error",U(S,O,v))}function ce(S,O,v){return S=="string"?ce:U(S,O,v)}return{startState:function(S){var O={tokenize:a,state:T,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(O.baseIndent=S),O},token:function(S,O){if(!O.tagName&&S.sol()&&(O.indented=S.indentation()),S.eatSpace())return null;l=null;var v=O.tokenize(S,O);return(v||l)&&v!="comment"&&(s=null,O.state=O.state(l||v,S,O),s&&(v=s=="error"?v+" error":s)),v},indent:function(S,O,v){var j=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+r;if(j&&j.noIndent)return CodeMirror.Pass;if(S.tokenize!=u&&S.tokenize!=a)return v?v.match(/^(\s*)/)[0].length:0;if(S.tagName)return i.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+r*(i.multilineTagIndentFactor||1);if(i.alignCDATA&&/$/,blockCommentStart:"",configuration:i.htmlMode?"html":"xml",helperType:i.htmlMode?"html":"xml",skipAttribute:function(S){S.state==le&&(S.state=U)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var O=[],v=S.context;v;v=v.prev)v.tagName&&O.push(v.tagName);return O.reverse()}}});CodeMirror.defineMIME("text/xml","xml");CodeMirror.defineMIME("application/xml","xml");CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0});const vo=Symbol("parsed quads");class xE extends bE{static get properties(){return{format:{type:String,reflect:!0},quads:{type:Array},noReserialize:{type:Boolean,attribute:"no-reserialize"}}}constructor(){super(),this.isParsing=!1,this.noReserialize=!1}disconnectedCallback(){super.disconnectedCallback(),this.ready=null}get quads(){return this[vo]}set quads(t){if(typeof t>"u"||t===null)return;const r=this[vo];this[vo]=t,this.requestUpdate("quads",r)}async updated(t){super.updated(t);let r=!1,i=!1;const n=this.quads&&this.quads.length>0;t.has("format")&&(r=n&&!this.noReserialize,i=!r),t.has("quads")&&(r=!0),(t.has("prefixes")||t.has("customPrefixes"))&&(r=n),i?this.parse():r&&this.__serialize()}async _parse(){const{toStream:t}=await ht(()=>import("./stream-BoghbXpd.js"),__vite__mapDeps([19,13])),r=t(this.value),i=[],n={},o=this.$rdf.formats.parsers.import(this.format,r);if(!o){this.dispatchEvent(new CustomEvent("parsing-failed",{detail:{notFound:!0}}));return}o.on("prefix",(l,s)=>{n[l]=s});for await(const l of o)i.push(l);this[vo]=i,this.dispatchEvent(new CustomEvent("quads-changed",{detail:{value:i}})),this.__notifyParsedPrefixes(n)}async __serialize(){if(!this.format)return;await this.ready;const{Readable:t}=await ht(()=>import("./stream-BoghbXpd.js"),__vite__mapDeps([19,13])),r=[...this.quads||[]],i=new t({objectMode:!0,read(){if(r.length===0){this.push(null);return}this.push(r.shift())}}),n=this.$rdf.formats.serializers.import(this.format,i,{prefixes:await this._combinePrefixes()});if(!n){this.value=`No serializer found for media type ${this.format}`;return}let o="";for await(const l of n)o+=l;this.format===Ft.jsonLd&&(o=JSON.stringify(JSON.parse(o),null,2)),this.value=o,this.dispatchEvent(new CustomEvent("serialized",{detail:{value:o}}))}_errorLine(t){const r={message:t.message};return t.context&&t.context.line&&(r.from={line:t.context.line-1,ch:0},r.to={line:t.context.line-1,ch:Number.MAX_SAFE_INTEGER}),r}__notifyParsedPrefixes(t){const r={},i={...t};for(const[n,o]of Object.entries(t))n in Vs&&(r[n]=o,delete i[n]);this.dispatchEvent(new CustomEvent("prefixes-parsed",{detail:{prefixes:{...r,...i}}}))}}const Sp=new Zs([Up,ta]);Sp.formats.import(At);window.customElements.define("rdf-editor",class extends Hp(xE,Sp){});class SE extends ki{static get properties(){return{input:{type:String},output:{type:Array}}}static get styles(){return uc` + :host { + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; + } + + button { + width: 50px; + height: 50px; + } + + .editor { + flex: 1; + display: flex; + flex-direction: column; + text-align: center; + height: 100vh; + } + + rdf-editor { + height: 100%; + padding: 20px; + } + `}constructor(){super(),this.input=`{ + "@context": { + "@vocab": "http://schema.org/" + }, + "name": "John Doe" +}`}render(){return pc` +
+

Input

+ +
+ +
+

Output

+ +
+ `}async _translate(){this.output=this.renderRoot.querySelector("#input").quads}}customElements.define("rdfjs-elements-demos",SE);export{Ed as a,gr as b,ME as c,Jo as e,Ky as f,ra as g,D1 as m,v1 as r,cd as s,fo as t}; diff --git a/converter/assets/main-9bW7T1LR.js b/converter/assets/main-9bW7T1LR.js new file mode 100644 index 0000000..c355e7c --- /dev/null +++ b/converter/assets/main-9bW7T1LR.js @@ -0,0 +1,2 @@ +import{e as Ke,b as Le,r as Qe,s as Ce}from"./index-DtgbetCt.js";import{i as te,b as ft}from"./browser-BwSN-dYO.js";var Oe={exports:{}},Je=Ke.EventEmitter,ve,We;function lt(){if(We)return ve;We=1;function r(y,v){var b=Object.keys(y);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(y);v&&(_=_.filter(function(M){return Object.getOwnPropertyDescriptor(y,M).enumerable})),b.push.apply(b,_)}return b}function i(y){for(var v=1;v0?this.tail.next=_:this.head=_,this.tail=_,++this.length}},{key:"unshift",value:function(b){var _={data:b,next:this.head};this.length===0&&(this.tail=_),this.head=_,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var _=this.head,M=""+_.data;_=_.next;)M+=b+_.data;return M}},{key:"concat",value:function(b){if(this.length===0)return T.alloc(0);for(var _=T.allocUnsafe(b>>>0),M=this.head,E=0;M;)x(M.data,_,E),E+=M.data.length,M=M.next;return _}},{key:"consume",value:function(b,_){var M;return bg.length?g.length:b;if(S===g.length?E+=g:E+=g.slice(0,b),b-=S,b===0){S===g.length?(++M,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=g.slice(S));break}++M}return this.length-=M,E}},{key:"_getBuffer",value:function(b){var _=T.allocUnsafe(b),M=this.head,E=1;for(M.data.copy(_),b-=M.data.length;M=M.next;){var g=M.data,S=b>g.length?g.length:b;if(g.copy(_,_.length-b,0,S),b-=S,b===0){S===g.length?(++E,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=g.slice(S));break}++E}return this.length-=E,_}},{key:I,value:function(b,_){return D(this,i(i({},_),{},{depth:0,customInspect:!1}))}}]),y}(),ve}function ut(r,i){var o=this,f=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return f||d?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ae,this,r)):process.nextTick(Ae,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(l){!i&&l?o._writableState?o._writableState.errorEmitted?process.nextTick(fe,o):(o._writableState.errorEmitted=!0,process.nextTick(Ie,o,l)):process.nextTick(Ie,o,l):i?(process.nextTick(fe,o),i(l)):process.nextTick(fe,o)}),this)}function Ie(r,i){Ae(r,i),fe(r)}function fe(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function st(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ae(r,i){r.emit("error",i)}function dt(r,i){var o=r._readableState,f=r._writableState;o&&o.autoDestroy||f&&f.autoDestroy?r.destroy(i):r.emit("error",i)}var Xe={destroy:ut,undestroy:st,errorOrDestroy:dt},G={};function ht(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i}var ze={};function q(r,i,o){o||(o=Error);function f(l,s,w){return typeof i=="string"?i:i(l,s,w)}var d=function(l){ht(s,l);function s(w,c,T){return l.call(this,f(w,c,T))||this}return s}(o);d.prototype.name=o.name,d.prototype.code=r,ze[r]=d}function xe(r,i){if(Array.isArray(r)){var o=r.length;return r=r.map(function(f){return String(f)}),o>2?"one of ".concat(i," ").concat(r.slice(0,o-1).join(", "),", or ")+r[o-1]:o===2?"one of ".concat(i," ").concat(r[0]," or ").concat(r[1]):"of ".concat(i," ").concat(r[0])}else return"of ".concat(i," ").concat(String(r))}function ct(r,i,o){return r.substr(!o||o<0?0:+o,i.length)===i}function pt(r,i,o){return(o===void 0||o>r.length)&&(o=r.length),r.substring(o-i.length,o)===i}function bt(r,i,o){return typeof o!="number"&&(o=0),o+i.length>r.length?!1:r.indexOf(i,o)!==-1}q("ERR_INVALID_OPT_VALUE",function(r,i){return'The value "'+i+'" is invalid for option "'+r+'"'},TypeError);q("ERR_INVALID_ARG_TYPE",function(r,i,o){var f;typeof i=="string"&&ct(i,"not ")?(f="must not be",i=i.replace(/^not /,"")):f="must be";var d;if(pt(r," argument"))d="The ".concat(r," ").concat(f," ").concat(xe(i,"type"));else{var l=bt(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(l," ").concat(f," ").concat(xe(i,"type"))}return d+=". Received type ".concat(typeof o),d},TypeError);q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");q("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});q("ERR_STREAM_PREMATURE_CLOSE","Premature close");q("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});q("ERR_MULTIPLE_CALLBACK","Callback called multiple times");q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");q("ERR_STREAM_WRITE_AFTER_END","write after end");q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);q("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");G.codes=ze;var _t=G.codes.ERR_INVALID_OPT_VALUE;function gt(r,i,o){return r.highWaterMark!=null?r.highWaterMark:i?r[o]:null}function wt(r,i,o,f){var d=gt(i,f,o);if(d!=null){if(!(isFinite(d)&&Math.floor(d)===d)||d<0){var l=f?o:"highWaterMark";throw new _t(l,d)}return Math.floor(d)}return r.objectMode?16:16*1024}var Ze={getHighWaterMark:wt},Re,Be;function et(){if(Be)return Re;Be=1,Re=L;function r(a){var n=this;this.next=null,this.entry=null,this.finish=function(){_e(n,a)}}var i;L.WritableState=O;var o={deprecate:ft},f=Je,d=Le.Buffer,l=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(a){return d.from(a)}function w(a){return d.isBuffer(a)||a instanceof l}var c=Xe,T=Ze,j=T.getHighWaterMark,D=G.codes,I=D.ERR_INVALID_ARG_TYPE,x=D.ERR_METHOD_NOT_IMPLEMENTED,y=D.ERR_MULTIPLE_CALLBACK,v=D.ERR_STREAM_CANNOT_PIPE,b=D.ERR_STREAM_DESTROYED,_=D.ERR_STREAM_NULL_VALUES,M=D.ERR_STREAM_WRITE_AFTER_END,E=D.ERR_UNKNOWN_ENCODING,g=c.errorOrDestroy;te(L,f);function S(){}function O(a,n,h){i=i||J(),a=a||{},typeof h!="boolean"&&(h=n instanceof i),this.objectMode=!!a.objectMode,h&&(this.objectMode=this.objectMode||!!a.writableObjectMode),this.highWaterMark=j(this,a,"writableHighWaterMark",h),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var R=a.decodeStrings===!1;this.decodeStrings=!R,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){ce(n,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=a.emitClose!==!1,this.autoDestroy=!!a.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}O.prototype.getBuffer=function(){for(var n=this.bufferedRequest,h=[];n;)h.push(n),n=n.next;return h},function(){try{Object.defineProperty(O.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var W;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(W=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(n){return W.call(this,n)?!0:this!==L?!1:n&&n._writableState instanceof O}})):W=function(n){return n instanceof this};function L(a){i=i||J();var n=this instanceof i;if(!n&&!W.call(L,this))return new L(a);this._writableState=new O(a,this,n),this.writable=!0,a&&(typeof a.write=="function"&&(this._write=a.write),typeof a.writev=="function"&&(this._writev=a.writev),typeof a.destroy=="function"&&(this._destroy=a.destroy),typeof a.final=="function"&&(this._final=a.final)),f.call(this)}L.prototype.pipe=function(){g(this,new v)};function m(a,n){var h=new M;g(a,h),process.nextTick(n,h)}function k(a,n,h,R){var P;return h===null?P=new _:typeof h!="string"&&!n.objectMode&&(P=new I("chunk",["string","Buffer"],h)),P?(g(a,P),process.nextTick(R,P),!1):!0}L.prototype.write=function(a,n,h){var R=this._writableState,P=!1,e=!R.objectMode&&w(a);return e&&!d.isBuffer(a)&&(a=s(a)),typeof n=="function"&&(h=n,n=null),e?n="buffer":n||(n=R.defaultEncoding),typeof h!="function"&&(h=S),R.ending?m(this,h):(e||k(this,R,a,h))&&(R.pendingcb++,P=de(this,R,e,a,n,h)),P},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,!a.writing&&!a.corked&&!a.bufferProcessing&&a.bufferedRequest&&$(this,a))},L.prototype.setDefaultEncoding=function(n){if(typeof n=="string"&&(n=n.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((n+"").toLowerCase())>-1))throw new E(n);return this._writableState.defaultEncoding=n,this},Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X(a,n,h){return!a.objectMode&&a.decodeStrings!==!1&&typeof n=="string"&&(n=d.from(n,h)),n}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function de(a,n,h,R,P,e){if(!h){var t=X(n,R,P);R!==t&&(h=!0,P="buffer",R=t)}var u=n.objectMode?1:R.length;n.length+=u;var p=n.length0)if(typeof t!="string"&&!A.objectMode&&Object.getPrototypeOf(t)!==f.prototype&&(t=l(t)),p)A.endEmitted?S(e,new _):X(e,A,t,!0);else if(A.ended)S(e,new v);else{if(A.destroyed)return!1;A.reading=!1,A.decoder&&!u?(t=A.decoder.write(t),A.objectMode||t.length!==0?X(e,A,t,!1):$(e,A)):X(e,A,t,!1)}else p||(A.reading=!1,$(e,A))}return!A.ended&&(A.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function re(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=he(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}m.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,u=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?h(this):F(this),null;if(e=re(e,t),e===0&&t.ended)return t.length===0&&h(this),null;var p=t.needReadable;c("need readable",p),(t.length===0||t.length-e0?C=n(e,t):C=null,C===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),u!==e&&t.ended&&h(this)),C!==null&&this.emit("data",C),C};function ce(e,t){if(c("onEofChunk"),!t.ended){if(t.decoder){var u=t.decoder.end();u&&u.length&&(t.buffer.push(u),t.length+=t.objectMode?1:u.length)}t.ended=!0,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ie(e)))}}function F(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(ie,e))}function ie(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,a(e)}function $(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(ne,e,t))}function ne(e,t){for(;!t.reading&&!t.ended&&(t.length1&&P(p.pipes,e)!==-1)&&!Ne&&(c("false write response, pause",p.awaitDrain),p.awaitDrain++),u.pause())}function ge(K){c("onerror",K),z(),e.removeListener("error",ge),i(e,"error")===0&&S(e,K)}W(e,"error",ge);function we(){e.removeListener("finish",ye),z()}e.once("close",we);function ye(){c("onfinish"),e.removeListener("close",we),z()}e.once("finish",ye);function z(){c("unpipe"),u.unpipe(e)}return e.emit("pipe",u),p.flowing||(c("pipe resume"),u.resume()),e};function pe(e){return function(){var u=e._readableState;c("pipeOnDrain",u.awaitDrain),u.awaitDrain&&u.awaitDrain--,u.awaitDrain===0&&i(e,"data")&&(u.flowing=!0,a(e))}}m.prototype.unpipe=function(e){var t=this._readableState,u={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,u),this);if(!e){var p=t.pipes,C=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var A=0;A0,p.flowing!==!1&&this.resume()):e==="readable"&&!p.endEmitted&&!p.readableListening&&(p.readableListening=p.needReadable=!0,p.flowing=!1,p.emittedReadable=!1,c("on readable",p.length,p.reading),p.length?F(this):p.reading||process.nextTick(H,this)),u},m.prototype.addListener=m.prototype.on,m.prototype.removeListener=function(e,t){var u=o.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(ae,this),u},m.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ae,this),t};function ae(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function H(e){c("readable nexttick read 0"),e.read(0)}m.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,be(this,e)),e.paused=!1,this};function be(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(_e,e,t))}function _e(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),a(e),t.flowing&&!t.reading&&e.read(0)}m.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function a(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&e.read()!==null;);}m.prototype.wrap=function(e){var t=this,u=this._readableState,p=!1;e.on("end",function(){if(c("wrapped end"),u.decoder&&!u.ended){var N=u.decoder.end();N&&N.length&&t.push(N)}t.push(null)}),e.on("data",function(N){if(c("wrapped data"),u.decoder&&(N=u.decoder.write(N)),!(u.objectMode&&N==null)&&!(!u.objectMode&&(!N||!N.length))){var Y=t.push(N);Y||(p=!0,e.pause())}});for(var C in e)this[C]===void 0&&typeof e[C]=="function"&&(this[C]=function(Y){return function(){return e[Y].apply(e,arguments)}}(C));for(var A=0;A=t.length?(t.decoder?u=t.buffer.join(""):t.buffer.length===1?u=t.buffer.first():u=t.buffer.concat(t.length),t.buffer.clear()):u=t.buffer.consume(e,t.decoder),u}function h(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(R,t,e))}function R(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var u=t._writableState;(!u||u.autoDestroy&&u.finished)&&t.destroy()}}typeof Symbol=="function"&&(m.from=function(e,t){return g===void 0&&(g=St()),g(m,e,t)});function P(e,t){for(var u=0,p=e.length;u0;return Wt(s,c,T,function(j){d||(d=j),j&&l.forEach($e),!c&&(l.forEach($e),f(d))})});return i.reduce(It)}var qt=Bt;(function(r,i){i=r.exports=rt(),i.Stream=i,i.Readable=i,i.Writable=et(),i.Duplex=J(),i.Transform=it,i.PassThrough=Lt,i.finished=De,i.pipeline=qt})(Oe,Oe.exports);var kt=Oe.exports;const B=kt;class Ye extends B.Readable{constructor(i={}){if(super(i),i.iterator)throw new Error("readable stream iterator shortcut not yet implemented")}until(i,o){return new Promise((f,d)=>{this.on("error",l=>{d(l)}),o?this.once(i,(...l)=>{f(this,...l)}):this.once(i,f)})}bucket(i="utf8"){if(this._readableState.objectMode)return new Promise((f,d)=>{let l=[];this.pipe(new B.Writable({write(s,w,c){l.push(s),c()},writev(s,w){l.push(...s),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="utf8"||i==="utf-8")return new Promise((f,d)=>{let l="";this.setEncoding(i),this.pipe(new B.Writable({decodeStrings:!1,write(s,w,c){l+=s,c()},writev(s,w){l+=s.join(""),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="buffer")return new Promise((f,d)=>{let l=Buffer.from([]);this.pipe(new B.Writable({decodeStrings:!0,write(s,w,c){l=Buffer.concat([l,s],l.length+s.length),c()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})})}}class Ut extends B.Writable{until(i,o){return new Promise((f,d)=>{this.on("error",l=>{d(l)}),o?this.once(i,(...l)=>{f(this,...l)}):this.once(i,f)})}import(i){return i.on("data",o=>this.write(o)).on("end",()=>this.end()).on("error",o=>this.emit("error",o)),this}}class Pe extends B.Duplex{until(i,o){return new Promise((f,d)=>{this.on("error",l=>{d(l)}),o?this.once(i,(...l)=>{f(this,...l)}):this.once(i,f)})}bucket(i="utf8"){if(this._readableState.objectMode)return new Promise((f,d)=>{let l=[];this.pipe(new B.Writable({write(s,w,c){l.push(s),c()},writev(s,w){l.push(...s),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="utf8"||i==="utf-8")return new Promise((f,d)=>{let l="";this.setEncoding(i),this.pipe(new B.Writable({decodeStrings:!1,write(s,w,c){l+=s,c()},writev(s,w){l+=s.join(""),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="buffer")return new Promise((f,d)=>{let l=Buffer.from([]);this.pipe(new B.Writable({decodeStrings:!0,write(s,w,c){l=Buffer.concat([l,s],l.length+s.length),c()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})})}}class ee extends B.Transform{until(i,o){return new Promise((f,d)=>{this.on("error",l=>{d(l)}),o?this.once(i,(...l)=>{f(this,...l)}):this.once(i,f)})}bucket(i="utf8"){if(this._readableState.objectMode)return new Promise((f,d)=>{let l=[];this.pipe(new B.Writable({write(s,w,c){l.push(s),c()},writev(s,w){l.push(...s),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="utf8"||i==="utf-8")return new Promise((f,d)=>{let l="";this.setEncoding(i),this.pipe(new B.Writable({decodeStrings:!1,write(s,w,c){l+=s,c()},writev(s,w){l+=s.join(""),w()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})});if(i==="buffer")return new Promise((f,d)=>{let l=Buffer.from([]);this.pipe(new B.Writable({decodeStrings:!0,write(s,w,c){l=Buffer.concat([l,s],l.length+s.length),c()}})).on("error",s=>{d(s)}).on("finish",()=>{f(l)})})}import(i){return i.on("data",o=>this.write(o)).on("end",()=>this.end()).on("error",o=>this.emit("error",o)),this}demolish(i){if(this.push=o=>{if(o!==null)throw new Error("[ERR_STREAM_DESTROYED]: Cannot push after stream was destroyed")},this.emit=function(o,...f){o!=="end"&&Object.getPrototypeOf(this).emit.apply(this,[o,...f])},i)return B.Transform.prototype.destroy.call(this,i)}}const Ft=new Function("try {return this===global;}catch(e){return false;}")(),[Kt,Ht]=typeof process>"u"?[!0,!1]:process.browser?[!0,!0]:process.versions==="undefined"||process.versions.node==="undefined"?[!0,!1]:[!1,!1];(Ht||Ft&&+/^v(\d+)/.exec(process.version)[1]<10)&&(ee.prototype.destroy=Pe.prototype.destroy=function(r,i){this._readableState.destroyed=!0,this._writableState.destroyed=!0;let o=()=>{this._writableState.emitClose&&this._readableState.emitClose&&this.emit("close")};return this._destroy(r||null,f=>{!i&&f?(process.nextTick(()=>{this.emit("error",f),o()}),this._writableState.errorEmitted=!0):(process.nextTick(o),i&&i(f))}),this},ee.prototype._destroy=Pe.prototype._destroy=(r,i)=>i(r));class se extends ee{constructor(i={}){super({...i,writableObjectMode:!0,readableObjectMode:!0}),this._as_inputs=new Set,this.on("pipe",o=>{this._as_inputs.add(o),o.on("prefix",(...f)=>{this.emit("prefix",...f)}).on("comment",(...f)=>{this.emit("comment",...f)})}),this.on("unpipe",o=>{this._as_inputs.delete(o)})}_destroy(){for(let i of this._as_inputs)i.destroy()}}class Gt extends se{_transform(i,o,f){f(null,JSON.stringify(i.isolate())+` +`)}}class Vt extends se{_transform(i,o,f){f(null,{type:"quad",value:i})}}ee.QuadsToOther=se;var Qt={...B,Readable:Ye,Writable:Ut,Duplex:Pe,Transform:ee,QuadsToOther:se,quads_to_json(){return new Gt},quads_to_writable(){return new Vt},source(r,i=null){return!i&&typeof r=="string"&&(i="utf8"),new Ye({objectMode:!i&&typeof r!="string"&&!Buffer.isBuffer(r),read(){this.push(r,i),this.push(null)}})}};export{Qt as m}; diff --git a/converter/assets/main-B06IXfHH.js b/converter/assets/main-B06IXfHH.js new file mode 100644 index 0000000..5ed631a --- /dev/null +++ b/converter/assets/main-B06IXfHH.js @@ -0,0 +1,4 @@ +import{m as o}from"./index-DtgbetCt.js";import{m as f}from"./main-9bW7T1LR.js";if(typeof queueMicrotask!="function"){let a=Promise.resolve();try{queueMicrotask=e=>a.then(e).catch(r=>setTimeout(()=>{throw r},0))}catch{}}const h=o,_=f,p=32768;class n extends _.Transform{static _flush_buffer(e){e._s_push&&(e.push(e._s_push),e._s_push="")}constructor(e={}){super({writableObjectMode:!0,readableObjectMode:!1});let{prefixes:r={}}=e;this._s_push="",this._n_max_buffer=e.max_buffer||e.maxBuffer||p,this._h_prefixes=h.cache_prefixes(r||{}),this.on("pipe",t=>{t.on("prefix",(i,s)=>{this.write({type:"prefixes",value:{[i]:s}})}),t.on("comment",i=>{this.write({type:"comment",value:i})})}),e.close&&this.once("close",e.close),e.drain&&this.on("drain",e.drain),e.error&&this.on("error",e.error),e.finish&&this.once("finish",e.finish),e.data&&this.on("data",e.data),e.end&&this.once("end",e.end),e.warning&&this.on("warning",e.warning)}_serialize_hash_comment(e){return"# "+e.replace(/\n/g,` +# `)+` +`}_serialize_newlines(e=1){return` +`.repeat(e)}_serialize_c4r(e){let r=this._h_prefixes,t=[],i="";for(let s in e)s!=="*"&&t.push(s),i+=this._serialize_c3r(e[s]);if(t.length){let s=`Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${t.map(u=>h.c1(u,r).verbose()).join(", ")}`;this.emit("warning",s)||console.warn(s)}return i}_serialize_c3(){throw new Error(`Write event type 'c3' not supported by ${this.constructor.name}`)}_serialize_c4(){throw new Error(`Write event type 'c4' not supported by ${this.constructor.name}`)}_serialize_c3r(){throw new Error(`Write event type 'c3r' should have been implemented by subclass ${this.constructor.name}`)}_serialize_quad(){throw new Error(`Write event type 'quad' should have been implemented by subclass ${this.constructor.name}`)}_serialize_comment(){}_update_prefixes(e,r=!1){let t={...this._h_prefixes,...e};this._h_prefixes=h.cachePrefixes(t||{},r)}_transform(e,r,t){let i;try{i=this.serialize(e)}catch(s){return t(s),s}if(i)n._flush_buffer(this),this.push(i);else{let s=this._s_push.length;s>this._n_max_buffer?n._flush_buffer(this):s&&queueMicrotask(()=>n._flush_buffer(this))}t()}_queue(e){this._s_push+=e,this._s_push.length>this._n_max_buffer?n._flush_buffer(this):queueMicrotask(()=>n._flush_buffer(this))}serialize(e){switch(e.type){case void 0:return this._serialize_quad(e);case"c3r":return this._serialize_c3r(e.value);case"c4r":return this._serialize_c4r(e.value);case"array":{let r="";for(let t of e.value){let i=this.serialize(t);i?r+=i:this._s_push&&(r+=this._s_push,this._s_push="")}return r}case"quad":return this._serialize_quad(e.value);case"c3":return this._serialize_c3(e.value);case"c4":return this._serialize_c4(e.value);case"prefixes":return this._serialize_prefixes(e.value);case"comment":return this._serialize_comment(e.value);case"newline":case"newlines":return this._serialize_newlines(e.value);default:throw new Error(`no such writable data event type for RDF stream: '${e.type}'`)}}rinse(){this._reset(),n._flush_buffer(this)}_flush(){n._flush_buffer(this),this.push(null)}}Object.assign(n.prototype,{isGraphyWritable:!0,_serialize_prefixes:n.prototype._update_prefixes});var c=n;export{c as m}; diff --git a/converter/assets/main-B4ltdbX3.js b/converter/assets/main-B4ltdbX3.js new file mode 100644 index 0000000..3e36829 --- /dev/null +++ b/converter/assets/main-B4ltdbX3.js @@ -0,0 +1,20 @@ +import{g as T,m as S}from"./index-DtgbetCt.js";import{m as C}from"./main-B9Y9bPv0.js";function I(l,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}if(typeof queueMicrotask!="function"){let l=Promise.resolve();try{queueMicrotask=e=>l.then(e).catch(t=>setTimeout(()=>{throw t},0))}catch{}}const u=S,A=C,k=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}]([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}])?)?$/u,p=1,w=2,E=4;class h extends A{constructor(e={}){super(e);let{prefixes:t={},lists:i=null,debug:r=!1,style:s=null}=e;if(Object.assign(this,{_b_debug:r,_s_indent:" ",_b_simplify_default_graph:!1,_xc_directives:0,_s_token_prefix:"@prefix"}),s){s.indent&&(this._s_indent=s.indent.replace(/[^\s]/g,""));let f=s.directives||s.directives;if(f)switch(f){case"sparql":{this._xc_directives=p,this._s_token_prefix="prefix";break}case"Sparql":{this._xc_directives=p|w,this._s_token_prefix="Prefix";break}case"SPARQL":{this._xc_directives=p|E,this._s_token_prefix="PREFIX";break}case"turtle":break;case"Turtle":{this._xc_directives=w,this._s_token_prefix="@Prefix";break}case"TURTLE":{this._xc_directives=E,this._s_token_prefix="@PREFIX";break}default:throw new Error(`Value not understood for 'directives' option: ${f}`)}}i&&(this._serialize_list_object=function(f,a){let d=this._transcode_list(f);return this._encode_objects(d,a)});let _=this._s_token_prefix,n=this._xc_directives&p?` +`:` . +`,o="";try{for(let f in t){if(!k.test(f))throw new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${f}'`);o+=`${_} ${f}: ${u.namedNode(t[f]).verbose()}${n}`}}catch(f){queueMicrotask(()=>{this.emit("error",f)})}o&&this.push(o)}_serialize_prefixes(e){let t=this._xc_state===2?` + +`:"";this._xc_state=0,this._h_prefixes={...this._h_prefixes};let i=this._s_token_prefix,r=this._xc_directives&p?` +`:` . +`;for(let s in e){if(!k.test(s))throw new Error(`Invlalid prefix id for text/turtle RDF serialization format: '${s}'`);t+=`${i} ${s}: ${u.namedNode(e[s]).verbose()}${r}`,this._h_prefixes[s]=e[s]}return u.cache_prefixes(this._h_prefixes),t}_serialize_c3(e){let{_h_prefixes:t,_s_indent:i}=this,r=this._xc_state!==2?` +`:"";this._xc_state=2;let s="",_=null;for(let n in e){if(n[0]==="`"){let c=this._apply_directive(n,e[n]);c.write&&(r+=s+c.write,s=""),c.exit&&(_=c.exit);continue}let o=r.length;r+=s+u.c1_node(n,t).terse(t)+" ";let f="",a="",d=e[n],$=r.length,y=!0,m=null;for(let c in d){if(c[0]==="`"){let x=this._apply_directive(c,d[c]);x.write&&(r+=(f?a:` +`)+i+x.write,a="",f=i),x.exit&&(m=x.exit);continue}let P=d[c],b=this._encode_objects(P);if(!b)continue;if(y=!1,c[0]==="_"&&c[1]===":")throw new Error(`Cannot use blank node in predicate position of c3 hash; subject:'${n}', predicate:'${c}'`);let g=u.c1_named_node(c,t),R=g.isRdfTypeAlias?"a":g.terse(t);r+=a+f+R+" "+b,this._xc_state=2,a=` ; +`,f=i,m&&m()}if(y){r=r.slice(0,o)+r.slice($);continue}s=` +`,r+=`${a?" ":f}. +`,_&&_()}return r+=` +`,r}_encode_objects(e,t=1){let{_h_prefixes:i,_s_indent:r,_hm_coercions:s}=this;switch(typeof e){case"string":return u.c1(e,i).terse(i);case"number":return u.number(e).terse(i);case"boolean":return u.boolean(e).terse(i);case"object":{if(e===null)throw new Error("Refusing to serialize null value given as an object of quad");if(Array.isArray(e)||e instanceof Set){let _="",n="";for(let o of e)Array.isArray(o)?_+=n+this._serialize_list_object(o,t):_+=n+this._encode_objects(o,t),n=", ";return _}else if(Object===e.constructor){let _="[",n=!0,o=null;for(let f in e){if(n=!1,_+=` +`+r.repeat(1+t),f[0]==="`"){let a=this._apply_directive(f,e[f]);a.write&&(_+=a.write),a.exit&&(o=a.exit);continue}_+=u.c1(f,i).terse(i)+" "+this._encode_objects(e[f],t+1)+" ;"}return _+=(n?"":` +`+r.repeat(t))+"]",o&&o(),_}else{if(s.has(e.constructor))return s.get(e.constructor).apply(this,[e,t]).terse(i);if(e.isGraphyTerm)return e.terse(i);if(e.termType)return u.from.term(e).terse(i)}}default:throw new Error(`Bad type for RDF object: [${typeof e}] ${e&&e.constructor}`)}}_serialize_collection_object(e,t){let i=this._s_indent,r="(";for(let s of e){let _="";Array.isArray(s)?_=this._serialize_collection_object(s,t+1):_=this._encode_objects(s,t+1),r+=` +`+i.repeat(1+t)+_}return e.length&&(r+=` +`+i.repeat(t)),r+=")",r}_serialize_quad(e){let t=this._h_prefixes,i=u.from.quad(e);this._s_push+=(this._xc_state!==2?` +`:"")+i.subject.terse(t)+" "+i.predicate.terse(t)+" "+i.object.terse(t)+` . + +`,this._xc_state=2}}Object.assign(h.prototype,{anonymous_blank_nodes:!0,_serialize_c3r:h.prototype._serialize_c3,_serialize_c4r:h.prototype._serialize_c4,_serialize_comment:A.prototype._serialize_hash_comment,_serialize_list_object:h.prototype._serialize_collection_object});var v=function(l){return new h(l)};const j=T(v),O=I({__proto__:null,default:j},[v]);export{O as m}; diff --git a/converter/assets/main-B9Y9bPv0.js b/converter/assets/main-B9Y9bPv0.js new file mode 100644 index 0000000..15a5ddc --- /dev/null +++ b/converter/assets/main-B9Y9bPv0.js @@ -0,0 +1,3 @@ +import{m as p}from"./index-DtgbetCt.js";import{m as w}from"./main-B06IXfHH.js";const _=p,d=w,u=/^`\[[^\]]+\](.*)$/,m=new Map([[Date,a=>_.dateTime(a)],[Number,a=>_.number(a)]]);class g extends d{constructor(e={}){super(e);let{lists:t=null}=e,s=m;if(e.coercions){s=new Map(s);for(let[r,n]of e.coercions)s.set(r,n)}let i={first:">http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:">http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:">http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};if(t){let{first:r=null,rest:n=null,nil:l=null}=t;r&&(i.first=r),n&&(i.rest=n),l&&(i.nil=l)}Object.assign(this,{_xc_state:0,_hm_coercions:s,_g_lists:i})}_serialize_comment(e,t){let s="";if(this._xc_state!==2&&(s+=` +`,this._xc_state=2),t&&t.width){let i=t.width,r=[];for(;e.length>i;){let n=e.slice(0,i+1),l=/^(.*[^\s])\s+/.exec(n);if(l){let o=l[1];r.push(o),e=e.slice(o.length).replace(/^\s+/,"")}else r.push(e.slice(0,i)),e=e.slice(i)}e=r.join(` +`)}return s+(super._serialize_comment(e)||"")}_transcode_list(e,t=this._g_lists){if(e.length){let s=e[0],i=s;return Array.isArray(s)&&(i=this._transcode_list(s,t)),{[t.first]:i,[t.rest]:e.length===1?t.nil:this._transcode_list(e.slice(1),t)}}else return t.nil}_apply_directive(e,t){let s=u.exec(e);if(!s)throw new Error(`Invalid writable data event directive string: "${e}"`);let i;try{i=JSON.parse(s[1])}catch{throw new Error(`Unable to parse JSON in writable data event directive: "${s[1]}"`)}let r=i.type;switch(r){case"comment":{if(this._serialize_comment)return{write:this._serialize_comment(t+"",i)};break}case"newlines":{if(this._serialize_newlines)return{write:this._serialize_newlines(t)};break}case"config":switch(i.value){case"lists":{let n=this._a_list_serializers;n.push(this._serialize_list_object);let l=this._g_lists,o={first:t.first||l.first,rest:t.rest||l.rest,nil:t.nil||l.nil};return this._serialize_list_object=function(c,h){let f=this._transcode_list(c,o);return this._encode_objects(f,h)},{exit:()=>{this._serialize_list_object=n.pop()}}}default:throw new Error(`No such config key '${i.value}'`)}default:throw new Error(`Invalid writable data event directive type: '${r}'`)}return{}}_serialize_c4(e){let t=this._h_prefixes,s=[],i="";for(let r in e)r!=="*"&&s.push(r),i+=this._serialize_c3(e[r]);if(s.length){let r=`Destination format does not support quads; an implicit union into the default graph was performed on the quads contained in graphs: ${s.map(n=>_.c1(n,t).verbose()).join(", ")}`;this.emit("warning",r)||console.warn(r)}return i}}var z=g;export{z as m}; diff --git a/converter/assets/main-BXAPmmD-.js b/converter/assets/main-BXAPmmD-.js new file mode 100644 index 0000000..76c8f3d --- /dev/null +++ b/converter/assets/main-BXAPmmD-.js @@ -0,0 +1,22 @@ +import{g,m as z}from"./index-DtgbetCt.js";import{m as $}from"./main-B06IXfHH.js";function C(a,s){for(var i=0;ie[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}const b=z,D=$,{c1:c,namedNode:j,$_PREFIX_CACHE:m}=b,v=/[&"<>']/g,M={"&":"&","<":"<",">":">",'"':""","'":"'"},k=/^xml/i,f=a=>a.replace(v,s=>M[s]),L=/([A-Za-z_][A-Za-z_.0-9-]*)$/,X=/([A-Za-z_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}][A-Za-z_.0-9\-\u00b7\u203f-\u2040\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*$)/u;function x(a,s,i,e){if(e.isNamedNode)i+=' rdf:resource="'+f(e.value)+'"/>';else if(e.isLiteral)e.isLanguaged?i+=' xml:lang="'+e.language+'"':e.isDatatyped&&(i+=' rdf:datatype="'+f(e.datatype.value)+'"'),i+=">"+f(e.value)+"";else if(e.isBlankNode)i+=' rdf:nodeID="'+f(e.value)+'"/>';else throw new Error(`Not allowed to serialize term type '${e.termType}' as object in XML serializer.`);return i}function F(a,s){let i=a._h_prefixes,e=s.value,r,t;{let u=L.exec(e);if(u)r=e.slice(0,u.index),t=u[1];else if(u=X.exec(e),u)r=e.slice(0,u.index),t=u[1];else throw new Error(`Cannot serialize predicate <${e}> into an XML qname`)}let n,l;e:for(;;){t:for(;;)if(i[m]){let o=i[m]._h_inverse;if(r in o){let _=o[r];n=(_?_+":":"")+t,l="<"+n;break e}else break}else{for(let o in i)if(i[o]===r){n=(o?o+":":"")+t,l="<"+n;break t}break}let u="__g"+a._c_prefixes_tmp++;n=u+":"+t,l="<"+n+" xmlns:"+u+'="'+r+'"';break}return[n,l]}class p extends D{constructor(s={}){let i=s.prefixes;delete s.prefixes,super(s),this._b_prefixes_open=!0,this._c_prefixes_tmp=0,this._kt_subject=null;let e=` + to <${s[t]}>`)}if(k.test(t))throw new Error(`Cannot serialize prefix '${t}' since it is reserved under the blanket XML namespace.`);r+=` + xmlns${t?":"+t:""}="${j(s[t]).value}"`}return r&&this._update_prefixes(s,!0),r}_serialize_c3r(s){let i="";this._b_prefixes_open&&(i+=">",this._b_prefixes_open=!1);let e=this._h_prefixes;this._kt_subject!==null&&(i+=` + `,this._kt_subject=null);for(let r in s){let t="",n=c(r,e);if(!n.termType)continue;if(!n.isNamedNode&&!n.isBlankNode)throw new Error(`Cannot use ${n.termType} term type in subject position`);if(n.isNamedNode)t+=` + + ';else if(n.isBlankNode)t+=` + + ';else throw new Error(`Not allowed to serialize term type '${n.termType}' as subject in XML serializer.`);let l=!1,u=s[r];for(let o in u){let _=c(o,e);if(!_.termType)continue;if(!_.isNamedNode)throw new Error(`Cannot use ${_.termType} term type in subject position`);let[y,E]=F(this,_),d="";for(let N of u[o]){let h=c(N,e);h.termType&&(d+=` + `+x(this,y,E,h))}d&&(t+=d,l=!0)}l&&(i+=t+` + `)}return i}_serialize_quad(s){let i=b.from.quad(s);this._b_prefixes_open&&(this._s_push+=">",this._b_prefixes_open=!1);let{subject:e,predicate:r,object:t}=i,[n,l]=F(this,r),u=` + `+x(this,n,l,t);if(e.equals(this._kt_subject))this._s_push+=u;else{if(!e.isNamedNode&&!e.isBlankNode)throw new Error(`Cannot use ${e.termType} term type in subject position`);let o;if(e.isNamedNode)o=` + + '+u;else if(e.isBlankNode)o=` + + '+u;else throw new Error(`Not allowed to serialize term type '${e.termType}' as subject in XML serializer.`);this._kt_subject?this._s_push+=` + `+o:this._s_push+=o,this._kt_subject=e}}_flush(){p._flush_buffer(this),this._b_prefixes_open&&(this.push(">"),this._b_prefixes_open=!1),this._kt_subject?this.push(` + + +`):this.push(` + +`),this.push(null)}}Object.assign(p,{_serialize_comment:D.prototype._serialize_hash_comment});var w=function(a){return new p(a)};const S=g(w),R=C({__proto__:null,default:S},[w]);export{R as m}; diff --git a/converter/assets/main-CRBhJGQX.js b/converter/assets/main-CRBhJGQX.js new file mode 100644 index 0000000..576da4a --- /dev/null +++ b/converter/assets/main-CRBhJGQX.js @@ -0,0 +1,13 @@ +import{g as P,m as U}from"./index-DtgbetCt.js";import{m as z}from"./main-9bW7T1LR.js";function M(o,e){for(var t=0;ts[a]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}if(typeof queueMicrotask!="function"){let o=Promise.resolve();try{queueMicrotask=e=>o.then(e).catch(t=>setTimeout(()=>{throw t},0))}catch{}}const w=z,C=U,G=/^[a-z][a-z0-9+\-.]*:(?:[^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,H=/^[a-z][a-z0-9+\-.]*:[^\0-\x20<>"{}|^`]*$/,B=/^([^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,V=/^([^\0-\x20<>"{}|^`])*$/,b=/\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})/g,g=(o,e,t)=>String.fromCodePoint(parseInt(e||t,16)),W=/\s*(?:#[^\n]*\n\s*)*\s*/y,Z=/\s*(#[^\n]*\n\s*)*\s*/y,k=/[\\]/,j=/[^\n]+\n/y,Q=/^(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.])*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}])?$/u,J=/^[a-z]+(-[a-z0-9]+)*$/,S=/[ \t]*/y,T=/@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\s+|(?=[.,;\])#]))/y,I=/<([^>]*)>\s*/y,$=(o,e,t,s,a,n)=>{if(e)switch(e){case"t":return" ";case"n":return` +`;case"r":return"\r";case"f":return"\f";case"b":return"\b";default:console.assert(`bad regex escape char mapping: '${e}'`)}else{if(t)return t;if(s)return String.fromCodePoint(parseInt(s,16));if(a)return String.fromCodePoint(parseInt(a,16));if(n)throw n[0]==="\\"?new Error(`expected string_literal but invalid escape sequence within contents: '${n}'. failed to parse a valid token`):new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(n)}. failed to parse a valid token`);console.assert("unexpected no match branch in escape sequence replace callback")}},K=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\.))/g,F=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,v=o=>o.replace(K,$),Y=o=>{let e=X.exec(o);if(e){let t=e.index;return[o.slice(0,t).replace(F,$),o.slice(t)]}else return[o.replace(F,$),""]},[X,D]=(()=>{function o(t){let s=RegExp.prototype.exec.call(this,t);if(s){let a=s[0].length-s[1].length;s.index+=a,s[0]=s[0].slice(a)}return s}let e=(()=>{try{new RegExp("(?(a.exec=n,a)}return t=>t()})();return[e(()=>new RegExp("(?new RegExp('(?]*)>|_:([^\x20\t<]+))[\x20\t]*<([^\\>]*)>[\x20\t]*(?:(?:(<[^\\>]*)>|_:([^\x20\t<]+))[\x20\t]*(?:<([^\\>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+|"([^"\\]*)(?:(")(?:\^\^<([^\\>]*)>|@([^\x20\t.]+)|)[\x20\t]*(?:<([^\\>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+)?)/y,N=/(?:<([^>]*)>|_:([^\x20\t<]+))[\x20\t]*<([^>]*)>[\x20\t]*(?:(?:(<[^>]*)>|_:([^\x20\t<]+))[\x20\t]*(?:<([^>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+|"((?:[^"\\]|\\.)*)(?:(")(?:\^\^<([^>]*)>|@([^\x20\t.]+)|)[\x20\t]*(?:<([^>]*)>|_:([^\x20\t<]+)|)[\x20\t]*\.\s*(#[^\n]*\n\s*|\n\s*)+)?)/y,O=/_:([^\x20\t<]+)/y;class ee extends w.Transform{constructor(e){super({decodeStrings:!1,writableObjectMode:!1,readableObjectMode:!0,flush:e.flush,transform:e.transform}),this.on("pipe",t=>{this._ds_input=t,typeof t.setEncoding=="function"&&t.setEncoding("utf8")})}pipe(e){let t=e;return t._writableState.objectMode?e.isGraphyWritable&&(e=w.quads_to_writable()):e=w.quads_to_json(),e!==t?(super.pipe(e),e.pipe(t)):super.pipe(t)}}class te{constructor(e){let{input:t=null,relax:s=!1,debug:a=!1}=e,n=e.allow_relative_iris||e.allowRelativeIRIs||e.allowRelativeIris||!1,d=this._dc_factory=C.adopt(e.dataFactory||e.data_factory||C.unfiltered),u=this._f_quad=d.quad;Object.assign(this,{s:e.prepend||"",n:0,_b_debug:a,_b_relax:s,_b_destroyed:!1,_b_trim_start:!0,_f_state:this.statement,_kt_subject:null,_kt_predicate:null,_kt_object:null,_s_literal:""}),this._kt_default_graph=d.defaultGraph(),this._kt_rdfs_lang_string=d.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");let x=this._r_clean=W;e.relaxed&&console.warn(new Error("no such option 'relaxed'; did you mean 'relax' ?").stack.replace(/^Error:/,"Warning:")),"validate"in e&&console.warn(new Error("option 'validate' has been removed and validation is now on by default. Use 'relax' option if you wish to disable validation.").stack.replace(/^Error:/,"Warning:"));let E=d.namedNode,A=d.blankNode,_=d.languagedLiteral,l=n?B:G,m=n?V:H,p=this;Object.assign(this,s?{create_named_node:E,create_named_node_escapeless:E,create_blank_node:A,create_languaged_literal:_}:{create_named_node(r){return l.test(r)?E(r):p._error(`invalid IRI: "${r}"`)},create_named_node_escapeless(r){return m.test(r)?E(r):p._error(`invalid IRI: "${r}"`)},create_blank_node(r){return Q.test(r)?A(r):p._error(`Invalid blank node label: "${r}"`)},create_languaged_literal(r,i){return J.test(i)?_(r,i):p._error(`Invalid literal language tag: ${i}`)}});let f,y=!1;if(f=this.transform=new ee({transform:(r,i,c)=>{y||(f.emit("ready"),y=!1);let h=this.s+=r;if(this._b_trim_start){x.lastIndex=0;let R=x.exec(h);this.emit_comments&&this.emit_comments(R[1]),this.i=x.lastIndex}else this.i=0;this.n=h.length;try{this.parse(!0)}catch(R){return f.destroy(R)}f.emit("progress",r.length),c()},flush:r=>{if(this.s.length){if(this.s+=` +`,this._b_trim_start){x.lastIndex=0;let i=x.exec(this.s);this.emit_comments&&this.emit_comments(i[1]),this.i=x.lastIndex}else this.i=0;try{this.parse()}catch(i){return f.demolish(i)}if(this.s.length)return f.demolish(new Error(`parsing error occurred in state: statement + ${this.s.substr(0,50)} + ^ starting here`))}if(this._f_state!==this.statement)return f.demolish(new Error(`parsing error occurred in state: ${this._f_state.name} + ${this.s.substr(0,50)} + ^ starting here`));this.s=null,f.emit("progress",0),f.emit("eof"),r()}}),f._destroy=(...r)=>{this.destroy(...r)},this._f_data_quad=(r,i,c,h)=>f.push(u(r,i,c,h)),f.on("newListener",r=>{r==="comment"&&(x=Z,this.emit_comments=i=>{if(!i)return;let c=i.slice(1).replace(/\n\s+$/,"").split(/\n+\s*#/g);for(let h of c)f.emit("comment",h)})}),this.bind(e),t)if(t.stream){let r=t.stream;queueMicrotask(()=>{r.pipe(f)})}else if(typeof t.string=="string"){let r=t.string;queueMicrotask(()=>{f.end(r,"utf8")})}else throw new TypeError(`Invalid argument for input parameter: ${typeof t=="object"?JSON.stringify(t):t}`);f._graphy_reader=this}_error(e){throw this._b_destroyed=!0,new Error(e)}bind(e){let t=this.transform;e.error&&t.on("error",e.error),e.comment&&t.on("comment",e.comment),e.read&&t.once("read",e.read),e.progress&&t.on("progress",e.progress),e.eof&&t.once("eof",e.eof),e.end&&t.once("end",e.end),e.finish&&t.once("finish",e.finish),e.data&&t.on("data",e.data)}parse(){let e=this._f_state();for(;typeof e=="function";)e=e.apply(this)}statement(){let e=this.s;this.n;let t=this.i,s=this._f_data_quad,a=this.create_named_node,n=this.create_named_node_escapeless,d=this.create_languaged_literal,u=this.create_blank_node,x=this._dc_factory.simpleLiteral,E=this._dc_factory.datatypedLiteral,A=this._kt_default_graph;for(;;){L.lastIndex=t;let _=L.exec(e);if(_){t=L.lastIndex;let l,m=!1;if(_[4]){let r=_[4].slice(1);l=n(r)}else if(_[5])l=u(_[5]);else{m=!0;let r=_[9];if(_[10])if(_[11]){let i=this.create_named_node_escapeless(_[11]);l=E(r,i)}else if(_[12]){let i=_[12].toLowerCase();l=d(r,i)}else l=x(r);else{this._s_literal=r,this.i=t;{let c=_[1];c||typeof c=="string"?this._kt_subject=n(c):this._kt_subject=u(_[2])}this._kt_predicate=n(_[3]);let i=this.strlit_contents();if(i&&this.statement!==i)return i;{let c=this._r_clean;c.lastIndex=this.i;let h=c.exec(e);this.emit_comments&&this.emit_comments(h[1]),t=c.lastIndex;continue}}}let p=A;if(m){let r=_[13];r||typeof r=="string"?p=n(r):_[14]&&(p=u(_[14]))}else{let r=_[6];r||typeof r=="string"?p=n(r):_[7]&&(p=u(_[7]))}let f;{let r=_[1];r||typeof r=="string"?f=n(r):f=u(_[2])}let y=_[3];s(f,n(y),l,p),this.emit_comments&&this.emit_comments(_[8]||_[15])}else{N.lastIndex=t;let l=N.exec(e);if(l){t=N.lastIndex;let m,p=!1;if(l[4]){let i=l[4].slice(1);m=a(k.test(i)?i.replace(b,g):i)}else if(l[5])m=u(k.test(l[5])?l[5].replace(b,g):l[5]);else{p=!0;let i=l[9];if(l[10])if(i=v(i),l[11]){let c=this.create_named_node(l[11]);m=E(i,c)}else if(l[12]){let c=l[12].toLowerCase();m=d(i,c)}else m=x(i);else{this._s_literal=i,this.i=t;{let h=l[1];h||typeof h=="string"?this._kt_subject=a(k.test(h)?h.replace(b,g):h):this._kt_subject=u(l[2])}this._kt_predicate=a(k.test(l[3])?l[3].replace(b,g):l[3]);let c=this.strlit_contents();if(c&&this.statement!==c)return c;{let h=this._r_clean;h.lastIndex=this.i;let R=h.exec(e);this.emit_comments&&this.emit_comments(R[1]),t=h.lastIndex;continue}}}let f=A;if(p){let i=l[13];i||typeof i=="string"?f=a(k.test(i)?i.replace(b,g):i):l[14]&&(f=u(l[14]))}else{let i=l[6];i||typeof i=="string"?f=a(k.test(i)?i.replace(b,g):i):l[7]&&(f=u(l[7]))}let y;{let i=l[1];i||typeof i=="string"?y=a(k.test(i)?i.replace(b,g):i):y=u(l[2])}let r=l[3];s(y,a(k.test(r)?r.replace(b,g):r),m,f),this.emit_comments&&this.emit_comments(l[8]||l[15])}else if(j.lastIndex=t,j.exec(e))t=j.lastIndex,this._error(`Failed to read statement: +\`${e.substr(t,80).replace(/\n/g,"⏎")} [...]\` + ^ starting here`);else break}}return this.s=e.substr(t),this._f_state=this.statement,1}strlit_contents(){let{s:e,n:t,i:s}=this;D.lastIndex=s;let a=D.exec(e);if(a){let n=a.index,d=e.slice(s,n);return this._s_literal+=v(d),this.i=n+a[0].length,this._b_trim_start=!0,this.datatype_or_langtag()||this.statement}else{let n=e.slice(s),[d,u]=Y(n);this._s_literal+=d,this.i=s=t-u.length,this._b_trim_start=!1}return sthis.max_token_length?this.parse_error("strlit_contents"):(this._f_state=this.strlit_contents,this.s=e.slice(s),this.eos&&this.eos(),1)}datatype_or_langtag(){let{s:e,n:t,i:s}=this,a=e[s];for(;sthis.max_token_length?this.parse_error("datatype_or_langtag"):(this._f_state=this.datatype_or_langtag,this.s=e.slice(s),this.eos&&this.eos(),1)}statement_term(){let{s:e,n:t,i:s}=this,a=e.indexOf(".",s);return a>-1?(this._b_trim_start=!0,this.i=a+1,this.statement):(/^\s*$/.test(e.slice(s))||this.parse_error("statement_term"),this._b_trim_start=!1,this._f_state=this.statement_term,this.s=e.slice(s),this.eos&&this.eos(),1)}post_object(){let{s:e,n:t,i:s}=this;if(S.lastIndex=s,S.exec(e),s=S.lastIndex,s>=t)return this._f_state=this.post_object,this.s=e.slice(s),this.eos&&this.eos(),1;switch(e[s]){case".":return this.i=s+1,this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_default_graph),this.statement;case"<":case"_":return this.i=s,this.graph();default:this.i=s,this.parse_error("post_object")}}graph(){let{s:e,n:t,i:s}=this;I.lastIndex=s;let a=I.exec(e);if(a){this.i=I.lastIndex;let n=this.create_named_node(a[1]);return this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,n),this.statement_term()}else{O.lastIndex=s;let n=O.exec(e);if(n){this.i=O.lastIndex;let d=this._dc_factory.blankNode(n[1]);return this._f_data_quad(this._kt_subject,this._kt_predicate,this._kt_object,d),this.statement_term()}}return this._f_state=this.graph,this.s=e.slice(s),this.eos&&this.eos(),1}parse_error(e){return this._error(`Failed to read ${e}: +\`${this.s.substr(this.i,80).replace(/\n/g,"⏎")} [...]\` + ^ starting here`)}destroy(e){this._f_data_quad=()=>{},!e&&this._ds_input&&this._ds_input.destroy(e),this.transform.demolish(e)}}var q=function(...o){let e={};if(o.length){let t=o[0];if(t&&t.input&&typeof t.input.string>"u"&&!t.input.stream&&(t=t.input),typeof t=="string")e.input={string:t};else if(t===null)e.input=null;else if(typeof t.setEncoding=="function")e.input={stream:t};else{if(typeof t.pipeTo=="function")throw new TypeError("Sorry, WHATWG streams are currently not supported :(");if(t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"){if(e=t,o.length>1)throw new TypeError(`unexpected argument(s) after config struct: ${o.slice(1)}`)}else throw new TypeError(`unexpected input type: ${t}`)}if(o.length>1&&(Object.assign(e,o[1]),o.length>2))throw new TypeError(`unexpected argument(s) after input and config struct: ${o.slice(2)}`)}return new te(e).transform};const se=P(q),ae=M({__proto__:null,default:se},[q]);export{ae as m}; diff --git a/converter/assets/main-Cwp2YZyg.js b/converter/assets/main-Cwp2YZyg.js new file mode 100644 index 0000000..89fd779 --- /dev/null +++ b/converter/assets/main-Cwp2YZyg.js @@ -0,0 +1,31 @@ +import{g as z,m as O}from"./index-DtgbetCt.js";import{m as F}from"./main-B9Y9bPv0.js";function G(x,e){for(var i=0;is[t]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}if(typeof queueMicrotask!="function"){let x=Promise.resolve();try{queueMicrotask=e=>x.then(e).catch(i=>setTimeout(()=>{throw i},0))}catch{}}const p=O,I=F,j=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}]([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}])?)?$/u,k=1,T=2,C=4;class E extends I{constructor(e={}){super(e);let{prefixes:i={},lists:s=null,debug:t=!1,style:r=null}=e;Object.assign(this,{_b_debug:t,_s_indent:" ",_b_simplify_default_graph:!1,_xc_directives:0,_s_token_prefix:"@prefix"});let f="";if(r){let _=r.graph_keyword||r.graphKeyword||r["graph-keyword"];if(_)if(_===!0)f="GRAPH ";else{if(typeof _!="string")throw new TypeError(`Invalid argument type given for 'graph' token: ${_}`);if(/^graph$/i.test(_))f=_+" ";else throw new Error(`Graph token must equal case-insensitive "GRAPH"; found: "${_}"`)}let d=r.simplify_default_graph||r.simplifyDefaultGraph||r["simplify-default-graph"];d&&(this._b_simplify_default_graph=!!d),r.indent&&(this._s_indent=r.indent.replace(/[^\s]/g,""));let h=r.directives||r.directives;if(h)switch(h){case"sparql":{this._xc_directives=k,this._s_token_prefix="prefix";break}case"Sparql":{this._xc_directives=k|T,this._s_token_prefix="Prefix";break}case"SPARQL":{this._xc_directives=k|C,this._s_token_prefix="PREFIX";break}case"turtle":break;case"Turtle":{this._xc_directives=T,this._s_token_prefix="@Prefix";break}case"TURTLE":{this._xc_directives=C,this._s_token_prefix="@PREFIX";break}default:throw new Error(`Value not understood for 'directives' option: ${h}`)}}this._s_graph_keyword=f,s&&(this._serialize_list_object=function(_,d){let h=this._transcode_list(_);return this._encode_objects(h,d)});let a=this._s_token_prefix,l=this._xc_directives&k?` +`:` . +`,n="";try{for(let _ in i){if(!j.test(_))throw new Error(`Invlalid prefix id for application/trig RDF serialization format: '${_}'`);n+=`${a} ${_}: ${p.namedNode(i[_]).verbose()}${l}`}}catch(_){queueMicrotask(()=>{this.emit("error",_)})}n&&this.push(n)}_serialize_prefixes(e){let i=this._xc_state===2?` + +`:"";this._xc_state=0,this._h_prefixes={...this._h_prefixes};let s=this._s_token_prefix,t=this._xc_directives&k?` +`:` . +`;for(let r in e){if(!j.test(r))throw new Error(`Invlalid prefix id for application/trig RDF serialization format: '${r}'`);i+=`${s} ${r}: ${p.namedNode(e[r]).verbose()}${t}`,this._h_prefixes[r]=e[r]}return p.cache_prefixes(this._h_prefixes),i}_serialize_c3(e){let{_h_prefixes:i,_s_indent:s}=this,t=this._xc_state!==2?` +`:"";this._xc_state=2;let r="",f=null;for(let a in e){if(a[0]==="`"){let c=this._apply_directive(a,e[a]);c.write&&(t+=r+c.write,r=""),c.exit&&(f=c.exit);continue}let l=t.length;t+=r+p.c1_node(a,i).terse(i)+" ";let n="",_="",d=e[a],h=t.length,w=!0,o=null;for(let c in d){if(c[0]==="`"){let m=this._apply_directive(c,d[c]);m.write&&(t+=(n?_:` +`)+s+m.write,_="",n=s),m.exit&&(o=m.exit);continue}let g=d[c],y=this._encode_objects(g);if(!y)continue;if(w=!1,c[0]==="_"&&c[1]===":")throw new Error(`Cannot use blank node in predicate position of c3 hash; subject:'${a}', predicate:'${c}'`);let b=p.c1_named_node(c,i),v=b.isRdfTypeAlias?"a":b.terse(i);t+=_+n+v+" "+y,this._xc_state=2,_=` ; +`,n=s,o&&o()}if(w){t=t.slice(0,l)+t.slice(h);continue}r=` +`,t+=`${_?" ":n}. +`,f&&f()}return t+=` +`,t}_serialize_c4(e){let{_h_prefixes:i,_s_indent:s}=this,t=this._xc_state!==2?` +`:"";this._xc_state=2;let r=this._b_simplify_default_graph,f=this._s_graph_keyword,a=null;for(let l in e){if(l[0]==="`"){let o=this._apply_directive(l,e[l]);o.write&&(t+=o.write),o.exit&&(a=o.exit);continue}let n=p.c1_node(l,i).terse(i);t+=n?f+n+` { +`:r?"":f+`{ +`;let _=!n&&r?"":s;this._xc_state=2;let d=e[l],h="",w=null;for(let o in d){if(o[0]==="`"){let u=this._apply_directive(o,d[o]);u.write&&(t+=h+_+u.write,h=""),u.exit&&(w=u.exit);continue}let c=t.length;t+=h+_+p.c1_node(o,i).terse(i)+" ";let g="",y="",b=d[o],v=t.length,m=!0,A=null;for(let u in b){if(u[0]==="`"){let $=this._apply_directive(u,b[u]);$.write&&(t+=(g?y:` +`)+s+_+$.write,y="",g=s+_),$.exit&&(A=$.exit);continue}let D=b[u],R=this._encode_objects(D);if(!R)continue;if(m=!1,u[0]==="_"&&u[1]===":")throw new Error(`Cannot use blank node in predicate position of c4 hash; graph:'${l}', subject:'${o}', predicate:'${u}'`);let P=p.c1_named_node(u,i),q=P.isRdfTypeAlias?"a":P.terse(i);t+=y+g+q+" "+R,this._xc_state=2,y=` ; +`,g=s+_,A&&A()}if(m){t=t.slice(0,c)+t.slice(v);continue}h=` +`,t+=`${y?" ":g}. +`,w&&w()}t+=(n||!r?`} +`:"")+` +`,a&&a()}return t}_encode_objects(e,i=1){let{_h_prefixes:s,_s_indent:t,_hm_coercions:r}=this;switch(typeof e){case"string":return p.c1(e,s).terse(s);case"number":return p.number(e).terse(s);case"boolean":return p.boolean(e).terse(s);case"object":{if(e===null)throw new Error("Refusing to serialize null value given as an object of quad");if(Array.isArray(e)||e instanceof Set){let f="",a="";for(let l of e)Array.isArray(l)?f+=a+this._serialize_list_object(l,i):f+=a+this._encode_objects(l,i),a=", ";return f}else if(Object===e.constructor){let f="[",a=!0,l=null;for(let n in e){if(a=!1,f+=` +`+t.repeat(2+i),n[0]==="`"){let _=this._apply_directive(n,e[n]);_.write&&(f+=_.write),_.exit&&(l=_.exit);continue}f+=p.c1(n,s).terse(s)+" "+this._encode_objects(e[n],i+1)+" ;"}return f+=(a?"":` +`+t.repeat(1+i))+"]",l&&l(),f}else{if(r.has(e.constructor))return r.get(e.constructor).apply(this,[e,i]).terse(s);if(e.isGraphyTerm)return e.terse(s);if(e.termType)return p.from.term(e).terse(s)}}default:throw new Error(`Bad type for RDF object: [${typeof e}] ${e&&e.constructor}`)}}_serialize_collection_object(e,i){let s=this._s_indent,t="(";for(let r of e){let f="";Array.isArray(r)?f=this._serialize_collection_object(r,i+1):f=this._encode_objects(r,i+1),t+=` +`+s.repeat(2+i)+f}return e.length&&(t+=` +`+s.repeat(1+i)),t+=")",t}_serialize_quad(e){let i=this._h_prefixes,s=p.from.quad(e),t=s.graph.terse(i);this._s_push+=(this._xc_state!==2?` +`:"")+this._s_graph_keyword+(t?t+" ":"")+`{ + `+s.subject.terse(i)+" "+s.predicate.terse(i)+" "+s.object.terse(i)+` . +} + +`,this._xc_state=2}}Object.assign(E.prototype,{anonymous_blank_nodes:!0,_serialize_c3r:E.prototype._serialize_c3,_serialize_c4r:E.prototype._serialize_c4,_serialize_comment:I.prototype._serialize_hash_comment,_serialize_list_object:E.prototype._serialize_collection_object});var S=function(x){return new E(x)};const M=z(S),N=G({__proto__:null,default:M},[S]);export{N as m}; diff --git a/converter/assets/main-DYtbBt7L.js b/converter/assets/main-DYtbBt7L.js new file mode 100644 index 0000000..ea80b16 --- /dev/null +++ b/converter/assets/main-DYtbBt7L.js @@ -0,0 +1,14 @@ +import{c as Ss,g as As,s as ws,m as $s}from"./index-DtgbetCt.js";import{m as Ds}from"./main-9bW7T1LR.js";function Ts(v,t){for(var n=0;ne[_]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}var ut={exports:{}};/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(v,t){(function(n,e){e(t)})(Ss,function(n){function e(){for(var i=arguments.length,s=Array(i),r=0;r1){s[0]=s[0].slice(0,-1);for(var h=s.length-1,l=1;l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Le=x-y,ee=Math.floor,Pe=String.fromCharCode;function xe(i){throw new RangeError(ss[i])}function is(i,s){for(var r=[],h=i.length;h--;)r[h]=s(i[h]);return r}function dt(i,s){var r=i.split("@"),h="";r.length>1&&(h=r[0]+"@",i=r[1]),i=i.replace(ts,".");var l=i.split("."),g=is(l,s).join(".");return h+g}function pt(i){for(var s=[],r=0,h=i.length;r=55296&&l<=56319&&r>1,s+=ee(s/r);s>Le*S>>1;l+=x)s=ee(s/Le);return ee(l+(Le+1)*s/(s+Q))},bt=function(s){var r=[],h=s.length,l=0,g=V,I=B,w=s.lastIndexOf(K);w<0&&(w=0);for(var N=0;N=128&&xe("not-basic"),r.push(s.charCodeAt(N));for(var U=w>0?w+1:0;U=h&&xe("invalid-input");var j=_s(s.charCodeAt(U++));(j>=x||j>ee((f-l)/T))&&xe("overflow"),l+=j*T;var C=M<=I?y:M>=I+S?S:M-I;if(jee(f/H)&&xe("overflow"),T*=H}var L=r.length+1;I=mt(l-A,L,A==0),ee(l/L)>f-g&&xe("overflow"),g+=ee(l/L),l%=L,r.splice(l++,0,g)}return String.fromCodePoint.apply(String,r)},kt=function(s){var r=[];s=pt(s);var h=s.length,l=V,g=0,I=B,w=!0,N=!1,U=void 0;try{for(var A=s[Symbol.iterator](),T;!(w=(T=A.next()).done);w=!0){var M=T.value;M<128&&r.push(Pe(M))}}catch(De){N=!0,U=De}finally{try{!w&&A.return&&A.return()}finally{if(N)throw U}}var j=r.length,C=j;for(j&&r.push(K);C=l&&meee((f-g)/Y)&&xe("overflow"),g+=(H-l)*Y,l=H;var ae=!0,be=!1,he=void 0;try{for(var $e=s[Symbol.iterator](),Nt;!(ae=(Nt=$e.next()).done);ae=!0){var Ot=Nt.value;if(Otf&&xe("overflow"),Ot==l){for(var Ne=g,Oe=x;;Oe+=x){var Ce=Oe<=I?y:Oe>=I+S?S:Oe-I;if(Ne>6|192).toString(16).toUpperCase()+"%"+(s&63|128).toString(16).toUpperCase():r="%"+(s>>12|224).toString(16).toUpperCase()+"%"+(s>>6&63|128).toString(16).toUpperCase()+"%"+(s&63|128).toString(16).toUpperCase(),r}function Ie(i){for(var s="",r=0,h=i.length;r=194&&l<224){if(h-r>=6){var g=parseInt(i.substr(r+4,2),16);s+=String.fromCharCode((l&31)<<6|g&63)}else s+=i.substr(r,6);r+=6}else if(l>=224){if(h-r>=9){var I=parseInt(i.substr(r+4,2),16),w=parseInt(i.substr(r+7,2),16);s+=String.fromCharCode((l&15)<<12|(I&63)<<6|w&63)}else s+=i.substr(r,9);r+=9}else s+=i.substr(r,3),r+=3}return s}function Fe(i,s){function r(h){var l=Ie(h);return l.match(s.UNRESERVED)?l:h}return i.scheme&&(i.scheme=String(i.scheme).replace(s.PCT_ENCODED,r).toLowerCase().replace(s.NOT_SCHEME,"")),i.userinfo!==void 0&&(i.userinfo=String(i.userinfo).replace(s.PCT_ENCODED,r).replace(s.NOT_USERINFO,te).replace(s.PCT_ENCODED,c)),i.host!==void 0&&(i.host=String(i.host).replace(s.PCT_ENCODED,r).toLowerCase().replace(s.NOT_HOST,te).replace(s.PCT_ENCODED,c)),i.path!==void 0&&(i.path=String(i.path).replace(s.PCT_ENCODED,r).replace(i.scheme?s.NOT_PATH:s.NOT_PATH_NOSCHEME,te).replace(s.PCT_ENCODED,c)),i.query!==void 0&&(i.query=String(i.query).replace(s.PCT_ENCODED,r).replace(s.NOT_QUERY,te).replace(s.PCT_ENCODED,c)),i.fragment!==void 0&&(i.fragment=String(i.fragment).replace(s.PCT_ENCODED,r).replace(s.NOT_FRAGMENT,te).replace(s.PCT_ENCODED,c)),i}function Ue(i){return i.replace(/^0*(.*)/,"$1")||"0"}function Me(i,s){var r=i.match(s.IPV4ADDRESS)||[],h=p(r,2),l=h[1];return l?l.split(".").map(Ue).join("."):i}function gt(i,s){var r=i.match(s.IPV6ADDRESS)||[],h=p(r,3),l=h[1],g=h[2];if(l){for(var I=l.toLowerCase().split("::").reverse(),w=p(I,2),N=w[0],U=w[1],A=U?U.split(":").map(Ue):[],T=N.split(":").map(Ue),M=s.IPV4ADDRESS.test(T[T.length-1]),j=M?7:8,C=T.length-j,H=Array(j),L=0;L1){var ye=H.slice(0,re.index),me=H.slice(re.index+re.length);_e=ye.join(":")+"::"+me.join(":")}else _e=H.join(":");return g&&(_e+="%"+g),_e}else return i}var ls=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,hs="".match(/(){0}/)[1]===void 0;function ne(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={},h=s.iri!==!1?R:b;s.reference==="suffix"&&(i=(s.scheme?s.scheme+":":"")+"//"+i);var l=i.match(ls);if(l){hs?(r.scheme=l[1],r.userinfo=l[3],r.host=l[4],r.port=parseInt(l[5],10),r.path=l[6]||"",r.query=l[7],r.fragment=l[8],isNaN(r.port)&&(r.port=l[5])):(r.scheme=l[1]||void 0,r.userinfo=i.indexOf("@")!==-1?l[3]:void 0,r.host=i.indexOf("//")!==-1?l[4]:void 0,r.port=parseInt(l[5],10),r.path=l[6]||"",r.query=i.indexOf("?")!==-1?l[7]:void 0,r.fragment=i.indexOf("#")!==-1?l[8]:void 0,isNaN(r.port)&&(r.port=i.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?l[4]:void 0)),r.host&&(r.host=gt(Me(r.host,h),h)),r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&!r.path&&r.query===void 0?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==r.reference&&(r.error=r.error||"URI is not a "+s.reference+" reference.");var g=W[(s.scheme||r.scheme||"").toLowerCase()];if(!s.unicodeSupport&&(!g||!g.unicodeSupport)){if(r.host&&(s.domainHost||g&&g.domainHost))try{r.host=ge.toASCII(r.host.replace(h.PCT_ENCODED,Ie).toLowerCase())}catch(I){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+I}Fe(r,b)}else Fe(r,h);g&&g.parse&&g.parse(r,s)}else r.error=r.error||"URI can not be parsed.";return r}function fs(i,s){var r=s.iri!==!1?R:b,h=[];return i.userinfo!==void 0&&(h.push(i.userinfo),h.push("@")),i.host!==void 0&&h.push(gt(Me(String(i.host),r),r).replace(r.IPV6ADDRESS,function(l,g,I){return"["+g+(I?"%25"+I:"")+"]"})),(typeof i.port=="number"||typeof i.port=="string")&&(h.push(":"),h.push(String(i.port))),h.length?h.join(""):void 0}var It=/^\.\.?\//,vt=/^\/\.(\/|$)/,Et=/^\/\.\.(\/|$)/,cs=/^\/?(?:.|\n)*?(?=\/|$)/;function ve(i){for(var s=[];i.length;)if(i.match(It))i=i.replace(It,"");else if(i.match(vt))i=i.replace(vt,"/");else if(i.match(Et))i=i.replace(Et,"/"),s.pop();else if(i==="."||i==="..")i="";else{var r=i.match(cs);if(r){var h=r[0];i=i.slice(h.length),s.push(h)}else throw new Error("Unexpected dot segment condition")}return s.join("")}function se(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=s.iri?R:b,h=[],l=W[(s.scheme||i.scheme||"").toLowerCase()];if(l&&l.serialize&&l.serialize(i,s),i.host&&!r.IPV6ADDRESS.test(i.host)){if(s.domainHost||l&&l.domainHost)try{i.host=s.iri?ge.toUnicode(i.host):ge.toASCII(i.host.replace(r.PCT_ENCODED,Ie).toLowerCase())}catch(w){i.error=i.error||"Host's domain name can not be converted to "+(s.iri?"Unicode":"ASCII")+" via punycode: "+w}}Fe(i,r),s.reference!=="suffix"&&i.scheme&&(h.push(i.scheme),h.push(":"));var g=fs(i,s);if(g!==void 0&&(s.reference!=="suffix"&&h.push("//"),h.push(g),i.path&&i.path.charAt(0)!=="/"&&h.push("/")),i.path!==void 0){var I=i.path;!s.absolutePath&&(!l||!l.absolutePath)&&(I=ve(I)),g===void 0&&(I=I.replace(/^\/\//,"/%2F")),h.push(I)}return i.query!==void 0&&(h.push("?"),h.push(i.query)),i.fragment!==void 0&&(h.push("#"),h.push(i.fragment)),h.join("")}function yt(i,s){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=arguments[3],l={};return h||(i=ne(se(i,r),r),s=ne(se(s,r),r)),r=r||{},!r.tolerant&&s.scheme?(l.scheme=s.scheme,l.userinfo=s.userinfo,l.host=s.host,l.port=s.port,l.path=ve(s.path||""),l.query=s.query):(s.userinfo!==void 0||s.host!==void 0||s.port!==void 0?(l.userinfo=s.userinfo,l.host=s.host,l.port=s.port,l.path=ve(s.path||""),l.query=s.query):(s.path?(s.path.charAt(0)==="/"?l.path=ve(s.path):((i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)&&!i.path?l.path="/"+s.path:i.path?l.path=i.path.slice(0,i.path.lastIndexOf("/")+1)+s.path:l.path=s.path,l.path=ve(l.path)),l.query=s.query):(l.path=i.path,s.query!==void 0?l.query=s.query:l.query=i.query),l.userinfo=i.userinfo,l.host=i.host,l.port=i.port),l.scheme=i.scheme),l.fragment=s.fragment,l}function os(i,s,r){var h=d({scheme:"null"},r);return se(yt(ne(i,h),ne(s,h),h,!0),h)}function us(i,s){return typeof i=="string"?i=se(ne(i,s),s):a(i)==="object"&&(i=ne(se(i,s),s)),i}function ds(i,s,r){return typeof i=="string"?i=se(ne(i,r),r):a(i)==="object"&&(i=se(i,r)),typeof s=="string"?s=se(ne(s,r),r):a(s)==="object"&&(s=se(s,r)),i===s}function ps(i,s){return i&&i.toString().replace(!s||!s.iri?b.ESCAPE:R.ESCAPE,te)}function le(i,s){return i&&i.toString().replace(!s||!s.iri?b.PCT_ENCODED:R.PCT_ENCODED,Ie)}var Ae={scheme:"http",domainHost:!0,parse:function(s,r){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s},serialize:function(s,r){var h=String(s.scheme).toLowerCase()==="https";return(s.port===(h?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}},jt={scheme:"https",domainHost:Ae.domainHost,parse:Ae.parse,serialize:Ae.serialize};function Rt(i){return typeof i.secure=="boolean"?i.secure:String(i.scheme).toLowerCase()==="wss"}var we={scheme:"ws",domainHost:!0,parse:function(s,r){var h=s;return h.secure=Rt(h),h.resourceName=(h.path||"/")+(h.query?"?"+h.query:""),h.path=void 0,h.query=void 0,h},serialize:function(s,r){if((s.port===(Rt(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){var h=s.resourceName.split("?"),l=p(h,2),g=l[0],I=l[1];s.path=g&&g!=="/"?g:void 0,s.query=I,s.resourceName=void 0}return s.fragment=void 0,s}},St={scheme:"wss",domainHost:we.domainHost,parse:we.parse,serialize:we.serialize},xs={},At="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ie="[0-9A-Fa-f]",ms=_(_("%[EFef]"+ie+"%"+ie+ie+"%"+ie+ie)+"|"+_("%[89A-Fa-f]"+ie+"%"+ie+ie)+"|"+_("%"+ie+ie)),bs="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ks="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",gs=e(ks,'[\\"\\\\]'),Is="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",vs=new RegExp(At,"g"),Ee=new RegExp(ms,"g"),Es=new RegExp(e("[^]",bs,"[\\.]",'[\\"]',gs),"g"),wt=new RegExp(e("[^]",At,Is),"g"),ys=wt;function He(i){var s=Ie(i);return s.match(vs)?s:i}var $t={scheme:"mailto",parse:function(s,r){var h=s,l=h.to=h.path?h.path.split(","):[];if(h.path=void 0,h.query){for(var g=!1,I={},w=h.query.split("&"),N=0,U=w.length;Nv.then(t).catch(n=>setTimeout(()=>{throw n},0))}catch{}}const P=Ns,Os=ws,qe=Ds,Te=$s,Cs=v=>Te.quad(v._kt_subject,v._kt_predicate,v._kt_object,v._kt_graph),Pt=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}]([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}])?)?$/u,Ft=/^([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_:0-9]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%])(([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.:]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%])*([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}:]|%[A-Fa-f0-9]{2}|\\[_~.\-!$&'()*+,;=/?#@%]))?$/u,Ls=/^[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_0-9]([A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}.]*[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u{02ff}\u{0370}-\u{037d}\u{037f}-\u{1fff}\u{200c}-\u{200d}\u{2070}-\u{218f}\u{2c00}-\u{2fef}\u{3001}-\u{d7ff}\u{f900}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{effff}_\-0-9\xb7\u{0300}-\u{036f}\u{203f}-\u{2040}])?$/u,ze=/^([^\0-\x20<>"{}|^`\\]|\\u[A-Fa-f0-9]{4}|\\U[A-Fa-f0-9]{8})*$/,Ps=/^([^\0-\x20<>"{}|^`])*$/,z=/\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})/g,G=(v,t,n)=>String.fromCodePoint(parseInt(t||n,16)),q=Object.prototype.hasOwnProperty,J=/([A-Za-z][A-Za-z0-9_-]*)?:([A-Za-z_0-9:][A-Za-z0-9_:-]*)(?:\s+|(?=\.?[<[("';,)\]#{}]|\.[\s\0]))/y,Ge=/([^\s#@<[("':_{}][^\s#@<[("':{}]*)?:((?:[^\s#@<[("'.;,{})\]\\](?:[^\s#@<[("';,{})\]\\]*[^\s#@<[("'.;,{})\]\\])?)?)(?:\s+|(?=\.?[<[("';,)\]#{}]|\.[\s\0]))/y,Ve=/([^\s#@<[("':_{}][^\s#@<[("':{}]*)?:((?:(?:[^\s#@<[("'.;,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"]))(?:(?:[^\s#@<[("';,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"]))*(?:[^\s#@<[("'.;,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"])))?)?)(?:\s+|(?=\.?[<[("';,)\]#{}]|\.[\s\0]))/y,pe=/\\(.)/g,Z=/_:(.(?:[^\s:<;,)\]#}]*[^\s:<.;,)\]#}])?)(?:\s+|(?=[<:{,;\])#]))/y,Be=/_:(.(?:[^\s:<;,)\]#}]*[^\s:<.;,)\]#}])?)(?:\s+|(?=\.?[<:{,;\])#])|(?=\.[\s@#<({[}]))/y,$=/<([^\\>]*)>\s*/y,D=/<([^>]*)>\s*/y,fe=/([+-]?(?:[0-9]+(\.[0-9]+)?|(\.[0-9]+))(\.?[eE][+-]?[0-9]+)?)(?:\s+|(?=\.[^eE0-9]|[;,)\]]))/y,ce=/(?:(true|TRUE)|false|FALSE)\s*/y,Ze=/a(?:\s+|(?=[[("'<#]))/y,Ke=/\^\^/y,m=/\s*/y,Xe=/@([A-Za-z]+(?:-[A-Za-z0-9-]+)*)(?:\s+|(?=[.},;\])#]))/y,We=/(?:(@prefix)|[pP][rR][eE][fF][iI][xX])\s*/y,Ye=/([^#:]*):\s*/iy,Je=/(?:(@base)|[bB][aA][sS][eE])\s*/y,Qe=/(?:graph)?\s*<([^\\>]*)>\s*\{\s*/iy,et=/(?:graph)?\s*([^\s#@<[("':_{}][^\s#@<[("':{}]*)?:((?:(?:[^\s#@<[("'.;,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"]))(?:(?:[^\s#@<[("';,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"]))*(?:[^\s#@<[("'.;,{})\]\\]|\\(?:%[0-9A-Fa-f][0-9A-Fa-f]|[^\s"])))?)?)\s*\{\s*/iy,tt=/(?:graph)?\s*_:(.(?:[^\s:<;,)\]#}]*[^\s:<.;,)\]#}])?)\s*\{\s*/iy,st=/(?:graph)?\s*\[\s*\]\s*\{\s*/iy,it=/(?:graph)?\s*<([^>]*)>\s*\{\s*/iy,rt=/graph(?:\s+|(?=[#<[{]))/iy,k=/(#[^\n]*\n\s*)+/y,F=/^[A-Za-z][A-Za-z0-9.\-+]*:/,_t=/^((([A-Za-z0-9.\-+]*:\/)?\/[^/>]*)?(\/(?:[^/>]*\/)*)?[^>]*)$/,oe=/\[\s*\]\s*/y,je=/\[(?:\s+|(?=[^\]]))/y,Re=/\(\s*/y,at=/\]\s*/y,nt=/\{\s*/y,ue=/\}\s*/y,lt=/\.\s*/y,ht=/[\\"\r\n]/g,ft=/[\\'\r\n]/g,Ut=/"{1,2}$/g,Mt=/'{1,2}$/g,ct=/(\\|""")/g,ot=/(\\|''')/g,Se=(v,t,n,e,_,a)=>{if(t)switch(t){case"t":return" ";case"n":return` +`;case"r":return"\r";case"f":return"\f";case"b":return"\b";default:console.assert(`bad regex escape char mapping: '${t}'`)}else{if(n)return n;if(e)return String.fromCodePoint(parseInt(e,16));if(_)return String.fromCodePoint(parseInt(_,16));if(a)throw a[0]==="\\"?new Error(`expected string_literal but invalid escape sequence within contents: '${a}'. failed to parse a valid token`):new Error(`expected string_literal but invalid whitespace character within contents: ${JSON.stringify(a)}. failed to parse a valid token`);console.assert("unexpected no match branch in escape sequence replace callback")}},Fs=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\.))/g,Ht=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|([\r\n]|\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,qt=v=>v.replace(Fs,Se),zt=v=>{let t=Qt.exec(v);if(t){let n=t.index;return[v.slice(0,n).replace(Ht,Se),v.slice(n)]}else return[v.replace(Ht,Se),""]},Us=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\.))/g,Gt=/(?:\\(?:([tnrfb])|([\\"'])|u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8}))|(\\[^uU]|\\u[^]{4}|\\U[^]{8}))/g,Vt=v=>v.replace(Us,Se),Bt=v=>{let t=Qt.exec(v);if(t){let n=t.index;return[v.slice(0,n).replace(Gt,Se),v.slice(n)]}else return[v.replace(Gt,Se),""]},[Qt,Zt,Kt,Xt,Wt]=(()=>{function v(n){let e=RegExp.prototype.exec.call(this,n);if(e){let _=e[0].length-e[1].length;e.index+=_,e[0]=e[0].slice(_)}return e}let t=(()=>{try{new RegExp("(?(_.exec=a,_)}return n=>n()})();return[t(()=>new RegExp("(?new RegExp('(?new RegExp("(?new RegExp('(?new RegExp("(?(Ge.lastIndex=t,[Ge.exec(v),Ge.lastIndex]),Jt=(v,t)=>(Ve.lastIndex=t,[Ve.exec(v),Ve.lastIndex]);function Ms(v,t,n,e){let _=Math.min(t,Math.abs(t-15)),a=v.s;return v.error(` +\`${a.substr(_,_+90).replace(/[\n\t]/g," ")}\` + ${" ".repeat(t-_)}^ +expected ${n} ${e||""}. failed to parse a valid token starting at ${a[t]?'"'+a[t]+'"':"<>"}`)}class Hs extends qe.Transform{constructor(t){super({decodeStrings:!1,writableObjectMode:!1,readableObjectMode:!0,flush:t.flush,transform:t.transform})}pipe(t){let n=t;return n._writableState.objectMode?t.isGraphyWritable&&(t=qe.quads_to_writable()):t=qe.quads_to_json(),t!==n?(super.pipe(t),t.pipe(n)):super.pipe(n)}}class qs{constructor(t={}){let{input:n=null,state:e={}}=t,{blank_node_index:_=0,prefixes:a={},labels:c={}}=e,o=Te.adopt(t.dataFactory||t.data_factory||Te.unfiltered),d=o.defaultGraph();o!==Te.unfiltered&&(d=Object.create(d));let u=o.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),b=o.blankNode,R=o.namedNode;if(this.emit_data=Te.unfiltered===o?function(){E.push(Cs(this))}:function(){let f=o.quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_graph);E.push(f)},Object.assign(this,{i:0,s:"",n:0,pre:t.prepend||"",_b_debug:t.debug||!1,_b_relax:t.relax||!1,_dc_factory:o,_f_state:this.block,_h_prefixes:a,_b_destroyed:!1,_s_base_url:"",_s_base_url_scheme:"",_s_base_url_root:"",_s_base_url_path:"",_kt_subject:null,_kt_predicate:u,_kt_object:null,_kt_graph:d,_s_literal:"",_kt_rdf_type:o.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_kt_rdf_first:u,_kt_rdf_rest:o.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),_kt_rdf_nil:o.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),_kt_default_graph:d,_a_nested:[],_h_labels:c,event:this.emit,data:this.emit_data,restore_data:this.emit_data,_a_queue_event:[],_b_expecting_full_stop:!1,_s_temp_prefix_id:null,_b_trim_start:!0,anonymous_blank_node:f=>b(f,!0),next_label(){let f="";do f="g"+_++;while(this._h_labels[f]);return this._h_labels[f]=2,f},eos:null,after_end_of_statement:this.post_object,_n_max_token_length:t.max_token_length||t.maxTokenLength||2048,_n_max_string_length:t.max_string_length||t.maxStringLength||1/0,_b_byte_tracking:t.byte_tracking||t.byteTracking||!1,_nb_seen:0,_nb_last:0,_nb_curr:0}),t.relaxed&&console.warn(new Error("no such option 'relaxed'; did you mean 'relax' ?").stack.replace(/^Error:/,"Warning:")),"validate"in t&&console.warn(new Error("option 'validate' has been deprecated. Validation is now enabled by default. Use the 'relax' option if you wish to disable validation.").stack.replace(/^Error:/,"Warning:")),Object.assign(this,t.relax?{blank_node(f){let x=this._h_labels[f];return x?x===1||(x===2?f=this._h_labels[f]=this.next_label():f=this._h_labels[f]):this._h_labels[f]=1,b(f)},check_named_node:R,check_named_node_escapeless:R,match_prefixed_name_escapeless:Yt,match_prefixed_name:Jt}:{blank_node(f){if(!Ls.test(f))return this.error(`invalid blank node label: "${f}"`);let x=this._h_labels[f];return x?x===1||(x===2?f=this._h_labels[f]=this.next_label():f=this._h_labels[f]):this._h_labels[f]=1,b(f)},check_named_node(f){return ze.test(f)?R(f):this.error(`invalid IRI: "${f}"`)},check_named_node_escapeless(f){return Ps.test(f)?R(f):this.error(`invalid IRI: "${f}"`)},match_prefixed_name_quick(f,x){return J.lastIndex=x,[J.exec(f),J.lastIndex]},match_prefixed_name_escapeless(f,x){let[y,S]=Yt(f,x);if(y&&!Ft.test(y[2])&&y[2]){this.error(`invalid prefixed name local name: "${y[2]}:"`);return}return[y,S]},match_prefixed_name(f,x){let[y,S]=Jt(f,x);if(y&&!Ft.test(y[2])){this.error(`invalid prefixed name local name: "${y[2]}:"`);return}return[y,S]}}),this.named_node=R,this.prefixed_name=function(f,x){return R(a[f]+x)},typeof t.base=="string")throw new TypeError(`invalid type 'string' was given for 'base' event listener: '${t.base}' +did you mean to use the 'base_uri' key instead?`);let p=t.base_uri||t.baseUri||t.baseURI||t.base_iri||t.baseIri||t.baseIRI;if(p){let f=_t.exec(p);this._s_base_url=f[1],this._s_base_url_root=f[2]||"",this._s_base_url_scheme=f[3]||"",this._s_base_url_path=f[4]||""}else if(t.base_url||t.baseUrl||t.baseURL)throw new Error(`invalid option: .base${t.base_url?"_url":t.baseUrl?"Url":t.baseURL?"URL":""}; use the '.base_uri' key instead`);let E=this.transform=new Hs({transform:(f,x,y)=>{let S=this.s=this.pre+f;this.n=S.length,this._b_trim_start?(m.lastIndex=0,m.exec(S),this.i=m.lastIndex):this.i=0,this.safe_parse(!0)&&(E.emit("progress",f.length),y())},flush:f=>{try{this.eof(1)}catch(x){this.destroy(x);return}f()}});if(E.on("pipe",f=>{this._ds_input=f;let x=this._b_byte_tracking;if(!x&&typeof f.setEncoding=="function")f.setEncoding("utf8");else{let y=E.write,S=new Os.StringDecoder("utf8"),Q=(V,K,X)=>{let ke=Buffer.from(V,"utf8").length;return this._nb_seen+=ke,this._nb_last=ke,y.call(E,V,K,X)},O=(V,K,X)=>{let ke=this._nb_last=V.length;return this._nb_seen+=ke,y.call(E,S.write(V),K,X)},B=(V,K,X)=>y.call(E,S.write(V),K,X);E.write=function(V,K,X){return V!==null?(typeof V=="string"?E.write=x?Q:y:E.write=x?O:B,E.write(V,K,X)):y.call(E,V,K,X)},x&&(this.emit_data=this.data=this.restore_data=function(){let V=this._dc_factory.quad(this._kt_subject,this._kt_predicate,this._kt_object,this._kt_graph),K=Buffer.from(this.s.slice(this.i)).length,X=this._nb_seen-K;V.byteRange=[this._nb_curr,X],this._nb_curr=X,this.transform.push(V)})}}),E.on("newListener",f=>{f==="comment"&&(this.emit_comments=x=>{let y=x.slice(1).replace(/\n\s+$/,"").split(/\n+\s*#/g);for(let S of y)E.emit("comment",S)})}),E._destroy=(...f)=>{this.destroy(...f)},this.bind(t),n)if(n.stream){let f=n.stream;queueMicrotask(()=>{f.pipe(E)})}else if(typeof n.string=="string"){let f=n.string;queueMicrotask(()=>{E.end(f,"utf8")})}else throw new TypeError(`Invalid argument for input parameter: ${typeof n=="object"?JSON.stringify(n):n}`)}safe_parse(){try{let t=this._f_state();for(;typeof t=="function";)t=t.apply(this)}catch(t){return this.destroy(t),!1}return!0}emit(t,...n){this.transform.emit(t,...n)}queue(t,...n){this._a_queue_event.push({event:t,args:n})}error(t){throw new Error(t)}parse_error(t,n=!1){let e=this.i,_=Math.min(e,Math.abs(e-15)),a=this.s;return this.error(` +\`${a.substr(_,_+90).replace(/[\n\t]/g," ")}\` + ${" ".repeat(e-_)}^ +expected ${t} ${n?"but encountered <>":""}. failed to parse a valid token starting at ${a[e]?'"'+a[e]+'"':"<>"}`)}info_error(t){let n=this.i,e=Math.min(n,Math.abs(n-15)),_=this.s;this.error(` +\`${_.substr(e,e+90).replace(/[\n\t]/g," ")}\` + ${" ".repeat(n-e)}^ +`+t)}eof(){if(this._a_queue_event.length){let n=this._a_queue_event;for(;n.length;){let e=n.shift();this[e.event](e.data)}}if(this.block!==this._f_state&&(this.s+="\0",this.n=this.s.length,this.safe_parse())){if(this.s===null)return;if(this.block!==this._f_state)return this.parse_error(this._f_state.name,!0)}if(this.ie&&(this.i=e=k.lastIndex,this.emit_comments&&this.emit_comments(_[0])),ethis.max_token_length)return this.parse_error("statement");this._f_state=this.statement,this.pre=t.slice(e),this.eos&&this.eos()}block(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("block");this._f_state=this.block,this.pre=t.slice(e),this.eos&&this.eos()}graph_or_subject(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("graph_or_subject");this._f_state=this.graph_or_subject,this.pre=t.slice(e),this.eos&&this.eos()}graph_or_subject_property_list(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("graph_or_subject_property_list");this._f_state=this.graph_or_subject_property_list,this.pre=t.slice(e),this.eos&&this.eos()}graph_or_subject_anon(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("graph_or_subject_anon");this._f_state=this.graph_or_subject_anon,this.pre=t.slice(e),this.eos&&this.eos()}graph_keyword(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("graph_keyword");this._f_state=this.graph_keyword,this.pre=t.slice(e),this.eos&&this.eos()}graph_post_name(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("graph_post_name");this._f_state=this.graph_post_name,this.pre=t.slice(e),this.eos&&this.eos()}pairs(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("pairs");this._f_state=this.pairs,this.pre=t.slice(e),this.eos&&this.eos()}object_list(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("object_list");this._f_state=this.object_list,this.pre=t.slice(e),this.eos&&this.eos()}string_literal_short_double(){let{s:t,n,i:e}=this;e:for(;ethis.max_token_length)return this.parse_error("string_literal_short_double");this._f_state=this.string_literal_short_double,this.pre=t.slice(e),this.eos&&this.eos()}string_literal_short_single(){let{s:t,n,i:e}=this;e:for(;ethis.max_token_length)return this.parse_error("string_literal_short_single");this._f_state=this.string_literal_short_single,this.pre=t.slice(e),this.eos&&this.eos()}string_literal_long_double(){let{s:t,n,i:e}=this;e:for(;ethis.max_token_length)return this.parse_error("string_literal_long_double");this._f_state=this.string_literal_long_double,this.pre=t.slice(e),this.eos&&this.eos()}string_literal_long_single(){let{s:t,n,i:e}=this;e:for(;ethis.max_token_length)return this.parse_error("string_literal_long_single");this._f_state=this.string_literal_long_single,this.pre=t.slice(e),this.eos&&this.eos()}string_literal(){let{s:t,n,i:e}=this;for(;ethis.max_string_length)return this.parse_error("string_literal");this._f_state=this.string_literal,this.pre=t.slice(e),this.eos&&this.eos()}datatype_or_langtag(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("datatype_or_langtag");this._f_state=this.datatype_or_langtag,this.pre=t.slice(e),this.eos&&this.eos()}datatype(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("datatype");this._f_state=this.datatype,this.pre=t.slice(e),this.eos&&this.eos()}post_object(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("post_object");this._f_state=this.post_object,this.pre=t.slice(e),this.eos&&this.eos()}base_iri(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("base_iri");this._f_state=this.base_iri,this.pre=t.slice(e),this.eos&&this.eos()}prefix_id(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("prefix_id");this._f_state=this.prefix_id,this.pre=t.slice(e),this.eos&&this.eos()}prefix_iri(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("prefix_iri");this._f_state=this.prefix_iri,this.pre=t.slice(e),this.eos&&this.eos()}full_stop(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("full_stop");this._f_state=this.full_stop,this.pre=t.slice(e),this.eos&&this.eos()}collection_subject(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("collection_subject");this._f_state=this.collection_subject,this.pre=t.slice(e),this.eos&&this.eos()}collection_object(){let{s:t,n,i:e}=this;for(;ethis.max_token_length)return this.parse_error("collection_object");this._f_state=this.collection_object,this.pre=t.slice(e),this.eos&&this.eos()}destroy(t){this.post_blank_subject=()=>{},this.statement=()=>{},this.block=()=>{},this.graph_or_subject=()=>{},this.graph_or_subject_property_list=()=>{},this.graph_or_subject_anon=()=>{},this.graph_keyword=()=>{},this.graph_post_name=()=>{},this.pairs=()=>{},this.object_list=()=>{},this.string_literal_short_double=()=>{},this.string_literal_short_single=()=>{},this.string_literal_long_double=()=>{},this.string_literal_long_single=()=>{},this.string_literal=()=>{},this.datatype_or_langtag=()=>{},this.datatype=()=>{},this.post_object=()=>{},this.base_iri=()=>{},this.prefix_id=()=>{},this.prefix_iri=()=>{},this.full_stop=()=>{},this.collection_subject=()=>{},this.collection_object=()=>{},this.eof=()=>{this.s=null},this._b_destroyed=!0,!t&&this._ds_input&&this._ds_input.destroy(t),this.transform.demolish(t)}}var es=function(...v){let t={};if(v.length){let n=v[0];if(n&&n.input&&typeof n.input.string>"u"&&!n.input.stream&&(n=n.input),typeof n=="string")t.input={string:n};else if(n===null)t.input=null;else if(typeof n.setEncoding=="function")t.input={stream:n};else{if(typeof n.pipeTo=="function")throw new TypeError("Sorry, WHATWG streams are currently not supported :(");if(n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"){if(t=n,v.length>1)throw new TypeError(`unexpected argument(s) after config struct: ${v.slice(1)}`)}else throw new TypeError(`unexpected input type: ${n}`)}if(v.length>1&&(Object.assign(t,v[1]),v.length>2))throw new TypeError(`unexpected argument(s) after input and config struct: ${v.slice(2)}`)}return new qs(t).transform};const zs=As(es),Bs=Ts({__proto__:null,default:zs},[es]);export{Bs as m}; diff --git a/converter/assets/readable-BmS1kvD9.js b/converter/assets/readable-BmS1kvD9.js new file mode 100644 index 0000000..535e6c1 --- /dev/null +++ b/converter/assets/readable-BmS1kvD9.js @@ -0,0 +1 @@ +const n=new Set(["_write","_writableState","writable"]);function u(a){return new Proxy(a,{has(r,e){return n.has(e)?!1:Reflect.has(...arguments)},get(r,e){if(n.has(e))return;const t=Reflect.get(...arguments);return t&&typeof t.bind=="function"?t.bind(r):t},set(r,e,t){if(!n.has(e))return Reflect.set(...arguments)}})}export{u as r}; diff --git a/converter/assets/stream-BoghbXpd.js b/converter/assets/stream-BoghbXpd.js new file mode 100644 index 0000000..8bcd47c --- /dev/null +++ b/converter/assets/stream-BoghbXpd.js @@ -0,0 +1 @@ +import{e as Te,b as ge,r as Me,s as me,g as Ft}from"./index-DtgbetCt.js";import{i as z,b as Et}from"./browser-BwSN-dYO.js";var Ve={exports:{}},St=Te.EventEmitter,Ne,Qe;function Ht(){if(Qe)return Ne;Qe=1;function r(_,g){var d=Object.keys(_);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(_);g&&(c=c.filter(function(T){return Object.getOwnPropertyDescriptor(_,T).enumerable})),d.push.apply(d,c)}return d}function n(_){for(var g=1;g0?this.tail.next=c:this.head=c,this.tail=c,++this.length}},{key:"unshift",value:function(d){var c={data:d,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}},{key:"shift",value:function(){if(this.length!==0){var d=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,d}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(d){if(this.length===0)return"";for(var c=this.head,T=""+c.data;c=c.next;)T+=d+c.data;return T}},{key:"concat",value:function(d){if(this.length===0)return m.alloc(0);for(var c=m.allocUnsafe(d>>>0),T=this.head,v=0;T;)W(T.data,c,v),v+=T.data.length,T=T.next;return c}},{key:"consume",value:function(d,c){var T;return db.length?b.length:d;if(R===b.length?v+=b:v+=b.slice(0,d),d-=R,d===0){R===b.length?(++T,c.next?this.head=c.next:this.head=this.tail=null):(this.head=c,c.data=b.slice(R));break}++T}return this.length-=T,v}},{key:"_getBuffer",value:function(d){var c=m.allocUnsafe(d),T=this.head,v=1;for(T.data.copy(c),d-=T.data.length;T=T.next;){var b=T.data,R=d>b.length?b.length:d;if(b.copy(c,c.length-d,0,R),d-=R,d===0){R===b.length?(++v,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=b.slice(R));break}++v}return this.length-=v,c}},{key:k,value:function(d,c){return D(this,n(n({},c),{},{depth:0,customInspect:!1}))}}]),_}(),Ne}function Gt(r,n){var f=this,p=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return p||s?(n?n(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ye,this,r)):process.nextTick(Ye,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(w){!n&&w?f._writableState?f._writableState.errorEmitted?process.nextTick(Ee,f):(f._writableState.errorEmitted=!0,process.nextTick(Ze,f,w)):process.nextTick(Ze,f,w):n?(process.nextTick(Ee,f),n(w)):process.nextTick(Ee,f)}),this)}function Ze(r,n){Ye(r,n),Ee(r)}function Ee(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function Vt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ye(r,n){r.emit("error",n)}function Yt(r,n){var f=r._readableState,p=r._writableState;f&&f.autoDestroy||p&&p.autoDestroy?r.destroy(n):r.emit("error",n)}var mt={destroy:Gt,undestroy:Vt,errorOrDestroy:Yt},ce={};function Kt(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}var Tt={};function V(r,n,f){f||(f=Error);function p(w,S,P){return typeof n=="string"?n:n(w,S,P)}var s=function(w){Kt(S,w);function S(P,h,m){return w.call(this,p(P,h,m))||this}return S}(f);s.prototype.name=f.name,s.prototype.code=r,Tt[r]=s}function et(r,n){if(Array.isArray(r)){var f=r.length;return r=r.map(function(p){return String(p)}),f>2?"one of ".concat(n," ").concat(r.slice(0,f-1).join(", "),", or ")+r[f-1]:f===2?"one of ".concat(n," ").concat(r[0]," or ").concat(r[1]):"of ".concat(n," ").concat(r[0])}else return"of ".concat(n," ").concat(String(r))}function Xt(r,n,f){return r.substr(!f||f<0?0:+f,n.length)===n}function zt(r,n,f){return(f===void 0||f>r.length)&&(f=r.length),r.substring(f-n.length,f)===n}function Jt(r,n,f){return typeof f!="number"&&(f=0),f+n.length>r.length?!1:r.indexOf(n,f)!==-1}V("ERR_INVALID_OPT_VALUE",function(r,n){return'The value "'+n+'" is invalid for option "'+r+'"'},TypeError);V("ERR_INVALID_ARG_TYPE",function(r,n,f){var p;typeof n=="string"&&Xt(n,"not ")?(p="must not be",n=n.replace(/^not /,"")):p="must be";var s;if(zt(r," argument"))s="The ".concat(r," ").concat(p," ").concat(et(n,"type"));else{var w=Jt(r,".")?"property":"argument";s='The "'.concat(r,'" ').concat(w," ").concat(p," ").concat(et(n,"type"))}return s+=". Received type ".concat(typeof f),s},TypeError);V("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");V("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});V("ERR_STREAM_PREMATURE_CLOSE","Premature close");V("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});V("ERR_MULTIPLE_CALLBACK","Callback called multiple times");V("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");V("ERR_STREAM_WRITE_AFTER_END","write after end");V("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);V("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);V("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");ce.codes=Tt;var Qt=ce.codes.ERR_INVALID_OPT_VALUE;function Zt(r,n,f){return r.highWaterMark!=null?r.highWaterMark:n?r[f]:null}function er(r,n,f,p){var s=Zt(n,p,f);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var w=p?f:"highWaterMark";throw new Qt(w,s)}return Math.floor(s)}return r.objectMode?16:16*1024}var Mt={getHighWaterMark:er},Ce,tt;function At(){if(tt)return Ce;tt=1,Ce=L;function r(a){var i=this;this.next=null,this.entry=null,this.finish=function(){ue(i,a)}}var n;L.WritableState=M;var f={deprecate:Et},p=St,s=ge.Buffer,w=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function S(a){return s.from(a)}function P(a){return s.isBuffer(a)||a instanceof w}var h=mt,m=Mt,C=m.getHighWaterMark,D=ce.codes,k=D.ERR_INVALID_ARG_TYPE,W=D.ERR_METHOD_NOT_IMPLEMENTED,_=D.ERR_MULTIPLE_CALLBACK,g=D.ERR_STREAM_CANNOT_PIPE,d=D.ERR_STREAM_DESTROYED,c=D.ERR_STREAM_NULL_VALUES,T=D.ERR_STREAM_WRITE_AFTER_END,v=D.ERR_UNKNOWN_ENCODING,b=h.errorOrDestroy;z(L,p);function R(){}function M(a,i,l){n=n||be(),a=a||{},typeof l!="boolean"&&(l=i instanceof n),this.objectMode=!!a.objectMode,l&&(this.objectMode=this.objectMode||!!a.writableObjectMode),this.highWaterMark=C(this,a,"writableHighWaterMark",l),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var y=a.decodeStrings===!1;this.decodeStrings=!y,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(O){fe(i,O)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=a.emitClose!==!1,this.autoDestroy=!!a.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}M.prototype.getBuffer=function(){for(var i=this.bufferedRequest,l=[];i;)l.push(i),i=i.next;return l},function(){try{Object.defineProperty(M.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(i){return I.call(this,i)?!0:this!==L?!1:i&&i._writableState instanceof M}})):I=function(i){return i instanceof this};function L(a){n=n||be();var i=this instanceof n;if(!i&&!I.call(L,this))return new L(a);this._writableState=new M(a,this,i),this.writable=!0,a&&(typeof a.write=="function"&&(this._write=a.write),typeof a.writev=="function"&&(this._writev=a.writev),typeof a.destroy=="function"&&(this._destroy=a.destroy),typeof a.final=="function"&&(this._final=a.final)),p.call(this)}L.prototype.pipe=function(){b(this,new g)};function E(a,i){var l=new T;b(a,l),process.nextTick(i,l)}function q(a,i,l,y){var O;return l===null?O=new c:typeof l!="string"&&!i.objectMode&&(O=new k("chunk",["string","Buffer"],l)),O?(b(a,O),process.nextTick(y,O),!1):!0}L.prototype.write=function(a,i,l){var y=this._writableState,O=!1,e=!y.objectMode&&P(a);return e&&!s.isBuffer(a)&&(a=S(a)),typeof i=="function"&&(l=i,i=null),e?i="buffer":i||(i=y.defaultEncoding),typeof l!="function"&&(l=R),y.ending?E(this,l):(e||q(this,y,a,l))&&(y.pendingcb++,O=ne(this,y,e,a,i,l)),O},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,!a.writing&&!a.corked&&!a.bufferProcessing&&a.bufferedRequest&&U(this,a))},L.prototype.setDefaultEncoding=function(i){if(typeof i=="string"&&(i=i.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((i+"").toLowerCase())>-1))throw new v(i);return this._writableState.defaultEncoding=i,this},Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function K(a,i,l){return!a.objectMode&&a.decodeStrings!==!1&&typeof i=="string"&&(i=s.from(i,l)),i}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(a,i,l,y,O,e){if(!l){var t=K(i,y,O);y!==t&&(l=!0,O="buffer",y=t)}var o=i.objectMode?1:y.length;i.length+=o;var u=i.length0)if(typeof t!="string"&&!A.objectMode&&Object.getPrototypeOf(t)!==p.prototype&&(t=w(t)),u)A.endEmitted?R(e,new c):K(e,A,t,!0);else if(A.ended)R(e,new g);else{if(A.destroyed)return!1;A.reading=!1,A.decoder&&!o?(t=A.decoder.write(t),A.objectMode||t.length!==0?K(e,A,t,!1):U(e,A)):K(e,A,t,!1)}else u||(A.reading=!1,U(e,A))}return!A.ended&&(A.length=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function J(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ae(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}E.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,o=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?l(this):B(this),null;if(e=J(e,t),e===0&&t.ended)return t.length===0&&l(this),null;var u=t.needReadable;h("need readable",u),(t.length===0||t.length-e0?j=i(e,t):j=null,j===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&l(this)),j!==null&&this.emit("data",j),j};function fe(e,t){if(h("onEofChunk"),!t.ended){if(t.decoder){var o=t.decoder.end();o&&o.length&&(t.buffer.push(o),t.length+=t.objectMode?1:o.length)}t.ended=!0,t.sync?B(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Q(e)))}}function B(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(Q,e))}function Q(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,a(e)}function U(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Z,e,t))}function Z(e,t){for(;!t.reading&&!t.ended&&(t.length1&&O(u.pipes,e)!==-1)&&!ye&&(h("false write response, pause",u.awaitDrain),u.awaitDrain++),o.pause())}function se(H){h("onerror",H),X(),e.removeListener("error",se),n(e,"error")===0&&R(e,H)}I(e,"error",se);function de(){e.removeListener("finish",he),X()}e.once("close",de);function he(){h("onfinish"),e.removeListener("close",de),X()}e.once("finish",he);function X(){h("unpipe"),o.unpipe(e)}return e.emit("pipe",o),u.flowing||(h("pipe resume"),o.resume()),e};function oe(e){return function(){var o=e._readableState;h("pipeOnDrain",o.awaitDrain),o.awaitDrain&&o.awaitDrain--,o.awaitDrain===0&&n(e,"data")&&(o.flowing=!0,a(e))}}E.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o),this);if(!e){var u=t.pipes,j=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var A=0;A0,u.flowing!==!1&&this.resume()):e==="readable"&&!u.endEmitted&&!u.readableListening&&(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,h("on readable",u.length,u.reading),u.length?B(this):u.reading||process.nextTick($,this)),o},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var o=f.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(ee,this),o},E.prototype.removeAllListeners=function(e){var t=f.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ee,this),t};function ee(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function $(e){h("readable nexttick read 0"),e.read(0)}E.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,le(this,e)),e.paused=!1,this};function le(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(ue,e,t))}function ue(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),a(e),t.flowing&&!t.reading&&e.read(0)}E.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function a(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&e.read()!==null;);}E.prototype.wrap=function(e){var t=this,o=this._readableState,u=!1;e.on("end",function(){if(h("wrapped end"),o.decoder&&!o.ended){var N=o.decoder.end();N&&N.length&&t.push(N)}t.push(null)}),e.on("data",function(N){if(h("wrapped data"),o.decoder&&(N=o.decoder.write(N)),!(o.objectMode&&N==null)&&!(!o.objectMode&&(!N||!N.length))){var F=t.push(N);F||(u=!0,e.pause())}});for(var j in e)this[j]===void 0&&typeof e[j]=="function"&&(this[j]=function(F){return function(){return e[F].apply(e,arguments)}}(j));for(var A=0;A=t.length?(t.decoder?o=t.buffer.join(""):t.buffer.length===1?o=t.buffer.first():o=t.buffer.concat(t.length),t.buffer.clear()):o=t.buffer.consume(e,t.decoder),o}function l(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(y,t,e))}function y(e,t){if(h("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var o=t._writableState;(!o||o.autoDestroy&&o.finished)&&t.destroy()}}typeof Symbol=="function"&&(E.from=function(e,t){return b===void 0&&(b=ar()),b(E,e,t)});function O(e,t){for(var o=0,u=e.length;o0;return gr(S,h,m,function(C){s||(s=C),C&&w.forEach(ut),!h&&(w.forEach(ut),p(s))})});return n.reduce(yr)}var Rr=wr;(function(r,n){n=r.exports=Lt(),n.Stream=n,n.Readable=n,n.Writable=At(),n.Duplex=be(),n.Transform=Pt,n.PassThrough=hr,n.finished=ze,n.pipeline=Rr})(Ve,Ve.exports);var Er=Ve.exports,Sr=Mr;const mr=Er;class Tr extends mr.Readable{constructor(n,f){super(),this._str=n,this._encoding=f||"utf8"}_read(){this.ended||(process.nextTick(()=>{this.push(Buffer.from(this._str,this._encoding)),this.push(null)}),this.ended=!0)}}function Mr(r,n){return new Tr(r,n)}const Ar=Ft(Sr);var Ke={exports:{}},Ct=Te.EventEmitter,Be,st;function Or(){if(st)return Be;st=1;function r(_,g){var d=Object.keys(_);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(_);g&&(c=c.filter(function(T){return Object.getOwnPropertyDescriptor(_,T).enumerable})),d.push.apply(d,c)}return d}function n(_){for(var g=1;g0?this.tail.next=c:this.head=c,this.tail=c,++this.length}},{key:"unshift",value:function(d){var c={data:d,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}},{key:"shift",value:function(){if(this.length!==0){var d=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,d}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(d){if(this.length===0)return"";for(var c=this.head,T=""+c.data;c=c.next;)T+=d+c.data;return T}},{key:"concat",value:function(d){if(this.length===0)return m.alloc(0);for(var c=m.allocUnsafe(d>>>0),T=this.head,v=0;T;)W(T.data,c,v),v+=T.data.length,T=T.next;return c}},{key:"consume",value:function(d,c){var T;return db.length?b.length:d;if(R===b.length?v+=b:v+=b.slice(0,d),d-=R,d===0){R===b.length?(++T,c.next?this.head=c.next:this.head=this.tail=null):(this.head=c,c.data=b.slice(R));break}++T}return this.length-=T,v}},{key:"_getBuffer",value:function(d){var c=m.allocUnsafe(d),T=this.head,v=1;for(T.data.copy(c),d-=T.data.length;T=T.next;){var b=T.data,R=d>b.length?b.length:d;if(b.copy(c,c.length-d,0,R),d-=R,d===0){R===b.length?(++v,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=b.slice(R));break}++v}return this.length-=v,c}},{key:k,value:function(d,c){return D(this,n(n({},c),{},{depth:0,customInspect:!1}))}}]),_}(),Be}function Lr(r,n){var f=this,p=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return p||s?(n?n(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Xe,this,r)):process.nextTick(Xe,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(w){!n&&w?f._writableState?f._writableState.errorEmitted?process.nextTick(Se,f):(f._writableState.errorEmitted=!0,process.nextTick(dt,f,w)):process.nextTick(dt,f,w):n?(process.nextTick(Se,f),n(w)):process.nextTick(Se,f)}),this)}function dt(r,n){Xe(r,n),Se(r)}function Se(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function Pr(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Xe(r,n){r.emit("error",n)}function Dr(r,n){var f=r._readableState,p=r._writableState;f&&f.autoDestroy||p&&p.autoDestroy?r.destroy(n):r.emit("error",n)}var jt={destroy:Lr,undestroy:Pr,errorOrDestroy:Dr},pe={};function Nr(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}var It={};function Y(r,n,f){f||(f=Error);function p(w,S,P){return typeof n=="string"?n:n(w,S,P)}var s=function(w){Nr(S,w);function S(P,h,m){return w.call(this,p(P,h,m))||this}return S}(f);s.prototype.name=f.name,s.prototype.code=r,It[r]=s}function ht(r,n){if(Array.isArray(r)){var f=r.length;return r=r.map(function(p){return String(p)}),f>2?"one of ".concat(n," ").concat(r.slice(0,f-1).join(", "),", or ")+r[f-1]:f===2?"one of ".concat(n," ").concat(r[0]," or ").concat(r[1]):"of ".concat(n," ").concat(r[0])}else return"of ".concat(n," ").concat(String(r))}function Cr(r,n,f){return r.substr(!f||f<0?0:+f,n.length)===n}function jr(r,n,f){return(f===void 0||f>r.length)&&(f=r.length),r.substring(f-n.length,f)===n}function Ir(r,n,f){return typeof f!="number"&&(f=0),f+n.length>r.length?!1:r.indexOf(n,f)!==-1}Y("ERR_INVALID_OPT_VALUE",function(r,n){return'The value "'+n+'" is invalid for option "'+r+'"'},TypeError);Y("ERR_INVALID_ARG_TYPE",function(r,n,f){var p;typeof n=="string"&&Cr(n,"not ")?(p="must not be",n=n.replace(/^not /,"")):p="must be";var s;if(jr(r," argument"))s="The ".concat(r," ").concat(p," ").concat(ht(n,"type"));else{var w=Ir(r,".")?"property":"argument";s='The "'.concat(r,'" ').concat(w," ").concat(p," ").concat(ht(n,"type"))}return s+=". Received type ".concat(typeof f),s},TypeError);Y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Y("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});Y("ERR_STREAM_PREMATURE_CLOSE","Premature close");Y("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});Y("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Y("ERR_STREAM_WRITE_AFTER_END","write after end");Y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Y("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);Y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");pe.codes=It;var kr=pe.codes.ERR_INVALID_OPT_VALUE;function Wr(r,n,f){return r.highWaterMark!=null?r.highWaterMark:n?r[f]:null}function qr(r,n,f,p){var s=Wr(n,p,f);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var w=p?f:"highWaterMark";throw new kr(w,s)}return Math.floor(s)}return r.objectMode?16:16*1024}var kt={getHighWaterMark:qr},$e,ct;function Wt(){if(ct)return $e;ct=1,$e=L;function r(a){var i=this;this.next=null,this.entry=null,this.finish=function(){ue(i,a)}}var n;L.WritableState=M;var f={deprecate:Et},p=Ct,s=ge.Buffer,w=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function S(a){return s.from(a)}function P(a){return s.isBuffer(a)||a instanceof w}var h=jt,m=kt,C=m.getHighWaterMark,D=pe.codes,k=D.ERR_INVALID_ARG_TYPE,W=D.ERR_METHOD_NOT_IMPLEMENTED,_=D.ERR_MULTIPLE_CALLBACK,g=D.ERR_STREAM_CANNOT_PIPE,d=D.ERR_STREAM_DESTROYED,c=D.ERR_STREAM_NULL_VALUES,T=D.ERR_STREAM_WRITE_AFTER_END,v=D.ERR_UNKNOWN_ENCODING,b=h.errorOrDestroy;z(L,p);function R(){}function M(a,i,l){n=n||_e(),a=a||{},typeof l!="boolean"&&(l=i instanceof n),this.objectMode=!!a.objectMode,l&&(this.objectMode=this.objectMode||!!a.writableObjectMode),this.highWaterMark=C(this,a,"writableHighWaterMark",l),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var y=a.decodeStrings===!1;this.decodeStrings=!y,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(O){fe(i,O)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=a.emitClose!==!1,this.autoDestroy=!!a.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}M.prototype.getBuffer=function(){for(var i=this.bufferedRequest,l=[];i;)l.push(i),i=i.next;return l},function(){try{Object.defineProperty(M.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(i){return I.call(this,i)?!0:this!==L?!1:i&&i._writableState instanceof M}})):I=function(i){return i instanceof this};function L(a){n=n||_e();var i=this instanceof n;if(!i&&!I.call(L,this))return new L(a);this._writableState=new M(a,this,i),this.writable=!0,a&&(typeof a.write=="function"&&(this._write=a.write),typeof a.writev=="function"&&(this._writev=a.writev),typeof a.destroy=="function"&&(this._destroy=a.destroy),typeof a.final=="function"&&(this._final=a.final)),p.call(this)}L.prototype.pipe=function(){b(this,new g)};function E(a,i){var l=new T;b(a,l),process.nextTick(i,l)}function q(a,i,l,y){var O;return l===null?O=new c:typeof l!="string"&&!i.objectMode&&(O=new k("chunk",["string","Buffer"],l)),O?(b(a,O),process.nextTick(y,O),!1):!0}L.prototype.write=function(a,i,l){var y=this._writableState,O=!1,e=!y.objectMode&&P(a);return e&&!s.isBuffer(a)&&(a=S(a)),typeof i=="function"&&(l=i,i=null),e?i="buffer":i||(i=y.defaultEncoding),typeof l!="function"&&(l=R),y.ending?E(this,l):(e||q(this,y,a,l))&&(y.pendingcb++,O=ne(this,y,e,a,i,l)),O},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,!a.writing&&!a.corked&&!a.bufferProcessing&&a.bufferedRequest&&U(this,a))},L.prototype.setDefaultEncoding=function(i){if(typeof i=="string"&&(i=i.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((i+"").toLowerCase())>-1))throw new v(i);return this._writableState.defaultEncoding=i,this},Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function K(a,i,l){return!a.objectMode&&a.decodeStrings!==!1&&typeof i=="string"&&(i=s.from(i,l)),i}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(a,i,l,y,O,e){if(!l){var t=K(i,y,O);y!==t&&(l=!0,O="buffer",y=t)}var o=i.objectMode?1:y.length;i.length+=o;var u=i.length0)if(typeof t!="string"&&!A.objectMode&&Object.getPrototypeOf(t)!==p.prototype&&(t=w(t)),u)A.endEmitted?R(e,new c):K(e,A,t,!0);else if(A.ended)R(e,new g);else{if(A.destroyed)return!1;A.reading=!1,A.decoder&&!o?(t=A.decoder.write(t),A.objectMode||t.length!==0?K(e,A,t,!1):U(e,A)):K(e,A,t,!1)}else u||(A.reading=!1,U(e,A))}return!A.ended&&(A.length=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function J(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ae(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}E.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,o=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?l(this):B(this),null;if(e=J(e,t),e===0&&t.ended)return t.length===0&&l(this),null;var u=t.needReadable;h("need readable",u),(t.length===0||t.length-e0?j=i(e,t):j=null,j===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),o!==e&&t.ended&&l(this)),j!==null&&this.emit("data",j),j};function fe(e,t){if(h("onEofChunk"),!t.ended){if(t.decoder){var o=t.decoder.end();o&&o.length&&(t.buffer.push(o),t.length+=t.objectMode?1:o.length)}t.ended=!0,t.sync?B(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Q(e)))}}function B(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(Q,e))}function Q(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,a(e)}function U(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Z,e,t))}function Z(e,t){for(;!t.reading&&!t.ended&&(t.length1&&O(u.pipes,e)!==-1)&&!ye&&(h("false write response, pause",u.awaitDrain),u.awaitDrain++),o.pause())}function se(H){h("onerror",H),X(),e.removeListener("error",se),n(e,"error")===0&&R(e,H)}I(e,"error",se);function de(){e.removeListener("finish",he),X()}e.once("close",de);function he(){h("onfinish"),e.removeListener("close",de),X()}e.once("finish",he);function X(){h("unpipe"),o.unpipe(e)}return e.emit("pipe",o),u.flowing||(h("pipe resume"),o.resume()),e};function oe(e){return function(){var o=e._readableState;h("pipeOnDrain",o.awaitDrain),o.awaitDrain&&o.awaitDrain--,o.awaitDrain===0&&n(e,"data")&&(o.flowing=!0,a(e))}}E.prototype.unpipe=function(e){var t=this._readableState,o={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,o),this);if(!e){var u=t.pipes,j=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var A=0;A0,u.flowing!==!1&&this.resume()):e==="readable"&&!u.endEmitted&&!u.readableListening&&(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,h("on readable",u.length,u.reading),u.length?B(this):u.reading||process.nextTick($,this)),o},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var o=f.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(ee,this),o},E.prototype.removeAllListeners=function(e){var t=f.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ee,this),t};function ee(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function $(e){h("readable nexttick read 0"),e.read(0)}E.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,le(this,e)),e.paused=!1,this};function le(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(ue,e,t))}function ue(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),a(e),t.flowing&&!t.reading&&e.read(0)}E.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function a(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&e.read()!==null;);}E.prototype.wrap=function(e){var t=this,o=this._readableState,u=!1;e.on("end",function(){if(h("wrapped end"),o.decoder&&!o.ended){var N=o.decoder.end();N&&N.length&&t.push(N)}t.push(null)}),e.on("data",function(N){if(h("wrapped data"),o.decoder&&(N=o.decoder.write(N)),!(o.objectMode&&N==null)&&!(!o.objectMode&&(!N||!N.length))){var F=t.push(N);F||(u=!0,e.pause())}});for(var j in e)this[j]===void 0&&typeof e[j]=="function"&&(this[j]=function(F){return function(){return e[F].apply(e,arguments)}}(j));for(var A=0;A=t.length?(t.decoder?o=t.buffer.join(""):t.buffer.length===1?o=t.buffer.first():o=t.buffer.concat(t.length),t.buffer.clear()):o=t.buffer.consume(e,t.decoder),o}function l(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(y,t,e))}function y(e,t){if(h("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var o=t._writableState;(!o||o.autoDestroy&&o.finished)&&t.destroy()}}typeof Symbol=="function"&&(E.from=function(e,t){return b===void 0&&(b=Fr()),b(E,e,t)});function O(e,t){for(var o=0,u=e.length;o0;return ti(S,h,m,function(C){s||(s=C),C&&w.forEach(Rt),!h&&(w.forEach(Rt),p(s))})});return n.reduce(ri)}var ai=ni;(function(r,n){n=r.exports=Bt(),n.Stream=n,n.Readable=n,n.Writable=Wt(),n.Duplex=_e(),n.Transform=$t,n.PassThrough=zr,n.finished=Je,n.pipeline=ai})(Ke,Ke.exports);var fi=Ke.exports;const ui=Ar,si=fi.Readable;export{si as Readable,ui as toStream}; diff --git a/converter/index.html b/converter/index.html new file mode 100644 index 0000000..a9c86b8 --- /dev/null +++ b/converter/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + rdfjs-elements-demos + + + + + + + + + diff --git a/rdf-editor/assets/CustomJsonLdSerializer-DF49DE2p.js b/rdf-editor/assets/CustomJsonLdSerializer-DF49DE2p.js new file mode 100644 index 0000000..ef76b49 --- /dev/null +++ b/rdf-editor/assets/CustomJsonLdSerializer-DF49DE2p.js @@ -0,0 +1 @@ +import{S as u}from"./index-BOvYCoiN.js";import{a as l}from"./index-3C0HHkK2.js";class h{constructor(e){this.stream=e,this.array=[]}push(e){this.array.push(e)}end(){this.stream.push(this.array),this.stream.push(null)}}class o{constructor(e){this.stream=e,this.first=!0,this.stream.push("[")}push(e){this.first?this.first=!1:this.stream.push(","),this.stream.push(JSON.stringify(e))}end(){this.stream.push("]"),this.stream.push(null)}}class r extends l.Readable{constructor(e,{encoding:n="object"}={}){if(super({objectMode:!0,read:()=>{}}),n==="object"&&(this.encoder=new h(this)),n==="string"&&(this.encoder=new o(this)),!this.encoder)throw new Error(`unknown encoding: ${n}`);e.on("data",t=>{const s={};let a=s;t.graph.termType!=="DefaultGraph"&&(s["@id"]=t.graph.value,s["@graph"]={},a=s["@graph"]),a["@id"]=r.subjectValue(t.subject),t.predicate.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"?a["@type"]=r.subjectValue(t.object):a[t.predicate.value]=r.objectValue(t.object),this.encoder.push(s)}),e.on("end",()=>this.encoder.end()),e.on("error",t=>this.emit("error",t))}static subjectValue(e){return e.termType==="BlankNode"?"_:"+e.value:e.value}static objectValue(e){return e.termType==="NamedNode"?{"@id":e.value}:e.termType==="BlankNode"?{"@id":"_:"+e.value}:e.language?{"@language":e.language,"@value":e.value}:e.datatype&&e.datatype.value!=="http://www.w3.org/2001/XMLSchema#string"?{"@type":e.datatype.value,"@value":e.value}:e.value}}class p extends u{constructor(e){super(r,e)}}class f extends p{constructor({...e}={}){super({encoding:"string",...e})}}export{f as default}; diff --git a/rdf-editor/assets/CustomRdfXmlParser-DayyQqb1.js b/rdf-editor/assets/CustomRdfXmlParser-DayyQqb1.js new file mode 100644 index 0000000..c12fbb0 --- /dev/null +++ b/rdf-editor/assets/CustomRdfXmlParser-DayyQqb1.js @@ -0,0 +1,27 @@ +import{c as N,a as Kt}from"./index-3C0HHkK2.js";import{r as Yt,a as Zt}from"./index-LYq9jbwg.js";var Nt={},v={},P={},gt={};(function(r){/** + * Character classes and associated utilities for the 5th edition of XML 1.0. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR=` +\r -퟿-�𐀀-􏿿`,r.S=` \r +`,r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u");var t=9,e=10,i=13,a=32;r.S_LIST=[a,e,i,t];function n(h){return h>=a&&h<=55295||h===e||h===i||h===t||h>=57344&&h<=65533||h>=65536&&h<=1114111}r.isChar=n;function o(h){return h===a||h===e||h===i||h===t}r.isS=o;function l(h){return h>=65&&h<=90||h>=97&&h<=122||h===58||h===95||h===8204||h===8205||h>=192&&h<=214||h>=216&&h<=246||h>=248&&h<=767||h>=880&&h<=893||h>=895&&h<=8191||h>=8304&&h<=8591||h>=11264&&h<=12271||h>=12289&&h<=55295||h>=63744&&h<=64975||h>=65008&&h<=65533||h>=65536&&h<=983039}r.isNameStartChar=l;function u(h){return l(h)||h>=48&&h<=57||h===45||h===46||h===183||h>=768&&h<=879||h>=8255&&h<=8256}r.isNameChar=u})(gt);var At={};(function(r){/** + * Character classes and associated utilities for the 2nd edition of XML 1.1. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR="-퟿-�𐀀-􏿿",r.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",r.S=` \r +`,r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.RESTRICTED_CHAR_RE=new RegExp("^["+r.RESTRICTED_CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u");var t=9,e=10,i=13,a=32;r.S_LIST=[a,e,i,t];function n(s){return s>=1&&s<=55295||s>=57344&&s<=65533||s>=65536&&s<=1114111}r.isChar=n;function o(s){return s>=1&&s<=8||s===11||s===12||s>=14&&s<=31||s>=127&&s<=132||s>=134&&s<=159}r.isRestrictedChar=o;function l(s){return s===9||s===10||s===13||s>31&&s<127||s===133||s>159&&s<=55295||s>=57344&&s<=65533||s>=65536&&s<=1114111}r.isCharAndNotRestricted=l;function u(s){return s===a||s===e||s===i||s===t}r.isS=u;function h(s){return s>=65&&s<=90||s>=97&&s<=122||s===58||s===95||s===8204||s===8205||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=880&&s<=893||s>=895&&s<=8191||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533||s>=65536&&s<=983039}r.isNameStartChar=h;function p(s){return h(s)||s>=48&&s<=57||s===45||s===46||s===183||s>=768&&s<=879||s>=8255&&s<=8256}r.isNameChar=p})(At);var Tt={};(function(r){/** + * Character class utilities for XML NS 1.0 edition 3. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */Object.defineProperty(r,"__esModule",{value:!0}),r.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",r.NC_NAME_CHAR="-"+r.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.NC_NAME_START_CHAR_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]$","u"),r.NC_NAME_CHAR_RE=new RegExp("^["+r.NC_NAME_CHAR+"]$","u"),r.NC_NAME_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]["+r.NC_NAME_CHAR+"]*$","u");function t(i){return i>=65&&i<=90||i===95||i>=97&&i<=122||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}r.isNCNameStartChar=t;function e(i){return t(i)||i===45||i===46||i>=48&&i<=57||i===183||i>=768&&i<=879||i>=8255&&i<=8256}r.isNCNameChar=e})(Tt);Object.defineProperty(P,"__esModule",{value:!0});P.SaxesParser=P.EVENTS=void 0;const y=gt,Jt=At,nt=Tt;var D=y.isS,te=y.isChar,$=y.isNameStartChar,ht=y.isNameChar,Rt=y.S_LIST,ee=y.NAME_RE,ie=Jt.isChar,se=nt.isNCNameStartChar,ae=nt.isNCNameChar,re=nt.NC_NAME_RE;const U="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",ne={__proto__:null,xml:U,xmlns:I},oe={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},F=-1,_=-2,lt=0,he=1,G=2,le=3,T=4,ue=5,ce=6,de=7,Q=8,fe=9,Fe=10,pe=11,me=12,E=13,k=14,z=15,xe=16,K=17,Ee=18,De=19,Y=20,Ce=21,_e=22,be=23,ut=24,Z=25,B=26,ct=27,Se=28,Ne=29,dt=30,ge=31,Ae=32,g=33,Te=34,J=35,M=36,tt=37,Re=38,ft=39,Ft=40,we=41,pt=42,Ie=43,ve=44,et=9,C=10,it=13,mt=32,xt=33,wt=34,O=38,It=39,H=45,j=47,Pe=59,S=60,R=61,m=62,x=63,vt=91,w=93,Et=133,Dt=8232,V=r=>r===wt||r===It,Pt=[wt,It],ye=[...Pt,vt,m],$e=[...Pt,S,w],Me=[R,x,...Rt],Oe=[...Rt,m,O,S];function rt(r,t,e){switch(t){case"xml":e!==U&&r.fail(`xml prefix must be bound to ${U}.`);break;case"xmlns":e!==I&&r.fail(`xmlns prefix must be bound to ${I}.`);break}switch(e){case I:r.fail(t===""?`the default namespace may not be set to ${e}.`:`may not assign a prefix (even "xmlns") to the URI ${I}.`);break;case U:switch(t){case"xml":break;case"":r.fail(`the default namespace may not be set to ${e}.`);break;default:r.fail("may not assign the xml namespace to another prefix.")}break}}function Le(r,t){for(const e of Object.keys(t))rt(r,e,t[e])}const ke=r=>re.test(r),Be=r=>ee.test(r),A=0,Ct=1,st=2;P.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const _t={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class He{get closed(){return this._closed}constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,e){this.nameStartCheck=se,this.nameCheck=ae,this.isName=ke,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},ne);const i=this.opt.additionalNamespaces;i!=null&&(Le(this,i),Object.assign(this.ns,i))}else this.nameStartCheck=$,this.nameCheck=ht,this.isName=Be,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=A,this.attribList=[];const{fragmentOpt:e}=this;this.state=e?E:lt,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=e,this.xmlDeclPossible=!e,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:i}=this.opt;if(i===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");i="1.0"}this.setXMLVersion(i),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(oe),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[_t[t]]=e}off(t){this[_t[t]]=void 0}makeError(t){var e;let i=(e=this.fileName)!==null&&e!==void 0?e:"";return this.trackPosition&&(i.length>0&&(i+=":"),i+=`${this.line}:${this.column}`),i.length>0&&(i+=": "),new Error(i+t)}fail(t){const e=this.makeError(t),i=this.errorHandler;if(i===void 0)throw e;return i(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;t===null?(e=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let i=t.length;const a=t.charCodeAt(i-1);!e&&(a===it||a>=55296&&a<=56319)&&(this.carriedFromPrevious=t[i-1],i--,t=t.slice(0,i));const{stateTable:n}=this;for(this.chunk=t,this.i=0;this.i=t.length)return F;const i=t.charCodeAt(e);if(this.column++,i<55296){if(i>=mt||i===et)return i;switch(i){case C:return this.line++,this.column=0,this.positionAtNewLine=this.position,C;case it:return t.charCodeAt(e+1)===C&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,_;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;const a=65536+(i-55296)*1024+(t.charCodeAt(e+1)-56320);return this.i=e+2,a>1114111&&this.fail("disallowed character."),a}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return F;const i=t.charCodeAt(e);if(this.column++,i<55296){if(i>31&&i<127||i>159&&i!==Dt||i===et)return i;switch(i){case C:return this.line++,this.column=0,this.positionAtNewLine=this.position,C;case it:{const n=t.charCodeAt(e+1);(n===C||n===Et)&&(this.i=e+2)}case Et:case Dt:return this.line++,this.column=0,this.positionAtNewLine=this.position,_;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;const a=65536+(i-55296)*1024+(t.charCodeAt(e+1)-56320);return this.i=e+2,a>1114111&&this.fail("disallowed character."),a}getCodeNorm(){const t=this.getCode();return t===_?C:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:i}=this;for(;;){const a=this.getCode(),n=a===_,o=n?C:a;if(o===F||t.includes(o))return this.text+=i.slice(e,this.prevI),o;n&&(this.text+=`${i.slice(e,this.prevI)} +`,e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:i}=this;for(;;){let a=this.getCode();switch(a){case _:this.text+=`${i.slice(e,this.prevI)} +`,e=this.i,a=C;break;case F:return this.text+=i.slice(e),!1}if(a===t)return this.text+=i.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const i=this.getCode();if(i===F)return this.name+=t.slice(e),F;if(!ht(i))return this.name+=t.slice(e,this.prevI),i===_?C:i}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===F||!D(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,t==="1.0"?(this.isChar=te,this.getCode=this.getCode10):(this.isChar=ie,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=he}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case S:if(this.state=z,this.text.length!==0)throw new Error("no-empty text at start");break;case F:break;default:this.unget(),this.state=E,this.xmlDeclPossible=!1}}sDoctype(){var t;const e=this.captureTo(ye);switch(e){case m:{(t=this.doctypeHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=E,this.doctype=!0;break}case F:break;default:this.text+=String.fromCodePoint(e),e===vt?this.state=T:V(e)&&(this.state=le,this.q=e)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=G)}sDTD(){const t=this.captureTo($e);t!==F&&(this.text+=String.fromCodePoint(t),t===w?this.state=G:t===S?this.state=ce:V(t)&&(this.state=ue,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=T,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case xt:this.state=de,this.openWakaBang="";break;case x:this.state=pe;break;default:this.state=T}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,e!=="-"&&(this.state=e==="--"?Q:T,this.openWakaBang="")}sDTDComment(){this.captureToChar(H)&&(this.text+="-",this.state=fe)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=t===H?Fe:Q}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===m?this.state=T:(this.fail("malformed comment."),this.state=Q)}sDTDPI(){this.captureToChar(x)&&(this.text+="?",this.state=me)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===m&&(this.state=T)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case _:this.entity+=`${e.slice(t,this.prevI)} +`,t=this.i;break;case Pe:{const{entityReturnState:i}=this,a=this.entity+e.slice(t,this.prevI);this.state=i;let n;a===""?(this.fail("empty entity name."),n="&;"):(n=this.parseEntity(a),this.entity=""),(i!==E||this.textHandler!==void 0)&&(this.text+=n);break t}case F:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if($(t))this.state=Te,this.unget(),this.xmlDeclPossible=!1;else switch(t){case j:this.state=Ie,this.xmlDeclPossible=!1;break;case xt:this.state=xe,this.openWakaBang="",this.xmlDeclPossible=!1;break;case x:this.state=be;break;default:this.fail("disallowed character in tag name"),this.state=E,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=Y,this.openWakaBang="";break;case"--":this.state=K,this.openWakaBang="";break;case"DOCTYPE":this.state=G,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(H)&&(this.state=Ee)}sCommentEnding(){var t;const e=this.getCodeNorm();e===H?(this.state=De,(t=this.commentHandler)===null||t===void 0||t.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(e)}`,this.state=K)}sCommentEnded(){const t=this.getCodeNorm();t!==m?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=K):this.state=E}sCData(){this.captureToChar(w)&&(this.state=Ce)}sCDataEnding(){const t=this.getCodeNorm();t===w?this.state=_e:(this.text+=`]${String.fromCodePoint(t)}`,this.state=Y)}sCDataEnding2(){var t;const e=this.getCodeNorm();switch(e){case m:{(t=this.cdataHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=E;break}case w:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(e)}`,this.state=Y}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=ut):t===x||D(t)?(this.fail("processing instruction without a target."),this.state=t===x?B:Z):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=ut)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const i=this.getCodeNorm();if(i===F){this.piTarget+=t.slice(e);return}if(!this.nameCheck(i)){this.piTarget+=t.slice(e,this.prevI);const a=i===x;a||D(i)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=a?g:ct):this.state=a?B:Z:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(i));break}}}sPIBody(){if(this.text.length===0){const t=this.getCodeNorm();t===x?this.state=B:D(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(x)&&(this.state=B)}sPIEnding(){var t;const e=this.getCodeNorm();if(e===m){const{piTarget:i}=this;i.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(t=this.piHandler)===null||t===void 0||t.call(this,{target:i,body:this.text}),this.piTarget=this.text="",this.state=E}else e===x?this.text+="?":(this.text+=`?${String.fromCodePoint(e)}`,this.state=Z);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();if(t===x){this.state=g;return}t!==F&&(this.state=Se,this.name=String.fromCodePoint(t))}sXMLDeclName(){const t=this.captureTo(Me);if(t===x){this.state=g,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(D(t)||t===R){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=t===R?dt:Ne}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===x){this.state=g,this.fail("XML declaration is incomplete.");return}D(t)||(t!==R&&this.fail("value required."),this.state=dt)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===x){this.state=g,this.fail("XML declaration is incomplete.");return}D(t)||(V(t)?this.q=t:(this.fail("value must be quoted."),this.q=mt),this.state=ge)}sXMLDeclValue(){const t=this.captureTo([this.q,x]);if(t===x){this.state=g,this.text="",this.fail("XML declaration is incomplete.");return}if(t===F)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const i=e;this.xmlDecl.version=i,/^1\.[0-9]+$/.test(i)?this.opt.forceXMLVersion||this.setXMLVersion(i):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":e!=="yes"&&e!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e;break}this.name="",this.state=Ae}sXMLDeclSeparator(){const t=this.getCodeNorm();if(t===x){this.state=g;return}D(t)||(this.fail("whitespace required."),this.unget()),this.state=ct}sXMLDeclEnding(){var t;this.getCodeNorm()===m?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(t=this.xmldeclHandler)===null||t===void 0||t.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=E):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var t;const e=this.captureNameChars();if(e===F)return;const i=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=i.ns=Object.create(null)),(t=this.openTagStartHandler)===null||t===void 0||t.call(this,i),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),e){case m:this.openTag();break;case j:this.state=J;break;default:D(e)||this.fail("disallowed character in tag name."),this.state=M}}sOpenTagSlash(){this.getCode()===m?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=M)}sAttrib(){const t=this.skipSpaces();t!==F&&($(t)?(this.unget(),this.state=tt):t===m?this.openTag():t===j?this.state=J:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===R?this.state=ft:D(t)?this.state=Re:t===m?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==F&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case F:return;case R:this.state=ft;break;default:this.fail("attribute without value."),this.text="",this.name="",t===m?this.openTag():$(t)?(this.unget(),this.state=tt):(this.fail("disallowed character in attribute name."),this.state=M)}}sAttribValue(){const t=this.getCodeNorm();V(t)?(this.q=t,this.state=Ft):D(t)||(this.fail("unquoted attribute value."),this.state=pt,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i}=this;for(;;)switch(this.getCode()){case t:this.pushAttrib(this.name,this.text+e.slice(i,this.prevI)),this.name=this.text="",this.q=null,this.state=we;return;case O:this.text+=e.slice(i,this.prevI),this.state=k,this.entityReturnState=Ft;return;case C:case _:case et:this.text+=`${e.slice(i,this.prevI)} `,i=this.i;break;case S:this.text+=e.slice(i,this.prevI),this.fail("disallowed character.");return;case F:this.text+=e.slice(i);return}}sAttribValueClosed(){const t=this.getCodeNorm();D(t)?this.state=M:t===m?this.openTag():t===j?this.state=J:$(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=tt):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(Oe);switch(t){case O:this.state=k,this.entityReturnState=pt;break;case S:this.fail("disallowed character.");break;case F:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===m?this.openTag():this.state=M}}sCloseTag(){const t=this.captureNameChars();t===m?this.closeTag():D(t)?this.state=ve:t!==F&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case m:this.closeTag();break;case F:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:i,textHandler:a}=this;t:for(;;)switch(this.getCode()){case S:{if(this.state=z,a!==void 0){const{text:n}=this,o=i.slice(t,this.prevI);n.length!==0?(a(n+o),this.text=""):o.length!==0&&a(o)}e=A;break t}case O:this.state=k,this.entityReturnState=E,a!==void 0&&(this.text+=i.slice(t,this.prevI)),e=A;break t;case w:switch(e){case A:e=Ct;break;case Ct:e=st;break;case st:break;default:throw new Error("impossible state")}break;case m:e===st&&this.fail('the string "]]>" is disallowed in char data.'),e=A;break;case _:a!==void 0&&(this.text+=`${i.slice(t,this.prevI)} +`),t=this.i,e=A;break;case F:a!==void 0&&(this.text+=i.slice(t));break t;default:e=A}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:i}=this;let a=!1;t:for(;;){const n=this.getCode();switch(n){case S:{if(this.state=z,i!==void 0){const{text:o}=this,l=e.slice(t,this.prevI);o.length!==0?(i(o+l),this.text=""):l.length!==0&&i(l)}break t}case O:this.state=k,this.entityReturnState=E,i!==void 0&&(this.text+=e.slice(t,this.prevI)),a=!0;break t;case _:i!==void 0&&(this.text+=`${e.slice(t,this.prevI)} +`),t=this.i;break;case F:i!==void 0&&(this.text+=e.slice(t));break t;default:D(n)||(a=!0)}}a&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,e){var i;const{prefix:a,local:n}=this.qname(t),o={name:t,prefix:a,local:n,value:e};if(this.attribList.push(o),(i=this.attributeHandler)===null||i===void 0||i.call(this,o),a==="xmlns"){const l=e.trim();this.currentXMLVersion==="1.0"&&l===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[n]=l,rt(this,n,l)}else if(t==="xmlns"){const l=e.trim();this.topNS[""]=l,rt(this,"",l)}}pushAttribPlain(t,e){var i;const a={name:t,value:e};this.attribList.push(a),(i=this.attributeHandler)===null||i===void 0||i.call(this,a)}end(){var t,e;this.sawRoot||this.fail("document must contain a root element.");const{tags:i}=this;for(;i.length>0;){const n=i.pop();this.fail(`unclosed tag: ${n.name}`)}this.state!==lt&&this.state!==E&&this.fail("unexpected end.");const{text:a}=this;return a.length!==0&&((t=this.textHandler)===null||t===void 0||t.call(this,a),this.text=""),this._closed=!0,(e=this.endHandler)===null||e===void 0||e.call(this),this._init(),this}resolve(t){var e,i;let a=this.topNS[t];if(a!==void 0)return a;const{tags:n}=this;for(let o=n.length-1;o>=0;o--)if(a=n[o].ns[t],a!==void 0)return a;return a=this.ns[t],a!==void 0?a:(i=(e=this.opt).resolvePrefix)===null||i===void 0?void 0:i.call(e,t)}qname(t){const e=t.indexOf(":");if(e===-1)return{prefix:"",local:t};const i=t.slice(e+1),a=t.slice(0,e);return(a===""||i===""||i.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:a,local:i}}processAttribsNS(){var t;const{attribList:e}=this,i=this.tag;{const{prefix:o,local:l}=this.qname(i.name);i.prefix=o,i.local=l;const u=i.uri=(t=this.resolve(o))!==null&&t!==void 0?t:"";o!==""&&(o==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),u===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(o)}.`),i.uri=o))}if(e.length===0)return;const{attributes:a}=i,n=new Set;for(const o of e){const{name:l,prefix:u,local:h}=o;let p,s;u===""?(p=l==="xmlns"?I:"",s=l):(p=this.resolve(u),p===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(u)}.`),p=u),s=`{${p}}${h}`),n.has(s)&&this.fail(`duplicate attribute: ${s}.`),n.add(s),o.uri=p,a[l]=o}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:i,value:a}of t)e[i]!==void 0&&this.fail(`duplicate attribute: ${i}.`),e[i]=a;this.attribList=[]}openTag(){var t;this.processAttribs();const{tags:e}=this,i=this.tag;i.isSelfClosing=!1,(t=this.openTagHandler)===null||t===void 0||t.call(this,i),e.push(i),this.state=E,this.name=""}openSelfClosingTag(){var t,e,i;this.processAttribs();const{tags:a}=this,n=this.tag;n.isSelfClosing=!0,(t=this.openTagHandler)===null||t===void 0||t.call(this,n),(e=this.closeTagHandler)===null||e===void 0||e.call(this,n),(this.tag=(i=a[a.length-1])!==null&&i!==void 0?i:null)===null&&(this.closedRoot=!0),this.state=E,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=E,this.name="",e===""){this.fail("weird empty close tag."),this.text+="";return}const i=this.closeTagHandler;let a=t.length;for(;a-- >0;){const n=this.tag=t.pop();if(this.topNS=n.ns,i==null||i(n),n.name===e)break;this.fail("unexpected close tag.")}a===0?this.closedRoot=!0:a<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=``)}parseEntity(t){if(t[0]!=="#"){const i=this.ENTITIES[t];return i!==void 0?i:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return t[1]==="x"&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}P.SaxesParser=He;var X={};Object.defineProperty(X,"__esModule",{value:!0});X.ParseError=void 0;class je extends Error{constructor(t,e){const i=t.saxParser;super(t.trackPosition?`Line ${i.line} column ${i.column+1}: ${e}`:e)}}X.ParseError=je;var yt={},$t={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateIri=r.IriValidationStrategy=void 0;function t(){const l="[!$&'()*+,;=]",u="%[a-fA-F0-9]{2}",h="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",p=`${h}\\.${h}\\.${h}\\.${h}`,s="[a-fA-F0-9]{1,4}",f=`(${s}:${s}|${p})`,d=`((${s}:){6}${f}|::(${s}:){5}${f}|(${s})?::(${s}:){4}${f}|((${s}:){0,1}${s})?::(${s}:){3}${f}|((${s}:){0,2}${s})?::(${s}:){2}${f}|((${s}:){0,3}${s})?::${s}:${f}|((${s}:){0,4}${s})?::${f}|((${s}:){0,5}${s})?::${s}|((${s}:){0,6}${s})?::)`,Mt=`v[a-fA-F0-9]+\\.(${l}|${l}|":)+`,Ot=`\\[(${d}|${Mt})\\]`,Lt="[0-9]*",kt="[a-zA-Z][a-zA-Z0-9+\\-.]*",Bt="[-󰀀-󿿽􀀀-􏿽]",W="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",L=`(${W}|${u}|${l}|[:@])*`,Ht=`(${L}|[\\/?])*`,jt=`(${L}|${Bt}|[\\/?])*`,ot=`(${L})+`,q=`(${L})*`,Vt="",Ut=`${ot}(\\/${q})*`,Xt=`\\/(${ot}(\\/${q})*)?`,Wt=`(\\/${q})*`,qt=`(${W}|${u}|${l})*`,Gt=`(${Ot}|${p}|${qt})`,Qt=`(\\/\\/${`(${`(${W}|${u}|${l}|:)*`}@)?${Gt}(:${Lt})?`}${Wt}|${Xt}|${Ut}|${Vt})`,zt=`^${kt}:${Qt}(\\?${jt})?(#${Ht})?$`;return new RegExp(zt,"u")}const e=t(),i=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var a;(function(o){o.Strict="strict",o.Pragmatic="pragmatic",o.None="none"})(a=r.IriValidationStrategy||(r.IriValidationStrategy={}));function n(o,l=a.Strict){switch(l){case a.Strict:return e.test(o)?void 0:new Error(`Invalid IRI according to RFC 3987: '${o}'`);case a.Pragmatic:return i.test(o)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${o}'`);case a.None:return;default:return new Error(`Not supported validation strategy "${l}"`)}}r.validateIri=n})($t);(function(r){var t=N&&N.__createBinding||(Object.create?function(i,a,n,o){o===void 0&&(o=n);var l=Object.getOwnPropertyDescriptor(a,n);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[n]}}),Object.defineProperty(i,o,l)}:function(i,a,n,o){o===void 0&&(o=n),i[o]=a[n]}),e=N&&N.__exportStar||function(i,a){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(a,n)&&t(a,i,n)};Object.defineProperty(r,"__esModule",{value:!0}),e($t,r)})(yt);Object.defineProperty(v,"__esModule",{value:!0});v.ParseType=v.RdfXmlParser=void 0;const bt=Yt,Ve=P,St=Kt,Ue=X,Xe=Zt,at=yt;class c extends St.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=new Xe.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?at.IriValidationStrategy.Pragmatic:at.IriValidationStrategy.None),this.saxParser=new Ve.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(t){const e=new St.PassThrough({readableObjectMode:!0});t.on("error",a=>i.emit("error",a)),t.on("data",a=>e.push(a)),t.on("end",()=>e.push(null));const i=e.pipe(new c(this.options));return i}_transform(t,e,i){try{this.saxParser.write(t)}catch(a){return i(a)}i()}newParseError(t){return new Ue.ParseError(this,t)}valueToUri(t,e){return this.uriToNamedNode((0,bt.resolve)(t,e.baseIRI))}uriToNamedNode(t){const e=(0,at.validateIri)(t,this.iriValidationStrategy);if(e instanceof Error)throw this.newParseError(e.message);return this.dataFactory.namedNode(t)}validateNcname(t){if(!c.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}attachSaxListeners(){this.saxParser.on("error",t=>this.emit("error",t)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(t){const e=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let i=b.RESOURCE;if(e&&(e.hadChildren=!0,i=e.childrenParseType),e&&e.childrenStringTags){const n=t.name;let o="";for(const p in t.attributes)o+=` ${p}="${t.attributes[p].value}"`;const u=`<${`${n}${o}`}>`;e.childrenStringTags.push(u);const h={childrenStringTags:e.childrenStringTags};h.childrenStringEmitClosingTag=``,this.activeTagStack.push(h);return}const a={};e?(a.language=e.language,a.baseIRI=e.baseIRI):a.baseIRI=this.baseIRI,this.activeTagStack.push(a),i===b.RESOURCE?this.onTagResource(t,a,e,!e):this.onTagProperty(t,a,e)}onTagResource(t,e,i,a){e.childrenParseType=b.PROPERTY;let n=!0;if(t.uri===c.RDF){if(!a&&c.FORBIDDEN_NODE_ELEMENTS.indexOf(t.local)>=0)throw this.newParseError(`Illegal node element name: ${t.local}`);switch(t.local){case"RDF":e.childrenParseType=b.RESOURCE;case"Description":n=!1}}const o=[],l=[];let u=null,h=!1,p=!1,s=null;for(const f in t.attributes){const d=t.attributes[f];if(i&&d.uri===c.RDF)switch(d.local){case"about":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);u=d.value;continue;case"ID":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);this.validateNcname(d.value),u="#"+d.value,h=!0;continue;case"nodeID":if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${d.value} and ${u} where found.`);this.validateNcname(d.value),u=d.value,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":s=d.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(d.uri===c.XML){if(d.local==="lang"){e.language=d.value===""?null:d.value.toLowerCase();continue}else if(d.local==="base"){e.baseIRI=(0,bt.resolve)(d.value,e.baseIRI);continue}}d.prefix!=="xml"&&d.prefix!=="xmlns"&&(d.prefix!==""||d.local!=="xmlns")&&d.uri&&(o.push(this.uriToNamedNode(d.uri+d.local)),l.push(d.value))}if(u!==null&&(e.subject=p?this.dataFactory.blankNode(u):this.valueToUri(u,e),h&&this.claimNodeId(e.subject)),e.subject||(e.subject=this.dataFactory.blankNode()),n){const f=this.uriToNamedNode(t.uri+t.local);this.emitTriple(e.subject,this.dataFactory.namedNode(c.RDF+"type"),f,i?i.reifiedStatementId:null)}if(i){if(i.predicate)if(i.childrenCollectionSubject){const f=this.dataFactory.blankNode();this.emitTriple(i.childrenCollectionSubject,i.childrenCollectionPredicate,f,i.reifiedStatementId),this.emitTriple(f,this.dataFactory.namedNode(c.RDF+"first"),e.subject,e.reifiedStatementId),i.childrenCollectionSubject=f,i.childrenCollectionPredicate=this.dataFactory.namedNode(c.RDF+"rest")}else{this.emitTriple(i.subject,i.predicate,e.subject,i.reifiedStatementId);for(let f=0;f=0)throw this.newParseError(`Illegal property element name: ${t.local}`);e.predicateSubPredicates=[],e.predicateSubObjects=[];let a=!1,n=!1,o=null,l=!0;const u=[],h=[];for(const p in t.attributes){const s=t.attributes[p];if(s.uri===c.RDF)switch(s.local){case"resource":if(o)throw this.newParseError(`Found both rdf:resource (${s.value}) and rdf:nodeID (${o}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${s.value})`);e.hadChildren=!0,o=s.value,l=!1;continue;case"datatype":if(n)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${s.value}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${s.value})`);e.datatype=this.valueToUri(s.value,e);continue;case"nodeID":if(n)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${s.value}).`);if(e.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${s.value}).`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${s.value})`);this.validateNcname(s.value),e.hadChildren=!0,o=s.value,l=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(n)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(e.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${e.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if(s.value==="Resource"){a=!0,e.childrenParseType=b.PROPERTY;const f=this.dataFactory.blankNode();this.emitTriple(e.subject,e.predicate,f,e.reifiedStatementId),e.subject=f,e.predicate=null}else s.value==="Collection"?(a=!0,e.hadChildren=!0,e.childrenCollectionSubject=e.subject,e.childrenCollectionPredicate=e.predicate,l=!1):s.value==="Literal"&&(a=!0,e.childrenTagsToString=!0,e.childrenStringTags=[]);continue;case"ID":this.validateNcname(s.value),e.reifiedStatementId=this.valueToUri("#"+s.value,e),this.claimNodeId(e.reifiedStatementId);continue}else if(s.uri===c.XML&&s.local==="lang"){e.language=s.value===""?null:s.value.toLowerCase();continue}if(s.prefix!=="xml"&&s.prefix!=="xmlns"&&(s.prefix!==""||s.local!=="xmlns")&&s.uri){if(a||e.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${s.value}`);e.hadChildren=!0,n=!0,u.push(this.uriToNamedNode(s.uri+s.local)),h.push(this.dataFactory.literal(s.value,e.datatype||e.language))}}if(o!==null){const p=e.subject;e.subject=l?this.dataFactory.blankNode(o):this.valueToUri(o,e),this.emitTriple(p,e.predicate,e.subject,e.reifiedStatementId);for(let s=0;s/g,(e,i,a)=>(this.saxParser.ENTITIES[i]=a,""))}}v.RdfXmlParser=c;c.MIME_TYPE="application/rdf+xml";c.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#";c.XML="http://www.w3.org/XML/1998/namespace";c.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"];c.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"];c.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u;var b;(function(r){r[r.RESOURCE=0]="RESOURCE",r[r.PROPERTY=1]="PROPERTY"})(b||(v.ParseType=b={}));(function(r){var t=N&&N.__createBinding||(Object.create?function(i,a,n,o){o===void 0&&(o=n);var l=Object.getOwnPropertyDescriptor(a,n);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[n]}}),Object.defineProperty(i,o,l)}:function(i,a,n,o){o===void 0&&(o=n),i[o]=a[n]}),e=N&&N.__exportStar||function(i,a){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(a,n)&&t(a,i,n)};Object.defineProperty(r,"__esModule",{value:!0}),e(v,r)})(Nt);class Ze extends Nt.RdfXmlParser{constructor({factory:t,...e}={}){super({...e,dataFactory:t})}}export{Ze as default}; diff --git a/rdf-editor/assets/browser-BwSN-dYO.js b/rdf-editor/assets/browser-BwSN-dYO.js new file mode 100644 index 0000000..596d467 --- /dev/null +++ b/rdf-editor/assets/browser-BwSN-dYO.js @@ -0,0 +1 @@ +var a={exports:{}};typeof Object.create=="function"?a.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:a.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var c=a.exports,s=i;function i(t,e){if(o("noDeprecation"))return t;var r=!1;function n(){if(!r){if(o("throwDeprecation"))throw new Error(e);o("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function o(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}export{s as b,c as i}; diff --git a/rdf-editor/assets/canonicalize-DMjjQ0zD.js b/rdf-editor/assets/canonicalize-DMjjQ0zD.js new file mode 100644 index 0000000..ee44283 --- /dev/null +++ b/rdf-editor/assets/canonicalize-DMjjQ0zD.js @@ -0,0 +1 @@ +var l=function(f){return n(f);function n(r){if(r===null||typeof r!="object"||r.toJSON!=null)return JSON.stringify(r);if(Array.isArray(r)&&r.length===0)return"[]";if(Array.isArray(r)&&r.length===1)return"["+n(r[0])+"]";if(Array.isArray(r))return"["+r.reduce((i,e,a)=>(i=a===1?n(i):i,i+","+n(e)))+"]";const u=Object.keys(r);return u.length===0?"{}":u.length===1?"{"+n(u[0])+":"+n(r[u[0]])+"}":"{"+u.sort().reduce((i,e,a)=>(i=a===1?n(i)+":"+n(r[i]):i,i+","+n(e)+":"+n(r[e])))+"}"}};export{l as c}; diff --git a/rdf-editor/assets/index-0uXaghQa.js b/rdf-editor/assets/index-0uXaghQa.js new file mode 100644 index 0000000..b972bc1 --- /dev/null +++ b/rdf-editor/assets/index-0uXaghQa.js @@ -0,0 +1,2 @@ +import{S as D}from"./index-BOvYCoiN.js";import{g as M,a as $,f as O}from"./index-3C0HHkK2.js";import{r as q}from"./readable-BmS1kvD9.js";const g="http://www.w3.org/1999/02/22-rdf-syntax-ns#",m="http://www.w3.org/2001/XMLSchema#",P="http://www.w3.org/2000/10/swap/",f={xsd:{decimal:`${m}decimal`,boolean:`${m}boolean`,double:`${m}double`,integer:`${m}integer`,string:`${m}string`},rdf:{type:`${g}type`,nil:`${g}nil`,first:`${g}first`,rest:`${g}rest`,langString:`${g}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${P}reify#forSome`,forAll:`${P}reify#forAll`},log:{implies:`${P}log#implies`}};/*! queue-microtask. MIT License. Feross Aboukhadijeh */let I;var B=typeof queueMicrotask=="function"?queueMicrotask:u=>(I||(I=Promise.resolve())).then(u).catch(e=>setTimeout(()=>{throw e},0));const G=M(B),{xsd:R}=f,U=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,F={"\\":"\\","'":"'",'"':'"',n:` +`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},z=/[\x00-\x20<>\\"\{\}\|\^\`]/,Q={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},H=/$0^/;class Z{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._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._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|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=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const i in this)!(i in Q)&&this[i]instanceof RegExp&&(this[i]=H)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,i){let t=this._input,s=t.length;for(;;){let n,_;for(;n=this._newline.exec(t);)this._comments&&(_=this._comment.exec(n[0]))&&a("comment",_[1],"",this._line,n[0].length),t=t.substr(n[0].length,t.length),s=t.length,this._line++;if(!n&&(n=this._whitespace.exec(t))&&(t=t.substr(n[0].length,t.length)),this._endOfFile.test(t))return i&&(this._comments&&(_=this._comment.exec(t))&&a("comment",_[1],"",this._line,t.length),t=null,a("eof","","",this._line,0)),this._input=t;const y=this._line,N=t[0];let l="",d="",p="",h=null,c=0,b=!1;switch(N){case"^":if(t.length<3)break;if(t[1]==="^"){if(this._previousMarker="^^",t=t.substr(2),t[0]!=="<"){b=!0;break}}else{this._n3Mode&&(c=1,l="^");break}case"<":if(h=this._unescapedIri.exec(t))l="IRI",d=h[1];else if(h=this._iri.exec(t)){if(d=this._unescape(h[1]),d===null||z.test(d))return r(this);l="IRI"}else t.length>1&&t[1]==="<"?(l="<<",c=2):this._n3Mode&&t.length>1&&t[1]==="="&&(l="inverse",c=2,d=">");break;case">":t.length>1&&t[1]===">"&&(l=">>",c=2);break;case"_":((h=this._blank.exec(t))||i&&(h=this._blank.exec(`${t} `)))&&(l="blank",p="_",d=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(t))d=h[1];else if({value:d,matchLength:c}=this._parseLiteral(t),d===null)return r(this);(h!==null||c!==0)&&(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(t))d=h[1];else if({value:d,matchLength:c}=this._parseLiteral(t),d===null)return r(this);(h!==null||c!==0)&&(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(t))&&(l="var",d=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(t))?(l="langcode",d=h[1]):(h=this._keyword.exec(t))&&(l=h[0]);break;case".":if(t.length===1?i:t[1]<"0"||t[1]>"9"){l=".",c=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(t)||i&&(h=this._number.exec(`${t} `)))&&(l="literal",d=h[0],p=typeof h[1]=="string"?R.double:typeof h[2]=="string"?R.decimal:R.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(t))?l=h[0].toUpperCase():b=!0;break;case"f":case"t":(h=this._boolean.exec(t))?(l="literal",d=h[0],p=R.boolean):b=!0;break;case"a":(h=this._shortPredicates.exec(t))?(l="abbreviation",d="a"):b=!0;break;case"=":this._n3Mode&&t.length>1&&(l="abbreviation",t[1]!==">"?(c=1,d="="):(c=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(c=1,l=N);break;default:b=!0}if(b&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(h=this._prefix.exec(t))?(l="prefix",d=h[1]||""):((h=this._prefixed.exec(t))||i&&(h=this._prefixed.exec(`${t} `)))&&(l="prefixed",p=h[1]||"",d=this._unescape(h[2]))),this._previousMarker==="^^")switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return i||!/^'''|^"""/.test(t)&&/\n|\r/.test(t)?r(this):this._input=t;const w=c||h[0].length,A=a(l,d,p,y,w);this.previousToken=A,this._previousMarker=l,t=t.substr(w,t.length)}function a(n,_,y,N,l){const d=t?s-t.length:s,p=d+l,h={type:n,value:_,prefix:y,line:N,start:d,end:p};return e(null,h),h}function r(n){e(n._syntaxError(/^\S*/.exec(t)[0]))}}_unescape(e){let i=!1;const t=e.replace(U,(s,a,r,n)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof r=="string"){let _=Number.parseInt(r,16);return _<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((_-=65536)>>10),56320+(_&1023))}return n in F?F[n]:(i=!0,"")});return i?null:t}_parseLiteral(e){if(e.length>=3){const i=e.match(/^(?:"""|"|'''|'|)/)[0],t=i.length;let s=Math.max(this._literalClosingPos,t);for(;(s=e.indexOf(i,s))>0;){let a=0;for(;e[s-a-1]==="\\";)a++;if(a%2===0){const r=e.substring(t,s),n=r.split(/\r\n|\r|\n/).length-1,_=s+t;if(t===1&&n!==0||t===3&&this._lineMode)break;return this._line+=n,{value:this._unescape(r),matchLength:_}}s++}this._literalClosingPos=e.length-t+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const i=new Error(`Unexpected "${e}" on line ${this._line}.`);return i.context={token:void 0,line:this._line,previousToken:this.previousToken},i}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,i){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof i=="function")G(()=>this._tokenizeToEnd(i,!0));else{const t=[];let s;if(this._tokenizeToEnd((a,r)=>a?s=a:t.push(r),!0),s)throw s;return t}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",t=>{this._input!==null&&t.length!==0&&(this._pendingBuffer&&(t=Buffer.concat([this._pendingBuffer,t]),this._pendingBuffer=null),t[t.length-1]&128?this._pendingBuffer=t:(typeof this._input>"u"?this._input=this._readStartingBom(typeof t=="string"?t:t.toString()):this._input+=t,this._tokenizeToEnd(i,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(i,!0)}),e.on("error",i)}}const{rdf:V,xsd:x}=f;let S,J=0;const X={namedNode:ie,blankNode:se,variable:ae,literal:re,defaultGraph:ue,quad:T,triple:T},K=X;class o{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof o?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class k extends o{get termType(){return"NamedNode"}}class j extends o{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let i=e.lastIndexOf('"')+1;return i0?"INF":"-INF")))),i===""||i===x.string?new j(`"${u}"`):new j(`"${u}"^^${i}`)}function ae(u){return new Y(u)}function ue(){return S}function T(u,e,i,t){return new te(u,e,i,t)}let E=0;class C{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&L(this,e.factory);const i=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",t=/turtle/.test(i),s=/trig/.test(i),a=/triple/.test(i),r=/quad/.test(i),n=this._n3Mode=/n3/.test(i),_=a||r;(this._supportsNamedGraphs=!(t||n))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(t||s||a||n),this._supportsRDFStar=i===""||/star|\*$/.test(i),_&&(this._resolveRelativeIRI=y=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Z({lineMode:_,n3:n}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){E=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const i=e.indexOf("#");i>=0&&(e=e.substr(0,i)),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,i,t,s,a){const r=this._n3Mode;this._contextStack.push({type:e,subject:t,predicate:s,object:a,graph:i,inverse:r?this._inversePredicate:!1,blankPrefix:r?this._prefixes._:"",quantified:r?this._quantified:null}),r&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,i){const t=this._contextStack.pop();if(!t||t.type!==e)return this._error(`Unexpected ${i.type}`,i);this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,this._n3Mode&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;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,i){let t;switch(e.type){case"IRI":case"typeIRI":const s=this._resolveIRI(e.value);if(s===null)return this._error("Invalid IRI",e);t=this._namedNode(s);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);t=this._namedNode(a+e.value);break;case"blank":t=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":t=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!i&&this._n3Mode&&t.id in this._quantified&&(t=this._quantified[t.id]),t}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return 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._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=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._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._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const i=e.type;switch(i){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${i}`,e):(this._subject=null,i==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._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._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return 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._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);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._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(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);const i=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:i?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let i=null,t=null,s=this._readListItem;const a=this._subject,r=this._contextStack,n=r[r.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,t=this._blankNode(),this.RDF_FIRST,this._subject=i=this._blankNode()),s=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,t=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),r.length!==0&&r[r.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(s=this._readPredicate,this._subject===this.RDF_NIL)return s}else if(s=this._getContextEndReader(),this._object===this.RDF_NIL)return s;t=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,s=this._readListItemDataTypeOrLang):(i=this._literal(e.value,this._namedNode(e.prefix)),s=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((i=this._readEntity(e))===void 0)return}if(t===null&&(this._subject=t=this._blankNode()),a===null?n.predicate===null?n.subject=t:n.object=t:this._emit(a,this.RDF_REST,t,this._graph),i!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,t,this.RDF_FIRST,i),this._subject=i,this._predicate=null,this._getPathReader(this._readListItem);this._emit(t,this.RDF_FIRST,i,this._graph)}return s}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let i=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const t=this._readEntity(e);if(t===void 0)return;i=this._literal(this._literalValue,t),e=null;break;case"langcode":i=this._literal(this._literalValue,e.value),e=null;break}return{token:e,literal:i}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,i){const t=this._completeLiteral(e);if(t)return this._object=t.literal,i&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),t.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(t.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let i,t=this._graph;const s=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,i=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":i=this._readPredicate;break;case",":i=this._readObject;break;default:if(this._supportsQuads&&this._graph===null&&(t=this._readEntity(e))!==void 0){i=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null){const r=this._predicate,n=this._object;a?this._emit(n,r,s,t):this._emit(s,r,n,t)}return i}_readBlankNodePunctuation(e){let i;switch(e.type){case";":i=this._readPredicate;break;case",":i=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),i}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const i=this._readEntity(e);return this._prefixes[this._prefix]=i.value,this._prefixCallback(this._prefix,i),this._readDeclarationPunctuation}_readBaseIRI(e){const i=e.type==="IRI"&&this._resolveIRI(e.value);return i?(this._setBase(i),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base 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._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let i;switch(e.type){case"IRI":case"prefixed":if((i=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._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,i,this.QUANTIFIERS_GRAPH)):this._quantified[i.id]=this._quantifier(this._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:const i=this._contextStack,t=i.length&&i[i.length-1];if(t&&t.type==="item"){const s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let i,t;const s=this._blankNode();if((t=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=s):(i=this._object,this._object=s),this._emit(i,t,s,this._graph),this._readPath}_readBackwardPath(e){const i=this._blankNode();let t,s;if((t=this._readEntity(e))!==void 0)return this._predicate===null?(s=this._subject,this._subject=i):(s=this._object,this._object=i),this._emit(i,t,s,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const i=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=i,this._readPredicate):(this._object=i,this._getContextEndReader())}_getContextEndReader(){const 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._readRDFStarTailOrGraph}}_emit(e,i,t,s){this._callback(null,this._quad(e,i,t,s||this.DEFAULTGRAPH))}_error(e,i){const t=new Error(`${e} on line ${i.line}.`);t.context={token:i,line:i.line,previousToken:this._lexer.previousToken},this._callback(t),this._callback=v}_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;const i=e.length;let t="",s=-1,a=-1,r=0,n="/";for(;s=a&&(t=t.substr(0,r)),n!=="/")return`${t}/${e.substr(s+1)}`;r=s+1}}}n=e[++s]}return t+e.substring(r)}parse(e,i,t){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${E++}_`,this._prefixCallback=t||v,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const s=[];let a;if(this._callback=(r,n)=>{r?a=r:n&&s.push(n)},this._lexer.tokenize(e).every(r=>this._readCallback=this._readCallback(r)),a)throw a;return s}this._callback=i,this._lexer.tokenize(e,(s,a)=>{s!==null?(this._callback(s),this._callback=v):this._readCallback&&(this._readCallback=this._readCallback(a))})}}function v(){}function L(u,e){const i=e.namedNode;u._namedNode=i,u._blankNode=e.blankNode,u._literal=e.literal,u._variable=e.variable,u._quad=e.quad,u.DEFAULTGRAPH=e.defaultGraph(),u.RDF_FIRST=i(f.rdf.first),u.RDF_REST=i(f.rdf.rest),u.RDF_NIL=i(f.rdf.nil),u.N3_FORALL=i(f.r.forAll),u.N3_FORSOME=i(f.r.forSome),u.ABBREVIATIONS={a:i(f.rdf.type),"=":i(f.owl.sameAs),">":i(f.log.implies)},u.QUANTIFIERS_GRAPH=i("urn:n3:quantifiers")}L(C.prototype,K);class ne extends $.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const i=new C(e);let t,s;i.parse({on:(a,r)=>{switch(a){case"data":t=r;break;case"end":s=r;break}}},(a,r)=>{a&&this.emit("error",a)||r&&this.push(r)},(a,r)=>{this.emit("prefix",a,r)}),this._transform=(a,r,n)=>{t(a),n()},this._flush=a=>{s(),a()}}import(e){return e.on("data",i=>{this.write(i)}),e.on("end",()=>{this.end()}),e.on("error",i=>{this.emit("error",i)}),this}}class he{constructor(e,{baseIRI:i="",factory:t=O,...s}={}){const a={blankNode:t.blankNode.bind(t),defaultGraph:t.defaultGraph.bind(t),literal:t.literal.bind(t),namedNode:t.namedNode.bind(t),quad:t.quad.bind(t)},r=new ne({baseIRI:i,factory:a,...s});return e.pipe(r),q(r)}}class ce extends D{constructor(e){super(he,e)}}export{ce as default}; diff --git a/rdf-editor/assets/index-3C0HHkK2.js b/rdf-editor/assets/index-3C0HHkK2.js new file mode 100644 index 0000000..a277bae --- /dev/null +++ b/rdf-editor/assets/index-3C0HHkK2.js @@ -0,0 +1,1313 @@ +const __vite__fileDeps=["assets/index-4jetJFYF.js","assets/index-BOvYCoiN.js","assets/readable-BmS1kvD9.js","assets/index-LYq9jbwg.js","assets/canonicalize-DMjjQ0zD.js","assets/index-0uXaghQa.js","assets/CustomRdfXmlParser-DayyQqb1.js","assets/index-CyXDZ5oU.js","assets/CustomJsonLdSerializer-DF49DE2p.js","assets/main-DrNJRgyo.js","assets/main-C74y4mRU.js","assets/main-Cqji3b8q.js","assets/main-bPSeNL4h.js","assets/browser-BwSN-dYO.js","assets/main-xslIGBng.js","assets/main-D1dAc-CX.js","assets/main-Bm6ldnLs.js","assets/main-d5updtmN.js","assets/index-CtXwIllf.js","assets/stream-ct2h2lnd.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +const cu=Object.freeze(Object.defineProperty({__proto__:null,get _void(){return rE},get acl(){return AS},get as(){return $S},get bibo(){return RS},get cc(){return NS},get cert(){return OS},get cnt(){return PS},get constant(){return FS},get crm(){return US},get csvw(){return HS},get ctag(){return GS},get dash(){return VS},get dashSparql(){return KS},get dbo(){return JS},get dc11(){return QS},get dcam(){return t1},get dcat(){return n1},get dcmitype(){return o1},get dcterms(){return l1},get default(){return _S},get dig(){return u1},get discipline(){return c1},get doap(){return h1},get dpv(){return g1},get dqv(){return b1},get dtype(){return y1},get duv(){return x1},get earl(){return _1},get ebucore(){return E1},get exif(){return A1},get foaf(){return $1},get frbr(){return R1},get geo(){return N1},get geof(){return O1},get geor(){return P1},get gml(){return F1},get gn(){return U1},get gr(){return H1},get grddl(){return G1},get gs1(){return K1},get gtfs(){return V1},get http(){return J1},get hydra(){return Q1},get ical(){return t_},get la(){return n_},get ldp(){return o_},get list(){return l_},get locn(){return u_},get log(){return c_},get lvont(){return h_},get m4i(){return g_},get ma(){return b_},get mads(){return y_},get math(){return x_},get oa(){return __},get og(){return E_},get oidc(){return A_},get org(){return $_},get owl(){return R_},get pim(){return N_},get prefix(){return O_},get prov(){return P_},get qb(){return F_},get qkdv(){return U_},get quantitykind(){return H_},get qudt(){return G_},get rdau(){return K_},get rdf(){return er},get rdfa(){return Y_},get rdfs(){return Z_},get rev(){return ek},get rico(){return rk},get rif(){return gE},get rr(){return ik},get rss(){return sk},get schema(){return ak},get sd(){return fk},get sdmx(){return dk},get sem(){return pk},get set(){return mk},get sf(){return wk},get sh(){return vk},get shex(){return Sk},get shsh(){return kk},get sioc(){return Tk},get skos(){return Ck},get skosxl(){return Lk},get solid(){return Mk},get sosa(){return Ik},get sou(){return Dk},get ssn(){return Bk},get stat(){return Wk},get string(){return zk},get test(){return jk},get time(){return qk},get unit(){return Xk},get v(){return bE},get vaem(){return Yk},get vann(){return Zk},get vcard(){return eE},get vs(){return iE},get wdr(){return yE},get wdrs(){return sE},get wgs(){return aE},get xhv(){return fE},get xkos(){return dE},get xml(){return xE},get xsd(){return io}},Symbol.toStringTag,{value:"Module"}));(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();const Ys=[],nh=(e,t)=>{Ys[e]=t},yi=Object.freeze({HOST:"host",KNOB:"knob",SLOT:"slot",PREFIX:"prefix",SUFFIX:"suffix",WRAPPER:"wrapper"}),Mn=e=>e instanceof HTMLTemplateElement,du=(e,t)=>r=>{const{element:n,target:i}=r.dataset;return n===e&&i===t},As=e=>Mn(e)?e.content.firstElementChild:null,Xi=(e,t,r)=>Ys[e].find(du(t,r)),Gm=(e,t,r)=>Ys[e].filter(du(t,r)),xa=(e,t,r)=>Ys[e].some(du(t,r));function ih(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const hu=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pu=Symbol(),Bf=new Map;let oh=class{constructor(t,r){if(this._$cssResult$=!0,r!==pu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=Bf.get(this.cssText);return hu&&t===void 0&&(Bf.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}};const qm=e=>new oh(typeof e=="string"?e:e+"",pu),qn=(e,...t)=>{const r=e.length===1?e[0]:t.reduce((n,i,o)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new oh(r,pu)},Km=(e,t)=>{hu?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{const n=document.createElement("style"),i=window.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)})},Ff=hu?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const n of t.cssRules)r+=n.cssText;return qm(r)})(e):e;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Ol;const Wf=window.trustedTypes,Xm=Wf?Wf.emptyScript:"",Uf=window.reactiveElementPolyfillSupport,Sa={toAttribute(e,t){switch(t){case Boolean:e=e?Xm:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},sh=(e,t)=>t!==e&&(t==t||e==e),Dl={attribute:!0,type:String,converter:Sa,reflect:!1,hasChanged:sh};let ii=class extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var r;(r=this.l)!==null&&r!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Eh(n,r);i!==void 0&&(this._$Eu.set(i,n),t.push(i))}),t}static createProperty(t,r=Dl){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){const n=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,r);i!==void 0&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,r,n){return{get(){return this[r]},set(i){const o=this[t];this[r]=i,this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||Dl}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const r=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const i of n)r.unshift(Ff(i))}else t!==void 0&&r.push(Ff(t));return r}static _$Eh(t,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,n;((r=this._$Eg)!==null&&r!==void 0?r:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)===null||n===void 0||n.call(t))}removeController(t){var r;(r=this._$Eg)===null||r===void 0||r.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Et.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;const r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return Km(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ES(t,r,n=Dl){var i,o;const s=this.constructor._$Eh(t,n);if(s!==void 0&&n.reflect===!0){const l=((o=(i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==null&&o!==void 0?o:Sa.toAttribute)(r,n.type);this._$Ei=t,l==null?this.removeAttribute(s):this.setAttribute(s,l),this._$Ei=null}}_$AK(t,r){var n,i,o;const s=this.constructor,l=s._$Eu.get(t);if(l!==void 0&&this._$Ei!==l){const a=s.getPropertyOptions(l),u=a.converter,f=(o=(i=(n=u)===null||n===void 0?void 0:n.fromAttribute)!==null&&i!==void 0?i:typeof u=="function"?u:null)!==null&&o!==void 0?o:Sa.fromAttribute;this._$Ei=l,this[l]=f(r,a.type),this._$Ei=null}}requestUpdate(t,r,n){let i=!0;t!==void 0&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||sh)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),n.reflect===!0&&this._$Ei!==t&&(this._$E_===void 0&&(this._$E_=new Map),this._$E_.set(t,n))):i=!1),!this.isUpdatePending&&i&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(r){Promise.reject(r)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((i,o)=>this[o]=i),this._$Et=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(t=this._$Eg)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$EU()}catch(i){throw r=!1,this._$EU(),i}r&&this._$AE(n)}willUpdate(t){}_$AE(t){var r;(r=this._$Eg)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$E_!==void 0&&(this._$E_.forEach((r,n)=>this._$ES(n,this[n],r)),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}};ii.finalized=!0,ii.elementProperties=new Map,ii.elementStyles=[],ii.shadowRootOptions={mode:"open"},Uf==null||Uf({ReactiveElement:ii}),((Ol=globalThis.reactiveElementVersions)!==null&&Ol!==void 0?Ol:globalThis.reactiveElementVersions=[]).push("1.0.2");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Pl;const vi=globalThis.trustedTypes,zf=vi?vi.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ir=`lit$${(Math.random()+"").slice(9)}$`,gu="?"+Ir,Vm=`<${gu}>`,xi=document,go=(e="")=>xi.createComment(e),mo=e=>e===null||typeof e!="object"&&typeof e!="function",lh=Array.isArray,ah=e=>{var t;return lh(e)||typeof((t=e)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},Ui=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hf=/-->/g,jf=/>/g,xn=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Gf=/'/g,qf=/"/g,uh=/^(?:script|style|textarea)$/i,Ym=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),$e=Ym(1),ir=Symbol.for("lit-noChange"),Ve=Symbol.for("lit-nothing"),Kf=new WeakMap,fh=(e,t,r)=>{var n,i;const o=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:t;let s=o._$litPart$;if(s===void 0){const l=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=s=new Li(t.insertBefore(go(),l),l,void 0,r??{})}return s._$AI(e),s},ci=xi.createTreeWalker(xi,129,null,!1),ch=(e,t)=>{const r=e.length-1,n=[];let i,o=t===2?"":"",s=Ui;for(let a=0;a"?(s=i??Ui,g=-1):h[1]===void 0?g=-2:(g=s.lastIndex-h[2].length,f=h[1],s=h[3]===void 0?xn:h[3]==='"'?qf:Gf):s===qf||s===Gf?s=xn:s===Hf||s===jf?s=Ui:(s=xn,i=void 0);const w=s===xn&&e[a+1].startsWith("/>")?" ":"";o+=s===Ui?u+Vm:g>=0?(n.push(f),u.slice(0,g)+"$lit$"+u.slice(g)+Ir+w):u+Ir+(g===-2?(n.push(void 0),a):w)}const l=o+(e[r]||"")+(t===2?"":"");return[zf!==void 0?zf.createHTML(l):l,n]};class bo{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let o=0,s=0;const l=t.length-1,a=this.parts,[u,f]=ch(t,r);if(this.el=bo.createElement(u,n),ci.currentNode=this.el.content,r===2){const h=this.el.content,g=h.firstChild;g.remove(),h.append(...g.childNodes)}for(;(i=ci.nextNode())!==null&&a.length0){i.textContent=vi?vi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Ve}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,n,i){const o=this.strings;let s=!1;if(o===void 0)t=Wn(this,t,r,0),s=!mo(t)||t!==this._$AH&&t!==ir,s&&(this._$AH=t);else{const l=t;let a,u;for(t=o[0],a=0;at.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(r){r.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(r){r.createProperty(t.key,e)}};function Qe(e){return(t,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(e,t,r):Qm(e,t)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Js={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Do=e=>(...t)=>({_$litDirective$:e,values:t});let Po=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this._$Ct=t,this._$AM=r,this._$Ci=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{H:e0}=Zm,t0=e=>e===null||typeof e!="object"&&typeof e!="function",Yo=(e,t)=>{var r,n;return t===void 0?((r=e)===null||r===void 0?void 0:r._$litType$)!==void 0:((n=e)===null||n===void 0?void 0:n._$litType$)===t},r0=e=>e.strings===void 0,Yf=()=>document.createComment(""),Jf=(e,t,r)=>{var n;const i=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(r===void 0){const s=i.insertBefore(Yf(),o),l=i.insertBefore(Yf(),o);r=new e0(s,l,e,e.options)}else{const s=r._$AB.nextSibling,l=r._$AM,a=l!==e;if(a){let u;(n=r._$AQ)===null||n===void 0||n.call(r,e),r._$AM=e,r._$AP!==void 0&&(u=e._$AU)!==l._$AU&&r._$AP(u)}if(s!==o||a){let u=r._$AA;for(;u!==s;){const f=u.nextSibling;i.insertBefore(u,o),u=f}}}return r},n0={},Zf=(e,t=n0)=>e._$AH=t,Qf=e=>e._$AH,i0=e=>{e._$AR()};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const bh=Do(class extends Po{constructor(e){super(e),this.tt=new WeakMap}render(e){return[e]}update(e,[t]){if(Yo(this.it)&&(!Yo(t)||this.it.strings!==t.strings)){const r=Qf(e).pop();let n=this.tt.get(this.it.strings);if(n===void 0){const i=document.createDocumentFragment();n=fh(Ve,i),n.setConnected(!1),this.tt.set(this.it.strings,n)}Zf(n,[r]),Jf(n,void 0,r)}if(Yo(t)){if(!Yo(this.it)||this.it.strings!==t.strings){const r=this.tt.get(t.strings);if(r!==void 0){const n=Qf(r).pop();i0(e),Jf(e,void 0,n),Zf(e,[n])}}this.it=t}else this.it=void 0;return this.render(t)}});/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ro=(e,t)=>{var r,n;const i=e._$AN;if(i===void 0)return!1;for(const o of i)(n=(r=o)._$AO)===null||n===void 0||n.call(r,t,!1),ro(o,t);return!0},Cs=e=>{let t,r;do{if((t=e._$AM)===void 0)break;r=t._$AN,r.delete(e),e=t}while((r==null?void 0:r.size)===0)},wh=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(r===void 0)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),l0(t)}};function o0(e){this._$AN!==void 0?(Cs(this),this._$AM=e,wh(this)):this._$AM=e}function s0(e,t=!1,r=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(n))for(let o=r;o{var t,r,n,i;e.type==Js.CHILD&&((t=(n=e)._$AP)!==null&&t!==void 0||(n._$AP=s0),(r=(i=e)._$AQ)!==null&&r!==void 0||(i._$AQ=o0))};class a0 extends Po{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,r,n){super._$AT(t,r,n),wh(this),this.isConnected=t._$AU}_$AO(t,r=!0){var n,i;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)===null||n===void 0||n.call(this):(i=this.disconnected)===null||i===void 0||i.call(this)),r&&(ro(this,t),Cs(this))}setValue(t){if(r0(this._$Ct))this._$Ct._$AI(t,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=t,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class u0{constructor(t){this.U=t}disconnect(){this.U=void 0}reconnect(t){this.U=t}deref(){return this.U}}let f0=class{constructor(){this.Y=void 0,this.q=void 0}get(){return this.Y}pause(){var t;(t=this.Y)!==null&&t!==void 0||(this.Y=new Promise(r=>this.q=r))}resume(){var t;(t=this.q)===null||t===void 0||t.call(this),this.Y=this.q=void 0}};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ec=e=>!t0(e)&&typeof e.then=="function";class c0 extends a0{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CG=new u0(this),this._$CK=new f0}render(...t){var r;return(r=t.find(n=>!ec(n)))!==null&&r!==void 0?r:ir}update(t,r){const n=this._$Cwt;let i=n.length;this._$Cwt=r;const o=this._$CG,s=this._$CK;this.isConnected||this.disconnected();for(let l=0;lthis._$Cft);l++){const a=r[l];if(!ec(a))return this._$Cft=l,a;l{for(;s.get();)await s.get();const f=o.deref();if(f!==void 0){const h=f._$Cwt.indexOf(a);h>-1&&h{var r,n;return((r=t.exports)==null?void 0:r.some(i=>i.kind==="custom-element-definition"))||((n=t.declarations)==null?void 0:n.some(i=>i.customElement))})}const h0=e=>e.kind==="custom-element-definition",p0=e=>e.customElement,g0=e=>!(e.privacy==="private"||e.privacy==="protected");async function m0(e){try{const r=await(await fetch(e)).json();if(mu(r))return r;throw new Error(`No element definitions found at ${e}`)}catch(t){return console.error(t),null}}function yh(e,t){const r=(e.modules??[]).flatMap(n=>{var i;return((i=n.exports)==null?void 0:i.filter(h0))??[]});return t?r.filter(n=>t.includes(n.name)):r}const b0=(e,t)=>{var a,u;const r=yh(e),n=t?r.findIndex(f=>(f==null?void 0:f.name)===t):0,i=r[n];if(!i)return null;const{name:o,module:s}=i.declaration,l=s?(u=(a=e.modules.find(f=>f.path===s.replace(/^\//,"")))==null?void 0:a.declarations)==null?void 0:u.find(f=>f.name===o):e.modules.flatMap(f=>f.declarations).find(f=>(f==null?void 0:f.name)===o);if(!l||!p0(l))throw new Error(`Could not find declaration for ${t}`);return{customElement:!0,name:i.name,description:l==null?void 0:l.description,slots:l.slots??[],attributes:l.attributes??[],members:l.members??[],events:l.events??[],cssParts:l.cssParts??[],cssProperties:[...l.cssProperties??[]].sort((f,h)=>f.name>h.name?1:-1)}},w0=(e=[])=>e.filter(t=>t.kind==="field"&&g0(t));function Jo(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}const y0=$e` +
No custom elements found in the JSON file.
+`,v0=e=>{class t extends e{constructor(){super(...arguments),this.jsonFetched=Promise.resolve(null)}willUpdate(){const{src:n}=this;this.manifest?mu(this.manifest)?(this.lastSrc=void 0,this.jsonFetched=Promise.resolve(this.manifest)):console.error("No custom elements found in the `manifest` object."):n&&this.lastSrc!==n&&(this.lastSrc=n,this.jsonFetched=m0(n))}}return Jo([Qe()],t.prototype,"src",void 0),Jo([Qe({attribute:!1})],t.prototype,"manifest",void 0),Jo([Qe({reflect:!0,converter:{fromAttribute:r=>r.split(","),toAttribute:r=>r.join(",")}})],t.prototype,"only",void 0),Jo([Qe()],t.prototype,"selected",void 0),t},bu=e=>typeof e=="string"&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,e.length-1):e;function wu(e,...t){const r=document.createElement("template");return r.innerHTML=t.reduce((n,i,o)=>n+i+e[o+1],e[0]),r}function lr(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}let x0=0;const S0=wu` + + +`;class vh extends HTMLElement{constructor(){super(),this._mousedown=!1,this._selected=!1,this.attachShadow({mode:"open"}).appendChild(S0.content.cloneNode(!0)),this.addEventListener("focus",()=>this._setFocused(!0),!0),this.addEventListener("blur",()=>{this._setFocused(!1),this._setActive(!1)},!0),this.addEventListener("mousedown",()=>{this._setActive(this._mousedown=!0);const r=()=>{this._setActive(this._mousedown=!1),document.removeEventListener("mouseup",r)};document.addEventListener("mouseup",r)})}get selected(){return this._selected}set selected(t){this._selected=t,this.setAttribute("aria-selected",String(t)),this.setAttribute("tabindex",t?"0":"-1"),this.toggleAttribute("selected",t)}connectedCallback(){this.setAttribute("role","tab"),this.id||(this.id=`api-viewer-tab-${x0++}`)}_setActive(t){this.toggleAttribute("active",t)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&!this._mousedown)}}customElements.define("api-viewer-tab",vh);let _0=0;const k0=wu` + + +`;class E0 extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(k0.content.cloneNode(!0))}connectedCallback(){this.setAttribute("role","tabpanel"),this.id||(this.id=`api-viewer-panel-${_0++}`)}}customElements.define("api-viewer-panel",E0);const T0=wu` + +
+ +
+ +`;class A0 extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"});t.appendChild(T0.content.cloneNode(!0));const r=t.querySelectorAll("slot");r[0].addEventListener("slotchange",()=>this._linkPanels()),r[1].addEventListener("slotchange",()=>this._linkPanels()),this.addEventListener("keydown",this.handleEvent),this.addEventListener("click",this.handleEvent)}connectedCallback(){this.setAttribute("role","tablist"),requestAnimationFrame(()=>{this._linkPanels()})}_linkPanels(){const{tabs:t}=this;t.forEach(n=>{const i=n.nextElementSibling;n.setAttribute("aria-controls",i.id),i.setAttribute("aria-labelledby",n.id)});const r=t.find(n=>n.selected)||t[0];this._selectTab(r)}get tabs(){return Array.from(this.querySelectorAll("api-viewer-tab"))}_getAvailableIndex(t,r){const{tabs:n}=this,i=n.length;for(let o=0;typeof t=="number"&&o=i&&(t=0),!n[t].hasAttribute("hidden"))return t;return-1}_prevTab(t){const r=this._getAvailableIndex(t.findIndex(n=>n.selected)-1,-1);return t[(r+t.length)%t.length]}_nextTab(t){const r=this._getAvailableIndex(t.findIndex(n=>n.selected)+1,1);return t[r%t.length]}reset(){this.tabs.forEach(t=>{t.selected=!1}),this.querySelectorAll("api-viewer-panel").forEach(t=>{t.hidden=!0})}selectFirst(){const t=this._getAvailableIndex(0,1);this._selectTab(this.tabs[t%this.tabs.length])}_selectTab(t){this.reset();const r=t.getAttribute("aria-controls"),n=this.querySelector(`#${r}`);n&&(t.selected=!0,n.hidden=!1)}handleEvent(t){const{target:r}=t;if(r&&r instanceof vh){let n;if(t.type==="keydown"){const{tabs:i}=this;switch(t.key){case"ArrowLeft":case"ArrowUp":n=this._prevTab(i);break;case"ArrowDown":case"ArrowRight":n=this._nextTab(i);break;case"Home":n=i[0];break;case"End":n=i[i.length-1];break;default:return}t.preventDefault()}else n=r;this._selectTab(n),n.focus()}}}customElements.define("api-viewer-tabs",A0);class yu{constructor(t,r){this._data=[],(this.host=t).addController(this),this.el=r}get data(){return this._data}set data(t){this._data=t,this.updateData(t)}updateData(t){this.host.isConnected&&this.host.requestUpdate()}clear(){this.data=[]}destroy(){this.host.removeController(this)}}class C0 extends yu{constructor(t,r,n){super(t,r),n.forEach(({name:i})=>{r.addEventListener(i,o=>{const s="-changed";if(i.endsWith(s)){const{knob:l}=t.getKnob(i.replace(s,""));l&&t.syncKnob(r,l)}this.data=[...this.data,o]})})}}const $0=e=>e[0].toUpperCase()+e.slice(1),xh=e=>$0(e===""?"content":e),L0=(e,t)=>{const{name:r,value:n}=e;return $e` + + `},tc=(e,t)=>{const{name:r,knobType:n,value:i,options:o}=e;let s;return n==="select"&&Array.isArray(o)?s=$e` + + `:n==="boolean"?s=$e` + + `:s=$e` + + `,s},R0=(e,t)=>{const{name:r,content:n}=e;return $e` + + `},Zo=(e,t,r,n)=>{const i=e.map(o=>{const{name:s}=o,l=`${r}-${s||"default"}`,a=r==="slot"?xh(s):s;return $e` + + + + + ${n(o,l)} + + `});return $e` +

${t}

+ + ${i} +
+ `};class M0 extends yu{constructor(t,r,n,i){super(t,r),this.enabled=!xa(n,r.localName,yi.SLOT),this.data=i.sort((o,s)=>o.name===""?1:s.name===""?-1:o.name.localeCompare(s.name)).map(o=>({...o,content:xh(o.name)}))}setValue(t,r){this.data=this.data.map(n=>n.name===t?{...n,content:r}:n)}updateData(t){super.updateData(t),this.enabled&&this.el.isConnected&&t&&t.length&&(this.el.innerHTML="",t.forEach(r=>{let n;const{name:i,content:o}=r;i?(n=document.createElement("div"),n.setAttribute("slot",i),n.textContent=o):n=document.createTextNode(o),this.el.appendChild(n)}))}}class N0 extends yu{constructor(t,r,n){if(super(t,r),n.length){const i=getComputedStyle(r);this.data=n.map(o=>{let s=o.default?bu(o.default):i.getPropertyValue(o.name);const l=o;return s&&(s=s.trim(),l.default=s,l.value=s),l})}}setValue(t,r){this.data=this.data.map(n=>n.name===t?{...n,value:r}:n)}updateData(t){super.updateData(t),t.length&&t.forEach(r=>{const{name:n,value:i}=r;i&&(i===r.default?this.el.style.removeProperty(n):this.el.style.setProperty(n,i))})}}const I0=e=>{const t=e,r="undefined";return"value"in e&&e.value===void 0&&(t.value=r),` detail: ${JSON.stringify(e).replace(`"${r}"`,r)}`},O0=e=>$e` + ${e.map(t=>$e` +

+ event: + ${t.type}.${t.detail==null?Ve:I0(t.detail)} +

+ `)} + `;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class _a extends Po{constructor(t){if(super(t),this.it=Ve,t.type!==Js.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Ve||t==null)return this.vt=void 0,this.it=t;if(t===ir)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const r=[t];return r.raw=r,this.vt={_$litType$:this.constructor.resultType,strings:r,values:[]}}}_a.directiveName="unsafeHTML",_a.resultType=1;const $s=Do(_a);function D0(e){return e.replace(/&/g,"&").replace(//g,">")}var P0={text:function(e){return D0(e)},join:function(e){return e.join("")},wrap:function(e,t){return''+t+""}};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Si=function(){return Si=Object.assign||function(t){for(var r,n=1,i=arguments.length;n`]+/}]}]}]},K0={name:"xml",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},Zs("",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{begin:/<\?(php)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0}]},{className:"tag",begin:"|$)",end:">",keywords:{name:"style"},contains:[Wl],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"|$)",end:">",keywords:{name:"script"},contains:[Wl],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},Wl]}]};function Ul(e,t){var r=e&&e.exec(t);return r&&r.index===0||!1}function Su(e,t,r,n,i,o){var s=[{content:[]}];function l(G){var Q=s[0].content;typeof G=="string"&&Q.length&&typeof Q[Q.length-1]=="string"?Q[Q.length-1]+=G:Q.push(G)}function a(G){l(t.text(G))}function u(G,Q){Q||(G=e.classPrefix+G),s.unshift({className:G,content:[]})}function f(G){G=e.classPrefix+G,s.push({className:G,content:[]})}function h(){if(s.length<2)throw"unbalanced";var G=s.shift(),Q=G.className,me=G.content,pe=t.join(me);l(Q?t.wrap(Q,pe):pe)}function g(G,Q){if(Ul(G.endRe,Q)){for(;G.endsParent&&G.parent;G=G.parent);return G}if(G.endsWithParent&&G.parent)return g(G.parent,Q)}function p(){if(!$.keywords){a(K);return}var G=0;$.lexemesRe.lastIndex=0;for(var Q=$.lexemesRe.exec(K);Q;){a(K.substring(G,Q.index));var me=A.case_insensitive?Q[0].toLowerCase():Q[0],pe=$.keywords.hasOwnProperty(me)&&$.keywords[me];pe?(ne+=pe[1],u(pe[0],!1),a(Q[0]),h()):a(Q[0]),G=$.lexemesRe.lastIndex,Q=$.lexemesRe.exec(K)}a(K.substr(G))}function w(G){var Q=G.length==1&&G[0];if(Q&&!Ea(Q)){a(K);return}var me=Q?Su(e,t,Q,K,!0,W[Q]):Eh(e,t,K,G.length?$.subLanguage:void 0);$.relevance>0&&(ne+=me.relevance),Q&&me.top&&(W[Q]=me.top),u(me.language,!0),l(me.value),h()}function y(){$.subLanguage!=null?w($.subLanguage):p(),K=""}function _(G){G.className&&u(G.className,!1),$=Object.create(G,{parent:{value:$}})}function C(G,Q){if(K+=G,Q==null)return y(),0;for(var me,pe=0,Te=$.contains;pe")+'"');return K+=Q,Q.length||1}var A=Ea(r);if(!A)throw new Error('Unknown language: "'+r+'"');var $=o||A,W={},B;for(B=$;B&&B!==A;B=B.parent)B.className&&f(B.className);var K="",ne=0;try{for(var ae=void 0,k=void 0,D=0;$.terminators.lastIndex=D,ae=$.terminators.exec(n),!!ae;)k=C(n.substring(D,ae.index),ae[0]),D=ae.index+k;for(C(n.substr(D)),B=$;B.parent;B=B.parent)B.className&&h();if(s.length!=1)throw"unbalanced";var x=s[0],j=x.className,P=x.content,ie=t.join(P),he=j?t.wrap(j,ie):ie;return{language:r,relevance:ne,value:he,top:$}}catch(G){if(G.message&&G.message.indexOf("Illegal")!==-1)return{language:r,relevance:0,value:t.text(n)};throw G}}function Eh(e,t,r,n){n===void 0&&(n=e.languages||H0());var i={language:"",relevance:0,value:t.text(r)};if(r!=""){for(var o=i,s=n.filter(Ea),l=0,a=s;lo.relevance&&(o=f),f.relevance>i.relevance&&(o=i,i=f)}o.language&&(i.second_best=o)}return i}var X0={classPrefix:"hljs-",useBr:!1};function V0(e,t){return t===void 0&&(t={}),{render:e,options:Si({},X0,t)}}function Y0(e,t,r){var n=e.render,i=e.options;return typeof r=="string"?Su(i,n,r,t,!1):Eh(i,n,t,r)}const J0={begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[vu,xu,kh]}]},Z0={className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[J0,kh,xu,vu,Ta,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}},Q0="[a-zA-Z-][a-zA-Z0-9_-]*",eb={begin:/(?:[A-Z_.-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[Z0]},tb={name:"css",case_insensitive:!0,illegal:/[=/|'$]/,contains:[Ta,{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[vu,xu]},{className:"selector-tag",begin:Q0,relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[Ta,eb]}]};z0(tb,K0);const rb=V0(P0,{classPrefix:""}),{PREFIX:nb,SLOT:ib,SUFFIX:ob,WRAPPER:sb}=yi,Nr=" ",lb=(e,t)=>{if(!e)return e;const r=e.replace(/\t/g,Nr).split(` +`),n=r.reduce((i,o)=>{if(/^\s*$/.test(o))return i;const s=o.match(/^(\s*)/),l=s&&s[0].length;return i===null||lt+i.substr(n)).join(` +`)},zl=(e,t)=>{const r=e.innerHTML.replace(/\s+$/,"").replace(/(="")/g,"");return lb(r,t)},ab=(e,t,r,n,i)=>{let o="";const s=Xi(e,t,nb);Mn(s)&&(o+=`${zl(s,"").trim()} +`);let l="",a=null;const u=Xi(e,t,sb),f=As(u);if(f){l=Nr;const y=f.outerHTML.match(/<([a-z]+)[^>]*>/);y&&(a=f.tagName.toLowerCase(),o+=`${y[0]} +${Nr}`)}o+=`<${t}`,Object.keys(r).sort((y,_)=>y>_?1:-1).forEach(y=>{const{value:_,knobType:C,attribute:A}=r[y],$=A||y;switch(C){case"boolean":o+=_?` ${$}`:"";break;case"select":o+=_!==""?` ${$}="${_}"`:"";break;default:o+=_!=null?` ${$}="${_}"`:"";break}}),o+=">";const h=Xi(e,t,ib);Mn(h)?o+=`${zl(h,`${l}${Nr}`)} +${l}`:n.length&&(n.length===1&&!n[0].name?o+=n[0].content:(o+=n.reduce((y,_)=>{const{name:C,content:A}=_,$=C?`
${A}
`:A;return`${y} +${l}${Nr}${$}`},""),o+=` +${l}`)),o+=``,a&&(o+=` +`);const g=Xi(e,t,ob);Mn(g)&&(o+=` +${zl(g,"").trim()} +`);const p=i.filter(y=>y.value!==y.default);p.length&&(o+=` +`);const{value:w}=Y0(rb,o,["xml","css"]);return $e`
${$s(w)}
`},Th=e=>{const{knobType:t,default:r}=e;switch(t){case"boolean":return r!=="false";case"number":return Number(r);default:return bu(r)}},ub=(e,t)=>{function r(i){return i===HTMLElement?void 0:Object.getOwnPropertyDescriptor(i.prototype,t)||r(Object.getPrototypeOf(i))}let n=!1;if(e){const i=r(e);n=!!(i&&i.get&&i.set===void 0)}return n},fb=(e="")=>e.replace(" | undefined","").replace(" | null",""),cb=(e,t,r="")=>{let n=t.filter(({name:i})=>!r.includes(i)&&!ub(customElements.get(e),i));return n=n.map(i=>{var s;const o={...i,knobType:fb((s=i.type)==null?void 0:s.text)};return typeof o.default=="string"&&(o.value=Th(o)),o}),n},db=(e,t)=>Gm(t,e,yi.KNOB).map(r=>{const{attr:n,type:i}=r.dataset;let o=null;if(n){if(i==="select"){const s=As(r),l=s?Array.from(s.children).filter(a=>a instanceof HTMLOptionElement).map(a=>a.value):[];s instanceof HTMLSelectElement&&l.length>1&&(o={name:n,attribute:n,knobType:i,options:l})}(i==="string"||i==="boolean")&&(o={name:n,attribute:n,knobType:i})}return o}).filter(Boolean),hb=(e,t)=>e.filter(r=>{const{name:n,knobType:i}=r,o=Th(r);return t[n]!==o||i==="boolean"&&o});/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const rc=Do(class extends Po{constructor(e){if(super(e),e.type!==Js.CHILD)throw Error("templateContent can only be used in child bindings")}render(e){return this.at===e?ir:(this.at=e,document.importNode(e.content,!0))}}),{HOST:pb,PREFIX:gb,SLOT:mb,SUFFIX:bb,WRAPPER:wb}=yi,yb=(e,t)=>{const{knobs:r}=t;Object.keys(r).forEach(n=>{const{attribute:i,value:o,custom:s}=r[n];s&&i?typeof o=="string"&&o?e.setAttribute(i,o):e.removeAttribute(i):e[n]=o})},nc=e=>typeof e=="object"&&Promise.resolve(e)===e;async function vb(e){let t=!1;const r=e,n=r.updateComplete;nc(n)&&(await n,t=!0);const i=r.componentOnReady?r.componentOnReady():!1;return nc(i)&&(await i,t=!0),t||await new Promise(requestAnimationFrame),r}let xb=class extends Po{constructor(t){if(super(t),t.type!==Js.CHILD)throw new Error("renderer only supports binding to element")}render(t){return Ve}update(t,[r]){var C;const n=(C=t.options)==null?void 0:C.host,{tag:i}=r,o=[],[s,l,a,u,f]=[pb,gb,bb,mb,wb].map(A=>Xi(r.id,i,A)),h=As(f),g=h?h.localName:"";let p=n.querySelector(i);if(p){const A=n.querySelector('[part="demo-output"]'),$=p.parentElement;if($&&$===A||$.localName===g)return yb(p,r),ir}const w=``,y=As(s);Mn(l)&&o.push(rc(l));let _=y?y.outerHTML:`<${i}>${w}`;if(Mn(u)&&(_=_.replace(w,`${u.innerHTML}${w}`)),g){const A=$s(` + <${g}> + ${_} + + `);o.push(A)}else o.push($s(_));return Mn(a)&&o.push(rc(a)),Promise.resolve().then(()=>{p=n.querySelector(i),vb(p).then(()=>{p.dispatchEvent(new CustomEvent("rendered",{detail:{component:p},bubbles:!0,composed:!0}))})}),$e`${o}`}};const Sb=Do(xb);class Yt extends nn{constructor(){super(...arguments),this.copyBtnText="copy",this.cssProps=[],this.events=[],this.slots=[],this.tag="",this.props=[],this.exclude="",this._whenDefined={}}createRenderRoot(){return this}render(){var p,w,y;const{tag:t}=this;if(!customElements.get(t))return this._whenDefined[t]=customElements.whenDefined(t),this._whenDefined[t].then(()=>{this.tag===t&&this.requestUpdate()}),$e` +
+ Element ${t} is not defined. Have you imported it? +
+ `;const[r,n,i,o,s]=[this.cssProps,this.events,this.slots,this.customKnobs,this.propKnobs].map(_=>_.length===0),l=this.vid,a=((p=this.eventsController)==null?void 0:p.data)||[],u=((w=this.slotsController)==null?void 0:w.data)||[],f=((y=this.stylesController)==null?void 0:y.data)||[],h=i||xa(l,t,yi.SLOT),g=s&&o;return $e` +
+ ${Sb({id:l,tag:t,knobs:this.knobs})} +
+ + Source + + +
+ ${ab(l,t,this.knobs,u,f)} +
+
+ + Knobs + + +
+
+ ${Zo(this.propKnobs,"Properties","prop",tc)} + ${Zo(this.customKnobs,"Attributes","attr",tc)} +
+
+ ${Zo(u,"Slots","slot",R0)} +
+
+
+ + Styles + + +
+
+ ${Zo(f,"Custom CSS Properties","css-prop",L0)} +
+
+
+ + Events + + +
+ + ${bh(a.length?O0(a):$e` +

+ Interact with component to see the event log. +

+ `)} +
+
+
+ `}willUpdate(t){t.has("tag")&&(this.knobs={},this.propKnobs=cb(this.tag,this.props,this.exclude),this.customKnobs=db(this.tag,this.vid))}updated(t){if(t.has("tag")&&t.get("tag")){const r=this.renderRoot.querySelector("api-viewer-tabs");r&&r.selectFirst()}}_onLogClear(){this.eventsController.clear();const t=this.querySelector("#events");t&&t.focus()}_onCopyClick(){const t=this.renderRoot.querySelector('[part="demo-snippet"] code');if(t){const r=document.createRange();r.selectNodeContents(t);const n=window.getSelection();n.removeAllRanges(),n.addRange(r);try{document.execCommand("copy"),this.copyBtnText="done"}catch(i){console.error(i),this.copyBtnText="error"}setTimeout(()=>{this.copyBtnText="copy"},1e3),n.removeAllRanges()}}onRendered(t){const{component:r}=t.detail;this.initKnobs(r),this.initEvents(r),this.initSlots(r),this.initStyles(r)}initEvents(t){const r=this.eventsController;r&&r.destroy(),this.eventsController=new C0(this,t,this.events)}initKnobs(t){xa(this.vid,this.tag,yi.HOST)&&hb(this.propKnobs,t).forEach(n=>{this.syncKnob(t,n)})}initSlots(t){const r=this.slotsController;r&&r.destroy(),this.slotsController=new M0(this,t,this.vid,this.slots)}initStyles(t){const r=this.stylesController;r&&r.destroy(),this.stylesController=new N0(this,t,this.cssProps)}getKnob(t){const r=o=>o.name===t||o.attribute===t;let n=this.propKnobs.find(r),i=!1;return n||(n=this.customKnobs.find(r),i=!0),{knob:n,custom:i}}setKnobs(t,r,n,i,o=!1){this.knobs={...this.knobs,[t]:{knobType:r,value:n,attribute:i,custom:o}}}syncKnob(t,r){const{name:n,knobType:i,attribute:o}=r,s=t[n];this.setKnobs(n,i,s,o),this.propKnobs=this.propKnobs.map(l=>l.name===n?{...l,value:s}:l)}_onCssChanged(t){const r=t.composedPath()[0];this.stylesController.setValue(r.dataset.name,r.value)}_onPropChanged(t){const r=t.composedPath()[0],{name:n,type:i}=r.dataset;let o;switch(i){case"boolean":o=r.checked;break;case"number":o=r.value===""?null:Number(r.value);break;default:o=r.value}const{knob:s,custom:l}=this.getKnob(n);s&&this.setKnobs(n,i,o,s.attribute,l)}_onSlotChanged(t){const r=t.composedPath()[0];this.slotsController.setValue(r.dataset.slot,r.value)}}lr([Qe()],Yt.prototype,"copyBtnText",void 0);lr([Qe({attribute:!1})],Yt.prototype,"cssProps",void 0);lr([Qe({attribute:!1})],Yt.prototype,"events",void 0);lr([Qe({attribute:!1})],Yt.prototype,"slots",void 0);lr([Qe()],Yt.prototype,"tag",void 0);lr([Qe({attribute:!1})],Yt.prototype,"props",void 0);lr([Qe()],Yt.prototype,"exclude",void 0);lr([Qe({type:Number})],Yt.prototype,"vid",void 0);lr([Qe({attribute:!1})],Yt.prototype,"customKnobs",void 0);lr([Qe({attribute:!1})],Yt.prototype,"knobs",void 0);lr([Qe({attribute:!1})],Yt.prototype,"propKnobs",void 0);customElements.define("api-demo-layout",Yt);function dn(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function Ah(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ri=Ah();function _b(e){Ri=e}const kb=/[&<>"']/,Eb=/[&<>"']/g,Tb=/[<>"']|&(?!#?\w+;)/,Ab=/[<>"']|&(?!#?\w+;)/g,Cb={"&":"&","<":"<",">":">",'"':""","'":"'"},ic=e=>Cb[e];function wt(e,t){if(t){if(kb.test(e))return e.replace(Eb,ic)}else if(Tb.test(e))return e.replace(Ab,ic);return e}const $b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Ch(e){return e.replace($b,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Lb=/(^|[^\[])\^/g;function Ye(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,i)=>(i=i.source||i,i=i.replace(Lb,"$1"),e=e.replace(n,i),r),getRegex:()=>new RegExp(e,t)};return r}const Rb=/[^\w:]/g,Mb=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function oc(e,t,r){if(e){let n;try{n=decodeURIComponent(Ch(r)).replace(Rb,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Mb.test(r)&&(r=Db(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Qo={},Nb=/^[^:]+:\/*[^/]*$/,Ib=/^([^:]+:)[\s\S]*$/,Ob=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Db(e,t){Qo[" "+e]||(Nb.test(e)?Qo[" "+e]=e+"/":Qo[" "+e]=ms(e,"/",!0)),e=Qo[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(Ib,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Ob,"$1")+t:e+t}const Rs={exec:function(){}};function ar(e){let t=1,r,n;for(;t{let a=!1,u=s;for(;--u>=0&&l[u]==="\\";)a=!a;return a?"|":" |"}),n=r.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function ac(e,t,r,n){const i=t.href,o=t.title?wt(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const l={type:"link",raw:r,href:i,title:o,text:s,tokens:n.inlineTokens(s,[])};return n.state.inLink=!1,l}return{type:"image",raw:r,href:i,title:o,text:wt(s)}}function Bb(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` +`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=n.length?i.slice(n.length):i}).join(` +`)}class _u{constructor(t){this.options=t||Ri}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ms(n,` +`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],i=Bb(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim():r[2],text:i}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=ms(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}const i={type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:r[0],tokens:this.lexer.blockTokens(n,[]),text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,i,o,s,l,a,u,f,h,g,p,w,y=r[1].trim();const _=y.length>1,C={type:"list",raw:"",ordered:_,start:_?+y.slice(0,-1):"",loose:!1,items:[]};y=_?`\\d{1,9}\\${y.slice(-1)}`:`\\${y}`,this.options.pedantic&&(y=_?y:"[*+-]");const A=new RegExp(`^( {0,3}${y})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(w=!1,!(!(r=A.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),f=r[2].split(` +`,1)[0],h=t.split(` +`,1)[0],this.options.pedantic?(s=2,p=f.trimLeft()):(s=r[2].search(/[^ ]/),s=s>4?1:s,p=f.slice(s),s+=r[1].length),a=!1,!f&&/^ *$/.test(h)&&(n+=h+` +`,t=t.substring(h.length+1),w=!0),!w){const W=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),B=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),K=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),ne=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(g=t.split(` +`,1)[0],f=g,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(f)||ne.test(f)||W.test(f)||B.test(t)));){if(f.search(/[^ ]/)>=s||!f.trim())p+=` +`+f.slice(s);else if(!a)p+=` +`+f;else break;!a&&!f.trim()&&(a=!0),n+=g+` +`,t=t.substring(g.length+1)}}C.loose||(u?C.loose=!0:/\n *\n *$/.test(n)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(p),i&&(o=i[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),C.items.push({type:"list_item",raw:n,task:!!i,checked:o,loose:!1,text:p}),C.raw+=n}C.items[C.items.length-1].raw=n.trimRight(),C.items[C.items.length-1].text=p.trimRight(),C.raw=C.raw.trimRight();const $=C.items.length;for(l=0;l<$;l++){this.lexer.state.top=!1,C.items[l].tokens=this.lexer.blockTokens(C.items[l].text,[]);const W=C.items[l].tokens.filter(K=>K.type==="space"),B=W.every(K=>{const ne=K.raw.split("");let ae=0;for(const k of ne)if(k===` +`&&(ae+=1),ae>1)return!0;return!1});!C.loose&&W.length&&B&&(C.loose=!0,C.items[l].loose=!0)}return C}}html(t){const r=this.rules.block.html.exec(t);if(r){const n={type:"html",raw:r[0],pre:!this.options.sanitizer&&(r[1]==="pre"||r[1]==="script"||r[1]==="style"),text:r[0]};return this.options.sanitize&&(n.type="paragraph",n.text=this.options.sanitizer?this.options.sanitizer(r[0]):wt(r[0]),n.tokens=[],this.lexer.inline(n.text,n.tokens)),n}}def(t){const r=this.rules.block.def.exec(t);if(r)return r[3]&&(r[3]=r[3].substring(1,r[3].length-1)),{type:"def",tag:r[1].toLowerCase().replace(/\s+/g," "),raw:r[0],href:r[2],title:r[3]}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:sc(r[1]).map(i=>({text:i})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=r[0];let i=n.align.length,o,s,l,a;for(o=0;o({text:u}));for(i=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):wt(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=ms(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Pb(r[2],"()");if(s>-1){const a=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let i=r[2],o="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],o=s[3])}else o=r[3]?r[3].slice(1,-1):"";return i=i.trim(),/^$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ac(r,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(/\s+/g," ");if(i=r[i.toLowerCase()],!i||!i.href){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return ac(n,i,n[0],this.lexer)}}emStrong(t,r,n=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(n===""||this.rules.inline.punctuation.exec(n))){const s=i[0].length-1;let l,a,u=s,f=0;const h=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(i=h.exec(r))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(a=l.length,i[3]||i[4]){u+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){f+=a;continue}if(u-=a,u>0)continue;if(a=Math.min(a,a+u+f),Math.min(s,a)%2){const p=t.slice(1,s+i.index+a);return{type:"em",raw:t.slice(0,s+i.index+a+1),text:p,tokens:this.lexer.inlineTokens(p,[])}}const g=t.slice(2,s+i.index+a-1);return{type:"strong",raw:t.slice(0,s+i.index+a+1),text:g,tokens:this.lexer.inlineTokens(g,[])}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=wt(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2],[])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let i,o;return n[2]==="@"?(i=wt(this.options.mangle?r(n[1]):n[1]),o="mailto:"+i):(i=wt(n[1]),o=i),{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let i,o;if(n[2]==="@")i=wt(this.options.mangle?r(n[0]):n[0]),o="mailto:"+i;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);i=wt(n[0]),n[1]==="www."?o="http://"+i:o=i}return{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):wt(n[0]):n[0]:i=wt(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:i}}}}const we={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Rs,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};we._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;we._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;we.def=Ye(we.def).replace("label",we._label).replace("title",we._title).getRegex();we.bullet=/(?:[*+-]|\d{1,9}[.)])/;we.listItemStart=Ye(/^( *)(bull) */).replace("bull",we.bullet).getRegex();we.list=Ye(we.list).replace(/bull/g,we.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+we.def.source+")").getRegex();we._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";we._comment=/|$)/;we.html=Ye(we.html,"i").replace("comment",we._comment).replace("tag",we._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();we.paragraph=Ye(we._paragraph).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",we._tag).getRegex();we.blockquote=Ye(we.blockquote).replace("paragraph",we.paragraph).getRegex();we.normal=ar({},we);we.gfm=ar({},we.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});we.gfm.table=Ye(we.gfm.table).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",we._tag).getRegex();we.gfm.paragraph=Ye(we._paragraph).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",we.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",we._tag).getRegex();we.pedantic=ar({},we.normal,{html:Ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rs,paragraph:Ye(we.normal._paragraph).replace("hr",we.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",we.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Rs,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Rs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";le.punctuation=Ye(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex();le.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;le.escapedEmSt=/\\\*|\\_/g;le._comment=Ye(we._comment).replace("(?:-->|$)","-->").getRegex();le.emStrong.lDelim=Ye(le.emStrong.lDelim).replace(/punct/g,le._punctuation).getRegex();le.emStrong.rDelimAst=Ye(le.emStrong.rDelimAst,"g").replace(/punct/g,le._punctuation).getRegex();le.emStrong.rDelimUnd=Ye(le.emStrong.rDelimUnd,"g").replace(/punct/g,le._punctuation).getRegex();le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;le._email=/[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])?)+(?![-_])/;le.autolink=Ye(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex();le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;le.tag=Ye(le.tag).replace("comment",le._comment).replace("attribute",le._attribute).getRegex();le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;le._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;le.link=Ye(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex();le.reflink=Ye(le.reflink).replace("label",le._label).replace("ref",we._label).getRegex();le.nolink=Ye(le.nolink).replace("ref",we._label).getRegex();le.reflinkSearch=Ye(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex();le.normal=ar({},le);le.pedantic=ar({},le.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()});le.gfm=ar({},le.normal,{escape:Ye(le.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class Br{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ri,this.options.tokenizer=this.options.tokenizer||new _u,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:we.normal,inline:le.normal};this.options.pedantic?(r.block=we.pedantic,r.inline=le.pedantic):this.options.gfm&&(r.block=we.gfm,this.options.breaks?r.inline=le.breaks:r.inline=le.gfm),this.tokenizer.rules=r}static get rules(){return{block:we,inline:le}}static lex(t,r){return new Br(r).lex(t)}static lexInline(t,r){return new Br(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,a,u)=>a+" ".repeat(u.length));let n,i,o,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(n=l.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` +`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` +`+n.raw,i.text+=` +`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(f){u=f.call({lexer:this},a),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(o=t.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){i=r[r.length-1],s&&i.type==="paragraph"?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n),s=o.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&i.type==="text"?(i.raw+=` +`+n.raw,i.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(t,r){this.inlineQueue.push({src:t,tokens:r})}inlineTokens(t,r=[]){let n,i,o,s=t,l,a,u;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)f.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,l.index)+"["+lc("a",l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,l.index)+"["+lc("a",l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,l.index)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(a||(u=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(f=>(n=f.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,u)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,uc)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,uc))){t=t.substring(n.raw.length),r.push(n);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let f=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(function(p){g=p.call({lexer:this},h),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(o=t.substring(0,f+1))}if(n=this.tokenizer.inlineText(o,Fb)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),a=!0,i=r[r.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(t){const f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}}class ku{constructor(t){this.options=t||Ri}code(t,r,n){const i=(r||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(n=!0,t=o)}return t=t.replace(/\n$/,"")+` +`,i?'
'+(n?t:wt(t,!0))+`
+`:"
"+(n?t:wt(t,!0))+`
+`}blockquote(t){return`
+${t}
+`}html(t){return t}heading(t,r,n,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(n);return`${t} +`}return`${t} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(t,r,n){const i=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+i+o+`> +`+t+" +`}listitem(t){return`
  • ${t}
  • +`}checkbox(t){return" "}paragraph(t){return`

    ${t}

    +`}table(t,r){return r&&(r=`${r}`),` + +`+t+` +`+r+`
    +`}tablerow(t){return` +${t} +`}tablecell(t,r){const n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=oc(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let i='",i}image(t,r,n){if(t=oc(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let i=`${n}":">",i}text(t){return t}}class Lh{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class Rh{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do i++,n=t+"-"+i;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=i,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class Fr{constructor(t){this.options=t||Ri,this.options.renderer=this.options.renderer||new ku,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Lh,this.slugger=new Rh}static parse(t,r){return new Fr(r).parse(t)}static parseInline(t,r){return new Fr(r).parseInline(t)}parse(t,r=!0){let n="",i,o,s,l,a,u,f,h,g,p,w,y,_,C,A,$,W,B,K;const ne=t.length;for(i=0;i0&&A.tokens[0].type==="paragraph"?(A.tokens[0].text=B+" "+A.tokens[0].text,A.tokens[0].tokens&&A.tokens[0].tokens.length>0&&A.tokens[0].tokens[0].type==="text"&&(A.tokens[0].tokens[0].text=B+" "+A.tokens[0].tokens[0].text)):A.tokens.unshift({type:"text",text:B}):C+=B),C+=this.parse(A.tokens,_),g+=this.renderer.listitem(C,W,$);n+=this.renderer.list(g,w,y);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(g=p.tokens?this.parseInline(p.tokens):p.text;i+1"u"||e===null)throw new Error("marked(): input parameter is undefined or null");if(typeof e!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(typeof t=="function"&&(r=t,t=null),t=ar({},ve.defaults,t||{}),$h(t),r){const n=t.highlight;let i;try{i=Br.lex(e,t)}catch(l){return r(l)}const o=function(l){let a;if(!l)try{t.walkTokens&&ve.walkTokens(i,t.walkTokens),a=Fr.parse(i,t)}catch(u){l=u}return t.highlight=n,l?r(l):r(null,a)};if(!n||n.length<3||(delete t.highlight,!i.length))return o();let s=0;ve.walkTokens(i,function(l){l.type==="code"&&(s++,setTimeout(()=>{n(l.text,l.lang,function(a,u){if(a)return o(a);u!=null&&u!==l.text&&(l.text=u,l.escaped=!0),s--,s===0&&o()})},0))}),s===0&&o();return}try{const n=Br.lex(e,t);return t.walkTokens&&ve.walkTokens(n,t.walkTokens),Fr.parse(n,t)}catch(n){if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,t.silent)return"

    An error occurred:

    "+wt(n.message+"",!0)+"
    ";throw n}}ve.options=ve.setOptions=function(e){return ar(ve.defaults,e),_b(ve.defaults),ve};ve.getDefaults=Ah;ve.defaults=Ri;ve.use=function(...e){const t=ar({},...e),r=ve.defaults.extensions||{renderers:{},childTokens:{}};let n;e.forEach(i=>{if(i.extensions&&(n=!0,i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const s=r.renderers?r.renderers[o.name]:null;s?r.renderers[o.name]=function(...l){let a=o.renderer.apply(this,l);return a===!1&&(a=s.apply(this,l)),a}:r.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");r[o.level]?r[o.level].unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}o.childTokens&&(r.childTokens[o.name]=o.childTokens)})),i.renderer){const o=ve.defaults.renderer||new ku;for(const s in i.renderer){const l=o[s];o[s]=(...a)=>{let u=i.renderer[s].apply(o,a);return u===!1&&(u=l.apply(o,a)),u}}t.renderer=o}if(i.tokenizer){const o=ve.defaults.tokenizer||new _u;for(const s in i.tokenizer){const l=o[s];o[s]=(...a)=>{let u=i.tokenizer[s].apply(o,a);return u===!1&&(u=l.apply(o,a)),u}}t.tokenizer=o}if(i.walkTokens){const o=ve.defaults.walkTokens;t.walkTokens=function(s){i.walkTokens.call(this,s),o&&o.call(this,s)}}n&&(t.extensions=r),ve.setOptions(t)})};ve.walkTokens=function(e,t){for(const r of e)switch(t.call(ve,r),r.type){case"table":{for(const n of r.header)ve.walkTokens(n.tokens,t);for(const n of r.rows)for(const i of n)ve.walkTokens(i.tokens,t);break}case"list":{ve.walkTokens(r.items,t);break}default:ve.defaults.extensions&&ve.defaults.extensions.childTokens&&ve.defaults.extensions.childTokens[r.type]?ve.defaults.extensions.childTokens[r.type].forEach(function(n){ve.walkTokens(r[n],t)}):r.tokens&&ve.walkTokens(r.tokens,t)}};ve.parseInline=function(e,t){if(typeof e>"u"||e===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof e!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=ar({},ve.defaults,t||{}),$h(t);try{const r=Br.lexInline(e,t);return t.walkTokens&&ve.walkTokens(r,t.walkTokens),Fr.parseInline(r,t)}catch(r){if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t.silent)return"

    An error occurred:

    "+wt(r.message+"",!0)+"
    ";throw r}};ve.Parser=Fr;ve.parser=Fr.parse;ve.Renderer=ku;ve.TextRenderer=Lh;ve.Lexer=Br;ve.lexer=Br.lex;ve.Tokenizer=_u;ve.Slugger=Rh;ve.parse=ve;ve.options;ve.setOptions;ve.use;ve.walkTokens;ve.parseInline;Fr.parse;Br.lex;/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */function Wb(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?r-1:0),i=1;i/gm),ew=Wr(/^data-[\-\w.\u00B7-\uFFFF]/),tw=Wr(/^aria-[\-\w]+$/),rw=Wr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nw=Wr(/^(?:\w+script|data):/i),iw=Wr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function hr(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t"u"?null:window},sw=function(t,r){if((typeof t>"u"?"undefined":Vi(t))!=="object"||typeof t.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Nh(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ow(),t=function(M){return Nh(M)};if(t.version="2.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;var r=e.document,n=e.document,i=e.DocumentFragment,o=e.HTMLTemplateElement,s=e.Node,l=e.Element,a=e.NodeFilter,u=e.NamedNodeMap,f=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,h=e.Text,g=e.Comment,p=e.DOMParser,w=e.trustedTypes,y=l.prototype,_=es(y,"cloneNode"),C=es(y,"nextSibling"),A=es(y,"childNodes"),$=es(y,"parentNode");if(typeof o=="function"){var W=n.createElement("template");W.content&&W.content.ownerDocument&&(n=W.content.ownerDocument)}var B=sw(w,r),K=B&&Ie?B.createHTML(""):"",ne=n,ae=ne.implementation,k=ne.createNodeIterator,D=ne.createDocumentFragment,x=ne.getElementsByTagName,j=r.importNode,P={};try{P=Sn(n).documentMode?n.documentMode:{}}catch{}var ie={};t.isSupported=typeof $=="function"&&ae&&typeof ae.createHTMLDocument<"u"&&P!==9;var he=Zb,G=Qb,Q=ew,me=tw,pe=nw,Te=iw,re=rw,X=null,H=Le({},[].concat(hr(pc),hr(Hl),hr(jl),hr(Gl),hr(gc))),te=null,Re=Le({},[].concat(hr(mc),hr(ql),hr(bc),hr(ts))),Tt=null,Ee=null,We=!0,yt=!0,Ht=!1,gt=!1,rt=!1,R=!1,N=!1,U=!1,oe=!1,se=!0,Ie=!1,ze=!0,Me=!0,nt=!1,ue={},tt=null,cr=Le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),st=null,Ze=Le({},["audio","video","img","source","image","track"]),b=null,c=Le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),d="http://www.w3.org/1998/Math/MathML",S="http://www.w3.org/2000/svg",L="http://www.w3.org/1999/xhtml",I=L,O=!1,ye=void 0,Be=["application/xhtml+xml","text/html"],Fe="text/html",Ae=void 0,Ce=null,Ar=n.createElement("form"),wn=function(M){Ce&&Ce===M||((!M||(typeof M>"u"?"undefined":Vi(M))!=="object")&&(M={}),M=Sn(M),X="ALLOWED_TAGS"in M?Le({},M.ALLOWED_TAGS):H,te="ALLOWED_ATTR"in M?Le({},M.ALLOWED_ATTR):Re,b="ADD_URI_SAFE_ATTR"in M?Le(Sn(c),M.ADD_URI_SAFE_ATTR):c,st="ADD_DATA_URI_TAGS"in M?Le(Sn(Ze),M.ADD_DATA_URI_TAGS):Ze,tt="FORBID_CONTENTS"in M?Le({},M.FORBID_CONTENTS):cr,Tt="FORBID_TAGS"in M?Le({},M.FORBID_TAGS):{},Ee="FORBID_ATTR"in M?Le({},M.FORBID_ATTR):{},ue="USE_PROFILES"in M?M.USE_PROFILES:!1,We=M.ALLOW_ARIA_ATTR!==!1,yt=M.ALLOW_DATA_ATTR!==!1,Ht=M.ALLOW_UNKNOWN_PROTOCOLS||!1,gt=M.SAFE_FOR_TEMPLATES||!1,rt=M.WHOLE_DOCUMENT||!1,U=M.RETURN_DOM||!1,oe=M.RETURN_DOM_FRAGMENT||!1,se=M.RETURN_DOM_IMPORT!==!1,Ie=M.RETURN_TRUSTED_TYPE||!1,N=M.FORCE_BODY||!1,ze=M.SANITIZE_DOM!==!1,Me=M.KEEP_CONTENT!==!1,nt=M.IN_PLACE||!1,re=M.ALLOWED_URI_REGEXP||re,I=M.NAMESPACE||L,ye=Be.indexOf(M.PARSER_MEDIA_TYPE)===-1?ye=Fe:ye=M.PARSER_MEDIA_TYPE,Ae=ye==="application/xhtml+xml"?function(J){return J}:bs,gt&&(yt=!1),oe&&(U=!0),ue&&(X=Le({},[].concat(hr(gc))),te=[],ue.html===!0&&(Le(X,pc),Le(te,mc)),ue.svg===!0&&(Le(X,Hl),Le(te,ql),Le(te,ts)),ue.svgFilters===!0&&(Le(X,jl),Le(te,ql),Le(te,ts)),ue.mathMl===!0&&(Le(X,Gl),Le(te,bc),Le(te,ts))),M.ADD_TAGS&&(X===H&&(X=Sn(X)),Le(X,M.ADD_TAGS)),M.ADD_ATTR&&(te===Re&&(te=Sn(te)),Le(te,M.ADD_ATTR)),M.ADD_URI_SAFE_ATTR&&Le(b,M.ADD_URI_SAFE_ATTR),M.FORBID_CONTENTS&&(tt===cr&&(tt=Sn(tt)),Le(tt,M.FORBID_CONTENTS)),Me&&(X["#text"]=!0),rt&&Le(X,["html","head","body"]),X.table&&(Le(X,["tbody"]),delete Tt.tbody),Lt&&Lt(M),Ce=M)},Cr=Le({},["mi","mo","mn","ms","mtext"]),mt=Le({},["foreignobject","desc","title","annotation-xml"]),$r=Le({},Hl);Le($r,jl),Le($r,Yb);var yn=Le({},Gl);Le(yn,Jb);var Nt=function(M){var J=$(M);(!J||!J.tagName)&&(J={namespaceURI:L,tagName:"template"});var fe=bs(M.tagName),Ne=bs(J.tagName);if(M.namespaceURI===S)return J.namespaceURI===L?fe==="svg":J.namespaceURI===d?fe==="svg"&&(Ne==="annotation-xml"||Cr[Ne]):!!$r[fe];if(M.namespaceURI===d)return J.namespaceURI===L?fe==="math":J.namespaceURI===S?fe==="math"&&mt[Ne]:!!yn[fe];if(M.namespaceURI===L){if(J.namespaceURI===S&&!mt[Ne]||J.namespaceURI===d&&!Cr[Ne])return!1;var it=Le({},["title","style","font","a","script"]);return!yn[fe]&&(it[fe]||!$r[fe])}return!1},It=function(M){Hi(t.removed,{element:M});try{M.parentNode.removeChild(M)}catch{try{M.outerHTML=K}catch{M.remove()}}},v=function(M,J){try{Hi(t.removed,{attribute:J.getAttributeNode(M),from:J})}catch{Hi(t.removed,{attribute:null,from:J})}if(J.removeAttribute(M),M==="is"&&!te[M])if(U||oe)try{It(J)}catch{}else try{J.setAttribute(M,"")}catch{}},E=function(M){var J=void 0,fe=void 0;if(N)M=""+M;else{var Ne=dc(M,/^[\r\n\t ]+/);fe=Ne&&Ne[0]}ye==="application/xhtml+xml"&&(M=''+M+"");var it=B?B.createHTML(M):M;if(I===L)try{J=new p().parseFromString(it,ye)}catch{}if(!J||!J.documentElement){J=ae.createDocument(I,"template",null);try{J.documentElement.innerHTML=O?"":it}catch{}}var qe=J.body||J.documentElement;return M&&fe&&qe.insertBefore(n.createTextNode(fe),qe.childNodes[0]||null),I===L?x.call(J,rt?"html":"body")[0]:rt?J.documentElement:qe},Z=function(M){return k.call(M.ownerDocument||M,M,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT,null,!1)},Y=function(M){return M instanceof h||M instanceof g?!1:typeof M.nodeName!="string"||typeof M.textContent!="string"||typeof M.removeChild!="function"||!(M.attributes instanceof f)||typeof M.removeAttribute!="function"||typeof M.setAttribute!="function"||typeof M.namespaceURI!="string"||typeof M.insertBefore!="function"},ee=function(M){return(typeof s>"u"?"undefined":Vi(s))==="object"?M instanceof s:M&&(typeof M>"u"?"undefined":Vi(M))==="object"&&typeof M.nodeType=="number"&&typeof M.nodeName=="string"},De=function(M,J,fe){ie[M]&&qb(ie[M],function(Ne){Ne.call(t,J,fe,Ce)})},bt=function(M){var J=void 0;if(De("beforeSanitizeElements",M,null),Y(M)||dc(M.nodeName,/[\u0080-\uFFFF]/))return It(M),!0;var fe=Ae(M.nodeName);if(De("uponSanitizeElement",M,{tagName:fe,allowedTags:X}),!ee(M.firstElementChild)&&(!ee(M.content)||!ee(M.content.firstElementChild))&&Rr(/<[/\w]/g,M.innerHTML)&&Rr(/<[/\w]/g,M.textContent)||fe==="select"&&Rr(/