From 861f4245a76c9e43231db9a8110ba83d2f11a785 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:55:07 +0000 Subject: [PATCH] Deploy to GitHub pages --- .nojekyll | 0 .../assets/CustomJsonLdSerializer-C_-jxN3b.js | 1 + .../assets/CustomRdfXmlParser-BJJf4Qyx.js | 27 + converter/assets/browser-BwSN-dYO.js | 1 + converter/assets/canonicalize-DMjjQ0zD.js | 1 + converter/assets/index-9ws8vv3D.js | 1 + converter/assets/index-BOvYCoiN.js | 1 + converter/assets/index-BXBHXDl7.js | 2 + converter/assets/index-C1l6Y1dy.js | 2 + converter/assets/index-KQGOViY4.js | 3 + converter/assets/index-eMmQoqsl.js | 485 ++++++ converter/assets/index-xi1VyXRX.js | 48 + converter/assets/main-16Vam_JP.js | 22 + converter/assets/main-BYlbn3DA.js | 20 + converter/assets/main-CDN167a0.js | 4 + converter/assets/main-CL977LrX.js | 2 + converter/assets/main-CM6HleSx.js | 13 + converter/assets/main-DouyocZT.js | 31 + converter/assets/main-MfGTL6Y1.js | 14 + converter/assets/main-lsZ9cb4d.js | 3 + converter/assets/readable-BmS1kvD9.js | 1 + converter/assets/stream-CaRB5T9V.js | 1 + converter/index.html | 27 + .../assets/CustomJsonLdSerializer-KAw4S5Ct.js | 1 + .../assets/CustomRdfXmlParser-DQIXAyrs.js | 27 + rdf-editor/assets/browser-BwSN-dYO.js | 1 + rdf-editor/assets/canonicalize-DMjjQ0zD.js | 1 + rdf-editor/assets/index-BJJSNifu.js | 2 + rdf-editor/assets/index-BOvYCoiN.js | 1 + rdf-editor/assets/index-CEq2jXnX.js | 48 + rdf-editor/assets/index-DJj1BX_N.js | 1433 +++++++++++++++ rdf-editor/assets/index-ORBAb9FT.js | 2 + rdf-editor/assets/index-aMC0ki5N.js | 3 + rdf-editor/assets/index-rm4E9--V.js | 1 + rdf-editor/assets/main-5j51Jm6i.js | 13 + rdf-editor/assets/main-B9odckXT.js | 4 + rdf-editor/assets/main-CAnNLMtq.js | 22 + rdf-editor/assets/main-CIK5Qv2f.js | 20 + rdf-editor/assets/main-CJU21JpY.js | 3 + rdf-editor/assets/main-CPXwvXK9.js | 31 + rdf-editor/assets/main-DcSxf3zY.js | 14 + rdf-editor/assets/main-v_ERuz1K.js | 2 + rdf-editor/assets/readable-BmS1kvD9.js | 1 + rdf-editor/assets/stream-baiUdxpZ.js | 1 + rdf-editor/custom-elements.json | 517 ++++++ rdf-editor/index.html | 61 + .../assets/CustomJsonLdSerializer-BwFxMv5q.js | 1 + .../assets/CustomRdfXmlParser-Cw2aOf8J.js | 27 + rdf-snippet/assets/browser-BwSN-dYO.js | 1 + rdf-snippet/assets/canonicalize-DMjjQ0zD.js | 1 + rdf-snippet/assets/index-7e9cq9Qu.js | 1 + rdf-snippet/assets/index-BOvYCoiN.js | 1 + rdf-snippet/assets/index-BfXhqbLW.js | 2 + rdf-snippet/assets/index-CzbL2tvI.js | 48 + rdf-snippet/assets/index-DUh1a9RY.js | 3 + rdf-snippet/assets/index-DXkCsV9d.js | 1531 +++++++++++++++++ rdf-snippet/assets/index-Dr3nV6r4.js | 2 + rdf-snippet/assets/main-B4rWvqYW.js | 13 + rdf-snippet/assets/main-Bud83Ixw.js | 4 + rdf-snippet/assets/main-C4ew0tN6.js | 22 + rdf-snippet/assets/main-CBlxw7Yf.js | 3 + rdf-snippet/assets/main-CGmanwk1.js | 2 + rdf-snippet/assets/main-Ci5Lf12J.js | 20 + rdf-snippet/assets/main-DeoAhMFN.js | 14 + rdf-snippet/assets/main-xEfuU6SW.js | 31 + rdf-snippet/assets/readable-BmS1kvD9.js | 1 + rdf-snippet/assets/stream-D92jGKRY.js | 1 + rdf-snippet/custom-elements.json | 289 ++++ rdf-snippet/index.html | 78 + sparql-editor/assets/index-B5pnqGJA.js | 1426 +++++++++++++++ sparql-editor/custom-elements.json | 127 ++ sparql-editor/index.html | 62 + 72 files changed, 6630 insertions(+) create mode 100644 .nojekyll create mode 100644 converter/assets/CustomJsonLdSerializer-C_-jxN3b.js create mode 100644 converter/assets/CustomRdfXmlParser-BJJf4Qyx.js create mode 100644 converter/assets/browser-BwSN-dYO.js create mode 100644 converter/assets/canonicalize-DMjjQ0zD.js create mode 100644 converter/assets/index-9ws8vv3D.js create mode 100644 converter/assets/index-BOvYCoiN.js create mode 100644 converter/assets/index-BXBHXDl7.js create mode 100644 converter/assets/index-C1l6Y1dy.js create mode 100644 converter/assets/index-KQGOViY4.js create mode 100644 converter/assets/index-eMmQoqsl.js create mode 100644 converter/assets/index-xi1VyXRX.js create mode 100644 converter/assets/main-16Vam_JP.js create mode 100644 converter/assets/main-BYlbn3DA.js create mode 100644 converter/assets/main-CDN167a0.js create mode 100644 converter/assets/main-CL977LrX.js create mode 100644 converter/assets/main-CM6HleSx.js create mode 100644 converter/assets/main-DouyocZT.js create mode 100644 converter/assets/main-MfGTL6Y1.js create mode 100644 converter/assets/main-lsZ9cb4d.js create mode 100644 converter/assets/readable-BmS1kvD9.js create mode 100644 converter/assets/stream-CaRB5T9V.js create mode 100644 converter/index.html create mode 100644 rdf-editor/assets/CustomJsonLdSerializer-KAw4S5Ct.js create mode 100644 rdf-editor/assets/CustomRdfXmlParser-DQIXAyrs.js create mode 100644 rdf-editor/assets/browser-BwSN-dYO.js create mode 100644 rdf-editor/assets/canonicalize-DMjjQ0zD.js create mode 100644 rdf-editor/assets/index-BJJSNifu.js create mode 100644 rdf-editor/assets/index-BOvYCoiN.js create mode 100644 rdf-editor/assets/index-CEq2jXnX.js create mode 100644 rdf-editor/assets/index-DJj1BX_N.js create mode 100644 rdf-editor/assets/index-ORBAb9FT.js create mode 100644 rdf-editor/assets/index-aMC0ki5N.js create mode 100644 rdf-editor/assets/index-rm4E9--V.js create mode 100644 rdf-editor/assets/main-5j51Jm6i.js create mode 100644 rdf-editor/assets/main-B9odckXT.js create mode 100644 rdf-editor/assets/main-CAnNLMtq.js create mode 100644 rdf-editor/assets/main-CIK5Qv2f.js create mode 100644 rdf-editor/assets/main-CJU21JpY.js create mode 100644 rdf-editor/assets/main-CPXwvXK9.js create mode 100644 rdf-editor/assets/main-DcSxf3zY.js create mode 100644 rdf-editor/assets/main-v_ERuz1K.js create mode 100644 rdf-editor/assets/readable-BmS1kvD9.js create mode 100644 rdf-editor/assets/stream-baiUdxpZ.js create mode 100644 rdf-editor/custom-elements.json create mode 100644 rdf-editor/index.html create mode 100644 rdf-snippet/assets/CustomJsonLdSerializer-BwFxMv5q.js create mode 100644 rdf-snippet/assets/CustomRdfXmlParser-Cw2aOf8J.js create mode 100644 rdf-snippet/assets/browser-BwSN-dYO.js create mode 100644 rdf-snippet/assets/canonicalize-DMjjQ0zD.js create mode 100644 rdf-snippet/assets/index-7e9cq9Qu.js create mode 100644 rdf-snippet/assets/index-BOvYCoiN.js create mode 100644 rdf-snippet/assets/index-BfXhqbLW.js create mode 100644 rdf-snippet/assets/index-CzbL2tvI.js create mode 100644 rdf-snippet/assets/index-DUh1a9RY.js create mode 100644 rdf-snippet/assets/index-DXkCsV9d.js create mode 100644 rdf-snippet/assets/index-Dr3nV6r4.js create mode 100644 rdf-snippet/assets/main-B4rWvqYW.js create mode 100644 rdf-snippet/assets/main-Bud83Ixw.js create mode 100644 rdf-snippet/assets/main-C4ew0tN6.js create mode 100644 rdf-snippet/assets/main-CBlxw7Yf.js create mode 100644 rdf-snippet/assets/main-CGmanwk1.js create mode 100644 rdf-snippet/assets/main-Ci5Lf12J.js create mode 100644 rdf-snippet/assets/main-DeoAhMFN.js create mode 100644 rdf-snippet/assets/main-xEfuU6SW.js create mode 100644 rdf-snippet/assets/readable-BmS1kvD9.js create mode 100644 rdf-snippet/assets/stream-D92jGKRY.js create mode 100644 rdf-snippet/custom-elements.json create mode 100644 rdf-snippet/index.html create mode 100644 sparql-editor/assets/index-B5pnqGJA.js create mode 100644 sparql-editor/custom-elements.json create mode 100644 sparql-editor/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/converter/assets/CustomJsonLdSerializer-C_-jxN3b.js b/converter/assets/CustomJsonLdSerializer-C_-jxN3b.js new file mode 100644 index 00000000..f62f8497 --- /dev/null +++ b/converter/assets/CustomJsonLdSerializer-C_-jxN3b.js @@ -0,0 +1 @@ +import{S as u}from"./index-BOvYCoiN.js";import{a as l}from"./index-eMmQoqsl.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-BJJf4Qyx.js b/converter/assets/CustomRdfXmlParser-BJJf4Qyx.js new file mode 100644 index 00000000..3330d733 --- /dev/null +++ b/converter/assets/CustomRdfXmlParser-BJJf4Qyx.js @@ -0,0 +1,27 @@ +import{c as N,a as Kt}from"./index-eMmQoqsl.js";import{r as Yt,a as Zt}from"./index-9ws8vv3D.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 00000000..596d467b --- /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 00000000..ee442835 --- /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-9ws8vv3D.js b/converter/assets/index-9ws8vv3D.js new file mode 100644 index 00000000..af68a7a9 --- /dev/null +++ b/converter/assets/index-9ws8vv3D.js @@ -0,0 +1 @@ +import{c as _}from"./index-eMmQoqsl.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 00000000..4a20221c --- /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-BXBHXDl7.js b/converter/assets/index-BXBHXDl7.js new file mode 100644 index 00000000..d2f4cd13 --- /dev/null +++ b/converter/assets/index-BXBHXDl7.js @@ -0,0 +1,2 @@ +import{S as D}from"./index-BOvYCoiN.js";import{g as M,a as $,f as O}from"./index-eMmQoqsl.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-C1l6Y1dy.js b/converter/assets/index-C1l6Y1dy.js new file mode 100644 index 00000000..bc47a64b --- /dev/null +++ b/converter/assets/index-C1l6Y1dy.js @@ -0,0 +1,2 @@ +import{S as a}from"./index-BOvYCoiN.js";import{a as n,t as i}from"./index-eMmQoqsl.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-KQGOViY4.js b/converter/assets/index-KQGOViY4.js new file mode 100644 index 00000000..4e2e8bb4 --- /dev/null +++ b/converter/assets/index-KQGOViY4.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-eMmQoqsl.js";import{r as Jt}from"./readable-BmS1kvD9.js";import{r as Me,a as Xt}from"./index-9ws8vv3D.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-eMmQoqsl.js b/converter/assets/index-eMmQoqsl.js new file mode 100644 index 00000000..ec4de48e --- /dev/null +++ b/converter/assets/index-eMmQoqsl.js @@ -0,0 +1,485 @@ +const __vite__fileDeps=["assets/index-KQGOViY4.js","assets/index-BOvYCoiN.js","assets/readable-BmS1kvD9.js","assets/index-9ws8vv3D.js","assets/canonicalize-DMjjQ0zD.js","assets/index-BXBHXDl7.js","assets/CustomRdfXmlParser-BJJf4Qyx.js","assets/index-C1l6Y1dy.js","assets/CustomJsonLdSerializer-C_-jxN3b.js","assets/main-BYlbn3DA.js","assets/main-lsZ9cb4d.js","assets/main-CDN167a0.js","assets/main-CL977LrX.js","assets/browser-BwSN-dYO.js","assets/main-16Vam_JP.js","assets/main-DouyocZT.js","assets/main-MfGTL6Y1.js","assets/main-CM6HleSx.js","assets/index-xi1VyXRX.js","assets/stream-CaRB5T9V.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +const cc=Object.freeze(Object.defineProperty({__proto__:null,get _void(){return Ix},get acl(){return ob},get as(){return sb},get bibo(){return ub},get cc(){return cb},get cert(){return hb},get cnt(){return gb},get constant(){return yb},get crm(){return mb},get csvw(){return xb},get ctag(){return _b},get dash(){return kb},get dashSparql(){return Cb},get dbo(){return Lb},get dc11(){return Mb},get dcam(){return $b},get dcat(){return Ob},get dcmitype(){return Db},get dcterms(){return Fb},get default(){return Rs},get dig(){return Hb},get discipline(){return jb},get doap(){return Gb},get dpv(){return Kb},get dqv(){return Vb},get dtype(){return Jb},get duv(){return Qb},get earl(){return tm},get ebucore(){return im},get exif(){return om},get foaf(){return sm},get frbr(){return um},get geo(){return cm},get geof(){return hm},get geor(){return gm},get gml(){return ym},get gn(){return mm},get gr(){return xm},get grddl(){return _m},get gs1(){return Cm},get gtfs(){return km},get http(){return Lm},get hydra(){return Mm},get ical(){return $m},get la(){return Om},get ldp(){return Dm},get list(){return Fm},get locn(){return Hm},get log(){return jm},get lvont(){return Gm},get m4i(){return Km},get ma(){return Vm},get mads(){return Jm},get math(){return Qm},get oa(){return tv},get og(){return iv},get oidc(){return ov},get org(){return sv},get owl(){return uv},get pim(){return cv},get prefix(){return hv},get prov(){return gv},get qb(){return yv},get qkdv(){return mv},get quantitykind(){return xv},get qudt(){return _v},get rdau(){return Cv},get rdf(){return $t},get rdfa(){return Av},get rdfs(){return Rv},get rev(){return Nv},get rico(){return Iv},get rif(){return Kx},get rr(){return Pv},get rss(){return Bv},get schema(){return Wv},get sd(){return Uv},get sdmx(){return zv},get sem(){return qv},get set(){return Xv},get sf(){return Yv},get sh(){return Zv},get shex(){return ex},get shsh(){return rx},get sioc(){return nx},get skos(){return lx},get skosxl(){return ax},get solid(){return fx},get sosa(){return dx},get sou(){return px},get ssn(){return wx},get stat(){return bx},get string(){return vx},get test(){return Sx},get time(){return Ex},get unit(){return Tx},get v(){return Vx},get vaem(){return Ax},get vann(){return Rx},get vcard(){return Nx},get vs(){return Px},get wdr(){return Jx},get wdrs(){return Bx},get wgs(){return Wx},get xhv(){return Ux},get xkos(){return zx},get xml(){return Qx},get xsd(){return mn}},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 _o=globalThis,Qs=_o.ShadowRoot&&(_o.ShadyCSS===void 0||_o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ea=Symbol(),pu=new WeakMap;let dc=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==ea)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o;const r=this.t;if(Qs&&t===void 0){const i=r!==void 0&&r.length===1;i&&(t=pu.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&pu.set(r,t))}return t}toString(){return this.cssText}};const Np=e=>new dc(typeof e=="string"?e:e+"",void 0,ea),hc=(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 dc(r,e,ea)},$p=(e,t)=>{if(Qs)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of t){const i=document.createElement("style"),n=_o.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,e.appendChild(i)}},gu=Qs?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return Np(r)})(e):e;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:Ip,defineProperty:Op,getOwnPropertyDescriptor:Pp,getOwnPropertyNames:Dp,getOwnPropertySymbols:Bp,getPrototypeOf:Fp}=Object,Er=globalThis,wu=Er.trustedTypes,Wp=wu?wu.emptyScript:"",Pl=Er.reactiveElementPolyfillSupport,wn=(e,t)=>e,ps={toAttribute(e,t){switch(t){case Boolean:e=e?Wp: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}},pc=(e,t)=>!Ip(e,t),yu={attribute:!0,type:String,converter:ps,reflect:!1,hasChanged:pc};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Er.litPropertyMetadata??(Er.litPropertyMetadata=new WeakMap);class Si extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=yu){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,r);n!==void 0&&Op(this.prototype,t,n)}}static getPropertyDescriptor(t,r,i){const{get:n,set:o}=Pp(this.prototype,t)??{get(){return this[r]},set(l){this[r]=l}};return{get(){return n==null?void 0:n.call(this)},set(l){const s=n==null?void 0:n.call(this);o.call(this,l),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yu}static _$Ei(){if(this.hasOwnProperty(wn("elementProperties")))return;const t=Fp(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(wn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(wn("properties"))){const r=this.properties,i=[...Dp(r),...Bp(r)];for(const n of i)this.createProperty(n,r[n])}const t=this[Symbol.metadata];if(t!==null){const r=litPropertyMetadata.get(t);if(r!==void 0)for(const[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}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(gu(n))}else t!==void 0&&r.push(gu(t));return r}static _$Eu(t,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(r=>r(this))}addController(t){var r;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var r;(r=this._$EO)==null||r.delete(t)}_$E_(){const t=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $p(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EC(t,r){var o;const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){const l=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:ps).toAttribute(r,i.type);this._$Em=t,l==null?this.removeAttribute(n):this.setAttribute(n,l),this._$Em=null}}_$AK(t,r){var o;const i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const l=i.getPropertyOptions(n),s=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:ps;this._$Em=n,this[n]=s.fromAttribute(r,l.type),this._$Em=null}}requestUpdate(t,r,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??pc)(this[t],r))return;this.P(t,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,r,i){this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,l]of this._$Ep)this[o]=l;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,l]of n)l.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],l)}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(r)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){var r;(r=this._$EO)==null||r.forEach(i=>{var n;return(n=i.hostUpdated)==null?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._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(t){}firstUpdated(t){}}Si.elementStyles=[],Si.shadowRootOptions={mode:"open"},Si[wn("elementProperties")]=new Map,Si[wn("finalized")]=new Map,Pl==null||Pl({ReactiveElement:Si}),(Er.reactiveElementVersions??(Er.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const yn=globalThis,$o=yn.trustedTypes,bu=$o?$o.createPolicy("lit-html",{createHTML:e=>e}):void 0,gc="$lit$",Sr=`lit$${Math.random().toFixed(9).slice(2)}$`,wc="?"+Sr,Hp=`<${wc}>`,ti=document,Ln=()=>ti.createComment(""),Rn=e=>e===null||typeof e!="object"&&typeof e!="function",ta=Array.isArray,Up=e=>ta(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Dl=`[ +\f\r]`,on=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,mu=/-->/g,vu=/>/g,Fr=RegExp(`>|${Dl}(?:([^\\s"'>=/]+)(${Dl}*=${Dl}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),xu=/'/g,Su=/"/g,yc=/^(?:script|style|textarea|title)$/i,jp=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),bc=jp(1),Di=Symbol.for("lit-noChange"),Ve=Symbol.for("lit-nothing"),_u=new WeakMap,zr=ti.createTreeWalker(ti,129);function mc(e,t){if(!ta(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return bu!==void 0?bu.createHTML(t):t}const zp=(e,t)=>{const r=e.length-1,i=[];let n,o=t===2?"":t===3?"":"",l=on;for(let s=0;s"?(l=n??on,h=-1):d[1]===void 0?h=-2:(h=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?Fr:d[3]==='"'?Su:xu):l===Su||l===xu?l=Fr:l===mu||l===vu?l=on:(l=Fr,n=void 0);const p=l===Fr&&e[s+1].startsWith("/>")?" ":"";o+=l===on?a+Hp:h>=0?(i.push(u),a.slice(0,h)+gc+a.slice(h)+Sr+p):a+Sr+(h===-2?s:p)}return[mc(e,o+(e[r]||"")+(t===2?"":t===3?"":"")),i]};class Mn{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]=zp(t,r);if(this.el=Mn.createElement(u,i),zr.currentNode=this.el.content,r===2||r===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=zr.nextNode())!==null&&a.length0){n.textContent=$o?$o.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}_$AI(t,r=this,i,n){const o=this.strings;let l=!1;if(o===void 0)t=Bi(this,t,r,0),l=!Rn(t)||t!==this._$AH&&t!==Di,l&&(this._$AH=t);else{const s=t;let a,u;for(t=o[0],a=0;a{const i=(r==null?void 0:r.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const o=(r==null?void 0:r.renderBefore)??null;i._$litPart$=n=new Vn(t.insertBefore(Ln(),o),o,void 0,r??{})}return n._$AI(e),n};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class Li extends Si{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const t=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=t.firstChild),t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=Yp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return Di}}var fc;Li._$litElement$=!0,Li.finalized=!0,(fc=globalThis.litElementHydrateSupport)==null||fc.call(globalThis,{LitElement:Li});const Fl=globalThis.litElementPolyfillSupport;Fl==null||Fl({LitElement:Li});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");function Jp(e,t){return class extends e{constructor(){super(),this.$rdf=t}}}class ra{constructor(t,{bind:r=!1}={}){this._factories=t.slice();for(const i of this._factories){typeof i.prototype.init=="function"&&i.prototype.init.call(this);for(const n of i.exports||[])r?this[n]=i.prototype[n].bind(this):this[n]=i.prototype[n]}}clone(){const t=new ra(this._factories);for(const r of t._factories)typeof r.prototype.clone=="function"&&r.prototype.clone.call(t,this);return t}}class Io extends Map{import(t,r,i){const n=this.get(t);return n?n.import(r,i):null}}class vc{constructor({factory:t}){this.factory=t,this.parsers=new Io,this.serializers=new Io}import(t){if(t.parsers)for(const[r,i]of t.parsers)this.parsers.set(r,new i.constructor({factory:this.factory}));if(t.serializers)for(const[r,i]of t.serializers)this.serializers.set(r,new i.constructor({factory:this.factory}));return this}}class Zp{init(){this.formats=new vc({factory:this})}clone(t){this.formats.import(t.formats)}}let xc=class{constructor(t){this.value=t}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}};xc.prototype.termType="BlankNode";let ia=class{equals(t){return!!t&&t.termType===this.termType}};ia.prototype.termType="DefaultGraph";ia.prototype.value="";function Eu(e,t){if(!t)return null;if(t.termType==="BlankNode")return e.blankNode(t.value);if(t.termType==="DefaultGraph")return e.defaultGraph();if(t.termType==="Literal")return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if(t.termType==="NamedNode")return e.namedNode(t.value);if(t.termType==="Quad"){const r=e.fromTerm(t.subject),i=e.fromTerm(t.predicate),n=e.fromTerm(t.object),o=e.fromTerm(t.graph);return e.quad(r,i,n,o)}if(t.termType==="Variable")return e.variable(t.value);throw new Error(`unknown termType ${t.termType}`)}class gs{constructor(t,r,i){this.value=t,this.language=r,this.datatype=i}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value&&t.language===this.language&&t.datatype.equals(this.datatype)}}gs.prototype.termType="Literal";let Zo=class{constructor(t){this.value=t}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}};Zo.prototype.termType="NamedNode";let na=class{constructor(t,r,i,n){this.subject=t,this.predicate=r,this.object=i,this.graph=n}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}};na.prototype.termType="Quad";na.prototype.value="";let Sc=class{constructor(t){this.value=t}equals(t){return!!t&&t.termType===this.termType&&t.value===this.value}};Sc.prototype.termType="Variable";const Qp=new Zo("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),eg=new Zo("http://www.w3.org/2001/XMLSchema#string");class oa{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new ia}}namedNode(t){return new Zo(t)}blankNode(t){return t=t||"b"+ ++this._data.blankNodeCounter,new xc(t)}literal(t,r){return typeof r=="string"?new gs(t,r,Qp):new gs(t,"",r||eg)}variable(t){return new Sc(t)}defaultGraph(){return this._data.defaultGraph}quad(t,r,i,n=this.defaultGraph()){return new na(t,r,i,n)}fromTerm(t){return Eu(this,t)}fromQuad(t){return Eu(this,t)}}oa.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const tg="modulepreload",rg=function(e){return"/converter/"+e},Cu={},yt=function(t,r,i){let n=Promise.resolve();if(r&&r.length>0){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=rg(a),a in Cu)return;Cu[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":tg,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})},ig=(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);!ng(n,o)&&i||Object.defineProperty(e,r,o)},ng=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)},og=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},lg=(e,t)=>`/* Wrapped ${e}*/ +${t}`,sg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ag=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ug=(e,t,r)=>{const i=r===""?"":`with ${r.trim()}() `,n=lg.bind(null,i,t.toString());Object.defineProperty(n,"name",ag),Object.defineProperty(e,"toString",{...sg,value:n})};function fg(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:i}=e;for(const n of Reflect.ownKeys(t))ig(e,t,n,r);return og(e,t),ug(e,t,i),e}const Oo=new WeakMap,_c=(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(Oo.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 fg(o,e),Oo.set(o,i),o};_c.callCount=e=>{if(!Oo.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Oo.get(e)};var BE=typeof globalThis<"u"?globalThis:typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{};function la(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cg(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 Ec={exports:{}},Wl={exports:{}},gr={},Qo={};Qo.byteLength=pg;Qo.toByteArray=wg;Qo.fromByteArray=mg;var Kt=[],St=[],dg=typeof Uint8Array<"u"?Uint8Array:Array,Hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var vi=0,hg=Hl.length;vi0)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 pg(e){var t=Cc(e),r=t[0],i=t[1];return(r+i)*3/4-i}function gg(e,t,r){return(t+r)*3/4-r}function wg(e){var t,r=Cc(e),i=r[0],n=r[1],o=new dg(gg(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 yg(e){return Kt[e>>18&63]+Kt[e>>12&63]+Kt[e>>6&63]+Kt[e&63]}function bg(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 sa={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */sa.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)};sa.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=Qo,r=sa,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 P(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 P(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 Pr=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},Tc={exports:{}},ln={exports:{}},Tu;function Nn(){if(Tu)return ln.exports;Tu=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 aa={exports:{}},Ri=typeof Reflect=="object"?Reflect:null,ku=Ri&&typeof Ri.apply=="function"?Ri.apply:function(t,r,i){return Function.prototype.apply.call(t,r,i)},Eo;Ri&&typeof Ri.ownKeys=="function"?Eo=Ri.ownKeys:Object.getOwnPropertySymbols?Eo=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Eo=function(t){return Object.getOwnPropertyNames(t)};function vg(e){console&&console.warn&&console.warn(e)}var kc=Number.isNaN||function(t){return t!==t};function $e(){$e.init.call(this)}aa.exports=$e;aa.exports.once=Eg;$e.EventEmitter=$e;$e.prototype._events=void 0;$e.prototype._eventsCount=0;$e.prototype._maxListeners=void 0;var Au=10;function el(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 Au},set:function(e){if(typeof e!="number"||e<0||kc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Au=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||kc(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 Ac(e){return e._maxListeners===void 0?$e.defaultMaxListeners:e._maxListeners}$e.prototype.getMaxListeners=function(){return Ac(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")ku(a,this,r);else for(var u=a.length,d=$c(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,vg(s)}return e}$e.prototype.addListener=function(t,r){return Lc(this,t,r,!1)};$e.prototype.on=$e.prototype.addListener;$e.prototype.prependListener=function(t,r){return Lc(this,t,r,!0)};function xg(){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 Rc(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=xg.bind(i);return n.listener=r,i.wrapFn=n,n}$e.prototype.once=function(t,r){return el(r),this.on(t,Rc(this,t,r)),this};$e.prototype.prependOnceListener=function(t,r){return el(r),this.prependListener(t,Rc(this,t,r)),this};$e.prototype.removeListener=function(t,r){var i,n,o,l,s;if(el(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():Sg(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 Mc(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?_g(n):$c(n,n.length)}$e.prototype.listeners=function(t){return Mc(this,t,!0)};$e.prototype.rawListeners=function(t){return Mc(this,t,!1)};$e.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Nc.call(e,t)};$e.prototype.listenerCount=Nc;function Nc(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?Eo(this._events):[]};function $c(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:tl.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")})(Tc);var ft=Tc.exports,ua={};const{format:Tg,inspect:Po,AggregateError:kg}=ft,Ag=globalThis.AggregateError||kg,Lg=Symbol("kIsNodeError"),Rg=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Mg=/^([A-Z][a-z0-9]*)+$/,Ng="__node_internal_",rl={};function Xr(e,t){if(!e)throw new rl.ERR_INTERNAL_ASSERTION(t)}function Lu(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 Xr(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 Xr(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:Tg(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[Lg]=!0,rl[e]=i}function Ru(e){const t=Ng+e.name;return Object.defineProperty(e,"name",{value:t}),e}function Ig(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new Ag([t,e],t.message);return r.code=t.code,r}return e||t}let Og=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new rl.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)=>{Xr(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)Xr(typeof a=="string","All expected entries have to be of type string"),Rg.includes(a)?n.push(a.toLowerCase()):Mg.test(a)?o.push(a):(Xr(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=Po(r,{depth:-1});i+=`. Received ${a}`}}else{let a=Po(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=Po(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)=>{Xr(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)=>{Xr(t,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Lu(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=Lu(i)),i+="n"):i=Po(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 ht={AbortError:Og,aggregateTwoErrors:Ru(Ig),hideStackFrames:Ru,codes:rl};const{ArrayIsArray:fa,ArrayPrototypeIncludes:Oc,ArrayPrototypeJoin:Pc,ArrayPrototypeMap:Pg,NumberIsInteger:ca,NumberIsNaN:Dg,NumberMAX_SAFE_INTEGER:Bg,NumberMIN_SAFE_INTEGER:Fg,NumberParseInt:Wg,ObjectPrototypeHasOwnProperty:Hg,RegExpPrototypeExec:Dc,String:Ug,StringPrototypeToUpperCase:jg,StringPrototypeTrim:zg}=We,{hideStackFrames:kt,codes:{ERR_SOCKET_BAD_PORT:Gg,ERR_INVALID_ARG_TYPE:nt,ERR_INVALID_ARG_VALUE:qi,ERR_OUT_OF_RANGE:ri,ERR_UNKNOWN_SIGNAL:Mu}}=ht,{normalizeEncoding:qg}=ft,{isAsyncFunction:Kg,isArrayBufferView:Xg}=ft.types,Nu={};function Vg(e){return e===(e|0)}function Yg(e){return e===e>>>0}const Jg=/^[0-7]+$/,Zg="must be a 32-bit unsigned integer or an octal string";function Qg(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Dc(Jg,e)===null)throw new qi(t,e,Zg);e=Wg(e,8)}return Bc(e,t),e}const e0=kt((e,t,r=Fg,i=Bg)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!ca(e))throw new ri(t,"an integer",e);if(ei)throw new ri(t,`>= ${r} && <= ${i}`,e)}),t0=kt((e,t,r=-2147483648,i=2147483647)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!ca(e))throw new ri(t,"an integer",e);if(ei)throw new ri(t,`>= ${r} && <= ${i}`,e)}),Bc=kt((e,t,r=!1)=>{if(typeof e!="number")throw new nt(t,"number",e);if(!ca(e))throw new ri(t,"an integer",e);const i=r?1:0,n=4294967295;if(en)throw new ri(t,`>= ${i} && <= ${n}`,e)});function da(e,t){if(typeof e!="string")throw new nt(t,"string",e)}function r0(e,t,r=void 0,i){if(typeof e!="number")throw new nt(t,"number",e);if(r!=null&&ei||(r!=null||i!=null)&&Dg(e))throw new ri(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}const i0=kt((e,t,r)=>{if(!Oc(r,e)){const n="must be one of: "+Pc(Pg(r,o=>typeof o=="string"?`'${o}'`:Ug(o)),", ");throw new qi(t,e,n)}});function Fc(e,t){if(typeof e!="boolean")throw new nt(t,"boolean",e)}function Ul(e,t,r){return e==null||!Hg(e,t)?r:e[t]}const n0=kt((e,t,r=null)=>{const i=Ul(r,"allowArray",!1),n=Ul(r,"allowFunction",!1);if(!Ul(r,"nullable",!1)&&e===null||!i&&fa(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new nt(t,"Object",e)}),o0=kt((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new nt(t,"a dictionary",e)}),il=kt((e,t,r=0)=>{if(!fa(e))throw new nt(t,"Array",e);if(e.length{if(!Xg(e))throw new nt(t,["Buffer","TypedArray","DataView"],e)});function c0(e,t){const r=qg(t),i=e.length;if(r==="hex"&&i%2!==0)throw new qi("encoding",t,`is invalid for data of length ${i}`)}function d0(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&zg(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new Gg(t,e,r);return e|0}const Wc=kt((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new nt(t,"AbortSignal",e)}),h0=kt((e,t)=>{if(typeof e!="function")throw new nt(t,"Function",e)}),p0=kt((e,t)=>{if(typeof e!="function"||Kg(e))throw new nt(t,"Function",e)}),g0=kt((e,t)=>{if(e!==void 0)throw new nt(t,"undefined",e)});function w0(e,t,r){if(!Oc(r,e))throw new nt(t,`('${Pc(r,"|")}')`,e)}const y0=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $u(e,t){if(typeof e>"u"||!Dc(y0,e))throw new qi(t,e,'must be an array or string of format "; rel=preload; as=style"')}function b0(e){if(typeof e=="string")return $u(e,"hints"),e;if(fa(e)){const t=e.length;let r="";if(t===0)return r;for(let i=0;i; rel=preload; as=style"')}var Yn={isInt32:Vg,isUint32:Yg,parseFileMode:Qg,validateArray:il,validateStringArray:l0,validateBooleanArray:s0,validateAbortSignalArray:a0,validateBoolean:Fc,validateBuffer:f0,validateDictionary:o0,validateEncoding:c0,validateFunction:h0,validateInt32:t0,validateInteger:e0,validateNumber:r0,validateObject:n0,validateOneOf:i0,validatePlainFunction:p0,validatePort:d0,validateSignalName:u0,validateString:da,validateUint32:Bc,validateUndefined:g0,validateUnion:w0,validateAbortSignal:Wc,validateLinkHeaderValue:b0},ha={exports:{}},Hc={exports:{}},Ue=Hc.exports={},zt,Gt;function ws(){throw new Error("setTimeout has not been defined")}function ys(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?zt=setTimeout:zt=ws}catch{zt=ws}try{typeof clearTimeout=="function"?Gt=clearTimeout:Gt=ys}catch{Gt=ys}})();function Uc(e){if(zt===setTimeout)return setTimeout(e,0);if((zt===ws||!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 m0(e){if(Gt===clearTimeout)return clearTimeout(e);if((Gt===ys||!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=[],Mi=!1,Gr,Co=-1;function v0(){!Mi||!Gr||(Mi=!1,Gr.length?lr=Gr.concat(lr):Co=-1,lr.length&&jc())}function jc(){if(!Mi){var e=Uc(v0);Mi=!0;for(var t=lr.length;t;){for(Gr=lr,lr=[];++Co1)for(var r=1;r{};function od(e,t,r){var i,n;if(arguments.length===2?(r=t,t=vs):t==null?t=vs:W0(t,"options"),F0(r,"callback"),B0(t.signal,"options.signal"),r=xs(r),G0(e)||q0(e))return J0(e,t,r);if(!K0(e))throw new D0("stream",["ReadableStream","WritableStream","Stream"],e);const o=(i=t.readable)!==null&&i!==void 0?i:jl(e),l=(n=t.writable)!==null&&n!==void 0?n:Hu(e),s=e._writableState,a=e._readableState,u=()=>{e.writable||g()};let d=X0(e)&&jl(e)===o&&Hu(e)===l,h=Uu(e,!1);const g=()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&r.call(e)};let p=Bu(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=z0(e);const R=()=>{T=!0;const U=ju(e)||Fu(e);if(U&&typeof U!="boolean")return r.call(e,U);if(o&&!p&&jl(e,!0)&&!Bu(e,!1))return r.call(e,new Pu);if(l&&!h&&!Uu(e,!1))return r.call(e,new Pu);r.call(e)},A=()=>{T=!0;const U=ju(e)||Fu(e);if(U&&typeof U!="boolean")return r.call(e,U);r.call(e)},N=()=>{e.req.on("finish",g)};Y0(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||Du(e))&&(h||Wu(e)===!1)||!l&&(!d||Wu(e))&&(p||Du(e)===!1)||a&&e.req&&e.aborted)&&vr.nextTick(A);const H=()=>{r=Ss,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 id(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)vr.nextTick(U);else{Ni=Ni||ft.addAbortListener;const Z=Ni(t.signal,U),le=r;r=xs((...ce)=>{Z[nd](),le.apply(e,ce)})}}return H}function J0(e,t,r){let i=!1,n=Ss;if(t.signal)if(n=()=>{i=!0,r.call(e,new id(void 0,{cause:t.signal.reason}))},t.signal.aborted)vr.nextTick(n);else{Ni=Ni||ft.addAbortListener;const l=Ni(t.signal,n),s=r;r=xs((...a)=>{l[nd](),s.apply(e,a)})}const o=(...l)=>{i||vr.nextTick(()=>r.apply(e,l))};return j0(e[V0].promise,o,o),Ss}function Z0(e,t){var r;let i=!1;return t===null&&(t=vs),(r=t)!==null&&r!==void 0&&r.cleanup&&(H0(t.cleanup,"cleanup"),i=t.cleanup),new U0((n,o)=>{const l=od(e,t,s=>{i&&l(),s?o(s):n()})})}ha.exports=od;ha.exports.finished=Z0;var Nr=ha.exports;const Xt=si,{aggregateTwoErrors:Q0,codes:{ERR_MULTIPLE_CALLBACK:ew},AbortError:tw}=ht,{Symbol:ld}=We,{kIsDestroyed:rw,isDestroyed:iw,isFinished:nw,isServerRequest:ow}=yr,sd=ld("kDestroy"),_s=ld("kConstruct");function ad(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function lw(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):(ad(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?zu(this,e,t):this.once(sd,function(o){zu(this,Q0(o,e),t)}),this)}function zu(e,t,r){let i=!1;function n(o){if(i)return;i=!0;const l=e._readableState,s=e._writableState;ad(o,s,l),s&&(s.closed=!0),l&&(l.closed=!0),typeof r=="function"&&r(o),o?Xt.nextTick(sw,e,o):Xt.nextTick(ud,e)}try{e._destroy(t||null,n)}catch(o){n(o)}}function sw(e,t){Es(e,t),ud(e)}function ud(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 Es(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 aw(){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 Cs(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(Es,e,t):Es(e,t))}function uw(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(_s,t),!(e.listenerCount(_s)>1)&&Xt.nextTick(fw,e)}function fw(e){let t=!1;function r(i){if(t){Cs(e,i??new ew);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(sd,i):i?Cs(e,i,!0):Xt.nextTick(cw,e)}try{e._construct(i=>{Xt.nextTick(r,i)})}catch(i){Xt.nextTick(r,i)}}function cw(e){e.emit(_s)}function Gu(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function fd(e){e.emit("close")}function dw(e,t){e.emit("error",t),Xt.nextTick(fd,e)}function hw(e,t){!e||iw(e)||(!t&&!nw(e)&&(t=new tw),ow(e)?(e.socket=null,e.destroy(t)):Gu(e)?e.abort():Gu(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Xt.nextTick(dw,e,t):Xt.nextTick(fd,e),e.destroyed||(e[rw]=!0))}var Ki={construct:uw,destroyer:hw,destroy:lw,undestroy:aw,errorOrDestroy:Cs};const{ArrayIsArray:pw,ObjectSetPrototypeOf:cd}=We,{EventEmitter:sl}=tl;function al(e){sl.call(this,e)}cd(al.prototype,sl.prototype);cd(al,sl);al.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(),sl.listenerCount(this,"error")===0&&this.emit("error",d)}Ts(r,"error",a),Ts(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 Ts(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):pw(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var pa={Stream:al,prependListener:Ts},dd={exports:{}};(function(e){const{SymbolDispose:t}=We,{AbortError:r,codes:i}=ht,{isNodeStream:n,isWebStream:o,kControllerErrorFunction:l}=yr,s=Nr,{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}})(dd);var ul=dd.exports;const{StringPrototypeSlice:qu,SymbolIterator:gw,TypedArrayPrototypeSet:ao,Uint8Array:ww}=We,{Buffer:zl}=gr,{inspect:yw}=ft;var bw=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 zl.alloc(0);const r=zl.allocUnsafe(t>>>0);let i=this.head,n=0;for(;i;)ao(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+=qu(o,0,t),this.head=i,i.data=qu(o,t));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(t){const r=zl.allocUnsafe(t),i=t;let n=this.head,o=0;do{const l=n.data;if(t>l.length)ao(r,l,i-t),t-=l.length;else{t===l.length?(ao(r,l,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(ao(r,new ww(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 yw(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:mw,NumberIsInteger:vw}=We,{validateInteger:xw}=Yn,{ERR_INVALID_ARG_VALUE:Sw}=ht.codes;let hd=16*1024,pd=16;function _w(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function gd(e){return e?pd:hd}function Ew(e,t){xw(t,"value",0),e?pd=t:hd=t}function Cw(e,t,r,i){const n=_w(t,i,r);if(n!=null){if(!vw(n)||n<0){const o=i?`options.${r}`:"options.highWaterMark";throw new Sw(o,n)}return mw(n)}return gd(e.objectMode)}var fl={getHighWaterMark:Cw,getDefaultHighWaterMark:gd,setDefaultHighWaterMark:Ew},wd={},ks={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)}})(ks,ks.exports);var Tw=ks.exports,ga=Tw.Buffer,Ku=ga.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 kw(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 Aw(e){var t=kw(e);if(typeof t!="string"&&(ga.isEncoding===Ku||!Ku(e)))throw new Error("Unknown encoding: "+e);return t||e}wd.StringDecoder=Jn;function Jn(e){this.encoding=Aw(e);var t;switch(this.encoding){case"utf16le":this.text=Iw,this.end=Ow,t=4;break;case"utf8":this.fillLast=Mw,t=4;break;case"base64":this.text=Pw,this.end=Dw,t=3;break;default:this.write=Bw,this.end=Fw;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ga.allocUnsafe(t)}Jn.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 Lw(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 Rw(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 Mw(e){var t=this.lastTotal-this.lastNeed,r=Rw(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 Nw(e,t){var r=Lw(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 Iw(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 Ow(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 Pw(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 Dw(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Bw(e){return e.toString(this.encoding)}function Fw(e){return e&&e.length?this.write(e):""}const Xu=si,{PromisePrototypeThen:Ww,SymbolAsyncIterator:Vu,SymbolIterator:Yu}=We,{Buffer:Hw}=gr,{ERR_INVALID_ARG_TYPE:Uw,ERR_STREAM_NULL_VALUES:jw}=ht.codes;function zw(e,t,r){let i;if(typeof t=="string"||t instanceof Hw)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let n;if(t&&t[Vu])n=!0,i=t[Vu]();else if(t&&t[Yu])n=!1,i=t[Yu]();else throw new Uw("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){Ww(s(u),()=>Xu.nextTick(d,u),h=>Xu.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 jw;if(o.push(h))continue;l=!1}}catch(u){o.destroy(u)}break}}return o}var yd=zw,ql,Ju;function cl(){if(Ju)return ql;Ju=1;const e=si,{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;ql=te,te.ReadableState=tt;const{EventEmitter:p}=tl,{Stream:m,prependListener:C}=pa,{Buffer:T}=gr,{addAbortSignal:R}=ul,A=Nr;let N=ft.debuglog("stream",b=>{N=b});const H=bw,U=Ki,{getHighWaterMark:Z,getDefaultHighWaterMark:le}=fl,{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:P},AbortError:oe}=ht,{validateObject:se}=Yn,fe=g("kPaused"),{StringDecoder:be}=wd,Le=yd;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,pt=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(pt),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 P);else{if(V.destroyed||V.errored)return!1;Pr(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?Pr(b,V,E,!1):k(b,V)):Pr(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=yi(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",Br);function Br(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 mi(){b.removeListener("finish",nn),Ht()}b.once("close",mi);function nn(){N("onfinish"),b.removeListener("close",mi),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=yi;function yi(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(lo,E,b))}function lo(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(Il,E);else if(b.autoDestroy){const K=E._writableState;(!K||K.autoDestroy&&(K.finished||K.writable===!1))&&E.destroy()}}}function Il(b){b.writable&&!b.writableEnded&&!b.destroyed&&b.end()}te.from=function(b,E){return Le(te,b,E)};let vt;function so(){return vt===void 0&&(vt={}),vt}return te.fromWeb=function(b,E){return so().newStreamReadableFromReadableStream(b,E)},te.toWeb=function(b,E){return so().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)},ql}var Kl,Zu;function wa(){if(Zu)return Kl;Zu=1;const e=si,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:i,ObjectDefineProperty:n,ObjectDefineProperties:o,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:s,Symbol:a,SymbolHasInstance:u}=We;Kl=se,se.WritableState=P;const{EventEmitter:d}=tl,h=pa.Stream,{Buffer:g}=gr,p=Ki,{addAbortSignal:m}=ul,{getHighWaterMark:C,getDefaultHighWaterMark:T}=fl,{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}=ht.codes,{errorOrDestroy:O}=p;l(se.prototype,h.prototype),l(se,h);function v(){}const j=a("kOnFinished");function P(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}P.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},n(P.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 P(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 P}}),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)?pt(Q,Y):Y.pendingcb--},L,M)):Se(M)&&(M.pendingcb++,pt(L,M))))}function pt(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(P))return j(P.arrayBuffer());if(n(P))return H(S,P,{objectMode:!0,writable:!1});if(u(P==null?void 0:P.readable)&&d(P==null?void 0:P.writable))return S.fromWeb(P);if(typeof(P==null?void 0:P.writable)=="object"||typeof(P==null?void 0:P.readable)=="object"){const fe=P!=null&&P.readable?l(P==null?void 0:P.readable)?P==null?void 0:P.readable:j(P.readable):void 0,be=P!=null&&P.writable?s(P==null?void 0:P.writable)?P==null?void 0:P.writable:j(P.writable):void 0;return v({readable:fe,writable:be})}const se=P==null?void 0:P.then;if(typeof se=="function"){let fe;return ce(se,P,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"],P)};function O(j){let{promise:P,resolve:oe}=N();const se=new le,fe=se.signal;return{value:j(async function*(){for(;;){const Le=P;P=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:P,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 P=j.readable&&typeof j.readable.read!="function"?R.wrap(j.readable):j.readable,oe=j.writable;let se=!!r(P),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:!!(P!=null&&P.readableObjectMode),writableObjectMode:!!(oe!=null&&oe.writableObjectMode),readable:se,writable:fe}),fe&&(h(oe,G=>{fe=!1,G&&C(P,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(P,G=>{se=!1,G&&C(P,G),X(G)}),P.on("readable",function(){if(we){const G=we;we=null,G()}}),P.on("end",function(){J.push(null)}),J._read=function(){for(;;){const G=P.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(P,G))},J}return Xl}var Vl,ef;function ur(){if(ef)return Vl;ef=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:i}=We;Vl=l;const n=cl(),o=wa();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 Vw(){this._final!==As&&As.call(this)}fr.prototype._final=As;fr.prototype._transform=function(e,t,r){throw new Kw("_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=Do(e,{readable:t,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,ty.destroyer(e,o||new ny("pipe")))},cleanup:n}}function dy(e){return sy(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function rs(e){if(Ur(e))return e;if(To(e))return hy(e);throw new Ls("val",["Readable","Iterable","AsyncIterable"],e)}async function*hy(e){es||(es=cl()),yield*es.prototype[Zw].call(e)}async function uo(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 Jw((u,d)=>{n?d(n):o=()=>{n?d(n):u()}});t.on("drain",l);const a=Do(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?ry(n,u):u)}finally{a(),t.off("drain",l)}}async function is(e,t,r,{end:i}){_i(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 py(...e){return Sd(e,ey(dy(e)))}function Sd(e,t,r){if(e.length===1&&Yw(e[0])&&(e=e[0]),e.length<2)throw new iy("streams");const i=new cy,n=i.signal,o=r==null?void 0:r.signal,l=[];ay(o,"options.signal");function s(){m(new ly)}ts=ts||ft.addAbortListener;let a;o&&(a=ts(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[Qw](),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(rf(N)){let ce=function(S){S&&S.name!=="AbortError"&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(S)};if(Z){const{destroy:S,cleanup:O}=nf(N,H,U);h.push(S),Jl(N)&&le&&l.push(O)}N.on("error",ce),Jl(N)&&le&&l.push(()=>{N.removeListener("error",ce)})}if(A===0)if(typeof N=="function"){if(C=N({signal:n}),!Ur(C))throw new Yl("Iterable, AsyncIterable or Stream","source",C)}else Ur(N)||To(N)||_i(N)?C=N:C=tf.from(N);else if(typeof N=="function"){if(_i(C)){var T;C=rs((T=C)===null||T===void 0?void 0:T.readable)}else C=rs(C);if(C=N(C,{signal:n}),H){if(!Ur(C,!0))throw new Yl("AsyncIterable",`transform[${A-1}]`,C)}else{var R;Ql||(Ql=xd);const ce=new Ql({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(Ur(C,!0))g++,uo(C,ce,p,{end:Z});else if(Zl(C)||_i(C)){const j=C.readable||C;g++,uo(j,ce,p,{end:Z})}else throw new Yl("AsyncIterable or Promise","destination",C);C=ce;const{destroy:O,cleanup:v}=nf(C,!1,!0);h.push(O),le&&l.push(v)}}else if(rf(N)){if(To(C)){g+=2;const ce=gy(C,N,p,{end:Z});Jl(N)&&le&&l.push(ce)}else if(_i(C)||Zl(C)){const ce=C.readable||C;g++,uo(ce,N,p,{end:Z})}else if(Ur(C))g++,uo(C,N,p,{end:Z});else throw new Ls("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=N}else if(uy(N)){if(To(C))g++,is(rs(C),N,p,{end:Z});else if(Zl(C)||Ur(C))g++,is(C,N,p,{end:Z});else if(_i(C))g++,is(C.readable,N,p,{end:Z});else throw new Ls("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=N}else C=tf.from(N)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&fn.nextTick(s),C}function gy(e,t,r,{end:i}){let n=!1;if(t.on("close",()=>{n||r(new oy)}),e.pipe(t,{end:!1}),i){let o=function(){n=!0,t.end()};fy(e)?fn.nextTick(o):e.once("end",o)}else r();return Do(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)}),Do(t,{readable:!1,writable:!0},r)}var ma={pipelineImpl:Sd,pipeline:py};const{pipeline:wy}=ma,fo=ur(),{destroyer:yy}=Ki,{isNodeStream:co,isReadable:of,isWritable:lf,isWebStream:ns,isTransformStream:Wr,isWritableStream:sf,isReadableStream:af}=yr,{AbortError:by,codes:{ERR_INVALID_ARG_VALUE:uf,ERR_MISSING_ARGS:my}}=ht,vy=Nr;var _d=function(...t){if(t.length===0)throw new my("streams");if(t.length===1)return fo.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=fo.from(t[0])),typeof t[t.length-1]=="function"){const p=t.length-1;t[p]=fo.from(t[p])}for(let p=0;p0&&!(lf(t[p])||sf(t[p])||Wr(t[p])))throw new uf(`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=wy(t,a),h=!!(lf(u)||sf(u)||Wr(u)),g=!!(of(d)||af(d)||Wr(d));if(s=new fo({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:g}),h){if(co(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(ns(u)){const C=(Wr(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=Wr(d)?d.readable:d;vy(p,()=>{if(n){const m=n;n=null,m()}})}if(g){if(co(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(ns(d)){const m=(Wr(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 by),o=null,i=null,n=null,l===null?m(p):(l=m,co(d)&&yy(d,p))},s};const xy=globalThis.AbortController||Nn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Sy,ERR_INVALID_ARG_TYPE:Zn,ERR_MISSING_ARGS:_y,ERR_OUT_OF_RANGE:Ey},AbortError:Yt}=ht,{validateAbortSignal:ui,validateInteger:ff,validateObject:fi}=Yn,Cy=We.Symbol("kWeak"),Ty=We.Symbol("kResistStopPropagation"),{finished:ky}=Nr,Ay=_d,{addAbortSignalNoValidate:Ly}=ul,{isWritable:Ry,isNodeStream:My}=yr,{deprecate:Ny}=ft,{ArrayPrototypePush:$y,Boolean:Iy,MathFloor:cf,Number:Oy,NumberIsNaN:Py,Promise:df,PromiseReject:hf,PromiseResolve:Dy,PromisePrototypeThen:pf,Symbol:Ed}=We,Bo=Ed("kEmpty"),gf=Ed("kEof");function By(e,t){if(t!=null&&fi(t,"options"),(t==null?void 0:t.signal)!=null&&ui(t.signal,"options.signal"),My(e)&&!Ry(e))throw new Sy("stream",e,"must be writable");const r=Ay(this,e);return t!=null&&t.signal&&Ly(t.signal,r),r}function dl(e,t){if(typeof e!="function")throw new Zn("fn",["Function","AsyncFunction"],e);t!=null&&fi(t,"options"),(t==null?void 0:t.signal)!=null&&ui(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=cf(t.concurrency));let i=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(i=cf(t.highWaterMark)),ff(r,"options.concurrency",1),ff(i,"options.highWaterMark",0),i+=r,(async function*(){const o=ft.AbortSignalAny([t==null?void 0:t.signal].filter(Iy)),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 df(A=>{d=A})}s.push(gf)}catch(R){const A=hf(R);pf(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===gf)return;if(o.aborted)throw new Yt;R!==Bo&&(yield R),s.shift(),C()}await new df(R=>{u=R})}}finally{h=!0,d&&(d(),d=null)}}).call(this)}function Fy(e=void 0){return e!=null&&fi(e,"options"),(e==null?void 0:e.signal)!=null&&ui(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 Cd(e,t=void 0){for await(const r of va.call(this,e,t))return!0;return!1}async function Wy(e,t=void 0){if(typeof e!="function")throw new Zn("fn",["Function","AsyncFunction"],e);return!await Cd.call(this,async(...r)=>!await e(...r),t)}async function Hy(e,t){for await(const r of va.call(this,e,t))return r}async function Uy(e,t){if(typeof e!="function")throw new Zn("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n),Bo}for await(const i of dl.call(this,r,t));}function va(e,t){if(typeof e!="function")throw new Zn("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n)?i:Bo}return dl.call(this,r,t)}class jy extends _y{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function zy(e,t,r){var i;if(typeof e!="function")throw new Zn("reducer",["Function","AsyncFunction"],e);r!=null&&fi(r,"options"),(r==null?void 0:r.signal)!=null&&ui(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 ky(this.destroy(u)),u}const o=new xy,l=o.signal;if(r!=null&&r.signal){const u={once:!0,[Cy]:this,[Ty]:!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 jy}finally{o.abort()}return t}async function Gy(e){e!=null&&fi(e,"options"),(e==null?void 0:e.signal)!=null&&ui(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 qy(e,t){const r=dl.call(this,e,t);return(async function*(){for await(const n of r)yield*n}).call(this)}function Td(e){if(e=Oy(e),Py(e))return 0;if(e<0)throw new Ey("number",">= 0",e);return e}function Ky(e,t=void 0){return t!=null&&fi(t,"options"),(t==null?void 0:t.signal)!=null&&ui(t.signal,"options.signal"),e=Td(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 Xy(e,t=void 0){return t!=null&&fi(t,"options"),(t==null?void 0:t.signal)!=null&&ui(t.signal,"options.signal"),e=Td(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)}ua.streamReturningOperators={asIndexedPairs:Ny(Fy,"readable.asIndexedPairs will be removed in a future version."),drop:Ky,filter:va,flatMap:qy,map:dl,take:Xy,compose:By};ua.promiseReturningOperators={every:Wy,forEach:Uy,reduce:zy,toArray:Gy,some:Cd,find:Hy};var os,wf;function kd(){if(wf)return os;wf=1;const{ArrayPrototypePop:e,Promise:t}=We,{isIterable:r,isNodeStream:i,isWebStream:n}=yr,{pipelineImpl:o}=ma,{finished:l}=Nr;Ad();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 os={finished:l,pipeline:s},os}var yf;function Ad(){if(yf)return Wl.exports;yf=1;const{Buffer:e}=gr,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:i}=We,{promisify:{custom:n}}=ft,{streamReturningOperators:o,promiseReturningOperators:l}=ua,{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ht,a=_d,{setDefaultHighWaterMark:u,getDefaultHighWaterMark:d}=fl,{pipeline:h}=ma,{destroyer:g}=Ki,p=Nr,m=kd(),C=yr,T=Wl.exports=pa.Stream;T.isDestroyed=C.isDestroyed,T.isDisturbed=C.isDisturbed,T.isErrored=C.isErrored,T.isReadable=C.isReadable,T.isWritable=C.isWritable,T.Readable=cl();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=wa(),T.Duplex=ur(),T.Transform=md,T.PassThrough=xd,T.pipeline=h;const{addAbortSignal:R}=ul;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)},Wl.exports}(function(e){const t=Ad(),r=kd(),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})(Ec);var Ld=Ec.exports;const Vy=la(Ld);class Yy{constructor(t,...r){this.load=_c(async()=>{const i=await t();return new i(...r)})}import(t,r){const i=new Ld.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 Yy{constructor(...t){super(e,...t)}}}const Jy=new Io,Zy=new Io,mt={parsers:Jy,serializers:Zy},Qy=Bt(async()=>(await yt(()=>import("./index-KQGOViY4.js"),__vite__mapDeps([0,1,2,3,4]))).default),Qn=Bt(async()=>(await yt(()=>import("./index-BXBHXDl7.js"),__vite__mapDeps([5,1,2]))).default),eb=Bt(async()=>(await yt(()=>import("./CustomRdfXmlParser-BJJf4Qyx.js"),__vite__mapDeps([6,3]))).default),hl=Bt(async()=>(await yt(()=>import("./index-C1l6Y1dy.js"),__vite__mapDeps([7,1,2]))).default),tb=Bt(async()=>(await yt(()=>import("./CustomJsonLdSerializer-C_-jxN3b.js"),__vite__mapDeps([8,1]))).default);mt.parsers.set("application/ld+json",new Qy);mt.parsers.set("application/trig",new Qn);mt.parsers.set("application/n-quads",new Qn);mt.parsers.set("application/n-triples",new Qn);mt.parsers.set("text/n3",new Qn);mt.parsers.set("text/turtle",new Qn);mt.parsers.set("application/rdf+xml",new eb);mt.serializers.set("application/ld+json",new tb);mt.serializers.set("application/n-quads",new hl);mt.serializers.set("application/n-triples",new hl);mt.serializers.set("text/n3",new hl);mt.serializers.set("text/turtle",new hl);class Rs{init(){this.ns=cc}}const rb=new oa,ib={apply:(e,t,r)=>e(r[0]),get:(e,t)=>e(t)};function B(e,{factory:t=rb}={}){const r=(i="")=>t.namedNode(`${e}${i.raw||i}`);return typeof Proxy>"u"?r:new Proxy(r,ib)}const nb=B("http://www.w3.org/ns/auth/acl#"),ob=nb,lb=B("https://www.w3.org/ns/activitystreams#"),sb=lb,ab=B("http://purl.org/ontology/bibo/"),ub=ab,fb=B("http://creativecommons.org/ns#"),cb=fb,db=B("http://www.w3.org/ns/auth/cert#"),hb=db,pb=B("http://www.w3.org/2011/content#"),gb=pb,wb=B("http://qudt.org/vocab/constant/"),yb=wb,bb=B("http://www.cidoc-crm.org/cidoc-crm/"),mb=bb,vb=B("http://www.w3.org/ns/csvw#"),xb=vb,Sb=B("http://commontag.org/ns#"),_b=Sb,Eb=B("http://datashapes.org/sparql#"),Cb=Eb,Tb=B("http://datashapes.org/dash#"),kb=Tb,Ab=B("http://dbpedia.org/ontology/"),Lb=Ab,Rb=B("http://purl.org/dc/elements/1.1/"),Mb=Rb,Nb=B("http://purl.org/dc/dcam/"),$b=Nb,Ib=B("http://www.w3.org/ns/dcat#"),Ob=Ib,Pb=B("http://purl.org/dc/dcmitype/"),Db=Pb,Bb=B("http://purl.org/dc/terms/"),Fb=Bb,Wb=B("http://www.ics.forth.gr/isl/CRMdig/"),Hb=Wb,Ub=B("http://qudt.org/vocab/discipline/"),jb=Ub,zb=B("http://usefulinc.com/ns/doap#"),Gb=zb,qb=B("http://www.w3.org/ns/dpv#"),Kb=qb,Xb=B("http://www.w3.org/ns/dqv#"),Vb=Xb,Yb=B("http://www.linkedmodel.org/schema/dtype#"),Jb=Yb,Zb=B("http://www.w3.org/ns/duv#"),Qb=Zb,em=B("http://www.w3.org/ns/earl#"),tm=em,rm=B("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#"),im=rm,nm=B("http://www.w3.org/2003/12/exif/ns#"),om=nm,lm=B("http://xmlns.com/foaf/0.1/"),sm=lm,am=B("http://purl.org/vocab/frbr/core#"),um=am,fm=B("http://www.opengis.net/ont/geosparql#"),cm=fm,dm=B("http://www.opengis.net/def/function/geosparql/"),hm=dm,pm=B("http://www.opengis.net/def/rule/geosparql/"),gm=pm,wm=B("http://www.opengis.net/ont/gml#"),ym=wm,bm=B("http://www.geonames.org/ontology#"),mm=bm,vm=B("http://purl.org/goodrelations/v1#"),xm=vm,Sm=B("http://www.w3.org/2003/g/data-view#"),_m=Sm,Em=B("https://gs1.org/voc/"),Cm=Em,Tm=B("http://vocab.gtfs.org/terms#"),km=Tm,Am=B("http://www.w3.org/2011/http#"),Lm=Am,Rm=B("http://www.w3.org/ns/hydra/core#"),Mm=Rm,Nm=B("http://www.w3.org/2002/12/cal/icaltzd#"),$m=Nm,Im=B("https://linked.art/ns/terms/"),Om=Im,Pm=B("http://www.w3.org/ns/ldp#"),Dm=Pm,Bm=B("http://www.w3.org/2000/10/swap/list#"),Fm=Bm,Wm=B("http://www.w3.org/ns/locn#"),Hm=Wm,Um=B("http://www.w3.org/2000/10/swap/log#"),jm=Um,zm=B("http://lexvo.org/ontology#"),Gm=zm,qm=B("http://w3id.org/nfdi4ing/metadata4ing#"),Km=qm,Xm=B("http://www.w3.org/ns/ma-ont#"),Vm=Xm,Ym=B("http://www.loc.gov/mads/rdf/v1#"),Jm=Ym,Zm=B("http://www.w3.org/2000/10/swap/math#"),Qm=Zm,ev=B("http://www.w3.org/ns/oa#"),tv=ev,rv=B("http://ogp.me/ns#"),iv=rv,nv=B("http://www.w3.org/ns/solid/oidc#"),ov=nv,lv=B("http://www.w3.org/ns/org#"),sv=lv,av=B("http://www.w3.org/2002/07/owl#"),uv=av,fv=B("http://www.w3.org/ns/pim/space#"),cv=fv,dv=B("http://qudt.org/vocab/prefix/"),hv=dv,pv=B("http://www.w3.org/ns/prov#"),gv=pv,wv=B("http://purl.org/linked-data/cube#"),yv=wv,bv=B("http://qudt.org/vocab/dimensionvector/"),mv=bv,vv=B("http://qudt.org/vocab/quantitykind/"),xv=vv,Sv=B("http://qudt.org/schema/qudt/"),_v=Sv,Ev=B("http://rdaregistry.info/Elements/u/"),Cv=Ev,Tv=B("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),$t=Tv,kv=B("http://www.w3.org/ns/rdfa#"),Av=kv,Lv=B("http://www.w3.org/2000/01/rdf-schema#"),Rv=Lv,Mv=B("http://purl.org/stuff/rev#"),Nv=Mv,$v=B("https://www.ica.org/standards/RiC/ontology#"),Iv=$v,Ov=B("http://www.w3.org/ns/r2rml#"),Pv=Ov,Dv=B("http://purl.org/rss/1.0/"),Bv=Dv,Fv=B("http://schema.org/"),Wv=Fv,Hv=B("http://www.w3.org/ns/sparql-service-description#"),Uv=Hv,jv=B("http://purl.org/linked-data/sdmx#"),zv=jv,Gv=B("http://semanticweb.cs.vu.nl/2009/11/sem/"),qv=Gv,Kv=B("http://www.w3.org/2000/10/swap/set#"),Xv=Kv,Vv=B("http://www.opengis.net/ont/sf#"),Yv=Vv,Jv=B("http://www.w3.org/ns/shacl#"),Zv=Jv,Qv=B("http://www.w3.org/ns/shex#"),ex=Qv,tx=B("https://www.w3.org/ns/shacl-shacl#"),rx=tx,ix=B("http://rdfs.org/sioc/ns#"),nx=ix,ox=B("http://www.w3.org/2004/02/skos/core#"),lx=ox,sx=B("http://www.w3.org/2008/05/skos-xl#"),ax=sx,ux=B("http://www.w3.org/ns/solid/terms#"),fx=ux,cx=B("http://www.w3.org/ns/sosa/"),dx=cx,hx=B("http://qudt.org/vocab/sou/"),px=hx,gx=B("http://www.w3.org/ns/ssn/"),wx=gx,yx=B("http://www.w3.org/ns/posix/stat#"),bx=yx,mx=B("http://www.w3.org/2000/10/swap/string#"),vx=mx,xx=B("http://www.w3.org/2006/03/test-description#"),Sx=xx,_x=B("http://www.w3.org/2006/time#"),Ex=_x,Cx=B("http://qudt.org/vocab/unit/"),Tx=Cx,kx=B("http://www.linkedmodel.org/schema/vaem#"),Ax=kx,Lx=B("http://purl.org/vocab/vann/"),Rx=Lx,Mx=B("http://www.w3.org/2006/vcard/ns#"),Nx=Mx,$x=B("http://rdfs.org/ns/void#"),Ix=$x,Ox=B("http://www.w3.org/2003/06/sw-vocab-status/ns#"),Px=Ox,Dx=B("http://www.w3.org/2007/05/powder-s#"),Bx=Dx,Fx=B("http://www.w3.org/2003/01/geo/wgs84_pos#"),Wx=Fx,Hx=B("http://www.w3.org/1999/xhtml/vocab#"),Ux=Hx,jx=B("http://rdf-vocabulary.ddialliance.org/xkos#"),zx=jx,Gx=B("http://www.w3.org/2001/XMLSchema#"),mn=Gx,qx=B("http://www.w3.org/2007/rif#"),Kx=qx,Xx=B("http://rdf.data-vocabulary.org/#"),Vx=Xx,Yx=B("http://www.w3.org/2007/05/powder#"),Jx=Yx,Zx=B("http://www.w3.org/XML/1998/namespace/"),Qx=Zx;function e1(e){return"_:"+e.value}var t1=e1;function r1(e,t){return[...e].map(r=>t(r)).join(` +`)+` +`}var i1=r1;function n1(){return""}var o1=n1;function l1(e){return"<"+e.value+">"}var Rd=l1;const s1=Rd,a1=/["\\\\\n\r]/,u1=/["\\\\\n\r]/g,f1={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function c1(e){return f1[e]}function d1(e){return a1.test(e)?e.replace(u1,c1):e}function h1(e){const t=d1(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+'"^^'+s1(e.datatype)}var p1=h1;function g1(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 w1=g1;function y1(e){return"?"+e.value}var b1=y1;const m1=t1,v1=i1,x1=o1,S1=p1,_1=Rd,E1=w1,C1=b1;function Ms(e){if(!e)return null;if(e.termType==="BlankNode")return m1(e);if(e.termType==="DefaultGraph")return x1();if(e.termType==="Literal")return S1(e);if(e.termType==="NamedNode")return _1(e);if(e.termType==="Quad"||e.subject&&e.predicate&&e.object&&e.graph)return E1(e,Ms);if(e.termType==="Variable")return C1(e);if(e[Symbol.iterator])return v1(e,Ms);throw new Error(`unknown termType ${e.termType}`)}var T1=Ms;const ho=la(T1);class po{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(ho(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(ho(t));return r&&r.value}has(t){return this.index.has(ho(t))}*keys(){for(const[,{term:t}]of this.index)yield t}set(t,r){const i=ho(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 Md={exports:{}};const k1={},A1=Object.freeze(Object.defineProperty({__proto__:null,default:k1},Symbol.toStringTag,{value:"Module"})),L1=cg(A1),R1=L1,M1=/([\x00-\x20<>"{}|^`\\]|%(?![0-9A-F][0-9A-F]))/g,N1=(e,t)=>{let r=t.codePointAt(0).toString(16)+"";return r.length>4?"\\U"+r.padStart(8,"0"):"\\u"+r.padStart(4,"0")},Fo=e=>e.replace(M1,N1),xa=/^(?:[\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].*)|.+\.)$/,Nd=/^(?:\\|[\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])))$/,$1=/^([Tt](rue)?|TRUE)$/,I1=/^([Ff](alse)?|FALSE)$/,O1="xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx",P1=/[xy]/g,cn=()=>{let e=Date.now();return typeof performance<"u"&&(e+=performance.now()),O1.replace(P1,t=>{let r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?r:r&3|8).toString(16)})},pl=Symbol("prefix-cache"),D1=/[$^*()+[\\{}|.?]/g,B1="((?:[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 bf(e,t=!1){let r=[],i={};for(let n in e){let o=e[n];t&&xa.test(n)||(i[o]=n,r.push(o.replace(D1,"\\$&")))}return r.length?(e[pl]={_r_iris:new RegExp(`^(${r.join("|")})${B1}`,"u"),_h_inverse:i},Object.freeze(e)):e}const $d=(e,t)=>{let r=t[pl];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&&!xa.test(l)){let a=e.slice(s.length);Nd.test(a)||(n=a,i=l,o=s.length)}}if(o!==-1)return i+":"+n}return"<"+e+">"},eo=(e,t={})=>{let r=t[pl];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},F1=/^([^:]*):(.*)$/;function Id(e,t={},r=!1){switch(e[0]){case">":return"<"+e.slice(1)+">";case"_":return e.length<=2||e[2]==="#"?new $n()[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))+"^^"+Id(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]=F1.exec(e);return r||Nd.test(n)||xa.test(i)?"<"+t[i]+n+">":e}}}class $r{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($r.prototype,{isGraphyTerm:!0});class Ge extends $r{constructor(t){super(),this.value=t}concise(t={}){return eo(this.value,t)}terse(t={},r=!1){return $d(Fo(this.value),t)}verbose(){return"<"+Fo(this.value)+">"}isolate(){return{termType:"NamedNode",value:this.value}}}Object.assign(Ge.prototype,{termType:"NamedNode",isNamedNode:!0});const Ns=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");Ns.isRdfTypeAlias=!0;const Od=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),W1=Od.isolate(),H1=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),mf=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),U1=new Ge("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),j1=new Ge("http://www.w3.org/2001/XMLSchema#date"),z1=new Ge("http://www.w3.org/2001/XMLSchema#dateTime"),_r=new Ge("http://www.w3.org/2001/XMLSchema#string");class gl extends $r{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:"^"+eo(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(gl.prototype,{datatype:_r,language:"",termType:"Literal",isLiteral:!0,isSimple:!1});class dn extends gl{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:W1}}}Object.assign(dn.prototype,{datatype:Od,isLanguaged:!0});class Xi extends gl{verbose(){return JSON.stringify(this.value)+"^^"+this.datatype.verbose()}concise(t){return"^"+eo(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 go extends Xi{constructor(t,r){super(),this.value=t,this.datatype=r}}class Pd extends $r{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:"^"+eo(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(Pd.prototype,{datatype:_r,language:"",termType:"Literal",isLiteral:!0});class jr extends gl{constructor(t){super(),this.value=t}verbose(){return JSON.stringify(this.value)}concise(){return'"'+this.value}terse(){return JSON.stringify(this.value)}}Object.assign(jr.prototype,{isSimple:!0});const Dd=new Ge("http://www.w3.org/2001/XMLSchema#integer");class Vr extends Xi{static from(t){let r=new Vr(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.number=t}concise(t={}){return"^"+Dd.concise(t)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value}}Object.assign(Vr.prototype,{datatype:Dd,isNumeric:!0,isInteger:!0});const to=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"^"+to.concise(t)+'"'+this.value}terse(){return this.number.toExponential()}}Object.assign(Vt.prototype,{datatype:to,isNumeric:!0,isDouble:!0});const Bd=new Ge("http://www.w3.org/2001/XMLSchema#decimal");class Yr extends Xi{static from(t){let r=new Yr(+t);return r.value=t,r}constructor(t){super(),this.value=t+"",this.number=t}concise(t={}){return"^"+Bd.concise(t)+'"'+this.value}terse(){return this.value.includes("e")?`"${this.value}"^^`:this.value+(this.value.includes(".")?"":".0")}}Object.assign(Yr.prototype,{datatype:Bd,isNumeric:!0,isDecimal:!0});const Fd=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"^"+Fd.concise(t)+'"'+this.value}terse(){return this.value+""}}Object.assign(qt.prototype,{datatype:Fd,isBoolean:!0});class Wd extends Vt{constructor(){super(1/0),this.value="INF"}terse(t){return'"INF"^^'+to.terse(t)}}Object.assign(Wd.prototype,{isInfinite:!0});class Hd extends Vt{constructor(){super(-1/0),this.value="-INF"}terse(t){return'"-INF"^^'+to.terse(t)}}Object.assign(Hd.prototype,{isInfinite:!0});class Ud extends Vt{constructor(){super(NaN),this.value="NaN"}terse(t){return'"NaN"^^'+to.terse(t)}}Object.assign(Ud.prototype,{isNaN:!0});function qr(e,t=!1){this.value=e,this.isAnonymous=t}qr.prototype=Object.assign(Object.create($r.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 $n(){}$n.prototype=Object.assign(Object.create(qr.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($n.prototype,"value",{get(){return"_"+cn()}});class jd extends $r{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(jd.prototype,{termType:"Variable",isVariable:!0});function In(){}In.prototype=Object.assign(Object.create($r.prototype),{value:"",termType:"DefaultGraph",isDefaultGraph:!0,concise(){return"*"},terse(){return""},verbose(){return""},isolate(){return{termType:"DefaultGraph",value:""}}});Object.assign(Object.create($r.prototype),{value:"",termType:"NoGraph",concise(){return""},terse(){return""},verbose(){return""},isolate(){return{termType:"NoGraph",value:""}}});const Wo=new In;function Nt(e,t,r,i=Wo){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 vf={namedNode(e){return new Ge(e)},blankNode(e,t){return new qr(e,t)},literal(e){return new Pd(e)},defaultGraph(){return new In},quad(e,t,r,i){return new Nt(e,t,r,i||Wo)},integer(e){return Vr.from(e)},double(e){return Vt.from(e)},decimal(e){return Yr.from(e)},boolean(e){return new qt(e)}};const he=Md.exports={concise:eo,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:vf,unfiltered:{...vf,literal(e,t){return!t||_r.equals(t)?new jr(e):typeof t=="string"?new dn(e,t):_r.equals(t)?new jr(e):new go(e,t)},simpleLiteral(e){return new jr(e)},languagedLiteral(e,t){return new dn(e,t)},datatypedLiteral(e,t){return _r.equals(t)?new jr(e):new go(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"),j1)},dateTime(e){return he.literal(e.toISOString(),z1)},namedNode(e){return new Ge(e)},ephemeral(){return new $n},anonymous(){return new $n},blankNode(e){if(e){if(typeof e=="string")return new qr(e)}else return new qr("_"+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 jr(e):typeof t=="string"?new dn(e,t):new go(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 Vr(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 Vr(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 Ud:e>0?new Wd:new Hd;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 Yr(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 Yr(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($1.test(e))return new qt(!0);if(I1.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 In},variable(e){return new jd(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||Wo)},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 Ns;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"?Ns: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:Id,*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,H1,r[0],i);let n=r.slice(1);if(!n.length)yield new Nt(t,mf,U1,e);else{let o=he.blankNode();yield new Nt(t,mf,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):Wo)},rdfjs_term(e){switch(e.termType){case"NamedNode":return new Ge(e.value);case"BlankNode":return new qr(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 In;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 go(e.value,new Ge(e.datatype)):new jr(e.value);case"bnode":return new qr(e.value);default:throw new Error(`unexpected SPARQL Result JSON Format Term type: ${e.type}`)}}},to:{boolean:e=>qt.from(e),integer:e=>Vr.from(e),decimal:e=>Yr.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=R1.createHash("sha256");return r.update(t.verbose()),r.digest("hex")},cache_prefixes:bf,cachePrefixes:bf,terse:$d,clean_iri:Fo,cleanIri:Fo,$_PREFIX_CACHE:pl};Object.assign(he,{c3:he.triples,c4:he.quads,fromTerm:he.from.term,fromQuad:he.from.quad});var G1=Md.exports;const xf=la(G1),q1={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/"},K1={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#"},X1={...K1,...q1};function V1(e,t={}){const r={...X1,...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 zd{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(mn.string))return"";const r=V1(this.term.datatype.value,t);return r?`^^${r}`:`^^<${this.term.datatype.value}>`}}const Gd=new Map([[zd,e=>e.toTerm()]]);function Y1(e){return e.has($t.first)&&e.has($t.rest)}class J1 extends Vy.Transform{constructor({prefixes:t={},strict:r=!1,preserveListNodeProperties:i=!1}={}){super({objectMode:!0}),this.prefixes=t,this.graphs=new po,this.blankNodes=new po,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 po},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&&Y1(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 po;return this.graphs.set(t,r),r}literalHash(t){if(t.datatype&&!this.strict)switch(t.datatype.value){case mn.integer.value:{const r=+t.value;if(Number.isInteger(r))return r;break}case mn.decimal.value:{const r=+t.value;if(!Number.isNaN(r)&&!Number.isInteger(r))return r;break}case mn.boolean.value:{if(t.value==="true")return!0;if(t.value==="false")return!1;break}}return t.value.includes(` +`)?new zd(t):xf.fromTerm(t).concise(this.prefixes)}toHashKey(t){return t.termType==="Literal"?this.literalHash(t):t.equals($t.type)?"a":xf.fromTerm(t).concise(this.prefixes)}}async function Sa(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 J1({prefixes:l,strict:t.strict,preserveListNodeProperties:n})).pipe(s),s}}}const qd=Bt(()=>Sa(yt(()=>import("./main-BYlbn3DA.js").then(e=>e.m),__vite__mapDeps([9,10,11,12,13])),{coercions:Gd})),Z1=Bt(()=>Sa(yt(()=>import("./main-16Vam_JP.js").then(e=>e.m),__vite__mapDeps([14,11,12,13])),{strict:!0})),Q1=Bt(()=>Sa(yt(()=>import("./main-DouyocZT.js").then(e=>e.m),__vite__mapDeps([15,10,11,12,13])),{strict:!0,coercions:Gd}));async function Kd(e){const t=(await e).default;return class{import(r,i){return r.pipe(i?t(i):t())}}}const _a=Bt(()=>Kd(yt(()=>import("./main-MfGTL6Y1.js").then(e=>e.m),__vite__mapDeps([16,12,13])))),Xd=Bt(()=>Kd(yt(()=>import("./main-CM6HleSx.js").then(e=>e.m),__vite__mapDeps([17,12,13])))),eS=Bt(async()=>{const e=(await yt(()=>import("./index-xi1VyXRX.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 vc({});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 eS);At.serializers.set(Ft.notation3,new qd);At.serializers.set(Ft.turtle,new qd);At.serializers.set(Ft.trig,new Q1);At.serializers.set(Ft.rdfXml,new Z1);At.parsers.set(Ft.notation3,new _a);At.parsers.set(Ft.turtle,new _a);At.parsers.set(Ft.trig,new _a);At.parsers.set(Ft.ntriples,new Xd);At.parsers.set(Ft.nquads,new Xd);var ct=navigator.userAgent,Vd=navigator.platform,cr=/gecko\/\d/i.test(ct),Yd=/MSIE \d/.test(ct),Jd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ct),wl=/Edge\/(\d+)/.exec(ct),ye=Yd||Jd||wl,Pe=ye&&(Yd?document.documentMode||6:+(wl||Jd)[1]),it=!wl&&/WebKit\//.test(ct),tS=it&&/Qt\/\d+\.\d+/.test(ct),yl=!wl&&/Chrome\//.test(ct),Dt=/Opera\//.test(ct),bl=/Apple Computer/.test(navigator.vendor),rS=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ct),iS=/PhantomJS/.test(ct),ro=bl&&(/Mobile\/\w+/.test(ct)||navigator.maxTouchPoints>2),ml=/Android/.test(ct),On=ro||ml||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ct),Ct=ro||/Mac/.test(Vd),nS=/\bCrOS\b/.test(ct),oS=/win/i.test(Vd),Jr=Dt&&ct.match(/Version\/(\d*\.\d*)/);Jr&&(Jr=Number(Jr[1]));Jr&&Jr>=15&&(Dt=!1,it=!0);var Sf=Ct&&(tS||Dt&&(Jr==null||Jr<12.11)),Ea=cr||ye&&Pe>=9;function Wi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ci=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 Tr(e){for(let t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function bt(e,t){return Tr(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=Ca(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 wo=[""];function Ta(e){for(;wo.length<=e;)wo.push(Ce(wo)+" ");return wo[e]}function Ce(e){return e[e.length-1]}function xl(e,t){let r=[];for(let i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||sS.test(e))}function ko(e,t){return t?t.source.indexOf("\\w")>-1&&Is(e)?!0:t.test(e):Is(e)}function Ef(e){for(let t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var aS=/[\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 Os(e){return e.charCodeAt(0)>=768&&aS.test(e)}function eh(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 uS(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 Bn(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 fS=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=ka(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){wt(this,t,r)}}function at(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ih(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ps(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Fn(e){at(e),ih(e)}function Aa(e){return e.target||e.srcElement}function nh(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 cS=function(){if(ye&&Pe<9)return!1;let e=ie("div");return"draggable"in e||"dragDrop"in e}(),as;function dS(e){if(as==null){let r=ie("span","​");bt(e,ie("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(as=r.offsetWidth<=1&&r.offsetHeight>2&&!(ye&&Pe<8))}let t=as?ie("span","​"):ie("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return t.setAttribute("cm-text",""),t}var us;function hS(e){if(us!=null)return us;let t=bt(e,document.createTextNode("AخA")),r=ii(t,0,1).getBoundingClientRect(),i=ii(t,1,2).getBoundingClientRect();return Tr(e),!r||r.left==r.right?!1:us=i.right-r.right<3}var La=` + +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/),pS=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},gS=(()=>{let e=ie("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),fs=null;function wS(e){if(fs!=null)return fs;let t=bt(e,ie("span","x")),r=t.getBoundingClientRect(),i=ii(t,0,1).getBoundingClientRect();return fs=Math.abs(r.left-i.left)>1}var Ra={},Ti={};function yS(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ra[e]=t}function bS(e,t){Ti[e]=t}function Ho(e){if(typeof e=="string"&&Ti.hasOwnProperty(e))e=Ti[e];else if(e&&typeof e.name=="string"&&Ti.hasOwnProperty(e.name)){let t=Ti[e.name];typeof t=="string"&&(t={name:t}),e=Qd(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ho("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ho("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ma(e,t){t=Ho(t);let r=Ra[t.name];if(!r)return Ma(e,"text/plain");let i=r(e,t);if(Ii.hasOwnProperty(t.name)){let n=Ii[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 Ii={};function mS(e,t){let r=Ii.hasOwnProperty(e)?Ii[e]:Ii[e]={};ni(t,r)}function Zr(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 Na(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 oh(e,t,r){return e.startState?e.startState(t,r):!0}var vS=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)}},Sl=vS;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 cs(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 Kr(e,t){let r=e.first;e:do{for(let n=0;n=e.first&&tr?F(r,ee(e,r).text.length):xS(t,ee(e,t.line).text.length)}function xS(e,t){let r=e.ch;return r==null||r>t?F(e.line,t):r<0?F(e.line,0):e}function Cf(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 Uo?new xn(e,Zr(e.mode,t.state),r,t.lookAhead):new xn(e,Zr(e.mode,t),r)}save(e){let t=e!==!1?Zr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Uo(t,this.maxLookAhead):t}};function sh(e,t,r,i){let n=[e.state.modeGen],o={};Lf(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&&Zr(e.doc.mode,i.state),o=sh(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 io(e,t,r){let i=e.doc,n=e.display;if(!i.mode.startState)return new xn(i,!0,t);let o=SS(e,t,r),l=o>i.first&&ee(i,o-1).stateAfter,s=l?xn.fromSaved(i,l,o):new xn(i,oh(i.mode),o);return i.iter(o,t,a=>{Ia(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 Tf=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 kf(e,t,r,i){let n=e.doc,o=n.mode,l;t=ae(n,t);let s=ee(n,t.line),a=io(e,t.line,r),u=new Sl(s.text,e.options.tabSize,a),d;for(i&&(d=[]);(i||u.pose.options.maxHighlightLength?(s=!1,l&&Ia(e,t,i,d.pos),d.pos=t.length,h=null):h=Af(Oa(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 Uo?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 _S(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierr;i--){let n=ee(e,i).stateAfter;if(n&&(!(n instanceof Uo)||i+n.lookAhead=t:o.to>t);(i||(i=[])).push(new Cl(l,o.from,a?null:o.to))}}return i}function LS(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 ch(e){let t=e.markedSpans;if(t){for(let r=0;rt)&&(!i||Pa(i,o.marker)<0)&&(i=o.marker)}return i}function Mf(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=ph(e);)e=t.find(-1,!0).line;return e}function NS(e){let t;for(;t=Tl(e);)e=t.find(1,!0).line;return e}function $S(e){let t,r;for(;t=Tl(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Da(e,t){let r=ee(e,t),i=Qt(r);return r==i?t:Ae(i)}function gh(e,t){if(t>e.lastLine())return t;let r=ee(e,t),i;if(!Ar(e,r))return t;for(;i=Tl(r);)r=i.find(1,!0).line;return Ae(r)+1}function Ar(e,t){let r=dr&&t.markedSpans;if(r){for(let i,n=0;n{let n=Go(i);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=i)})}var Un=class{constructor(e,t,r){this.text=e,dh(this,t),this.height=r?r(this):1}lineNo(){return Ae(this)}};Vi(Un);function IS(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ch(e),dh(e,r);let n=i?i(e):1;n!=e.height&&Zt(e,n)}function OS(e){e.parent=null,ch(e)}var PS={},DS={};function Nf(e,t){if(!e||/^\s*$/.test(e))return null;let r=t.addModeClass?DS:PS;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function wh(e,t){let r=$i("span",null,null,it?"padding-right: .1px":null),i={pre:$i("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=FS,hS(e.display.measure)&&(l=br(o,e.doc.direction))&&(i.addToken=HS(i.addToken,l)),i.map=[];let s=t!=e.display.externalMeasured&&Ae(o);US(o,i,ah(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=ls(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=ls(o.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(dS(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=ls(i.pre.className,i.textClass||"")),i}function BS(e){let t=ie("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function FS(e,t,r,i,n,o,l){if(!t)return;let s=e.splitSpaces?WS(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&&Pe<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&&Pe<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",Ta(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&&Pe<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 WS(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 $f(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 US(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||Pa(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=Nf(r[a++],t.cm.options)}}}function yh(e,t,r){this.line=t,this.rest=$S(t),this.size=this.rest?Ae(Ce(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ar(e,t)}function Ao(e,t,r){let i=[],n;for(let o=t;or[o].apply(null,i))}function qS(){let e=Sn;Sn=null;for(let t=0;t2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function _h(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 QS(e,t){t=Qt(t);let r=Ae(t),i=e.display.externalMeasured=new yh(e.doc,t,r);i.lineN=r;let n=i.built=wh(e,i);return i.text=n.pre,bt(e.display.lineMeasure,n.pre),i}function Eh(e,t,r,i){return tr(e,Yi(e,t),r,i)}function Ua(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 t_(e,t,r,i){let n=Th(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&&Os(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&&Pe<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=Ch}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=Bn(s,a,u),g=hn,p=d(a,h,u=="before");return g!=null&&(p.other=d(a,g,u!="before")),p}function Pf(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)+kl(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function Us(e,t,r,i,n){let o=F(e,t,r);return o.xRel=n,i&&(o.outside=i),o}function za(e,t,r){let i=e.doc;if(r+=e.display.viewOffset,r<0)return Us(i.first,0,null,-1,-1);let n=Kr(i,r),o=i.first+i.size-1;if(n>o)return Us(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=i_(e,l,n,t,r),a=MS(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 Mh(e,t,r,i){i-=ja(t);let n=t.text.length,o=Dn(l=>tr(e,r,l-1).bottom<=i,n,0);return n=Dn(l=>tr(e,r,l).top>i,o,n),{begin:o,end:n}}function Nh(e,t,r,i){r||(r=Yi(e,t));let n=Al(e,t,tr(e,r,i),"line").top;return Mh(e,t,r,n)}function js(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function i_(e,t,r,i,n){n-=hr(t);let o=Yi(e,t),l=ja(t),s=0,a=t.text.length,u=!0,d=br(t,e.doc.direction);if(d){let R=(e.options.lineWrapping?o_:n_)(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=Dn(R=>{let A=tr(e,o,R);return A.top+=l,A.bottom+=l,js(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=eh(t.text,p,1),Us(r,p,C,T,i-m)}function n_(e,t,r,i,n,o,l){let s=Dn(u=>{let d=n[u],h=d.level!=1;return js(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);js(d,o,l,!0)&&d.top>l&&(a=n[s-1])}return a}function o_(e,t,r,i,n,o,l){let{begin:s,end:a}=Mh(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 Hr;function Ui(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Hr==null){Hr=ie("pre",null,"CodeMirror-line-like");for(let r=0;r<49;++r)Hr.appendChild(document.createTextNode("x")),Hr.appendChild(ie("br"));Hr.appendChild(document.createTextNode("x"))}bt(e.measure,Hr);let t=Hr.offsetHeight/50;return t>3&&(e.cachedTextHeight=t),Tr(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 Ga(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:qa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function qa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $h(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(Ar(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 oi(e,t,r,i){let n=e.display;if(!r&&Aa(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=za(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-Sh(e.display).left)/Ji(e.display))-d))}return a}function li(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&&Da(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=yo(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=yo(e,t,t,-1);l?(n.view=n.view.slice(0,l.index),n.viewTo=l.lineN):xr(e)}else{let l=yo(e,t,t,-1),s=yo(e,r,r+i,1);l&&s?(n.view=n.view.slice(0,l.index).concat(Ao(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[li(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 yo(e,t,r,i){let n=li(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(;Da(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 l_(e,t,r){let i=e.display;i.view.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=Ao(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=Ao(e,t,i.viewFrom).concat(i.view):i.viewFromr&&(i.view=i.view.slice(0,li(e,r)))),i.viewTo=r}function Df(e){let t=e.display.view,r=0;for(let i=0;i=e.display.viewTo||s.to().line{let j=O=="ltr",P=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-P.top<=3){let we=(u?se:fe)&&be,xe=(u?fe:se)&&Le,J=we?s:(j?P:oe).left,X=xe?a:(j?oe:P).right;d(J,P.top,X-J,P.bottom)}else{let we,xe,J,X;j?(we=u&&se&&be?s:P.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:P.right,J=!u&&fe&&Le?s:oe.left,X=u?Z(S,O,"after"):a),d(we,P.top,xe-we,P.bottom),P.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 Ph(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ya(e))}function Va(e){e.state.delayingBlurEvent=!0,setTimeout(()=>{e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zi(e))},100)}function Ya(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,di(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()),Xa(e))}function Zi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,ci(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(()=>{e.state.focused||(e.display.shift=!1)},150))}function Ll(e){let t=e.display,r=t.lineDiv.offsetTop;for(let i=0;i.005||a<-.005)&&(Zt(n.line,l),Bf(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 Bf(e){if(e.widgets)for(let t=0;t=l&&(o=Kr(t,hr(ee(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function a_(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&&!iS){let o=ie("div","​",null,`position: absolute; + top: ${t.top-r.viewOffset-kl(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 u_(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=Ja(e,n),d=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(no(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(l=!0)),u.scrollLeft!=null&&(pi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return n}function f_(e,t){let r=Ja(e,t);r.scrollTop!=null&&no(e,r.scrollTop),r.scrollLeft!=null&&pi(e,r.scrollLeft)}function Ja(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=Ha(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);let s=e.doc.height+Wa(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=hi(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 Za(e,t){t!=null&&(Rl(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Qi(e){Rl(e);let t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function En(e,t,r){(t!=null||r!=null)&&Rl(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function c_(e,t){Rl(e),e.curOp.scrollToPos=t}function Rl(e){let t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;let r=Pf(e,t.from),i=Pf(e,t.to);Dh(e,r,i,t.margin)}}function Dh(e,t,r,i){let n=Ja(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});En(e,n.scrollLeft,n.scrollTop)}function no(e,t){Math.abs(e.doc.scrollTop-t)<2||(cr||zs(e,{top:t}),Bh(e,t,!0),cr&&zs(e),oo(e,100))}function Bh(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 pi(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,jh(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function qn(e){let t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Wa(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 d_=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&&Pe<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&&!rS?"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)}},h_=class{update(){return{bottom:0,right:0}}setScrollLeft(){}setScrollTop(){}clear(){}};function ji(e,t){t||(t=qn(e));let r=e.display.barWidth,i=e.display.barHeight;Ff(e,t);for(let n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&Ll(e),Ff(e,qn(e)),r=e.display.barWidth,i=e.display.barHeight}function Ff(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 Fh={native:d_,null:h_};function Wh(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ci(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fh[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"?pi(e,t):no(e,t)},e),e.display.scrollbars.addClass&&di(e.display.wrapper,e.display.scrollbars.addClass)}var p_=0;function gi(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:++p_},jS(e.curOp)}function wi(e){let t=e.curOp;t&&GS(t,r=>{for(let i=0;i=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Hh(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function y_(e){e.updatedDisplay=e.mustUpdate&&Qa(e.cm,e.update)}function b_(e){let t=e.cm,r=t.display;e.updatedDisplay&&Ll(t),e.barMeasure=qn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Eh(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-hi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function m_(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=io(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?Zr(t.mode,i.state):null,a=sh(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 oo(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&&Df(e)==0)return!1;zh(e)&&(xr(e),t.dims=Ga(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=Da(e.doc,o),l=gh(e.doc,l));let s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;l_(e,o,l),r.viewOffset=hr(ee(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";let a=Df(e);if(!s&&a==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;let u=__(e);return a>4&&(r.lineDiv.style.display="none"),C_(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,E_(u),Tr(r.cursorDiv),Tr(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,oo(e,400)),r.updateLineNumbers=null,!0}function Uh(e,t){let r=t.viewport;for(let i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==hi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Wa(e.display)-Ha(e),r.top)}),t.visible=qo(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=qo(e.display,e.doc,r));if(!Qa(e,t))break;Ll(e);let n=qn(e);_n(e),ji(e,n),tu(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 zs(e,t){let r=new Hh(e,t);if(Qa(e,r)){Ll(e),Uh(e,r);let i=qn(e);_n(e),ji(e,i),tu(e,i),r.finish()}}function C_(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),bh(e,h,u,r)),g&&(Tr(h.lineNumber),h.lineNumber.appendChild(document.createTextNode($a(e.options,u)))),l=h.node.nextSibling}u+=h.size}for(;l;)l=s(l)}function eu(e){let t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ke(e,"gutterChanged",e)}function tu(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 jh(e){let t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;let i=qa(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&&(gt=(gt*mo+h)/(mo+1),++mo)},200)):(o.wheelDX+=i,o.wheelDY+=n))}}var Or=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 El(this.anchor,this.head)}to(){return _l(this.anchor,this.head)}empty(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function Pt(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=El(s.from(),l.from()),d=_l(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 Or(t,r)}function Lr(e,t){return new Or([new Me(e,t||e)],0)}function Rr(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 Hf(e,t){if(ue(e,t.from)<0)return e;if(ue(e,t.to)<=0)return Rr(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+=Rr(t).ch-t.to.ch),F(r,i)}function ru(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,oo(e,100),e.state.modeGen++,e.curOp&&ut(e)}function Kh(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function iu(e,t,r,i){function n(C){return r?r[C]:null}function o(C,T,R){IS(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 Cr(e,t,r){function i(n,o,l){if(n.linked)for(let s=0;s{Vh(e),ut(e)})}function Lo(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 Ks(e,t){let r={from:Bs(t.from),to:Rr(t),text:Qr(e,t.from,t.to)};return jf(e,r,t.from.line,t.to.line+1),Cr(e,i=>jf(i,r,t.from.line,t.to.line+1),!0),r}function Yh(e){for(;e.length&&Ce(e).ranges;)e.pop()}function R_(e,t){if(t)return Yh(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 Jh(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=R_(n,n.lastOp==i)))s=Ce(l.changes),ue(t.from,t.to)==0&&ue(t.from,s.to)==0?s.to=Rr(t):l.changes.push(Ks(e,t));else{let a=Ce(n.done);for((!a||!a.ranges)&&Ko(e.sel,n.done),l={changes:[Ks(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 M_(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 N_(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||M_(e,o,Ce(n.done),t))?n.done[n.done.length-1]=t:Ko(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=r,i&&i.clearRedo!==!1&&Yh(n.undone)}function Ko(e,t){let r=Ce(t);r&&r.ranges&&r.equals(e)||t.push(e)}function jf(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){if(!e)return null;let t;for(let r=0;r-1&&(Ce(a)[n]=d[n],delete d[n])}}return i}function nu(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 Ml(e,t,r,i,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Je(e,new Or([nu(e.sel.primary(),t,r,n)],0),i)}function Gf(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=Kf(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 ki(e,g,t,i,n)}let h=a.find(i<0?-1:1);return(i<0?u:d)&&(h=Kf(e,h,i,h.line==t.line?o:null)),h?ki(e,h,t,i,n):null}}return t}function Xo(e,t,r,i,n){let o=i||1,l=ki(e,t,r,o,n)||!n&&ki(e,t,r,o,!0)||ki(e,t,r,-o,n)||!n&&ki(e,t,r,-o,!0);return l||(e.cantEdit=!0,F(e.first,0))}function Kf(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=ip(e,t,!0),!t))return;let i=fh&&!r&&RS(e,t.from,t.to);if(i)for(let n=i.length-1;n>=0;--n)Xf(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else Xf(e,t)}function Xf(e,t){if(t.text.length==1&&t.text[0]==""&&ue(t.from,t.to)==0)return;let r=ru(e,t);Jh(e,t,r,e.cm?e.cm.curOp.id:NaN),Kn(e,t,r,Fs(e,t));let i=[];Cr(e,(n,o)=>{!o&&Ze(i,n.history)==-1&&(np(n.history,t),i.push(n.history)),Kn(n,t,null,Fs(n,t))})}function vo(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&&!ip(e,p,!1)){s.length=0;return}d.push(Ks(e,p));let m=g?ru(e,p):Ce(s);Kn(e,p,m,zf(e,p)),!g&&e.cm&&e.cm.scrollIntoView({from:p.from,to:Rr(p)});let C=[];Cr(e,(T,R)=>{!R&&Ze(C,T.history)==-1&&(np(T.history,p),C.push(T.history)),Kn(T,p,null,zf(T,p))})}}function Vf(e,t){if(t!=0&&(e.first+=t,e.sel=new Or(xl(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=Qr(e,t.from,t.to),r||(r=ru(e,t)),e.cm?P_(e.cm,t,i):iu(e,t,i),Nl(e,r,Jt),e.cantEdit&&Xo(e,F(e.firstLine(),0))&&(e.cantEdit=!1)}function P_(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&&rh(e),iu(i,t,r,$h(e)),e.options.lineWrapping||(i.iter(a,o.line+t.text.length,g=>{let p=Go(g);p>n.maxLineLength&&(n.maxLine=g,n.maxLineLength=p,n.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),_S(i,o.line),oo(e,400);let u=t.text.length-(l.line-o.line)-1;t.full?ut(e):o.line==l.line&&t.text.length==1&&!Kh(e.doc,t)?Ir(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 Yf(e,t,r,i){r1||!(this.children[0]instanceof Cn))){let r=[];this.collapse(r),this.children=[new Cn(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{Zf(e,r,-n),Ir(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=zn(this)-e;i&&(Ar(this.doc,r)||Zt(r,r.height+i),t&&dt(t,()=>{t.curOp.forceUpdate=!0,Zf(t,r,i),Ke(t,"lineWidgetChanged",t,this,Ae(r))}))}};Vi(lu);function Zf(e,t,r){hr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Za(e,r)}function D_(e,t,r,i){let n=new lu(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&&!Ar(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&&ep(e.doc)),e&&Ke(e,"markerCleared",e,this,r,i),t&&wi(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=Ua(r,n);if(o&&(kh(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ar(t.doc,i)&&t.height!=null){let l=t.height;t.height=null;let s=zn(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(su);function Gi(e,t,r,i,n){if(i&&i.shared)return B_(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return qe(e.cm,Gi)(e,t,r,i,n);let o=new su(e,n),l=ue(t,r);if(i&&ni(i,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=$i("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Mf(e,t.line,t,r,o)||t.line!=r.line&&Mf(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");CS()}o.addToHistory&&Jh(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),kS(d,new Cl(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,d=>{Ar(e,d)&&Zt(d,0)}),o.clearOnEnter&&ne(o,"beforeCursorEnter",()=>o.clear()),o.readOnly&&(ES(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++op,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++)Ir(a,d,"text");o.atomic&&ep(a.doc),Ke(a,"markerAdded",a,o)}return o}var au=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 F_(e,t){for(let r=0;ri.push(n));for(let n=0;n=0;l--)zi(this,i[l]);o?Zh(this,o):this.cm&&Qi(this.cm)}),undo:je(function(){vo(this,"undo")}),redo:je(function(){vo(this,"redo")}),undoSelection:je(function(){vo(this,"undo",!0)}),redoSelection:je(function(){vo(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:xi(this.history.done),undone:xi(this.history.undone)}},setHistory:function(e){let t=this.history=new Lo(this.history);t.done=xi(e.done.slice(0),null,!0),t.undone=xi(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&&Ef(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,Ef(t.gutterMarkers)&&(t.gutterMarkers=null),!0))})}),lineInfo:function(e){let t;if(typeof e=="number"){if(!Wn(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 D_(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(cs(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 Lo(null),e.history.done=xi(this.history.done,t),e.history.undone=xi(this.history.undone,t)}},iterLinkedDocs:function(e){Cr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):La(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&&L_(this.cm))})});sr.prototype.eachLine=sr.prototype.iter;var ei=sr,lp=0;function U_(e){let t=this;if(sp(t),ze(t,e)||pr(t.display,e))return;at(e),ye&&(lp=+new Date);let r=oi(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),Zh(t.doc,Lr(ae(t.doc,r),ae(t.doc,Rr(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()),Nl(t.doc,Lr(r,r)),o)for(let l=0;l{for(let i=0;i{e==null&&(e=setTimeout(()=>{e=null,ec(K_)},100))}),ne(window,"blur",()=>ec(Zi))}function K_(e){let t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}var Mr={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++)Mr[e+48]=Mr[e+96]=String(e);for(let e=65;e<=90;e++)Mr[e]=String.fromCharCode(e);for(let e=1;e<=12;e++)Mr[e+111]=Mr[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 X_(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 uu(e,t,r){let i=eh(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Xs(e,t,r){let i=uu(e,t.ch,r);return i==null?null:new F(t.line,i,r<0?"after":"before")}function fu(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=Dn(g=>tr(t,d,g).top==h,n<0==(l.level==1)?l.from:l.to-1,u),a=="before"&&(u=uu(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 Y_(e,t,r,i){let n=br(t,e.doc.direction);if(!n)return Xs(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=Bn(n,r.ch,r.sticky),l=n[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(i>0?l.to>r.ch:l.fromuu(t,m instanceof F?m.ch:m,C),a,u=m=>e.options.lineWrapping?(a=a||Yi(e,t),Nh(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 Xn={selectAll:rp,singleSelection:e=>e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Jt),killLine:e=>Ei(e,t=>{if(t.empty()){let r=ee(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.lineEi(e,t=>({from:F(t.from().line,0),to:ae(e.doc,F(t.to().line+1,0))})),delLineLeft:e=>Ei(e,t=>({from:F(t.from().line,0),to:t.from()})),delWrappedLineLeft:e=>Ei(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=>Ei(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=>cp(e,t.head.line),{origin:"+move",bias:1}),goLineStartSmart:e=>e.extendSelectionsBy(t=>rc(e,t.head),{origin:"+move",bias:1}),goLineEnd:e=>e.extendSelectionsBy(t=>J_(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")},vn),goLineLeft:e=>e.extendSelectionsBy(t=>{let r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},vn),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 cp(e,t){let r=ee(e.doc,t),i=Qt(r);return i!=r&&(t=Ae(i)),fu(!0,e,i,t,1)}function J_(e,t){let r=ee(e.doc,t),i=NS(r);return i!=r&&(t=Ae(i)),fu(!0,e,r,t,-1)}function rc(e,t){let r=cp(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 Ro(e,t,r){if(typeof t=="string"&&(t=Xn[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)!=vl}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}function Z_(e,t,r){for(let i=0;i{e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),ic(e,n+" "+t,r,i))return!0}return ic(e,t,r,i)}function ic(e,t,r,i){let n=Z_(e,t,i);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Ke(e,"keyHandled",e,t,r),(n=="handled"||n=="multi")&&(at(r),Xa(e)),!!n}function dp(e,t){let r=fp(t,!0);return r?t.shiftKey&&!e.state.keySeq?kn(e,"Shift-"+r,t,i=>Ro(e,i,!0))||kn(e,r,t,i=>{if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return Ro(e,i)}):kn(e,r,t,i=>Ro(e,i)):!1}function eE(e,t,r){return kn(e,"'"+r+"'",t,i=>Ro(e,i,!0))}var Vs=null;function hp(e){let t=this;if(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=Et(),ze(t,e)))return;ye&&Pe<11&&e.keyCode==27&&(e.returnValue=!1);let r=e.keyCode;t.display.shift=r==16||e.shiftKey;let i=dp(t,e);Dt&&(Vs=i?r:null,!i&&r==88&&!gS&&(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)&&tE(t)}function tE(e){let t=e.display.lineDiv;di(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(ci(t,"CodeMirror-crosshair"),wt(document,"keyup",r),wt(document,"mouseover",r))}ne(document,"keyup",r),ne(document,"mouseover",r)}function pp(e){e.keyCode==16&&(this.doc.sel.shift=!1),ze(this,e)}function gp(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(Dt&&r==Vs){Vs=null,at(e);return}if(Dt&&(!e.which||e.which<10)&&dp(t,e))return;let n=String.fromCharCode(i??r);n!="\b"&&(eE(t,e,n)||t.display.input.onKeyPress(e))}var rE=400,nc=class{constructor(e,t,r){this.time=e,this.pos=t,this.button=r}compare(e,t,r){return this.time+rE>e&&ue(t,this.pos)==0&&r==this.button}},an,un;function iE(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 nc(r,e,t),an=null,"double"):(an=new nc(r,e,t),un=null,"single")}function wp(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(Ys(t,e))return;let i=oi(t,e),n=nh(e),o=i?iE(i,n):"single";window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&nE(t,n,i,o,e))&&(n==1?i?lE(t,i,o,e):Aa(e)==r.scroller&&at(e):n==2?(i&&Ml(t.doc,i),setTimeout(()=>r.input.focus(),20)):n==3&&(Ea?t.display.input.onContextMenu(e):Va(t)))}function nE(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,kn(e,up(o,n),n,l=>{if(typeof l=="string"&&(l=Xn[l]),!l)return!1;let s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=l(e,r)!=vl}finally{e.state.suppressEdits=!1}return s})}function oE(e,t,r){let i=e.getOption("configureMouse"),n=i?i(e,t,r):{};if(n.unit==null){let o=nS?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 lE(e,t,r,i){ye?setTimeout(Ca(Ph,e),0):e.curOp.focus=Et();let n=oE(e,r,i),o=e.doc.sel,l;e.options.dragDrop&&cS&&!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)?sE(e,i,t,n):aE(e,i,t,n)}function sE(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:Va(e)),wt(n.wrapper.ownerDocument,"mouseup",l),wt(n.wrapper.ownerDocument,"mousemove",s),wt(n.scroller,"dragstart",a),wt(n.scroller,"drop",l),o||(at(u),i.addNew||Ml(e.doc,r,null,null,i.extend),it&&!bl||ye&&Pe==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 oc(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 aE(e,t,r,i){ye&&Va(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=oi(e,t,!0,!0),s=-1;else{let A=oc(e,r,i.unit);i.extend?l=nu(l,A.anchor,A.head,i.extend):l=A}i.addNew?s==-1?(s=u.length,Je(o,Pt(e,u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&i.unit=="char"&&!i.extend?(Je(o,Pt(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):ou(o,s,l,ss):(s=0,Je(o,new Or([l],0),ss),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=$s(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,$s(v,ce,H))))}N.length||N.push(new Me(r,r)),Je(o,Pt(e,a.ranges.slice(0,s).concat(N),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(A)}else{let N=l,H=oc(e,A,i.unit),U=N.anchor,Z;ue(H.anchor,U)>0?(Z=H.head,U=El(N.from(),H.anchor)):(Z=H.anchor,U=_l(N.to(),H.head));let le=a.ranges.slice(0);le[s]=uE(e,new Me(ae(o,U),Z)),Je(o,Pt(e,le,s),ss)}}let g=n.wrapper.getBoundingClientRect(),p=0;function m(A){let N=++p,H=oi(e,A,!0,i.unit=="rectangle");if(H)if(ue(H,d)!=0){e.curOp.focus=Et(),h(H);let U=qo(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()),wt(n.wrapper.ownerDocument,"mousemove",T),wt(n.wrapper.ownerDocument,"mouseup",R),o.history.lastSelOrigin=null}let T=qe(e,A=>{A.buttons===0||!nh(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 uE(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=Bn(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=Bn(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 yp(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 Ps(t);o-=s.top-l.viewOffset;for(let a=0;a=n){let d=Kr(e.doc,o),h=e.display.gutterSpecs[a];return He(e,r,e,d,h.className,t),Ps(t)}}}function Ys(e,t){return yp(e,t,"gutterClick",!0)}function lc(e,t){pr(e.display,t)||fE(e,t)||ze(e,t,"contextmenu")||Ea||e.display.input.onContextMenu(t)}function fE(e,t){return Tt(e,"gutterContextMenu")?yp(e,t,"gutterContextMenu",!1):!1}function bp(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gn(e)}var Ai={toString:function(){return"CodeMirror.Init"}},mp={},Mo={};function cE(e){let t=e.optionHandlers;function r(i,n,o,l){e.defaults[i]=n,o&&(t[i]=l?(s,a,u)=>{u!=Ai&&o(s,a,u)}:o)}e.defineOption=r,e.Init=Ai,r("value","",(i,n)=>i.setValue(n),!0),r("mode",null,(i,n)=>{i.doc.modeOption=n,qs(i)},!0),r("indentUnit",2,qs,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,i=>{pn(i),Gn(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!=Ai&&i.refresh()}),r("specialCharPlaceholder",BS,i=>i.refresh(),!0),r("electricChars",!0),r("inputStyle",On?"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",!oS),r("wholeLineUpdateBefore",!0),r("theme","default",i=>{bp(i),sn(i)},!0),r("keyMap","default",(i,n,o)=>{let l=Vo(n),s=o!=Ai&&Vo(o);s&&s.detach&&s.detach(i,l),l.attach&&l.attach(i,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,hE,!0),r("gutters",[],(i,n)=>{i.display.gutterSpecs=Gs(n,i.options.lineNumbers),sn(i)},!0),r("fixedGutter",!0,(i,n)=>{i.display.gutters.style.left=n?qa(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,i=>ji(i),!0),r("scrollbarStyle","native",i=>{Wh(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=Gs(i.options.gutters,n),sn(i)},!0),r("firstLineNumber",1,sn,!0),r("lineNumberFormatter",i=>i,sn,!0),r("showCursorWhenSelecting",!1,_n,!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,dE),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,_n,!0),r("singleCursorHeightPerLine",!0,_n,!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 dE(e,t,r){let i=r&&r!=Ai;if(!t!=!i){let n=e.display.dragFunctions,o=t?ne:wt;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 hE(e){e.options.lineWrapping?(di(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ci(e.display.wrapper,"CodeMirror-wrap"),Ba(e)),Ka(e),ut(e),Gn(e),setTimeout(()=>ji(e),100)}function De(e,t){if(!(this instanceof De))return new De(e,t);this.options=t=t?ni(t):{},ni(mp,t,!1);let r=t.value;typeof r=="string"?r=new ei(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;let i=new De.inputStyles[t.inputStyle](this),n=this.display=new T_(e,r,i,t);n.wrapper.CodeMirror=this,bp(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wh(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&&!On&&n.input.focus(),ye&&Pe<11&&setTimeout(()=>this.display.input.reset(!0),20),gE(this),G_(),gi(this),this.curOp.forceUpdate=!0,Xh(this,r),t.autofocus&&!On||this.hasFocus()?setTimeout(()=>{this.hasFocus()&&!this.state.focused&&Ya(this)},20):Zi(this);for(let o in Mo)Mo.hasOwnProperty(o)&&Mo[o](this,t[o],Ai);zh(this),t.finishInit&&t.finishInit(this);for(let o=0;o{if(ze(e,a))return;let u=oi(e,a);if(!u||Ys(e,a)||pr(e.display,a))return;at(a);let d=e.findWordAt(u);Ml(e.doc,d.anchor,d.head)})):ne(t.scroller,"dblclick",a=>ze(e,a)||at(a)),ne(t.scroller,"contextmenu",a=>lc(e,a)),ne(t.input.getField(),"contextmenu",a=>{t.scroller.contains(a.target)||lc(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)&&!Ys(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&&(no(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),ne(t.scroller,"mousewheel",a=>Wf(e,a)),ne(t.scroller,"DOMMouseScroll",a=>Wf(e,a)),ne(t.wrapper,"scroll",()=>t.wrapper.scrollTop=t.wrapper.scrollLeft=0),t.dragFunctions={enter:a=>{ze(e,a)||Fn(a)},over:a=>{ze(e,a)||(z_(e,a),Fn(a))},start:a=>j_(e,a),drop:qe(e,U_),leave:a=>{ze(e,a)||sp(e)}};let s=t.input.getField();ne(s,"keyup",a=>pp.call(e,a)),ne(s,"keydown",qe(e,hp)),ne(s,"keypress",qe(e,gp)),ne(s,"focus",a=>Ya(e,a)),ne(s,"blur",a=>Zi(e,a))}var Js=[];De.defineInitHook=e=>Js.push(e);function An(e,t,r,i){let n=e.doc,o;r==null&&(r="add"),r=="smart"&&(n.mode.indent?o=io(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==vl||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=La(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&&xp(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function vp(e,t){let r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&dt(t,()=>cu(t,r,0,null,"paste")),!0}function xp(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=An(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=An(e,n.head.line,"smart"));l&&Ke(e,"electricInput",e,n.head.line)}}function Sp(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&&(An(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&&ou(this.doc,l,new Me(a,h[l].to()),Jt)}}}),getTokenAt:function(i,n){return kf(this,i,n)},getLineTokens:function(i,n){return kf(this,F(i),n,!0)},getTokenTypeAt:function(i){i=ae(this.doc,i);let n=ah(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 Al(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&&f_(this,{left:d,top:u,right:d+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:rt(hp),triggerOnKeyPress:rt(gp),triggerOnKeyUp:pp,triggerOnMouseDown:rt(wp),execCommand:function(i){if(Xn.hasOwnProperty(i))return Xn[i].call(null,this)},triggerElectric:rt(function(i){xp(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()?ds(this.doc,o.head,i,n,this.options.rtlMoveVisually):i<0?o.from():o.to(),vn)}),deleteH:rt(function(i,n){let o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):Ei(this,s=>{let a=ds(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=sc(this,u,i,n);return n=="page"&&a==o.sel.primary()&&Za(this,Hs(this,d,"div").top-u.top),d},vn),l.length)for(let a=0;ako(h,a):/\s/.test(u)?h=>/\s/.test(h):h=>!/\s/.test(h)&&!ko(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&&Ah(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)&&Ka(this),He(this,"refresh",this)}),swapDoc:rt(function(i){let n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Xh(this,i),Gn(this),this.display.input.reset(),En(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 ds(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=Y_(e.cm,s,t,r):p=Xs(s,t,r);if(p==null)if(!g&&u())t=fu(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=ko(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=Xo(e,t,o,l,!0);return Ds(o,h)&&(h.hitSide=!0),h}function sc(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=za(e,o,l),!!s.outside;){if(r<0?l<=0:l>=n.height){s.hitSide=!0;break}l+=r*5}return s}var Cp=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,_p(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)||vp(l,r)||Pe<=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())Yo({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){let d=Sp(r);Yo({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=Ep(),a=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),a.value=It.text.join(` +`);let u=Et();Pn(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=Ih(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&&ac(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 kr(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(ml&&yl&&this.cm.display.gutterSpecs.length&&bE(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=xo(t,e.anchorNode,e.anchorOffset),i=xo(t,e.focusNode,e.focusOffset);r&&i&&dt(t,()=>{Je(t.doc,Lr(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=li(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=li(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(mE(e,s,d,l,u)),g=Qr(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,cu)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))}readOnlyChanged(e){this.div.contentEditable=String(e!="nocursor")}onContextMenu(){}resetPosition(){}},yE=Cp;Cp.prototype.needsContentAttribute=!0;function ac(e,t){let r=Ua(e,t.line);if(!r||r.hidden)return null;let i=ee(e.doc,t.line),n=_h(r,i,t.line),o=br(i,e.doc.direction),l="left";o&&(l=Bn(o,t.ch)%2?"right":"left");let s=Th(n.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function bE(e){for(let t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ci(e,t){return t&&(e.bad=!0),e}function mE(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(Qr(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&&Pe>=9&&this.hasSelection&&(this.hasSelection=null),t.poll()}),ne(i,"paste",o=>{ze(r,o)||vp(o,r)||(r.state.pasteIncoming=+new Date,t.fastPoll())});function n(o){if(!ze(r,o)){if(r.somethingSelected())Yo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){let l=Sp(r);Yo({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,Jt):(t.prevInput="",i.value=l.text.join(` +`),Pn(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=Ep(),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=Ih(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&&Pn(this.textarea),ye&&Pe>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",ye&&Pe>=9&&(this.hasSelection=null))}getField(){return this.textarea}supportsTouch(){return!1}focus(){if(this.cm.options.readOnly!="nocursor"&&(!On||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||pS(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&&Pe>=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{cu(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&&Pe>=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=oi(r,e),l=i.scroller.scrollTop;if(!o||Dt)return;r.options.resetSelectionOnContextMenu&&r.doc.sel.contains(o)==-1&&qe(r,Je)(r.doc,Lr(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&&Pe<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),n.selectionStart!=null)){(!ye||ye&&Pe<9)&&g();let m=0,C=()=>{i.selForContextMenu==r.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"?qe(r,rp)(r):m++<10?i.detectingSelectAll=setTimeout(C,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(C,200)}}if(ye&&Pe>=9&&g(),Ea){Fn(e);let m=()=>{wt(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(){}},xE=Tp;Tp.prototype.needsContentAttribute=!1;function SE(e,t){if(t=t?ni(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&&(wt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";let n=De(o=>e.parentNode.insertBefore(o,e.nextSibling),t);return n}function _E(e){e.off=wt,e.on=ne,e.wheelEventPixels=k_,e.Doc=ei,e.splitLines=La,e.countColumn=_t,e.findColumn=$s,e.isWordChar=Is,e.Pass=vl,e.signal=He,e.Line=Un,e.changeEnd=Rr,e.scrollbarModel=Fh,e.Pos=F,e.cmpPos=ue,e.modes=Ra,e.mimeModes=Ti,e.resolveMode=Ho,e.getMode=Ma,e.modeExtensions=Ii,e.extendMode=mS,e.copyState=Zr,e.startState=oh,e.innerMode=Na,e.commands=Xn,e.keyMap=ar,e.keyName=fp,e.isModifierKey=ap,e.lookupKey=Pi,e.normalizeKeyMap=V_,e.StringStream=Sl,e.SharedTextMarker=au,e.TextMarker=su,e.LineWidget=lu,e.e_preventDefault=at,e.e_stopPropagation=ih,e.e_stop=Fn,e.addClass=di,e.contains=kr,e.rmClass=ci,e.keyNames=Mr}cE(De);wE(De);var EE="iter insert remove copy getEditor constructor".split(" ");for(let e in ei.prototype)ei.prototype.hasOwnProperty(e)&&Ze(EE,e)<0&&(De.prototype[e]=function(t){return function(){return t.apply(this.doc,arguments)}}(ei.prototype[e]));Vi(ei);De.inputStyles={textarea:xE,contenteditable:yE};De.defineMode=function(e){!De.defaults.mode&&e!="null"&&(De.defaults.mode=e),yS.apply(this,arguments)};De.defineMIME=bS;De.defineMode("null",()=>({token:e=>e.skipToEnd()}));De.defineMIME("text/plain","null");De.defineExtension=(e,t)=>{De.prototype[e]=t};De.defineDocExtension=(e,t)=>{ei.prototype[e]=t};De.fromTextArea=SE;_E(De);De.version="5.61.0";var No=De;document.body.insertAdjacentHTML("beforeend",` + +`);self.CodeMirror=No;var Zs=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=Zs.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=Zs.dedentText(n.innerHTML),i=i.replace(/<(\/?script)(.*?)>/g,"<$1$2>"));let o=No.defaults.viewportMargin;if(this.hasAttribute("viewport-margin")){const l=this.getAttribute("viewport-margin").toLowerCase();o=l==="infinity"?1/0:parseInt(l)}this.editor=No.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(No.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 CE(e,t,r){return r===void 0?uc(e,t,!1):uc(e,r,t!==!1)}const mr=Symbol("Initial value"),hs=Symbol("Editor dirty"),or=Symbol("ParseHandler");function TE(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 kE extends Li{static get styles(){return hc` + :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 TE(()=>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()=>(this.prefixes||"").split(",").map(r=>r.trim()).reduce((r,i)=>i in Rs?{...r,[i]:Rs[i]().value}:r,{})}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 bc`${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[hs]=!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]=CE(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[hs]&&await this.parse(),this[hs]=!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"),D=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:D,do:D,try:D,finally:D,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,D,z=!1;(D=w.next())!=null;){if(!_){if(D=="/"&&!z)return;D=="["?z=!0:z&&D=="]"&&(z=!1)}_=!_&&D=="\\"}}var g,p;function m(w,_,D){return g=w,p=D,_}function C(w,_){var D=w.next();if(D=='"'||D=="'")return _.tokenize=T(D),_.tokenize(w,_);if(D=="."&&w.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if(D=="."&&w.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(D))return m(D);if(D=="="&&w.eat(">"))return m("=>","operator");if(D=="0"&&w.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(D))return w.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if(D=="/")return w.eat("*")?(_.tokenize=R,R(w,_)):w.eat("/")?(w.skipToEnd(),m("comment","comment")):hu(w,_,1)?(h(w),w.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(w.eat("="),m("operator","operator",w.current()));if(D=="`")return _.tokenize=A,A(w,_);if(D=="#")return w.skipToEnd(),m("error","error");if(D=="<"&&w.match("!--")||D=="-"&&w.match("->"))return w.skipToEnd(),m("comment","comment");if(u.test(D))return(D!=">"||!_.lexical||_.lexical.type!=">")&&(w.eat("=")?(D=="!"||D=="=")&&w.eat("="):/[<>*+\-]/.test(D)&&(w.eat(D),D==">"&&w.eat(D))),m("operator","operator",w.current());if(s.test(D)){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(_,D){var z=!1,de;if(n&&_.peek()=="@"&&_.match(d))return D.tokenize=C,m("jsonld-keyword","meta");for(;(de=_.next())!=null&&!(de==w&&!z);)z=!z&&de=="\\";return z||(D.tokenize=C),m("string","string")}}function R(w,_){for(var D=!1,z;z=w.next();){if(z=="/"&&D){_.tokenize=C;break}D=z=="*"}return m("comment","comment")}function A(w,_){for(var D=!1,z;(z=w.next())!=null;){if(!D&&(z=="`"||z=="$"&&w.eat("{"))){_.tokenize=C;break}D=!D&&z=="\\"}return m("quasi","string-2",w.current())}var N="([{}])";function H(w,_){_.fatArrowAt&&(_.fatArrowAt=null);var D=w.string.indexOf("=>",w.start);if(!(D<0)){if(l){var z=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(w.string.slice(w.start,D));z&&(D=z.index)}for(var de=0,ve=!1,Oe=D-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 Mp=w.string.charAt(Oe-1);if(Mp==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,_,D,z,de,ve){this.indented=w,this.column=_,this.type=D,this.prev=de,this.info=ve,z!=null&&(this.align=z)}function le(w,_){for(var D=w.localVars;D;D=D.next)if(D.name==_)return!0;for(var z=w.context;z;z=z.prev)for(var D=z.vars;D;D=D.next)if(D.name==_)return!0}function ce(w,_,D,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(D,z)){for(;ve.length&&ve[ve.length-1].lex;)ve.pop()();return S.marked?S.marked:D=="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 D=_;D;D=D.next)if(D.name==w)return!0;return!1}function P(w){var _=S.state;if(S.marked="def",_.context){if(_.lexical.info=="var"&&_.context&&_.context.block){var D=oe(w,_.context);if(D!=null){_.context=D;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 D=oe(w,_.prev);return D?D==_.prev?_:new fe(D,_.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,_,D){this.prev=w,this.vars=_,this.block=D}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 D=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 D.lex=!0,D}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 _(D){return D==w?v():w==";"||D=="}"||D==")"||D=="]"?O():v(_)}return _}function Se(w,_){return w=="var"?v(X("vardef",_),yi,re(";"),G):w=="keyword a"?v(X("form"),pt,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"),pt,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(du):_=="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"),pt,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 pt(w){return w!="("?O():v(X(")"),ge,re(")"),G)}function ir(w,_,D){if(S.state.fatArrowAt==S.stream.start){var z=D?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=D?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(D?Ne:ge):w=="("?v(X(")"),Rt,re(")"),G,de):w=="operator"||w=="spread"?v(D?Ne:ge):w=="["?v(X("]"),Ap,G,de):w=="{"?y(Ye,"}",null,de):w=="quasi"?O(M,de):w=="new"?v(Re(D)):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,_,D){var z=D==!1?et:L,de=D==!1?ge:Ne;if(w=="=>")return v(we,D?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(Pr);var D;return l&&S.state.fatArrowAt==S.stream.start&&(D=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+D[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 Pr(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,_,D){function z(de,ve){if(D?D.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():D&&D.indexOf(";")>-1?O(w):v(re(_))}return function(de,ve){return de==_||ve==_?v():O(w,z)}}function y(w,_,D){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,$l)}function $l(w,_){if(_=="=")return v(I)}function yi(w,_){return _=="enum"?(S.marked="keyword",v(du)):O(ot,c,vt,so)}function ot(w,_){if(l&&se(_))return S.marked="keyword",v(ot);if(w=="variable")return P(_),v();if(w=="spread")return v(ot);if(w=="[")return y(Il,"]");if(w=="{")return y(lo,"}")}function lo(w,_){return w=="variable"&&!S.stream.match(/^\s*:/,!1)?(P(_),v(vt)):(w=="variable"&&(S.marked="property"),w=="spread"?v(ot):w=="}"?O():w=="["?v(ge,re("]"),re(":"),lo):v(re(":"),ot,vt))}function Il(){return O(ot,vt)}function vt(w,_){if(_=="=")return v(Ne)}function so(w){if(w==",")return v(yi)}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(yi,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 P(_),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 P(_),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,_):bi(w,_)}function tn(w,_){if(w=="variable")return P(_),v(bi)}function bi(w,_){if(_=="<")return v(X(">"),Fe(Dr,">"),G,bi);if(_=="extends"||_=="implements"||l&&w==",")return _=="implements"&&(S.marked="keyword"),v(l?I:ge,bi);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?Br:V,xt);if(w=="number"||w=="string")return v(l?Br:V,xt);if(w=="[")return v(ge,c,re("]"),l?Br: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 Br(w,_){if(_=="?")return v(Br);if(w==":")return v(I,vt);if(_=="=")return v(Ne);var D=S.state.lexical.prev,z=D&&D.info=="interface";return O(z?Be:V)}function rn(w,_){return _=="*"?(S.marked="keyword",v(Ol,re(";"))):_=="default"?(S.marked="keyword",v(ge,re(";"))):w=="{"?v(Fe(mi,"}"),Ol,re(";")):O(Se)}function mi(w,_){if(_=="as")return S.marked="keyword",v(re("variable"));if(w=="variable")return O(Ne,mi)}function nn(w){return w=="string"?v():w=="("?O(ge):O(Ht,Ut,Ol)}function Ht(w,_){return w=="{"?y(Ht,"}"):(w=="variable"&&P(_),_=="*"&&(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 Ol(w,_){if(_=="from")return S.marked="keyword",v(ge)}function Ap(w){return w=="]"?v():O(Fe(Ne,"]"))}function du(){return O(X("form"),ot,re("{"),X("}"),Fe(Lp,"}"),G,G)}function Lp(){return O(ot,vt)}function Rp(w,_){return w.lastType=="operator"||w.lastType==","||u.test(_.charAt(0))||/[,.]/.test(_.charAt(0))}function hu(w,_,D){return _.tokenize==C&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(_.lastType)||_.lastType=="quasi"&&/\{\s*$/.test(w.string.slice(0,w.pos-(D||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 D=_.tokenize(w,_);return g=="comment"?D:(_.lastType=g=="operator"&&(p=="++"||p=="--")?"incdec":g,ce(_,D,g,p,w))},indent:function(w,_){if(w.tokenize==R)return CodeMirror.Pass;if(w.tokenize!=C)return 0;var D=_&&_.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")&&(D=="}"||(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=D==st;return st=="vardef"?z.indented+(w.lastType=="operator"||w.lastType==","?z.info.length+1:0):st=="form"&&D=="{"?z.indented:st=="form"?z.indented+r:st=="stat"?z.indented+(Rp(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:hu,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 AE={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},LE={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?AE:LE;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 P;return S.eat("#")?S.eat("x")?P=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):P=S.eatWhile(/[\d]/)&&S.eat(";"):P=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),P?"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,P=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,P==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 So=Symbol("parsed quads");class RE extends kE{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[So]}set quads(t){if(typeof t>"u"||t===null)return;const r=this[So];this[So]=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 yt(()=>import("./stream-CaRB5T9V.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[So]=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 yt(()=>import("./stream-CaRB5T9V.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 cc&&(r[n]=o,delete i[n]);this.dispatchEvent(new CustomEvent("prefixes-parsed",{detail:{prefixes:{...r,...i}}}))}}const kp=new ra([Zp,oa]);kp.formats.import(At);window.customElements.define("rdf-editor",class extends Jp(RE,kp){});class ME extends Li{static get properties(){return{input:{type:String},output:{type:Array}}}static get styles(){return hc` + :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 bc` +
+

Input

+ +
+ +
+

Output

+ +
+ `}async _translate(){this.output=this.renderRoot.querySelector("#input").quads}}customElements.define("rdfjs-elements-demos",ME);export{Ld as a,gr as b,BE as c,tl as e,rb as f,la as g,G1 as m,L1 as r,wd as s,ho as t}; diff --git a/converter/assets/index-xi1VyXRX.js b/converter/assets/index-xi1VyXRX.js new file mode 100644 index 00000000..339adb24 --- /dev/null +++ b/converter/assets/index-xi1VyXRX.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-eMmQoqsl.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/main-16Vam_JP.js b/converter/assets/main-16Vam_JP.js new file mode 100644 index 00000000..58c32e60 --- /dev/null +++ b/converter/assets/main-16Vam_JP.js @@ -0,0 +1,22 @@ +import{g,m as z}from"./index-eMmQoqsl.js";import{m as $}from"./main-CDN167a0.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-BYlbn3DA.js b/converter/assets/main-BYlbn3DA.js new file mode 100644 index 00000000..47d2b0ca --- /dev/null +++ b/converter/assets/main-BYlbn3DA.js @@ -0,0 +1,20 @@ +import{g as T,m as S}from"./index-eMmQoqsl.js";import{m as C}from"./main-lsZ9cb4d.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-CDN167a0.js b/converter/assets/main-CDN167a0.js new file mode 100644 index 00000000..b4091aa4 --- /dev/null +++ b/converter/assets/main-CDN167a0.js @@ -0,0 +1,4 @@ +import{m as o}from"./index-eMmQoqsl.js";import{m as f}from"./main-CL977LrX.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-CL977LrX.js b/converter/assets/main-CL977LrX.js new file mode 100644 index 00000000..07b302a3 --- /dev/null +++ b/converter/assets/main-CL977LrX.js @@ -0,0 +1,2 @@ +import{e as Ke,b as Le,r as Qe,s as Ce}from"./index-eMmQoqsl.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-CM6HleSx.js b/converter/assets/main-CM6HleSx.js new file mode 100644 index 00000000..bc635af5 --- /dev/null +++ b/converter/assets/main-CM6HleSx.js @@ -0,0 +1,13 @@ +import{g as P,m as U}from"./index-eMmQoqsl.js";import{m as z}from"./main-CL977LrX.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-DouyocZT.js b/converter/assets/main-DouyocZT.js new file mode 100644 index 00000000..afd992b2 --- /dev/null +++ b/converter/assets/main-DouyocZT.js @@ -0,0 +1,31 @@ +import{g as z,m as O}from"./index-eMmQoqsl.js";import{m as F}from"./main-lsZ9cb4d.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-MfGTL6Y1.js b/converter/assets/main-MfGTL6Y1.js new file mode 100644 index 00000000..f03c0280 --- /dev/null +++ b/converter/assets/main-MfGTL6Y1.js @@ -0,0 +1,14 @@ +import{c as Ss,g as As,s as ws,m as $s}from"./index-eMmQoqsl.js";import{m as Ds}from"./main-CL977LrX.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/main-lsZ9cb4d.js b/converter/assets/main-lsZ9cb4d.js new file mode 100644 index 00000000..98ef40ce --- /dev/null +++ b/converter/assets/main-lsZ9cb4d.js @@ -0,0 +1,3 @@ +import{m as p}from"./index-eMmQoqsl.js";import{m as w}from"./main-CDN167a0.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/readable-BmS1kvD9.js b/converter/assets/readable-BmS1kvD9.js new file mode 100644 index 00000000..535e6c15 --- /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-CaRB5T9V.js b/converter/assets/stream-CaRB5T9V.js new file mode 100644 index 00000000..3469f029 --- /dev/null +++ b/converter/assets/stream-CaRB5T9V.js @@ -0,0 +1 @@ +import{e as Te,b as ge,r as Me,s as me,g as Ft}from"./index-eMmQoqsl.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 00000000..1a68db0e --- /dev/null +++ b/converter/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + rdfjs-elements-demos + + + + + + + + + diff --git a/rdf-editor/assets/CustomJsonLdSerializer-KAw4S5Ct.js b/rdf-editor/assets/CustomJsonLdSerializer-KAw4S5Ct.js new file mode 100644 index 00000000..6217795e --- /dev/null +++ b/rdf-editor/assets/CustomJsonLdSerializer-KAw4S5Ct.js @@ -0,0 +1 @@ +import{S as u}from"./index-BOvYCoiN.js";import{a as l}from"./index-DJj1BX_N.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-DQIXAyrs.js b/rdf-editor/assets/CustomRdfXmlParser-DQIXAyrs.js new file mode 100644 index 00000000..29aa1385 --- /dev/null +++ b/rdf-editor/assets/CustomRdfXmlParser-DQIXAyrs.js @@ -0,0 +1,27 @@ +import{c as N,a as Kt}from"./index-DJj1BX_N.js";import{r as Yt,a as Zt}from"./index-rm4E9--V.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 00000000..596d467b --- /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 00000000..ee442835 --- /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-BJJSNifu.js b/rdf-editor/assets/index-BJJSNifu.js new file mode 100644 index 00000000..c1243e82 --- /dev/null +++ b/rdf-editor/assets/index-BJJSNifu.js @@ -0,0 +1,2 @@ +import{S as D}from"./index-BOvYCoiN.js";import{g as M,a as $,f as O}from"./index-DJj1BX_N.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-BOvYCoiN.js b/rdf-editor/assets/index-BOvYCoiN.js new file mode 100644 index 00000000..4a20221c --- /dev/null +++ b/rdf-editor/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/rdf-editor/assets/index-CEq2jXnX.js b/rdf-editor/assets/index-CEq2jXnX.js new file mode 100644 index 00000000..547beac6 --- /dev/null +++ b/rdf-editor/assets/index-CEq2jXnX.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-DJj1BX_N.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/rdf-editor/assets/index-DJj1BX_N.js b/rdf-editor/assets/index-DJj1BX_N.js new file mode 100644 index 00000000..9a1f1d38 --- /dev/null +++ b/rdf-editor/assets/index-DJj1BX_N.js @@ -0,0 +1,1433 @@ +const __vite__fileDeps=["assets/index-aMC0ki5N.js","assets/index-BOvYCoiN.js","assets/readable-BmS1kvD9.js","assets/index-rm4E9--V.js","assets/canonicalize-DMjjQ0zD.js","assets/index-BJJSNifu.js","assets/CustomRdfXmlParser-DQIXAyrs.js","assets/index-ORBAb9FT.js","assets/CustomJsonLdSerializer-KAw4S5Ct.js","assets/main-CIK5Qv2f.js","assets/main-CJU21JpY.js","assets/main-B9odckXT.js","assets/main-v_ERuz1K.js","assets/browser-BwSN-dYO.js","assets/main-CAnNLMtq.js","assets/main-CPXwvXK9.js","assets/main-DcSxf3zY.js","assets/main-5j51Jm6i.js","assets/index-CEq2jXnX.js","assets/stream-baiUdxpZ.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +var lv=Object.defineProperty;var av=(t,e,r)=>e in t?lv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var uh=(t,e,r)=>(av(t,typeof e!="symbol"?e+"":e,r),r);const Rm=Object.freeze(Object.defineProperty({__proto__:null,get _void(){return RR},get acl(){return tk},get as(){return ik},get bibo(){return sk},get cc(){return lk},get cert(){return uk},get cnt(){return fk},get constant(){return hk},get crm(){return gk},get csvw(){return yk},get ctag(){return wk},get dash(){return $k},get dashSparql(){return _k},get dbo(){return Ak},get dc11(){return kk},get dcam(){return Ck},get dcat(){return Lk},get dcmitype(){return Mk},get dcterms(){return Ok},get default(){return tf},get dig(){return Dk},get discipline(){return Uk},get doap(){return Hk},get dpv(){return zk},get dqv(){return Gk},get dtype(){return Kk},get duv(){return Xk},get earl(){return Zk},get ebucore(){return Qk},get exif(){return tT},get foaf(){return iT},get frbr(){return sT},get geo(){return lT},get geof(){return uT},get geor(){return fT},get gml(){return hT},get gn(){return gT},get gr(){return yT},get grddl(){return wT},get gs1(){return _T},get gtfs(){return $T},get http(){return AT},get hydra(){return kT},get ical(){return CT},get la(){return LT},get ldp(){return MT},get list(){return OT},get locn(){return DT},get log(){return UT},get lvont(){return HT},get m4i(){return zT},get ma(){return GT},get mads(){return KT},get math(){return XT},get oa(){return ZT},get og(){return QT},get oidc(){return tC},get org(){return iC},get owl(){return sC},get pim(){return lC},get prefix(){return uC},get prov(){return fC},get qb(){return hC},get qkdv(){return gC},get quantitykind(){return yC},get qudt(){return wC},get rdau(){return _C},get rdf(){return gr},get rdfa(){return SC},get rdfs(){return EC},get rev(){return TC},get rico(){return RC},get rif(){return zR},get rr(){return NC},get rss(){return IC},get schema(){return PC},get sd(){return BC},get sdmx(){return FC},get sem(){return WC},get set(){return jC},get sf(){return qC},get sh(){return VC},get shex(){return YC},get shsh(){return JC},get sioc(){return eR},get skos(){return rR},get skosxl(){return nR},get solid(){return oR},get sosa(){return aR},get sou(){return cR},get ssn(){return dR},get stat(){return pR},get string(){return mR},get test(){return bR},get time(){return vR},get unit(){return xR},get v(){return GR},get vaem(){return SR},get vann(){return ER},get vcard(){return TR},get vs(){return NR},get wdr(){return KR},get wdrs(){return IR},get wgs(){return PR},get xhv(){return BR},get xkos(){return FR},get xml(){return XR},get xsd(){return Ys}},Symbol.toStringTag,{value:"Module"}));(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();const pa=[],Lm=(t,e)=>{pa[t]=e},Zn=Object.freeze({HOST:"host",KNOB:"knob",SLOT:"slot",PREFIX:"prefix",SUFFIX:"suffix",WRAPPER:"wrapper"}),Zi=t=>t instanceof HTMLTemplateElement,Ef=(t,e)=>r=>{const{element:i,target:n}=r.dataset;return i===t&&n===e},Il=t=>Zi(t)?t.content.firstElementChild:null,Ds=(t,e,r)=>pa[t].find(Ef(e,r)),uv=(t,e,r)=>pa[t].filter(Ef(e,r)),mc=(t,e,r)=>pa[t].some(Ef(e,r));function Ye(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ml=window,kf=ml.ShadowRoot&&(ml.ShadyCSS===void 0||ml.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tf=Symbol(),ch=new WeakMap;let Nm=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Tf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(kf&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=ch.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ch.set(r,e))}return e}toString(){return this.cssText}};const cv=t=>new Nm(typeof t=="string"?t:t+"",void 0,Tf),fv=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new Nm(r,t,Tf)},dv=(t,e)=>{kf?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=ml.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},fh=kf?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return cv(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var su;const Ol=window,dh=Ol.trustedTypes,hv=dh?dh.emptyScript:"",hh=Ol.reactiveElementPolyfillSupport,yc={toAttribute(t,e){switch(e){case Boolean:t=t?hv:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Mm=(t,e)=>e!==t&&(e==e||t==t),ou={attribute:!0,type:String,converter:yc,reflect:!1,hasChanged:Mm},bc="finalized";let Mn=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=ou){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ou}static finalize(){if(this.hasOwnProperty(bc))return!1;this[bc]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=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(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(fh(n))}else e!==void 0&&r.push(fh(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return dv(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=ou){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:yc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:yc;this._$El=s,this[s]=l.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Mm)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===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(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Mn[bc]=!0,Mn.elementProperties=new Map,Mn.elementStyles=[],Mn.shadowRootOptions={mode:"open"},hh==null||hh({ReactiveElement:Mn}),((su=Ol.reactiveElementVersions)!==null&&su!==void 0?su:Ol.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var lu;const Pl=window,Jn=Pl.trustedTypes,ph=Jn?Jn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Dl="$lit$",Wr=`lit$${(Math.random()+"").slice(9)}$`,Cf="?"+Wr,pv=`<${Cf}>`,on=document,uo=()=>on.createComment(""),co=t=>t===null||typeof t!="object"&&typeof t!="function",Im=Array.isArray,Om=t=>Im(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",au=`[ +\f\r]`,Es=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gh=/-->/g,mh=/>/g,Li=RegExp(`>|${au}(?:([^\\s"'>=/]+)(${au}*=${au}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),yh=/'/g,bh=/"/g,Pm=/^(?:script|style|textarea|title)$/i,gv=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Bs=gv(1),mi=Symbol.for("lit-noChange"),dt=Symbol.for("lit-nothing"),wh=new WeakMap,zi=on.createTreeWalker(on,129,null,!1);function Dm(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ph!==void 0?ph.createHTML(e):e}const Bm=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=Es;for(let l=0;l"?(o=n??Es,f=-1):c[1]===void 0?f=-2:(f=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Li:c[3]==='"'?bh:yh):o===bh||o===yh?o=Li:o===gh||o===mh?o=Es:(o=Li,n=void 0);const p=o===Li&&t[l+1].startsWith("/>")?" ":"";s+=o===Es?a+pv:f>=0?(i.push(u),a.slice(0,f)+Dl+a.slice(f)+Wr+p):a+Wr+(f===-2?(i.push(void 0),l):p)}return[Dm(t,s+(t[r]||"")+(e===2?"":"")),i]};let wc=class Um{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[u,c]=Bm(e,r);if(this.el=Um.createElement(u,i),zi.currentNode=this.el.content,r===2){const f=this.el.content,g=f.firstChild;g.remove(),f.append(...g.childNodes)}for(;(n=zi.nextNode())!==null&&a.length0){n.textContent=Jn?Jn.emptyScript:"";for(let p=0;p2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=dt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=ln(this,e,r,0),o=!co(e)||e!==this._$AH&&e!==mi,o&&(this._$AH=e);else{const l=e;let a,u;for(e=s[0],a=0;a{var i,n;const s=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let o=s._$litPart$;if(o===void 0){const l=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=o=new ga(e.insertBefore(uo(),l),l,void 0,r??{})}return o._$AI(t),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var uu,cu;let Gs=class extends Mn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qm(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return mi}};Gs.finalized=!0,Gs._$litElement$=!0,(uu=globalThis.litElementHydrateSupport)===null||uu===void 0||uu.call(globalThis,{LitElement:Gs});const _h=globalThis.litElementPolyfillSupport;_h==null||_h({LitElement:Gs});((cu=globalThis.litElementVersions)!==null&&cu!==void 0?cu:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const bv=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},wv=(t,e,r)=>{e.constructor.createProperty(r,t)};function Km(t){return(e,r)=>r!==void 0?wv(t,e,r):bv(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const vv={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Vm=t=>(...e)=>({_$litDirective$:t,values:e});let Xm=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{I:_v}=yv,xv=t=>t===null||typeof t!="object"&&typeof t!="function",xh=(t,e)=>e===void 0?(t==null?void 0:t._$litType$)!==void 0:(t==null?void 0:t._$litType$)===e,$v=t=>{var e;return((e=t==null?void 0:t._$litType$)===null||e===void 0?void 0:e.h)!=null},Sv=t=>t.strings===void 0,$h=()=>document.createComment(""),Sh=(t,e,r)=>{var i;const n=t._$AA.parentNode,s=e===void 0?t._$AB:e._$AA;if(r===void 0){const o=n.insertBefore($h(),s),l=n.insertBefore($h(),s);r=new _v(o,l,t,t.options)}else{const o=r._$AB.nextSibling,l=r._$AM,a=l!==t;if(a){let u;(i=r._$AQ)===null||i===void 0||i.call(r,t),r._$AM=t,r._$AP!==void 0&&(u=t._$AU)!==l._$AU&&r._$AP(u)}if(o!==s||a){let u=r._$AA;for(;u!==o;){const c=u.nextSibling;n.insertBefore(u,s),u=c}}}return r},Av={},Ah=(t,e=Av)=>t._$AH=e,Eh=t=>t._$AH,Ev=t=>{t._$AR()};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const kh=t=>$v(t)?t._$litType$.h:t.strings,kv=Vm(class extends Xm{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){const r=xh(this.et)?kh(this.et):null,i=xh(e)?kh(e):null;if(r!==null&&(i===null||r!==i)){const n=Eh(t).pop();let s=this.tt.get(r);if(s===void 0){const o=document.createDocumentFragment();s=qm(dt,o),s.setConnected(!1),this.tt.set(r,s)}Ah(s,[n]),Sh(s,void 0,n)}if(i!==null){if(r===null||r!==i){const n=this.tt.get(i);if(n!==void 0){const s=Eh(n).pop();Ev(t),Sh(t,void 0,s),Ah(t,[s])}}this.et=e}else this.et=void 0;return this.render(e)}});/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const qs=(t,e)=>{var r,i;const n=t._$AN;if(n===void 0)return!1;for(const s of n)(i=(r=s)._$AO)===null||i===void 0||i.call(r,e,!1),qs(s,e);return!0},Bl=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while((r==null?void 0:r.size)===0)},Ym=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),Rv(e)}};function Tv(t){this._$AN!==void 0?(Bl(this),this._$AM=t,Ym(this)):this._$AM=t}function Cv(t,e=!1,r=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let s=r;s{var e,r,i,n;t.type==vv.CHILD&&((e=(i=t)._$AP)!==null&&e!==void 0||(i._$AP=Cv),(r=(n=t)._$AQ)!==null&&r!==void 0||(n._$AQ=Tv))};let Lv=class extends Xm{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,i){super._$AT(e,r,i),Ym(this),this.isConnected=e._$AU}_$AO(e,r=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)===null||i===void 0||i.call(this):(n=this.disconnected)===null||n===void 0||n.call(this)),r&&(qs(this,e),Bl(this))}setValue(e){if(Sv(this._$Ct))this._$Ct._$AI(e,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let Nv=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Mv=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var e;(e=this.Y)!==null&&e!==void 0||(this.Y=new Promise(r=>this.Z=r))}resume(){var e;(e=this.Z)===null||e===void 0||e.call(this),this.Y=this.Z=void 0}};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Th=t=>!xv(t)&&typeof t.then=="function",Ch=1073741823;let Iv=class extends Lv{constructor(){super(...arguments),this._$C_t=Ch,this._$Cwt=[],this._$Cq=new Nv(this),this._$CK=new Mv}render(...e){var r;return(r=e.find(i=>!Th(i)))!==null&&r!==void 0?r:mi}update(e,r){const i=this._$Cwt;let n=i.length;this._$Cwt=r;const s=this._$Cq,o=this._$CK;this.isConnected||this.disconnected();for(let l=0;lthis._$C_t);l++){const a=r[l];if(!Th(a))return this._$C_t=l,a;l{for(;o.get();)await o.get();const c=s.deref();if(c!==void 0){const f=c._$Cwt.indexOf(a);f>-1&&f{var r,i;return((r=e.exports)==null?void 0:r.some(n=>n.kind==="custom-element-definition"))||((i=e.declarations)==null?void 0:i.some(n=>n.customElement))})}const Pv=t=>t.kind==="custom-element-definition",Dv=t=>t.customElement,Zm=t=>!(t.privacy==="private"||t.privacy==="protected");async function Bv(t){try{const r=await(await fetch(t)).json();if(Rf(r))return r;throw new Error(`No element definitions found at ${t}`)}catch(e){return console.error(e),null}}function Uv(t,e){const r=(t.modules??[]).flatMap(i=>{var n;return((n=i.exports)==null?void 0:n.filter(Pv))??[]});return e?r.filter(i=>e.includes(i.name)):r}const Fv=(t,e,r)=>{var a,u;const i=r?e.findIndex(c=>(c==null?void 0:c.name)===r):0,n=e[i];if(!n)return null;const{name:s,module:o}=n.declaration,l=o?(u=(a=t.modules.find(c=>c.path===o.replace(/^\//,"")))==null?void 0:a.declarations)==null?void 0:u.find(c=>c.name===s):t.modules.flatMap(c=>c.declarations).find(c=>(c==null?void 0:c.name)===s);if(!l||!Dv(l))throw new Error(`Could not find declaration for ${r}`);return{customElement:!0,name:n.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((c,f)=>c.name>f.name?1:-1)}},Hv=(t=[])=>t.filter(e=>e.kind==="field"&&Zm(e)),Wv=(t=[])=>t.filter(e=>e.kind==="method"&&Zm(e));/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const yl=window,Lf=yl.ShadowRoot&&(yl.ShadyCSS===void 0||yl.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Nf=Symbol(),Rh=new WeakMap;let Jm=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Nf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Lf&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=Rh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Rh.set(r,e))}return e}toString(){return this.cssText}};const zv=t=>new Jm(typeof t=="string"?t:t+"",void 0,Nf),jv=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new Jm(r,t,Nf)},Gv=(t,e)=>{Lf?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=yl.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},Lh=Lf?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return zv(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var fu;const Ul=window,Nh=Ul.trustedTypes,qv=Nh?Nh.emptyScript:"",Mh=Ul.reactiveElementPolyfillSupport,vc={toAttribute(t,e){switch(e){case Boolean:t=t?qv:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Qm=(t,e)=>e!==t&&(e==e||t==t),du={attribute:!0,type:String,converter:vc,reflect:!1,hasChanged:Qm},_c="finalized";let In=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=du){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||du}static finalize(){if(this.hasOwnProperty(_c))return!1;this[_c]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=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(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(Lh(n))}else e!==void 0&&r.push(Lh(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Gv(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=du){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:vc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:vc;this._$El=s,this[s]=l.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Qm)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===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(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};In[_c]=!0,In.elementProperties=new Map,In.elementStyles=[],In.shadowRootOptions={mode:"open"},Mh==null||Mh({ReactiveElement:In}),((fu=Ul.reactiveElementVersions)!==null&&fu!==void 0?fu:Ul.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var hu;const Fl=window,Qn=Fl.trustedTypes,Ih=Qn?Qn.createPolicy("lit-html",{createHTML:t=>t}):void 0,xc="$lit$",ui=`lit$${(Math.random()+"").slice(9)}$`,e0="?"+ui,Kv=`<${e0}>`,an=document,fo=()=>an.createComment(""),ho=t=>t===null||typeof t!="object"&&typeof t!="function",t0=Array.isArray,Vv=t=>t0(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",pu=`[ +\f\r]`,ks=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Oh=/-->/g,Ph=/>/g,Ni=RegExp(`>|${pu}(?:([^\\s"'>=/]+)(${pu}*=${pu}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Dh=/'/g,Bh=/"/g,r0=/^(?:script|style|textarea|title)$/i,Xv=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Yv=Xv(1),es=Symbol.for("lit-noChange"),yt=Symbol.for("lit-nothing"),Uh=new WeakMap,ji=an.createTreeWalker(an,129,null,!1);function i0(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ih!==void 0?Ih.createHTML(e):e}const Zv=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=ks;for(let l=0;l"?(o=n??ks,f=-1):c[1]===void 0?f=-2:(f=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Ni:c[3]==='"'?Bh:Dh):o===Bh||o===Dh?o=Ni:o===Oh||o===Ph?o=ks:(o=Ni,n=void 0);const p=o===Ni&&t[l+1].startsWith("/>")?" ":"";s+=o===ks?a+Kv:f>=0?(i.push(u),a.slice(0,f)+xc+a.slice(f)+ui+p):a+ui+(f===-2?(i.push(void 0),l):p)}return[i0(t,s+(t[r]||"")+(e===2?"":"")),i]};let $c=class n0{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[u,c]=Zv(e,r);if(this.el=n0.createElement(u,i),ji.currentNode=this.el.content,r===2){const f=this.el.content,g=f.firstChild;g.remove(),f.append(...g.childNodes)}for(;(n=ji.nextNode())!==null&&a.length0){n.textContent=Qn?Qn.emptyScript:"";for(let p=0;p2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=yt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=ts(this,e,r,0),o=!ho(e)||e!==this._$AH&&e!==es,o&&(this._$AH=e);else{const l=e;let a,u;for(e=s[0],a=0;a{var i,n;const s=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let o=s._$litPart$;if(o===void 0){const l=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=o=new Mf(e.insertBefore(fo(),l),l,void 0,r??{})}return o._$AI(t),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var gu,mu;let bl=class extends In{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=n_(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return es}};bl.finalized=!0,bl._$litElement$=!0,(gu=globalThis.litElementHydrateSupport)===null||gu===void 0||gu.call(globalThis,{LitElement:bl});const Hh=globalThis.litElementPolyfillSupport;Hh==null||Hh({LitElement:bl});((mu=globalThis.litElementVersions)!==null&&mu!==void 0?mu:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const s_=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},o_=(t,e,r)=>{e.constructor.createProperty(r,t)};function Zo(t){return(e,r)=>r!==void 0?o_(t,e,r):s_(t,e)}const l_=Yv` +
No custom elements found in the JSON file.
+`,a_=t=>{class e extends t{constructor(){super(...arguments),this.jsonFetched=Promise.resolve(null)}willUpdate(){const{src:i}=this;this.manifest?Rf(this.manifest)?(this.lastSrc=void 0,this.jsonFetched=Promise.resolve(this.manifest)):console.error("No custom elements found in the `manifest` object."):i&&this.lastSrc!==i&&(this.lastSrc=i,this.jsonFetched=Bv(i))}}return Ye([Zo()],e.prototype,"src",void 0),Ye([Zo({attribute:!1})],e.prototype,"manifest",void 0),Ye([Zo({reflect:!0,converter:{fromAttribute:r=>r.split(","),toAttribute:r=>r.join(",")}})],e.prototype,"only",void 0),Ye([Zo()],e.prototype,"selected",void 0),e},If=t=>typeof t=="string"&&t.startsWith("'")&&t.endsWith("'")?t.slice(1,t.length-1):t;function Of(t,...e){const r=document.createElement("template");return r.innerHTML=e.reduce((i,n,s)=>i+n+t[s+1],t[0]),r}/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const wl=window,Pf=wl.ShadowRoot&&(wl.ShadyCSS===void 0||wl.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Df=Symbol(),Wh=new WeakMap;let o0=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Df)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Pf&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=Wh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Wh.set(r,e))}return e}toString(){return this.cssText}};const u_=t=>new o0(typeof t=="string"?t:t+"",void 0,Df),Bf=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new o0(r,t,Df)},c_=(t,e)=>{Pf?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=wl.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},zh=Pf?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return u_(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var yu;const Hl=window,jh=Hl.trustedTypes,f_=jh?jh.emptyScript:"",Gh=Hl.reactiveElementPolyfillSupport,Sc={toAttribute(t,e){switch(e){case Boolean:t=t?f_:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},l0=(t,e)=>e!==t&&(e==e||t==t),bu={attribute:!0,type:String,converter:Sc,reflect:!1,hasChanged:l0},Ac="finalized";let On=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=bu){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||bu}static finalize(){if(this.hasOwnProperty(Ac))return!1;this[Ac]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=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(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(zh(n))}else e!==void 0&&r.push(zh(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return c_(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=bu){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Sc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:Sc;this._$El=s,this[s]=l.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||l0)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===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(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};On[Ac]=!0,On.elementProperties=new Map,On.elementStyles=[],On.shadowRootOptions={mode:"open"},Gh==null||Gh({ReactiveElement:On}),((yu=Hl.reactiveElementVersions)!==null&&yu!==void 0?yu:Hl.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var wu;const Wl=window,rs=Wl.trustedTypes,qh=rs?rs.createPolicy("lit-html",{createHTML:t=>t}):void 0,zl="$lit$",zr=`lit$${(Math.random()+"").slice(9)}$`,Uf="?"+zr,d_=`<${Uf}>`,un=document,po=()=>un.createComment(""),go=t=>t===null||typeof t!="object"&&typeof t!="function",a0=Array.isArray,u0=t=>a0(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",vu=`[ +\f\r]`,Ts=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Kh=/-->/g,Vh=/>/g,Mi=RegExp(`>|${vu}(?:([^\\s"'>=/]+)(${vu}*=${vu}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Xh=/'/g,Yh=/"/g,c0=/^(?:script|style|textarea|title)$/i,h_=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Mt=h_(1),Kr=Symbol.for("lit-noChange"),Je=Symbol.for("lit-nothing"),Zh=new WeakMap,Gi=un.createTreeWalker(un,129,null,!1);function f0(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return qh!==void 0?qh.createHTML(e):e}const d0=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=Ts;for(let l=0;l"?(o=n??Ts,f=-1):c[1]===void 0?f=-2:(f=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Mi:c[3]==='"'?Yh:Xh):o===Yh||o===Xh?o=Mi:o===Kh||o===Vh?o=Ts:(o=Mi,n=void 0);const p=o===Mi&&t[l+1].startsWith("/>")?" ":"";s+=o===Ts?a+d_:f>=0?(i.push(u),a.slice(0,f)+zl+a.slice(f)+zr+p):a+zr+(f===-2?(i.push(void 0),l):p)}return[f0(t,s+(t[r]||"")+(e===2?"":"")),i]};let Ec=class h0{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[u,c]=d0(e,r);if(this.el=h0.createElement(u,i),Gi.currentNode=this.el.content,r===2){const f=this.el.content,g=f.firstChild;g.remove(),f.append(...g.childNodes)}for(;(n=Gi.nextNode())!==null&&a.length0){n.textContent=rs?rs.emptyScript:"";for(let p=0;p2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Je}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=cn(this,e,r,0),o=!go(e)||e!==this._$AH&&e!==Kr,o&&(this._$AH=e);else{const l=e;let a,u;for(e=s[0],a=0;a{var i,n;const s=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let o=s._$litPart$;if(o===void 0){const l=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=o=new ya(e.insertBefore(po(),l),l,void 0,r??{})}return o._$AI(t),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var _u,xu;let Ks=class extends On{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=v0(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Kr}};Ks.finalized=!0,Ks._$litElement$=!0,(_u=globalThis.litElementHydrateSupport)===null||_u===void 0||_u.call(globalThis,{LitElement:Ks});const Qh=globalThis.litElementPolyfillSupport;Qh==null||Qh({LitElement:Ks});((xu=globalThis.litElementVersions)!==null&&xu!==void 0?xu:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const m_=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},y_=(t,e,r)=>{e.constructor.createProperty(r,t)};function lr(t){return(e,r)=>r!==void 0?y_(t,e,r):m_(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ff={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ba=t=>(...e)=>({_$litDirective$:t,values:e});let wa=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{I:b_}=g_,ep=(t,e)=>e===void 0?(t==null?void 0:t._$litType$)!==void 0:(t==null?void 0:t._$litType$)===e,w_=t=>{var e;return((e=t==null?void 0:t._$litType$)===null||e===void 0?void 0:e.h)!=null},tp=()=>document.createComment(""),rp=(t,e,r)=>{var i;const n=t._$AA.parentNode,s=e===void 0?t._$AB:e._$AA;if(r===void 0){const o=n.insertBefore(tp(),s),l=n.insertBefore(tp(),s);r=new b_(o,l,t,t.options)}else{const o=r._$AB.nextSibling,l=r._$AM,a=l!==t;if(a){let u;(i=r._$AQ)===null||i===void 0||i.call(r,t),r._$AM=t,r._$AP!==void 0&&(u=t._$AU)!==l._$AU&&r._$AP(u)}if(o!==s||a){let u=r._$AA;for(;u!==o;){const c=u.nextSibling;n.insertBefore(u,s),u=c}}}return r},v_={},ip=(t,e=v_)=>t._$AH=e,np=t=>t._$AH,__=t=>{t._$AR()};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const sp=t=>w_(t)?t._$litType$.h:t.strings,x_=ba(class extends wa{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){const r=ep(this.et)?sp(this.et):null,i=ep(e)?sp(e):null;if(r!==null&&(i===null||r!==i)){const n=np(t).pop();let s=this.tt.get(r);if(s===void 0){const o=document.createDocumentFragment();s=v0(Je,o),s.setConnected(!1),this.tt.set(r,s)}ip(s,[n]),rp(s,void 0,n)}if(i!==null){if(r===null||r!==i){const n=this.tt.get(i);if(n!==void 0){const s=np(n).pop();__(t),rp(t,void 0,s),ip(t,[s])}}this.et=e}else this.et=void 0;return this.render(e)}});let $_=0;const S_=Of` + + +`;class _0 extends HTMLElement{get selected(){return this._selected}set selected(e){this._selected=e,this.setAttribute("aria-selected",String(e)),this.setAttribute("tabindex",e?"0":"-1"),this.toggleAttribute("selected",e)}constructor(){super(),this._mousedown=!1,this._selected=!1,this.attachShadow({mode:"open"}).appendChild(S_.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)})}connectedCallback(){this.setAttribute("role","tab"),this.id||(this.id=`api-viewer-tab-${$_++}`)}_setActive(e){this.toggleAttribute("active",e)}_setFocused(e){this.toggleAttribute("focused",e),this.toggleAttribute("focus-ring",e&&!this._mousedown)}}customElements.define("api-viewer-tab",_0);let A_=0;const E_=Of` + + +`;class k_ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(E_.content.cloneNode(!0))}connectedCallback(){this.setAttribute("role","tabpanel"),this.id||(this.id=`api-viewer-panel-${A_++}`)}}customElements.define("api-viewer-panel",k_);const T_=Of` + +
+ +
+ +`;class C_ extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"});e.appendChild(T_.content.cloneNode(!0));const r=e.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:e}=this;e.forEach(i=>{const n=i.nextElementSibling;i.setAttribute("aria-controls",n.id),n.setAttribute("aria-labelledby",i.id)});const r=e.find(i=>i.selected)||e[0];this._selectTab(r)}get tabs(){return Array.from(this.querySelectorAll("api-viewer-tab"))}_getAvailableIndex(e,r){const{tabs:i}=this,n=i.length;for(let s=0;typeof e=="number"&&s=n&&(e=0),!i[e].hasAttribute("hidden"))return e;return-1}_prevTab(e){const r=this._getAvailableIndex(e.findIndex(i=>i.selected)-1,-1);return e[(r+e.length)%e.length]}_nextTab(e){const r=this._getAvailableIndex(e.findIndex(i=>i.selected)+1,1);return e[r%e.length]}reset(){this.tabs.forEach(e=>{e.selected=!1}),this.querySelectorAll("api-viewer-panel").forEach(e=>{e.hidden=!0})}selectFirst(){const e=this._getAvailableIndex(0,1);this._selectTab(this.tabs[e%this.tabs.length])}_selectTab(e){this.reset();const r=e.getAttribute("aria-controls"),i=this.querySelector(`#${r}`);i&&(e.selected=!0,i.hidden=!1)}handleEvent(e){const{target:r}=e;if(r&&r instanceof _0){let i;if(e.type==="keydown"){const{tabs:n}=this;switch(e.key){case"ArrowLeft":case"ArrowUp":i=this._prevTab(n);break;case"ArrowDown":case"ArrowRight":i=this._nextTab(n);break;case"Home":i=n[0];break;case"End":i=n[n.length-1];break;default:return}e.preventDefault()}else i=r;this._selectTab(i),i.focus()}}}customElements.define("api-viewer-tabs",C_);class Hf{get data(){return this._data}set data(e){this._data=e,this.updateData(e)}updateData(e){this.host.isConnected&&this.host.requestUpdate()}constructor(e,r){this._data=[],(this.host=e).addController(this),this.el=r}clear(){this.data=[]}destroy(){this.host.removeController(this)}}class R_ extends Hf{constructor(e,r,i){super(e,r),i.forEach(({name:n})=>{r.addEventListener(n,s=>{const o="-changed";if(n.endsWith(o)){const{knob:l}=e.getKnob(n.replace(o,""));e.syncKnob(r,l)}this.data=[...this.data,s]})})}}const L_=t=>t[0].toUpperCase()+t.slice(1),x0=t=>L_(t===""?"content":t),N_=(t,e)=>{const{name:r,value:i}=t;return Mt` + + `},op=(t,e)=>{const{name:r,knobType:i,value:n,options:s}=t;let o;return i==="select"&&Array.isArray(s)?o=Mt` + + `:i==="boolean"?o=Mt` + + `:o=Mt` + + `,o},M_=(t,e)=>{const{name:r,content:i}=t;return Mt` + + `},Jo=(t,e,r,i)=>{const n=t.map(s=>{const{name:o}=s,l=`${r}-${o||"default"}`,a=r==="slot"?x0(o):o;return Mt` + + + + + ${i(s,l)} + + `});return Mt` +

${e}

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

+ event: + ${e.type}.${e.detail==null?Je:P_(e.detail)} +

+ `)} +`;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let kc=class extends wa{constructor(e){if(super(e),this.et=Je,e.type!==Ff.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Je||e==null)return this.ft=void 0,this.et=e;if(e===Kr)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const r=[e];return r.raw=r,this.ft={_$litType$:this.constructor.resultType,strings:r,values:[]}}};kc.directiveName="unsafeHTML",kc.resultType=1;const Tc=ba(kc);function B_(t){return t.replace(/&/g,"&").replace(//g,">")}var U_={text:function(t){return B_(t)},join:function(t){return t.join("")},wrap:function(t,e){return''+e+""}};/*! ***************************************************************************** +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 is=function(){return is=Object.assign||function(e){for(var r,i=1,n=arguments.length;i`]+/}]}]}]},X_={name:"xml",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},va("",{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:[$u],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"|$)",end:">",keywords:{name:"script"},contains:[$u],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},$u]}]};function Su(t,e){var r=t&&t.exec(e);return r&&r.index===0||!1}function jf(t,e,r,i,n,s){var o=[{content:[]}];function l(G){var J=o[0].content;typeof G=="string"&&J.length&&typeof J[J.length-1]=="string"?J[J.length-1]+=G:J.push(G)}function a(G){l(e.text(G))}function u(G,J){J||(G=t.classPrefix+G),o.unshift({className:G,content:[]})}function c(G){G=t.classPrefix+G,o.push({className:G,content:[]})}function f(){if(o.length<2)throw"unbalanced";var G=o.shift(),J=G.className,be=G.content,me=e.join(be);l(J?e.wrap(J,me):me)}function g(G,J){if(Su(G.endRe,J)){for(;G.endsParent&&G.parent;G=G.parent);return G}if(G.endsWithParent&&G.parent)return g(G.parent,J)}function p(){if(!C.keywords){a(V);return}var G=0;C.lexemesRe.lastIndex=0;for(var J=C.lexemesRe.exec(V);J;){a(V.substring(G,J.index));var be=k.case_insensitive?J[0].toLowerCase():J[0],me=C.keywords.hasOwnProperty(be)&&C.keywords[be];me?(ne+=me[1],u(me[0],!1),a(J[0]),f()):a(J[0]),G=C.lexemesRe.lastIndex,J=C.lexemesRe.exec(V)}a(V.substr(G))}function b(G){var J=G.length==1&&G[0];if(J&&!Rc(J)){a(V);return}var be=J?jf(t,e,J,V,!0,F[J]):E0(t,e,V,G.length?C.subLanguage:void 0);C.relevance>0&&(ne+=be.relevance),J&&be.top&&(F[J]=be.top),u(be.language,!0),l(be.value),f()}function w(){C.subLanguage!=null?b(C.subLanguage):p(),V=""}function $(G){G.className&&u(G.className,!1),C=Object.create(G,{parent:{value:C}})}function T(G,J){if(V+=G,J==null)return w(),0;for(var be,me=0,ke=C.contains;me")+'"');return V+=J,J.length||1}var k=Rc(r);if(!k)throw new Error('Unknown language: "'+r+'"');var C=s||k,F={},U;for(U=C;U&&U!==k;U=U.parent)U.className&&c(U.className);var V="",ne=0;try{for(var he=void 0,A=void 0,P=0;C.terminators.lastIndex=P,he=C.terminators.exec(i),!!he;)A=T(i.substring(P,he.index),he[0]),P=he.index+A;for(T(i.substr(P)),U=C;U.parent;U=U.parent)U.className&&f();if(o.length!=1)throw"unbalanced";var _=o[0],z=_.className,D=_.content,ue=e.join(D),ge=z?e.wrap(z,ue):ue;return{language:r,relevance:ne,value:ge,top:C}}catch(G){if(G.message&&G.message.indexOf("Illegal")!==-1)return{language:r,relevance:0,value:e.text(i)};throw G}}function E0(t,e,r,i){i===void 0&&(i=t.languages||G_());var n={language:"",relevance:0,value:e.text(r)};if(r!=""){for(var s=n,o=i.filter(Rc),l=0,a=o;ls.relevance&&(s=c),c.relevance>n.relevance&&(s=n,n=c)}s.language&&(n.second_best=s)}return n}var Y_={classPrefix:"hljs-",useBr:!1};function Z_(t,e){return e===void 0&&(e={}),{render:t,options:is({},Y_,e)}}function J_(t,e,r){var i=t.render,n=t.options;return typeof r=="string"?jf(n,i,r,e,!1):E0(n,i,e,r)}const Q_={begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[Wf,zf,A0]}]},ex={className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[Q_,A0,zf,Wf,Lc,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}},tx="[a-zA-Z-][a-zA-Z0-9_-]*",rx={begin:/(?:[A-Z_.-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[ex]},ix={name:"css",case_insensitive:!0,illegal:/[=/|'$]/,contains:[Lc,{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[Wf,zf]},{className:"selector-tag",begin:tx,relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[Lc,rx]}]};j_(ix,X_);const nx=Z_(U_,{classPrefix:""}),{PREFIX:sx,SLOT:ox,SUFFIX:lx,WRAPPER:ax}=Zn,Hr=" ",ux=(t,e)=>{if(!t)return t;const r=t.replace(/\t/g,Hr).split(` +`),i=r.reduce((n,s)=>{if(/^\s*$/.test(s))return n;const o=s.match(/^(\s*)/),l=o&&o[0].length;return n===null||le+n.substr(i)).join(` +`)},Au=(t,e)=>{const r=t.innerHTML.replace(/\s+$/,"").replace(/(="")/g,"");return ux(r,e)},cx=(t,e,r,i,n)=>{let s="";const o=Ds(t,e,sx);Zi(o)&&(s+=`${Au(o,"").trim()} +`);let l="",a=null;const u=Ds(t,e,ax),c=Il(u);if(c){l=Hr;const w=c.outerHTML.match(/<([a-z]+)[^>]*>/);w&&(a=c.tagName.toLowerCase(),s+=`${w[0]} +${Hr}`)}s+=`<${e}`,Object.keys(r).sort((w,$)=>w>$?1:-1).forEach(w=>{const{value:$,knobType:T,attribute:k}=r[w],C=k||w;switch(T){case"boolean":s+=$?` ${C}`:"";break;case"select":s+=$!==""?` ${C}="${$}"`:"";break;default:s+=$!=null?` ${C}="${$}"`:"";break}}),s+=">";const f=Ds(t,e,ox);Zi(f)?s+=`${Au(f,`${l}${Hr}`)} +${l}`:i.length&&(i.length===1&&!i[0].name?s+=i[0].content:(s+=i.reduce((w,$)=>{const{name:T,content:k}=$,C=T?`
${k}
`:k;return`${w} +${l}${Hr}${C}`},""),s+=` +${l}`)),s+=``,a&&(s+=` +`);const g=Ds(t,e,lx);Zi(g)&&(s+=` +${Au(g,"").trim()} +`);const p=n.filter(w=>w.value!==w.default);p.length&&(s+=` +`);const{value:b}=J_(nx,s,["xml","css"]);return Mt`
${Tc(b)}
`},k0=t=>{const{knobType:e,default:r}=t;switch(e){case"boolean":return r!=="false";case"number":return Number(r);default:return If(r)}},fx=(t="")=>t.replace(" | undefined","").replace(" | null",""),dx=(t,e="")=>{let r=t.filter(({name:i,readonly:n})=>!e.includes(i)&&!n);return r=r.map(i=>{var s;const n={...i,knobType:fx((s=i.type)==null?void 0:s.text)};return typeof n.default=="string"&&(n.value=k0(n)),n}),r},hx=(t,e)=>uv(e,t,Zn.KNOB).map(r=>{const{attr:i,type:n}=r.dataset;let s=null;if(i){if(n==="select"){const o=Il(r),l=o?Array.from(o.children).filter(a=>a instanceof HTMLOptionElement).map(a=>a.value):[];o instanceof HTMLSelectElement&&l.length>1&&(s={name:i,attribute:i,knobType:n,options:l})}(n==="string"||n==="boolean")&&(s={name:i,attribute:i,knobType:n})}return s}).filter(Boolean),px=(t,e)=>t.filter(r=>{const{name:i,knobType:n}=r,s=k0(r);return e[i]!==s||n==="boolean"&&s});/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const lp=ba(class extends wa{constructor(t){if(super(t),t.type!==Ff.CHILD)throw Error("templateContent can only be used in child bindings")}render(t){return this.vt===t?Kr:(this.vt=t,document.importNode(t.content,!0))}}),{HOST:gx,PREFIX:mx,SLOT:yx,SUFFIX:bx,WRAPPER:wx}=Zn,vx=(t,e)=>{const{knobs:r}=e;Object.keys(r).forEach(i=>{const{attribute:n,value:s,custom:o}=r[i];o&&n?typeof s=="string"&&s?t.setAttribute(n,s):t.removeAttribute(n):t[i]=s})},ap=t=>typeof t=="object"&&Promise.resolve(t)===t;async function _x(t){let e=!1;const r=t,i=r.updateComplete;ap(i)&&(await i,e=!0);const n=r.componentOnReady?r.componentOnReady():!1;return ap(n)&&(await n,e=!0),e||await new Promise(requestAnimationFrame),r}let xx=class extends wa{constructor(e){if(super(e),e.type!==Ff.CHILD)throw new Error("renderer only supports binding to element")}render(e){return Je}update(e,[r]){var T;const i=(T=e.options)==null?void 0:T.host,{tag:n}=r,s=[],[o,l,a,u,c]=[gx,mx,bx,yx,wx].map(k=>Ds(r.id,n,k)),f=Il(c),g=f?f.localName:"";let p=i.querySelector(n);if(p){const k=i.querySelector('[part="demo-output"]'),C=p.parentElement;if(C&&(C===k||C.localName===g))return vx(p,r),Kr}const b=``,w=Il(o);Zi(l)&&s.push(lp(l));let $=w?w.outerHTML:`<${n}>${b}`;if(Zi(u)&&($=$.replace(b,`${u.innerHTML}${b}`)),g){const k=Tc(` + <${g}> + ${$} + + `);s.push(k)}else s.push(Tc($));return Zi(a)&&s.push(lp(a)),Promise.resolve().then(()=>{p=i.querySelector(n),p&&_x(p).then(()=>{p.dispatchEvent(new CustomEvent("rendered",{detail:{component:p},bubbles:!0,composed:!0}))})}),Mt`${s}`}};const $x=ba(xx);class Yt extends Ks{constructor(){super(...arguments),this.copyBtnText="copy",this.cssProps=[],this.events=[],this.slots=[],this.tag="",this.props=[],this.exclude="",this.defined=!1}createRenderRoot(){return this}render(){var p,b,w;const{tag:e}=this;if(!this.defined)return Mt` +
+ Element ${e} is not defined. Have you imported it? +
+ `;const[r,i,n,s,o]=[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=((b=this.slotsController)==null?void 0:b.data)||[],c=((w=this.stylesController)==null?void 0:w.data)||[],f=n||mc(l,e,Zn.SLOT),g=o&&s;return Mt` +
+ ${$x({id:l,tag:e,knobs:this.knobs})} +
+ + Source + + +
+ ${cx(l,e,this.knobs,u,c)} +
+
+ + Knobs + + +
+
+ ${Jo(this.propKnobs,"Properties","prop",op)} + ${Jo(this.customKnobs,"Attributes","attr",op)} +
+
+ ${Jo(u,"Slots","slot",M_)} +
+
+
+ + Styles + + +
+
+ ${Jo(c,"Custom CSS Properties","css-prop",N_)} +
+
+
+ + Events + + +
+ + ${x_(a.length?D_(a):Mt` +

+ Interact with component to see the event log. +

+ `)} +
+
+
+ `}willUpdate(e){if(e.has("tag")){const{tag:r}=this;this.defined=!!customElements.get(r),this.defined||customElements.whenDefined(r).then(()=>{this.tag===r&&(this.defined=!0)}),this.knobs={},this.propKnobs=dx(this.props,this.exclude),this.customKnobs=hx(this.tag,this.vid)}}updated(e){if(e.has("tag")&&e.get("tag")){const r=this.renderRoot.querySelector("api-viewer-tabs");r&&r.selectFirst()}}_onLogClear(){var r;(r=this.eventsController)==null||r.clear();const e=this.querySelector("#events");e&&e.focus()}_onCopyClick(){const e=this.renderRoot.querySelector('[part="demo-snippet"] code');if(e){const r=document.createRange();r.selectNodeContents(e);const i=window.getSelection();i.removeAllRanges(),i.addRange(r);try{document.execCommand("copy"),this.copyBtnText="done"}catch(n){console.error(n),this.copyBtnText="error"}setTimeout(()=>{this.copyBtnText="copy"},1e3),i.removeAllRanges()}}onRendered(e){const{component:r}=e.detail;this.initKnobs(r),this.initEvents(r),this.initSlots(r),this.initStyles(r)}initEvents(e){const r=this.eventsController;r&&r.destroy(),this.eventsController=new R_(this,e,this.events)}initKnobs(e){mc(this.vid,this.tag,Zn.HOST)&&px(this.propKnobs,e).forEach(i=>{this.syncKnob(e,i)})}initSlots(e){const r=this.slotsController;r&&r.destroy(),this.slotsController=new I_(this,e,this.vid,this.slots)}initStyles(e){const r=this.stylesController;r&&r.destroy(),this.stylesController=new O_(this,e,this.cssProps)}getKnob(e){const r=s=>s.name===e||s.attribute===e;let i=this.propKnobs.find(r),n=!1;return i||(i=this.customKnobs.find(r),n=!0),{knob:i,custom:n}}setKnobs(e,r,i,n,s=!1){this.knobs={...this.knobs,[e]:{knobType:r,value:i,attribute:n,custom:s}}}syncKnob(e,r){const{name:i,knobType:n,attribute:s}=r,o=e[i];this.setKnobs(i,n,o,s),this.propKnobs=this.propKnobs.map(l=>l.name===i?{...l,value:o}:l)}_onCssChanged(e){var i;const r=e.composedPath()[0];(i=this.stylesController)==null||i.setValue(r.dataset.name,r.value)}_onPropChanged(e){const r=e.composedPath()[0],{name:i,type:n}=r.dataset;let s;switch(n){case"boolean":s=r.checked;break;case"number":s=r.value===""?null:Number(r.value);break;default:s=r.value}const{knob:o,custom:l}=this.getKnob(i);this.setKnobs(i,n,s,o.attribute,l)}_onSlotChanged(e){var i;const r=e.composedPath()[0];(i=this.slotsController)==null||i.setValue(r.dataset.slot,r.value)}}Ye([lr()],Yt.prototype,"copyBtnText",void 0);Ye([lr({attribute:!1})],Yt.prototype,"cssProps",void 0);Ye([lr({attribute:!1})],Yt.prototype,"events",void 0);Ye([lr({attribute:!1})],Yt.prototype,"slots",void 0);Ye([lr()],Yt.prototype,"tag",void 0);Ye([lr({attribute:!1})],Yt.prototype,"props",void 0);Ye([lr()],Yt.prototype,"exclude",void 0);Ye([lr({type:Number})],Yt.prototype,"vid",void 0);Ye([lr({attribute:!1})],Yt.prototype,"customKnobs",void 0);Ye([lr({attribute:!1})],Yt.prototype,"knobs",void 0);Ye([lr({attribute:!1})],Yt.prototype,"propKnobs",void 0);Ye([lr({type:Boolean})],Yt.prototype,"defined",void 0);customElements.define("api-demo-layout",Yt);/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const vl=window,Gf=vl.ShadowRoot&&(vl.ShadyCSS===void 0||vl.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,qf=Symbol(),up=new WeakMap;let T0=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==qf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Gf&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=up.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&up.set(r,e))}return e}toString(){return this.cssText}};const Sx=t=>new T0(typeof t=="string"?t:t+"",void 0,qf),Ax=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new T0(r,t,qf)},Ex=(t,e)=>{Gf?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=vl.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},cp=Gf?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return Sx(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Eu;const Gl=window,fp=Gl.trustedTypes,kx=fp?fp.emptyScript:"",dp=Gl.reactiveElementPolyfillSupport,Nc={toAttribute(t,e){switch(e){case Boolean:t=t?kx:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},C0=(t,e)=>e!==t&&(e==e||t==t),ku={attribute:!0,type:String,converter:Nc,reflect:!1,hasChanged:C0},Mc="finalized";let Pn=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=ku){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ku}static finalize(){if(this.hasOwnProperty(Mc))return!1;this[Mc]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=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(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(cp(n))}else e!==void 0&&r.push(cp(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ex(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=ku){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Nc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:Nc;this._$El=s,this[s]=l.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||C0)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===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(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Pn[Mc]=!0,Pn.elementProperties=new Map,Pn.elementStyles=[],Pn.shadowRootOptions={mode:"open"},dp==null||dp({ReactiveElement:Pn}),((Eu=Gl.reactiveElementVersions)!==null&&Eu!==void 0?Eu:Gl.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Tu;const ql=window,ns=ql.trustedTypes,hp=ns?ns.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ic="$lit$",ci=`lit$${(Math.random()+"").slice(9)}$`,R0="?"+ci,Tx=`<${R0}>`,fn=document,mo=()=>fn.createComment(""),yo=t=>t===null||typeof t!="object"&&typeof t!="function",L0=Array.isArray,Cx=t=>L0(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Cu=`[ +\f\r]`,Rs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pp=/-->/g,gp=/>/g,Ii=RegExp(`>|${Cu}(?:([^\\s"'>=/]+)(${Cu}*=${Cu}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),mp=/'/g,yp=/"/g,N0=/^(?:script|style|textarea|title)$/i,Rx=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),lt=Rx(1),dn=Symbol.for("lit-noChange"),Ke=Symbol.for("lit-nothing"),bp=new WeakMap,qi=fn.createTreeWalker(fn,129,null,!1);function M0(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return hp!==void 0?hp.createHTML(e):e}const Lx=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=Rs;for(let l=0;l"?(o=n??Rs,f=-1):c[1]===void 0?f=-2:(f=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Ii:c[3]==='"'?yp:mp):o===yp||o===mp?o=Ii:o===pp||o===gp?o=Rs:(o=Ii,n=void 0);const p=o===Ii&&t[l+1].startsWith("/>")?" ":"";s+=o===Rs?a+Tx:f>=0?(i.push(u),a.slice(0,f)+Ic+a.slice(f)+ci+p):a+ci+(f===-2?(i.push(void 0),l):p)}return[M0(t,s+(t[r]||"")+(e===2?"":"")),i]};let Oc=class I0{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[u,c]=Lx(e,r);if(this.el=I0.createElement(u,i),qi.currentNode=this.el.content,r===2){const f=this.el.content,g=f.firstChild;g.remove(),f.append(...g.childNodes)}for(;(n=qi.nextNode())!==null&&a.length0){n.textContent=ns?ns.emptyScript:"";for(let p=0;p2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Ke}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=ss(this,e,r,0),o=!yo(e)||e!==this._$AH&&e!==dn,o&&(this._$AH=e);else{const l=e;let a,u;for(e=s[0],a=0;a{var i,n;const s=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let o=s._$litPart$;if(o===void 0){const l=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=o=new Kf(e.insertBefore(mo(),l),l,void 0,r??{})}return o._$AI(t),o};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Ru,Lu;let Vs=class extends Pn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Bx(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return dn}};Vs.finalized=!0,Vs._$litElement$=!0,(Ru=globalThis.litElementHydrateSupport)===null||Ru===void 0||Ru.call(globalThis,{LitElement:Vs});const vp=globalThis.litElementPolyfillSupport;vp==null||vp({LitElement:Vs});((Lu=globalThis.litElementVersions)!==null&&Lu!==void 0?Lu:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ux=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Fx=(t,e,r)=>{e.constructor.createProperty(r,t)};function Ai(t){return(e,r)=>r!==void 0?Fx(t,e,r):Ux(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Hx={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Wx=t=>(...e)=>({_$litDirective$:t,values:e});let zx=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let Pc=class extends zx{constructor(e){if(super(e),this.et=Ke,e.type!==Hx.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Ke||e==null)return this.ft=void 0,this.et=e;if(e===dn)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const r=[e];return r.raw=r,this.ft={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Pc.directiveName="unsafeHTML",Pc.resultType=1;const jx=Wx(Pc);function P0(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let wn=P0();function Gx(t){wn=t}const D0=/[&<>"']/,qx=new RegExp(D0.source,"g"),B0=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Kx=new RegExp(B0.source,"g"),Vx={"&":"&","<":"<",">":">",'"':""","'":"'"},_p=t=>Vx[t];function Tt(t,e){if(e){if(D0.test(t))return t.replace(qx,_p)}else if(B0.test(t))return t.replace(Kx,_p);return t}const Xx=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U0(t){return t.replace(Xx,(e,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 Yx=/(^|[^\[])\^/g;function Ve(t,e){t=typeof t=="string"?t:t.source,e=e||"";const r={replace:(i,n)=>(n=n.source||n,n=n.replace(Yx,"$1"),t=t.replace(i,n),r),getRegex:()=>new RegExp(t,e)};return r}const Zx=/[^\w:]/g,Jx=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function xp(t,e,r){if(t){let i;try{i=decodeURIComponent(U0(r)).replace(Zx,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!Jx.test(r)&&(r=r$(e,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Qo={},Qx=/^[^:]+:\/*[^/]*$/,e$=/^([^:]+:)[\s\S]*$/,t$=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r$(t,e){Qo[" "+t]||(Qx.test(t)?Qo[" "+t]=t+"/":Qo[" "+t]=_l(t,"/",!0)),t=Qo[" "+t];const r=t.indexOf(":")===-1;return e.substring(0,2)==="//"?r?e:t.replace(e$,"$1")+e:e.charAt(0)==="/"?r?e:t.replace(t$,"$1")+e:t+e}const Kl={exec:function(){}};function $p(t,e){const r=t.replace(/\|/g,(s,o,l)=>{let a=!1,u=o;for(;--u>=0&&l[u]==="\\";)a=!a;return a?"|":" |"}),i=r.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>e)i.splice(e);else for(;i.length1;)e&1&&(r+=t),e>>=1,t+=t;return r+t}function Ap(t,e,r,i){const n=e.href,s=e.title?Tt(e.title):null,o=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){i.state.inLink=!0;const l={type:"link",raw:r,href:n,title:s,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}return{type:"image",raw:r,href:n,title:s,text:Tt(o)}}function s$(t,e){const r=t.match(/^(\s+)(?:```)/);if(r===null)return e;const i=r[1];return e.split(` +`).map(n=>{const s=n.match(/^\s+/);if(s===null)return n;const[o]=s;return o.length>=i.length?n.slice(i.length):n}).join(` +`)}class Vf{constructor(e){this.options=e||wn}space(e){const r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){const r=this.rules.block.code.exec(e);if(r){const i=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:_l(i,` +`)}}}fences(e){const r=this.rules.block.fences.exec(e);if(r){const i=r[0],n=s$(i,r[3]||"");return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:n}}}heading(e){const r=this.rules.block.heading.exec(e);if(r){let i=r[2].trim();if(/#$/.test(i)){const n=_l(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){const r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:r[0]}}blockquote(e){const r=this.rules.block.blockquote.exec(e);if(r){const i=r[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=n,{type:"blockquote",raw:r[0],tokens:s,text:i}}}list(e){let r=this.rules.block.list.exec(e);if(r){let i,n,s,o,l,a,u,c,f,g,p,b,w=r[1].trim();const $=w.length>1,T={type:"list",raw:"",ordered:$,start:$?+w.slice(0,-1):"",loose:!1,items:[]};w=$?`\\d{1,9}\\${w.slice(-1)}`:`\\${w}`,this.options.pedantic&&(w=$?w:"[*+-]");const k=new RegExp(`^( {0,3}${w})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(b=!1,!(!(r=k.exec(e))||this.rules.block.hr.test(e)));){if(i=r[0],e=e.substring(i.length),c=r[2].split(` +`,1)[0].replace(/^\t+/,F=>" ".repeat(3*F.length)),f=e.split(` +`,1)[0],this.options.pedantic?(o=2,p=c.trimLeft()):(o=r[2].search(/[^ ]/),o=o>4?1:o,p=c.slice(o),o+=r[1].length),a=!1,!c&&/^ *$/.test(f)&&(i+=f+` +`,e=e.substring(f.length+1),b=!0),!b){const F=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),U=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),V=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),ne=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;e&&(g=e.split(` +`,1)[0],f=g,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(V.test(f)||ne.test(f)||F.test(f)||U.test(e)));){if(f.search(/[^ ]/)>=o||!f.trim())p+=` +`+f.slice(o);else{if(a||c.search(/[^ ]/)>=4||V.test(c)||ne.test(c)||U.test(c))break;p+=` +`+f}!a&&!f.trim()&&(a=!0),i+=g+` +`,e=e.substring(g.length+1),c=f.slice(o)}}T.loose||(u?T.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(p),n&&(s=n[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),T.items.push({type:"list_item",raw:i,task:!!n,checked:s,loose:!1,text:p}),T.raw+=i}T.items[T.items.length-1].raw=i.trimRight(),T.items[T.items.length-1].text=p.trimRight(),T.raw=T.raw.trimRight();const C=T.items.length;for(l=0;lV.type==="space"),U=F.length>0&&F.some(V=>/\n.*\n/.test(V.raw));T.loose=U}if(T.loose)for(l=0;l$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:n,title:s}}}table(e){const r=this.rules.block.table.exec(e);if(r){const i={type:"table",header:$p(r[1]).map(n=>({text:n})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(i.header.length===i.align.length){i.raw=r[0];let n=i.align.length,s,o,l,a;for(s=0;s({text:u}));for(n=i.header.length,o=0;o/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]):Tt(r[0]):r[0]}}link(e){const r=this.rules.inline.link.exec(e);if(r){const i=r[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=_l(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=i$(r[2],"()");if(o>-1){const a=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let n=r[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o&&(n=o[1],s=o[3])}else s=r[3]?r[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),Ap(r,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(e,r){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=(i[2]||i[1]).replace(/\s+/g," ");if(n=r[n.toLowerCase()],!n){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Ap(i,n,i[0],this.lexer)}}emStrong(e,r,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;const s=n[1]||n[2]||"";if(!s||s&&(i===""||this.rules.inline.punctuation.exec(i))){const o=n[0].length-1;let l,a,u=o,c=0;const f=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,r=r.slice(-1*e.length+o);(n=f.exec(r))!=null;){if(l=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!l)continue;if(a=l.length,n[3]||n[4]){u+=a;continue}else if((n[5]||n[6])&&o%3&&!((o+a)%3)){c+=a;continue}if(u-=a,u>0)continue;a=Math.min(a,a+u+c);const g=e.slice(0,o+n.index+(n[0].length-l.length)+a);if(Math.min(o,a)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const p=g.slice(2,-2);return{type:"strong",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const r=this.rules.inline.code.exec(e);if(r){let i=r[2].replace(/\n/g," ");const n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=Tt(i,!0),{type:"codespan",raw:r[0],text:i}}}br(e){const r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){const r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e,r){const i=this.rules.inline.autolink.exec(e);if(i){let n,s;return i[2]==="@"?(n=Tt(this.options.mangle?r(i[1]):i[1]),s="mailto:"+n):(n=Tt(i[1]),s=n),{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e,r){let i;if(i=this.rules.inline.url.exec(e)){let n,s;if(i[2]==="@")n=Tt(this.options.mangle?r(i[0]):i[0]),s="mailto:"+n;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);n=Tt(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,r){const i=this.rules.inline.text.exec(e);if(i){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Tt(i[0]):i[0]:n=Tt(this.options.smartypants?r(i[0]):i[0]),{type:"text",raw:i[0],text:n}}}}const _e={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 *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Kl,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;_e.def=Ve(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex();_e.bullet=/(?:[*+-]|\d{1,9}[.)])/;_e.listItemStart=Ve(/^( *)(bull) */).replace("bull",_e.bullet).getRegex();_e.list=Ve(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex();_e._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";_e._comment=/|$)/;_e.html=Ve(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();_e.paragraph=Ve(_e._paragraph).replace("hr",_e.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",_e._tag).getRegex();_e.blockquote=Ve(_e.blockquote).replace("paragraph",_e.paragraph).getRegex();_e.normal={..._e};_e.gfm={..._e.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};_e.gfm.table=Ve(_e.gfm.table).replace("hr",_e.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",_e._tag).getRegex();_e.gfm.paragraph=Ve(_e._paragraph).replace("hr",_e.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",_e.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",_e._tag).getRegex();_e.pedantic={..._e.normal,html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:Kl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ve(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Kl,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:Kl,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";oe.punctuation=Ve(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex();oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;oe._comment=Ve(_e._comment).replace("(?:-->|$)","-->").getRegex();oe.emStrong.lDelim=Ve(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex();oe.emStrong.rDelimAst=Ve(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex();oe.emStrong.rDelimUnd=Ve(oe.emStrong.rDelimUnd,"g").replace(/punct/g,oe._punctuation).getRegex();oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;oe._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])?)+(?![-_])/;oe.autolink=Ve(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex();oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;oe.tag=Ve(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex();oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;oe.link=Ve(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex();oe.reflink=Ve(oe.reflink).replace("label",oe._label).replace("ref",_e._label).getRegex();oe.nolink=Ve(oe.nolink).replace("ref",_e._label).getRegex();oe.reflinkSearch=Ve(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex();oe.normal={...oe};oe.pedantic={...oe.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:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()};oe.gfm={...oe.normal,escape:Ve(oe.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&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}class yi{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||wn,this.options.tokenizer=this.options.tokenizer||new Vf,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:_e.normal,inline:oe.normal};this.options.pedantic?(r.block=_e.pedantic,r.inline=oe.pedantic):this.options.gfm&&(r.block=_e.gfm,this.options.breaks?r.inline=oe.breaks:r.inline=oe.gfm),this.tokenizer.rules=r}static get rules(){return{block:_e,inline:oe}}static lex(e,r){return new yi(r).lex(e)}static lexInline(e,r){return new yi(r).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`),this.blockTokens(e,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(e,r=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(l,a,u)=>a+" ".repeat(u.length));let i,n,s,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(i=l.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&r.length>0?r[r.length-1].raw+=` +`:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),n=r[r.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text):r.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),n=r[r.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` +`+i.raw,n.text+=` +`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=e.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},a),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(s=e.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){n=r[r.length-1],o&&n.type==="paragraph"?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):r.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),n=r[r.length-1],n&&n.type==="text"?(n.raw+=` +`+i.raw,n.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):r.push(i);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let i,n,s,o=e,l,a,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+Sp("a",l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,l.index)+"["+Sp("a",l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,l.index+l[0].length-2)+"++"+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(a||(u=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=r[r.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):r.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=r[r.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):r.push(i);continue}if(i=this.tokenizer.emStrong(e,o,u)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.autolink(e,Ep)){e=e.substring(i.raw.length),r.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,Ep))){e=e.substring(i.raw.length),r.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=e.slice(1);let g;this.options.extensions.startInline.forEach(function(p){g=p.call({lexer:this},f),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(s=e.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,o$)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),a=!0,n=r[r.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):r.push(i);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}}class Xf{constructor(e){this.options=e||wn}code(e,r,i){const n=(r||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(e,n);s!=null&&s!==e&&(i=!0,e=s)}return e=e.replace(/\n$/,"")+` +`,n?'
'+(i?e:Tt(e,!0))+`
+`:"
"+(i?e:Tt(e,!0))+`
+`}blockquote(e){return`
+${e}
+`}html(e){return e}heading(e,r,i,n){if(this.options.headerIds){const s=this.options.headerPrefix+n.slug(i);return`${e} +`}return`${e} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(e,r,i){const n=r?"ol":"ul",s=r&&i!==1?' start="'+i+'"':"";return"<"+n+s+`> +`+e+" +`}listitem(e){return`
  • ${e}
  • +`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    +`}table(e,r){return r&&(r=`${r}`),` + +`+e+` +`+r+`
    +`}tablerow(e){return` +${e} +`}tablecell(e,r){const i=r.header?"th":"td";return(r.align?`<${i} align="${r.align}">`:`<${i}>`)+e+` +`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,r,i){if(e=xp(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='",n}image(e,r,i){if(e=xp(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n=`${i}":">",n}text(e){return e}}class F0{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,r,i){return""+i}image(e,r,i){return""+i}br(){return""}}class H0{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,r){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return r||(this.seen[e]=n,this.seen[i]=0),i}slug(e,r={}){const i=this.serialize(e);return this.getNextSafeSlug(i,r.dryrun)}}class bi{constructor(e){this.options=e||wn,this.options.renderer=this.options.renderer||new Xf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F0,this.slugger=new H0}static parse(e,r){return new bi(r).parse(e)}static parseInline(e,r){return new bi(r).parseInline(e)}parse(e,r=!0){let i="",n,s,o,l,a,u,c,f,g,p,b,w,$,T,k,C,F,U,V;const ne=e.length;for(n=0;n0&&k.tokens[0].type==="paragraph"?(k.tokens[0].text=U+" "+k.tokens[0].text,k.tokens[0].tokens&&k.tokens[0].tokens.length>0&&k.tokens[0].tokens[0].type==="text"&&(k.tokens[0].tokens[0].text=U+" "+k.tokens[0].tokens[0].text)):k.tokens.unshift({type:"text",text:U}):T+=U),T+=this.parse(k.tokens,$),g+=this.renderer.listitem(T,F,C);i+=this.renderer.list(g,b,w);continue}case"html":{i+=this.renderer.html(p.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(g=p.tokens?this.parseInline(p.tokens):p.text;n+1{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const n="

    An error occurred:

    "+Tt(i.message+"",!0)+"
    ";if(e)return Promise.resolve(n);if(r){r(null,n);return}return n}if(e)return Promise.reject(i);if(r){r(i);return}throw i}}function W0(t,e){return(r,i,n)=>{typeof i=="function"&&(n=i,i=null);const s={...i};i={...ve.defaults,...s};const o=l$(i.silent,i.async,n);if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(n$(i),i.hooks&&(i.hooks.options=i),n){const l=i.highlight;let a;try{i.hooks&&(r=i.hooks.preprocess(r)),a=t(r,i)}catch(f){return o(f)}const u=function(f){let g;if(!f)try{i.walkTokens&&ve.walkTokens(a,i.walkTokens),g=e(a,i),i.hooks&&(g=i.hooks.postprocess(g))}catch(p){f=p}return i.highlight=l,f?o(f):n(null,g)};if(!l||l.length<3||(delete i.highlight,!a.length))return u();let c=0;ve.walkTokens(a,function(f){f.type==="code"&&(c++,setTimeout(()=>{l(f.text,f.lang,function(g,p){if(g)return u(g);p!=null&&p!==f.text&&(f.text=p,f.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(l=>t(l,i)).then(l=>i.walkTokens?Promise.all(ve.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>e(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));const l=t(r,i);i.walkTokens&&ve.walkTokens(l,i.walkTokens);let a=e(l,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(l){return o(l)}}}function ve(t,e,r){return W0(yi.lex,bi.parse)(t,e,r)}ve.options=ve.setOptions=function(t){return ve.defaults={...ve.defaults,...t},Gx(ve.defaults),ve};ve.getDefaults=P0;ve.defaults=wn;ve.use=function(...t){const e=ve.defaults.extensions||{renderers:{},childTokens:{}};t.forEach(r=>{const i={...r};if(i.async=ve.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const s=e.renderers[n.name];s?e.renderers[n.name]=function(...o){let l=n.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){const n=ve.defaults.renderer||new Xf;for(const s in r.renderer){const o=n[s];n[s]=(...l)=>{let a=r.renderer[s].apply(n,l);return a===!1&&(a=o.apply(n,l)),a}}i.renderer=n}if(r.tokenizer){const n=ve.defaults.tokenizer||new Vf;for(const s in r.tokenizer){const o=n[s];n[s]=(...l)=>{let a=r.tokenizer[s].apply(n,l);return a===!1&&(a=o.apply(n,l)),a}}i.tokenizer=n}if(r.hooks){const n=ve.defaults.hooks||new Vl;for(const s in r.hooks){const o=n[s];Vl.passThroughHooks.has(s)?n[s]=l=>{if(ve.defaults.async)return Promise.resolve(r.hooks[s].call(n,l)).then(u=>o.call(n,u));const a=r.hooks[s].call(n,l);return o.call(n,a)}:n[s]=(...l)=>{let a=r.hooks[s].apply(n,l);return a===!1&&(a=o.apply(n,l)),a}}i.hooks=n}if(r.walkTokens){const n=ve.defaults.walkTokens;i.walkTokens=function(s){let o=[];return o.push(r.walkTokens.call(this,s)),n&&(o=o.concat(n.call(this,s))),o}}ve.setOptions(i)})};ve.walkTokens=function(t,e){let r=[];for(const i of t)switch(r=r.concat(e.call(ve,i)),i.type){case"table":{for(const n of i.header)r=r.concat(ve.walkTokens(n.tokens,e));for(const n of i.rows)for(const s of n)r=r.concat(ve.walkTokens(s.tokens,e));break}case"list":{r=r.concat(ve.walkTokens(i.items,e));break}default:ve.defaults.extensions&&ve.defaults.extensions.childTokens&&ve.defaults.extensions.childTokens[i.type]?ve.defaults.extensions.childTokens[i.type].forEach(function(n){r=r.concat(ve.walkTokens(i[n],e))}):i.tokens&&(r=r.concat(ve.walkTokens(i.tokens,e)))}return r};ve.parseInline=W0(yi.lexInline,bi.parseInline);ve.Parser=bi;ve.parser=bi.parse;ve.Renderer=Xf;ve.TextRenderer=F0;ve.Lexer=yi;ve.lexer=yi.lex;ve.Tokenizer=Vf;ve.Slugger=H0;ve.Hooks=Vl;ve.parse=ve;ve.options;ve.setOptions;ve.use;ve.walkTokens;ve.parseInline;bi.parse;yi.lex;/*! @license DOMPurify 2.5.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.6/LICENSE */function fi(t){"@babel/helpers - typeof";return fi=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},fi(t)}function Dc(t,e){return Dc=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},Dc(t,e)}function a$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xl(t,e,r){return a$()?xl=Reflect.construct:xl=function(n,s,o){var l=[null];l.push.apply(l,s);var a=Function.bind.apply(n,l),u=new a;return o&&Dc(u,o.prototype),u},xl.apply(null,arguments)}function hr(t){return u$(t)||c$(t)||f$(t)||d$()}function u$(t){if(Array.isArray(t))return Bc(t)}function c$(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function f$(t,e){if(t){if(typeof t=="string")return Bc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bc(t,e)}}function Bc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r1?r-1:0),n=1;n/gm),E$=ir(/\${[\w\W]*}/gm),k$=ir(/^data-[\-\w.\u00B7-\uFFFF]/),T$=ir(/^aria-[\-\w]+$/),C$=ir(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),R$=ir(/^(?:\w+script|data):/i),L$=ir(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),N$=ir(/^html$/i),M$=ir(/^[a-z][.\w]*(-[.\w]+)+$/i),I$=function(){return typeof window>"u"?null:window},O$=function(e,r){if(fi(e)!=="object"||typeof e.createPolicy!="function")return null;var i=null,n="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(n)&&(i=r.currentScript.getAttribute(n));var s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:function(l){return l},createScriptURL:function(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function j0(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I$(),e=function(R){return j0(R)};if(e.version="2.5.6",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var r=t.document,i=t.document,n=t.DocumentFragment,s=t.HTMLTemplateElement,o=t.Node,l=t.Element,a=t.NodeFilter,u=t.NamedNodeMap,c=u===void 0?t.NamedNodeMap||t.MozNamedAttrMap:u,f=t.HTMLFormElement,g=t.DOMParser,p=t.trustedTypes,b=l.prototype,w=el(b,"cloneNode"),$=el(b,"nextSibling"),T=el(b,"childNodes"),k=el(b,"parentNode");if(typeof s=="function"){var C=i.createElement("template");C.content&&C.content.ownerDocument&&(i=C.content.ownerDocument)}var F=O$(p,r),U=F?F.createHTML(""):"",V=i,ne=V.implementation,he=V.createNodeIterator,A=V.createDocumentFragment,P=V.getElementsByTagName,_=r.importNode,z={};try{z=Oi(i).documentMode?i.documentMode:{}}catch{}var D={};e.isSupported=typeof k=="function"&&ne&&ne.createHTMLDocument!==void 0&&z!==9;var ue=S$,ge=A$,G=E$,J=k$,be=T$,me=R$,ke=L$,re=M$,Q=C$,H=null,ae=Re({},[].concat(hr(Rp),hr(Iu),hr(Ou),hr(Pu),hr(Lp))),xe=null,Ut=Re({},[].concat(hr(Np),hr(Du),hr(Mp),hr(tl))),ce=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,wt=null,Jt=!0,Lt=!0,at=!1,N=!0,M=!1,j=!0,ie=!1,se=!1,Ue=!1,Pe=!1,Ne=!1,it=!1,de=!0,ot=!1,Br="user-content-",Qe=!0,je=!1,y={},d=null,h=Re({},["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"]),x=null,L=Re({},["audio","video","img","source","image","track"]),I=null,O=Re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",Te="http://www.w3.org/1999/xhtml",Ce=Te,Me=!1,cr=null,Ss=Re({},[$e,Ie,Te],Nu),Ft,vt=["application/xhtml+xml","text/html"],Cn="text/html",et,ut=null,Rn=i.createElement("form"),v=function(R){return R instanceof RegExp||R instanceof Function},E=function(R){ut&&ut===R||((!R||fi(R)!=="object")&&(R={}),R=Oi(R),Ft=vt.indexOf(R.PARSER_MEDIA_TYPE)===-1?Ft=Cn:Ft=R.PARSER_MEDIA_TYPE,et=Ft==="application/xhtml+xml"?Nu:$l,H="ALLOWED_TAGS"in R?Re({},R.ALLOWED_TAGS,et):ae,xe="ALLOWED_ATTR"in R?Re({},R.ALLOWED_ATTR,et):Ut,cr="ALLOWED_NAMESPACES"in R?Re({},R.ALLOWED_NAMESPACES,Nu):Ss,I="ADD_URI_SAFE_ATTR"in R?Re(Oi(O),R.ADD_URI_SAFE_ATTR,et):O,x="ADD_DATA_URI_TAGS"in R?Re(Oi(L),R.ADD_DATA_URI_TAGS,et):L,d="FORBID_CONTENTS"in R?Re({},R.FORBID_CONTENTS,et):h,Oe="FORBID_TAGS"in R?Re({},R.FORBID_TAGS,et):{},wt="FORBID_ATTR"in R?Re({},R.FORBID_ATTR,et):{},y="USE_PROFILES"in R?R.USE_PROFILES:!1,Jt=R.ALLOW_ARIA_ATTR!==!1,Lt=R.ALLOW_DATA_ATTR!==!1,at=R.ALLOW_UNKNOWN_PROTOCOLS||!1,N=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,M=R.SAFE_FOR_TEMPLATES||!1,j=R.SAFE_FOR_XML!==!1,ie=R.WHOLE_DOCUMENT||!1,Pe=R.RETURN_DOM||!1,Ne=R.RETURN_DOM_FRAGMENT||!1,it=R.RETURN_TRUSTED_TYPE||!1,Ue=R.FORCE_BODY||!1,de=R.SANITIZE_DOM!==!1,ot=R.SANITIZE_NAMED_PROPS||!1,Qe=R.KEEP_CONTENT!==!1,je=R.IN_PLACE||!1,Q=R.ALLOWED_URI_REGEXP||Q,Ce=R.NAMESPACE||Te,ce=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&v(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&v(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),M&&(Lt=!1),Ne&&(Pe=!0),y&&(H=Re({},hr(Lp)),xe=[],y.html===!0&&(Re(H,Rp),Re(xe,Np)),y.svg===!0&&(Re(H,Iu),Re(xe,Du),Re(xe,tl)),y.svgFilters===!0&&(Re(H,Ou),Re(xe,Du),Re(xe,tl)),y.mathMl===!0&&(Re(H,Pu),Re(xe,Mp),Re(xe,tl))),R.ADD_TAGS&&(H===ae&&(H=Oi(H)),Re(H,R.ADD_TAGS,et)),R.ADD_ATTR&&(xe===Ut&&(xe=Oi(xe)),Re(xe,R.ADD_ATTR,et)),R.ADD_URI_SAFE_ATTR&&Re(I,R.ADD_URI_SAFE_ATTR,et),R.FORBID_CONTENTS&&(d===h&&(d=Oi(d)),Re(d,R.FORBID_CONTENTS,et)),Qe&&(H["#text"]=!0),ie&&Re(H,["html","head","body"]),H.table&&(Re(H,["tbody"]),delete Oe.tbody),Pt&&Pt(R),ut=R)},Z=Re({},["mi","mo","mn","ms","mtext"]),Y=Re({},["foreignobject","annotation-xml"]),te=Re({},["title","style","font","a","script"]),Ge=Re({},Iu);Re(Ge,Ou),Re(Ge,x$);var ct=Re({},Pu);Re(ct,$$);var Qt=function(R){var X=k(R);(!X||!X.tagName)&&(X={namespaceURI:Ce,tagName:"template"});var ee=$l(R.tagName),De=$l(X.tagName);return cr[R.namespaceURI]?R.namespaceURI===Ie?X.namespaceURI===Te?ee==="svg":X.namespaceURI===$e?ee==="svg"&&(De==="annotation-xml"||Z[De]):!!Ge[ee]:R.namespaceURI===$e?X.namespaceURI===Te?ee==="math":X.namespaceURI===Ie?ee==="math"&&Y[De]:!!ct[ee]:R.namespaceURI===Te?X.namespaceURI===Ie&&!Y[De]||X.namespaceURI===$e&&!Z[De]?!1:!ct[ee]&&(te[ee]||!Ge[ee]):!!(Ft==="application/xhtml+xml"&&cr[R.namespaceURI]):!1},tt=function(R){Ls(e.removed,{element:R});try{R.parentNode.removeChild(R)}catch{try{R.outerHTML=U}catch{R.remove()}}},xr=function(R,X){try{Ls(e.removed,{attribute:X.getAttributeNode(R),from:X})}catch{Ls(e.removed,{attribute:null,from:X})}if(X.removeAttribute(R),R==="is"&&!xe[R])if(Pe||Ne)try{tt(X)}catch{}else try{X.setAttribute(R,"")}catch{}},Ur=function(R){var X,ee;if(Ue)R=""+R;else{var De=Cp(R,/^[\r\n\t ]+/);ee=De&&De[0]}Ft==="application/xhtml+xml"&&Ce===Te&&(R=''+R+"");var m=F?F.createHTML(R):R;if(Ce===Te)try{X=new g().parseFromString(m,Ft)}catch{}if(!X||!X.documentElement){X=ne.createDocument(Ce,"template",null);try{X.documentElement.innerHTML=Me?U:m}catch{}}var S=X.body||X.documentElement;return R&&ee&&S.insertBefore(i.createTextNode(ee),S.childNodes[0]||null),Ce===Te?P.call(X,ie?"html":"body")[0]:ie?X.documentElement:S},Nt=function(R){return he.call(R.ownerDocument||R,R,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT|a.SHOW_PROCESSING_INSTRUCTION|a.SHOW_CDATA_SECTION,null,!1)},$r=function(R){return R instanceof f&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof c)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},fr=function(R){return fi(o)==="object"?R instanceof o:R&&fi(R)==="object"&&typeof R.nodeType=="number"&&typeof R.nodeName=="string"},At=function(R,X,ee){D[R]&&b$(D[R],function(De){De.call(e,X,ee,ut)})},si=function(R){var X;if(At("beforeSanitizeElements",R,null),$r(R)||_t(/[\u0080-\uFFFF]/,R.nodeName))return tt(R),!0;var ee=et(R.nodeName);if(At("uponSanitizeElement",R,{tagName:ee,allowedTags:H}),R.hasChildNodes()&&!fr(R.firstElementChild)&&(!fr(R.content)||!fr(R.content.firstElementChild))&&_t(/<[/\w]/g,R.innerHTML)&&_t(/<[/\w]/g,R.textContent)||ee==="select"&&_t(/