@ulb-darmstadt/shacl-form 1.7.3 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +13 -3
  2. package/dist/config.d.ts +4 -5
  3. package/dist/constants.d.ts +15 -12
  4. package/dist/constraints.d.ts +5 -4
  5. package/dist/exports.d.ts +2 -1
  6. package/dist/form-bootstrap.d.ts +1 -1
  7. package/dist/form-bootstrap.js +361 -2
  8. package/dist/form-default.d.ts +1 -1
  9. package/dist/form-default.js +350 -2
  10. package/dist/form-material.d.ts +1 -1
  11. package/dist/form-material.js +670 -2
  12. package/dist/form.d.ts +3 -2
  13. package/dist/node-template.d.ts +17 -0
  14. package/dist/node.d.ts +5 -1
  15. package/dist/plugins/leaflet.d.ts +2 -4
  16. package/dist/plugins/leaflet.js +720 -2
  17. package/dist/plugins/mapbox.d.ts +2 -2
  18. package/dist/plugins/mapbox.js +2764 -2
  19. package/dist/property-template.d.ts +2 -1
  20. package/dist/property.d.ts +6 -2
  21. package/dist/theme.d.ts +2 -2
  22. package/dist/themes/default.d.ts +3 -3
  23. package/dist/themes/material.d.ts +2 -3
  24. package/package.json +26 -14
  25. package/src/config.ts +11 -10
  26. package/src/constants.ts +4 -1
  27. package/src/constraints.ts +75 -31
  28. package/src/exports.ts +2 -1
  29. package/src/form.ts +32 -17
  30. package/src/group.ts +1 -1
  31. package/src/loader.ts +12 -13
  32. package/src/node-template.ts +82 -0
  33. package/src/node.ts +88 -63
  34. package/src/plugins/leaflet.ts +2 -2
  35. package/src/plugins/mapbox.ts +4 -4
  36. package/src/property-template.ts +19 -8
  37. package/src/property.ts +168 -63
  38. package/src/serialize.ts +14 -1
  39. package/src/styles.css +8 -10
  40. package/src/theme.ts +5 -5
  41. package/src/themes/bootstrap.ts +1 -1
  42. package/src/themes/default.css +2 -2
  43. package/src/themes/default.ts +12 -3
  44. package/src/themes/material.ts +12 -3
  45. package/src/util.ts +12 -14
  46. package/dist/form-bootstrap.js.LICENSE.txt +0 -69
  47. package/dist/form-default.js.LICENSE.txt +0 -69
  48. package/dist/form-material.js.LICENSE.txt +0 -69
  49. package/dist/plugins/file-upload.js +0 -1
  50. package/dist/plugins/fixed-list.js +0 -1
  51. package/dist/plugins/leaflet.js.LICENSE.txt +0 -4
  52. package/dist/plugins/mapbox.js.LICENSE.txt +0 -10
@@ -1,2 +1,670 @@
1
- /*! For license information please see form-material.js.LICENSE.txt */
2
- import*as e from"mdui";var t={92:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const r=n(103);class i{fromRdf(e,t){switch(e.value){case"true":case"1":return!0;case"false":case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},103:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const n of t)this.supportedRdfDatatypes.push(n),this.fromRdfHandlers[n.value]=e;for(const t of n){let n=this.toRdfHandlers[t];n||(this.toRdfHandlers[t]=n=[]),n.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},251:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+e[t+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=c}return(f?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(t*l-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+f]=255&s,f+=p,s/=256,c-=8);e[n+f-p]|=128*g}},259:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},277:(e,t,n)=>{const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=n(4134),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:x}}=n(6371),{normalizeEncoding:S}=n(7760),{isAsyncFunction:j,isArrayBufferView:I}=n(7760).types,E={},N=/^[0-7]+$/,T=m(((e,t,n=u,r=c)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),R=m(((e,t,n=-2147483648,r=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),O=m(((e,t,n=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new _(t,`>= ${r} && <= ${i}`,e)}));function k(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const L=m(((e,t,n)=>{if(!i(n,e)){const r=o(s(n,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,"must be one of: "+r)}}));function A(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function C(e,t,n){return null!=e&&h(e,t)?e[t]:n}const D=m(((e,t,n=null)=>{const i=C(n,"allowArray",!1),o=C(n,"allowFunction",!1);if(!C(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new v(t,"Object",e)})),M=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),P=m(((e,t,n=0)=>{if(!r(e))throw new v(t,"Array",e);if(e.length<n)throw new w(t,e,`must be longer than ${n}`)})),$=m(((e,t="buffer")=>{if(!I(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),B=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),F=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),q=m(((e,t)=>{if("function"!=typeof e||j(e))throw new v(t,"Function",e)})),U=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!f(G,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if(void 0===e&&(e=n),"string"==typeof e){if(null===f(N,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return O(e,t),e},validateArray:P,validateStringArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)k(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)A(e[n],`${t}[${n}]`)},validateAbortSignalArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++){const r=e[n],i=`${t}[${n}]`;if(null==r)throw new v(i,"AbortSignal",r);B(r,i)}},validateBoolean:A,validateBuffer:$,validateDictionary:M,validateEncoding:function(e,t){const n=S(t),r=e.length;if("hex"===n&&r%2!=0)throw new w("encoding",t,`is invalid for data of length ${r}`)},validateFunction:F,validateInt32:R,validateInteger:T,validateNumber:function(e,t,n=void 0,r){if("number"!=typeof e)throw new v(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new _(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:D,validateOneOf:L,validatePlainFunction:q,validatePort:function(e,t="Port",n=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new b(t,e,n);return 0|e},validateSignalName:function(e,t="signal"){if(k(e,t),void 0===E[e]){if(void 0!==E[g(e)])throw new x(e+" (signals must use all capital letters)");throw new x(e)}},validateString:k,validateUint32:O,validateUndefined:U,validateUnion:function(e,t,n){if(!i(n,e))throw new v(t,`('${o(n,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];V(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},345:(e,t,n)=>{const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=n(4134),{Buffer:a}=n(8287),{inspect:l}=n(7760);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)o(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),n=e;let r=this.head,i=0;do{const a=r.data;if(!(e>a.length)){e===a.length?(o(t,a,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}o(t,a,n-e),e-=a.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},378:(e,t,n)=>{const r=n(3751),i=n(2438);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,r="r"}const s=this.hashRelatedBlankNode(o,i,t,r),a=n.get(s);a?a.push(o):n.set(s,[o])}return n}}},458:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(3476);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING,this.direction=""):t?"termType"in t?(this.language="",this.datatype=t,this.direction=""):(this.language=t.language,this.datatype=t.direction?i.RDF_DIRECTIONAL_LANGUAGE_STRING:i.RDF_LANGUAGE_STRING,this.direction=t.direction||""):(this.language="",this.datatype=i.XSD_STRING,this.direction="")}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&(e.direction===this.direction||!e.direction&&""===this.direction)&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},470:(e,t,n)=>{const r=n(7382),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let s=r.keys.length;for(;s--;)n[r.keys[s]]=void 0===o[s]?null:o[s];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,null!==n.query?o.query=n.query:o.query=e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==n.fragment&&(s+="#"+n.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},701:(e,t,n)=>{const r=n(6957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},823:(e,t,n)=>{const r=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=n(6371),{validateAbortSignal:c,validateInteger:u,validateObject:d}=n(277),h=n(4134).Symbol("kWeak"),f=n(4134).Symbol("kResistStopPropagation"),{finished:p}=n(6238),g=n(7830),{addAbortSignalNoValidate:y}=n(4147),{isWritable:m,isNodeStream:b}=n(6115),{deprecate:v}=n(7760),{ArrayPrototypePush:w,Boolean:_,MathFloor:x,Number:S,NumberIsNaN:j,Promise:I,PromiseReject:E,PromiseResolve:N,PromisePrototypeThen:T,Symbol:R}=n(4134),O=R("kEmpty"),k=R("kEof");function L(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let r=1;null!=(null==t?void 0:t.concurrency)&&(r=x(t.concurrency));let i=r-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=x(t.highWaterMark)),u(r,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=r,async function*(){const o=n(7760).AbortSignalAny([null==t?void 0:t.signal].filter(_)),s=this,a=[],c={signal:o};let u,d,h=!1,f=0;function p(){h=!0,g()}function g(){f-=1,y()}function y(){d&&!h&&f<r&&a.length<i&&(d(),d=null)}!async function(){try{for await(let t of s){if(h)return;if(o.aborted)throw new l;try{if(t=e(t,c),t===O)continue;t=N(t)}catch(e){t=E(e)}f+=1,T(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||f>=r)&&await new I((e=>{d=e}))}a.push(k)}catch(e){const t=E(e);T(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===k)return;if(o.aborted)throw new l;e!==O&&(yield e),a.shift(),y()}await new I((e=>{u=e}))}}finally{h=!0,d&&(d(),d=null)}}.call(this)}async function A(e,t=void 0){for await(const n of C.call(this,e,t))return!0;return!1}function C(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return L.call(this,(async function(t,n){return await e(t,n)?t:O}),t)}class D extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=S(e),j(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield n)}}.call(this)},filter:C,flatMap:function(e,t){const n=L.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:L,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!m(e))throw new i("stream",e,"must be writable");const n=g(this,e);return null!=t&&t.signal&&y(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await A.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const n of L.call(this,(async function(t,n){return await e(t,n),O}),t));},reduce:async function(e,t,n){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=n&&d(n,"options"),null!=(null==n?void 0:n.signal)&&c(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const a=new r,u=a.signal;if(null!=n&&n.signal){const e={once:!0,[h]:this,[f]:!0};n.signal.addEventListener("abort",(()=>a.abort()),e)}let g=!1;try{for await(const r of this){var y;if(g=!0,null!=n&&null!==(y=n.signal)&&void 0!==y&&y.aborted)throw new l;s?t=await e(t,r,{signal:u}):(t=r,s=!0)}if(!g&&!s)throw new D}finally{a.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,r)}return t},some:A,find:async function(e,t){for await(const n of C.call(this,e,t))return n}}},989:(e,t,n)=>{e.exports=n(4005)},1058:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:o,isString:s,isUndefined:a}=n(7382),{isList:l,isValue:c,isGraph:u,isSimpleGraph:d,isSubjectReference:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{removeBase:b,prependBase:v}=n(470),{REGEX_KEYWORD:w,addValue:_,asArray:x,compareShortestLeast:S}=n(9263),j={};function I(e,t,n){if("@nest"!==f(e,t,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:f={}})=>{if(i(n)){let r=[];for(let i=0;i<n.length;++i){const o=await j.compact({activeCtx:e,activeProperty:t,element:n[i],options:f});null!==o&&r.push(o)}return f.compactArrays&&1===r.length&&0===(p(e,t,"@container")||[]).length&&(r=r[0]),r}const b=p(e,t,"@context");if(a(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:f})),o(n)){if(f.link&&"@id"in n&&f.link.hasOwnProperty(n["@id"])){const e=f.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(c(n)||h(n)){const r=j.compactValue({activeCtx:e,activeProperty:t,value:n,options:f});return f.link&&h(n)&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:r})),r}if(l(n)&&(p(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:f});const b="@reverse"===t,v={},w=e;c(n)||h(n)||(e=e.revertToPreviousContext());const S=p(w,t,"@context");a(S)||(e=await y({activeCtx:e,localCtx:S,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in n&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:v}));let E=n["@type"]||[];E.length>1&&(E=Array.from(E).sort());const N=e;for(const t of E){const n=j.compactIri({activeCtx:N,iri:t,relativeTo:{vocab:!0}}),r=p(w,n,"@context");a(r)||(e=await y({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const T=Object.keys(n).sort();for(const a of T){const h=n[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,t,h)}else{if(!i(h))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const t=j.compactIri({activeCtx:e,iri:a,value:h,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=v;n&&(I(e,n,f),o(v[n])||(v[n]={}),r=v[n]),_(r,t,h,{propertyIsArray:!0})}for(const t of h){const n=j.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let h=v;r&&(I(e,r,f),o(v[r])||(v[r]={}),h=v[r]);const g=p(e,n,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let S=await j.compact({activeCtx:e,activeProperty:n,element:m||y?w:t,options:f});if(m){if(i(S)||(S=[S]),g.includes("@list")){_(h,n,S,{valueIsArray:!0,allowDuplicate:!0});continue}S={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:S},"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&d(t))){let r;h.hasOwnProperty(n)?r=h[n]:h[n]=r={};const i=(g.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});_(r,i,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&d(t)?(i(S)&&S.length>1&&(S={"@included":S}),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(S)&&1===S.length&&f.compactArrays&&(S=S[0]),S={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:S},"@id"in t&&(S[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let r,i;if(h.hasOwnProperty(n)?r=h[n]:h[n]=r={},g.includes("@language"))c(S)&&(S=S["@value"]),i=t["@language"];else if(g.includes("@index")){const r=p(e,n,"@index")||"@index",o=j.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete S[o];else{let e;if([i,...e]=x(S[r]||[]),s(i))switch(e.length){case 0:delete S[r];break;case 1:S[r]=e[0];break;default:S[r]=e}else i=null}}else if(g.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=S[t],delete S[t]}else if(g.includes("@type")){const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=x(S[r]||[]),o.length){case 0:delete S[r];break;case 1:S[r]=o[0];break;default:S[r]=o}1===Object.keys(S).length&&"@id"in t&&(S=await j.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),_(r,i,S,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(S)&&0===S.length||"@list"===a||"@graph"===a;_(h,n,S,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,h)}else{const n=await j.compact({activeCtx:e,activeProperty:t,element:h,options:f});i(n)&&0===n.length||_(v,a,n)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:h,options:f});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(p(e,n,"@container")||[]).includes("@set")||!f.compactArrays;_(v,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,t)}}else{let t=x(h).map((e=>j.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(p(e,n,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===h.length;_(v,n,t,{propertyIsArray:r})}else{let t=x(h).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),v[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return v}return n},j.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const d=e.getInverse();if(g(t)&&t in d&&"@none"in d[t]&&"@type"in d[t]["@none"]&&"@none"in d[t]["@none"]["@type"])return d[t]["@none"]["@type"]["@none"];if(i.vocab&&t in d){const r=e["@language"]||"@none",i=[];o(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),u(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):o(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let a="@language",d="@null";if(s)a="@type",d="@reverse",i.push("@set");else if(l(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)a="@any",d="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;r<e.length;++r){const i=e[r];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===n?n=s:s!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(a="@type",d=n):d=t}}else{if(c(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),d=n["@language"];const e=n["@direction"];e&&(d=`${d}_${e}`)}else"@direction"in n&&!("@index"in n)?d=`_${n["@direction"]}`:"@type"in n&&(a="@type",d=n["@type"]);else a="@type",d="@id";i.push("@set")}i.push("@none"),o(n)&&!("@index"in n)&&i.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const h=function(e,t,n,r,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(n)&&"@id"in n){"@reverse"===s&&a.push("@reverse");const t=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of r){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,n,i,a,d);if(null!==h)return h}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let h=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let r=f.length-1;r>=0;--r){const i=f[r],o=i.terms;for(const r of o){const o=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===h||S(o,h)<0)&&(h=o)}}if(null!==h)return h;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const n=b(v(a,e["@base"]),t);return w.test(n)?`./${n}`:n}return t}return b(a,t)}return t},j.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){const r=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in n&&!a.includes("@index");if(!l&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===o)return n["@value"]}const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,d="@language"in e,h=s(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==r&&(!d||!h||f))return n["@value"];const g={};return l&&(g[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?g[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(g[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(g[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),g[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],g}const i=f(e,t,{vocab:!0},r),o=p(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},1227:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",r="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",i="[ \\t]+",o="[ \\t]*",s="(?:"+e+"|"+r+")"+i,l=e+i,c="(?:"+e+"|"+r+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+o,u="(?:\\.|(?:(?:"+e+"|"+r+")"+o+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+o+"$"),a.quad=new RegExp("^"+o+s+l+c+u+o+"$")})(),e.exports=class e{static parse(e){const l=[],u={},d=e.split(a.eoln);let h=0;for(const e of d){if(h++,a.empty.test(e))continue;const d=e.match(a.quad);if(null===d)throw new Error("N-Quads parse error on line "+h+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?g.subject={termType:r,value:d[1]}:g.subject={termType:i,value:d[2]},g.predicate={termType:r,value:d[3]},void 0!==d[4]?g.object={termType:r,value:d[4]}:void 0!==d[5]?g.object={termType:i,value:d[5]}:(g.object={termType:o,value:void 0,datatype:{termType:r}},void 0!==d[7]?g.object.datatype.value=d[7]:void 0!==d[8]?(g.object.datatype.value=t,g.object.language=d[8]):g.object.datatype.value=n,g.object.value=d[6].replace(c,(function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")}))),void 0!==d[9]?g.graph={termType:r,value:d[9]}:void 0!==d[10]?g.graph={termType:i,value:d[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const n of t)if(p=g,(f=n).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==o||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===r?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===r?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==n&&(c+=`^^<${s.datatype.value}>`)),a.termType===r?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:r,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:r},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=n)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:r,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},1972:(e,t,n)=>{const r=n(9263),i=n(2207),{isArray:o,isObject:s,isString:a,isUndefined:l}=n(7382),{isAbsolute:c,isRelative:u,prependBase:d}=n(470),{handleEvent:h}=n(2246),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=n(9263),m=new Map,b={};function v(e,t,n,r,i,o){if(null===t||!a(t)||b.isKeyword(t))return t;if(t.match(p))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(s(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),s=t.substr(l+1);if("_"===n||0===s.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const a=e.mappings.get(n);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let n,r;"@base"in e?e["@base"]?(r=d(o.base,e["@base"]),n=d(r,t)):(r=e["@base"],n=t):(r=o.base,n=d(o.base,t)),t=n}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)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 n=0;n<e.length;++n)if(!w(e[n],t[n]))return!1;return!0}const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const n in e){let r=e[n],i=t[n];if("@container"===n&&Array.isArray(r)&&Array.isArray(i)&&(r=r.slice().sort(),i=i.slice().sort()),!w(r,i))return!1}return!0}e.exports=b,b.process=async({activeCtx:e,localCtx:t,options:n,propagate:r=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];n.eventHandler&&m.push(n.eventHandler);const w=n;n={...n,eventHandler:m};const _=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});s(_[0].document)&&"boolean"==typeof _[0].document["@propagate"]&&(r=_[0].document["@propagate"]);let x=e;r||x.previousContext||(x=x.clone(),x.previousContext=e);for(const r of _){let{document:o}=r;if(e=x,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});x=e=b.getInitialContext(n).clone();continue}const g=r.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)h({event:e,options:w});x=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});x=x.clone();const m=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});x.processingMode="json-ld-1.1",x["@version"]=o["@version"],m.set("@version",!0)}if(x.processingMode=x.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(e))throw new i('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:o});e=d(x["@base"],e)}x["@base"]=e,m.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete x["@vocab"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});if(!c(e)&&b.processingMode(x,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});{const t=v(x,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),x["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete x["@language"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:o});e.match(f)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),x["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in o){const t=o["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:o});if(null===t)delete x["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:o});x["@direction"]=t}m.set("@direction",!0)}if("@propagate"in o){const n=o["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in o){const r=o["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if(!a(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const n=s[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)o.hasOwnProperty(e)||(o[e]=n[e]);s[0].setProcessed(e,o)}m.set("@import",!0)}m.set("@protected",o["@protected"]||!1);for(const e in o)if(b.createTermDefinition({activeCtx:x,localCtx:o,term:e,defined:m,options:n,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let r=!0;if(a(t)){const e=d(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await b.process({activeCtx:x.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:n,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}r.setProcessed(e,{context:x,events:y})}return x},b.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:l,overrideProtected:u=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&s(d)&&"@set"===(d["@container"]||"@set")&&b.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);if(0===r.length||r.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(b.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(p))return void(l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let g=!1;if((a(d)||null===d)&&(g=!0,d={"@id":d}),!s(d))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(n,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];b.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in d)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(y._termHasColon=_>0,"@reverse"in d){if("@id"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=d["@reverse"];if(!a(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));const s=v(e,o,{vocab:!0,base:!1},t,r,l);if(!c(s))throw new i("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});y["@id"]=s,y.reverse=!0}else if("@id"in d){let o=d["@id"];if(o&&!a(o))throw new i("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(null===o)y["@id"]=null;else{if(!b.isKeyword(o)&&o.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));if(o!==n){if(o=v(e,o,{vocab:!0,base:!1},t,r,l),!c(o)&&!b.isKeyword(o))throw new i("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(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),l)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=o,y._prefix=g&&!y._termHasColon&&null!==o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=n.substr(0,_);if(t.hasOwnProperty(i)&&b.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:l}),e.mappings.has(i)){const t=n.substr(_+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=n}else if("@type"===n)y["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});y["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,y.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!a(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(b.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,l),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("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})}y["@type"]=n}if("@container"in d){const n=a(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let s=!0;const l=n.includes("@set");if(b.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("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 s&=n.length<=(l?2:1);if(n.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else s&=!o(d["@container"]),s&=n.length<=1;if(s&=n.every((e=>r.includes(e))),s&=!(l&&n.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new i("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});y["@container"]=n}if("@index"in d){if(!("@container"in d)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(d["@index"])||0===d["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=d["@index"]}if("@context"in d&&(y["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!a(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in d){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(b.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("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});y["@nest"]=e}const x=y["@id"];if("@context"===x||"@preserve"===x)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[n]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},b.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),b.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=m.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const d=b.isKeyword(l);if(u)d||o._termHasColon||r[l].push(e);else if(t[l]=u={},!d&&!o._termHasColon){r[l]=[e];const t={iri:l,terms:r[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],n=o["@direction"];s(e,u["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in n)o(n,e,1);return t},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===m.size&&m.clear(),m.set(t,i),i;function o(e,t,n){const r=e[t],i=e[t]={};let s,a;for(const e of r)s=e.iri,a=n>=s.length?"":s[n],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,n+1)}function s(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},b.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(l(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},b.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,b.isKeyword=e=>{if(!a(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}},2177:(e,t,n)=>{var r=n(1489);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},2207:e=>{e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},2246:(e,t,n)=>{const r=n(2207),{isArray:i}=n(7382),{asArray:o}=n(9263),s={};function a({event:e,handlers:t}){let n=!0;for(let o=0;n&&o<t.length;++o){n=!1;const s=t[o];if(i(s))n=a({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{n=!0}});else{if("object"!=typeof s)throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=s,s.defaultEventHandler=null,s.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?s.safeEventHandler:[],e.eventHandler?o(e.eventHandler):[],s.defaultEventHandler?s.defaultEventHandler:[]);return 0===t.length?null:t},s.handleEvent=({event:e,options:t})=>{a({event:e,handlers:t.eventHandler})};const l=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","rdfDirection not set"]);s.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&l.has(e.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},s.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},s.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},s.unhandledEventHandler=function({event:e}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:e})},s.setDefaultEventHandler=function({eventHandler:e}={}){s.defaultEventHandler=e?o(e):null}},2341:e=>{e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])),"")+"}"}},2406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},2438:(e,t,n)=>{const r=n(2985),i=n(3751),o=n(9925),s=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const n=t.get(e);if(n.length>1){o.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of o){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(s.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(r),"g"!==r&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){r.update(e);let n,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let r=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),i+=r.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,n=r)}}r.update(s),t=n}return{hash:r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,n),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},2791:function(e,t,n){!function(e){if(!e.setImmediate){var t,n,r,i,o,s=1,a={},l=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),t=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,t=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):t=function(e){setTimeout(h,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1];var i={callback:e,args:n};return a[s]=i,t(s),s++},u.clearImmediate=d}function d(e){delete a[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=a[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},2946:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},2985:e=>{e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},3067:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},3095:(e,t,n)=>{const{ArrayPrototypePop:r,Promise:i}=n(4134),{isIterable:o,isNodeStream:s,isWebStream:a}=n(6115),{pipelineImpl:l}=n(7758),{finished:c}=n(6238);n(5506),e.exports={finished:c,pipeline:function(...e){return new i(((t,n)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!o(u)&&!a(u)){const t=r(e);i=t.signal,c=t.end}l(e,((e,r)=>{e?n(e):t(r)}),{signal:i,end:c})}))}}},3141:(e,t,n)=>{var r=n(5003).Buffer,i=r.isEncoding||function(e){switch((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 o(e){var t;switch(this.encoding=function(e){var t=function(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}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3370:(e,t,n)=>{const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=n(4134);e.exports=c;const a=n(7576),l=n(8584);s(c.prototype,a.prototype),s(c,a);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];c.prototype[n]||(c.prototype[n]=l.prototype[n])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,d;function h(){return void 0===u&&(u={}),u}r(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return d||(d=n(6706)),d(e,"body")}},3476:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},3513:(e,t,n)=>{const r=n(2985),i=n(3751),o=n(9925),s=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let i=0;for(const e of n)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const n=t.get(e);if(n.length>1){l.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=await this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(s.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=await i.digest(),n.hash}async hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(r),"g"!==r&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){r.update(e);let n,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let r=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),i+=r.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,n=r)}}r.update(s),t=n}return{hash:await r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const o of r)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,n),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},3617:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3067),t),i(n(8339),t),i(n(4878),t),i(n(458),t),i(n(3476),t),i(n(2946),t),i(n(7265),t)},3743:e=>{e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},3751:(e,t,n)=>{n(2791);const r=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await r.subtle.digest(this.algorithm,e));let n="";for(let e=0;e<t.length;++e)n+=t[e].toString(16).padStart(2,"0");return n}}},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3845:(e,t,n)=>{const r=n(3751),i=n(3513);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const o of r){let r,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,r="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,r),l=n.get(a);l?l.push(s):n.set(a,[s])}return n}}},3947:(e,t,n)=>{const r=n(2207),i=n(3978),o=n(7382),{REGEX_BCP47:s,addValue:a}=n(9263),{handleEvent:l}=n(2246),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:d,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:b}=n(9378),v={};function w(e,t,n,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=b),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,b].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==b&&(a["@type"]=c)}return a}e.exports=v,v.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:s=!1,rdfDirection:l=null}=t,p={},g={"@default":p},y={};if(l){if("compound-literal"===l)throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:l});if("i18n-datatype"!==l)throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:l})}for(const r of e){const e="DefaultGraph"===r.graph.termType?"@default":r.graph.value;e in g||(g[e]={}),"@default"===e||e in p||(p[e]={"@id":e});const i=g[e],o=r.subject.value,c=r.predicate.value,u=r.object;o in i||(i[o]={"@id":o});const d=i[o],m=u.termType.endsWith("Node");if(m&&!(u.value in i)&&(i[u.value]={"@id":u.value}),c===f&&!n&&m){a(d,"@type",u.value,{propertyIsArray:!0});continue}const b=w(u,s,l,t);if(a(d,c,b,{propertyIsArray:!0}),m)if(u.value===h){const e=i[u.value];"usages"in e||(e.usages=[]),e.usages.push({node:d,property:c,value:b})}else u.value in y?y[u.value]=!1:y[u.value]={node:d,property:c,value:b}}for(const e in g){const t=g[e];if(!(h in t))continue;const n=t[h];if(n.usages){for(let e of n.usages){let n=e.node,r=e.property,s=e.value;const a=[],l=[];let h=Object.keys(n).length;for(;r===d&&o.isObject(y[n["@id"]])&&o.isArray(n[u])&&1===n[u].length&&o.isArray(n[d])&&1===n[d].length&&(3===h||4===h&&o.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(a.push(n[u][0]),l.push(n["@id"]),e=y[n["@id"]],n=e.node,r=e.property,s=e.value,h=Object.keys(n).length,i.isBlankNode(n)););delete s["@id"],s["@list"]=a.reverse();for(const e of l)delete t[e]}delete n.usages}}const m=[],b=Object.keys(p).sort();for(const e of b){const t=p[e];if(e in g){const n=t["@graph"]=[],r=g[e],o=Object.keys(r).sort();for(const e of o){const t=r[e];i.isSubjectReference(t)||n.push(t)}}i.isSubjectReference(t)||m.push(t)}return m}},3978:(e,t,n)=>{const r=n(7382),i={};e.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(r.isObject(e)){if("@id"in e){const t=e["@id"];return!r.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},4005:(e,t,n)=>{const r=n(3513),i=n(3845),o=n(2438),s=n(378);let a;try{a=n(7789)}catch(e){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(1227),t.IdentifierIssuer=n(2985),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,r)=>a.canonize(n,t,((t,n)=>t?r(t):e(n)))))}if("URDNA2015"===t.algorithm)return new r(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new o(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},4019:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=n(7382),{isList:c,isValue:u,isGraph:d,isSubject:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{isAbsolute:b}=n(470),{REGEX_BCP47:v,REGEX_KEYWORD:w,addValue:_,asArray:x,getValues:S,validateTypeValue:j}=n(9263),{handleEvent:I}=n(2246),E={};function N({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let r,i;0===t?(r="empty object",i="Dropping empty object."):"@value"in e?(r="object with only @value",i="Dropping object with only @value."):"@list"in e?(r="object with only @list",i="Dropping object with only @list."):1===t&&"@id"in e&&(r="object with only @id",i="Dropping object with only @id."),I({event:{type:["JsonLdEvent"],code:r,level:"warning",message:i,details:{value:e}},options:n})}return null}return e}async function T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:d,expandedParent:w,options:S={},insideList:R,typeKey:L,typeScopedContext:A}){const C=Object.keys(d).sort(),D=[];let M;const P=d[L]&&"@json"===f(e,i(d[L])?d[L][0]:d[L],{vocab:!0},{...S,typeExpansion:!0});for(const T of C){let R,L=d[T];if("@context"===T)continue;const C=f(e,T,{vocab:!0},S);if(null===C||!b(C)&&!g(C)){S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:T,expandedProperty:C}},options:S});continue}if(g(C)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(C in w&&"@included"!==C&&"@type"!==C)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(L)){if(!S.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(o(L)){if(!s(L))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:L})}else{if(!i(L))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:L});if(!L.every((e=>a(e))))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:L})}}_(w,"@id",x(L).map((t=>{if(a(t)){const n=f(e,t,{base:!0},S);return S.eventHandler&&(null===n?I(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:S}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:S}):b(n)||I({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:S})),n}return t})),{propertyIsArray:S.isFrame});continue}if("@type"===C){o(L)&&(L=Object.fromEntries(Object.entries(L).map((([e,t])=>[f(A,e,{vocab:!0}),x(t).map((e=>f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0})))])))),j(L,S.isFrame),_(w,"@type",x(L).map((e=>{if(a(e)){const t=f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0});return"@json"===t||b(t)||S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:S}),t}return e})),{propertyIsArray:!!S.isFrame});continue}if("@included"===C&&m(e,1.1)){const n=x(await E.expand({activeCtx:e,activeProperty:t,element:L,options:S}));if(!n.every((e=>h(e))))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});_(w,"@included",n,{propertyIsArray:!0});continue}if("@graph"===C&&!o(L)&&!i(L))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===C){M=L,P&&m(e,1.1)?w["@value"]=L:_(w,"@value",L,{propertyIsArray:S.isFrame});continue}if("@language"===C){if(null===L)continue;if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=x(L).map((e=>a(e)?e.toLowerCase():e));for(const e of L)a(e)&&!e.match(v)&&S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:S});_(w,"@language",L,{propertyIsArray:S.isFrame});continue}if("@direction"===C){if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=x(L);for(const e of L)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});_(w,"@direction",L,{propertyIsArray:S.isFrame});continue}if("@index"===C){if(!a(L))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});_(w,"@index",L);continue}if("@reverse"===C){if(!o(L))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(R=await E.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:S}),"@reverse"in R)for(const e in R["@reverse"])_(w,e,R["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in R){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),_(t,e,[],{propertyIsArray:!0});const n=R[e];for(let i=0;i<n.length;++i){const o=n[i];if(u(o)||c(o))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(T);continue}let $=e;const B=p(e,T,"@context");l(B)||($=await y({activeCtx:e,localCtx:B,propagate:!0,overrideProtected:!0,options:S}));const F=p(e,T,"@container")||[];if(F.includes("@language")&&o(L))R=O($,L,p($,T,"@direction"),S);else if(F.includes("@index")&&o(L)){const t=F.includes("@graph"),n=p($,T,"@index")||"@index",r="@index"!==n&&f(e,n,{vocab:!0},S);R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:t,indexKey:n,propertyIndex:r})}else if(F.includes("@id")&&o(L)){const e=F.includes("@graph");R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:e,indexKey:"@id"})}else if(F.includes("@type")&&o(L))R=await k({activeCtx:$.revertToPreviousContext(),options:S,activeProperty:T,value:L,asGraph:!1,indexKey:"@type"});else{const r="@list"===C;if(r||"@set"===C){let e=t;r&&"@graph"===n&&(e=null),R=await E.expand({activeCtx:$,activeProperty:e,element:L,options:S,insideList:r})}else R="@json"===p(e,T,"@type")?{"@type":"@json","@value":L}:await E.expand({activeCtx:$,activeProperty:T,element:L,options:S,insideList:!1})}if(null!==R||"@value"===C){if("@list"!==C&&!c(R)&&F.includes("@list")&&(R={"@list":x(R)}),F.includes("@graph")&&!F.some((e=>"@id"===e||"@index"===e))){if(R=x(R),S.isFrame||(R=R.filter((e=>null!==N({value:e,count:Object.keys(e).length,options:S})))),0===R.length)continue;R=R.map((e=>({"@graph":x(e)})))}if($.mappings.has(T)&&$.mappings.get(T).reverse){const e=w["@reverse"]=w["@reverse"]||{};R=x(R);for(let t=0;t<R.length;++t){const n=R[t];if(u(n)||c(n))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(e,C,n,{propertyIsArray:!0})}}else _(w,C,R,{propertyIsArray:!0})}}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((o(M)||i(M))&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:M});for(const s of D){const a=i(d[s])?d[s]:[d[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},S))))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:w,options:S,insideList:R,typeScopedContext:A,typeKey:L})}}}function R({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},{...r,typeExpansion:!0});const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(n)){const i=f(e,n,{base:!0},r);return null===i&&n.match(w)&&r.eventHandler&&I({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}),{"@id":i}}if("@vocab"===o&&a(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(g(i))return n;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(n)){const n=p(e,t,"@language");null!==n&&(s["@language"]=n);const r=p(e,t,"@direction");null!==r&&(s["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),s["@value"]=n,s}function O(e,t,n,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(v)||o.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),s.push(i)}}return s}async function k({activeCtx:e,options:t,activeProperty:n,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const h=[],g=Object.keys(o).sort(),m="@type"===a;for(let b of g){if(m){const n=p(e,b,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let g,v=o[b];i(v)||(v=[v]),v=await E.expand({activeCtx:e,activeProperty:n,element:v,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===b?"@none":R({activeCtx:e,activeProperty:a,value:b,options:t}):f(e,b,{vocab:!0},t),"@id"===a?b=f(e,b,{base:!0},t):m&&(b=g);for(let e of v){if(s&&!d(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(u(e)&&!["@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:e});c?"@none"!==g&&_(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=b)}h.push(e)}}return h}e.exports=E,E.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:u=!1,insideIndex:d=!1,typeScopedContext:h=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(n)&&!o(n))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?R({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(i(n)){let r=[];const o=p(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<n.length;++o){let s=await E.expand({activeCtx:e,activeProperty:t,element:n[o],options:c,insideIndex:d,typeScopedContext:h});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?r=r.concat(s):r.push(s))}return r}const g=f(e,t,{vocab:!0},c),v=p(e,t,"@context");h=h||(e.previousContext?e:null);let w=Object.keys(n).sort(),_=!d;if(_&&h&&w.length<=2&&!w.includes("@context"))for(const t of w){const n=f(h,t,{vocab:!0},c);if("@value"===n){_=!1,e=h;break}if("@id"===n&&1===w.length){_=!1;break}}_&&(e=e.revertToPreviousContext()),l(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:c})),"@context"in n&&(e=await y({activeCtx:e,localCtx:n["@context"],options:c})),h=e;let j=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){j=j||t;const r=n[t],i=Array.isArray(r)?r.length>1?r.slice().sort():r:[r];for(const t of i){const n=p(h,t,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let O={};await T({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:n,expandedParent:O,options:c,insideList:u,typeKey:j,typeScopedContext:h}),w=Object.keys(O);let k=w.length;if("@value"in O){if("@type"in O&&("@language"in O||"@direction"in O))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:O});let t=k-1;if("@type"in O&&(t-=1),"@index"in O&&(t-=1),"@language"in O&&(t-=1),"@direction"in O&&(t-=1),0!==t)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:O});const n=null===O["@value"]?[]:x(O["@value"]),i=S(O,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===n.length)c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:O}},options:c}),O=null;else{if(!n.every((e=>a(e)||s(e)))&&"@language"in O)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:O});if(!i.every((e=>b(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))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:O})}}else if("@type"in O&&!i(O["@type"]))O["@type"]=[O["@type"]];else if("@set"in O||"@list"in O){if(k>1&&(2!==k||!("@index"in O)))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:O});"@set"in O&&(O=O["@set"],w=Object.keys(O),k=w.length)}else 1===k&&"@language"in O&&(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:O}},options:c}),O=null);return!o(O)||c.keepFreeFloatingNodes||u||null!==t&&"@graph"!==g&&!(p(e,t,"@container")||[]).includes("@graph")||(O=N({value:O,count:k,options:c})),O}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},4134:e=>{e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error,FunctionPrototypeCall:(e,t,...n)=>e.call(t,...n),FunctionPrototypeSymbolHasInstance:(e,t)=>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)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Boolean,Uint8Array}},4147:(e,t,n)=>{const{SymbolDispose:r}=n(4134),{AbortError:i,codes:o}=n(6371),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=n(6115),c=n(6238),{ERR_INVALID_ARG_TYPE:u}=o;let d;e.exports.addAbortSignal=function(t,n){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(n)&&!a(n))throw new u("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{d=d||n(7760).addAbortListener;const i=d(e,o);c(t,i[r])}return t}},4191:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class n{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},4259:(e,t,n)=>{const{ArrayIsArray:r,ObjectSetPrototypeOf:i}=n(4134),{EventEmitter:o}=n(7007);function s(e){o.call(this,e)}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){d(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function d(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",c),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",d),n.removeListener("close",d),e.removeListener("close",d)}return a(n,"error",u),a(e,"error",u),n.on("end",d),n.on("close",d),e.on("close",d),e.emit("pipe",n),e},e.exports={Stream:s,prependListener:a}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},4802:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(92),t),i(n(7258),t),i(n(2406),t),i(n(6925),t),i(n(4191),t)},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4841:(e,t,n)=>{const r=n(989),i=n(701),o=n(9263),s=n(7034),a=o.IdentifierIssuer,l=n(2207),c=n(9749),u=n(8229),{expand:d}=n(4019),{flatten:h}=n(5229),{fromRDF:f}=n(3947),{toRDF:p}=n(9180),{frameMergedOrDefault:g,cleanupNull:y}=n(7946),{isArray:m,isObject:b,isString:v}=n(7382),{isSubjectReference:w}=n(3978),{expandIri:_,getInitialContext:x,process:S,processingMode:j}=n(1972),{compact:I,compactIri:E}=n(1058),{createNodeMap:N,createMergedNodeMap:T,mergeNodeMaps:R}=n(9233),{logEventHandler:O,logWarningEventHandler:k,safeEventHandler:L,setDefaultEventHandler:A,setupEventHandler:C,strictEventHandler:D,unhandledEventHandler:M}=n(2246),P=function(e){const t={},P=new c({max:100});function $(t,{documentLoader:n=e.documentLoader,...r}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},r,t,{eventHandler:C({options:t})})}return e.compact=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(r=$(r,{base:v(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:P})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?t:await e.expand(t,r);const c=await e.processContext(x(r),n,r);let u=await I({activeCtx:c,element:i,options:r});r.compactArrays&&!r.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):r.graph&&b(u)&&(u=[u]),b(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),m(n)||(n=[n]);const d=n;n=[];for(let e=0;e<d.length;++e)(!b(d[e])||Object.keys(d[e]).length>0)&&n.push(d[e]);const h=n.length>0;if(1===n.length&&(n=n[0]),m(u)){const e=E({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},h&&(u["@context"]=n),u[e]=t}else if(b(u)&&h){const e=u;u={"@context":n};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const r={},i=[];if("expandContext"in(n=$(n,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:P})}))){const e=o.clone(n.expandContext);b(e)&&"@context"in e?r.expandContext=e:r.expandContext={"@context":e},i.push(r.expandContext)}let a;if(v(t)){const o=await e.get(t,n);a=o.documentUrl,r.input=o.document,o.contextUrl&&(r.remoteContext={"@context":o.contextUrl},i.push(r.remoteContext))}else r.input=o.clone(t);"base"in n||(n.base=a||"");let l=x(n);for(const e of i)l=await S({activeCtx:l,localCtx:e,options:n});let c=await d({activeCtx:l,element:r.input,options:n});return b(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=$(r,{base:v(t)?t:"",contextResolver:new s({sharedCache:P})});const i=await e.expand(t,r),o=h(i);return null===n?o:(r.graph=!0,r.skipExpansion=!0,await e.compact(o,n,r))},e.frame=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=$(r,{base:v(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:P})}),v(n)){const t=await e.get(n,r);if(n=t.document,t.contextUrl){let e=n["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},o=await e.processContext(x(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=j(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=j(o,1.1));const a=await e.expand(t,r),l={...r};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),u=Object.keys(n).map((e=>_(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=j(o,1.1);const d=g(a,c,l);l.graph=!r.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let h=await e.compact(d,i,l);return l.link={},h=y(h,l),h},e.link=async function(t,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,r)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=$(n,{base:v(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:P})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return r.canonize(e,n)}const i={...n};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return r.canonize(o,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=$(n,{format:v(e)?"application/n-quads":void 0});const{format:r}=n;let{rdfParser:i}=n;if(r){if(i=i||t[r],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=await i(e);return f(o,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=$(n,{base:v(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:P})})).skipExpansion?t:await e.expand(t,n);const i=p(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=$(n,{base:v(t)?t:"",contextResolver:new s({sharedCache:P})});const r=await e.expand(t,n);return T(r,n)},e.merge=async function(t,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=$(r,{contextResolver:new s({sharedCache:P})});const i=await Promise.all(t.map((t=>{const n={...r};return e.expand(t,n)})));let l=!0;"mergeNodes"in r&&(l=r.mergeNodes);const c=r.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),n=l||0===e?u:{"@default":{}};if(N(t,n,"@default",c),n!==u)for(const e in n){const t=n[e];if(!(e in u)){u[e]=t;continue}const r=u[e];for(const e in t)e in r||(r[e]=t[e])}}const d=R(u),h=[],f=Object.keys(d).sort();for(let e=0;e<f.length;++e){const t=d[f[e]];w(t)||h.push(t)}return null===n?h:(r.graph=!0,r.skipExpansion=!0,await e.compact(h,n,r))},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await r(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");v(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=$(n,{base:"",contextResolver:new s({sharedCache:P})}),null===t?x(n):(t=o.clone(t),b(t)&&"@context"in t||(t={"@context":t}),S({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(1972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=n(470),e.logEventHandler=O,e.logWarningEventHandler=k,e.safeEventHandler=L,e.setDefaultEventHandler=A,e.strictEventHandler=D,e.unhandledEventHandler=M,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=n(3743),e.JsonLdProcessor=n(5445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},$=function(){return P((function(){return $()}))};P($),e.exports=$},4878:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},5001:(e,t,n)=>{const{ObjectSetPrototypeOf:r,Symbol:i}=n(4134);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:o}=n(6371).codes,s=n(3370),{getHighWaterMark:a}=n(5291);r(c.prototype,s.prototype),r(c,s);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())}))}function d(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,n){throw new o("_transform()")},c.prototype._write=function(e,t,n){const r=this._readableState,i=this._writableState,o=r.length;this._transform(e,t,((e,t)=>{e?n(e):(null!=t&&this.push(t),i.ended||o===r.length||r.length<r.highWaterMark?n():this[l]=n)}))},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5003:(e,t,n)=>{var r=n(8287),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},5229:(e,t,n)=>{const{isSubjectReference:r}=n(3978),{createMergedNodeMap:i}=n(9233),o={};e.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];r(i)||n.push(i)}return n}},5291:(e,t,n)=>{const{MathFloor:r,NumberIsInteger:i}=n(4134),{validateInteger:o}=n(277),{ERR_INVALID_ARG_VALUE:s}=n(6371).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,n,o){const a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,o,n);if(null!=a){if(!i(a)||a<0)throw new s(o?`options.${n}`:"options.highWaterMark",a);return r(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?l=t:a=t}}},5445:e=>{e.exports=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(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},5448:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5506:(e,t,n)=>{const{Buffer:r}=n(8287),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=n(4134),{promisify:{custom:a}}=n(7760),{streamReturningOperators:l,promiseReturningOperators:c}=n(823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=n(6371),d=n(7830),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:f}=n(5291),{pipeline:p}=n(7758),{destroyer:g}=n(5896),y=n(6238),m=n(3095),b=n(6115),v=e.exports=n(4259).Stream;v.isDestroyed=b.isDestroyed,v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.isWritable=b.isWritable,v.Readable=n(7576);for(const _ of o(l)){const x=l[_];function S(...e){if(new.target)throw u();return v.Readable.from(s(x,this,e))}i(S,"name",{__proto__:null,value:x.name}),i(S,"length",{__proto__:null,value:x.length}),i(v.Readable.prototype,_,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(const j of o(c)){const I=c[j];function E(...e){if(new.target)throw u();return s(I,this,e)}i(E,"name",{__proto__:null,value:I.name}),i(E,"length",{__proto__:null,value:I.length}),i(v.Readable.prototype,j,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}v.Writable=n(8584),v.Duplex=n(3370),v.Transform=n(5001),v.PassThrough=n(6524),v.pipeline=p;const{addAbortSignal:w}=n(4147);v.addAbortSignal=w,v.finished=y,v.destroy=g,v.compose=d,v.setDefaultHighWaterMark=h,v.getDefaultHighWaterMark=f,i(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),i(p,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),i(y,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}},5568:e=>{const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},5606:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,l=[],c=!1,u=-1;function d(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||c||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5896:(e,t,n)=>{const r=n(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=n(6371),{Symbol:a}=n(4134),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:d}=n(6115),h=a("kDestroy"),f=a("kConstruct");function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function g(e,t,n){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(m,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function y(e,t){b(e,t),m(e)}function m(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=n&&n.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const n=e._readableState,r=e._writableState;null!=r&&r.errorEmitted||null!=n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function v(e,t,n){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function n(n){if(t)return void v(e,null!=n?n:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?v(e,n,!0):r.nextTick(_,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(e){r.nextTick(n,e)}}function _(e){e.emit(f)}function x(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function S(e){e.emit("close")}function j(e,t){e.emit("error",t),r.nextTick(S,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),e.listenerCount(f)>1||r.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),d(e)?(e.socket=null,e.destroy(t)):x(e)?e.abort():x(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(j,e,t):r.nextTick(S,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,r=this._writableState,o=r||n;return null!=r&&r.destroyed||null!=n&&n.destroyed?("function"==typeof t&&t(),this):(p(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),o.constructed?g(this,e,t):this.once(h,(function(n){g(this,i(n,e),t)})),this)},undestroy:function(){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=!1===e.readable,e.endEmitted=!1===e.readable),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=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},6115:(e,t,n)=>{const{SymbolAsyncIterator:r,SymbolIterator:i,SymbolFor:o}=n(4134),s=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),c=o("nodejs.stream.writable"),u=o("nodejs.stream.disturbed"),d=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function f(e,t=!1){var n;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function m(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[s]||null!=r&&r.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function _(e,t){if(!f(e))return null;const n=e._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function x(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&f(e)&&e.readable&&!_(e)}function S(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&p(e)&&e.writable&&!w(e)}function j(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&j(e)}e.exports={isDestroyed:v,kIsDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,n,r,i,o,s,l,c,u,d;return!(!e||!(null!==(t=null!==(n=null!==(r=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==r?r:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:a,isReadable:x,kIsReadable:l,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==t?void 0:t.closed)||(null==n?void 0:n.closed):"boolean"==typeof e._closed&&j(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&x(e)||!1!==(null==t?void 0:t.writable)&&S(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[i]:"function"==typeof e[r]||"function"==typeof e[i])},isReadableNodeStream:f,isReadableStream:y,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,n;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||m(e)||b(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:m,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&I(e)||!!(r&&r.autoDestroy&&r.emitClose&&!1===r.closed)},isTransformStream:b}},6238:(e,t,n)=>{const r=n(5606),{AbortError:i,codes:o}=n(6371),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:c}=n(7760),{validateAbortSignal:u,validateFunction:d,validateObject:h,validateBoolean:f}=n(277),{Promise:p,PromisePrototypeThen:g,SymbolDispose:y}=n(4134),{isClosed:m,isReadable:b,isReadableNodeStream:v,isReadableStream:w,isReadableFinished:_,isReadableErrored:x,isWritable:S,isWritableNodeStream:j,isWritableStream:I,isWritableFinished:E,isWritableErrored:N,isNodeStream:T,willEmitClose:R,kIsClosedPromise:O}=n(6115);let k;const L=()=>{};function A(e,t,o){var f,p;if(2===arguments.length?(o=t,t=l):null==t?t=l:h(t,"options"),d(o,"callback"),u(t.signal,"options.signal"),o=c(o),w(e)||I(e))return function(e,t,o){let s=!1,a=L;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(a);else{k=k||n(7760).addAbortListener;const r=k(t.signal,a),i=o;o=c(((...t)=>{r[y](),i.apply(e,t)}))}const l=(...t)=>{s||r.nextTick((()=>o.apply(e,t)))};return g(e[O].promise,l,l),L}(e,t,o);if(!T(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const A=null!==(f=t.readable)&&void 0!==f?f:v(e),C=null!==(p=t.writable)&&void 0!==p?p:j(e),D=e._writableState,M=e._readableState,P=()=>{e.writable||F()};let $=R(e)&&v(e)===A&&j(e)===C,B=E(e,!1);const F=()=>{B=!0,e.destroyed&&($=!1),(!$||e.readable&&!A)&&(A&&!q||o.call(e))};let q=_(e,!1);const U=()=>{q=!0,e.destroyed&&($=!1),(!$||e.writable&&!C)&&(C&&!B||o.call(e))},G=t=>{o.call(e,t)};let V=m(e);const H=()=>{V=!0;const t=N(e)||x(e);return t&&"boolean"!=typeof t?o.call(e,t):A&&!q&&v(e,!0)&&!_(e,!1)?o.call(e,new a):!C||B||E(e,!1)?void o.call(e):o.call(e,new a)},z=()=>{V=!0;const t=N(e)||x(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},W=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?C&&!D&&(e.on("end",P),e.on("close",P)):(e.on("complete",F),$||e.on("abort",H),e.req?W():e.on("request",W)),$||"boolean"!=typeof e.aborted||e.on("aborted",H),e.on("end",U),e.on("finish",F),!1!==t.error&&e.on("error",G),e.on("close",H),V?r.nextTick(H):null!=D&&D.errorEmitted||null!=M&&M.errorEmitted?$||r.nextTick(z):(A||$&&!b(e)||!B&&!1!==S(e))&&(C||$&&!S(e)||!q&&!1!==b(e))?M&&e.req&&e.aborted&&r.nextTick(z):r.nextTick(z);const J=()=>{o=L,e.removeListener("aborted",H),e.removeListener("complete",F),e.removeListener("abort",H),e.removeListener("request",W),e.req&&e.req.removeListener("finish",F),e.removeListener("end",P),e.removeListener("close",P),e.removeListener("finish",F),e.removeListener("end",U),e.removeListener("error",G),e.removeListener("close",H)};if(t.signal&&!V){const s=()=>{const n=o;J(),n.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(s);else{k=k||n(7760).addAbortListener;const r=k(t.signal,s),i=o;o=c(((...t)=>{r[y](),i.apply(e,t)}))}}return J}e.exports=A,e.exports.finished=function(e,t){var n;let r=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(f(t.cleanup,"cleanup"),r=t.cleanup),new p(((n,i)=>{const o=A(e,t,(e=>{r&&o(),e?i(e):n()}))}))}},6371:(e,t,n)=>{const{format:r,inspect:i,AggregateError:o}=n(7760),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function d(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return d(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",((e,t,n)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const o=[],s=[],a=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?o.push(e.toLowerCase()):c.test(e)?s.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:r+=`of type ${o[0]}`;break;case 2:r+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();r+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(r+=" or ")}if(s.length>0){switch(s.length){case 1:r+=`an instance of ${s[0]}`;break;case 2:r+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();r+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();r+=`one of ${a.join(", ")}, or ${e}`}}if(null==n)r+=`. Received ${n}`;else if("function"==typeof n&&n.name)r+=`. Received function ${n.name}`;else if("object"==typeof n){var u;null!==(u=n.constructor)&&void 0!==u&&u.name?r+=`. Received an instance of ${n.constructor.name}`:r+=`. Received ${i(n,{depth:-1})}`}else{let e=i(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),r+=`. Received type ${typeof n} (${e})`}return r}),TypeError),f("ERR_INVALID_ARG_VALUE",((e,t,n="is invalid")=>{let r=i(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`}),TypeError),f("ERR_INVALID_RETURN_VALUE",((e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${null!=n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),f("ERR_MISSING_ARGS",((...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const n=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}}return`${t} must be specified`}),TypeError),f("ERR_OUT_OF_RANGE",((e,t,n)=>{let r;return d(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?r=h(String(n)):"bigint"==typeof n?(r=String(n),(n>2n**32n||n<-(2n**32n))&&(r=h(r)),r+="n"):r=i(n),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`}),RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new s([t,e],t.message);return n.code=t.code,n}return e||t})),hideStackFrames:p,codes:u}},6524:(e,t,n)=>{const{ObjectSetPrototypeOf:r}=n(4134);e.exports=o;const i=n(5001);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}r(o.prototype,i.prototype),r(o,i),o.prototype._transform=function(e,t,n){n(null,e)}},6532:(e,t,n)=>{const r=n(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=n(4134),{Buffer:a}=n(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=n(6371).codes;e.exports=function(e,t,n){let u,d;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[o])d=!0,u=t[o]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);d=!1,u=t[s]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:e,done:t}=d?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw f=!1,new c;if(h.push(t))continue;f=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,n="function"==typeof u.throw;if(t&&n){const{value:t,done:n}=await u.throw(e);if(await t,n)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},h}},6706:(e,t,n)=>{const r=n(5606),i=n(8287),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:f}=n(6115),p=n(6238),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m}}=n(6371),{destroyer:b}=n(5896),v=n(3370),w=n(7576),_=n(8584),{createDeferredPromise:x}=n(7760),S=n(6532),j=globalThis.Blob||i.Blob,I=void 0!==j?function(e){return e instanceof j}:function(e){return!1},E=globalThis.AbortController||n(5568).AbortController,{FunctionPrototypeCall:N}=n(4134);class T extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function R(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,n=e.writable;let r,i,a,l,c,u=!!o(t),d=!!s(n);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new T({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:u,writable:d}),d&&(p(n,(e=>{d=!1,e&&b(t,e),h(e)})),c._write=function(e,t,i){n.write(e,t)?i():r=i},c._final=function(e){n.end(),i=e},n.on("drain",(function(){if(r){const e=r;r=null,e()}})),n.on("finish",(function(){if(i){const e=i;i=null,e()}}))),u&&(p(t,(e=>{u=!1,e&&b(t,e),h(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,o){e||null===l||(e=new g),a=null,r=null,i=null,null===l?o(e):(l=o,b(n,e),b(t,e))},c}e.exports=function e(t,n){if(d(t))return t;if(c(t))return R({readable:t});if(u(t))return R({writable:t});if(l(t))return R({writable:!1,readable:!1});if(h(t))return R({readable:w.fromWeb(t)});if(f(t))return R({writable:_.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:n}=x();const i=new E,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:n}=x()),yield i}}(),{signal:o}),write(e,t,r){const i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return S(T,e,{objectMode:!0,write:i,final:o,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const n=N(l,e,(e=>{if(null!=e)throw new m("nully","body",e)}),(e=>{b(t,e)}));return t=new T({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:s})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,e)}if(I(t))return e(t.arrayBuffer());if(a(t))return S(T,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&f(null==t?void 0:t.writable))return T.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return R({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return N(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new T({objectMode:!0,writable:!1,read(){}})}throw new y(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},6925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||(e<=i.MAX_INT&&e>=i.MIN_INT?n.namedNode(i.TYPES[0]):n.namedNode(i.TYPES[1])))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},6957:(e,t,n)=>{const{parseLinkHeader:r,buildHeaders:i}=n(9263),{LINK_HEADER_CONTEXT:o}=n(9378),s=n(2207),a=n(3743),{prependBase:l}=n(470),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))throw new s('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 u;try{u=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const e in n)r.setRequestHeader(e,n[e]);r.send()}))}(n,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let d={contextUrl:null,documentUrl:a,document:u.response},h=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=r(p),t=e[o];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(d.contextUrl=t.target),h=e.alternate,h&&"application/ld+json"==h.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(d=await i(l(a,h.target)))}return d})))},7007:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,s,c;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=p(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7034:(e,t,n)=>{const{isArray:r,isObject:i,isString:o}=n(7382),{asArray:s}=n(9263),{prependBase:a}=n(470),l=n(2207),c=n(7532);function u(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d({context:e,base:t}){if(!e)return;const n=e["@context"];if(o(n))e["@context"]=a(t,n);else if(r(n))for(let e=0;e<n.length;++e){const r=n[e];o(r)?n[e]=a(t,r):i(r)&&d({context:{"@context":r},base:t})}else if(i(n))for(const e in n)d({context:n[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:n,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const d=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:n,base:a,cycles:l})),r(t)?d.push(...t):d.push(t);continue}if(null===s){d.push(new c({document:null}));continue}i(s)||u(t);const h=JSON.stringify(s);let f=this._get(h);f||(f=new c({document:s}),this._cacheResolvedContext({key:h,resolved:f,tag:"static"})),d.push(f)}return d}_get(e){let t=this.perOpCache.get(e);if(!t){const n=this.sharedCache.get(e);n&&(t=n.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:n}){if(this.perOpCache.set(e,t),void 0!==n){let r=this.sharedCache.get(e);r||(r=new Map,this.sharedCache.set(e,r)),r.set(n,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:n,base:r,cycles:i}){t=a(r,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});d({context:o,base:r=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:n,base:r,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await n(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l(`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. URL: "${t}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(a))throw new l(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${t}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:t});return a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(r(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},7258:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const r=n(103);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let o;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=r.toISOString().replace(/T.*$/,"");break;default:o=r.toISOString()}return n.literal(o,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},7265:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},7382:e=>{const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7526:(e,t)=>{t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),u=0,d=l>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(l(e,a,a+s>c?c:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},7532:(e,t,n)=>{const r=n(9749);e.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},7576:(e,t,n)=>{const r=n(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:d,SafeSet:h,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:g}=n(4134);e.exports=W,W.ReadableState=z;const{EventEmitter:y}=n(7007),{Stream:m,prependListener:b}=n(4259),{Buffer:v}=n(8287),{addAbortSignal:w}=n(4147),_=n(6238);let x=n(7760).debuglog("stream",(e=>{x=e}));const S=n(345),j=n(5896),{getHighWaterMark:I,getDefaultHighWaterMark:E}=n(5291),{aggregateTwoErrors:N,codes:{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:A}=n(6371),{validateObject:C}=n(277),D=g("kPaused"),{StringDecoder:M}=n(3141),P=n(6532);u(W.prototype,m.prototype),u(W,m);const $=()=>{},{errorOrDestroy:B}=j,F=1,q=16,U=32,G=2048,V=4096;function H(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function z(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.state=G|V|q|U,e&&e.objectMode&&(this.state|=F),r&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?I(this,e,"readableHighWaterMark",r):E(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[D]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function W(e){if(!(this instanceof W))return new W(e);const t=this instanceof n(3370);this._readableState=new z(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),m.call(this,e),j.construct(this,(()=>{this._readableState.needReadable&&Z(this,this._readableState)}))}function J(e,t,n,r){x("readableAddChunk",t);const i=e._readableState;let o;if(0===(i.state&F)&&("string"==typeof t?(n=n||i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=v.from(t,n).toString(i.encoding):(t=v.from(t,n),n=""))):t instanceof v?n="":m._isUint8Array(t)?(t=m._uint8ArrayToBuffer(t),n=""):null!=t&&(o=new T("chunk",["string","Buffer","Uint8Array"],t))),o)B(e,o);else if(null===t)i.state&=-9,function(e,t){if(x("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?K(e):(t.needReadable=!1,t.emittedReadable=!0,Y(e))}}(e,i);else if(0!==(i.state&F)||t&&t.length>0)if(r)if(4&i.state)B(e,new L);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)B(e,new k);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else r||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,n,r){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),64&t.state&&K(e)),Z(e,t)}function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&F)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function K(e){const t=e._readableState;x("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Y,e))}function Y(e){const t=e._readableState;x("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(x("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[D]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ne(e){x("readable nexttick read 0"),e.read(0)}function re(e,t){x("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(x("flow",t.flowing);t.flowing&&null!==e.read(););}function oe(e,t){"function"!=typeof e.read&&(e=W.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,r=$;function i(t){this===e?(r(),r=$):r=t}e.on("readable",i);const o=_(e,{writable:!1},(e=>{n=e?N(n,e):null,r(),r=$}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new d(i)}}}catch(e){throw n=N(n,e),n}finally{!n&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",i),o()):j.destroyer(e,null)}}(e,t);return n.stream=e,n}function se(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function ae(e){const t=e._readableState;x("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(le,t,e))}function le(e,t){if(x("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function de(){return void 0===ue&&(ue={}),ue}l(z.prototype,{objectMode:H(F),ended:H(2),endEmitted:H(4),reading:H(8),constructed:H(q),sync:H(U),needReadable:H(64),emittedReadable:H(128),readableListening:H(256),resumeScheduled:H(512),errorEmitted:H(1024),emitClose:H(G),autoDestroy:H(V),destroyed:H(8192),closed:H(16384),closeEmitted:H(32768),multiAwaitDrain:H(65536),readingMore:H(1<<17),dataEmitted:H(1<<18)}),W.prototype.destroy=j.destroy,W.prototype._undestroy=j.undestroy,W.prototype._destroy=function(e,t){t(e)},W.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},W.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new A,this.destroy(e)),new d(((t,n)=>_(this,(r=>r&&r!==e?n(r):t(null)))))},W.prototype.push=function(e,t){return J(this,e,t,!1)},W.prototype.unshift=function(e,t){return J(this,e,t,!0)},W.prototype.isPaused=function(){const e=this._readableState;return!0===e[D]||!1===e.flowing},W.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const e of n)r+=t.write(e);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this},W.prototype.read=function(e){x("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return x("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):K(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ae(this),null;let r,i=!!(64&t.state);if(x("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,x("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,x("reading, ended or constructing",i);else if(i){x("do read"),t.state|=8|U,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){B(this,e)}t.state&=~U,t.reading||(e=X(n,t))}return r=e>0?se(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ae(this)),null===r||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",r)),r},W.prototype._read=function(e){throw new R("_read()")},W.prototype.pipe=function(e,t){const n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),x("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===r.stdout||e===r.stderr?g:s;function s(){x("onend"),e.end()}let a;i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",(function t(r,o){x("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,x("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())}));let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(x("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(x("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),a||(a=function(e,t){return function(){const n=e._readableState;n.awaitDrainWriters===t?(x("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(x("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",a))}function u(t){x("ondata");const n=e.write(t);x("dest.write",n),!1===n&&c()}function d(t){if(x("onerror",t),g(),e.removeListener("error",d),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?B(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",p),g()}function p(){x("onfinish"),e.removeListener("close",f),g()}function g(){x("unpipe"),n.unpipe(e)}return n.on("data",u),b(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),!0===e.writableNeedDrain?c():i.flowing||(x("pipe resume"),n.resume()),e},W.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=i(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},W.prototype.on=function(e,t){const n=m.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x("on readable",i.length,i.reading),i.length?K(this):i.reading||r.nextTick(ne,this))),n},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(e,t){const n=m.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(te,this),n},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(e){const t=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(te,this),t},W.prototype.resume=function(){const e=this._readableState;return e.flowing||(x("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(re,e,t))}(this,e)),e[D]=!1,this},W.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[D]=!0,this},W.prototype.wrap=function(e){let t=!1;e.on("data",(n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=c(e);for(let t=1;t<n.length;t++){const r=n[t];void 0===this[r]&&"function"==typeof e[r]&&(this[r]=e[r].bind(e))}return this},W.prototype[p]=function(){return oe(this)},W.prototype.iterator=function(e){return void 0!==e&&C(e,"options"),oe(this,e)},l(W.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},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}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(z.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[D]},set(e){this[D]=!!e}}}),W._fromList=se,W.from=function(e,t){return P(W,e,t)},W.fromWeb=function(e,t){return de().newStreamReadableFromReadableStream(e,t)},W.toWeb=function(e,t){return de().newReadableStreamFromStreamReadable(e,t)},W.wrap=function(e,t){var n,r;return new W({objectMode:null===(n=null!==(r=e.readableObjectMode)&&void 0!==r?r:e.objectMode)||void 0===n||n,...t,destroy(t,n){j.destroyer(e,t),n(t)}}).wrap(e)}},7758:(e,t,n)=>{const r=n(5606),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:a}=n(4134),l=n(6238),{once:c}=n(7760),u=n(5896),d=n(3370),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:b}=n(6371),{validateFunction:v,validateAbortSignal:w}=n(277),{isIterable:_,isReadable:x,isReadableNodeStream:S,isNodeStream:j,isTransformStream:I,isWebStream:E,isReadableStream:N,isReadableFinished:T}=n(6115),R=globalThis.AbortController||n(5568).AbortController;let O,k,L;function A(e,t,n){let r=!1;return e.on("close",(()=>{r=!0})),{destroy:t=>{r||(r=!0,u.destroyer(e,t||new y("pipe")))},cleanup:l(e,{readable:t,writable:n},(e=>{r=!e}))}}function C(e){if(_(e))return e;if(S(e))return async function*(e){k||(k=n(7576)),yield*k.prototype[s].call(e)}(e);throw new f("val",["Readable","Iterable","AsyncIterable"],e)}async function D(e,t,n,{end:r}){let i,s=null;const a=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},c=()=>new o(((e,t)=>{i?t(i):s=()=>{i?t(i):e()}}));t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const n of e)t.write(n)||await c();r&&(t.end(),await c()),n()}catch(e){n(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,n,{end:r}){I(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function P(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const s=new R,l=s.signal,c=null==o?void 0:o.signal,u=[];function h(){F(new b)}let y,m,v;w(c,"options.signal"),L=L||n(7760).addAbortListener,c&&(y=L(c,h));const T=[];let k,P=0;function B(e){F(e,0===--P)}function F(e,n){var i;if(!e||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=e),m||n){for(;T.length;)T.shift()(m);null===(i=y)||void 0===i||i[a](),s.abort(),n&&(m||u.forEach((e=>e())),r.nextTick(t,m,v))}}for(let G=0;G<e.length;G++){const V=e[G],H=G<e.length-1,z=G>0,W=H||!1!==(null==o?void 0:o.end),J=G===e.length-1;if(j(V)){if(W){const{destroy:X,cleanup:K}=A(V,H,z);T.push(X),x(V)&&J&&u.push(K)}function Q(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}V.on("error",Q),x(V)&&J&&u.push((()=>{V.removeListener("error",Q)}))}if(0===G)if("function"==typeof V){if(k=V({signal:l}),!_(k))throw new p("Iterable, AsyncIterable or Stream","source",k)}else k=_(V)||S(V)||I(V)?V:d.from(V);else if("function"==typeof V){var q;if(k=I(k)?C(null===(q=k)||void 0===q?void 0:q.readable):C(k),k=V(k,{signal:l}),H){if(!_(k,!0))throw new p("AsyncIterable",`transform[${G-1}]`,k)}else{var U;O||(O=n(6524));const Y=new O({objectMode:!0}),Z=null===(U=k)||void 0===U?void 0:U.then;if("function"==typeof Z)P++,Z.call(k,(e=>{v=e,null!=e&&Y.write(e),W&&Y.end(),r.nextTick(B)}),(e=>{Y.destroy(e),r.nextTick(B,e)}));else if(_(k,!0))P++,D(k,Y,B,{end:W});else{if(!N(k)&&!I(k))throw new p("AsyncIterable or Promise","destination",k);{const ne=k.readable||k;P++,D(ne,Y,B,{end:W})}}k=Y;const{destroy:ee,cleanup:te}=A(k,!1,!0);T.push(ee),J&&u.push(te)}}else if(j(V)){if(S(k)){P+=2;const re=$(k,V,B,{end:W});x(V)&&J&&u.push(re)}else if(I(k)||N(k)){const ie=k.readable||k;P++,D(ie,V,B,{end:W})}else{if(!_(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,D(k,V,B,{end:W})}k=V}else if(E(V)){if(S(k))P++,M(C(k),V,B,{end:W});else if(N(k)||_(k))P++,M(k,V,B,{end:W});else{if(!I(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,M(k.readable,V,B,{end:W})}k=V}else k=d.from(V)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&r.nextTick(h),k}function $(e,t,n,{end:i}){let o=!1;if(t.on("close",(()=>{o||n(new m)})),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}T(e)?r.nextTick(s):e.once("end",s)}else n();return l(e,{readable:!0,writable:!1},(t=>{const r=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&r&&r.ended&&!r.errored&&!r.errorEmitted?e.once("end",n).once("error",n):n(t)})),l(t,{readable:!1,writable:!0},n)}e.exports={pipelineImpl:P,pipeline:function(...e){return P(e,c(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},7760:(e,t,n)=>{const r=n(8287),{kResistStopPropagation:i,SymbolDispose:o}=n(4134),s=globalThis.AbortSignal||n(5568).AbortSignal,a=globalThis.AbortController||n(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,c=globalThis.Blob||r.Blob,u=void 0!==c?function(e){return e instanceof c}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class h extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}},promisify:e=>new Promise(((t,n)=>{e(((e,...r)=>e?n(e):t(...r)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,n]){const r=t.shift();return"f"===n?r.toFixed(6):"j"===n?JSON.stringify(r):"s"===n&&"object"==typeof r?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:u,deprecate:(e,t)=>e,addAbortListener:n(7007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let n;return d(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[i]:!0}),n=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[o](){var e;null===(e=n)||void 0===e||e()}}},AbortSignalAny:s.any||function(e){if(1===e.length)return e[0];const t=new a,n=()=>t.abort();return e.forEach((e=>{d(e,"signals"),e.addEventListener("abort",n,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",n)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7789:()=>{},7830:(e,t,n)=>{const{pipeline:r}=n(7758),i=n(3370),{destroyer:o}=n(5896),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:d,isReadableStream:h}=n(6115),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=n(6371),y=n(6238);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let n=0;n<e.length;++n)if(s(e[n])||c(e[n])){if(n<e.length-1&&!(a(e[n])||h(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be readable");if(n>0&&!(l(e[n])||d(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be writable")}let n,m,b,v,w;const _=e[0],x=r(e,(function(e){const t=v;v=null,t?t(e):e?w.destroy(e):j||S||w.destroy()})),S=!!(l(_)||d(_)||u(_)),j=!!(a(x)||h(x)||u(x));if(w=new i({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==x||!x.readableObjectMode),writable:S,readable:j}),S){if(s(_))w._write=function(e,t,r){_.write(e,t)?r():n=r},w._final=function(e){_.end(),m=e},_.on("drain",(function(){if(n){const e=n;n=null,e()}}));else if(c(_)){const e=(u(_)?_.writable:_).getWriter();w._write=async function(t,n,r){try{await e.ready,e.write(t).catch((()=>{})),r()}catch(e){r(e)}},w._final=async function(t){try{await e.ready,e.close().catch((()=>{})),m=t}catch(e){t(e)}}}const e=u(x)?x.readable:x;y(e,(()=>{if(m){const e=m;m=null,e()}}))}if(j)if(s(x))x.on("readable",(function(){if(b){const e=b;b=null,e()}})),x.on("end",(function(){w.push(null)})),w._read=function(){for(;;){const e=x.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(x)){const e=(u(x)?x.readable:x).getReader();w._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!w.push(t))return;if(n)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===v||(e=new f),b=null,n=null,m=null,null===v?t(e):(v=t,s(x)&&o(x,e))},w}},7946:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),o=n(7382),s=n(9263),a=n(470),l=n(2207),{createNodeMap:c,mergeNodeMapGraphs:u}=n(9233),d={};function h(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function f(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 p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new l("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 s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)&&"@json"!==t||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,a){let l=!0,c=!1;for(const u in n){let d=!1;const h=s.getValues(t,u),f=0===s.getValues(n,u).length;if("@id"===u){if(o.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(h[0])),!a.requireAll)return d}else if("@type"===u){if(l=!1,f){if(h.length>0)return!1;d=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))d=h.length>0;else for(const e of n["@type"])d=!(!o.isObject(e)||!("@default"in e))||d||h.some((t=>t===e));if(!a.requireAll)return d}else{if(r(u))continue;{const t=s.getValues(n,u)[0];let r=!1;if(t&&(g([t]),r="@default"in t),l=!1,0===h.length&&r)continue;if(h.length>0&&f)return!1;if(void 0===t){if(h.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(h[0])){const t=h[0]["@list"];i.isValue(n)?d=t.some((e=>_(n,e))):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some((t=>w(e,n,t,a))))}}else d=i.isValue(t)?h.some((e=>_(t,e))):i.isSubjectReference(t)?h.some((n=>w(e,t,n,a))):!!o.isObject(t)&&h.length>0}}if(!d&&a.requireAll)return!1;c=c||d}return l||c}function m(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function b(e,t){if(o.isArray(e))return e.map((e=>b(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(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(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=b(e[n],t)}return e}function v(e,t,n){o.isObject(e)?s.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function w(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function _(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(n)&&!o.isEmptyObject(s[0]))&&!!(!r&&0===a.length||a.includes(r)||r&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=u(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return d.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter((e=>1===r.bnodeMap[e].length))),n.link={},b(o,n)},d.frame=(e,t,n,a,c=null)=>{g(n),n=n[0];const u=e.options,b={embed:p(n,u,"embed"),explicit:p(n,u,"explicit"),requireAll:p(n,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],x=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,b),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&g in w){v(a,c,w[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),w[g]=S,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==b.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=b.embed&&"@once"!=b.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===b.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&d.frame({...e,embedded:!1},t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!b.explicit||t in n)for(const r of y[t]){const o=t in n?n[t]:h(b);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:h(b),a={"@list":[]};v(S,t,a);const l=r["@list"];for(const t of l)i.isSubjectReference(t)?d.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):v(a,"@list",s.clone(t))}else i.isSubjectReference(r)?d.frame({...e,embedded:!0},[r["@id"]],o,S,t):_(o[0],r)&&v(S,t,s.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=s.clone(t["@default"])),o.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))s.getValues(e.subjects[n],t).some((e=>e["@id"]===g))&&(S["@reverse"]=S["@reverse"]||{},s.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),d.frame({...e,embedded:!0},[n],r,S["@reverse"][t],c))}v(a,c,S),e.subjectStack.pop()}else v(a,c,S);else v(a,c,S)}},d.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>d.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},8059:(e,t,n)=>{var r=n(2177);e.exports=function(e){return r(2,e)}},8229:(e,t,n)=>{e.exports=n(989).NQuads},8287:(e,t,n)=>{const r=n(7526),i=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let o,s=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===l)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){let n=!0;for(let r=0;r<l;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function w(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(X(r))return s;e[n+s]=r}return s}function _(e,t,n,r){return J(z(t,e.length-n),e,n,r)}function x(e,t,n,r){return J(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return J(W(t),e,n,r)}function j(e,t,n,r){return J(function(e,t){let n,r,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(o=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}(r)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(Q(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==u[e]){o=c[e],s=u[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function R(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function O(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=K[e[r]];return i}function k(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function L(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function C(e,t,n,r,i){U(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function D(e,t,n,r,i){U(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Y((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Y((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Y((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Y((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const B={};function F(e,t,n){B[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function U(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||V(t,e.length-(n+1))}(r,i,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new B.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(3067),i=n(4878),o=n(458),s=n(3476),a=n(2946),l=n(7265);let c=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${c++}_`}namedNode(e){return new s.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new o.Literal(e,t)}variable(e){return new l.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new a.Quad(e,t,n,r||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(o.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}}},8584:(e,t,n)=>{const r=n(5606),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:d,SymbolHasInstance:h}=n(4134);e.exports=C,C.WritableState=L;const{EventEmitter:f}=n(7007),p=n(4259).Stream,{Buffer:g}=n(8287),y=n(5896),{addAbortSignal:m}=n(4147),{getHighWaterMark:b,getDefaultHighWaterMark:v}=n(5291),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:N,ERR_UNKNOWN_ENCODING:T}=n(6371).codes,{errorOrDestroy:R}=y;function O(){}c(C.prototype,p.prototype),c(C,p);const k=d("kOnFinished");function L(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",r):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=$.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,A(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[k]=[]}function A(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function C(e){const t=this instanceof n(3370);if(!t&&!s(C,this))return new C(e);this._writableState=new L(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),p.call(this,e),y.construct(this,(()=>{const e=this._writableState;e.writing||U(this,e),V(this,e)}))}function D(e,t,n,i){const o=e._writableState;if("function"==typeof n)i=n,n=o.defaultEncoding;else{if(n){if("buffer"!==n&&!g.isEncoding(n))throw new T(n)}else n=o.defaultEncoding;"function"!=typeof i&&(i=O)}if(null===t)throw new E;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,n),n="buffer");else if(t instanceof g)n="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}let s;return o.ending?s=new N:o.destroyed&&(s=new j("write")),s?(r.nextTick(i,s),R(e,s,!0),s):(o.pendingcb++,function(e,t,n,r,i){const o=t.objectMode?1:n.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&"buffer"!==r&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,n,i))}function M(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new j("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function P(e,t,n,r){--t.pendingcb,r(n),q(t),R(e,n)}function $(e,t){const n=e._writableState,i=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(P,e,n,t,o):P(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&U(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick(B,n.afterWriteTickInfo)):F(e,n,1,o))):R(e,new x)}function B({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,F(e,t,n,r)}function F(e,t,n,r){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,r();t.destroyed&&q(t),V(e,t)}function q(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;const{chunk:r,callback:i}=e.buffered[n],o=e.objectMode?1:r.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new j("write"))}const n=e[k].splice(0);for(let t=0;t<n.length;t++){var r;n[t](null!==(r=e.errored)&&void 0!==r?r:new j("end"))}A(e)}function U(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:r,objectMode:o}=t,s=n.length-r;if(!s)return;let a=r;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const r=t.allNoop?O:e=>{for(let t=a;t<n.length;++t)n[t].callback(e)},o=t.allNoop&&0===a?n:i(n,a);o.allBuffers=t.allBuffers,M(e,t,!0,t.length,o,"",r),A(t)}else{do{const{chunk:r,encoding:i,callback:s}=n[a];n[a++]=null,M(e,t,!1,o?1:r.length,r,i,s)}while(a<n.length&&!t.writing);a===n.length?A(t):a>256?(n.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function G(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t,n){G(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)R(e,null!=i?i:x());else if(n=!0,t.pendingcb--,i){const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e](i);R(e,i,t.sync)}else G(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(H,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{G(t)?H(e,t):t.pendingcb--}),e,t)):G(t)&&(t.pendingcb++,H(e,t))))}function H(e,t){t.pendingcb--,t.finished=!0;const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}L.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(C,h,{__proto__:null,value:function(e){return!!s(this,e)||this===C&&e&&e._writableState instanceof L}}),C.prototype.pipe=function(){R(this,new S)},C.prototype.write=function(e,t,n){return!0===D(this,e,t,n)},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||U(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new T(e);return this._writableState.defaultEncoding=e,this},C.prototype._write=function(e,t,n){if(!this._writev)throw new _("_write()");this._writev([{chunk:e,encoding:t}],n)},C.prototype._writev=null,C.prototype.end=function(e,t,n){const i=this._writableState;let s;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){const n=D(this,e,t);n instanceof o&&(s=n)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new I("end"):i.destroyed&&(s=new j("end")):(i.ending=!0,V(this,i,!0),i.ended=!0)),"function"==typeof n&&(s||i.finished?r.nextTick(n,s):i[k].push(n)),this},l(C.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const z=y.destroy;let W;function J(){return void 0===W&&(W={}),W}C.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[k].length)&&r.nextTick(q,n),z.call(this,e,t),this},C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},C.fromWeb=function(e,t){return J().newStreamWritableFromWritableStream(e,t)},C.toWeb=function(e){return J().newWritableStreamFromStreamWritable(e)}},8799:(e,t,n)=>{function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r<e;r++)o=o.next;var s=[];for(r=0;o&&r<t;r++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),r=0;r<n.length;r++)o=i(this,o,n[r]);return s},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(259)(r)}catch(e){}},9180:(e,t,n)=>{const{createNodeMap:r}=n(9233),{isKeyword:i}=n(1972),o=n(3978),s=n(2341),a=n(2207),l=n(7382),c=n(9263),{handleEvent:u}=n(2246),{RDF_FIRST:d,RDF_REST:h,RDF_NIL:f,RDF_TYPE:p,RDF_JSON_LITERAL:g,RDF_LANGSTRING:y,XSD_BOOLEAN:m,XSD_DOUBLE:b,XSD_INTEGER:v,XSD_STRING:w}=n(9378),{isAbsolute:_}=n(470),x={};function S(e,t,n,r,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!_(a)){o.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!_(t)){o.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:r.getOldIds().find((e=>r.getId(e)===t))}},options:o});continue}const c=j(i,r,e,n,o.rdfDirection,o);c&&e.push({subject:s,predicate:l,object:c,graph:n})}}}}function j(e,t,n,r,i,c){const p={};if(o.isValue(e)){p.termType="Literal",p.value=void 0,p.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)p.value=s(t),p.datatype.value=g;else if(l.isBoolean(t))p.value=t.toString(),p.datatype.value=n||m;else if(l.isDouble(t)||n===b)l.isDouble(t)||(t=parseFloat(t)),p.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),p.datatype.value=n||b;else if(l.isNumber(t))p.value=t.toFixed(0),p.datatype.value=n||v;else if("@direction"in e&&"i18n-datatype"===i){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;p.datatype.value=n,p.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new a("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new a("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||y,p.language=e["@language"]):("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||w)}}else if(o.isList(e)){const o=function(e,t,n,r,i,o){const s={termType:"NamedNode",value:d},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:f},c=e.pop(),u=c?{termType:"BlankNode",value:t.getId()}:l;let p=u;for(const l of e){const e=j(l,t,n,r,i,o),c={termType:"BlankNode",value:t.getId()};n.push({subject:p,predicate:s,object:e,graph:r}),n.push({subject:p,predicate:a,object:c,graph:r}),p=c}if(c){const e=j(c,t,n,r,i,o);n.push({subject:p,predicate:s,object:e,graph:r}),n.push({subject:p,predicate:a,object:l,graph:r})}return u}(e["@list"],t,n,r,i,c);p.termType=o.termType,p.value=o.value}else{const t=l.isObject(e)?e["@id"]:e;p.termType=t.startsWith("_:")?"BlankNode":"NamedNode",p.value=t}return"NamedNode"!==p.termType||_(p.value)?p:(c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:p.value}},options:c}),null)}e.exports=x,x.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],s=Object.keys(i).sort();for(const e of s){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!_(e)){t.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}S(o,i[e],r,n,t)}return o}},9198:(e,t,n)=>{const r=n(5506),i=n(3095),o=r.Readable.destroy;e.exports=r.Readable,e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,e.exports._isUint8Array=r._isUint8Array,e.exports.isDisturbed=r.isDisturbed,e.exports.isErrored=r.isErrored,e.exports.isReadable=r.isReadable,e.exports.Readable=r.Readable,e.exports.Writable=r.Writable,e.exports.Duplex=r.Duplex,e.exports.Transform=r.Transform,e.exports.PassThrough=r.PassThrough,e.exports.addAbortSignal=r.addAbortSignal,e.exports.finished=r.finished,e.exports.destroy=r.destroy,e.exports.destroy=o,e.exports.pipeline=r.pipeline,e.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=r.Stream,e.exports.default=e.exports},9233:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),o=n(7382),s=n(9263),a=n(2207),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),r={"@default":{}};return l.createNodeMap(e,r,"@default",n),l.mergeNodeMaps(r)},l.createNodeMap=(e,t,n,c,u,d)=>{if(o.isArray(e)){for(const r of e)l.createNodeMap(r,t,n,c,void 0,d);return}if(!o.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return l.createNodeMap(e["@list"],t,n,c,u,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),d&&d.push({"@id":u});const h=t[n],f=h[u]=h[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const r={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,n,c,a),s.addValue(h[a],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,n,c);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const d=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==d.length)for(let e of d)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(f,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];l.createNodeMap(e["@list"],t,n,c,u,r),e={"@list":r},s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,u),s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(f,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||s.push(t)}}return t}},9263:(e,t,n)=>{const r=n(3978),i=n(7382),o=n(989).IdentifierIssuer,s=n(2207),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",d={};function h(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=h(e,t[n]);else if(r.isList(t))t["@list"]=h(e,t["@list"]);else if(i.isObject(t)){r.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let r=0;r<n.length;++r){const i=n[r];"@id"!==i&&(t[i]=h(e,t[i]))}}return t}e.exports=d,d.IdentifierIssuer=o,d.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,d.REGEX_KEYWORD=/^@[a-zA-Z]+$/,d.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=d.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,r]of e)t.set(n,d.clone(r))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(d.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=d.clone(e[n])}else t=e.toString();return t}return e},d.asArray=function(e){return Array.isArray(e)?e:[e]},d.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},d.parseLinkHeader=e=>{const t={},n=e.match(a);for(let e=0;e<n.length;++e){let r=n[e].match(l);if(!r)continue;const i={target:r[1]},o=r[2];for(;r=c.exec(o);)i[r[1]]=void 0===r[2]?r[3]:r[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},d.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new s('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})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let o=e[t];const s=r.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(d.compareValues(n,o[e]))return!0}else if(!i.isArray(n))return d.compareValues(n,o)}return!1},d.addValue=(e,t,n,r)=>{if("propertyIsArray"in(r=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(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)d.addValue(e,t,n[i],r)}else if(e.hasOwnProperty(t)){const o=!r.allowDuplicate&&d.hasValue(e,t,n);i.isArray(e[t])||o&&!r.propertyIsArray||(e[t]=[e[t]]),o||(r.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=r.propertyIsArray?[n]:n},d.getValues=(e,t)=>[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter((e=>!d.compareValues(e,n)));0===i.length?d.removeProperty(e,t):1!==i.length||r.propertyIsArray?e[t]=i:e[t]=i[0]},d.relabelBlankNodes=(e,t)=>h((t=t||{}).issuer||new o("_:b"),e),d.compareValues=(e,t)=>e===t||!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},9325:(e,t,n)=>{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},9349:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.fromRdf=u,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=l),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?u(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()};const o=n(3617),s=n(4802),a=n(103);i(n(4802),t),i(n(5448),t),i(n(103),t);const l=new o.DataFactory,c=new a.Translator;function u(e,t){return c.fromRdf(e,t)}c.registerHandler(new s.TypeHandlerString,s.TypeHandlerString.TYPES.map((e=>l.namedNode(e))),["string"]),c.registerHandler(new s.TypeHandlerBoolean,[s.TypeHandlerBoolean.TYPE].map((e=>l.namedNode(e))),["boolean"]),c.registerHandler(new s.TypeHandlerNumberDouble,s.TypeHandlerNumberDouble.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new s.TypeHandlerNumberInteger,s.TypeHandlerNumberInteger.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new s.TypeHandlerDate,s.TypeHandlerDate.TYPES.map((e=>l.namedNode(e))),["object"])},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?NaN:+e}},9378:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},9749:(e,t,n)=>{const r=n(8799),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,n)=>{const r=e[h].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[a])return}else n&&(e[f]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},m=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[h].delete(n.key),e[d].removeNode(t)}};class v{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const w=(e,t,n,r)=>{let i=n.value;y(e,i)&&(b(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;w(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;w(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[s](t,e);if(this[h].has(e)){if(a>this[i])return b(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=r,s.maxAge=n,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),m(this),!0}const f=new v(e,t,a,r,n);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[d].unshift(f),this[h].set(e,this[d].head),m(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},9925:e=>{e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,n=e.slice();let r=null,i=0;const o=e.length;for(let n=0;n<o;++n){const s=e[n],a=t.get(s);(null===r||s>r)&&(a&&n>0&&s>e[n-1]||!a&&n<o-1&&s>e[n+1])&&(r=s,i=n)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const n of e)n>r&&t.set(n,!t.get(n))}return n}}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};r.r(i),r.d(i,{anyAtomicType:()=>Gn,anySimpleType:()=>Un,anyURI:()=>ur,base64Binary:()=>cr,boolean:()=>Qn,byte:()=>_r,date:()=>nr,dateTime:()=>er,dateTimeStamp:()=>Or,dayTimeDuration:()=>Rr,decimal:()=>Xn,double:()=>Yn,duration:()=>Zn,float:()=>Kn,gDay:()=>sr,gMonth:()=>ar,gMonthDay:()=>or,gYear:()=>ir,gYearMonth:()=>rr,hexBinary:()=>lr,int:()=>vr,integer:()=>gr,language:()=>pr,long:()=>br,negativeInteger:()=>mr,nonNegativeInteger:()=>xr,nonPositiveInteger:()=>yr,normalizedString:()=>hr,positiveInteger:()=>Nr,short:()=>wr,string:()=>Jn,time:()=>tr,token:()=>fr,unsignedByte:()=>Er,unsignedInt:()=>jr,unsignedLong:()=>Sr,unsignedShort:()=>Ir,yearMonthDuration:()=>Tr});const o="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/",l={xsd:{decimal:`${s}decimal`,boolean:`${s}boolean`,double:`${s}double`,integer:`${s}integer`,string:`${s}string`},rdf:{type:`${o}type`,nil:`${o}nil`,first:`${o}first`,rest:`${o}rest`,langString:`${o}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${a}reify#forSome`,forAll:`${a}reify#forAll`},log:{implies:`${a}log#implies`,isImpliedBy:`${a}log#isImpliedBy`}},{rdf:c,xsd:u}=l;let d,h=0;const f={namedNode:S,blankNode:j,variable:E,literal:I,defaultGraph:function(){return d},quad:N,triple:N,fromTerm:T,fromQuad:R},p=f;class g{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof g?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 y extends g{get termType(){return"NamedNode"}}class m extends g{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new y(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?u.string:c.langString}equals(e){return e instanceof m?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class b extends g{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class v extends g{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}function w(e,t,n){if(t=t||f,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===f)return new m(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const r=e.lastIndexOf('"',e.length-1);return t.literal(e.substr(1,r-1),"@"===e[r+1]?e.substr(r+2):t.namedNode(e.substr(r+3)));case"[":e=JSON.parse(e);break;default:if(!n||!Array.isArray(e))return t.namedNode(e)}return t.quad(w(e[0],t,!0),w(e[1],t,!0),w(e[2],t,!0),e[3]&&w(e[3],t,!0))}function _(e,t){if("string"==typeof e)return e;if(e instanceof g&&"Quad"!==e.termType)return e.id;if(!e)return d.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==u.string?`^^${e.datatype.value}`:""}`;case"Quad":const n=[_(e.subject,!0),_(e.predicate,!0),_(e.object,!0)];return e.graph&&"DefaultGraph"!==e.graph.termType&&n.push(_(e.graph,!0)),t?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${e.termType}`)}}d=new class extends g{constructor(){return super(""),d||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class x extends g{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||d}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function S(e){return new y(e)}function j(e){return new b(e||"n3-"+h++)}function I(e,t){if("string"==typeof t)return new m(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=u.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?u.integer:u.double:(n=u.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===n||n===u.string?new m(`"${e}"`):new m(`"${e}"^^${n}`)}function E(e){return new v(e)}function N(e,t,n,r){return new x(e,t,n,r)}function T(e){if(e instanceof g)return e;switch(e.termType){case"NamedNode":return S(e.value);case"BlankNode":return j(e.value);case"Variable":return E(e.value);case"DefaultGraph":return d;case"Literal":return I(e.value,e.language||e.datatype);case"Quad":return R(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function R(e){if(e instanceof x)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return N(T(e.subject),T(e.predicate),T(e.object),T(e.graph))}const O="http://www.w3.org/ns/shacl#",k="http://datashapes.org/dash#",L="http://www.w3.org/2001/XMLSchema#",A="http://www.w3.org/1999/02/22-rdf-syntax-ns#",C="http://www.w3.org/2000/01/rdf-schema#",D="http://www.w3.org/2004/02/skos/core#",M="http://www.w3.org/2002/07/owl#",P=p.namedNode("shapes"),$=p.namedNode(A+"type"),B=p.namedNode("http://purl.org/dc/terms/conformsTo"),F=p.namedNode(C+"subClassOf"),q=p.namedNode(D+"broader"),U=p.namedNode(M+"imports"),G=p.namedNode(M+"NamedIndividual"),V=p.namedNode(O+"NodeShape"),H=p.namedNode(O+"IRI"),z=p.namedNode(O+"class"),W=p.namedNode(O+"targetClass"),J=p.namedNode(O+"nodeKind");function Q(e,t,n=O,r){let i="";const o=function(e,t,n=O,r){let i;const o=n+t;if(null==r?void 0:r.length){for(const t of r)for(const n of e)if(n.predicate.value===o){if(n.object.id.endsWith(`@${t}`))return n.object;n.object.id.indexOf("@")<0?i=n.object:i||(i=n.object)}}else for(const t of e)if(t.predicate.value===o)return t.object;return i}(e,t,n,r);return o&&(i=o.value),i}function X(e,t){return Q(e,"prefLabel",D,t)||Q(e,"label",C,t)}function K(e,t,n,r){const i=[];for(const o of e)i.push({value:o,label:X(t.getQuads(o,null,null,null),n),indent:r});return i}function Y(e,t){for(const n in t)e=e.replace(t[n],"");return e}function Z(e,t,n,r,i=new Set){for(const o of t.owlImports)i.has(o.id)||(i.add(o.id),r.push(...n.getSubjects($,e,o)));t.parent&&Z(e,t.parent,n,r,i)}function ee(e,t,n=0){let r;if(t.shaclIn){const e=t.config.lists[t.shaclIn];r=(null==e?void 0:e.length)?e:[]}else r=t.config.shapesGraph.getSubjects($,e,P),r.push(...t.config.dataGraph.getSubjects($,e,null)),Z(e,t,t.config.shapesGraph,r);const i=K(r,t.config.shapesGraph,t.config.languages,n);if(void 0===t.shaclIn){for(const r of t.config.shapesGraph.getSubjects(F,e,null))i.push(...ee(r,t,n+1));if(t.config.shapesGraph.getQuads(e,$,G,null).length>0){i.push(...K([e],t.config.shapesGraph,t.config.languages,n));for(const r of t.config.shapesGraph.getSubjects(q,e,null))i.push(...ee(r,t,n+1))}}return i}function te(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}function ne(e,t,n){if(void 0===t)return n;if(void 0===n)return t;const r=e.indexOf(t.language);if(r<0)return n;const i=e.indexOf(n.language);return i<0||i>r?t:n}function re(e,t,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const i=[];if(i.push({label:"--- please choose ---",value:""}),t instanceof Ce){const o=[];for(let r=0;r<e.length;r++){const s=new Ie(e[r],t,n);o.push(s),i.push({label:s.template.label,value:r.toString()})}const s=n.theme.createListEditor("Please choose",null,!1,i),a=s.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(o[parseInt(a.value)])},r.appendChild(s)}else{const o=[];for(let t=0;t<e.length;t++){const r=n.shapesGraph.getQuads(e[t],null,null,null);r.length&&(o.push(r),i.push({label:X(r,n.languages)||Y(r[0].predicate.value,n.prefixes)+" = "+Y(r[0].object.value,n.prefixes),value:t.toString()}))}const s=n.theme.createListEditor(t.template.label+"?",null,!1,i,t.template),a=s.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(Ee(t.template.clone().merge(o[parseInt(a.value)]),void 0,!0))},r.appendChild(s)}return r}const ie={[`${O}name`]:(e,t)=>{const n=t;e.name=ne(e.config.languages,e.name,n)},[`${O}description`]:(e,t)=>{const n=t;e.description=ne(e.config.languages,e.description,n)},[`${O}path`]:(e,t)=>{e.path=t.value},[`${O}node`]:(e,t)=>{e.node=t},[`${O}datatype`]:(e,t)=>{e.datatype=t},[`${O}nodeKind`]:(e,t)=>{e.nodeKind=t},[`${O}minCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${O}maxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[`${O}minLength`]:(e,t)=>{e.minLength=parseInt(t.value)},[`${O}maxLength`]:(e,t)=>{e.maxLength=parseInt(t.value)},[`${O}minInclusive`]:(e,t)=>{e.minInclusive=parseInt(t.value)},[`${O}maxInclusive`]:(e,t)=>{e.maxInclusive=parseInt(t.value)},[`${O}minExclusive`]:(e,t)=>{e.minExclusive=parseInt(t.value)},[`${O}maxExclusive`]:(e,t)=>{e.maxExclusive=parseInt(t.value)},[`${O}pattern`]:(e,t)=>{e.pattern=t.value},[`${O}order`]:(e,t)=>{e.order=parseInt(t.value)},[`${k}singleLine`]:(e,t)=>{e.singleLine="true"===t.value},[`${k}readonly`]:(e,t)=>{e.readonly="true"===t.value},"http://www.w3.org/ns/oa#styleClass":(e,t)=>{e.cssClass=t.value},[`${O}and`]:(e,t)=>{e.shaclAnd=t.value},[`${O}in`]:(e,t)=>{e.shaclIn=t.value},[`${O}languageIn`]:(e,t)=>{e.languageIn=e.config.lists[t.value],e.datatype=p.namedNode(A+"langString")},[`${O}defaultValue`]:(e,t)=>{e.defaultValue=t},[`${O}hasValue`]:(e,t)=>{e.hasValue=t},[`${O}qualifiedValueShape`]:(e,t)=>{e.qualifiedValueShape=t},[`${O}qualifiedMinCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${O}qualifiedMaxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[U.id]:(e,t)=>{e.owlImports.push(t)},[z.id]:(e,t)=>{e.class=t;const n=e.config.shapesGraph.getSubjects(W,t,null);n.length>0&&(e.node=n[0])},[`${O}or`]:(e,t)=>{const n=e.config.lists[t.value];(null==n?void 0:n.length)?e.shaclOr=n:console.error("list not found:",t.value,"existing lists:",e.config.lists)}};class oe{constructor(e,t,n){this.label="",this.owlImports=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.shapesGraph.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){var t,n;for(const n of e)null===(t=ie[n.predicate.id])||void 0===t||t.call(this,this,n.object);if(this.label=(null===(n=this.name)||void 0===n?void 0:n.value)||X(e,this.config.languages),this.label||this.shaclAnd||(this.label=this.path?Y(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.extendedShapes=[],this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const e=this.config.lists[this.shaclAnd];if(null==e?void 0:e.length)for(const t of e)this.extendedShapes.push(t)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}class se{constructor(e){let t="form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }\nform.mode-edit { padding-left: 1em; }\nform *, form ::after, form ::before { box-sizing: inherit; }\nshacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }\nshacl-node .control-button { text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }\nshacl-node .control-button:hover { border-color: inherit; }\nshacl-node .remove-button { margin-left: 4px; }\nshacl-node .add-button { font-size: 0.8rem; color: #555; margin: 4px 24px 0 0; }\nshacl-node .add-button:before { content: '+'; margin-right: 0.2em; }\nshacl-node .add-button:hover { color: inherit; }\nshacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }\nshacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }\nshacl-property:not(.may-add) > .add-button { display: none; }\nshacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }\nshacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }\n.shacl-group { margin-bottom: 1em; padding-bottom: 1em; }\n.mode-view .shacl-group:not(:has(shacl-property)) { display: none; }\n.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }\n.shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }\n.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }\n.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }\n.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: green; content: '\\2713'; }\n.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }\n.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }\nselect { overflow: hidden; text-overflow: ellipsis; }\ntextarea.editor { resize: vertical; }\n.lang-chooser { position: absolute; top: 5px; right: 24px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }\n.lang-chooser+.editor { padding-right: 55px; }\n.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: red; cursor: help; }\n.validation-error::before { content: '\\26a0' }\n.validation-error.node { left: -1em; }\n.invalid > .editor { border-color: red !important; }\n.ml-0 { margin-left: 0 !important; }\n.pr-0 { padding-right: 0 !important; }\n.mode-view .property-instance:not(:first-child) > label { visibility: hidden; }\n.mode-view .property-instance label { width: var(--label-width); }\n\n.d-flex { display: flex; }\n.lang { opacity: 0.65; font-size: 0.6em; }\na, a:visited { color: inherit; }\n\n.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }\n.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}\n@keyframes fadeIn {\n 0% { opacity: 0; transform: scaleY(0.8); }\n 100% { opacity: 1; transform: scaleY(1); }\n}\n \n.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }\n.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }\n.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }\n.collapsible.open > .activator::after { transform: rotate(225deg); }\n.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }\n.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }\n.collapsible > .property-instance > shacl-node > h1 { display: none; }\n.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }\n.ref-link { cursor: pointer; }\n.ref-link:hover { text-decoration: underline; }\n.node-id-display { color: #999; font-size: 11px; }";e&&(t+="\n"+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,n){const r=document.createElement("div"),i=document.createElement("label");i.innerHTML=e+":",n.description&&i.setAttribute("title",n.description.value),r.appendChild(i);let o,s=t.value,a=null;if(t instanceof y){const e=n.config.shapesGraph.getQuads(s,null,null,null);if(e.length){const t=X(e,n.config.languages);t&&(s=t)}}else t instanceof m&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${L}date`?s=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${L}dateTime`&&(s=new Date(Date.parse(t.value)).toLocaleString()));return te(t.value)?(o=document.createElement("a"),o.setAttribute("href",t.value)):o=document.createElement("div"),o.classList.add("d-flex"),o.innerText=s,a&&o.appendChild(a),r.appendChild(o),r}}function ae(e){return!!e&&"DefaultGraph"===e.termType}function le(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const ce=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ue=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/;class de{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!ce.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!de.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",le(e)],n=[],r=[],i=/[^/?#]*([/?#])/y;let o,s=0,a=0,l=i.lastIndex=e.length;for(;!s&&!a&&(o=i.exec(this.base));)"#"===o[1]?a=i.lastIndex-1:(t.push(le(o[0]),"(?:"),n.push(")?"),"?"!==o[1]?r.push(l=i.lastIndex):(s=l=i.lastIndex,a=this.base.indexOf("#",s),this._pathReplacements[s]="?"));for(let e=0;e<r.length;e++)this._pathReplacements[r[e]]="../".repeat(r.length-e-1);return this._pathReplacements[r[r.length-1]]="./",this._baseLength=a>0?a:this.base.length,t.push(le(this.base.substring(l,this._baseLength)),s?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const r=this._pathReplacements[n];if(r){const t=e.substring(n);return"?"===r||ue.test(t)?"./"===r&&/^[^?#]/.test(t)?t:r+t:e}return e.substring(n-1)}}const he=p.defaultGraph(),{rdf:fe,xsd:pe}=l,ge=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ye=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,me={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class be extends g{equals(e){return e===this}}class ve{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=he,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new de(t.baseIRI)))}get _inDefaultGraph(){return he.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(he.equals(r)?"":`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){let t="";for(const n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),ge.test(t)&&(t=t.replace(ye,we));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(ge.test(t)&&(t=t.replace(ye,we)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===pe.string)return`"${t}"`}else switch(e.datatype.value){case pe.string:return`"${t}"`;case pe.boolean:if("true"===t||"false"===t)return t;break;case pe.integer:if(/^[+-]?\d+$/.test(t))return t;break;case pe.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case pe.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===fe.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${ae(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,he,r):this._writeQuad(e,t,n,r||he,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const r={};r[e]=t,this.addPrefixes(r,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let t in e){let r=e[t];"string"!=typeof r&&(r=r.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[r]=t+=":",this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?"|":"")+this._prefixIRIs[n];e=le(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new be("[]");case 1:if(n=i[0],!(n.object instanceof be))return new be(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let o=0;o<r;o++)n=i[o],n.predicate.equals(e)?t+=`, ${this._encodeObject(n.object)}`:(t+=`${(o?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new be(`${t}\n]`)}}list(e){const t=e&&e.length||0,n=new Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new be(`(${n.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,r)=>{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function we(e){let t=me[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function _e(e){let t=e.shaclDatatype,n=e.value;return n?e.dataset.class||e.dataset.nodeKind===O+"IRI"?p.namedNode(n):(e.dataset.lang?t=e.dataset.lang:"number"===e.type?n=parseFloat(n):"file"===e.type&&e.binaryData?n=e.binaryData:"datetime-local"===e.type&&(n=new Date(n).toISOString().slice(0,19)),p.literal(n,t)):"checkbox"!==e.type&&"checkbox"!==e.getAttribute("type")||!(e.checked||parseInt(e.dataset.minCount||"0")>0)?void 0:p.literal(e.checked?"true":"false",t)}const xe={};function Se(e){void 0===e.predicate&&void 0===e.datatype?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',e):xe[`${e.predicate}^${e.datatype}`]=e}class je{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}class Ie extends HTMLElement{constructor(e,t,n,r){var i;if(super(),this.template=new oe(n.shapesGraph.getQuads(e,null,null,null),t,n),void 0!==this.template.order&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&(this.addButton=document.createElement("a"),this.addButton.innerText=this.template.label,this.addButton.title="Add "+this.template.label,this.addButton.classList.add("control-button","add-button"),this.addButton.addEventListener("click",(e=>{const t=this.addPropertyInstance();t.classList.add("fadeIn"),this.updateControls(),function(e){var t;null===(t=e.querySelector("input,select,textarea"))||void 0===t||t.focus()}(t),setTimeout((()=>{t.classList.remove("fadeIn")}),200)})),this.appendChild(this.addButton)),this.template.path){const e=r?n.dataGraph.getQuads(r,this.template.path,null,null):[];let t=!1;for(const r of e){if(this.template.node){const e=n.shapesGraph.getObjects(this.template.node,W,null);if(e.length>0){let t=!1;for(let i=0;i<e.length&&!t;i++)n.dataGraph.getQuads(r.object,$,e[i],null).length>0&&(t=!0);if(!t)continue}}this.addPropertyInstance(r.object),this.template.hasValue&&r.object.equals(this.template.hasValue)&&(t=!0)}n.editMode&&this.template.hasValue&&!t&&this.addPropertyInstance(this.template.hasValue)}if(n.editMode&&(this.addEventListener("change",(()=>{this.updateControls()})),this.updateControls()),(null===(i=this.template.extendedShapes)||void 0===i?void 0:i.length)&&null!==this.template.config.attributes.collapse&&(!this.template.maxCount||this.template.maxCount>1)&&(n.editMode||this.childElementCount>0)){const e=this;e.classList.add("collapsible"),"open"===this.template.config.attributes.collapse&&e.classList.add("open");const t=document.createElement("h1");t.classList.add("activator"),t.innerText=this.template.label,t.addEventListener("click",(()=>{e.classList.toggle("open")})),this.prepend(t)}}addPropertyInstance(e){var t;let n;return(null===(t=this.template.shaclOr)||void 0===t?void 0:t.length)?e?n=Ee(function(e,t){if(!e.shaclOr)return console.warn("can't resolve sh:or because template has no options",e),e;if(t instanceof m){const n=t.datatype;for(const t of e.shaclOr){const r=e.config.shapesGraph.getQuads(t,null,null,null);for(const t of r)if(t.predicate.value===`${O}datatype`&&t.object.equals(n))return e.clone().merge(r)}}else{let n=e.config.dataGraph.getObjects(t,$,null);n.push(...e.config.shapesGraph.getObjects(t,$,null));for(const t of e.shaclOr){const r=e.config.shapesGraph.getQuads(t,null,null,null);for(const t of r)if(n.length>0){if(t.predicate.value===`${O}node`)for(const i of n)if(e.config.shapesGraph.getQuads(t.object,W,i,null).length>0)return e.clone().merge(r);if(t.predicate.equals(z))for(const i of n)if(t.object.equals(i))return e.clone().merge(r)}else if(t.predicate.equals(J)&&t.object.equals(H))return e.clone().merge(r)}}return console.error("couldn't resolve sh:or for value",t),e}(this.template,e),e,!0):(n=re(this.template.shaclOr,this,this.template.config),Ne(n,"")):n=Ee(this.template,e),this.template.config.editMode?this.insertBefore(n,this.addButton):this.appendChild(n),n}updateControls(){var e;let t,n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;0===n&&(!(null===(e=this.template.extendedShapes)||void 0===e?void 0:e.length)||void 0!==this.template.minCount&&this.template.minCount>0)&&(this.addPropertyInstance(),n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length),t=void 0!==this.template.minCount?n>this.template.minCount:this.template.extendedShapes&&this.template.extendedShapes.length>0||n>1;const r=void 0===this.template.maxCount||n<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance")){const r=p.namedNode(n.dataset.path);if(n.firstChild instanceof Ce){const i=n.firstChild.toRDF(e);e.addQuad(t,r,i,this.template.config.valuesGraph)}else for(const i of n.querySelectorAll(":scope > .editor")){const n=_e(i);n&&e.addQuad(t,r,n,this.template.config.valuesGraph)}}}}function Ee(e,t,n=!1){var r,i;let o;if(null===(r=e.extendedShapes)||void 0===r?void 0:r.length){o=document.createElement("div"),o.classList.add("property-instance");for(const n of e.extendedShapes)o.appendChild(new Ce(n,e.config,t,e.parent,e.nodeKind,e.label))}else{const n=function(e,t){let n=xe[`${e}^${t}`];return n||(n=xe[`${e}^undefined`],n||xe[`undefined^${t}`])}(e.path,null===(i=e.datatype)||void 0===i?void 0:i.value);o=n?e.config.editMode?n.createEditor(e,t):n.createViewer(e,t):function(e,t){var n,r,i;if(e.config.editMode){const o=void 0!==e.minCount&&e.minCount>0;if(e.class)return e.config.theme.createListEditor(e.label,t,o,ee(e.class,e),e);if(e.shaclIn){const n=e.config.lists[e.shaclIn];if(null==n?void 0:n.length){const r=K(n,e.config.shapesGraph,e.config.languages);return e.config.theme.createListEditor(e.label,t,o,r,e)}console.error("list not found:",e.shaclIn,"existing lists:",e.config.lists)}if((null===(n=e.datatype)||void 0===n?void 0:n.value)===`${A}langString`||(null===(r=e.languageIn)||void 0===r?void 0:r.length))return e.config.theme.createLangStringEditor(e.label,t,o,e);switch(null===(i=e.datatype)||void 0===i?void 0:i.value.replace(L,"")){case"integer":case"float":case"double":case"decimal":return e.config.theme.createNumberEditor(e.label,t,o,e);case"date":case"dateTime":return e.config.theme.createDateEditor(e.label,t,o,e);case"boolean":return e.config.theme.createBooleanEditor(e.label,t,o,e);case"base64Binary":return e.config.theme.createFileEditor(e.label,t,o,e)}return e.config.theme.createTextEditor(e.label,t,o,e)}{if(t)return e.config.theme.createViewer(e.label,t,e);const n=document.createElement("div");return n.innerHTML="No value",n}}(e,t||null),o.classList.add("property-instance")}return e.config.editMode&&Ne(o,e.label,n),o.dataset.path=e.path,o}function Ne(e,t,n=!1){const r=document.createElement("a");r.innerText="×",r.classList.add("control-button","btn","remove-button"),r.title="Remove "+t,r.addEventListener("click",(t=>{e.classList.remove("fadeIn"),e.classList.add("fadeOut"),setTimeout((()=>{const t=e.parentElement;e.remove(),null==t||t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),200)})),n&&r.classList.add("persistent"),e.appendChild(r)}function Te(e,t){const n=document.createElement("div");n.dataset.subject=e,n.classList.add("shacl-group");let r=e;const i=t.shapesGraph.getQuads(e,null,null,null),o=Q(i,"label",C,t.languages);o&&(r=o);const s=Q(i,"order");s&&(n.style.order=s);const a=document.createElement("h1");return a.innerText=r,n.appendChild(a),null!==t.attributes.collapse&&(n.classList.add("collapsible"),"open"===t.attributes.collapse&&n.classList.add("open"),a.classList.add("activator"),a.addEventListener("click",(()=>{n.classList.toggle("open")}))),n}window.customElements.define("shacl-property",Ie);const Re={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Oe;const ke=new Uint8Array(16),Le=[];for(let e=0;e<256;++e)Le.push((e+256).toString(16).slice(1));const Ae=function(e,t,n){if(Re.randomUUID&&!t&&!e)return Re.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Oe){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Oe=crypto.getRandomValues.bind(crypto)}return Oe(ke)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(Le[e[t+0]]+Le[e[t+1]]+Le[e[t+2]]+Le[e[t+3]]+"-"+Le[e[t+4]]+Le[e[t+5]]+"-"+Le[e[t+6]]+Le[e[t+7]]+"-"+Le[e[t+8]]+Le[e[t+9]]+"-"+Le[e[t+10]]+Le[e[t+11]]+Le[e[t+12]]+Le[e[t+13]]+Le[e[t+14]]+Le[e[t+15]]).toLowerCase()}(r)};class Ce extends HTMLElement{constructor(e,t,n,r,i,o){super(),this.owlImports=[],this.parent=r,this.config=t,this.shaclSubject=e;let s=n;if(!s){if(!i){const n=t.shapesGraph.getObjects(e,`${O}nodeKind`,null);n.length&&(i=n[0])}s=void 0===i&&t.attributes.valuesNamespace||(null==i?void 0:i.id)===`${O}IRI`?p.namedNode(t.attributes.valuesNamespace+Ae()):p.blankNode(Ae())}this.nodeId=s;const a=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(a)){if(o&&null===t.attributes.collapse){const e=document.createElement("label");e.innerText=o,this.appendChild(e)}const e=document.createElement("a");e.innerText=n.id,e.classList.add("ref-link"),e.onclick=()=>{var e;null===(e=this.config.form.querySelector(`shacl-node[data-node-id='${this.nodeId.id}']`))||void 0===e||e.scrollIntoView()},this.appendChild(e),this.style.flexDirection="row"}else{n&&t.renderedNodes.add(a),this.dataset.nodeId=this.nodeId.id;const r=t.shapesGraph.getQuads(e,null,null,null);let i;if(null!==this.config.attributes.showNodeIds){const e=document.createElement("div");e.innerText=`id: ${this.nodeId.id}`,e.classList.add("node-id-display"),this.appendChild(e)}for(const e of r)switch(e.predicate.id){case`${O}property`:let r=this;const o=t.shapesGraph.getQuads(e.object,`${O}group`,null,null);if(o.length>0){const e=o[0].object.value;if(t.groups.indexOf(e)>-1){let n=this.querySelector(`:scope > .shacl-group[data-subject='${e}']`);n||(n=Te(e,t),this.appendChild(n)),r=n}else console.warn("ignoring unknown group reference",o[0],"existing groups:",t.groups)}setTimeout((()=>{const i=new Ie(e.object,this,t,n);i.childElementCount>0&&r.appendChild(i)}));break;case`${O}and`:if(i=t.lists[e.object.value],null==i?void 0:i.length)for(const e of i)this.prepend(new Ce(e,t,n,this));else console.error("list not found:",e.object.value,"existing lists:",t.lists);break;case`${O}node`:this.prepend(new Ce(e.object,t,n,this));break;case`${O}targetClass`:this.targetClass=e.object;break;case U.id:this.owlImports.push(e.object);break;case`${O}or`:i=t.lists[e.object.value],(null==i?void 0:i.length)?this.appendChild(re(i,this,t)):console.error("list not found:",e.object.value,"existing lists:",t.lists)}if(o){const e=document.createElement("h1");e.innerText=o,this.prepend(e)}}}toRDF(e,t){t||(t=this.nodeId);for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);return this.targetClass&&e.addQuad(t,$,this.targetClass,this.config.valuesGraph),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,p.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraph),t}}window.customElements.define("shacl-node",Ce);var De=r(9198);const Me=Symbol("iter");function Pe(e,t,n=4){if(0===n)return Object.assign(e,t);for(const r in t)e[r]=Pe(e[r]||Object.create(null),t[r],n-1);return e}function $e(e,t,n=4){let r=!1;for(const i in e)if(i in t){const o=0===n?null:$e(e[i],t[i],n-1);if(!1!==o)r=r||Object.create(null),r[i]=o;else if(3===n)return!1}return r}function Be(e,t,n=4){let r=!1;for(const i in e)if(i in t){if(0!==n){const o=Be(e[i],t[i],n-1);if(!1!==o)r=r||Object.create(null),r[i]=o;else if(3===n)return!1}}else r=r||Object.create(null),r[i]=0===n?null:Pe({},e[i],n-1);return r}class Fe{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||p}_termFromId(e){if("."===e[0]){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return w(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object);let i;return t&&n&&r&&(ae(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[_(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${ae(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:_(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class qe{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||"function"==typeof e.match||(t=e,e=null),t=t||{},this._factory=t.factory||p,this._entityIndex=t.entityIndex||new Fe({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const o in n=t[i].subjects)for(const t in r=n[o])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),s=r in o;return s||(o[r]=null),!s}_removeFromIndex(e,t,n,r){const i=e[t],o=i[n];delete o[r];for(const e in o)return;delete i[n];for(const e in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,o,s,a){let l,c,u;const d=this._entities,h=this._termFromId(d[a]),f={subject:null,predicate:null,object:null};t&&((l=e,e={})[t]=l[t]);for(const t in e)if(c=e[t]){f[i]=this._termFromId(d[t]),n&&((l=c,c={})[n]=l[n]);for(const e in c)if(u=c[e]){f[o]=this._termFromId(d[e]);const t=r?r in u?[r]:[]:Object.keys(u);for(let e=0;e<t.length;e++)f[s]=this._termFromId(d[t[e]]),yield this._factory.quad(f.subject,f.predicate,f.object,h)}}}_loop(e,t){for(const n in e)t(n)}_loopByKey0(e,t,n){let r,i;if(r=e[t])for(i in r)n(i)}_loopByKey1(e,t,n){let r,i;for(r in e)i=e[r],i[t]&&n(r)}_loopBy2Keys(e,t,n,r){let i,o,s;if((i=e[t])&&(o=i[n]))for(s in o)r(s)}_countInIndex(e,t,n,r){let i,o,s,a=0;t&&((i=e,e={})[t]=i[t]);for(const t in e)if(o=e[t]){n&&((i=o,o={})[n]=i[n]);for(const e in o)(s=o[e])&&(r?r in s&&a++:a+=Object.keys(s).length)}return a}_getGraphs(e){return"number"!=typeof(e=""===e?1:e&&(this._termToNumericId(e)||-1))?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r?this._termToNewNumericId(r):1;let i=this._graphs[r];return i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),!!this._addToIndex(i.subjects,e,t,n)&&(this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.objects,n,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,r){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:r}=e),!this.readQuads(e,t,n,r).next().done}import(e){return e.on("data",(e=>{this.addQuad(e)})),e}removeQuad(e,t,n,r){t||({subject:e,predicate:t,object:n,graph:r}=e),r=r?this._termToNumericId(r):1;const i=this._graphs;let o,s,a;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(n=n&&this._termToNumericId(n))&&(o=i[r])&&(s=o.subjects[e])&&(a=s[t])&&n in a))return!1;for(e in this._removeFromIndex(o.subjects,e,t,n),this._removeFromIndex(o.predicates,t,n,e),this._removeFromIndex(o.objects,n,e,t),null!==this._size&&this._size--,o.subjects)return!0;return delete i[r],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",(e=>{this.removeQuad(e)})),e}removeMatches(e,t,n,r){const i=new De.Readable({objectMode:!0}),o=this.readQuads(e,t,n,r);return i._read=e=>{for(;--e>=0;){const{done:e,value:t}=o.next();if(e)return void i.push(null);i.push(t)}},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){return[...this.readQuads(e,t,n,r)]}*readQuads(e,t,n,r){const i=this._getGraphs(r);let o,s,a,l;if(!(e&&!(s=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(const e in i)(o=i[e])&&(s?l?yield*this._findInIndex(o.objects,l,s,a,"object","subject","predicate",e):yield*this._findInIndex(o.subjects,s,a,null,"subject","predicate","object",e):a?yield*this._findInIndex(o.predicates,a,l,null,"predicate","object","subject",e):l?yield*this._findInIndex(o.objects,l,null,null,"object","subject","predicate",e):yield*this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",e))}match(e,t,n,r){return new Ge(this,e,t,n,r,{entityIndex:this._entityIndex})}countQuads(e,t,n,r){const i=this._getGraphs(r);let o,s,a,l,c=0;if(e&&!(s=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(const r in i)(o=i[r])&&(c+=e?n?this._countInIndex(o.objects,l,s,a):this._countInIndex(o.subjects,s,a,l):t?this._countInIndex(o.predicates,a,l,s):this._countInIndex(o.objects,l,s,a));return c}forEach(e,t,n,r,i){this.some((t=>(e(t,this),!1)),t,n,r,i)}every(e,t,n,r,i){return!this.some((t=>!e(t,this)),t,n,r,i)}some(e,t,n,r,i){for(const o of this.readQuads(t,n,r,i))if(e(o,this))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects((e=>{r.push(e)}),e,t,n),r}forSubjects(e,t,n,r){const i=this._getGraphs(r);let o,s,a;if(e=this._uniqueEntities(e),!(t&&!(s=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(o=i[r])&&(s?a?this._loopBy2Keys(o.predicates,s,a,e):this._loopByKey1(o.subjects,s,e):a?this._loopByKey0(o.objects,a,e):this._loop(o.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates((e=>{r.push(e)}),e,t,n),r}forPredicates(e,t,n,r){const i=this._getGraphs(r);let o,s,a;if(e=this._uniqueEntities(e),!(t&&!(s=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(o=i[r])&&(s?a?this._loopBy2Keys(o.objects,a,s,e):this._loopByKey0(o.subjects,s,e):a?this._loopByKey1(o.predicates,a,e):this._loop(o.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects((e=>{r.push(e)}),e,t,n),r}forObjects(e,t,n,r){const i=this._getGraphs(r);let o,s,a;if(e=this._uniqueEntities(e),!(t&&!(s=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(o=i[r])&&(s?a?this._loopBy2Keys(o.subjects,s,a,e):this._loopByKey1(o.objects,s,e):a?this._loopByKey0(o.predicates,a,e):this._loop(o.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs((e=>{r.push(e)}),e,t,n),r}forGraphs(e,t,n,r){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,n,r,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,l.rdf.rest,l.rdf.nil,null),o=e?[...i]:[];return i.forEach((t=>{const i=[];let s,a,c=!1;const u=t.graph;let d=t.subject;for(;d&&!c;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,h=null,f=null,p=null;for(let i=0;i<t.length&&!c;i++)n=t[i],n.graph.equals(u)?s?c=r(d,"has non-list arcs out"):n.predicate.value===l.rdf.first?h?c=r(d,"has multiple rdf:first arcs"):o.push(h=n):n.predicate.value===l.rdf.rest?f?c=r(d,"has multiple rdf:rest arcs"):o.push(f=n):e.length?c=r(d,"can't be subject and object"):(s=n,a="subject"):c=r(d,"not confined to single graph");for(let t=0;t<e.length&&!c;++t)n=e[t],s?c=r(d,"can't have coreferences"):n.predicate.value===l.rdf.rest?p?c=r(d,"has incoming rdf:rest arcs"):p=n:(s=n,a="object");h?i.unshift(h.object):c=r(d,"has no list head"),d=p&&p.subject}c?e=!1:s&&(n[s[a].value]=i)})),e&&this.removeQuads(o),n}addAll(e){if(e instanceof Ge&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof qe&&e._entityIndex===this._entityIndex)0!==e._size&&(this._graphs=Pe(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof Ge&&(e=e.filtered),e===this)return!0;if(!(e instanceof qe)||this._entityIndex!==e._entityIndex)return e.every((e=>this.has(e)));const t=this._graphs,n=e._graphs;let r,i,o,s,a;for(const e in n){if(!(r=t[e]))return!1;r=r.subjects;for(const t in i=n[e].subjects){if(!(o=r[t]))return!1;for(const e in s=i[t]){if(!(a=o[e]))return!1;for(const t in s[e])if(!(t in a))return!1}}}return!0}deleteMatches(e,t,n,r){for(const i of this.match(e,t,n,r))this.removeQuad(i);return this}difference(e){if(e&&e instanceof Ge&&(e=e.filtered),e===this)return new qe({entityIndex:this._entityIndex});if(e instanceof qe&&e._entityIndex===this._entityIndex){const t=new qe({entityIndex:this._entityIndex}),n=Be(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>!e.has(t)))}equals(e){return e instanceof Ge&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new qe({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof Ge&&(e=e.filtered),e===this){const e=new qe({entityIndex:this._entityIndex});return e._graphs=Pe(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof qe&&this._entityIndex===e._entityIndex){const t=new qe({entityIndex:this._entityIndex}),n=$e(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>e.has(t)))}map(e){const t=new qe({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let r=void 0===t?n.next().value:t;for(const t of n)r=e(r,t,this);return r}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new ve).quadsToString(this)}union(e){const t=new qe({entityIndex:this._entityIndex});return t._graphs=Pe(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function Ue(e,t,n=0){const r=t[n];if(r&&!(r in e))return!1;let i=!1;for(const o in r?{[r]:e[r]}:e){const r=2===n?null:Ue(e[o],t,n+1);!1!==r&&(i=i||Object.create(null),i[o]=r)}return i}class Ge extends De.Readable{constructor(e,t,n,r,i,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:r,graph:i,options:o})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:r,subject:i}=this,o=this._filtered=new qe({factory:e._factory,entityIndex:this.options.entityIndex});let s,a,l;if(i&&!(s=o._termToNumericId(i))||r&&!(a=o._termToNumericId(r))||n&&!(l=o._termToNumericId(n)))return o;const c=e._getGraphs(t);for(const e in c){let t,n,r,i;(i=c[e])&&(!s&&a?(n=Ue(i.predicates,[a,l,s]))&&(t=Ue(i.subjects,[s,a,l]),r=Ue(i.objects,[l,s,a])):l?(r=Ue(i.objects,[l,s,a]))&&(t=Ue(i.subjects,[s,a,l]),n=Ue(i.predicates,[a,l,s])):(t=Ue(i.subjects,[s,a,l]))&&(n=Ue(i.predicates,[a,l,s]),r=Ue(i.objects,[l,s,a])),t&&(o._graphs[e]={subjects:t,predicates:n,objects:r}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Me]&&(this[Me]=this[Symbol.iterator]());const t=this[Me];for(;--e>=0;){const{done:e,value:n}=t.next();if(e)return void this.push(null);this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,r){return this.filtered.deleteMatches(e,t,n,r)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,r,i){return this.filtered.every(e,t,n,r,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,r,i){return this.filtered.forEach(e,t,n,r,i)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,r,i){return this.filtered.some(e,t,n,r,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new ve).quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,r){return new Ge(this.filtered,e,t,n,r,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}var Ve=r(8287);const{xsd:He}=l,ze=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,We={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Je=/[\x00-\x20<>\\"\{\}\|\^\`]/,Qe={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Xe=/$0^/;class Ke{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._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Qe)&&this[e]instanceof RegExp&&(this[e]=Xe)}else this._n3Mode=!1!==e.n3;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,s;for(;e=this._newline.exec(n);)this.comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(s=this._comment.exec(n))&&i("comment",s[1],"",this._line,n.length),n=null,i("eof","","",this._line,0)),this._input=n;const a=this._line,l=n[0];let c="",u="",d="",h=null,f=0,p=!1;switch(l){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){p=!0;break}case"<":if(h=this._unescapedIri.exec(n))c="IRI",u=h[1];else if(h=this._iri.exec(n)){if(u=this._unescape(h[1]),null===u||Je.test(u))return o(this);c="IRI"}else n.length>1&&"<"===n[1]?(c="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(f=2,this._isImpliedBy?(c="abbreviation",u="<"):(c="inverse",u=">"));break;case">":n.length>1&&">"===n[1]&&(c=">>",f=2);break;case"_":((h=this._blank.exec(n))||t&&(h=this._blank.exec(`${n} `)))&&(c="blank",d="_",u=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return o(this);null===h&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return o(this);null===h&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(n))&&(c="var",u=h[0]);break;case"@":"literal"===this._previousMarker&&(h=this._langcode.exec(n))?(c="langcode",u=h[1]):(h=this._keyword.exec(n))&&(c=h[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){c=".",f=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(n)||t&&(h=this._number.exec(`${n} `)))&&(c="literal",u=h[0],d="string"==typeof h[1]?He.double:"string"==typeof h[2]?He.decimal:He.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(n))?c=h[0].toUpperCase():p=!0;break;case"f":case"t":(h=this._boolean.exec(n))?(c="literal",u=h[0],d=He.boolean):p=!0;break;case"a":(h=this._shortPredicates.exec(n))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&n.length>1&&(c="abbreviation",">"!==n[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(f=1,c=l);break;case"{":!this._lineMode&&n.length>=2&&("|"===n[1]?(c="{|",f=2):(c=l,f=1));break;case"|":n.length>=2&&"}"===n[1]&&(c="|}",f=2);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(h=this._prefix.exec(n))?((h=this._prefixed.exec(n))||t&&(h=this._prefixed.exec(`${n} `)))&&(c="prefixed",d=h[1]||"",u=this._unescape(h[2])):(c="prefix",u=h[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;const g=f||h[0].length,y=i(c,u,d,a,g);this.previousToken=y,this._previousMarker=c,n=n.substr(g,n.length)}function i(t,i,o,s,a){const l=n?r-n.length:r,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(ze,((e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in We?We[i]:(t=!0,"")}));return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((n,r)=>n?t=n:e.push(r)),!0),t)throw t;return e}queueMicrotask((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Ve.Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}let Ye=0;class Ze{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&tt(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||s),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Ke({lineMode:a,n3:s,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ye=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?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,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._factory.namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(r+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":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._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":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._factory.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-star syntax",e);default:if(void 0===(this._object=this._readEntity(e)))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);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?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 t=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._factory.blankNode()),null===i?null===s.predicate?s.subject=n:s.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const o=this._predicate,s=this._object;this._subject=this._factory.quad(r,o,s,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),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._factory.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 t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._factory.blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?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 t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,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,t,n,r){this._callback(null,this._factory.quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=et}_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 t=e.length;let n="",r=-1,i=-1,o=0,s="/";for(;r<t;){switch(s){case":":if(i<0&&"/"===e[++r]&&"/"===e[++r])for(;(i=r+1)<t&&"/"!==e[i];)r=i;break;case"?":case"#":r=t;break;case"/":if("."===e[r+1])switch(s=e[1+ ++r],s){case"/":n+=e.substring(o,r-1),o=r+1;break;case void 0:case"?":case"#":return n+e.substring(o,r)+e.substr(r+1);case".":if(s=e[1+ ++r],void 0===s||"/"===s||"?"===s||"#"===s){if(n+=e.substring(o,r-2),(o=n.lastIndexOf("/"))>=i&&(n=n.substr(0,o)),"/"!==s)return`${n}/${e.substr(r+1)}`;o=r+1}}}s=e[++r]}return n+e.substring(o)}parse(e,t,n){let r,i,o;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(r=t.onQuad,i=t.onPrefix,o=t.onComment):(r=t,i=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ye++}_`,this._prefixCallback=i||et,this._inversePredicate=!1,this._quantified=Object.create(null),!r){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),n)throw n;return t}let s=(e,t)=>{null!==e?(this._callback(e),this._callback=et):this._readCallback&&(this._readCallback=this._readCallback(t))};o&&(this._lexer.comments=!0,s=(e,t)=>{null!==e?(this._callback(e),this._callback=et):this._readCallback&&("comment"===t.type?o(t.value):this._readCallback=this._readCallback(t))}),this._callback=r,this._lexer.tokenize(e,s)}}function et(){}function tt(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(l.rdf.first),e.RDF_REST=t.namedNode(l.rdf.rest),e.RDF_NIL=t.namedNode(l.rdf.nil),e.N3_FORALL=t.namedNode(l.r.forAll),e.N3_FORSOME=t.namedNode(l.r.forSome),e.ABBREVIATIONS={a:t.namedNode(l.rdf.type),"=":t.namedNode(l.owl.sameAs),">":t.namedNode(l.log.implies),"<":t.namedNode(l.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode("urn:n3:quantifiers")}tt(Ze.prototype,p);var nt=r(4841),rt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const it={},ot={};let st;class at{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}loadGraphs(){return rt(this,void 0,void 0,(function*(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=st;const t=new qe;this.config.prefixes={};const n=[this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,void 0,new Ze({blankNodePrefix:""}))];if(e||(e=new qe,n.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,P))),yield Promise.all(n),!st&&0==(null==e?void 0:e.size)&&this.config.attributes.valuesSubject){const n=[...t.getObjects(this.config.attributes.valuesSubject,$,null),...t.getObjects(this.config.attributes.valuesSubject,B,null)],r=[];for(const t of n){const n=this.toURL(t.value);n&&this.loadedExternalUrls.indexOf(n)<0&&(this.loadedExternalUrls.push(n),r.push(this.importRDF(this.fetchRDF(n),e,P)))}try{yield Promise.allSettled(r)}catch(e){console.warn(e)}}this.config.shapesGraph=e,this.config.dataGraph=t}))}importRDF(e,t,n,r){return rt(this,void 0,void 0,(function*(){const i=r||new Ze,o=e=>rt(this,void 0,void 0,(function*(){const o=[];yield new Promise(((s,a)=>{i.parse(e,((e,i,l)=>{if(e)return console.warn("failed parsing graph",n,e.message),a(e);if(i){if(t.add(new x(i.subject,i.predicate,i.object,n)),null===this.config.attributes.ignoreOwlImports&&U.equals(i.predicate)){const e=this.toURL(i.object.value);e&&this.loadedExternalUrls.indexOf(e)<0&&(this.loadedExternalUrls.push(e),o.push(this.importRDF(this.fetchRDF(e),t,p.namedNode(e),r)))}if(this.config.classInstanceProvider&&z.equals(i.predicate)){const e=i.object.value;if(this.loadedClasses.indexOf(e)<0){let i;e in ot?i=ot[e]:(i=this.config.classInstanceProvider(e),ot[e]=i),this.loadedClasses.push(e),o.push(this.importRDF(i,t,n,r))}}}else l&&this.config.registerPrefixes(l),s(null)}))}));try{yield Promise.allSettled(o)}catch(e){console.warn(e)}}));if(e instanceof Promise&&(e=yield e),e){try{e=yield(0,nt.toRDF)(JSON.parse(e),{format:"application/n-quads"})}catch(e){}yield o(e)}}))}fetchRDF(e){return rt(this,void 0,void 0,(function*(){if(e in it)return it[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then((e=>e.text()));return it[e]=t,t}))}toURL(e){if(te(e))return e;if(this.config.prefixes){const t=e.split(":");if(2===t.length){const n=this.config.prefixes[t[0]];if(n&&te(e=e.replace(`${t[0]}:`,n)))return e}}return null}}function lt(e){st=e}class ct{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class ut{constructor(e,t){this.attributes=new ct,this.loader=new at(this),this.prefixes={},this.editMode=!0,this.dataGraph=new qe,this.lists={},this.groups=[],this.renderedNodes=new Set,this._shapesGraph=new qe,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap((e=>e.length>2?[e.toLocaleLowerCase(),e.substring(0,2)]:e))),""]}updateAttributes(e){const t=new ct;if(Object.keys(t).forEach((n=>{const r=e.dataset[n];void 0!==r&&(t[n]=r)})),this.editMode=null===t.view,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const e=this.languages.indexOf(t.language);e>-1&&this.languages.splice(e,1),this.languages.unshift(t.language)}this.valuesGraph=t.valuesGraph?p.namedNode(t.valuesGraph):void 0}static dataAttributes(){const e=new ct;return Object.keys(e).map((e=>"data-"+e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))))}get shapesGraph(){return this._shapesGraph}set shapesGraph(e){this._shapesGraph=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects((e=>{this.groups.push(e.id)}),$,`${O}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}const dt=function(e){return"<"+e.value+">"},ht=/["\\\\\n\r]/,ft=/["\\\\\n\r]/g,pt={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function gt(e){return pt[e]}const yt=function e(t){if(!t)return null;if("BlankNode"===t.termType)return function(e){return"_:"+e.value}(t);if("DefaultGraph"===t.termType)return"";if("Literal"===t.termType)return function(e){const t=(n=e.value,ht.test(n)?n.replace(ft,gt):n);var n;return"http://www.w3.org/2001/XMLSchema#string"===e.datatype.value?'"'+t+'"':"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===e.datatype.value?'"'+t+'"@'+e.language:'"'+t+'"^^'+dt(e.datatype)}(t);if("NamedNode"===t.termType)return dt(t);if("Quad"===t.termType||t.subject&&t.predicate&&t.object&&t.graph)return function(e,t){const n=t(e.subject),r=t(e.predicate),i=t(e.object),o=t(e.graph);return`${n} ${r} ${i} ${o?o+" ":""}.`}(t,e);if("Variable"===t.termType)return function(e){return"?"+e.value}(t);if(t[Symbol.iterator])return function(e,t){return[...e].map((e=>t(e))).join("\n")+"\n"}(t,e);throw new Error(`unknown termType ${t.termType}`)};class mt{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(yt(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(yt(e));return t&&t.value}has(e){return this.index.has(yt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=yt(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}const bt=mt;function vt(e){try{return yt(e)}catch(e){return null}}class wt{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=yt(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(vt(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(vt(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const _t=wt,xt=class{constructor({dataset:e,end:t,quad:n,start:r}){this.dataset=e,this.end=t,this.quad=n,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class St{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}St.prototype.termType="BlankNode";const jt=St;class It{equals(e){return!!e&&e.termType===this.termType}}It.prototype.termType="DefaultGraph",It.prototype.value="";const Et=It,Nt=function(e,t){if(!t)return null;if("BlankNode"===t.termType)return e.blankNode(t.value);if("DefaultGraph"===t.termType)return e.defaultGraph();if("Literal"===t.termType)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if("NamedNode"===t.termType)return e.namedNode(t.value);if("Quad"===t.termType){const n=e.fromTerm(t.subject),r=e.fromTerm(t.predicate),i=e.fromTerm(t.object),o=e.fromTerm(t.graph);return e.quad(n,r,i,o)}if("Variable"===t.termType)return e.variable(t.value);throw new Error(`unknown termType ${t.termType}`)};class Tt{constructor(e,t,n){this.value=e,this.language=t,this.datatype=n}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}Tt.prototype.termType="Literal";const Rt=Tt;class Ot{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Ot.prototype.termType="NamedNode";const kt=Ot;class Lt{constructor(e,t,n,r){this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}Lt.prototype.termType="Quad",Lt.prototype.value="";const At=Lt;class Ct{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Ct.prototype.termType="Variable";const Dt=Ct,Mt=new kt("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Pt=new kt("http://www.w3.org/2001/XMLSchema#string");class $t{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new Et}}namedNode(e){return new kt(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new jt(e)}literal(e,t){return"string"==typeof t?new Rt(e,t,Mt):new Rt(e,"",t||Pt)}variable(e){return new Dt(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,r=this.defaultGraph()){return new At(e,t,n,r)}fromTerm(e){return Nt(this,e)}fromQuad(e){return Nt(this,e)}}$t.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const Bt=new $t,Ft={apply:(e,t,n)=>e(n[0]),get:(e,t)=>e(t)},qt=function(e,{factory:t=Bt}={}){const n=(n="")=>t.namedNode(`${e}${n.raw||n}`);return"undefined"==typeof Proxy?n:new Proxy(n,Ft)},Ut=(qt("http://www.w3.org/2001/XMLSchema#"),qt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));qt("http://www.w3.org/2000/01/rdf-schema#");class Gt{static add({ptr:e,start:t,end:n,subjects:r=[null],predicates:i=[null],objects:o=[null],graphs:s,callback:a}={}){if(!e.factory)throw new Error("add operation requires a factory");let l=()=>{};a&&(l=r=>{a(new xt({dataset:e.dataset,start:t,end:n,quad:r}))});for(const n of r)for(const r of i)for(const i of o)for(const o of s){const s={subject:n,predicate:r,object:i,graph:o};s[t]=e.term;const a=e.factory.quad(s.subject,s.predicate,s.object,s.graph);e.dataset.add(a),l(a)}return e}static addList({ptr:e,predicates:t,items:n,graphs:r}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const i of t)for(const t of r){const r=n.map((()=>e.factory.blankNode()));e.dataset.add(e.factory.quad(e.term,i,r[0]||Ut.nil,t));for(let i=0;i<r.length;i++)e.dataset.add(e.factory.quad(r[i],Ut.first,n[i],t)),e.dataset.add(e.factory.quad(r[i],Ut.rest,r[i+1]||Ut.nil,t))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:r=[null],objects:i=[null]}){for(const o of n)for(const n of r)for(const r of i){const i={subject:o,predicate:n,object:r};i[t]=e.term;const s=e.dataset.match(i.subject,i.predicate,i.object);for(const t of s)e.dataset.delete(t)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const r of t)for(const t of e.dataset.match(e.term,r)){let r=t.object;for(n.push(t);!Ut.nil.equals(r);){r=n[n.length-1].object;const t=e.dataset.match(r);if(0===t.size)break;for(const e of t)n.push(e)}}for(const t of n)e.dataset.delete(t);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:r,end:i,subjects:o,predicates:s,objects:a,graphs:l,items:c,callback:u}={}){if("add"===t)return Gt.add({ptr:e,start:r,end:i,subjects:o,predicates:s,objects:a,graphs:l,callback:u});if("addList"===t)return Gt.addList({ptr:e,predicates:s,items:c,graphs:l});if("delete"===t)return Gt.delete({ptr:e,start:r,subjects:o,predicates:s,objects:a});if("deleteList"===t)return Gt.deleteList({ptr:e,predicates:s});if("isList"===t)return Gt.isList({ptr:e});if("list"===t)return Gt.list({ptr:e});if("traverse"===t)return Gt.traverse({ptr:e,quantifier:n,start:r,end:i,subjects:o,predicates:s,objects:a,graphs:l});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return!e.isAny()&&(!!Ut.nil.equals(e.term)||1===Gt.traverse({ptr:e,predicates:[Ut.first]}).length)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(Ut.nil);){const t=e.out([Ut.first]);if(1!==t.length)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([Ut.rest]);if(1!==n.length)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:r="object",subjects:i=[null],predicates:o=[null],objects:s=[null],graphs:a=[null],callback:l}){if("one"===t)return Gt.traverseOne({ptr:e,start:n,end:r,subjects:i,predicates:o,objects:s,graphs:a,callback:l});if("oneOrMore"===t){const t=Gt.traverse({ptr:e,end:r,start:n,subjects:i,predicates:o,objects:s,graphs:a,callback:l});return Gt.traverseMore({ptrs:t,end:r,start:n,subjects:i,predicates:o,objects:s,graphs:a,callback:l})}if("zeroOrMore"===t)return Gt.traverseMore({ptrs:[e],end:r,start:n,subjects:i,predicates:o,objects:s,graphs:a,callback:l});if("zeroOrOne"===t)return[e,...Gt.traverse({ptr:e,end:r,start:n,subjects:i,predicates:o,objects:s,graphs:a,callback:l})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:r,predicates:i,objects:o,graphs:s,callback:a}={}){let l,c,u=[...e];do{l=[];for(const c of e)l=[...l,...Gt.traverseOne({ptr:c,end:t,start:n,subjects:r,predicates:i,objects:o,graphs:s,callback:a})];c&&(l=l.filter((e=>!c.has(e.term)))),e=l,u=[...u,...l],c=new _t(u.map((e=>e.term)))}while(l.length>0);return u}static traverseOne({ptr:e,start:t,end:n,subjects:r,predicates:i,objects:o,graphs:s,callback:a=(e,t)=>t.extend(e)}={}){const l=[];for(const c of r)for(const r of i)for(const i of o)for(const o of s){const s={subject:c,predicate:r,object:i,graph:o};s[t]=e.term;for(const r of e.dataset.match(s.subject,s.predicate,s.object,s.graph))l.push(a(new xt({dataset:e.dataset,end:n,quad:r,start:t}),e))}return l}}const Vt=Gt;function Ht(e,t){return t?n=>t(e.extend(n)):()=>{}}const zt=class{constructor({dataset:e,edges:t=[],factory:n,graph:r,term:i}){if(!e&&0===t.length)throw new Error("dataset or edges is required");if(0===t.length&&void 0===i)throw new Error("edges or term must be given");if(t.length>0&&i)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=r,0===t.length&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return"object"==typeof this._graph?this._graph:this.edge&&this.edge.graph}get length(){return void 0!==this._term?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return void 0!==this._term?this._term:this.edge.term}get value(){const e=this.term;return null===e?void 0:e.value}addIn(e,t,n){return Vt.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}addList(e,t){return Vt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Vt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}deleteIn(e,t){return Vt.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Vt.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Vt.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:o,objects:s,graphs:a,items:l,callback:c}){return Vt.execute({ptr:this,operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:o,objects:s,graphs:a,items:l,callback:c})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Vt.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Vt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Vt.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Vt.isList({ptr:this})}list(){return Vt.list({ptr:this})}nodes(){const e=this,t=e=>void 0!==this._term?{dataset:this.dataset,term:this._term}:this.edges.length>e?{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e?{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term}:void 0;return{*[Symbol.iterator](){for(let n=0;n<e.length;n++)yield t(n)}}}out(e,t){return Vt.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.edges)yield t.quad}}}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}},Wt=function(e,t){return e?e.equals(t):e===t};function Jt(e,t){return t?n=>t(new e.constructor({factory:e.factory,ptrs:[n]})):()=>{}}class Qt{constructor({dataset:e,factory:t,ptrs:n,terms:r,graphs:i}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const n of r||[null])for(const r of i||[null])this.ptrs.push(new zt({dataset:e,factory:t,graph:r,term:n}))}}get dataset(){const e=new Set(this.datasets);return 1!==e.size?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map((e=>e.dataset))}get term(){const e=new _t(this.terms);if(1===e.size)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map((e=>e.term))}get value(){const e=this.term;return null==e?void 0:e.value}get values(){return this.ptrs.map((e=>e.value))}addIn(e,t,n){const r=Jt(this,n);for(const n of this.ptrs)n.addIn(e,t,r);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const r=Jt(this,n);for(const n of this.ptrs)n.addOut(e,t,r);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce(((e,t)=>(e.some((e=>{return r=t,(n=e).dataset===r.dataset&&!!Wt(n.graph,r.graph)&&!!Wt(n.term,r.term);var n,r}))||e.push(t.trim()),e)),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap((t=>t.execute(e)))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map((e=>e.ptrs[0]))})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasIn(e,t)))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasOut(e,t)))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.in(e,t)))})}isAny(){return this.ptrs.length>0&&this.ptrs.some((e=>e.isAny()))}isList(){return 1===this.ptrs.length&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list()[Symbol.iterator](),t=()=>{const{done:t,value:n}=e.next();return t?{done:!0}:{done:!1,value:this.clone({ptrs:[n]})}};return{[Symbol.iterator]:()=>({next:t})}}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map((e=>new zt({dataset:t,factory:this.factory,term:e})));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.out(e,t)))})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.ptrs)for(const e of t.edges)yield e.quad}}}trim(){return this.clone({ptrs:this.ptrs.map((e=>e.trim()))})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}const Xt=Qt;qt("http://www.w3.org/2002/07/owl#");const Kt=qt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),Yt=qt("http://www.w3.org/2000/01/rdf-schema#"),Zt=qt("http://www.w3.org/ns/shacl#"),en=qt("https://schemas.link/shacl-next#"),tn=qt("http://www.w3.org/2001/XMLSchema#");var nn=r(8059);const rn=class{constructor({details:e,factory:t,options:n,results:r=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=r,this._conforms=nn((()=>!this.results.some((e=>e.severity.equals(Zt.Info)||e.severity.equals(Zt.Violation)||e.severity.equals(Zt.Warning))))),this._ptr=nn((()=>this.build()))}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Xt({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Kt.type],[Zt.ValidationReport]).addOut([Zt.conforms],[this.factory.literal(this.conforms.toString(),tn.boolean)]);for(const t of this.results)e.addOut([Zt.result],[this.factory.blankNode()],(e=>{t.build(e,this.options)}));return e}coverage(){return this.results.flatMap((e=>e.coverage()))}},on=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:r,message:i=[],path:o,results:s=[],severity:a,shape:l,source:c=[],value:u,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=r,this.path=o||l.path,this.results=s,this.severity=a,this.shape=l,this.source=c,this.value=u,this.valuePaths=d,this._message=nn((()=>(this.shape.message.length>0&&(i=this.shape.message),0===i.length&&(i=this.shape.ptr.node([this.constraintComponent]).out([Zt.message]).terms),i.map((t=>n.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=yt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(t.value,e),t.language||null))))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Kt.type],[Zt.ValidationResult]).addOut([Zt.focusNode],this.focusNode.terms).addOut([Zt.resultSeverity],[this.severity]).addOut([Zt.sourceConstraint],this.source).addOut([Zt.sourceConstraintComponent],[this.constraintComponent]).addOut([Zt.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([Zt.resultMessage],this.message);const n=t=>"one"===t.quantifier?t.predicates.length>1?e.node([this.factory.blankNode()]).addList([Zt.alternativePath],t.predicates):"object"===t.start?e.node([this.factory.blankNode()]).addOut([Zt.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]):"oneOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Zt.oneOrMorePath],[t.predicates[0]]):"zeroOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Zt.zeroOrMorePath],[t.predicates[0]]):"zeroOrOne"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Zt.zeroOrOnePath],[t.predicates[0]]):void 0;if(this.path&&(1===this.path.length?e.addOut([Zt.resultPath],n(this.path[0]).terms):e.addList([Zt.resultPath],this.path.map((e=>n(e).term)))),void 0!==this.value&&e.addOut([Zt.value],this.value.terms),t)for(const n of this.results)e.addOut([Zt.detail],[this.factory.blankNode()],(e=>{n.build(e,{details:t})}))}coverage(){return[...this.valuePaths.flatMap((e=>[...e.quads()])),...this.results.flatMap((e=>e.coverage()))]}};class sn{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:r=new Set,report:i=new rn({factory:e,options:n}),results:o=new Map,shape:s,value:a,valueOrNode:l,valuePaths:c,values:u}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=r,this.report=i,this.results=o,this.shape=s,this.value=a,this.valuePaths=c,this.valueOrNode=l,this.values=u}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:r=this.value,valueOrNode:i=this.valueOrNode,valuePaths:o=this.valuePaths,values:s=this.values}={}){return new sn({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new rn({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:r,valueOrNode:i,valuePaths:o,values:s})}id({shape:e=this.shape}={}){return`${yt(e.ptr.term)} - ${yt(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map((e=>function(e){return e?`{${[...e.quads()].map((e=>yt(e))).join(" ")}}`:"{}"}(e))).join(" ")}}`:"{}"}`;var t}result(e){const t=new on({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:en.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:en.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||Zt.Violation,...t})}}const an=sn;function ln(){return{generic:e=>{e.trace(en.TraversalConstraintComponent,{args:{},message:[e.factory.literal("Traversal")],value:e.valueOrNode})}}}const cn=class{constructor(e){this.validations=new bt(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const r=new Set;for(const t of e.ptr.execute({start:"subject",end:"predicate"})){const e=this.validations.get(t.term);e&&(r.add(e),t.term.equals(Zt.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&r.add(ln),[...r].map((t=>t(e))).filter(Boolean)}};var un=r(9349);function dn(e){if("BlankNode"!==e.term.termType)return{quantifier:"one",start:"subject",end:"object",predicates:[e.term]};const t=e.out([Zt.alternativePath]);if(1===t.ptrs.length&&t.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...t.list()].map((e=>e.term))};const n=e.out([Zt.inversePath]);if(n.term)return{quantifier:"one",start:"object",end:"subject",predicates:[n.term]};const r=e.out([Zt.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const i=e.out([Zt.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const o=e.out([Zt.zeroOrOnePath]);return o.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[o.term]}:void 0}const hn=class{constructor(e){this.shape=e,this._compiled=nn((()=>this.shape.validator.registry.compile(e)))}get compiled(){return this._compiled()}async validate(e){return 0===e.focusNode.dataset.size||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);const n=t.node(new _t(t.terms)),r=[...t].reduce(((e,n)=>{const r=n.term,i=t.node([r]);return e.has(r)||e.set(r,{value:i,valuePaths:[]}),e.get(r).valuePaths.push(n),e}),new bt).values(),i=e.create({shape:this.shape,values:n});for(const e of this.compiled)e.property&&await e.property(i);for(const{value:t,valuePaths:n}of r){const r=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:n});for(const e of this.compiled)e.generic&&await e.generic(r)}}},fn=function(e){const t=new _t,n=new Xt({dataset:e.dataset,terms:e.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[Yt.subClassOf]});for(const e of n.ptrs)for(const{term:n}of e.nodes())t.add(n);return t},pn=class{constructor(e){this.targetClass=new _t([...fn(e.hasOut([Kt.type],[Zt.NodeShape])),...fn(e.out([Zt.targetClass]))]),this.targetNode=e.out([Zt.targetNode]).terms,this.targetObjectsOf=e.out([Zt.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([Zt.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([Kt.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],r=e.focusNode.clone({ptrs:n});return r.node([...new _t(r.terms)])}},gn=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=nn((()=>{const e=this.ptr.out([Zt.deactivated]).term;return e&&(0,un.fromRdf)(e)})),this._message=nn((()=>this.ptr.out([Zt.message]).terms)),this._path=nn((()=>function(e){return 0===e.terms.length?null:e.ptrs[0].isList()?[...e.list()].map((e=>dn(e))):[dn(e)]}(this.ptr.out([Zt.path])))),this._severity=nn((()=>this.ptr.out([Zt.severity]).term)),this._shapeValidator=nn((()=>new hn(this))),this._sparql=nn((()=>this.ptr.out([Zt.sparql]))),this._targetResolver=nn((()=>new pn(this.ptr)))}get deactivated(){return this._deactivated()}get isPropertyShape(){return Boolean(this.path)}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}};async function yn(e,t){return Promise.all(e.map(t))}function mn(e){return t=>{t.test(e.equals(t.valueOrNode.term),Zt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Value must be {$hasValue}")]})}}function bn(e){return t=>{const n=[...t.values].some((t=>e.equals(t.term)));t.test(n,Zt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Missing expected value {$hasValue}")]})}}function vn(e){return tn.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}const wn=function(e,t){if(!e||"Literal"!==e.termType)return null;if(!t||"Literal"!==t.termType)return null;if(vn(e)!==vn(t))return null;const n=(0,un.fromRdf)(e),r=(0,un.fromRdf)(t);return typeof n!=typeof r?null:"string"==typeof n?n.localeCompare(r):n-r};function _n(e){return t=>{const n=t.focusNode.out([e]),r=n.filter((e=>!e.term.equals(t.focusNode.term))),i=0!==n.terms.length&&0===r.terms.length;t.test(i,Zt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&t.focusNode.node([r.terms[0]])||t.focusNode})}}function xn(e){return t=>{const n=new _t(t.focusNode.out([e]).terms),r=new _t(t.values.terms),i=[...[...r].filter((e=>!n.has(e))),...[...n].filter((e=>!r.has(e)))];for(const n of i)t.violation(Zt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:t.focusNode.node([n])});0===i.length&&t.debug(Zt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")]})}}function Sn(e,t,n,r){return async i=>{const o=[];let s=[];t&&(s=new Set(i.shape.ptr.in([Zt.property]).out([Zt.property]).out([Zt.qualifiedValueShape]).filter((t=>!t.term.equals(e.ptr.term))).map((e=>i.shape.validator.shape(e)))));const a=(await async function(t){return(await Promise.all(t.map((t=>(async t=>{const n=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(o.push(n.results),!n.conforms)return!1;if(0===s.length)return!0;if(i.options.debug||i.options.details){const e=await yn([...s],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report));return o.push(e.flatMap((e=>e.results))),!e.every((e=>e.conforms))}return!await async function(e,t){for(const n of e)if(!await t(n))return!1;return!0}([...s],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms))})(t))))).filter(Boolean)}(i.values)).length;null!==n&&i.test(a<=n,Zt.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:o.flat()}),null!==r&&i.test(a>=r,Zt.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:o.flat()})}}function jn(e,t,n){return r=>{r.test(n.test(r.valueOrNode.term.value),Zt.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}const In=qt("http://www.w3.org/ns/shacl#"),En=qt("https://schemas.link/shacl-next#"),Nn=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some((e=>e.severity.equals(In.Info)||e.severity.equals(In.Violation)||e.severity.equals(In.Warning)))}},Tn=class{constructor({args:e={},factory:t,message:n=[],severity:r=In.Violation}={}){this.severity=r,this.message=n.map((n=>t.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=yt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(n.value,e),n.language||null)))}};class Rn{constructor({factory:e=Bt}={}){this.factory=e}clone({factory:e}={}){return new Rn({factory:e||this.factory})}validate(){return new Nn}validateSimple(){return!0}}const On=Rn;class kn extends On{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:e}={}){return new kn({datatypes:this.datatypes,factory:e||this.factory})}}const Ln=kn,An=class{constructor({factory:e=Bt,validations:t}={}){if(this.factory=e,this.validations=new bt,t)for(const e of Object.values(t)){const t=e.clone({factory:this.factory});for(const e of t.datatypes)this.validations.set(e,t)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new Nn}validateSimple(e){const t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}};class Cn extends Ln{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Cn(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map((t=>{let n;t.test(e.value)&&(n=En.Debug);const r={pattern:this.factory.literal(t.toString()),this:e};return new Tn({args:r,factory:this.factory,message:this.message,severity:n})}));return new Nn({results:t})}validateSimple(e){return this.patterns.every((t=>t.test(e.value)))}}const Dn=Cn,Mn=/^([-+]?[0-9]+)$/;class Pn extends Dn{constructor(e=null,t=null,n,{factory:r}={}){super(Mn,n,{factory:r}),this.maxInclusive=null,this.minInclusive=null,"string"==typeof t&&(this.maxInclusive=BigInt(t)),"string"==typeof e&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Pn(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!En.Debug.equals(t[0].severity))return new Nn({results:t});const n=BigInt(e.value);if(null!==this.minInclusive&&n<this.minInclusive){const n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Tn({factory:this.factory,message:r}))}if(null!==this.maxInclusive&&n>this.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Tn({factory:this.factory,message:r}))}return new Nn({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(null!==this.minInclusive&&t<this.minInclusive||null!==this.maxInclusive&&t>this.maxInclusive)}}const $n=Pn;class Bn extends Ln{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new Bn(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,r=[this.factory.literal(n)];t.push(new Tn({factory:this.factory,message:r}))}return new Nn({results:t})}validateSimple(e){return this.values.has(e.value)}}const Fn=Bn,qn={xsd:qt("http://www.w3.org/2001/XMLSchema#")},Un=new Ln({datatypes:qn.xsd.anySimpleType}),Gn=new Ln({datatypes:qn.xsd.anyAtomicType}),Vn=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Hn=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,zn=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,Wn=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Jn=new Dn(Vn,qn.xsd.string),Qn=new Fn(["1","true","0","false"],qn.xsd.boolean),Xn=new Dn(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,qn.xsd.decimal),Kn=new Dn(Hn,qn.xsd.float),Yn=new Dn(Hn,qn.xsd.double),Zn=new Dn(zn,qn.xsd.duration),er=new Dn(Wn,qn.xsd.dateTime),tr=new Dn(/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.time),nr=new Dn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.date),rr=new Dn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.gYearMonth),ir=new Dn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.gYear),or=new Dn(/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.gMonthDay),sr=new Dn(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.gDay),ar=new Dn(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,qn.xsd.gMonth),lr=new Dn(/^(([0-9a-fA-F]{2})*)$/,qn.xsd.hexBinary),cr=new Dn(/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,qn.xsd.base64Binary),ur=new Dn(Vn,qn.xsd.anyURI),dr=/^([^\u000d\u000a\u0009]*)$/,hr=new Dn([Vn,dr],qn.xsd.normalizedString),fr=new Dn([Vn,dr,/^([^ ]+( [^ ]+)*)*$/],qn.xsd.token),pr=new Dn(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,qn.xsd.language),gr=new $n(null,null,qn.xsd.integer),yr=new $n(null,"0",qn.xsd.nonPositiveInteger),mr=new $n(null,"-1",qn.xsd.negativeInteger),br=new $n("-9223372036854775808","9223372036854775807",qn.xsd.long),vr=new $n("-2147483648","2147483647",qn.xsd.int),wr=new $n("-32768","32767",qn.xsd.short),_r=new $n("-128","127",qn.xsd.byte),xr=new $n("0",null,qn.xsd.nonNegativeInteger),Sr=new $n("0","18446744073709551615",qn.xsd.unsignedLong),jr=new $n("0","4294967295",qn.xsd.unsignedInt),Ir=new $n("0","65535",qn.xsd.unsignedShort),Er=new $n("0","255",qn.xsd.unsignedByte),Nr=new $n("1",null,qn.xsd.positiveInteger),Tr=new Dn([zn,/^([^DT]*)$/],qn.xsd.yearMonthDuration),Rr=new Dn([zn,/^([^YM]*[DT].*)$/],qn.xsd.dayTimeDuration),Or=new Dn([Wn,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],qn.xsd.dateTimeStamp),kr=class extends An{constructor({factory:e}={}){super({factory:e,validations:{...i}})}},Lr=new bt([[Zt.BlankNode,new Set(["BlankNode"])],[Zt.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[Zt.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[Zt.IRI,new Set(["NamedNode"])],[Zt.IRIOrLiteral,new Set(["NamedNode","Literal"])],[Zt.Literal,new Set(["Literal"])]]);function Ar(e,t){return n=>{n.test(t.has(n.valueOrNode.term.termType),Zt.NodeKindConstraintComponent,{args:{nodeKind:e},message:[n.factory.literal("Value does not have node kind {$nodeKind}")],value:n.valueOrNode})}}const Cr=new bt([[Zt.maxCount,function(e){return{property:(t=parseInt(e.ptr.out([Zt.maxCount]).value),e=>{e.test(e.values.terms.length<=t,Zt.MaxCountConstraintComponent,{args:{maxCount:t},message:[e.factory.literal("More than {$maxCount} values")]})})};var t}],[Zt.minCount,function(e){return{property:(t=parseInt(e.ptr.out([Zt.minCount]).value),e=>{e.test(e.values.terms.length>=t,Zt.MinCountConstraintComponent,{args:{minCount:t},message:[e.factory.literal("Less than {$minCount} values")]})})};var t}],[Zt.and,function(e){return{generic:(t=[...e.ptr.out([Zt.and])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await yn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=n.every((e=>e.conforms));e.test(r,Zt.AndConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Zt.not,function(e){return{generic:(t=e.validator.shape(e.ptr.out([Zt.not])),async e=>{const n=(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!n.conforms;e.test(r,Zt.NotConstraintComponent,{args:{not:t.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:n.results,value:e.valueOrNode})})};var t}],[Zt.or,function(e){return{generic:(t=[...e.ptr.out([Zt.or])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{let n,r=[];if(e.options.debug||e.options.details){const i=await yn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report));r=i.flatMap((e=>e.results)),n=i.some((e=>e.conforms))}else n=await async function(e,t){for(const n of e)if(await t(n))return!0;return!1}(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms));e.test(n,Zt.OrConstraintComponent,{results:r,value:e.valueOrNode})})};var t}],[Zt.xone,function(e){return{generic:(t=[...e.ptr.out([Zt.xone])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await yn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=1===n.filter((e=>e.conforms)).length;e.test(r,Zt.XoneConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Zt.closed,function(e){if(!(0,un.fromRdf)(e.ptr.out([Zt.closed]).term))return null;const t=e.ptr.out([Zt.property]).map((t=>e.validator.shape(t)));return{node:(n=new _t(t.filter((e=>!e.deactivated)).map((e=>e.path[0].predicates[0]))),r=new _t([...e.ptr.out([Zt.ignoredProperties]).list()||[]].map((e=>e.term))),e=>{const t=e.focusNode.execute({start:"subject",end:"predicate"}).filter((e=>!r.has(e.term)&&!n.has(e.term)));if(t.ptrs.length>0)for(const n of t)e.violation(Zt.ClosedConstraintComponent,{message:[e.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[n.term]}],value:e.focusNode.node([[...n.quads()][0].object])});else e.debug(Zt.ClosedConstraintComponent)})};var n,r}],[Zt.hasValue,function(e){const t=e.ptr.out([Zt.hasValue]).term;return{node:mn(t),property:bn(t)}}],[Zt.in,function(e){return{generic:(t=new _t([...e.ptr.out([Zt.in]).list()].map((e=>e.term))),e=>{e.test(t.has(e.valueOrNode.term),Zt.InConstraintComponent,{args:{in:[...t].map((e=>e.value)).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})})};var t}],[Zt.disjoint,function(e){return{generic:(t=e.ptr.out([Zt.disjoint]).term,e=>{const n=e.focusNode.dataset.match(e.focusNode.term,t,e.valueOrNode.term);e.test(0===n.size,Zt.DisjointConstraintComponent,{args:{disjoint:t},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})})};var t}],[Zt.equals,function(e){const t=e.ptr.out([Zt.equals]).term;return{node:_n(t),property:xn(t)}}],[Zt.lessThan,function(e){return{property:(t=e.ptr.out([Zt.lessThan]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=wn(r.term,i);null===n||n>=0?e.violation(Zt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(Zt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}})};var t}],[Zt.lessThanOrEquals,function(e){return{property:(t=e.ptr.out([Zt.lessThanOrEquals]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=wn(r.term,i);null===n||n>0?e.violation(Zt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(Zt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}})};var t}],[Zt.maxExclusive,function(e){return{generic:(t=e.ptr.out([Zt.maxExclusive]).term,e=>{const n=wn(e.valueOrNode.term,t);e.test(null!==n&&n<0,Zt.MaxExclusiveConstraintComponent,{args:{maxExclusive:t},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})})};var t}],[Zt.maxInclusive,function(e){return{generic:(t=e.ptr.out([Zt.maxInclusive]).term,e=>{const n=wn(e.valueOrNode.term,t);e.test(null!==n&&n<=0,Zt.MaxInclusiveConstraintComponent,{args:{maxInclusive:t},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})})};var t}],[Zt.minExclusive,function(e){return{generic:(t=e.ptr.out([Zt.minExclusive]).term,e=>{const n=wn(e.valueOrNode.term,t);e.test(null!==n&&n>0,Zt.MinExclusiveConstraintComponent,{args:{minExclusive:t},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})})};var t}],[Zt.minInclusive,function(e){return{generic:(t=e.ptr.out([Zt.minInclusive]).term,e=>{const n=wn(e.valueOrNode.term,t);e.test(null!==n&&n>=0,Zt.MinInclusiveConstraintComponent,{args:{minInclusive:t},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})})};var t}],[Zt.node,function(e){return{generic:(t=[...e.ptr.out([Zt.node])].map((t=>e.validator.shape(t))),async e=>{for(const n of t){const t=await n.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(t.report.conforms,Zt.NodeConstraintComponent,{args:{node:n.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:t.report.results,value:e.valueOrNode})}})};var t}],[Zt.property,function(e){return{generic:(t=[...e.ptr.out([Zt.property])].map((t=>e.validator.shape(t))),async e=>{const n=e.create({focusNode:e.valueOrNode});for(const e of t)await e.validate(n)})};var t}],[Zt.qualifiedValueShape,function(e){const t=e.validator.shape(e.ptr.out([Zt.qualifiedValueShape])),n=e.ptr.out([Zt.qualifiedValueShapesDisjoint]).term,r=!!n&&(0,un.fromRdf)(n),i=e.ptr.out([Zt.qualifiedMaxCount]).term,o=i?parseInt(i.value):null,s=e.ptr.out([Zt.qualifiedMinCount]).term;return{property:Sn(t,r,o,s?parseInt(s.value):null)}}],[Zt.languageIn,function(e){return{generic:(t=[...new Set([...e.ptr.out([Zt.languageIn]).list()].map((e=>e.value)))],e=>{const n=t.some((t=>function(e,t){return!!t&&t.slice(0,e.length)===e}(t,e.valueOrNode.term.language)));e.test(n,Zt.LanguageInConstraintComponent,{args:{languageIn:t.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})})};var t}],[Zt.maxLength,function(e){return{generic:(t=parseInt(e.ptr.out([Zt.maxLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length<=t;e.test(n,Zt.MaxLengthConstraintComponent,{args:{maxLength:t},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})})};var t}],[Zt.minLength,function(e){return{generic:(t=parseInt(e.ptr.out([Zt.minLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length>=t;e.test(n,Zt.MinLengthConstraintComponent,{args:{minLength:t},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})})};var t}],[Zt.pattern,function(e){const t=e.ptr.out([Zt.pattern]).value,n=e.ptr.out([Zt.flags]).value;return{generic:jn(t,n,new RegExp(t,n))}}],[Zt.uniqueLang,function(e){const t=e.ptr.out([Zt.uniqueLang]).term;return"true"===t.value&&tn.boolean.equals(t.datatype)?{property:e=>{const t=Object.entries(e.values.terms.reduce(((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e)),{})),n=t.filter((([,e])=>e>1));for(const[t]of n)e.violation(Zt.UniqueLangConstraintComponent,{args:{lang:t},message:[e.factory.literal('Language "{?lang}" used more than once')]});0===n.length&&e.debug(Zt.UniqueLangConstraintComponent)}}:null}],[Zt.class,function(e){return{generic:(t=e.ptr.out([Zt.class]).map((e=>fn(e))),e=>{const n=new _t(e.valueOrNode.out([Kt.type]).terms);for(const r of t){const t=[...n].some((e=>r.has(e)));e.test(t,Zt.ClassConstraintComponent,{value:e.valueOrNode})}})};var t}],[Zt.datatype,function(e){return{generic:(t=e.ptr.out([Zt.datatype]).term,n=new kr,e=>{const r=t.equals(e.valueOrNode.term.datatype)&&n.validateSimple(e.valueOrNode.term);e.test(r,Zt.DatatypeConstraintComponent,{args:{datatype:t},message:[e.factory.literal("Value does not have datatype {$datatype}")],value:e.valueOrNode})})};var t,n}],[Zt.nodeKind,function(e){const t=e.ptr.out([Zt.nodeKind]).term;return{generic:Ar(t,Lr.get(t))}}]]),Dr=class{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new cn(Cr),this.shapesPtr=new Xt({dataset:e,factory:t}),this.shapes=new bt,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[e,t]of this.options.validations)this.registry.validations.set(e,t);const r=[...this.shapesPtr.hasOut([Zt.targetClass]),...this.shapesPtr.hasOut([Zt.targetNode]),...this.shapesPtr.hasOut([Zt.targetObjectsOf]),...this.shapesPtr.hasOut([Zt.targetSubjectsOf]),...this.shapesPtr.hasOut([Kt.type],[Zt.NodeShape]),...this.shapesPtr.hasOut([Kt.type],[Zt.PropertyShape])];for(const e of r)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new gn(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new Xt({...e,factory:this.factory}),r=new an({factory:this.factory,focusNode:n,options:this.options,validator:this});t=t?t.map((e=>this.shape(this.shapesPtr.node(e.terms)))):this.shapes.values();for(const e of t){const t=r.create({shape:e});let i;i=n.isAny()?e.resolveTargets(t):n;for(const n of i)await e.validate(t.create({focusNode:n}))}return r.report}};var Mr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Pr extends HTMLElement{static get observedAttributes(){return ut.dataAttributes()}constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new ut(e,this.form),this.form.addEventListener("change",(e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then((e=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:e.conforms,report:e}}))})).catch((e=>{console.warn(e)}))}))}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout((()=>Mr(this,void 0,void 0,(function*(){this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{yield this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach((e=>{this.form.classList.remove(e)})),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const e of Object.entries(xe).map((e=>e[1])))e.stylesheet&&t.push(e.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Ce(e,this.config,this.config.attributes.valuesSubject?p.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(null!==this.config.attributes.submitButton){const e=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);e.addEventListener("click",(e=>{e.preventDefault(),this.form.reportValidity()&&this.validate().then((e=>{var t;(null==e?void 0:e.conforms)?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):null===(t=this.form.querySelector(":scope .invalid > .editor"))||void 0===t||t.focus()}))})),this.form.appendChild(e)}yield this.validate(!0)}}else if(this.config.shapesGraph.size>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}}))),200)}serialize(e="text/turtle",t=this.toRDF()){return function(e,t,n){if("application/ld+json"===t)return function(e){const t=[];for(const n of e){const e={"@id":n.subject.id};if(n.predicate===$)e["@type"]=n.object.id;else{let t=n.object.value;n.object instanceof m?n.object.language?t={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${L}#string`&&(t={"@type":n.object.datatype.value,"@value":n.object.value}):t={"@id":n.object.id},e[n.predicate.value]=t}t.push(e)}return JSON.stringify(t)}(e);{const r=new ve({format:t,prefixes:n});r.addQuads(e);let i="";return r.end(((e,t)=>{e&&console.error(e),i=t})),i}}(t.getQuads(null,null,null,null),e,this.config.prefixes)}toRDF(e=new qe){var t;return null===(t=this.shape)||void 0===t||t.toRDF(e),e}registerPlugin(e){Se(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){lt(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}validate(){return Mr(this,arguments,void 0,(function*(e=!1){var t,n,r,i,o,s;for(const e of this.form.querySelectorAll(":scope .validation-error"))e.remove();for(const e of this.form.querySelectorAll(":scope .property-instance"))e.classList.remove("invalid"),(null===(t=e.querySelector(":scope > .editor"))||void 0===t?void 0:t.value)?e.classList.add("valid"):e.classList.remove("valid");this.config.shapesGraph.deleteGraph(""),null===(n=this.shape)||void 0===n||n.toRDF(this.config.shapesGraph),this.shape&&this.config.shapesGraph.add(new x(this.shape.shaclSubject,p.namedNode(O+"targetNode"),this.shape.nodeId,void 0));try{const t=this.config.shapesGraph,n=yield new Dr(t,{details:!0,factory:p}).validate({dataset:t});for(const t of n.results)if(null===(i=null===(r=t.focusNode)||void 0===r?void 0:r.ptrs)||void 0===i?void 0:i.length)for(const n of t.focusNode.ptrs){const r=n._term;if(null===(o=t.path)||void 0===o?void 0:o.length){const n=t.path[0].predicates[0];let i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}'] > .editor`);0===i.length&&(i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}']`));for(const n of i)if(n.classList.contains("editor")){if(!e||n.value){let e=n.parentElement;e.classList.add("invalid"),e.classList.remove("valid"),e.appendChild(this.createValidationErrorDisplay(t));do{e.classList.contains("collapsible")&&e.classList.add("open"),e=e.parentElement}while(e)}}else e||(n.classList.add("invalid"),n.classList.remove("valid"),n.appendChild(this.createValidationErrorDisplay(t,"node")))}else e||null===(s=this.form.querySelector(`:scope [data-node-id='${r.id}']`))||void 0===s||s.prepend(this.createValidationErrorDisplay(t,"node"))}return n}catch(e){return console.error(e),!1}}))}createValidationErrorDisplay(e,t){var n,r;const i=document.createElement("span");if(i.classList.add("validation-error"),t&&i.classList.add(t),e)if((null===(n=e.message)||void 0===n?void 0:n.length)>0)for(const t of e.message)i.title+=t.value+"\n";else i.title=null===(r=e.sourceConstraintComponent)||void 0===r?void 0:r.value;return i}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=p.namedNode(this.config.attributes.shapeSubject),0===this.config.shapesGraph.getQuads(e,$,V,null).length)return void console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`)}else if(this.config.attributes.valuesSubject&&this.config.dataGraph.size>0){const t=p.namedNode(this.config.attributes.valuesSubject),n=[...this.config.dataGraph.getQuads(t,$,null,null),...this.config.dataGraph.getQuads(t,B,null,null)];if(0===n.length)return void console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${$.id} nor ${B.id} statement`);for(const t of n)if(this.config.shapesGraph.getQuads(t.object,$,V,null).length>0){e=t.object;break}if(!e){const t=this.config.shapesGraph.getQuads(null,W,n[0].object,null);if(0===t.length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);if(t.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${t[0].subject})`),0===this.config.shapesGraph.getQuads(t[0].subject,$,V,null).length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${t[0].subject})`);e=t[0].subject}}else{const t=this.config.shapesGraph.getQuads(null,$,V,null);if(0==t.length)return void console.warn("shapes graph does not contain any root shapes");t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}}const $r=(Br={Button:()=>e.Button,Checkbox:()=>e.Checkbox,MenuItem:()=>e.MenuItem,Select:()=>e.Select,TextField:()=>e.TextField},Fr={},r.d(Fr,Br),Fr);var Br,Fr;class qr extends se{constructor(){super(":host {\n --mdui-color-primary-light: var(--mdui-color-primary-light);\n --mdui-color-primary-dark: var(--mdui-color-primary-dark);\n --mdui-color-background-light: var(--mdui-color-background-light);\n}\n/* this prevents hiding the date picker icon and number controls */\nmdui-text-field::part(input) {\n clip-path: none;\n appearance: inherit;\n}\nform.mode-edit { --label-width: 0em; }\n.property-instance { margin-bottom:14px; }\n.mode-edit .property-instance *[required]::part(icon) { align-self: flex-start; padding-top: 0.7em; }\n.mode-edit .property-instance *[required]::part(icon)::before { color: red; content: '\\2736'; font-size: 0.6em; }")}createDefaultTemplate(e,t,n,r,i){var o;r.classList.add("editor"),(null==i?void 0:i.datatype)&&(r.shaclDatatype=i.datatype),void 0!==(null==i?void 0:i.minCount)&&(r.dataset.minCount=String(i.minCount)),(null==i?void 0:i.class)&&(r.dataset.class=i.class.value),(null==i?void 0:i.nodeKind)&&(r.dataset.nodeKind=i.nodeKind.value),((null==i?void 0:i.hasValue)||(null==i?void 0:i.readonly))&&(r.disabled=!0),r.value=(null==t?void 0:t.value)||(null===(o=null==i?void 0:i.defaultValue)||void 0===o?void 0:o.value)||"";const s=(null==i?void 0:i.description)?i.description.value:(null==i?void 0:i.pattern)?i.pattern:null;s&&r.setAttribute("placeholder",s),n&&r.setAttribute("required","true");const a=document.createElement("div");if(e){const t=document.createElement("label");t.htmlFor=r.id,t.innerText=e,a.appendChild(t)}return a.appendChild(r),a}createTextEditor(e,t,n,r){const i=new $r.TextField;return i.variant="outlined",i.label=e,i.type="text",r.description&&(i.helper=r.description.value),!1===r.singleLine&&(i.rows=5),r.pattern&&(i.pattern=r.pattern),this.createDefaultTemplate("",t,n,i,r)}createNumberEditor(e,t,n,r){var i,o;const s=new $r.TextField;s.variant="outlined",s.type="number",s.label=e,s.helper=(null===(i=r.description)||void 0===i?void 0:i.value)||"";const a=void 0!==r.minInclusive?r.minInclusive:void 0!==r.minExclusive?r.minExclusive+1:void 0,l=void 0!==r.maxInclusive?r.maxInclusive:void 0!==r.maxExclusive?r.maxExclusive-1:void 0;return void 0!==a&&s.setAttribute("min",String(a)),void 0!==l&&s.setAttribute("max",String(l)),(null===(o=r.datatype)||void 0===o?void 0:o.value)!==L+"integer"&&s.setAttribute("step","0.1"),this.createDefaultTemplate("",t,n,s,r)}createListEditor(e,t,n,r,i){var o;const s=new $r.Select;s.variant="outlined",s.label=e,s.helper=null===(o=null==i?void 0:i.description)||void 0===o?void 0:o.value,s.clearable=!0;const a=this.createDefaultTemplate("",null,n,s,i);let l=!0;for(const e of r){const t=new $r.MenuItem,n="string"==typeof e.value?e.value:e.value.value,r=e.label?e.label:n;if(t.value=n,t.textContent=r||n,e.indent)for(let n=0;n<e.indent;n++)t.innerHTML="&#160;&#160;"+t.innerHTML;""===n&&(l=!1,t.ariaLabel="blank"),s.appendChild(t)}if(l){const e=new $r.MenuItem;e.ariaLabel="blank",s.prepend(e)}return t&&(s.value=t.value),a}createBooleanEditor(e,t,n,r){const i=new $r.Checkbox,o=this.createDefaultTemplate("",t,n,i,r);return i.removeAttribute("required"),t instanceof m&&(i.checked="true"===t.value),i.innerText=e,o}createDateEditor(e,t,n,r){var i,o,s;const a=new $r.TextField;a.variant="outlined",a.helper=(null===(i=null==r?void 0:r.description)||void 0===i?void 0:i.value)||(null==r?void 0:r.label)||"",(null===(o=r.datatype)||void 0===o?void 0:o.value)===L+"dateTime"?(a.type="datetime-local",a.setAttribute("step","1")):a.type="date",a.classList.add("pr-0");const l=this.createDefaultTemplate("",null,n,a,r);if(t)try{let e=new Date(t.value).toISOString();e=(null===(s=r.datatype)||void 0===s?void 0:s.value)===L+"dateTime"?e.slice(0,19):e.slice(0,10),a.value=e}catch(e){console.error(e,t)}return l}createLangStringEditor(e,t,n,r){var i;const o=this.createTextEditor(e,t,n,r),s=o.querySelector(":scope .editor");let a;if(null===(i=r.languageIn)||void 0===i?void 0:i.length){a=document.createElement("select");for(const e of r.languageIn){const t=document.createElement("option");t.innerText=e.value,a.appendChild(t)}}else a=document.createElement("input"),a.maxLength=5,a.placeholder="lang?";return a.title="Language of the text",a.classList.add("lang-chooser"),a.addEventListener("change",(e=>{e.stopPropagation(),s&&(s.dataset.lang=a.value,s.dispatchEvent(new Event("change",{bubbles:!0})))})),t instanceof m&&(a.value=t.language),s.dataset.lang=a.value,s.after(a),o}createFileEditor(e,t,n,r){const i=document.createElement("input");return i.type="file",i.addEventListener("change",(e=>{var t;if(null===(t=i.files)||void 0===t?void 0:t.length){e.stopPropagation();const t=new FileReader;t.readAsDataURL(i.files[0]),t.onload=()=>{var e;i.binaryData=btoa(t.result),null===(e=i.parentElement)||void 0===e||e.dispatchEvent(new Event("change",{bubbles:!0}))}}else i.binaryData=void 0})),this.createDefaultTemplate(e,t,n,i,r)}createButton(e,t){let n;return t?(n=new $r.Button,n.classList.add("primary")):(n=new $r.Button,n.classList.add("secondary")),n.innerHTML=e,n}}class Ur extends Pr{constructor(){super(new qr)}}window.customElements.define("shacl-form",Ur);export{ut as Config,at as Loader,je as Plugin,Ur as ShaclForm,oe as ShaclPropertyTemplate,se as Theme,X as findLabel,Se as registerPlugin,lt as setSharedShapesGraph};
1
+ var Fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Yp(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var n=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return i[r]}})}),t}var Lo={},mn={},cd;function Zp(){if(cd)return mn;cd=1,mn.byteLength=a,mn.toByteArray=c,mn.fromByteArray=g;for(var i=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=r.length;n<s;++n)i[n]=r[n],e[r.charCodeAt(n)]=n;e[45]=62,e[95]=63;function o(y){var b=y.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=y.indexOf("=");_===-1&&(_=b);var E=_===b?0:4-_%4;return[_,E]}function a(y){var b=o(y),_=b[0],E=b[1];return(_+E)*3/4-E}function l(y,b,_){return(b+_)*3/4-_}function c(y){var b,_=o(y),E=_[0],S=_[1],k=new t(l(y,E,S)),v=0,u=S>0?E-4:E,m;for(m=0;m<u;m+=4)b=e[y.charCodeAt(m)]<<18|e[y.charCodeAt(m+1)]<<12|e[y.charCodeAt(m+2)]<<6|e[y.charCodeAt(m+3)],k[v++]=b>>16&255,k[v++]=b>>8&255,k[v++]=b&255;return S===2&&(b=e[y.charCodeAt(m)]<<2|e[y.charCodeAt(m+1)]>>4,k[v++]=b&255),S===1&&(b=e[y.charCodeAt(m)]<<10|e[y.charCodeAt(m+1)]<<4|e[y.charCodeAt(m+2)]>>2,k[v++]=b>>8&255,k[v++]=b&255),k}function d(y){return i[y>>18&63]+i[y>>12&63]+i[y>>6&63]+i[y&63]}function f(y,b,_){for(var E,S=[],k=b;k<_;k+=3)E=(y[k]<<16&16711680)+(y[k+1]<<8&65280)+(y[k+2]&255),S.push(d(E));return S.join("")}function g(y){for(var b,_=y.length,E=_%3,S=[],k=16383,v=0,u=_-E;v<u;v+=k)S.push(f(y,v,v+k>u?u:v+k));return E===1?(b=y[_-1],S.push(i[b>>2]+i[b<<4&63]+"==")):E===2&&(b=(y[_-2]<<8)+y[_-1],S.push(i[b>>10]+i[b>>4&63]+i[b<<2&63]+"=")),S.join("")}return mn}var xs={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var dd;function em(){return dd||(dd=1,xs.read=function(i,e,t,r,n){var s,o,a=n*8-r-1,l=(1<<a)-1,c=l>>1,d=-7,f=t?n-1:0,g=t?-1:1,y=i[e+f];for(f+=g,s=y&(1<<-d)-1,y>>=-d,d+=a;d>0;s=s*256+i[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=r;d>0;o=o*256+i[e+f],f+=g,d-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-c}return(y?-1:1)*o*Math.pow(2,s-r)},xs.write=function(i,e,t,r,n,s){var o,a,l,c=s*8-n-1,d=(1<<c)-1,f=d>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:s-1,b=r?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=g/l:e+=g*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*l-1)*Math.pow(2,n),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;i[t+y]=a&255,y+=b,a/=256,n-=8);for(o=o<<n|a,c+=n;c>0;i[t+y]=o&255,y+=b,o/=256,c-=8);i[t+y-b]|=_*128}),xs}/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */var ud;function Hi(){return ud||(ud=1,function(i){const e=Zp(),t=em(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=a,i.SlowBuffer=k,i.INSPECT_MAX_BYTES=50;const n=2147483647;i.kMaxLength=n,a.TYPED_ARRAY_SUPPORT=s(),!a.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 s(){try{const C=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(C,h),C.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(C){if(C>n)throw new RangeError('The value "'+C+'" is invalid for option "size"');const h=new Uint8Array(C);return Object.setPrototypeOf(h,a.prototype),h}function a(C,h,p){if(typeof C=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(C)}return l(C,h,p)}a.poolSize=8192;function l(C,h,p){if(typeof C=="string")return g(C,h);if(ArrayBuffer.isView(C))return b(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(ue(C,ArrayBuffer)||C&&ue(C.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ue(C,SharedArrayBuffer)||C&&ue(C.buffer,SharedArrayBuffer)))return _(C,h,p);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const B=C.valueOf&&C.valueOf();if(B!=null&&B!==C)return a.from(B,h,p);const ee=E(C);if(ee)return ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return a.from(C[Symbol.toPrimitive]("string"),h,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}a.from=function(C,h,p){return l(C,h,p)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function d(C,h,p){return c(C),C<=0?o(C):h!==void 0?typeof p=="string"?o(C).fill(h,p):o(C).fill(h):o(C)}a.alloc=function(C,h,p){return d(C,h,p)};function f(C){return c(C),o(C<0?0:S(C)|0)}a.allocUnsafe=function(C){return f(C)},a.allocUnsafeSlow=function(C){return f(C)};function g(C,h){if((typeof h!="string"||h==="")&&(h="utf8"),!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const p=v(C,h)|0;let B=o(p);const ee=B.write(C,h);return ee!==p&&(B=B.slice(0,ee)),B}function y(C){const h=C.length<0?0:S(C.length)|0,p=o(h);for(let B=0;B<h;B+=1)p[B]=C[B]&255;return p}function b(C){if(ue(C,Uint8Array)){const h=new Uint8Array(C);return _(h.buffer,h.byteOffset,h.byteLength)}return y(C)}function _(C,h,p){if(h<0||C.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(C.byteLength<h+(p||0))throw new RangeError('"length" is outside of buffer bounds');let B;return h===void 0&&p===void 0?B=new Uint8Array(C):p===void 0?B=new Uint8Array(C,h):B=new Uint8Array(C,h,p),Object.setPrototypeOf(B,a.prototype),B}function E(C){if(a.isBuffer(C)){const h=S(C.length)|0,p=o(h);return p.length===0||C.copy(p,0,0,h),p}if(C.length!==void 0)return typeof C.length!="number"||Ve(C.length)?o(0):y(C);if(C.type==="Buffer"&&Array.isArray(C.data))return y(C.data)}function S(C){if(C>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return C|0}function k(C){return+C!=C&&(C=0),a.alloc(+C)}a.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==a.prototype},a.compare=function(h,p){if(ue(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),ue(p,Uint8Array)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(h)||!a.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===p)return 0;let B=h.length,ee=p.length;for(let le=0,he=Math.min(B,ee);le<he;++le)if(h[le]!==p[le]){B=h[le],ee=p[le];break}return B<ee?-1:ee<B?1:0},a.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(h,p){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return a.alloc(0);let B;if(p===void 0)for(p=0,B=0;B<h.length;++B)p+=h[B].length;const ee=a.allocUnsafe(p);let le=0;for(B=0;B<h.length;++B){let he=h[B];if(ue(he,Uint8Array))le+he.length>ee.length?(a.isBuffer(he)||(he=a.from(he)),he.copy(ee,le)):Uint8Array.prototype.set.call(ee,he,le);else if(a.isBuffer(he))he.copy(ee,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=he.length}return ee};function v(C,h){if(a.isBuffer(C))return C.length;if(ArrayBuffer.isView(C)||ue(C,ArrayBuffer))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const p=C.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&p===0)return 0;let ee=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return ye(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return fe(C).length;default:if(ee)return B?-1:ye(C).length;h=(""+h).toLowerCase(),ee=!0}}a.byteLength=v;function u(C,h,p){let B=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,h>>>=0,p<=h))return"";for(C||(C="utf8");;)switch(C){case"hex":return te(this,h,p);case"utf8":case"utf-8":return L(this,h,p);case"ascii":return Y(this,h,p);case"latin1":case"binary":return F(this,h,p);case"base64":return I(this,h,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,h,p);default:if(B)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),B=!0}}a.prototype._isBuffer=!0;function m(C,h,p){const B=C[h];C[h]=C[p],C[p]=B}a.prototype.swap16=function(){const h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<h;p+=2)m(this,p,p+1);return this},a.prototype.swap32=function(){const h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<h;p+=4)m(this,p,p+3),m(this,p+1,p+2);return this},a.prototype.swap64=function(){const h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<h;p+=8)m(this,p,p+7),m(this,p+1,p+6),m(this,p+2,p+5),m(this,p+3,p+4);return this},a.prototype.toString=function(){const h=this.length;return h===0?"":arguments.length===0?L(this,0,h):u.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(h){if(!a.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:a.compare(this,h)===0},a.prototype.inspect=function(){let h="";const p=i.INSPECT_MAX_BYTES;return h=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(h+=" ... "),"<Buffer "+h+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(h,p,B,ee,le){if(ue(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(p===void 0&&(p=0),B===void 0&&(B=h?h.length:0),ee===void 0&&(ee=0),le===void 0&&(le=this.length),p<0||B>h.length||ee<0||le>this.length)throw new RangeError("out of range index");if(ee>=le&&p>=B)return 0;if(ee>=le)return-1;if(p>=B)return 1;if(p>>>=0,B>>>=0,ee>>>=0,le>>>=0,this===h)return 0;let he=le-ee,Pe=B-p;const et=Math.min(he,Pe),Qe=this.slice(ee,le),tt=h.slice(p,B);for(let ze=0;ze<et;++ze)if(Qe[ze]!==tt[ze]){he=Qe[ze],Pe=tt[ze];break}return he<Pe?-1:Pe<he?1:0};function T(C,h,p,B,ee){if(C.length===0)return-1;if(typeof p=="string"?(B=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,Ve(p)&&(p=ee?0:C.length-1),p<0&&(p=C.length+p),p>=C.length){if(ee)return-1;p=C.length-1}else if(p<0)if(ee)p=0;else return-1;if(typeof h=="string"&&(h=a.from(h,B)),a.isBuffer(h))return h.length===0?-1:N(C,h,p,B,ee);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?ee?Uint8Array.prototype.indexOf.call(C,h,p):Uint8Array.prototype.lastIndexOf.call(C,h,p):N(C,[h],p,B,ee);throw new TypeError("val must be string, number or Buffer")}function N(C,h,p,B,ee){let le=1,he=C.length,Pe=h.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(C.length<2||h.length<2)return-1;le=2,he/=2,Pe/=2,p/=2}function et(tt,ze){return le===1?tt[ze]:tt.readUInt16BE(ze*le)}let Qe;if(ee){let tt=-1;for(Qe=p;Qe<he;Qe++)if(et(C,Qe)===et(h,tt===-1?0:Qe-tt)){if(tt===-1&&(tt=Qe),Qe-tt+1===Pe)return tt*le}else tt!==-1&&(Qe-=Qe-tt),tt=-1}else for(p+Pe>he&&(p=he-Pe),Qe=p;Qe>=0;Qe--){let tt=!0;for(let ze=0;ze<Pe;ze++)if(et(C,Qe+ze)!==et(h,ze)){tt=!1;break}if(tt)return Qe}return-1}a.prototype.includes=function(h,p,B){return this.indexOf(h,p,B)!==-1},a.prototype.indexOf=function(h,p,B){return T(this,h,p,B,!0)},a.prototype.lastIndexOf=function(h,p,B){return T(this,h,p,B,!1)};function $(C,h,p,B){p=Number(p)||0;const ee=C.length-p;B?(B=Number(B),B>ee&&(B=ee)):B=ee;const le=h.length;B>le/2&&(B=le/2);let he;for(he=0;he<B;++he){const Pe=parseInt(h.substr(he*2,2),16);if(Ve(Pe))return he;C[p+he]=Pe}return he}function j(C,h,p,B){return ve(ye(h,C.length-p),C,p,B)}function R(C,h,p,B){return ve(we(h),C,p,B)}function P(C,h,p,B){return ve(fe(h),C,p,B)}function q(C,h,p,B){return ve(ie(h,C.length-p),C,p,B)}a.prototype.write=function(h,p,B,ee){if(p===void 0)ee="utf8",B=this.length,p=0;else if(B===void 0&&typeof p=="string")ee=p,B=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(B)?(B=B>>>0,ee===void 0&&(ee="utf8")):(ee=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const le=this.length-p;if((B===void 0||B>le)&&(B=le),h.length>0&&(B<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let he=!1;for(;;)switch(ee){case"hex":return $(this,h,p,B);case"utf8":case"utf-8":return j(this,h,p,B);case"ascii":case"latin1":case"binary":return R(this,h,p,B);case"base64":return P(this,h,p,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,h,p,B);default:if(he)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),he=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(C,h,p){return h===0&&p===C.length?e.fromByteArray(C):e.fromByteArray(C.slice(h,p))}function L(C,h,p){p=Math.min(C.length,p);const B=[];let ee=h;for(;ee<p;){const le=C[ee];let he=null,Pe=le>239?4:le>223?3:le>191?2:1;if(ee+Pe<=p){let et,Qe,tt,ze;switch(Pe){case 1:le<128&&(he=le);break;case 2:et=C[ee+1],(et&192)===128&&(ze=(le&31)<<6|et&63,ze>127&&(he=ze));break;case 3:et=C[ee+1],Qe=C[ee+2],(et&192)===128&&(Qe&192)===128&&(ze=(le&15)<<12|(et&63)<<6|Qe&63,ze>2047&&(ze<55296||ze>57343)&&(he=ze));break;case 4:et=C[ee+1],Qe=C[ee+2],tt=C[ee+3],(et&192)===128&&(Qe&192)===128&&(tt&192)===128&&(ze=(le&15)<<18|(et&63)<<12|(Qe&63)<<6|tt&63,ze>65535&&ze<1114112&&(he=ze))}}he===null?(he=65533,Pe=1):he>65535&&(he-=65536,B.push(he>>>10&1023|55296),he=56320|he&1023),B.push(he),ee+=Pe}return A(B)}const Q=4096;function A(C){const h=C.length;if(h<=Q)return String.fromCharCode.apply(String,C);let p="",B=0;for(;B<h;)p+=String.fromCharCode.apply(String,C.slice(B,B+=Q));return p}function Y(C,h,p){let B="";p=Math.min(C.length,p);for(let ee=h;ee<p;++ee)B+=String.fromCharCode(C[ee]&127);return B}function F(C,h,p){let B="";p=Math.min(C.length,p);for(let ee=h;ee<p;++ee)B+=String.fromCharCode(C[ee]);return B}function te(C,h,p){const B=C.length;(!h||h<0)&&(h=0),(!p||p<0||p>B)&&(p=B);let ee="";for(let le=h;le<p;++le)ee+=kt[C[le]];return ee}function x(C,h,p){const B=C.slice(h,p);let ee="";for(let le=0;le<B.length-1;le+=2)ee+=String.fromCharCode(B[le]+B[le+1]*256);return ee}a.prototype.slice=function(h,p){const B=this.length;h=~~h,p=p===void 0?B:~~p,h<0?(h+=B,h<0&&(h=0)):h>B&&(h=B),p<0?(p+=B,p<0&&(p=0)):p>B&&(p=B),p<h&&(p=h);const ee=this.subarray(h,p);return Object.setPrototypeOf(ee,a.prototype),ee};function z(C,h,p){if(C%1!==0||C<0)throw new RangeError("offset is not uint");if(C+h>p)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(h,p,B){h=h>>>0,p=p>>>0,B||z(h,p,this.length);let ee=this[h],le=1,he=0;for(;++he<p&&(le*=256);)ee+=this[h+he]*le;return ee},a.prototype.readUintBE=a.prototype.readUIntBE=function(h,p,B){h=h>>>0,p=p>>>0,B||z(h,p,this.length);let ee=this[h+--p],le=1;for(;p>0&&(le*=256);)ee+=this[h+--p]*le;return ee},a.prototype.readUint8=a.prototype.readUInt8=function(h,p){return h=h>>>0,p||z(h,1,this.length),this[h]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(h,p){return h=h>>>0,p||z(h,2,this.length),this[h]|this[h+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(h,p){return h=h>>>0,p||z(h,2,this.length),this[h]<<8|this[h+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(h,p){return h=h>>>0,p||z(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(h,p){return h=h>>>0,p||z(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},a.prototype.readBigUInt64LE=je(function(h){h=h>>>0,O(h,"offset");const p=this[h],B=this[h+7];(p===void 0||B===void 0)&&G(h,this.length-8);const ee=p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,le=this[++h]+this[++h]*2**8+this[++h]*2**16+B*2**24;return BigInt(ee)+(BigInt(le)<<BigInt(32))}),a.prototype.readBigUInt64BE=je(function(h){h=h>>>0,O(h,"offset");const p=this[h],B=this[h+7];(p===void 0||B===void 0)&&G(h,this.length-8);const ee=p*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],le=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+B;return(BigInt(ee)<<BigInt(32))+BigInt(le)}),a.prototype.readIntLE=function(h,p,B){h=h>>>0,p=p>>>0,B||z(h,p,this.length);let ee=this[h],le=1,he=0;for(;++he<p&&(le*=256);)ee+=this[h+he]*le;return le*=128,ee>=le&&(ee-=Math.pow(2,8*p)),ee},a.prototype.readIntBE=function(h,p,B){h=h>>>0,p=p>>>0,B||z(h,p,this.length);let ee=p,le=1,he=this[h+--ee];for(;ee>0&&(le*=256);)he+=this[h+--ee]*le;return le*=128,he>=le&&(he-=Math.pow(2,8*p)),he},a.prototype.readInt8=function(h,p){return h=h>>>0,p||z(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},a.prototype.readInt16LE=function(h,p){h=h>>>0,p||z(h,2,this.length);const B=this[h]|this[h+1]<<8;return B&32768?B|4294901760:B},a.prototype.readInt16BE=function(h,p){h=h>>>0,p||z(h,2,this.length);const B=this[h+1]|this[h]<<8;return B&32768?B|4294901760:B},a.prototype.readInt32LE=function(h,p){return h=h>>>0,p||z(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},a.prototype.readInt32BE=function(h,p){return h=h>>>0,p||z(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},a.prototype.readBigInt64LE=je(function(h){h=h>>>0,O(h,"offset");const p=this[h],B=this[h+7];(p===void 0||B===void 0)&&G(h,this.length-8);const ee=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(B<<24);return(BigInt(ee)<<BigInt(32))+BigInt(p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),a.prototype.readBigInt64BE=je(function(h){h=h>>>0,O(h,"offset");const p=this[h],B=this[h+7];(p===void 0||B===void 0)&&G(h,this.length-8);const ee=(p<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(ee)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+B)}),a.prototype.readFloatLE=function(h,p){return h=h>>>0,p||z(h,4,this.length),t.read(this,h,!0,23,4)},a.prototype.readFloatBE=function(h,p){return h=h>>>0,p||z(h,4,this.length),t.read(this,h,!1,23,4)},a.prototype.readDoubleLE=function(h,p){return h=h>>>0,p||z(h,8,this.length),t.read(this,h,!0,52,8)},a.prototype.readDoubleBE=function(h,p){return h=h>>>0,p||z(h,8,this.length),t.read(this,h,!1,52,8)};function Z(C,h,p,B,ee,le){if(!a.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>ee||h<le)throw new RangeError('"value" argument is out of bounds');if(p+B>C.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(h,p,B,ee){if(h=+h,p=p>>>0,B=B>>>0,!ee){const Pe=Math.pow(2,8*B)-1;Z(this,h,p,B,Pe,0)}let le=1,he=0;for(this[p]=h&255;++he<B&&(le*=256);)this[p+he]=h/le&255;return p+B},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(h,p,B,ee){if(h=+h,p=p>>>0,B=B>>>0,!ee){const Pe=Math.pow(2,8*B)-1;Z(this,h,p,B,Pe,0)}let le=B-1,he=1;for(this[p+le]=h&255;--le>=0&&(he*=256);)this[p+le]=h/he&255;return p+B},a.prototype.writeUint8=a.prototype.writeUInt8=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,1,255,0),this[p]=h&255,p+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,2,65535,0),this[p]=h&255,this[p+1]=h>>>8,p+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,2,65535,0),this[p]=h>>>8,this[p+1]=h&255,p+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,4,4294967295,0),this[p+3]=h>>>24,this[p+2]=h>>>16,this[p+1]=h>>>8,this[p]=h&255,p+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,4,4294967295,0),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4};function J(C,h,p,B,ee){be(h,B,ee,C,p,7);let le=Number(h&BigInt(4294967295));C[p++]=le,le=le>>8,C[p++]=le,le=le>>8,C[p++]=le,le=le>>8,C[p++]=le;let he=Number(h>>BigInt(32)&BigInt(4294967295));return C[p++]=he,he=he>>8,C[p++]=he,he=he>>8,C[p++]=he,he=he>>8,C[p++]=he,p}function ce(C,h,p,B,ee){be(h,B,ee,C,p,7);let le=Number(h&BigInt(4294967295));C[p+7]=le,le=le>>8,C[p+6]=le,le=le>>8,C[p+5]=le,le=le>>8,C[p+4]=le;let he=Number(h>>BigInt(32)&BigInt(4294967295));return C[p+3]=he,he=he>>8,C[p+2]=he,he=he>>8,C[p+1]=he,he=he>>8,C[p]=he,p+8}a.prototype.writeBigUInt64LE=je(function(h,p=0){return J(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=je(function(h,p=0){return ce(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(h,p,B,ee){if(h=+h,p=p>>>0,!ee){const et=Math.pow(2,8*B-1);Z(this,h,p,B,et-1,-et)}let le=0,he=1,Pe=0;for(this[p]=h&255;++le<B&&(he*=256);)h<0&&Pe===0&&this[p+le-1]!==0&&(Pe=1),this[p+le]=(h/he>>0)-Pe&255;return p+B},a.prototype.writeIntBE=function(h,p,B,ee){if(h=+h,p=p>>>0,!ee){const et=Math.pow(2,8*B-1);Z(this,h,p,B,et-1,-et)}let le=B-1,he=1,Pe=0;for(this[p+le]=h&255;--le>=0&&(he*=256);)h<0&&Pe===0&&this[p+le+1]!==0&&(Pe=1),this[p+le]=(h/he>>0)-Pe&255;return p+B},a.prototype.writeInt8=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,1,127,-128),h<0&&(h=255+h+1),this[p]=h&255,p+1},a.prototype.writeInt16LE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,2,32767,-32768),this[p]=h&255,this[p+1]=h>>>8,p+2},a.prototype.writeInt16BE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,2,32767,-32768),this[p]=h>>>8,this[p+1]=h&255,p+2},a.prototype.writeInt32LE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,4,2147483647,-2147483648),this[p]=h&255,this[p+1]=h>>>8,this[p+2]=h>>>16,this[p+3]=h>>>24,p+4},a.prototype.writeInt32BE=function(h,p,B){return h=+h,p=p>>>0,B||Z(this,h,p,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4},a.prototype.writeBigInt64LE=je(function(h,p=0){return J(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=je(function(h,p=0){return ce(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(C,h,p,B,ee,le){if(p+B>C.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function W(C,h,p,B,ee){return h=+h,p=p>>>0,ee||H(C,h,p,4),t.write(C,h,p,B,23,4),p+4}a.prototype.writeFloatLE=function(h,p,B){return W(this,h,p,!0,B)},a.prototype.writeFloatBE=function(h,p,B){return W(this,h,p,!1,B)};function K(C,h,p,B,ee){return h=+h,p=p>>>0,ee||H(C,h,p,8),t.write(C,h,p,B,52,8),p+8}a.prototype.writeDoubleLE=function(h,p,B){return K(this,h,p,!0,B)},a.prototype.writeDoubleBE=function(h,p,B){return K(this,h,p,!1,B)},a.prototype.copy=function(h,p,B,ee){if(!a.isBuffer(h))throw new TypeError("argument should be a Buffer");if(B||(B=0),!ee&&ee!==0&&(ee=this.length),p>=h.length&&(p=h.length),p||(p=0),ee>0&&ee<B&&(ee=B),ee===B||h.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),h.length-p<ee-B&&(ee=h.length-p+B);const le=ee-B;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,B,ee):Uint8Array.prototype.set.call(h,this.subarray(B,ee),p),le},a.prototype.fill=function(h,p,B,ee){if(typeof h=="string"){if(typeof p=="string"?(ee=p,p=0,B=this.length):typeof B=="string"&&(ee=B,B=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!a.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(h.length===1){const he=h.charCodeAt(0);(ee==="utf8"&&he<128||ee==="latin1")&&(h=he)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(p<0||this.length<p||this.length<B)throw new RangeError("Out of range index");if(B<=p)return this;p=p>>>0,B=B===void 0?this.length:B>>>0,h||(h=0);let le;if(typeof h=="number")for(le=p;le<B;++le)this[le]=h;else{const he=a.isBuffer(h)?h:a.from(h,ee),Pe=he.length;if(Pe===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(le=0;le<B-p;++le)this[le+p]=he[le%Pe]}return this};const V={};function re(C,h,p){V[C]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${C}]`,this.stack,delete this.name}get code(){return C}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${C}]: ${this.message}`}}}re("ERR_BUFFER_OUT_OF_BOUNDS",function(C){return C?`${C} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),re("ERR_INVALID_ARG_TYPE",function(C,h){return`The "${C}" argument must be of type number. Received type ${typeof h}`},TypeError),re("ERR_OUT_OF_RANGE",function(C,h,p){let B=`The value of "${C}" is out of range.`,ee=p;return Number.isInteger(p)&&Math.abs(p)>2**32?ee=ne(String(p)):typeof p=="bigint"&&(ee=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(ee=ne(ee)),ee+="n"),B+=` It must be ${h}. Received ${ee}`,B},RangeError);function ne(C){let h="",p=C.length;const B=C[0]==="-"?1:0;for(;p>=B+4;p-=3)h=`_${C.slice(p-3,p)}${h}`;return`${C.slice(0,p)}${h}`}function ge(C,h,p){O(h,"offset"),(C[h]===void 0||C[h+p]===void 0)&&G(h,C.length-(p+1))}function be(C,h,p,B,ee,le){if(C>p||C<h){const he=typeof h=="bigint"?"n":"";let Pe;throw h===0||h===BigInt(0)?Pe=`>= 0${he} and < 2${he} ** ${(le+1)*8}${he}`:Pe=`>= -(2${he} ** ${(le+1)*8-1}${he}) and < 2 ** ${(le+1)*8-1}${he}`,new V.ERR_OUT_OF_RANGE("value",Pe,C)}ge(B,ee,le)}function O(C,h){if(typeof C!="number")throw new V.ERR_INVALID_ARG_TYPE(h,"number",C)}function G(C,h,p){throw Math.floor(C)!==C?(O(C,p),new V.ERR_OUT_OF_RANGE("offset","an integer",C)):h<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${h}`,C)}const oe=/[^+/0-9A-Za-z-_]/g;function pe(C){if(C=C.split("=")[0],C=C.trim().replace(oe,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function ye(C,h){h=h||1/0;let p;const B=C.length;let ee=null;const le=[];for(let he=0;he<B;++he){if(p=C.charCodeAt(he),p>55295&&p<57344){if(!ee){if(p>56319){(h-=3)>-1&&le.push(239,191,189);continue}else if(he+1===B){(h-=3)>-1&&le.push(239,191,189);continue}ee=p;continue}if(p<56320){(h-=3)>-1&&le.push(239,191,189),ee=p;continue}p=(ee-55296<<10|p-56320)+65536}else ee&&(h-=3)>-1&&le.push(239,191,189);if(ee=null,p<128){if((h-=1)<0)break;le.push(p)}else if(p<2048){if((h-=2)<0)break;le.push(p>>6|192,p&63|128)}else if(p<65536){if((h-=3)<0)break;le.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((h-=4)<0)break;le.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return le}function we(C){const h=[];for(let p=0;p<C.length;++p)h.push(C.charCodeAt(p)&255);return h}function ie(C,h){let p,B,ee;const le=[];for(let he=0;he<C.length&&!((h-=2)<0);++he)p=C.charCodeAt(he),B=p>>8,ee=p%256,le.push(ee),le.push(B);return le}function fe(C){return e.toByteArray(pe(C))}function ve(C,h,p,B){let ee;for(ee=0;ee<B&&!(ee+p>=h.length||ee>=C.length);++ee)h[ee+p]=C[ee];return ee}function ue(C,h){return C instanceof h||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===h.name}function Ve(C){return C!==C}const kt=function(){const C="0123456789abcdef",h=new Array(256);for(let p=0;p<16;++p){const B=p*16;for(let ee=0;ee<16;++ee)h[B+ee]=C[p]+C[ee]}return h}();function je(C){return typeof BigInt>"u"?Ct:C}function Ct(){throw new Error("BigInt not supported")}}(Lo)),Lo}var tm=Hi();const gn="http://www.w3.org/1999/02/22-rdf-syntax-ns#",yn="http://www.w3.org/2001/XMLSchema#",Es="http://www.w3.org/2000/10/swap/",_t={xsd:{decimal:`${yn}decimal`,boolean:`${yn}boolean`,double:`${yn}double`,integer:`${yn}integer`,string:`${yn}string`},rdf:{type:`${gn}type`,nil:`${gn}nil`,first:`${gn}first`,rest:`${gn}rest`,langString:`${gn}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Es}reify#forSome`,forAll:`${Es}reify#forAll`},log:{implies:`${Es}log#implies`,isImpliedBy:`${Es}log#isImpliedBy`}},{xsd:Ss}=_t,im=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,hd={"\\":"\\","'":"'",'"':'"',n:`
7
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},rm=/[\x00-\x20<>\\"\{\}\|\^\`]/,nm={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},sm=/$0^/;class om{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._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const t in this)!(t in nm)&&this[t]instanceof RegExp&&(this[t]=sm)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let a,l;for(;a=this._newline.exec(r);)this.comments&&(l=this._comment.exec(a[0]))&&s("comment",l[1],"",this._line,a[0].length),r=r.substr(a[0].length,r.length),n=r.length,this._line++;if(!a&&(a=this._whitespace.exec(r))&&(r=r.substr(a[0].length,r.length)),this._endOfFile.test(r))return t&&(this.comments&&(l=this._comment.exec(r))&&s("comment",l[1],"",this._line,r.length),r=null,s("eof","","",this._line,0)),this._input=r;const c=this._line,d=r[0];let f="",g="",y="",b=null,_=0,E=!1;switch(d){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){E=!0;break}}else{this._n3Mode&&(_=1,f="^");break}case"<":if(b=this._unescapedIri.exec(r))f="IRI",g=b[1];else if(b=this._iri.exec(r)){if(g=this._unescape(b[1]),g===null||rm.test(g))return o(this);f="IRI"}else r.length>1&&r[1]==="<"?(f="<<",_=2):this._n3Mode&&r.length>1&&r[1]==="="&&(_=2,this._isImpliedBy?(f="abbreviation",g="<"):(f="inverse",g=">"));break;case">":r.length>1&&r[1]===">"&&(f=">>",_=2);break;case"_":((b=this._blank.exec(r))||t&&(b=this._blank.exec(`${r} `)))&&(f="blank",y="_",g=b[1]);break;case'"':if(b=this._simpleQuotedString.exec(r))g=b[1];else if({value:g,matchLength:_}=this._parseLiteral(r),g===null)return o(this);(b!==null||_!==0)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(b=this._simpleApostropheString.exec(r))g=b[1];else if({value:g,matchLength:_}=this._parseLiteral(r),g===null)return o(this);(b!==null||_!==0)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(b=this._variable.exec(r))&&(f="var",g=b[0]);break;case"@":this._previousMarker==="literal"&&(b=this._langcode.exec(r))?(f="langcode",g=b[1]):(b=this._keyword.exec(r))&&(f=b[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){f=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(b=this._number.exec(r)||t&&(b=this._number.exec(`${r} `)))&&(f="literal",g=b[0],y=typeof b[1]=="string"?Ss.double:typeof b[2]=="string"?Ss.decimal:Ss.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(b=this._sparqlKeyword.exec(r))?f=b[0].toUpperCase():E=!0;break;case"f":case"t":(b=this._boolean.exec(r))?(f="literal",g=b[0],y=Ss.boolean):E=!0;break;case"a":(b=this._shortPredicates.exec(r))?(f="abbreviation",g="a"):E=!0;break;case"=":this._n3Mode&&r.length>1&&(f="abbreviation",r[1]!==">"?(_=1,g="="):(_=2,g=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(_=1,f=d);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(f="{|",_=2):(f=d,_=1));break;case"|":r.length>=2&&r[1]==="}"&&(f="|}",_=2);break;default:E=!0}if(E&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(b=this._prefix.exec(r))?(f="prefix",g=b[1]||""):((b=this._prefixed.exec(r))||t&&(b=this._prefixed.exec(`${r} `)))&&(f="prefixed",y=b[1]||"",g=this._unescape(b[2]))),this._previousMarker==="^^")switch(f){case"prefixed":f="type";break;case"IRI":f="typeIRI";break;default:f=""}if(!f)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const S=_||b[0].length,k=s(f,g,y,c,S);this.previousToken=k,this._previousMarker=f,r=r.substr(S,r.length)}function s(a,l,c,d,f){const g=r?n-r.length:n,y=g+f,b={type:a,value:l,prefix:c,line:d,start:g,end:y};return e(null,b),b}function o(a){e(a._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(im,(n,s,o,a)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof o=="string"){let l=Number.parseInt(o,16);return l<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return a in hd?hd[a]:(t=!0,"")});return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let s=0;for(;e[n-s-1]==="\\";)s++;if(s%2===0){const o=e.substring(r,n),a=o.split(/\r\n|\r|\n/).length-1,l=n+r;if(r===1&&a!==0||r===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:l}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const r=[];let n;if(this._tokenizeToEnd((s,o)=>s?n=s:r.push(o),!0),n)throw n;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=tm.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:am,xsd:br}=_t;let on,lm=0;const qe={namedNode:lf,blankNode:cf,variable:uf,literal:df,defaultGraph:hm,quad:kl,triple:kl,fromTerm:Bn,fromQuad:hf};class bi{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof bi?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let lc=class extends bi{get termType(){return"NamedNode"}},Ii=class af extends bi{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&e[t++]==="@"?e.substr(t).toLowerCase():""}get datatype(){return new lc(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return r==="^"?e.substr(t+2):r!=="@"?br.string:am.langString}equals(e){return e instanceof af?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},cm=class extends bi{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},dm=class extends bi{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},um=class extends bi{constructor(){return super(""),on||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};on=new um;function jn(i,e,t){if(e=e||qe,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===qe)return new Ii(i);if(i[i.length-1]==='"')return e.literal(i.substr(1,i.length-2));const r=i.lastIndexOf('"',i.length-1);return e.literal(i.substr(1,r-1),i[r+1]==="@"?i.substr(r+2):e.namedNode(i.substr(r+3)));case"[":i=JSON.parse(i);break;default:if(!t||!Array.isArray(i))return e.namedNode(i)}return e.quad(jn(i[0],e,!0),jn(i[1],e,!0),jn(i[2],e,!0),i[3]&&jn(i[3],e,!0))}function qr(i,e){if(typeof i=="string")return i;if(i instanceof bi&&i.termType!=="Quad")return i.id;if(!i)return on.id;switch(i.termType){case"NamedNode":return i.value;case"BlankNode":return`_:${i.value}`;case"Variable":return`?${i.value}`;case"DefaultGraph":return"";case"Literal":return`"${i.value}"${i.language?`@${i.language}`:i.datatype&&i.datatype.value!==br.string?`^^${i.datatype.value}`:""}`;case"Quad":const t=[qr(i.subject,!0),qr(i.predicate,!0),qr(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&t.push(qr(i.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let lo=class extends bi{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||on}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function lf(i){return new lc(i)}function cf(i){return new cm(i||`n3-${lm++}`)}function df(i,e){if(typeof e=="string")return new Ii(`"${i}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof i=="boolean"?t=br.boolean:typeof i=="number"&&(Number.isFinite(i)?t=Number.isInteger(i)?br.integer:br.double:(t=br.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),t===""||t===br.string?new Ii(`"${i}"`):new Ii(`"${i}"^^${t}`)}function uf(i){return new dm(i)}function hm(){return on}function kl(i,e,t,r){return new lo(i,e,t,r)}function Bn(i){if(i instanceof bi)return i;switch(i.termType){case"NamedNode":return lf(i.value);case"BlankNode":return cf(i.value);case"Variable":return uf(i.value);case"DefaultGraph":return on;case"Literal":return df(i.value,i.language||i.datatype);case"Quad":return hf(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function hf(i){if(i instanceof lo)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return kl(Bn(i.subject),Bn(i.predicate),Bn(i.object),Bn(i.graph))}let fd=0;class Il{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&ff(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),s=/triple/.test(t),o=/quad/.test(t),a=this._n3Mode=/n3/.test(t),l=s||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||s||a),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),l&&(this._resolveRelativeIRI=c=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new om({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){fd=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,r,n,s){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:s,graph:t,inverse:o?this._inversePredicate:!1,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.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,t){let r;switch(e.type){case"IRI":case"typeIRI":const n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(n);break;case"type":case"prefixed":const s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(s+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":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._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star 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 t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":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._factory.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-star 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 t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?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 t=null,r=null,n=this._readListItem;const s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((t=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),s===null?a.predicate===null?a.subject=r:a.object=r:this._emit(s,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;t=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.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 t,r=this._graph;const n=this._subject,s=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,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const o=this._predicate,a=this._object;this._subject=this._factory.quad(n,o,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){const o=this._predicate,a=this._object;s?this._emit(a,o,n,r):this._emit(n,o,a,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._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 t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_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._factory.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 t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&r.type==="item"){const n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,n;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,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 t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_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,t,r,n){this._callback(null,this._factory.quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=ks}_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 t=e.length;let r="",n=-1,s=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<t&&e[s]!=="/";)n=s;break;case"?":case"#":n=t;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=s&&(r=r.substr(0,o)),a!=="/")return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){let n,s,o;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(n=t.onQuad,s=t.onPrefix,o=t.onComment):(n=t,s=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${fd++}_`,this._prefixCallback=s||ks,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const l=[];let c;if(this._callback=(d,f)=>{d?c=d:f&&l.push(f)},this._lexer.tokenize(e).every(d=>this._readCallback=this._readCallback(d)),c)throw c;return l}let a=(l,c)=>{l!==null?(this._callback(l),this._callback=ks):this._readCallback&&(this._readCallback=this._readCallback(c))};o&&(this._lexer.comments=!0,a=(l,c)=>{l!==null?(this._callback(l),this._callback=ks):this._readCallback&&(c.type==="comment"?o(c.value):this._readCallback=this._readCallback(c))}),this._callback=n,this._lexer.tokenize(e,a)}}function ks(){}function ff(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(_t.rdf.first),i.RDF_REST=e.namedNode(_t.rdf.rest),i.RDF_NIL=e.namedNode(_t.rdf.nil),i.N3_FORALL=e.namedNode(_t.r.forAll),i.N3_FORSOME=e.namedNode(_t.r.forSome),i.ABBREVIATIONS={a:e.namedNode(_t.rdf.type),"=":e.namedNode(_t.owl.sameAs),">":e.namedNode(_t.log.implies),"<":e.namedNode(_t.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ff(Il.prototype,qe);function Rl(i){return!!i&&i.termType==="DefaultGraph"}function Ms(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const fm=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,pm=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,pd="./",mm="../",Do="?",md="#";class cc{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!fm.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!cc.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",Ms(e)],r=[],n=[],s=/[^/?#]*([/?#])/y;let o,a=0,l=0,c=s.lastIndex=e.length;for(;!a&&!l&&(o=s.exec(this.base));)o[1]===md?l=s.lastIndex-1:(t.push(Ms(o[0]),"(?:"),r.push(")?"),o[1]!==Do?n.push(c=s.lastIndex):(a=c=s.lastIndex,l=this.base.indexOf(md,a),this._pathReplacements[a]=Do));for(let d=0;d<n.length;d++)this._pathReplacements[n[d]]=mm.repeat(n.length-d-1);return this._pathReplacements[n[n.length-1]]=pd,this._baseLength=l>0?l:this.base.length,t.push(Ms(this.base.substring(c,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const n=this._pathReplacements[r];if(n){const s=e.substring(r);return n!==Do&&!pm.test(s)?e:n===pd&&/^[^?#]/.test(s)?s:n+s}return e.substring(r-1)}}const bn=qe.defaultGraph(),{rdf:gm,xsd:Or}=_t,gd=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,yd=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ym={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class vn extends bi{equals(e){return e===this}}class dc{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let r="";this._outputStream={write(n,s,o){r+=n,o&&o()},end:n=>{n&&n(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=bn,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new cc(t.baseIRI)))}get _inDefaultGraph(){return bn.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,s){try{n.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
8
+ `:`
9
+ }
10
+ `)+(bn.equals(n)?"":`${this._encodeIriOrBlank(n)} {
11
+ `)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,s):this._write(`;
12
+ ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s):this._write(`${(this._subject===null?"":`.
13
+ `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,s)}catch(o){s&&s(o)}}_writeQuadLine(e,t,r,n,s){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),s)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .
14
+ `:` .
15
+ `}`}quadsToString(e){let t="";for(const r of e)t+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return t}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),gd.test(t)&&(t=t.replace(yd,bd));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(gd.test(t)&&(t=t.replace(yd,bd)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Or.string)return`"${t}"`}else switch(e.datatype.value){case Or.string:return`"${t}"`;case Or.boolean:if(t==="true"||t==="false")return t;break;case Or.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Or.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Or.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===gm.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${Rl(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,s){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof n=="function"?this._writeQuad(e,t,r,bn,n):this._writeQuad(e,t,r,n||bn,s)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const n={};n[e]=t,this.addPrefixes(n,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let n in e){let s=e[n];typeof s!="string"&&(s=s.value),r=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
16
+ `:`
17
+ }
18
+ `),this._subject=null,this._graph=""),this._prefixIRIs[s]=n+=":",this._write(`@prefix ${n} <${s}>.
19
+ `)}if(r){let n="",s="";for(const o in this._prefixIRIs)n+=n?`|${o}`:o,s+=(s?"|":"")+this._prefixIRIs[o];n=Ms(n),this._prefixRegex=new RegExp(`^(?:${s})[^/]*$|^(${n})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?`
20
+ `:"",t)}blank(e,t){let r=e,n,s;switch(e===void 0?r=[]:e.termType?r=[{predicate:e,object:t}]:"length"in e||(r=[e]),s=r.length){case 0:return new vn("[]");case 1:if(n=r[0],!(n.object instanceof vn))return new vn(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let o="[";for(let a=0;a<s;a++)n=r[a],n.predicate.equals(e)?o+=`, ${this._encodeObject(n.object)}`:(o+=`${(a?`;
21
+ `:`
22
+ `)+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new vn(`${o}
23
+ ]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let n=0;n<t;n++)r[n]=this._encodeObject(e[n]);return new vn(`(${r.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
24
+ `:`
25
+ }
26
+ `),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,n)=>{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function bd(i){let e=ym[i];return e===void 0&&(i.length===1?(e=i.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Oo={exports:{}},Mo={exports:{}},Po,vd;function nt(){if(vd)return Po;vd=1;class i extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
27
+ `;super(r),this.name="AggregateError",this.errors=t}}return Po={AggregateError:i,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},Po}var jo={exports:{}},Bo,wd;function pf(){return wd||(wd=1,Bo={format(i,...e){return i.replace(/%([sdifj])/g,function(...[t,r]){const n=e.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(i){switch(typeof i){case"string":if(i.includes("'"))if(i.includes('"')){if(!i.includes("`")&&!i.includes("${"))return`\`${i}\``}else return`"${i}"`;return`'${i}'`;case"number":return isNaN(i)?"NaN":Object.is(i,-0)?String(i):i;case"bigint":return`${String(i)}n`;case"boolean":case"undefined":return String(i);case"object":return"{}"}}}),Bo}var Fo,_d;function Pt(){if(_d)return Fo;_d=1;const{format:i,inspect:e}=pf(),{AggregateError:t}=nt(),r=globalThis.AggregateError||t,n=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,a="__node_internal_",l={};function c(E,S){if(!E)throw new l.ERR_INTERNAL_ASSERTION(S)}function d(E){let S="",k=E.length;const v=E[0]==="-"?1:0;for(;k>=v+4;k-=3)S=`_${E.slice(k-3,k)}${S}`;return`${E.slice(0,k)}${S}`}function f(E,S,k){if(typeof S=="function")return c(S.length<=k.length,`Code: ${E}; The provided arguments length (${k.length}) does not match the required ones (${S.length}).`),S(...k);const v=(S.match(/%[dfijoOs]/g)||[]).length;return c(v===k.length,`Code: ${E}; The provided arguments length (${k.length}) does not match the required ones (${v}).`),k.length===0?S:i(S,...k)}function g(E,S,k){k||(k=Error);class v extends k{constructor(...m){super(f(E,S,m))}toString(){return`${this.name} [${E}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${E}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=E,v.prototype[n]=!0,l[E]=v}function y(E){const S=a+E.name;return Object.defineProperty(E,"name",{value:S}),E}function b(E,S){if(E&&S&&E!==S){if(Array.isArray(S.errors))return S.errors.push(E),S;const k=new r([S,E],S.message);return k.code=S.code,k}return E||S}class _ extends Error{constructor(S="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new l.ERR_INVALID_ARG_TYPE("options","Object",k);super(S,k),this.code="ABORT_ERR",this.name="AbortError"}}return g("ERR_ASSERTION","%s",Error),g("ERR_INVALID_ARG_TYPE",(E,S,k)=>{c(typeof E=="string","'name' must be a string"),Array.isArray(S)||(S=[S]);let v="The ";E.endsWith(" argument")?v+=`${E} `:v+=`"${E}" ${E.includes(".")?"property":"argument"} `,v+="must be ";const u=[],m=[],T=[];for(const $ of S)c(typeof $=="string","All expected entries have to be of type string"),s.includes($)?u.push($.toLowerCase()):o.test($)?m.push($):(c($!=="object",'The value "object" should be written as "Object"'),T.push($));if(m.length>0){const $=u.indexOf("object");$!==-1&&(u.splice(u,$,1),m.push("Object"))}if(u.length>0){switch(u.length){case 1:v+=`of type ${u[0]}`;break;case 2:v+=`one of type ${u[0]} or ${u[1]}`;break;default:{const $=u.pop();v+=`one of type ${u.join(", ")}, or ${$}`}}(m.length>0||T.length>0)&&(v+=" or ")}if(m.length>0){switch(m.length){case 1:v+=`an instance of ${m[0]}`;break;case 2:v+=`an instance of ${m[0]} or ${m[1]}`;break;default:{const $=m.pop();v+=`an instance of ${m.join(", ")}, or ${$}`}}T.length>0&&(v+=" or ")}switch(T.length){case 0:break;case 1:T[0].toLowerCase()!==T[0]&&(v+="an "),v+=`${T[0]}`;break;case 2:v+=`one of ${T[0]} or ${T[1]}`;break;default:{const $=T.pop();v+=`one of ${T.join(", ")}, or ${$}`}}if(k==null)v+=`. Received ${k}`;else if(typeof k=="function"&&k.name)v+=`. Received function ${k.name}`;else if(typeof k=="object"){var N;if((N=k.constructor)!==null&&N!==void 0&&N.name)v+=`. Received an instance of ${k.constructor.name}`;else{const $=e(k,{depth:-1});v+=`. Received ${$}`}}else{let $=e(k,{colors:!1});$.length>25&&($=`${$.slice(0,25)}...`),v+=`. Received type ${typeof k} (${$})`}return v},TypeError),g("ERR_INVALID_ARG_VALUE",(E,S,k="is invalid")=>{let v=e(S);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${E.includes(".")?"property":"argument"} '${E}' ${k}. Received ${v}`},TypeError),g("ERR_INVALID_RETURN_VALUE",(E,S,k)=>{var v;const u=k!=null&&(v=k.constructor)!==null&&v!==void 0&&v.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${E} to be returned from the "${S}" function but got ${u}.`},TypeError),g("ERR_MISSING_ARGS",(...E)=>{c(E.length>0,"At least one arg needs to be specified");let S;const k=E.length;switch(E=(Array.isArray(E)?E:[E]).map(v=>`"${v}"`).join(" or "),k){case 1:S+=`The ${E[0]} argument`;break;case 2:S+=`The ${E[0]} and ${E[1]} arguments`;break;default:{const v=E.pop();S+=`The ${E.join(", ")}, and ${v} arguments`}break}return`${S} must be specified`},TypeError),g("ERR_OUT_OF_RANGE",(E,S,k)=>{c(S,'Missing "range" argument');let v;if(Number.isInteger(k)&&Math.abs(k)>2**32)v=d(String(k));else if(typeof k=="bigint"){v=String(k);const u=BigInt(2)**BigInt(32);(k>u||k<-u)&&(v=d(v)),v+="n"}else v=e(k);return`The value of "${E}" is out of range. It must be ${S}. Received ${v}`},RangeError),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),g("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),g("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),g("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),g("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),g("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),g("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),g("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),g("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),g("ERR_STREAM_WRITE_AFTER_END","write after end",Error),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Fo={AbortError:_,aggregateTwoErrors:y(b),hideStackFrames:y,codes:l},Fo}var wn={exports:{}},xd;function ts(){if(xd)return wn.exports;xd=1;const{AbortController:i,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return wn.exports=i,wn.exports.AbortSignal=e,wn.exports.default=i,wn.exports}var Is={exports:{}},Ed;function co(){if(Ed)return Is.exports;Ed=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(m,T,N){return Function.prototype.apply.call(m,T,N)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:t=function(m){return Object.getOwnPropertyNames(m)};function r(u){console&&console.warn&&console.warn(u)}var n=Number.isNaN||function(m){return m!==m};function s(){s.init.call(this)}Is.exports=s,Is.exports.once=S,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(u){if(typeof u!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof u)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(u){if(typeof u!="number"||u<0||n(u))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+u+".");o=u}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||n(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function l(u){return u._maxListeners===void 0?s.defaultMaxListeners:u._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(m){for(var T=[],N=1;N<arguments.length;N++)T.push(arguments[N]);var $=m==="error",j=this._events;if(j!==void 0)$=$&&j.error===void 0;else if(!$)return!1;if($){var R;if(T.length>0&&(R=T[0]),R instanceof Error)throw R;var P=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw P.context=R,P}var q=j[m];if(q===void 0)return!1;if(typeof q=="function")e(q,this,T);else for(var I=q.length,L=b(q,I),N=0;N<I;++N)e(L[N],this,T);return!0};function c(u,m,T,N){var $,j,R;if(a(T),j=u._events,j===void 0?(j=u._events=Object.create(null),u._eventsCount=0):(j.newListener!==void 0&&(u.emit("newListener",m,T.listener?T.listener:T),j=u._events),R=j[m]),R===void 0)R=j[m]=T,++u._eventsCount;else if(typeof R=="function"?R=j[m]=N?[T,R]:[R,T]:N?R.unshift(T):R.push(T),$=l(u),$>0&&R.length>$&&!R.warned){R.warned=!0;var P=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");P.name="MaxListenersExceededWarning",P.emitter=u,P.type=m,P.count=R.length,r(P)}return u}s.prototype.addListener=function(m,T){return c(this,m,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(m,T){return c(this,m,T,!0)};function d(){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 f(u,m,T){var N={fired:!1,wrapFn:void 0,target:u,type:m,listener:T},$=d.bind(N);return $.listener=T,N.wrapFn=$,$}s.prototype.once=function(m,T){return a(T),this.on(m,f(this,m,T)),this},s.prototype.prependOnceListener=function(m,T){return a(T),this.prependListener(m,f(this,m,T)),this},s.prototype.removeListener=function(m,T){var N,$,j,R,P;if(a(T),$=this._events,$===void 0)return this;if(N=$[m],N===void 0)return this;if(N===T||N.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete $[m],$.removeListener&&this.emit("removeListener",m,N.listener||T));else if(typeof N!="function"){for(j=-1,R=N.length-1;R>=0;R--)if(N[R]===T||N[R].listener===T){P=N[R].listener,j=R;break}if(j<0)return this;j===0?N.shift():_(N,j),N.length===1&&($[m]=N[0]),$.removeListener!==void 0&&this.emit("removeListener",m,P||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(m){var T,N,$;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[m]),this;if(arguments.length===0){var j=Object.keys(N),R;for($=0;$<j.length;++$)R=j[$],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=N[m],typeof T=="function")this.removeListener(m,T);else if(T!==void 0)for($=T.length-1;$>=0;$--)this.removeListener(m,T[$]);return this};function g(u,m,T){var N=u._events;if(N===void 0)return[];var $=N[m];return $===void 0?[]:typeof $=="function"?T?[$.listener||$]:[$]:T?E($):b($,$.length)}s.prototype.listeners=function(m){return g(this,m,!0)},s.prototype.rawListeners=function(m){return g(this,m,!1)},s.listenerCount=function(u,m){return typeof u.listenerCount=="function"?u.listenerCount(m):y.call(u,m)},s.prototype.listenerCount=y;function y(u){var m=this._events;if(m!==void 0){var T=m[u];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function b(u,m){for(var T=new Array(m),N=0;N<m;++N)T[N]=u[N];return T}function _(u,m){for(;m+1<u.length;m++)u[m]=u[m+1];u.pop()}function E(u){for(var m=new Array(u.length),T=0;T<m.length;++T)m[T]=u[T].listener||u[T];return m}function S(u,m){return new Promise(function(T,N){function $(R){u.removeListener(m,j),N(R)}function j(){typeof u.removeListener=="function"&&u.removeListener("error",$),T([].slice.call(arguments))}v(u,m,j,{once:!0}),m!=="error"&&k(u,$,{once:!0})})}function k(u,m,T){typeof u.on=="function"&&v(u,"error",m,T)}function v(u,m,T,N){if(typeof u.on=="function")N.once?u.once(m,T):u.on(m,T);else if(typeof u.addEventListener=="function")u.addEventListener(m,function $(j){N.once&&u.removeEventListener(m,$),T(j)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof u)}return Is.exports}var Sd;function Ut(){return Sd||(Sd=1,function(i){const e=Hi(),{format:t,inspect:r}=pf(),{codes:{ERR_INVALID_ARG_TYPE:n}}=Pt(),{kResistStopPropagation:s,AggregateError:o,SymbolDispose:a}=nt(),l=globalThis.AbortSignal||ts().AbortSignal,c=globalThis.AbortController||ts().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||e.Blob,g=typeof f<"u"?function(E){return E instanceof f}:function(E){return!1},y=(_,E)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new n(E,"AbortSignal",_)},b=(_,E)=>{if(typeof _!="function")throw new n(E,"Function",_)};i.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(_){let E=!1;return function(...S){E||(E=!0,_.apply(this,S))}},createDeferredPromise:function(){let _,E;return{promise:new Promise((k,v)=>{_=k,E=v}),resolve:_,reject:E}},promisify(_){return new Promise((E,S)=>{_((k,...v)=>k?S(k):E(...v))})},debuglog(){return function(){}},format:t,inspect:r,types:{isAsyncFunction(_){return _ instanceof d},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:g,deprecate(_,E){return _},addAbortListener:co().addAbortListener||function(E,S){if(E===void 0)throw new n("signal","AbortSignal",E);y(E,"signal"),b(S,"listener");let k;return E.aborted?queueMicrotask(()=>S()):(E.addEventListener("abort",S,{__proto__:null,once:!0,[s]:!0}),k=()=>{E.removeEventListener("abort",S)}),{__proto__:null,[a](){var v;(v=k)===null||v===void 0||v()}}},AbortSignalAny:l.any||function(E){if(E.length===1)return E[0];const S=new c,k=()=>S.abort();return E.forEach(v=>{y(v,"signals"),v.addEventListener("abort",k,{once:!0})}),S.signal.addEventListener("abort",()=>{E.forEach(v=>v.removeEventListener("abort",k))},{once:!0}),S.signal}},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(jo)),jo.exports}var Rs={},qo,kd;function ps(){if(kd)return qo;kd=1;const{ArrayIsArray:i,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:r,NumberIsInteger:n,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:a,NumberParseInt:l,ObjectPrototypeHasOwnProperty:c,RegExpPrototypeExec:d,String:f,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=nt(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:E,ERR_INVALID_ARG_VALUE:S,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:v}}=Pt(),{normalizeEncoding:u}=Ut(),{isAsyncFunction:m,isArrayBufferView:T}=Ut().types,N={};function $(ie){return ie===(ie|0)}function j(ie){return ie===ie>>>0}const R=/^[0-7]+$/,P="must be a 32-bit unsigned integer or an octal string";function q(ie,fe,ve){if(typeof ie>"u"&&(ie=ve),typeof ie=="string"){if(d(R,ie)===null)throw new S(fe,ie,P);ie=l(ie,8)}return Q(ie,fe),ie}const I=b((ie,fe,ve=a,ue=o)=>{if(typeof ie!="number")throw new E(fe,"number",ie);if(!n(ie))throw new k(fe,"an integer",ie);if(ie<ve||ie>ue)throw new k(fe,`>= ${ve} && <= ${ue}`,ie)}),L=b((ie,fe,ve=-2147483648,ue=2147483647)=>{if(typeof ie!="number")throw new E(fe,"number",ie);if(!n(ie))throw new k(fe,"an integer",ie);if(ie<ve||ie>ue)throw new k(fe,`>= ${ve} && <= ${ue}`,ie)}),Q=b((ie,fe,ve=!1)=>{if(typeof ie!="number")throw new E(fe,"number",ie);if(!n(ie))throw new k(fe,"an integer",ie);const ue=ve?1:0,Ve=4294967295;if(ie<ue||ie>Ve)throw new k(fe,`>= ${ue} && <= ${Ve}`,ie)});function A(ie,fe){if(typeof ie!="string")throw new E(fe,"string",ie)}function Y(ie,fe,ve=void 0,ue){if(typeof ie!="number")throw new E(fe,"number",ie);if(ve!=null&&ie<ve||ue!=null&&ie>ue||(ve!=null||ue!=null)&&s(ie))throw new k(fe,`${ve!=null?`>= ${ve}`:""}${ve!=null&&ue!=null?" && ":""}${ue!=null?`<= ${ue}`:""}`,ie)}const F=b((ie,fe,ve)=>{if(!e(ve,ie)){const Ve="must be one of: "+t(r(ve,kt=>typeof kt=="string"?`'${kt}'`:f(kt)),", ");throw new S(fe,ie,Ve)}});function te(ie,fe){if(typeof ie!="boolean")throw new E(fe,"boolean",ie)}function x(ie,fe,ve){return ie==null||!c(ie,fe)?ve:ie[fe]}const z=b((ie,fe,ve=null)=>{const ue=x(ve,"allowArray",!1),Ve=x(ve,"allowFunction",!1);if(!x(ve,"nullable",!1)&&ie===null||!ue&&i(ie)||typeof ie!="object"&&(!Ve||typeof ie!="function"))throw new E(fe,"Object",ie)}),Z=b((ie,fe)=>{if(ie!=null&&typeof ie!="object"&&typeof ie!="function")throw new E(fe,"a dictionary",ie)}),J=b((ie,fe,ve=0)=>{if(!i(ie))throw new E(fe,"Array",ie);if(ie.length<ve){const ue=`must be longer than ${ve}`;throw new S(fe,ie,ue)}});function ce(ie,fe){J(ie,fe);for(let ve=0;ve<ie.length;ve++)A(ie[ve],`${fe}[${ve}]`)}function H(ie,fe){J(ie,fe);for(let ve=0;ve<ie.length;ve++)te(ie[ve],`${fe}[${ve}]`)}function W(ie,fe){J(ie,fe);for(let ve=0;ve<ie.length;ve++){const ue=ie[ve],Ve=`${fe}[${ve}]`;if(ue==null)throw new E(Ve,"AbortSignal",ue);ge(ue,Ve)}}function K(ie,fe="signal"){if(A(ie,fe),N[ie]===void 0)throw N[g(ie)]!==void 0?new v(ie+" (signals must use all capital letters)"):new v(ie)}const V=b((ie,fe="buffer")=>{if(!T(ie))throw new E(fe,["Buffer","TypedArray","DataView"],ie)});function re(ie,fe){const ve=u(fe),ue=ie.length;if(ve==="hex"&&ue%2!==0)throw new S("encoding",fe,`is invalid for data of length ${ue}`)}function ne(ie,fe="Port",ve=!0){if(typeof ie!="number"&&typeof ie!="string"||typeof ie=="string"&&y(ie).length===0||+ie!==+ie>>>0||ie>65535||ie===0&&!ve)throw new _(fe,ie,ve);return ie|0}const ge=b((ie,fe)=>{if(ie!==void 0&&(ie===null||typeof ie!="object"||!("aborted"in ie)))throw new E(fe,"AbortSignal",ie)}),be=b((ie,fe)=>{if(typeof ie!="function")throw new E(fe,"Function",ie)}),O=b((ie,fe)=>{if(typeof ie!="function"||m(ie))throw new E(fe,"Function",ie)}),G=b((ie,fe)=>{if(ie!==void 0)throw new E(fe,"undefined",ie)});function oe(ie,fe,ve){if(!e(ve,ie))throw new E(fe,`('${t(ve,"|")}')`,ie)}const pe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ye(ie,fe){if(typeof ie>"u"||!d(pe,ie))throw new S(fe,ie,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function we(ie){if(typeof ie=="string")return ye(ie,"hints"),ie;if(i(ie)){const fe=ie.length;let ve="";if(fe===0)return ve;for(let ue=0;ue<fe;ue++){const Ve=ie[ue];ye(Ve,"hints"),ve+=Ve,ue!==fe-1&&(ve+=", ")}return ve}throw new S("hints",ie,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return qo={isInt32:$,isUint32:j,parseFileMode:q,validateArray:J,validateStringArray:ce,validateBooleanArray:H,validateAbortSignalArray:W,validateBoolean:te,validateBuffer:V,validateDictionary:Z,validateEncoding:re,validateFunction:be,validateInt32:L,validateInteger:I,validateNumber:Y,validateObject:z,validateOneOf:F,validatePlainFunction:O,validatePort:ne,validateSignalName:K,validateString:A,validateUint32:Q,validateUndefined:G,validateUnion:oe,validateAbortSignal:ge,validateLinkHeaderValue:we},qo}var Ts={exports:{}},Uo={exports:{}},Id;function Cr(){if(Id)return Uo.exports;Id=1;var i=Uo.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=n}catch{t=n}})();function s(_){if(e===setTimeout)return setTimeout(_,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(_,0);try{return e(_,0)}catch{try{return e.call(null,_,0)}catch{return e.call(this,_,0)}}}function o(_){if(t===clearTimeout)return clearTimeout(_);if((t===n||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(_);try{return t(_)}catch{try{return t.call(null,_)}catch{return t.call(this,_)}}}var a=[],l=!1,c,d=-1;function f(){!l||!c||(l=!1,c.length?a=c.concat(a):d=-1,a.length&&g())}function g(){if(!l){var _=s(f);l=!0;for(var E=a.length;E;){for(c=a,a=[];++d<E;)c&&c[d].run();d=-1,E=a.length}c=null,l=!1,o(_)}}i.nextTick=function(_){var E=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)E[S-1]=arguments[S];a.push(new y(_,E)),a.length===1&&!l&&s(g)};function y(_,E){this.fun=_,this.array=E}y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function b(){}return i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(_){return[]},i.binding=function(_){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(_){throw new Error("process.chdir is not supported")},i.umask=function(){return 0},Uo.exports}var Vo,Rd;function Wi(){if(Rd)return Vo;Rd=1;const{SymbolAsyncIterator:i,SymbolIterator:e,SymbolFor:t}=nt(),r=t("nodejs.stream.destroyed"),n=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),a=t("nodejs.stream.disturbed"),l=t("nodejs.webstream.isClosedPromise"),c=t("nodejs.webstream.controllerErrorFunction");function d(x,z=!1){var Z;return!!(x&&typeof x.pipe=="function"&&typeof x.on=="function"&&(!z||typeof x.pause=="function"&&typeof x.resume=="function")&&(!x._writableState||((Z=x._readableState)===null||Z===void 0?void 0:Z.readable)!==!1)&&(!x._writableState||x._readableState))}function f(x){var z;return!!(x&&typeof x.write=="function"&&typeof x.on=="function"&&(!x._readableState||((z=x._writableState)===null||z===void 0?void 0:z.writable)!==!1))}function g(x){return!!(x&&typeof x.pipe=="function"&&x._readableState&&typeof x.on=="function"&&typeof x.write=="function")}function y(x){return x&&(x._readableState||x._writableState||typeof x.write=="function"&&typeof x.on=="function"||typeof x.pipe=="function"&&typeof x.on=="function")}function b(x){return!!(x&&!y(x)&&typeof x.pipeThrough=="function"&&typeof x.getReader=="function"&&typeof x.cancel=="function")}function _(x){return!!(x&&!y(x)&&typeof x.getWriter=="function"&&typeof x.abort=="function")}function E(x){return!!(x&&!y(x)&&typeof x.readable=="object"&&typeof x.writable=="object")}function S(x){return b(x)||_(x)||E(x)}function k(x,z){return x==null?!1:z===!0?typeof x[i]=="function":z===!1?typeof x[e]=="function":typeof x[i]=="function"||typeof x[e]=="function"}function v(x){if(!y(x))return null;const z=x._writableState,Z=x._readableState,J=z||Z;return!!(x.destroyed||x[r]||J!=null&&J.destroyed)}function u(x){if(!f(x))return null;if(x.writableEnded===!0)return!0;const z=x._writableState;return z!=null&&z.errored?!1:typeof(z==null?void 0:z.ended)!="boolean"?null:z.ended}function m(x,z){if(!f(x))return null;if(x.writableFinished===!0)return!0;const Z=x._writableState;return Z!=null&&Z.errored?!1:typeof(Z==null?void 0:Z.finished)!="boolean"?null:!!(Z.finished||z===!1&&Z.ended===!0&&Z.length===0)}function T(x){if(!d(x))return null;if(x.readableEnded===!0)return!0;const z=x._readableState;return!z||z.errored?!1:typeof(z==null?void 0:z.ended)!="boolean"?null:z.ended}function N(x,z){if(!d(x))return null;const Z=x._readableState;return Z!=null&&Z.errored?!1:typeof(Z==null?void 0:Z.endEmitted)!="boolean"?null:!!(Z.endEmitted||z===!1&&Z.ended===!0&&Z.length===0)}function $(x){return x&&x[s]!=null?x[s]:typeof(x==null?void 0:x.readable)!="boolean"?null:v(x)?!1:d(x)&&x.readable&&!N(x)}function j(x){return x&&x[o]!=null?x[o]:typeof(x==null?void 0:x.writable)!="boolean"?null:v(x)?!1:f(x)&&x.writable&&!u(x)}function R(x,z){return y(x)?v(x)?!0:!((z==null?void 0:z.readable)!==!1&&$(x)||(z==null?void 0:z.writable)!==!1&&j(x)):null}function P(x){var z,Z;return y(x)?x.writableErrored?x.writableErrored:(z=(Z=x._writableState)===null||Z===void 0?void 0:Z.errored)!==null&&z!==void 0?z:null:null}function q(x){var z,Z;return y(x)?x.readableErrored?x.readableErrored:(z=(Z=x._readableState)===null||Z===void 0?void 0:Z.errored)!==null&&z!==void 0?z:null:null}function I(x){if(!y(x))return null;if(typeof x.closed=="boolean")return x.closed;const z=x._writableState,Z=x._readableState;return typeof(z==null?void 0:z.closed)=="boolean"||typeof(Z==null?void 0:Z.closed)=="boolean"?(z==null?void 0:z.closed)||(Z==null?void 0:Z.closed):typeof x._closed=="boolean"&&L(x)?x._closed:null}function L(x){return typeof x._closed=="boolean"&&typeof x._defaultKeepAlive=="boolean"&&typeof x._removedConnection=="boolean"&&typeof x._removedContLen=="boolean"}function Q(x){return typeof x._sent100=="boolean"&&L(x)}function A(x){var z;return typeof x._consuming=="boolean"&&typeof x._dumped=="boolean"&&((z=x.req)===null||z===void 0?void 0:z.upgradeOrConnect)===void 0}function Y(x){if(!y(x))return null;const z=x._writableState,Z=x._readableState,J=z||Z;return!J&&Q(x)||!!(J&&J.autoDestroy&&J.emitClose&&J.closed===!1)}function F(x){var z;return!!(x&&((z=x[a])!==null&&z!==void 0?z:x.readableDidRead||x.readableAborted))}function te(x){var z,Z,J,ce,H,W,K,V,re,ne;return!!(x&&((z=(Z=(J=(ce=(H=(W=x[n])!==null&&W!==void 0?W:x.readableErrored)!==null&&H!==void 0?H:x.writableErrored)!==null&&ce!==void 0?ce:(K=x._readableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&J!==void 0?J:(V=x._writableState)===null||V===void 0?void 0:V.errorEmitted)!==null&&Z!==void 0?Z:(re=x._readableState)===null||re===void 0?void 0:re.errored)!==null&&z!==void 0?z:!((ne=x._writableState)===null||ne===void 0)&&ne.errored))}return Vo={isDestroyed:v,kIsDestroyed:r,isDisturbed:F,kIsDisturbed:a,isErrored:te,kIsErrored:n,isReadable:$,kIsReadable:s,kIsClosedPromise:l,kControllerErrorFunction:c,kIsWritable:o,isClosed:I,isDuplexNodeStream:g,isFinished:R,isIterable:k,isReadableNodeStream:d,isReadableStream:b,isReadableEnded:T,isReadableFinished:N,isReadableErrored:q,isNodeStream:y,isWebStream:S,isWritable:j,isWritableNodeStream:f,isWritableStream:_,isWritableEnded:u,isWritableFinished:m,isWritableErrored:P,isServerRequest:A,isServerResponse:Q,willEmitClose:Y,isTransformStream:E},Vo}var Td;function sr(){if(Td)return Ts.exports;Td=1;const i=Cr(),{AbortError:e,codes:t}=Pt(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:n}=t,{kEmptyObject:s,once:o}=Ut(),{validateAbortSignal:a,validateFunction:l,validateObject:c,validateBoolean:d}=ps(),{Promise:f,PromisePrototypeThen:g,SymbolDispose:y}=nt(),{isClosed:b,isReadable:_,isReadableNodeStream:E,isReadableStream:S,isReadableFinished:k,isReadableErrored:v,isWritable:u,isWritableNodeStream:m,isWritableStream:T,isWritableFinished:N,isWritableErrored:$,isNodeStream:j,willEmitClose:R,kIsClosedPromise:P}=Wi();let q;function I(F){return F.setHeader&&typeof F.abort=="function"}const L=()=>{};function Q(F,te,x){var z,Z;if(arguments.length===2?(x=te,te=s):te==null?te=s:c(te,"options"),l(x,"callback"),a(te.signal,"options.signal"),x=o(x),S(F)||T(F))return A(F,te,x);if(!j(F))throw new r("stream",["ReadableStream","WritableStream","Stream"],F);const J=(z=te.readable)!==null&&z!==void 0?z:E(F),ce=(Z=te.writable)!==null&&Z!==void 0?Z:m(F),H=F._writableState,W=F._readableState,K=()=>{F.writable||ne()};let V=R(F)&&E(F)===J&&m(F)===ce,re=N(F,!1);const ne=()=>{re=!0,F.destroyed&&(V=!1),!(V&&(!F.readable||J))&&(!J||ge)&&x.call(F)};let ge=k(F,!1);const be=()=>{ge=!0,F.destroyed&&(V=!1),!(V&&(!F.writable||ce))&&(!ce||re)&&x.call(F)},O=ie=>{x.call(F,ie)};let G=b(F);const oe=()=>{G=!0;const ie=$(F)||v(F);if(ie&&typeof ie!="boolean")return x.call(F,ie);if(J&&!ge&&E(F,!0)&&!k(F,!1))return x.call(F,new n);if(ce&&!re&&!N(F,!1))return x.call(F,new n);x.call(F)},pe=()=>{G=!0;const ie=$(F)||v(F);if(ie&&typeof ie!="boolean")return x.call(F,ie);x.call(F)},ye=()=>{F.req.on("finish",ne)};I(F)?(F.on("complete",ne),V||F.on("abort",oe),F.req?ye():F.on("request",ye)):ce&&!H&&(F.on("end",K),F.on("close",K)),!V&&typeof F.aborted=="boolean"&&F.on("aborted",oe),F.on("end",be),F.on("finish",ne),te.error!==!1&&F.on("error",O),F.on("close",oe),G?i.nextTick(oe):H!=null&&H.errorEmitted||W!=null&&W.errorEmitted?V||i.nextTick(pe):(!J&&(!V||_(F))&&(re||u(F)===!1)||!ce&&(!V||u(F))&&(ge||_(F)===!1)||W&&F.req&&F.aborted)&&i.nextTick(pe);const we=()=>{x=L,F.removeListener("aborted",oe),F.removeListener("complete",ne),F.removeListener("abort",oe),F.removeListener("request",ye),F.req&&F.req.removeListener("finish",ne),F.removeListener("end",K),F.removeListener("close",K),F.removeListener("finish",ne),F.removeListener("end",be),F.removeListener("error",O),F.removeListener("close",oe)};if(te.signal&&!G){const ie=()=>{const fe=x;we(),fe.call(F,new e(void 0,{cause:te.signal.reason}))};if(te.signal.aborted)i.nextTick(ie);else{q=q||Ut().addAbortListener;const fe=q(te.signal,ie),ve=x;x=o((...ue)=>{fe[y](),ve.apply(F,ue)})}}return we}function A(F,te,x){let z=!1,Z=L;if(te.signal)if(Z=()=>{z=!0,x.call(F,new e(void 0,{cause:te.signal.reason}))},te.signal.aborted)i.nextTick(Z);else{q=q||Ut().addAbortListener;const ce=q(te.signal,Z),H=x;x=o((...W)=>{ce[y](),H.apply(F,W)})}const J=(...ce)=>{z||i.nextTick(()=>x.apply(F,ce))};return g(F[P].promise,J,J),L}function Y(F,te){var x;let z=!1;return te===null&&(te=s),(x=te)!==null&&x!==void 0&&x.cleanup&&(d(te.cleanup,"cleanup"),z=te.cleanup),new f((Z,J)=>{const ce=Q(F,te,H=>{z&&ce(),H?J(H):Z()})})}return Ts.exports=Q,Ts.exports.finished=Y,Ts.exports}var zo,$d;function an(){if($d)return zo;$d=1;const i=Cr(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:r}=Pt(),{Symbol:n}=nt(),{kIsDestroyed:s,isDestroyed:o,isFinished:a,isServerRequest:l}=Wi(),c=n("kDestroy"),d=n("kConstruct");function f(R,P,q){R&&(R.stack,P&&!P.errored&&(P.errored=R),q&&!q.errored&&(q.errored=R))}function g(R,P){const q=this._readableState,I=this._writableState,L=I||q;return I!=null&&I.destroyed||q!=null&&q.destroyed?(typeof P=="function"&&P(),this):(f(R,I,q),I&&(I.destroyed=!0),q&&(q.destroyed=!0),L.constructed?y(this,R,P):this.once(c,function(Q){y(this,e(Q,R),P)}),this)}function y(R,P,q){let I=!1;function L(Q){if(I)return;I=!0;const A=R._readableState,Y=R._writableState;f(Q,Y,A),Y&&(Y.closed=!0),A&&(A.closed=!0),typeof q=="function"&&q(Q),Q?i.nextTick(b,R,Q):i.nextTick(_,R)}try{R._destroy(P||null,L)}catch(Q){L(Q)}}function b(R,P){E(R,P),_(R)}function _(R){const P=R._readableState,q=R._writableState;q&&(q.closeEmitted=!0),P&&(P.closeEmitted=!0),(q!=null&&q.emitClose||P!=null&&P.emitClose)&&R.emit("close")}function E(R,P){const q=R._readableState,I=R._writableState;I!=null&&I.errorEmitted||q!=null&&q.errorEmitted||(I&&(I.errorEmitted=!0),q&&(q.errorEmitted=!0),R.emit("error",P))}function S(){const R=this._readableState,P=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),P&&(P.constructed=!0,P.destroyed=!1,P.closed=!1,P.closeEmitted=!1,P.errored=null,P.errorEmitted=!1,P.finalCalled=!1,P.prefinished=!1,P.ended=P.writable===!1,P.ending=P.writable===!1,P.finished=P.writable===!1)}function k(R,P,q){const I=R._readableState,L=R._writableState;if(L!=null&&L.destroyed||I!=null&&I.destroyed)return this;I!=null&&I.autoDestroy||L!=null&&L.autoDestroy?R.destroy(P):P&&(P.stack,L&&!L.errored&&(L.errored=P),I&&!I.errored&&(I.errored=P),q?i.nextTick(E,R,P):E(R,P))}function v(R,P){if(typeof R._construct!="function")return;const q=R._readableState,I=R._writableState;q&&(q.constructed=!1),I&&(I.constructed=!1),R.once(d,P),!(R.listenerCount(d)>1)&&i.nextTick(u,R)}function u(R){let P=!1;function q(I){if(P){k(R,I??new t);return}P=!0;const L=R._readableState,Q=R._writableState,A=Q||L;L&&(L.constructed=!0),Q&&(Q.constructed=!0),A.destroyed?R.emit(c,I):I?k(R,I,!0):i.nextTick(m,R)}try{R._construct(I=>{i.nextTick(q,I)})}catch(I){i.nextTick(q,I)}}function m(R){R.emit(d)}function T(R){return(R==null?void 0:R.setHeader)&&typeof R.abort=="function"}function N(R){R.emit("close")}function $(R,P){R.emit("error",P),i.nextTick(N,R)}function j(R,P){!R||o(R)||(!P&&!a(R)&&(P=new r),l(R)?(R.socket=null,R.destroy(P)):T(R)?R.abort():T(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy(P):typeof R.close=="function"?R.close():P?i.nextTick($,R,P):i.nextTick(N,R),R.destroyed||(R[s]=!0))}return zo={construct:v,destroyer:j,destroy:g,undestroy:S,errorOrDestroy:k},zo}var Ho,Cd;function uc(){if(Cd)return Ho;Cd=1;const{ArrayIsArray:i,ObjectSetPrototypeOf:e}=nt(),{EventEmitter:t}=co();function r(s){t.call(this,s)}e(r.prototype,t.prototype),e(r,t),r.prototype.pipe=function(s,o){const a=this;function l(_){s.writable&&s.write(_)===!1&&a.pause&&a.pause()}a.on("data",l);function c(){a.readable&&a.resume&&a.resume()}s.on("drain",c),!s._isStdio&&(!o||o.end!==!1)&&(a.on("end",f),a.on("close",g));let d=!1;function f(){d||(d=!0,s.end())}function g(){d||(d=!0,typeof s.destroy=="function"&&s.destroy())}function y(_){b(),t.listenerCount(this,"error")===0&&this.emit("error",_)}n(a,"error",y),n(s,"error",y);function b(){a.removeListener("data",l),s.removeListener("drain",c),a.removeListener("end",f),a.removeListener("close",g),a.removeListener("error",y),s.removeListener("error",y),a.removeListener("end",b),a.removeListener("close",b),s.removeListener("close",b)}return a.on("end",b),a.on("close",b),s.on("close",b),s.emit("pipe",a),s};function n(s,o,a){if(typeof s.prependListener=="function")return s.prependListener(o,a);!s._events||!s._events[o]?s.on(o,a):i(s._events[o])?s._events[o].unshift(a):s._events[o]=[a,s._events[o]]}return Ho={Stream:r,prependListener:n},Ho}var Wo={exports:{}},Ad;function uo(){return Ad||(Ad=1,function(i){const{SymbolDispose:e}=nt(),{AbortError:t,codes:r}=Pt(),{isNodeStream:n,isWebStream:s,kControllerErrorFunction:o}=Wi(),a=sr(),{ERR_INVALID_ARG_TYPE:l}=r;let c;const d=(f,g)=>{if(typeof f!="object"||!("aborted"in f))throw new l(g,"AbortSignal",f)};i.exports.addAbortSignal=function(g,y){if(d(g,"signal"),!n(y)&&!s(y))throw new l("stream",["ReadableStream","WritableStream","Stream"],y);return i.exports.addAbortSignalNoValidate(g,y)},i.exports.addAbortSignalNoValidate=function(f,g){if(typeof f!="object"||!("aborted"in f))return g;const y=n(g)?()=>{g.destroy(new t(void 0,{cause:f.reason}))}:()=>{g[o](new t(void 0,{cause:f.reason}))};if(f.aborted)y();else{c=c||Ut().addAbortListener;const b=c(f,y);a(g,b[e])}return g}}(Wo)),Wo.exports}var Go,Nd;function bm(){if(Nd)return Go;Nd=1;const{StringPrototypeSlice:i,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:r}=nt(),{Buffer:n}=Hi(),{inspect:s}=Ut();return Go=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){const l={data:a,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(a){const l={data:a,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;const a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let l=this.head,c=""+l.data;for(;(l=l.next)!==null;)c+=a+l.data;return c}concat(a){if(this.length===0)return n.alloc(0);const l=n.allocUnsafe(a>>>0);let c=this.head,d=0;for(;c;)t(l,c.data,d),d+=c.data.length,c=c.next;return l}consume(a,l){const c=this.head.data;if(a<c.length){const d=c.slice(0,a);return this.head.data=c.slice(a),d}return a===c.length?this.shift():l?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[e](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let l="",c=this.head,d=0;do{const f=c.data;if(a>f.length)l+=f,a-=f.length;else{a===f.length?(l+=f,++d,c.next?this.head=c.next:this.head=this.tail=null):(l+=i(f,0,a),this.head=c,c.data=i(f,a));break}++d}while((c=c.next)!==null);return this.length-=d,l}_getBuffer(a){const l=n.allocUnsafe(a),c=a;let d=this.head,f=0;do{const g=d.data;if(a>g.length)t(l,g,c-a),a-=g.length;else{a===g.length?(t(l,g,c-a),++f,d.next?this.head=d.next:this.head=this.tail=null):(t(l,new r(g.buffer,g.byteOffset,a),c-a),this.head=d,d.data=g.slice(a));break}++f}while((d=d.next)!==null);return this.length-=f,l}[Symbol.for("nodejs.util.inspect.custom")](a,l){return s(this,{...l,depth:0,customInspect:!1})}},Go}var Ko,Ld;function ho(){if(Ld)return Ko;Ld=1;const{MathFloor:i,NumberIsInteger:e}=nt(),{validateInteger:t}=ps(),{ERR_INVALID_ARG_VALUE:r}=Pt().codes;let n=16*1024,s=16;function o(d,f,g){return d.highWaterMark!=null?d.highWaterMark:f?d[g]:null}function a(d){return d?s:n}function l(d,f){t(f,"value",0),d?s=f:n=f}function c(d,f,g,y){const b=o(f,y,g);if(b!=null){if(!e(b)||b<0){const _=y?`options.${g}`:"options.highWaterMark";throw new r(_,b)}return i(b)}return a(d.objectMode)}return Ko={getHighWaterMark:c,getDefaultHighWaterMark:a,setDefaultHighWaterMark:l},Ko}var Jo={},$s={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Dd;function vm(){return Dd||(Dd=1,function(i,e){var t=Hi(),r=t.Buffer;function n(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?i.exports=t:(n(t,e),e.Buffer=s);function s(o,a,l){return r(o,a,l)}s.prototype=Object.create(r.prototype),n(r,s),s.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},s.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=r(o);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}}($s,$s.exports)),$s.exports}var Od;function wm(){if(Od)return Jo;Od=1;var i=vm().Buffer,e=i.isEncoding||function(S){switch(S=""+S,S&&S.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 t(S){if(!S)return"utf8";for(var k;;)switch(S){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 S;default:if(k)return;S=(""+S).toLowerCase(),k=!0}}function r(S){var k=t(S);if(typeof k!="string"&&(i.isEncoding===e||!e(S)))throw new Error("Unknown encoding: "+S);return k||S}Jo.StringDecoder=n;function n(S){this.encoding=r(S);var k;switch(this.encoding){case"utf16le":this.text=f,this.end=g,k=4;break;case"utf8":this.fillLast=l,k=4;break;case"base64":this.text=y,this.end=b,k=3;break;default:this.write=_,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(k)}n.prototype.write=function(S){if(S.length===0)return"";var k,v;if(this.lastNeed){if(k=this.fillLast(S),k===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<S.length?k?k+this.text(S,v):this.text(S,v):k||""},n.prototype.end=d,n.prototype.text=c,n.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length};function s(S){return S<=127?0:S>>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function o(S,k,v){var u=k.length-1;if(u<v)return 0;var m=s(k[u]);return m>=0?(m>0&&(S.lastNeed=m-1),m):--u<v||m===-2?0:(m=s(k[u]),m>=0?(m>0&&(S.lastNeed=m-2),m):--u<v||m===-2?0:(m=s(k[u]),m>=0?(m>0&&(m===2?m=0:S.lastNeed=m-3),m):0))}function a(S,k,v){if((k[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return S.lastNeed=2,"�"}}function l(S){var k=this.lastTotal-this.lastNeed,v=a(this,S);if(v!==void 0)return v;if(this.lastNeed<=S.length)return S.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,k,0,S.length),this.lastNeed-=S.length}function c(S,k){var v=o(this,S,k);if(!this.lastNeed)return S.toString("utf8",k);this.lastTotal=v;var u=S.length-(v-this.lastNeed);return S.copy(this.lastChar,0,u),S.toString("utf8",k,u)}function d(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+"�":k}function f(S,k){if((S.length-k)%2===0){var v=S.toString("utf16le",k);if(v){var u=v.charCodeAt(v.length-1);if(u>=55296&&u<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",k,S.length-1)}function g(S){var k=S&&S.length?this.write(S):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,v)}return k}function y(S,k){var v=(S.length-k)%3;return v===0?S.toString("base64",k):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",k,S.length-v))}function b(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function _(S){return S.toString(this.encoding)}function E(S){return S&&S.length?this.write(S):""}return Jo}var Xo,Md;function mf(){if(Md)return Xo;Md=1;const i=Cr(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:r}=nt(),{Buffer:n}=Hi(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=Pt().codes;function a(l,c,d){let f;if(typeof c=="string"||c instanceof n)return new l({objectMode:!0,...d,read(){this.push(c),this.push(null)}});let g;if(c&&c[t])g=!0,f=c[t]();else if(c&&c[r])g=!1,f=c[r]();else throw new s("iterable",["Iterable"],c);const y=new l({objectMode:!0,highWaterMark:1,...d});let b=!1;y._read=function(){b||(b=!0,E())},y._destroy=function(S,k){e(_(S),()=>i.nextTick(k,S),v=>i.nextTick(k,v||S))};async function _(S){const k=S!=null,v=typeof f.throw=="function";if(k&&v){const{value:u,done:m}=await f.throw(S);if(await u,m)return}if(typeof f.return=="function"){const{value:u}=await f.return();await u}}async function E(){for(;;){try{const{value:S,done:k}=g?await f.next():f.next();if(k)y.push(null);else{const v=S&&typeof S.then=="function"?await S:S;if(v===null)throw b=!1,new o;if(y.push(v))continue;b=!1}}catch(S){y.destroy(S)}break}}return y}return Xo=a,Xo}var Qo,Pd;function fo(){if(Pd)return Qo;Pd=1;const i=Cr(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:n,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:a,Promise:l,SafeSet:c,SymbolAsyncDispose:d,SymbolAsyncIterator:f,Symbol:g}=nt();Qo=ue,ue.ReadableState=ve;const{EventEmitter:y}=co(),{Stream:b,prependListener:_}=uc(),{Buffer:E}=Hi(),{addAbortSignal:S}=uo(),k=sr();let v=Ut().debuglog("stream",M=>{v=M});const u=bm(),m=an(),{getHighWaterMark:T,getDefaultHighWaterMark:N}=ho(),{aggregateTwoErrors:$,codes:{ERR_INVALID_ARG_TYPE:j,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:P,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:I},AbortError:L}=Pt(),{validateObject:Q}=ps(),A=g("kPaused"),{StringDecoder:Y}=wm(),F=mf();a(ue.prototype,b.prototype),a(ue,b);const te=()=>{},{errorOrDestroy:x}=m,z=1,Z=2,J=4,ce=8,H=16,W=32,K=64,V=128,re=256,ne=512,ge=1024,be=2048,O=4096,G=8192,oe=16384,pe=32768,ye=65536,we=1<<17,ie=1<<18;function fe(M){return{enumerable:!1,get(){return(this.state&M)!==0},set(U){U?this.state|=M:this.state&=~M}}}s(ve.prototype,{objectMode:fe(z),ended:fe(Z),endEmitted:fe(J),reading:fe(ce),constructed:fe(H),sync:fe(W),needReadable:fe(K),emittedReadable:fe(V),readableListening:fe(re),resumeScheduled:fe(ne),errorEmitted:fe(ge),emitClose:fe(be),autoDestroy:fe(O),destroyed:fe(G),closed:fe(oe),closeEmitted:fe(pe),multiAwaitDrain:fe(ye),readingMore:fe(we),dataEmitted:fe(ie)});function ve(M,U,_e){typeof _e!="boolean"&&(_e=U instanceof ji()),this.state=be|O|H|W,M&&M.objectMode&&(this.state|=z),_e&&M&&M.readableObjectMode&&(this.state|=z),this.highWaterMark=M?T(this,M,"readableHighWaterMark",_e):N(!1),this.buffer=new u,this.length=0,this.pipes=[],this.flowing=null,this[A]=null,M&&M.emitClose===!1&&(this.state&=~be),M&&M.autoDestroy===!1&&(this.state&=~O),this.errored=null,this.defaultEncoding=M&&M.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,M&&M.encoding&&(this.decoder=new Y(M.encoding),this.encoding=M.encoding)}function ue(M){if(!(this instanceof ue))return new ue(M);const U=this instanceof ji();this._readableState=new ve(M,this,U),M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy),typeof M.construct=="function"&&(this._construct=M.construct),M.signal&&!U&&S(M.signal,this)),b.call(this,M),m.construct(this,()=>{this._readableState.needReadable&&ee(this,this._readableState)})}ue.prototype.destroy=m.destroy,ue.prototype._undestroy=m.undestroy,ue.prototype._destroy=function(M,U){U(M)},ue.prototype[y.captureRejectionSymbol]=function(M){this.destroy(M)},ue.prototype[d]=function(){let M;return this.destroyed||(M=this.readableEnded?null:new L,this.destroy(M)),new l((U,_e)=>k(this,xe=>xe&&xe!==M?_e(xe):U(null)))},ue.prototype.push=function(M,U){return Ve(this,M,U,!1)},ue.prototype.unshift=function(M,U){return Ve(this,M,U,!0)};function Ve(M,U,_e,xe){v("readableAddChunk",U);const ke=M._readableState;let It;if((ke.state&z)===0&&(typeof U=="string"?(_e=_e||ke.defaultEncoding,ke.encoding!==_e&&(xe&&ke.encoding?U=E.from(U,_e).toString(ke.encoding):(U=E.from(U,_e),_e=""))):U instanceof E?_e="":b._isUint8Array(U)?(U=b._uint8ArrayToBuffer(U),_e=""):U!=null&&(It=new j("chunk",["string","Buffer","Uint8Array"],U))),It)x(M,It);else if(U===null)ke.state&=~ce,h(M,ke);else if((ke.state&z)!==0||U&&U.length>0)if(xe)if((ke.state&J)!==0)x(M,new I);else{if(ke.destroyed||ke.errored)return!1;kt(M,ke,U,!0)}else if(ke.ended)x(M,new q);else{if(ke.destroyed||ke.errored)return!1;ke.state&=~ce,ke.decoder&&!_e?(U=ke.decoder.write(U),ke.objectMode||U.length!==0?kt(M,ke,U,!1):ee(M,ke)):kt(M,ke,U,!1)}else xe||(ke.state&=~ce,ee(M,ke));return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function kt(M,U,_e,xe){U.flowing&&U.length===0&&!U.sync&&M.listenerCount("data")>0?((U.state&ye)!==0?U.awaitDrainWriters.clear():U.awaitDrainWriters=null,U.dataEmitted=!0,M.emit("data",_e)):(U.length+=U.objectMode?1:_e.length,xe?U.buffer.unshift(_e):U.buffer.push(_e),(U.state&K)!==0&&p(M)),ee(M,U)}ue.prototype.isPaused=function(){const M=this._readableState;return M[A]===!0||M.flowing===!1},ue.prototype.setEncoding=function(M){const U=new Y(M);this._readableState.decoder=U,this._readableState.encoding=this._readableState.decoder.encoding;const _e=this._readableState.buffer;let xe="";for(const ke of _e)xe+=U.write(ke);return _e.clear(),xe!==""&&_e.push(xe),this._readableState.length=xe.length,this};const je=1073741824;function Ct(M){if(M>je)throw new P("size","<= 1GiB",M);return M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++,M}function C(M,U){return M<=0||U.length===0&&U.ended?0:(U.state&z)!==0?1:r(M)?U.flowing&&U.length?U.buffer.first().length:U.length:M<=U.length?M:U.ended?U.length:0}ue.prototype.read=function(M){v("read",M),M===void 0?M=NaN:t(M)||(M=n(M,10));const U=this._readableState,_e=M;if(M>U.highWaterMark&&(U.highWaterMark=Ct(M)),M!==0&&(U.state&=~V),M===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return v("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?To(this):p(this),null;if(M=C(M,U),M===0&&U.ended)return U.length===0&&To(this),null;let xe=(U.state&K)!==0;if(v("need readable",xe),(U.length===0||U.length-M<U.highWaterMark)&&(xe=!0,v("length less than watermark",xe)),U.ended||U.reading||U.destroyed||U.errored||!U.constructed)xe=!1,v("reading, ended or constructing",xe);else if(xe){v("do read"),U.state|=ce|W,U.length===0&&(U.state|=K);try{this._read(U.highWaterMark)}catch(It){x(this,It)}U.state&=~W,U.reading||(M=C(_e,U))}let ke;return M>0?ke=rd(M,U):ke=null,ke===null?(U.needReadable=U.length<=U.highWaterMark,M=0):(U.length-=M,U.multiAwaitDrain?U.awaitDrainWriters.clear():U.awaitDrainWriters=null),U.length===0&&(U.ended||(U.needReadable=!0),_e!==M&&U.ended&&To(this)),ke!==null&&!U.errorEmitted&&!U.closeEmitted&&(U.dataEmitted=!0,this.emit("data",ke)),ke};function h(M,U){if(v("onEofChunk"),!U.ended){if(U.decoder){const _e=U.decoder.end();_e&&_e.length&&(U.buffer.push(_e),U.length+=U.objectMode?1:_e.length)}U.ended=!0,U.sync?p(M):(U.needReadable=!1,U.emittedReadable=!0,B(M))}}function p(M){const U=M._readableState;v("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(v("emitReadable",U.flowing),U.emittedReadable=!0,i.nextTick(B,M))}function B(M){const U=M._readableState;v("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&!U.errored&&(U.length||U.ended)&&(M.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,ze(M)}function ee(M,U){!U.readingMore&&U.constructed&&(U.readingMore=!0,i.nextTick(le,M,U))}function le(M,U){for(;!U.reading&&!U.ended&&(U.length<U.highWaterMark||U.flowing&&U.length===0);){const _e=U.length;if(v("maybeReadMore read 0"),M.read(0),_e===U.length)break}U.readingMore=!1}ue.prototype._read=function(M){throw new R("_read()")},ue.prototype.pipe=function(M,U){const _e=this,xe=this._readableState;xe.pipes.length===1&&(xe.multiAwaitDrain||(xe.multiAwaitDrain=!0,xe.awaitDrainWriters=new c(xe.awaitDrainWriters?[xe.awaitDrainWriters]:[]))),xe.pipes.push(M),v("pipe count=%d opts=%j",xe.pipes.length,U);const It=(!U||U.end!==!1)&&M!==i.stdout&&M!==i.stderr?sd:pn;xe.endEmitted?i.nextTick(It):_e.once("end",It),M.on("unpipe",si);function si(fr,Oi){v("onunpipe"),fr===_e&&Oi&&Oi.hasUnpiped===!1&&(Oi.hasUnpiped=!0,Xp())}function sd(){v("onend"),M.end()}let hr,od=!1;function Xp(){v("cleanup"),M.removeListener("close",Ao),M.removeListener("finish",No),hr&&M.removeListener("drain",hr),M.removeListener("error",Co),M.removeListener("unpipe",si),_e.removeListener("end",sd),_e.removeListener("end",pn),_e.removeListener("data",ld),od=!0,hr&&xe.awaitDrainWriters&&(!M._writableState||M._writableState.needDrain)&&hr()}function ad(){od||(xe.pipes.length===1&&xe.pipes[0]===M?(v("false write response, pause",0),xe.awaitDrainWriters=M,xe.multiAwaitDrain=!1):xe.pipes.length>1&&xe.pipes.includes(M)&&(v("false write response, pause",xe.awaitDrainWriters.size),xe.awaitDrainWriters.add(M)),_e.pause()),hr||(hr=he(_e,M),M.on("drain",hr))}_e.on("data",ld);function ld(fr){v("ondata");const Oi=M.write(fr);v("dest.write",Oi),Oi===!1&&ad()}function Co(fr){if(v("onerror",fr),pn(),M.removeListener("error",Co),M.listenerCount("error")===0){const Oi=M._writableState||M._readableState;Oi&&!Oi.errorEmitted?x(M,fr):M.emit("error",fr)}}_(M,"error",Co);function Ao(){M.removeListener("finish",No),pn()}M.once("close",Ao);function No(){v("onfinish"),M.removeListener("close",Ao),pn()}M.once("finish",No);function pn(){v("unpipe"),_e.unpipe(M)}return M.emit("pipe",_e),M.writableNeedDrain===!0?ad():xe.flowing||(v("pipe resume"),_e.resume()),M};function he(M,U){return function(){const xe=M._readableState;xe.awaitDrainWriters===U?(v("pipeOnDrain",1),xe.awaitDrainWriters=null):xe.multiAwaitDrain&&(v("pipeOnDrain",xe.awaitDrainWriters.size),xe.awaitDrainWriters.delete(U)),(!xe.awaitDrainWriters||xe.awaitDrainWriters.size===0)&&M.listenerCount("data")&&M.resume()}}ue.prototype.unpipe=function(M){const U=this._readableState,_e={hasUnpiped:!1};if(U.pipes.length===0)return this;if(!M){const ke=U.pipes;U.pipes=[],this.pause();for(let It=0;It<ke.length;It++)ke[It].emit("unpipe",this,{hasUnpiped:!1});return this}const xe=e(U.pipes,M);return xe===-1?this:(U.pipes.splice(xe,1),U.pipes.length===0&&this.pause(),M.emit("unpipe",this,_e),this)},ue.prototype.on=function(M,U){const _e=b.prototype.on.call(this,M,U),xe=this._readableState;return M==="data"?(xe.readableListening=this.listenerCount("readable")>0,xe.flowing!==!1&&this.resume()):M==="readable"&&!xe.endEmitted&&!xe.readableListening&&(xe.readableListening=xe.needReadable=!0,xe.flowing=!1,xe.emittedReadable=!1,v("on readable",xe.length,xe.reading),xe.length?p(this):xe.reading||i.nextTick(et,this)),_e},ue.prototype.addListener=ue.prototype.on,ue.prototype.removeListener=function(M,U){const _e=b.prototype.removeListener.call(this,M,U);return M==="readable"&&i.nextTick(Pe,this),_e},ue.prototype.off=ue.prototype.removeListener,ue.prototype.removeAllListeners=function(M){const U=b.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&i.nextTick(Pe,this),U};function Pe(M){const U=M._readableState;U.readableListening=M.listenerCount("readable")>0,U.resumeScheduled&&U[A]===!1?U.flowing=!0:M.listenerCount("data")>0?M.resume():U.readableListening||(U.flowing=null)}function et(M){v("readable nexttick read 0"),M.read(0)}ue.prototype.resume=function(){const M=this._readableState;return M.flowing||(v("resume"),M.flowing=!M.readableListening,Qe(this,M)),M[A]=!1,this};function Qe(M,U){U.resumeScheduled||(U.resumeScheduled=!0,i.nextTick(tt,M,U))}function tt(M,U){v("resume",U.reading),U.reading||M.read(0),U.resumeScheduled=!1,M.emit("resume"),ze(M),U.flowing&&!U.reading&&M.read(0)}ue.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[A]=!0,this};function ze(M){const U=M._readableState;for(v("flow",U.flowing);U.flowing&&M.read()!==null;);}ue.prototype.wrap=function(M){let U=!1;M.on("data",xe=>{!this.push(xe)&&M.pause&&(U=!0,M.pause())}),M.on("end",()=>{this.push(null)}),M.on("error",xe=>{x(this,xe)}),M.on("close",()=>{this.destroy()}),M.on("destroy",()=>{this.destroy()}),this._read=()=>{U&&M.resume&&(U=!1,M.resume())};const _e=o(M);for(let xe=1;xe<_e.length;xe++){const ke=_e[xe];this[ke]===void 0&&typeof M[ke]=="function"&&(this[ke]=M[ke].bind(M))}return this},ue.prototype[f]=function(){return id(this)},ue.prototype.iterator=function(M){return M!==void 0&&Q(M,"options"),id(this,M)};function id(M,U){typeof M.read!="function"&&(M=ue.wrap(M,{objectMode:!0}));const _e=Gp(M,U);return _e.stream=M,_e}async function*Gp(M,U){let _e=te;function xe(si){this===M?(_e(),_e=te):_e=si}M.on("readable",xe);let ke;const It=k(M,{writable:!1},si=>{ke=si?$(ke,si):null,_e(),_e=te});try{for(;;){const si=M.destroyed?null:M.read();if(si!==null)yield si;else{if(ke)throw ke;if(ke===null)return;await new l(xe)}}}catch(si){throw ke=$(ke,si),ke}finally{(ke||(U==null?void 0:U.destroyOnReturn)!==!1)&&(ke===void 0||M._readableState.autoDestroy)?m.destroyer(M,null):(M.off("readable",xe),It())}}s(ue.prototype,{readable:{__proto__:null,get(){const M=this._readableState;return!!M&&M.readable!==!1&&!M.destroyed&&!M.errorEmitted&&!M.endEmitted},set(M){this._readableState&&(this._readableState.readable=!!M)}},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(M){this._readableState&&(this._readableState.flowing=M)}},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(M){this._readableState&&(this._readableState.destroyed=M)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ve.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[A]!==!1},set(M){this[A]=!!M}}}),ue._fromList=rd;function rd(M,U){if(U.length===0)return null;let _e;return U.objectMode?_e=U.buffer.shift():!M||M>=U.length?(U.decoder?_e=U.buffer.join(""):U.buffer.length===1?_e=U.buffer.first():_e=U.buffer.concat(U.length),U.buffer.clear()):_e=U.buffer.consume(M,U.decoder),_e}function To(M){const U=M._readableState;v("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,i.nextTick(Kp,U,M))}function Kp(M,U){if(v("endReadableNT",M.endEmitted,M.length),!M.errored&&!M.closeEmitted&&!M.endEmitted&&M.length===0){if(M.endEmitted=!0,U.emit("end"),U.writable&&U.allowHalfOpen===!1)i.nextTick(Jp,U);else if(M.autoDestroy){const _e=U._writableState;(!_e||_e.autoDestroy&&(_e.finished||_e.writable===!1))&&U.destroy()}}}function Jp(M){M.writable&&!M.writableEnded&&!M.destroyed&&M.end()}ue.from=function(M,U){return F(ue,M,U)};let $o;function nd(){return $o===void 0&&($o={}),$o}return ue.fromWeb=function(M,U){return nd().newStreamReadableFromReadableStream(M,U)},ue.toWeb=function(M,U){return nd().newReadableStreamFromStreamReadable(M,U)},ue.wrap=function(M,U){var _e,xe;return new ue({objectMode:(_e=(xe=M.readableObjectMode)!==null&&xe!==void 0?xe:M.objectMode)!==null&&_e!==void 0?_e:!0,...U,destroy(ke,It){m.destroyer(M,ke),It(ke)}}).wrap(M)},Qo}var Yo,jd;function hc(){if(jd)return Yo;jd=1;const i=Cr(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:n,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:a,Symbol:l,SymbolHasInstance:c}=nt();Yo=Q,Q.WritableState=I;const{EventEmitter:d}=co(),f=uc().Stream,{Buffer:g}=Hi(),y=an(),{addAbortSignal:b}=uo(),{getHighWaterMark:_,getDefaultHighWaterMark:E}=ho(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:u,ERR_STREAM_DESTROYED:m,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:N,ERR_STREAM_WRITE_AFTER_END:$,ERR_UNKNOWN_ENCODING:j}=Pt().codes,{errorOrDestroy:R}=y;o(Q.prototype,f.prototype),o(Q,f);function P(){}const q=l("kOnFinished");function I(O,G,oe){typeof oe!="boolean"&&(oe=G instanceof ji()),this.objectMode=!!(O&&O.objectMode),oe&&(this.objectMode=this.objectMode||!!(O&&O.writableObjectMode)),this.highWaterMark=O?_(this,O,"writableHighWaterMark",oe):E(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const pe=!!(O&&O.decodeStrings===!1);this.decodeStrings=!pe,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=x.bind(void 0,G),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,L(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!O||O.emitClose!==!1,this.autoDestroy=!O||O.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function L(O){O.buffered=[],O.bufferedIndex=0,O.allBuffers=!0,O.allNoop=!0}I.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},n(I.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Q(O){const G=this instanceof ji();if(!G&&!r(Q,this))return new Q(O);this._writableState=new I(O,this,G),O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final),typeof O.construct=="function"&&(this._construct=O.construct),O.signal&&b(O.signal,this)),f.call(this,O),y.construct(this,()=>{const oe=this._writableState;oe.writing||ce(this,oe),V(this,oe)})}n(Q,c,{__proto__:null,value:function(O){return r(this,O)?!0:this!==Q?!1:O&&O._writableState instanceof I}}),Q.prototype.pipe=function(){R(this,new u)};function A(O,G,oe,pe){const ye=O._writableState;if(typeof oe=="function")pe=oe,oe=ye.defaultEncoding;else{if(!oe)oe=ye.defaultEncoding;else if(oe!=="buffer"&&!g.isEncoding(oe))throw new j(oe);typeof pe!="function"&&(pe=P)}if(G===null)throw new N;if(!ye.objectMode)if(typeof G=="string")ye.decodeStrings!==!1&&(G=g.from(G,oe),oe="buffer");else if(G instanceof g)oe="buffer";else if(f._isUint8Array(G))G=f._uint8ArrayToBuffer(G),oe="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],G);let we;return ye.ending?we=new $:ye.destroyed&&(we=new m("write")),we?(i.nextTick(pe,we),R(O,we,!0),we):(ye.pendingcb++,Y(O,ye,G,oe,pe))}Q.prototype.write=function(O,G,oe){return A(this,O,G,oe)===!0},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){const O=this._writableState;O.corked&&(O.corked--,O.writing||ce(this,O))},Q.prototype.setDefaultEncoding=function(G){if(typeof G=="string"&&(G=a(G)),!g.isEncoding(G))throw new j(G);return this._writableState.defaultEncoding=G,this};function Y(O,G,oe,pe,ye){const we=G.objectMode?1:oe.length;G.length+=we;const ie=G.length<G.highWaterMark;return ie||(G.needDrain=!0),G.writing||G.corked||G.errored||!G.constructed?(G.buffered.push({chunk:oe,encoding:pe,callback:ye}),G.allBuffers&&pe!=="buffer"&&(G.allBuffers=!1),G.allNoop&&ye!==P&&(G.allNoop=!1)):(G.writelen=we,G.writecb=ye,G.writing=!0,G.sync=!0,O._write(oe,pe,G.onwrite),G.sync=!1),ie&&!G.errored&&!G.destroyed}function F(O,G,oe,pe,ye,we,ie){G.writelen=pe,G.writecb=ie,G.writing=!0,G.sync=!0,G.destroyed?G.onwrite(new m("write")):oe?O._writev(ye,G.onwrite):O._write(ye,we,G.onwrite),G.sync=!1}function te(O,G,oe,pe){--G.pendingcb,pe(oe),J(G),R(O,oe)}function x(O,G){const oe=O._writableState,pe=oe.sync,ye=oe.writecb;if(typeof ye!="function"){R(O,new v);return}oe.writing=!1,oe.writecb=null,oe.length-=oe.writelen,oe.writelen=0,G?(G.stack,oe.errored||(oe.errored=G),O._readableState&&!O._readableState.errored&&(O._readableState.errored=G),pe?i.nextTick(te,O,oe,G,ye):te(O,oe,G,ye)):(oe.buffered.length>oe.bufferedIndex&&ce(O,oe),pe?oe.afterWriteTickInfo!==null&&oe.afterWriteTickInfo.cb===ye?oe.afterWriteTickInfo.count++:(oe.afterWriteTickInfo={count:1,cb:ye,stream:O,state:oe},i.nextTick(z,oe.afterWriteTickInfo)):Z(O,oe,1,ye))}function z({stream:O,state:G,count:oe,cb:pe}){return G.afterWriteTickInfo=null,Z(O,G,oe,pe)}function Z(O,G,oe,pe){for(!G.ending&&!O.destroyed&&G.length===0&&G.needDrain&&(G.needDrain=!1,O.emit("drain"));oe-- >0;)G.pendingcb--,pe();G.destroyed&&J(G),V(O,G)}function J(O){if(O.writing)return;for(let ye=O.bufferedIndex;ye<O.buffered.length;++ye){var G;const{chunk:we,callback:ie}=O.buffered[ye],fe=O.objectMode?1:we.length;O.length-=fe,ie((G=O.errored)!==null&&G!==void 0?G:new m("write"))}const oe=O[q].splice(0);for(let ye=0;ye<oe.length;ye++){var pe;oe[ye]((pe=O.errored)!==null&&pe!==void 0?pe:new m("end"))}L(O)}function ce(O,G){if(G.corked||G.bufferProcessing||G.destroyed||!G.constructed)return;const{buffered:oe,bufferedIndex:pe,objectMode:ye}=G,we=oe.length-pe;if(!we)return;let ie=pe;if(G.bufferProcessing=!0,we>1&&O._writev){G.pendingcb-=we-1;const fe=G.allNoop?P:ue=>{for(let Ve=ie;Ve<oe.length;++Ve)oe[Ve].callback(ue)},ve=G.allNoop&&ie===0?oe:e(oe,ie);ve.allBuffers=G.allBuffers,F(O,G,!0,G.length,ve,"",fe),L(G)}else{do{const{chunk:fe,encoding:ve,callback:ue}=oe[ie];oe[ie++]=null;const Ve=ye?1:fe.length;F(O,G,!1,Ve,fe,ve,ue)}while(ie<oe.length&&!G.writing);ie===oe.length?L(G):ie>256?(oe.splice(0,ie),G.bufferedIndex=0):G.bufferedIndex=ie}G.bufferProcessing=!1}Q.prototype._write=function(O,G,oe){if(this._writev)this._writev([{chunk:O,encoding:G}],oe);else throw new k("_write()")},Q.prototype._writev=null,Q.prototype.end=function(O,G,oe){const pe=this._writableState;typeof O=="function"?(oe=O,O=null,G=null):typeof G=="function"&&(oe=G,G=null);let ye;if(O!=null){const we=A(this,O,G);we instanceof t&&(ye=we)}return pe.corked&&(pe.corked=1,this.uncork()),ye||(!pe.errored&&!pe.ending?(pe.ending=!0,V(this,pe,!0),pe.ended=!0):pe.finished?ye=new T("end"):pe.destroyed&&(ye=new m("end"))),typeof oe=="function"&&(ye||pe.finished?i.nextTick(oe,ye):pe[q].push(oe)),this};function H(O){return O.ending&&!O.destroyed&&O.constructed&&O.length===0&&!O.errored&&O.buffered.length===0&&!O.finished&&!O.writing&&!O.errorEmitted&&!O.closeEmitted}function W(O,G){let oe=!1;function pe(ye){if(oe){R(O,ye??v());return}if(oe=!0,G.pendingcb--,ye){const we=G[q].splice(0);for(let ie=0;ie<we.length;ie++)we[ie](ye);R(O,ye,G.sync)}else H(G)&&(G.prefinished=!0,O.emit("prefinish"),G.pendingcb++,i.nextTick(re,O,G))}G.sync=!0,G.pendingcb++;try{O._final(pe)}catch(ye){pe(ye)}G.sync=!1}function K(O,G){!G.prefinished&&!G.finalCalled&&(typeof O._final=="function"&&!G.destroyed?(G.finalCalled=!0,W(O,G)):(G.prefinished=!0,O.emit("prefinish")))}function V(O,G,oe){H(G)&&(K(O,G),G.pendingcb===0&&(oe?(G.pendingcb++,i.nextTick((pe,ye)=>{H(ye)?re(pe,ye):ye.pendingcb--},O,G)):H(G)&&(G.pendingcb++,re(O,G))))}function re(O,G){G.pendingcb--,G.finished=!0;const oe=G[q].splice(0);for(let pe=0;pe<oe.length;pe++)oe[pe]();if(O.emit("finish"),G.autoDestroy){const pe=O._readableState;(!pe||pe.autoDestroy&&(pe.endEmitted||pe.readable===!1))&&O.destroy()}}s(Q.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(O){this._writableState&&(this._writableState.destroyed=O)}},writable:{__proto__:null,get(){const O=this._writableState;return!!O&&O.writable!==!1&&!O.destroyed&&!O.errored&&!O.ending&&!O.ended},set(O){this._writableState&&(this._writableState.writable=!!O)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const O=this._writableState;return O?!O.destroyed&&!O.ending&&O.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ne=y.destroy;Q.prototype.destroy=function(O,G){const oe=this._writableState;return!oe.destroyed&&(oe.bufferedIndex<oe.buffered.length||oe[q].length)&&i.nextTick(J,oe),ne.call(this,O,G),this},Q.prototype._undestroy=y.undestroy,Q.prototype._destroy=function(O,G){G(O)},Q.prototype[d.captureRejectionSymbol]=function(O){this.destroy(O)};let ge;function be(){return ge===void 0&&(ge={}),ge}return Q.fromWeb=function(O,G){return be().newStreamWritableFromWritableStream(O,G)},Q.toWeb=function(O){return be().newWritableStreamFromStreamWritable(O)},Yo}var Zo,Bd;function _m(){if(Bd)return Zo;Bd=1;const i=Cr(),e=Hi(),{isReadable:t,isWritable:r,isIterable:n,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:a,isDuplexNodeStream:l,isReadableStream:c,isWritableStream:d}=Wi(),f=sr(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:b}}=Pt(),{destroyer:_}=an(),E=ji(),S=fo(),k=hc(),{createDeferredPromise:v}=Ut(),u=mf(),m=globalThis.Blob||e.Blob,T=typeof m<"u"?function(I){return I instanceof m}:function(I){return!1},N=globalThis.AbortController||ts().AbortController,{FunctionPrototypeCall:$}=nt();class j extends E{constructor(I){super(I),(I==null?void 0:I.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(I==null?void 0:I.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Zo=function q(I,L){if(l(I))return I;if(o(I))return P({readable:I});if(a(I))return P({writable:I});if(s(I))return P({writable:!1,readable:!1});if(c(I))return P({readable:S.fromWeb(I)});if(d(I))return P({writable:k.fromWeb(I)});if(typeof I=="function"){const{value:A,write:Y,final:F,destroy:te}=R(I);if(n(A))return u(j,A,{objectMode:!0,write:Y,final:F,destroy:te});const x=A==null?void 0:A.then;if(typeof x=="function"){let z;const Z=$(x,A,J=>{if(J!=null)throw new b("nully","body",J)},J=>{_(z,J)});return z=new j({objectMode:!0,readable:!1,write:Y,final(J){F(async()=>{try{await Z,i.nextTick(J,null)}catch(ce){i.nextTick(J,ce)}})},destroy:te})}throw new b("Iterable, AsyncIterable or AsyncFunction",L,A)}if(T(I))return q(I.arrayBuffer());if(n(I))return u(j,I,{objectMode:!0,writable:!1});if(c(I==null?void 0:I.readable)&&d(I==null?void 0:I.writable))return j.fromWeb(I);if(typeof(I==null?void 0:I.writable)=="object"||typeof(I==null?void 0:I.readable)=="object"){const A=I!=null&&I.readable?o(I==null?void 0:I.readable)?I==null?void 0:I.readable:q(I.readable):void 0,Y=I!=null&&I.writable?a(I==null?void 0:I.writable)?I==null?void 0:I.writable:q(I.writable):void 0;return P({readable:A,writable:Y})}const Q=I==null?void 0:I.then;if(typeof Q=="function"){let A;return $(Q,I,Y=>{Y!=null&&A.push(Y),A.push(null)},Y=>{_(A,Y)}),A=new j({objectMode:!0,writable:!1,read(){}})}throw new y(L,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],I)};function R(q){let{promise:I,resolve:L}=v();const Q=new N,A=Q.signal;return{value:q(async function*(){for(;;){const F=I;I=null;const{chunk:te,done:x,cb:z}=await F;if(i.nextTick(z),x)return;if(A.aborted)throw new g(void 0,{cause:A.reason});({promise:I,resolve:L}=v()),yield te}}(),{signal:A}),write(F,te,x){const z=L;L=null,z({chunk:F,done:!1,cb:x})},final(F){const te=L;L=null,te({done:!0,cb:F})},destroy(F,te){Q.abort(),te(F)}}}function P(q){const I=q.readable&&typeof q.readable.read!="function"?S.wrap(q.readable):q.readable,L=q.writable;let Q=!!t(I),A=!!r(L),Y,F,te,x,z;function Z(J){const ce=x;x=null,ce?ce(J):J&&z.destroy(J)}return z=new j({readableObjectMode:!!(I!=null&&I.readableObjectMode),writableObjectMode:!!(L!=null&&L.writableObjectMode),readable:Q,writable:A}),A&&(f(L,J=>{A=!1,J&&_(I,J),Z(J)}),z._write=function(J,ce,H){L.write(J,ce)?H():Y=H},z._final=function(J){L.end(),F=J},L.on("drain",function(){if(Y){const J=Y;Y=null,J()}}),L.on("finish",function(){if(F){const J=F;F=null,J()}})),Q&&(f(I,J=>{Q=!1,J&&_(I,J),Z(J)}),I.on("readable",function(){if(te){const J=te;te=null,J()}}),I.on("end",function(){z.push(null)}),z._read=function(){for(;;){const J=I.read();if(J===null){te=z._read;return}if(!z.push(J))return}}),z._destroy=function(J,ce){!J&&x!==null&&(J=new g),te=null,Y=null,F=null,x===null?ce(J):(x=ce,_(L,J),_(I,J))},z}return Zo}var ea,Fd;function ji(){if(Fd)return ea;Fd=1;const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=nt();ea=o;const n=fo(),s=hc();r(o.prototype,n.prototype),r(o,n);{const d=t(s.prototype);for(let f=0;f<d.length;f++){const g=d[f];o.prototype[g]||(o.prototype[g]=s.prototype[g])}}function o(d){if(!(this instanceof o))return new o(d);n.call(this,d),s.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}i(o.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});let a;function l(){return a===void 0&&(a={}),a}o.fromWeb=function(d,f){return l().newStreamDuplexFromReadableWritablePair(d,f)},o.toWeb=function(d){return l().newReadableWritablePairFromDuplex(d)};let c;return o.from=function(d){return c||(c=_m()),c(d,"body")},ea}var ta,qd;function gf(){if(qd)return ta;qd=1;const{ObjectSetPrototypeOf:i,Symbol:e}=nt();ta=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Pt().codes,r=ji(),{getHighWaterMark:n}=ho();i(o.prototype,r.prototype),i(o,r);const s=e("kCallback");function o(c){if(!(this instanceof o))return new o(c);const d=c?n(this,c,"readableHighWaterMark",!0):null;d===0&&(c={...c,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:c.writableHighWaterMark||0}),r.call(this,c),this._readableState.sync=!1,this[s]=null,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",l)}function a(c){typeof this._flush=="function"&&!this.destroyed?this._flush((d,f)=>{if(d){c?c(d):this.destroy(d);return}f!=null&&this.push(f),this.push(null),c&&c()}):(this.push(null),c&&c())}function l(){this._final!==a&&a.call(this)}return o.prototype._final=a,o.prototype._transform=function(c,d,f){throw new t("_transform()")},o.prototype._write=function(c,d,f){const g=this._readableState,y=this._writableState,b=g.length;this._transform(c,d,(_,E)=>{if(_){f(_);return}E!=null&&this.push(E),y.ended||b===g.length||g.length<g.highWaterMark?f():this[s]=f})},o.prototype._read=function(){if(this[s]){const c=this[s];this[s]=null,c()}},ta}var ia,Ud;function yf(){if(Ud)return ia;Ud=1;const{ObjectSetPrototypeOf:i}=nt();ia=t;const e=gf();i(t.prototype,e.prototype),i(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,n,s){s(null,r)},ia}var ra,Vd;function fc(){if(Vd)return ra;Vd=1;const i=Cr(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:r,SymbolDispose:n}=nt(),s=sr(),{once:o}=Ut(),a=an(),l=ji(),{aggregateTwoErrors:c,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:_}=Pt(),{validateFunction:E,validateAbortSignal:S}=ps(),{isIterable:k,isReadable:v,isReadableNodeStream:u,isNodeStream:m,isTransformStream:T,isWebStream:N,isReadableStream:$,isReadableFinished:j}=Wi(),R=globalThis.AbortController||ts().AbortController;let P,q,I;function L(J,ce,H){let W=!1;J.on("close",()=>{W=!0});const K=s(J,{readable:ce,writable:H},V=>{W=!V});return{destroy:V=>{W||(W=!0,a.destroyer(J,V||new y("pipe")))},cleanup:K}}function Q(J){return E(J[J.length-1],"streams[stream.length - 1]"),J.pop()}function A(J){if(k(J))return J;if(u(J))return Y(J);throw new d("val",["Readable","Iterable","AsyncIterable"],J)}async function*Y(J){q||(q=fo()),yield*q.prototype[r].call(J)}async function F(J,ce,H,{end:W}){let K,V=null;const re=be=>{if(be&&(K=be),V){const O=V;V=null,O()}},ne=()=>new t((be,O)=>{K?O(K):V=()=>{K?O(K):be()}});ce.on("drain",re);const ge=s(ce,{readable:!1},re);try{ce.writableNeedDrain&&await ne();for await(const be of J)ce.write(be)||await ne();W&&(ce.end(),await ne()),H()}catch(be){H(K!==be?c(K,be):be)}finally{ge(),ce.off("drain",re)}}async function te(J,ce,H,{end:W}){T(ce)&&(ce=ce.writable);const K=ce.getWriter();try{for await(const V of J)await K.ready,K.write(V).catch(()=>{});await K.ready,W&&await K.close(),H()}catch(V){try{await K.abort(V),H(V)}catch(re){H(re)}}}function x(...J){return z(J,o(Q(J)))}function z(J,ce,H){if(J.length===1&&e(J[0])&&(J=J[0]),J.length<2)throw new g("streams");const W=new R,K=W.signal,V=H==null?void 0:H.signal,re=[];S(V,"options.signal");function ne(){ye(new _)}I=I||Ut().addAbortListener;let ge;V&&(ge=I(V,ne));let be,O;const G=[];let oe=0;function pe(ve){ye(ve,--oe===0)}function ye(ve,ue){var Ve;if(ve&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=ve),!(!be&&!ue)){for(;G.length;)G.shift()(be);(Ve=ge)===null||Ve===void 0||Ve[n](),W.abort(),ue&&(be||re.forEach(kt=>kt()),i.nextTick(ce,be,O))}}let we;for(let ve=0;ve<J.length;ve++){const ue=J[ve],Ve=ve<J.length-1,kt=ve>0,je=Ve||(H==null?void 0:H.end)!==!1,Ct=ve===J.length-1;if(m(ue)){let C=function(h){h&&h.name!=="AbortError"&&h.code!=="ERR_STREAM_PREMATURE_CLOSE"&&pe(h)};if(je){const{destroy:h,cleanup:p}=L(ue,Ve,kt);G.push(h),v(ue)&&Ct&&re.push(p)}ue.on("error",C),v(ue)&&Ct&&re.push(()=>{ue.removeListener("error",C)})}if(ve===0)if(typeof ue=="function"){if(we=ue({signal:K}),!k(we))throw new f("Iterable, AsyncIterable or Stream","source",we)}else k(ue)||u(ue)||T(ue)?we=ue:we=l.from(ue);else if(typeof ue=="function"){if(T(we)){var ie;we=A((ie=we)===null||ie===void 0?void 0:ie.readable)}else we=A(we);if(we=ue(we,{signal:K}),Ve){if(!k(we,!0))throw new f("AsyncIterable",`transform[${ve-1}]`,we)}else{var fe;P||(P=yf());const C=new P({objectMode:!0}),h=(fe=we)===null||fe===void 0?void 0:fe.then;if(typeof h=="function")oe++,h.call(we,ee=>{O=ee,ee!=null&&C.write(ee),je&&C.end(),i.nextTick(pe)},ee=>{C.destroy(ee),i.nextTick(pe,ee)});else if(k(we,!0))oe++,F(we,C,pe,{end:je});else if($(we)||T(we)){const ee=we.readable||we;oe++,F(ee,C,pe,{end:je})}else throw new f("AsyncIterable or Promise","destination",we);we=C;const{destroy:p,cleanup:B}=L(we,!1,!0);G.push(p),Ct&&re.push(B)}}else if(m(ue)){if(u(we)){oe+=2;const C=Z(we,ue,pe,{end:je});v(ue)&&Ct&&re.push(C)}else if(T(we)||$(we)){const C=we.readable||we;oe++,F(C,ue,pe,{end:je})}else if(k(we))oe++,F(we,ue,pe,{end:je});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],we);we=ue}else if(N(ue)){if(u(we))oe++,te(A(we),ue,pe,{end:je});else if($(we)||k(we))oe++,te(we,ue,pe,{end:je});else if(T(we))oe++,te(we.readable,ue,pe,{end:je});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],we);we=ue}else we=l.from(ue)}return(K!=null&&K.aborted||V!=null&&V.aborted)&&i.nextTick(ne),we}function Z(J,ce,H,{end:W}){let K=!1;if(ce.on("close",()=>{K||H(new b)}),J.pipe(ce,{end:!1}),W){let V=function(){K=!0,ce.end()};j(J)?i.nextTick(V):J.once("end",V)}else H();return s(J,{readable:!0,writable:!1},V=>{const re=J._readableState;V&&V.code==="ERR_STREAM_PREMATURE_CLOSE"&&re&&re.ended&&!re.errored&&!re.errorEmitted?J.once("end",H).once("error",H):H(V)}),s(ce,{readable:!1,writable:!0},H)}return ra={pipelineImpl:z,pipeline:x},ra}var na,zd;function bf(){if(zd)return na;zd=1;const{pipeline:i}=fc(),e=ji(),{destroyer:t}=an(),{isNodeStream:r,isReadable:n,isWritable:s,isWebStream:o,isTransformStream:a,isWritableStream:l,isReadableStream:c}=Wi(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:f,ERR_MISSING_ARGS:g}}=Pt(),y=sr();return na=function(..._){if(_.length===0)throw new g("streams");if(_.length===1)return e.from(_[0]);const E=[..._];if(typeof _[0]=="function"&&(_[0]=e.from(_[0])),typeof _[_.length-1]=="function"){const P=_.length-1;_[P]=e.from(_[P])}for(let P=0;P<_.length;++P)if(!(!r(_[P])&&!o(_[P]))){if(P<_.length-1&&!(n(_[P])||c(_[P])||a(_[P])))throw new f(`streams[${P}]`,E[P],"must be readable");if(P>0&&!(s(_[P])||l(_[P])||a(_[P])))throw new f(`streams[${P}]`,E[P],"must be writable")}let S,k,v,u,m;function T(P){const q=u;u=null,q?q(P):P?m.destroy(P):!R&&!j&&m.destroy()}const N=_[0],$=i(_,T),j=!!(s(N)||l(N)||a(N)),R=!!(n($)||c($)||a($));if(m=new e({writableObjectMode:!!(N!=null&&N.writableObjectMode),readableObjectMode:!!($!=null&&$.readableObjectMode),writable:j,readable:R}),j){if(r(N))m._write=function(q,I,L){N.write(q,I)?L():S=L},m._final=function(q){N.end(),k=q},N.on("drain",function(){if(S){const q=S;S=null,q()}});else if(o(N)){const I=(a(N)?N.writable:N).getWriter();m._write=async function(L,Q,A){try{await I.ready,I.write(L).catch(()=>{}),A()}catch(Y){A(Y)}},m._final=async function(L){try{await I.ready,I.close().catch(()=>{}),k=L}catch(Q){L(Q)}}}const P=a($)?$.readable:$;y(P,()=>{if(k){const q=k;k=null,q()}})}if(R){if(r($))$.on("readable",function(){if(v){const P=v;v=null,P()}}),$.on("end",function(){m.push(null)}),m._read=function(){for(;;){const P=$.read();if(P===null){v=m._read;return}if(!m.push(P))return}};else if(o($)){const q=(a($)?$.readable:$).getReader();m._read=async function(){for(;;)try{const{value:I,done:L}=await q.read();if(!m.push(I))return;if(L){m.push(null);return}}catch{return}}}}return m._destroy=function(P,q){!P&&u!==null&&(P=new d),v=null,S=null,k=null,u===null?q(P):(u=q,r($)&&t($,P))},m},na}var Hd;function xm(){if(Hd)return Rs;Hd=1;const i=globalThis.AbortController||ts().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:n},AbortError:s}=Pt(),{validateAbortSignal:o,validateInteger:a,validateObject:l}=ps(),c=nt().Symbol("kWeak"),d=nt().Symbol("kResistStopPropagation"),{finished:f}=sr(),g=bf(),{addAbortSignalNoValidate:y}=uo(),{isWritable:b,isNodeStream:_}=Wi(),{deprecate:E}=Ut(),{ArrayPrototypePush:S,Boolean:k,MathFloor:v,Number:u,NumberIsNaN:m,Promise:T,PromiseReject:N,PromiseResolve:$,PromisePrototypeThen:j,Symbol:R}=nt(),P=R("kEmpty"),q=R("kEof");function I(V,re){if(re!=null&&l(re,"options"),(re==null?void 0:re.signal)!=null&&o(re.signal,"options.signal"),_(V)&&!b(V))throw new e("stream",V,"must be writable");const ne=g(this,V);return re!=null&&re.signal&&y(re.signal,ne),ne}function L(V,re){if(typeof V!="function")throw new t("fn",["Function","AsyncFunction"],V);re!=null&&l(re,"options"),(re==null?void 0:re.signal)!=null&&o(re.signal,"options.signal");let ne=1;(re==null?void 0:re.concurrency)!=null&&(ne=v(re.concurrency));let ge=ne-1;return(re==null?void 0:re.highWaterMark)!=null&&(ge=v(re.highWaterMark)),a(ne,"options.concurrency",1),a(ge,"options.highWaterMark",0),ge+=ne,(async function*(){const O=Ut().AbortSignalAny([re==null?void 0:re.signal].filter(k)),G=this,oe=[],pe={signal:O};let ye,we,ie=!1,fe=0;function ve(){ie=!0,ue()}function ue(){fe-=1,Ve()}function Ve(){we&&!ie&&fe<ne&&oe.length<ge&&(we(),we=null)}async function kt(){try{for await(let je of G){if(ie)return;if(O.aborted)throw new s;try{if(je=V(je,pe),je===P)continue;je=$(je)}catch(Ct){je=N(Ct)}fe+=1,j(je,ue,ve),oe.push(je),ye&&(ye(),ye=null),!ie&&(oe.length>=ge||fe>=ne)&&await new T(Ct=>{we=Ct})}oe.push(q)}catch(je){const Ct=N(je);j(Ct,ue,ve),oe.push(Ct)}finally{ie=!0,ye&&(ye(),ye=null)}}kt();try{for(;;){for(;oe.length>0;){const je=await oe[0];if(je===q)return;if(O.aborted)throw new s;je!==P&&(yield je),oe.shift(),Ve()}await new T(je=>{ye=je})}}finally{ie=!0,we&&(we(),we=null)}}).call(this)}function Q(V=void 0){return V!=null&&l(V,"options"),(V==null?void 0:V.signal)!=null&&o(V.signal,"options.signal"),(async function*(){let ne=0;for await(const be of this){var ge;if(V!=null&&(ge=V.signal)!==null&&ge!==void 0&&ge.aborted)throw new s({cause:V.signal.reason});yield[ne++,be]}}).call(this)}async function A(V,re=void 0){for await(const ne of x.call(this,V,re))return!0;return!1}async function Y(V,re=void 0){if(typeof V!="function")throw new t("fn",["Function","AsyncFunction"],V);return!await A.call(this,async(...ne)=>!await V(...ne),re)}async function F(V,re){for await(const ne of x.call(this,V,re))return ne}async function te(V,re){if(typeof V!="function")throw new t("fn",["Function","AsyncFunction"],V);async function ne(ge,be){return await V(ge,be),P}for await(const ge of L.call(this,ne,re));}function x(V,re){if(typeof V!="function")throw new t("fn",["Function","AsyncFunction"],V);async function ne(ge,be){return await V(ge,be)?ge:P}return L.call(this,ne,re)}class z extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Z(V,re,ne){var ge;if(typeof V!="function")throw new t("reducer",["Function","AsyncFunction"],V);ne!=null&&l(ne,"options"),(ne==null?void 0:ne.signal)!=null&&o(ne.signal,"options.signal");let be=arguments.length>1;if(ne!=null&&(ge=ne.signal)!==null&&ge!==void 0&&ge.aborted){const ye=new s(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await f(this.destroy(ye)),ye}const O=new i,G=O.signal;if(ne!=null&&ne.signal){const ye={once:!0,[c]:this,[d]:!0};ne.signal.addEventListener("abort",()=>O.abort(),ye)}let oe=!1;try{for await(const ye of this){var pe;if(oe=!0,ne!=null&&(pe=ne.signal)!==null&&pe!==void 0&&pe.aborted)throw new s;be?re=await V(re,ye,{signal:G}):(re=ye,be=!0)}if(!oe&&!be)throw new z}finally{O.abort()}return re}async function J(V){V!=null&&l(V,"options"),(V==null?void 0:V.signal)!=null&&o(V.signal,"options.signal");const re=[];for await(const ge of this){var ne;if(V!=null&&(ne=V.signal)!==null&&ne!==void 0&&ne.aborted)throw new s(void 0,{cause:V.signal.reason});S(re,ge)}return re}function ce(V,re){const ne=L.call(this,V,re);return(async function*(){for await(const be of ne)yield*be}).call(this)}function H(V){if(V=u(V),m(V))return 0;if(V<0)throw new n("number",">= 0",V);return V}function W(V,re=void 0){return re!=null&&l(re,"options"),(re==null?void 0:re.signal)!=null&&o(re.signal,"options.signal"),V=H(V),(async function*(){var ge;if(re!=null&&(ge=re.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;for await(const O of this){var be;if(re!=null&&(be=re.signal)!==null&&be!==void 0&&be.aborted)throw new s;V--<=0&&(yield O)}}).call(this)}function K(V,re=void 0){return re!=null&&l(re,"options"),(re==null?void 0:re.signal)!=null&&o(re.signal,"options.signal"),V=H(V),(async function*(){var ge;if(re!=null&&(ge=re.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;for await(const O of this){var be;if(re!=null&&(be=re.signal)!==null&&be!==void 0&&be.aborted)throw new s;if(V-- >0&&(yield O),V<=0)return}}).call(this)}return Rs.streamReturningOperators={asIndexedPairs:E(Q,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:x,flatMap:ce,map:L,take:K,compose:I},Rs.promiseReturningOperators={every:Y,forEach:te,reduce:Z,toArray:J,some:A,find:F},Rs}var sa,Wd;function vf(){if(Wd)return sa;Wd=1;const{ArrayPrototypePop:i,Promise:e}=nt(),{isIterable:t,isNodeStream:r,isWebStream:n}=Wi(),{pipelineImpl:s}=fc(),{finished:o}=sr();wf();function a(...l){return new e((c,d)=>{let f,g;const y=l[l.length-1];if(y&&typeof y=="object"&&!r(y)&&!t(y)&&!n(y)){const b=i(l);f=b.signal,g=b.end}s(l,(b,_)=>{b?d(b):c(_)},{signal:f,end:g})})}return sa={finished:o,pipeline:a},sa}var Gd;function wf(){if(Gd)return Mo.exports;Gd=1;const{Buffer:i}=Hi(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=nt(),{promisify:{custom:n}}=Ut(),{streamReturningOperators:s,promiseReturningOperators:o}=xm(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=Pt(),l=bf(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:d}=ho(),{pipeline:f}=fc(),{destroyer:g}=an(),y=sr(),b=vf(),_=Wi(),E=Mo.exports=uc().Stream;E.isDestroyed=_.isDestroyed,E.isDisturbed=_.isDisturbed,E.isErrored=_.isErrored,E.isReadable=_.isReadable,E.isWritable=_.isWritable,E.Readable=fo();for(const k of t(s)){let u=function(...m){if(new.target)throw a();return E.Readable.from(r(v,this,m))};const v=s[k];e(u,"name",{__proto__:null,value:v.name}),e(u,"length",{__proto__:null,value:v.length}),e(E.Readable.prototype,k,{__proto__:null,value:u,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let u=function(...m){if(new.target)throw a();return r(v,this,m)};const v=o[k];e(u,"name",{__proto__:null,value:v.name}),e(u,"length",{__proto__:null,value:v.length}),e(E.Readable.prototype,k,{__proto__:null,value:u,enumerable:!1,configurable:!0,writable:!0})}E.Writable=hc(),E.Duplex=ji(),E.Transform=gf(),E.PassThrough=yf(),E.pipeline=f;const{addAbortSignal:S}=uo();return E.addAbortSignal=S,E.finished=y,E.destroy=g,E.compose=l,E.setDefaultHighWaterMark=c,E.getDefaultHighWaterMark=d,e(E,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),e(f,n,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),e(y,n,{__proto__:null,enumerable:!0,get(){return b.finished}}),E.Stream=E,E._isUint8Array=function(v){return v instanceof Uint8Array},E._uint8ArrayToBuffer=function(v){return i.from(v.buffer,v.byteOffset,v.byteLength)},Mo.exports}var Kd;function Em(){return Kd||(Kd=1,function(i){const e=wf(),t=vf(),r=e.Readable.destroy;i.exports=e.Readable,i.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,i.exports._isUint8Array=e._isUint8Array,i.exports.isDisturbed=e.isDisturbed,i.exports.isErrored=e.isErrored,i.exports.isReadable=e.isReadable,i.exports.Readable=e.Readable,i.exports.Writable=e.Writable,i.exports.Duplex=e.Duplex,i.exports.Transform=e.Transform,i.exports.PassThrough=e.PassThrough,i.exports.addAbortSignal=e.addAbortSignal,i.exports.finished=e.finished,i.exports.destroy=e.destroy,i.exports.destroy=r,i.exports.pipeline=e.pipeline,i.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),i.exports.Stream=e.Stream,i.exports.default=i.exports}(Oo)),Oo.exports}var _f=Em();const oa=Symbol("iter");function Vn(i,e,t=4){if(t===0)return Object.assign(i,e);for(const r in e)i[r]=Vn(i[r]||Object.create(null),e[r],t-1);return i}function xf(i,e,t=4){let r=!1;for(const n in i)if(n in e){const s=t===0?null:xf(i[n],e[n],t-1);if(s!==!1)r=r||Object.create(null),r[n]=s;else if(t===3)return!1}return r}function Ef(i,e,t=4){let r=!1;for(const n in i)if(!(n in e))r=r||Object.create(null),r[n]=t===0?null:Vn({},i[n],t-1);else if(t!==0){const s=Ef(i[n],e[n],t-1);if(s!==!1)r=r||Object.create(null),r[n]=s;else if(t===3)return!1}return r}class Sm{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||qe}_termFromId(e){if(e[0]==="."){const t=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(t[r[1]]),this._termFromId(t[r[2]]),this._termFromId(t[r[3]]),r[4]&&this._termFromId(t[r[4]]))}return jn(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object);let s;return t&&r&&n&&(Rl(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${r}.${n}.${s}`:`.${t}.${r}.${n}`]}return this._ids[qr(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Rl(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:qr(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class Rt{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||qe,this._entityIndex=t.entityIndex||new Sm({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let r,n;for(const s in t)for(const o in r=t[s].subjects)for(const a in n=r[o])e+=Object.keys(n[a]).length;return this._size=e}_addToIndex(e,t,r,n){const s=e[t]||(e[t]={}),o=s[r]||(s[r]={}),a=n in o;return a||(o[n]=null),!a}_removeFromIndex(e,t,r,n){const s=e[t],o=s[r];delete o[n];for(const a in o)return;delete s[r];for(const a in s)return;delete e[t]}*_findInIndex(e,t,r,n,s,o,a,l){let c,d,f;const g=this._entities,y=this._termFromId(g[l]),b={subject:null,predicate:null,object:null};t&&((c=e,e={})[t]=c[t]);for(const _ in e)if(d=e[_]){b[s]=this._termFromId(g[_]),r&&((c=d,d={})[r]=c[r]);for(const E in d)if(f=d[E]){b[o]=this._termFromId(g[E]);const S=n?n in f?[n]:[]:Object.keys(f);for(let k=0;k<S.length;k++)b[a]=this._termFromId(g[S[k]]),yield this._factory.quad(b.subject,b.predicate,b.object,y)}}}_loop(e,t){for(const r in e)t(r)}_loopByKey0(e,t,r){let n,s;if(n=e[t])for(s in n)r(s)}_loopByKey1(e,t,r){let n,s;for(n in e)s=e[n],s[t]&&r(n)}_loopBy2Keys(e,t,r,n){let s,o,a;if((s=e[t])&&(o=s[r]))for(a in o)n(a)}_countInIndex(e,t,r,n){let s=0,o,a,l;t&&((o=e,e={})[t]=o[t]);for(const c in e)if(a=e[c]){r&&((o=a,a={})[r]=o[r]);for(const d in a)(l=a[d])&&(n?n in l&&s++:s+=Object.keys(l).length)}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return r=>{r in t||(t[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1;let s=this._graphs[n];return s||(s=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),this._addToIndex(s.subjects,e,t,r)?(this._addToIndex(s.predicates,t,r,e),this._addToIndex(s.objects,r,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,r,n){return e&&e.subject&&({subject:e,predicate:t,object:r,graph:n}=e),!this.readQuads(e,t,r,n).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,r,n){t||({subject:e,predicate:t,object:r,graph:n}=e),n=n?this._termToNumericId(n):1;const s=this._graphs;let o,a,l;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(o=s[n])||!(a=o.subjects[e])||!(l=a[t])||!(r in l))return!1;this._removeFromIndex(o.subjects,e,t,r),this._removeFromIndex(o.predicates,t,r,e),this._removeFromIndex(o.objects,r,e,t),this._size!==null&&this._size--;for(e in o.subjects)return!0;return delete s[n],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,r,n){const s=new _f.Readable({objectMode:!0}),o=this.readQuads(e,t,r,n);return s._read=a=>{for(;--a>=0;){const{done:l,value:c}=o.next();if(l){s.push(null);return}s.push(c)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,n){return[...this.readQuads(e,t,r,n)]}*readQuads(e,t,r,n){const s=this._getGraphs(n);let o,a,l,c;if(!(e&&!(a=this._termToNumericId(e))||t&&!(l=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(const d in s)(o=s[d])&&(a?c?yield*this._findInIndex(o.objects,c,a,l,"object","subject","predicate",d):yield*this._findInIndex(o.subjects,a,l,null,"subject","predicate","object",d):l?yield*this._findInIndex(o.predicates,l,c,null,"predicate","object","subject",d):c?yield*this._findInIndex(o.objects,c,null,null,"object","subject","predicate",d):yield*this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",d))}match(e,t,r,n){return new Qi(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const s=this._getGraphs(n);let o=0,a,l,c,d;if(e&&!(l=this._termToNumericId(e))||t&&!(c=this._termToNumericId(t))||r&&!(d=this._termToNumericId(r)))return 0;for(const f in s)(a=s[f])&&(e?r?o+=this._countInIndex(a.objects,d,l,c):o+=this._countInIndex(a.subjects,l,c,d):t?o+=this._countInIndex(a.predicates,c,d,l):o+=this._countInIndex(a.objects,d,l,c));return o}forEach(e,t,r,n,s){this.some(o=>(e(o,this),!1),t,r,n,s)}every(e,t,r,n,s){return!this.some(o=>!e(o,this),t,r,n,s)}some(e,t,r,n,s){for(const o of this.readQuads(t,r,n,s))if(e(o,this))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects(s=>{n.push(s)},e,t,r),n}forSubjects(e,t,r,n){const s=this._getGraphs(n);let o,a,l;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(l=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.predicates,a,l,e):this._loopByKey1(o.subjects,a,e):l?this._loopByKey0(o.objects,l,e):this._loop(o.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates(s=>{n.push(s)},e,t,r),n}forPredicates(e,t,r,n){const s=this._getGraphs(n);let o,a,l;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(l=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.objects,l,a,e):this._loopByKey0(o.subjects,a,e):l?this._loopByKey1(o.predicates,l,e):this._loop(o.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects(s=>{n.push(s)},e,t,r),n}forObjects(e,t,r,n){const s=this._getGraphs(n);let o,a,l;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(l=this._termToNumericId(r))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.subjects,a,l,e):this._loopByKey1(o.objects,a,e):l?this._loopByKey0(o.predicates,l,e):this._loop(o.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs(s=>{n.push(s)},e,t,r),n}forGraphs(e,t,r,n){for(const s in this._graphs)this.some(o=>(e(o.graph),!0),t,r,n,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(a,l)=>{throw new Error(`${a.value} ${l}`)},s=this.getQuads(null,_t.rdf.rest,_t.rdf.nil,null),o=e?[...s]:[];return s.forEach(a=>{const l=[];let c=!1,d,f;const g=a.graph;let y=a.subject;for(;y&&!c;){const b=this.getQuads(null,null,y,null),_=this.getQuads(y,null,null,null);let E,S=null,k=null,v=null;for(let u=0;u<_.length&&!c;u++)E=_[u],E.graph.equals(g)?d?c=n(y,"has non-list arcs out"):E.predicate.value===_t.rdf.first?S?c=n(y,"has multiple rdf:first arcs"):o.push(S=E):E.predicate.value===_t.rdf.rest?k?c=n(y,"has multiple rdf:rest arcs"):o.push(k=E):b.length?c=n(y,"can't be subject and object"):(d=E,f="subject"):c=n(y,"not confined to single graph");for(let u=0;u<b.length&&!c;++u)E=b[u],d?c=n(y,"can't have coreferences"):E.predicate.value===_t.rdf.rest?v?c=n(y,"has incoming rdf:rest arcs"):v=E:(d=E,f="object");S?l.unshift(S.object):c=n(y,"has no list head"),y=v&&v.subject}c?e=!1:d&&(r[d[f].value]=l)}),e&&this.removeQuads(o),r}addAll(e){if(e instanceof Qi&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Rt&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Vn(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof Qi&&(e=e.filtered),e===this)return!0;if(!(e instanceof Rt)||this._entityIndex!==e._entityIndex)return e.every(c=>this.has(c));const t=this._graphs,r=e._graphs;let n,s,o,a,l;for(const c in r){if(!(n=t[c]))return!1;n=n.subjects;for(const d in s=r[c].subjects){if(!(o=n[d]))return!1;for(const f in a=s[d]){if(!(l=o[f]))return!1;for(const g in a[f])if(!(g in l))return!1}}}return!0}deleteMatches(e,t,r,n){for(const s of this.match(e,t,r,n))this.removeQuad(s);return this}difference(e){if(e&&e instanceof Qi&&(e=e.filtered),e===this)return new Rt({entityIndex:this._entityIndex});if(e instanceof Rt&&e._entityIndex===this._entityIndex){const t=new Rt({entityIndex:this._entityIndex}),r=Ef(this._graphs,e._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof Qi&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new Rt({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof Qi&&(e=e.filtered),e===this){const t=new Rt({entityIndex:this._entityIndex});return t._graphs=Vn(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof Rt&&this._entityIndex===e._entityIndex){const t=new Rt({entityIndex:this._entityIndex}),r=xf(e._graphs,this._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new Rt({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let n=t===void 0?r.next().value:t;for(const s of r)n=e(n,s,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new dc().quadsToString(this)}union(e){const t=new Rt({entityIndex:this._entityIndex});return t._graphs=Vn(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function xi(i,e,t=0){const r=e[t];if(r&&!(r in i))return!1;let n=!1;for(const s in r?{[r]:i[r]}:i){const o=t===2?null:xi(i[s],e,t+1);o!==!1&&(n=n||Object.create(null),n[s]=o)}return n}class Qi extends _f.Readable{constructor(e,t,r,n,s,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:s,options:o})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:s}=this,o=this._filtered=new Rt({factory:e._factory,entityIndex:this.options.entityIndex});let a,l,c;if(s&&!(a=o._termToNumericId(s))||n&&!(l=o._termToNumericId(n))||r&&!(c=o._termToNumericId(r)))return o;const d=e._getGraphs(t);for(const f in d){let g,y,b,_;(_=d[f])&&(!a&&l?(y=xi(_.predicates,[l,c,a]))&&(g=xi(_.subjects,[a,l,c]),b=xi(_.objects,[c,a,l])):c?(b=xi(_.objects,[c,a,l]))&&(g=xi(_.subjects,[a,l,c]),y=xi(_.predicates,[l,c,a])):(g=xi(_.subjects,[a,l,c]))&&(y=xi(_.predicates,[l,c,a]),b=xi(_.objects,[c,a,l])),g&&(o._graphs[f]={subjects:g,predicates:y,objects:b}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[oa]&&(this[oa]=this[Symbol.iterator]());const t=this[oa];for(;--e>=0;){const{done:r,value:n}=t.next();if(r){this.push(null);return}this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,r,n){return this.filtered.deleteMatches(e,t,r,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,n,s){return this.filtered.every(e,t,r,n,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,n,s){return this.filtered.forEach(e,t,r,n,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,n,s){return this.filtered.some(e,t,r,n,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new dc().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,n){return new Qi(this.filtered,e,t,r,n,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const Ae="http://www.w3.org/ns/shacl#",Jd="http://datashapes.org/dash#",wr="http://www.w3.org/2001/XMLSchema#",pc="http://www.w3.org/1999/02/22-rdf-syntax-ns#",mc="http://www.w3.org/2000/01/rdf-schema#",Sf="http://www.w3.org/2004/02/skos/core#",kf="http://www.w3.org/2002/07/owl#",km="http://www.w3.org/ns/oa#",Im="http://purl.org/dc/terms/",Rm="http://xmlns.com/foaf/0.1/",Ws=qe.namedNode("loaded-shapes"),Si=qe.namedNode("loaded-data"),xt=qe.namedNode(pc+"type"),Tl=qe.namedNode(Im+"conformsTo"),Tm=qe.namedNode(mc+"subClassOf"),$m=qe.namedNode(Sf+"broader"),gc=qe.namedNode(kf+"imports"),Cm=qe.namedNode(kf+"NamedIndividual"),Cs=qe.namedNode(Ae+"NodeShape"),Am=qe.namedNode(Ae+"IRI"),Gs=qe.namedNode(Ae+"property"),yc=qe.namedNode(Ae+"class"),is=qe.namedNode(Ae+"targetClass"),Nm=qe.namedNode(Ae+"nodeKind");function zn(i,e,t=Ae,r){let n="";const s=Lm(i,e,t,r);return s&&(n=s.value),n}function Lm(i,e,t=Ae,r){let n;const s=t+e;if(r!=null&&r.length){for(const o of r)for(const a of i)if(a.predicate.value===s){if(a.object.id.endsWith(`@${o}`))return a.object;a.object.id.indexOf("@")<0?n=a.object:n||(n=a.object)}}else for(const o of i)if(o.predicate.value===s)return o.object;return n}function Dm(i){var e;(e=i.querySelector("input,select,textarea"))==null||e.focus()}function po(i,e){return zn(i,"prefLabel",Sf,e)||zn(i,"label",mc,e)||zn(i,"name",Rm,e)}function $l(i,e,t,r){const n=[];for(const s of i)n.push({value:s,label:po(e.getQuads(s,null,null,null),t),indent:r});return n}function Cl(i,e){for(const t in e)i=i.replace(e[t],"");return i}function If(i,e,t,r,n=new Set){for(const s of e.owlImports)n.has(s.id)||(n.add(s.id),r.push(...t.getSubjects(xt,i,s)));e.parent&&If(i,e.parent,t,r,n)}function Ks(i,e,t=0){let r;if(e.shaclIn){const s=e.config.lists[e.shaclIn];r=s!=null&&s.length?s:[]}else r=e.config.store.getSubjects(xt,i,Ws),r.push(...e.config.store.getSubjects(xt,i,Si)),If(i,e,e.config.store,r);const n=$l(r,e.config.store,e.config.languages,t);if(e.shaclIn===void 0){for(const s of e.config.store.getSubjects(Tm,i,null))n.push(...Ks(s,e,t+1));if(e.config.store.getQuads(i,xt,Cm,null).length>0){n.push(...$l([i],e.config.store,e.config.languages,t));for(const s of e.config.store.getSubjects($m,i,null))n.push(...Ks(s,e,t+1))}}return n}function Al(i){let e;try{e=new URL(i)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Xd(i,e,t){if(e===void 0)return t;if(t===void 0)return e;const r=i.indexOf(e.language);if(r<0)return t;const n=i.indexOf(t.language);return n<0||n>r?e:t}function Rf(i,e,t){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const n=[];if(n.push({label:"--- please choose ---",value:""}),e instanceof ir){const s=[];let o=!1;i.length&&(o=t.store.countQuads(i[0],Gs,null,null)>0);for(let c=0;c<i.length;c++)if(o){const d=t.store.getObjects(i[c],Gs,null),f=[];let g="";for(const y of d){const b=new Qs(y,e,t);f.push(b),g+=(g.length>1?" / ":"")+b.template.label}s.push(f),n.push({label:g,value:c.toString()})}else{const d=new Qs(i[c],e,t);s.push([d]),n.push({label:d.template.label,value:c.toString()})}const a=t.theme.createListEditor("Please choose",null,!1,n),l=a.querySelector(".editor");l.onchange=()=>{if(l.value){const c=s[parseInt(l.value)];let d;c.length&&(d=c[0],r.replaceWith(c[0]));for(let f=1;f<c.length;f++)d.after(c[f]),d=c[f]}},r.appendChild(a)}else{const s=[];for(let l=0;l<i.length;l++){const c=t.store.getQuads(i[l],null,null,null);c.length&&(s.push(c),n.push({label:po(c,t.languages)||Cl(c[0].predicate.value,t.prefixes)+" = "+Cl(c[0].object.value,t.prefixes),value:l.toString()}))}const o=t.theme.createListEditor(e.template.label+"?",null,!1,n,e.template),a=o.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(Fs(e.template.clone().merge(s[parseInt(a.value)]),void 0,!0))},r.appendChild(o)}return r}function Om(i,e,t){if(e instanceof Ii){const r=e.datatype;for(const n of i){const s=t.store.getQuads(n,null,null,null);for(const o of s)if(o.predicate.value===`${Ae}datatype`&&o.object.equals(r))return s}}else{const r=t.store.getObjects(e,xt,null);for(const n of i){const s=t.store.getQuads(n,null,null,null);for(const o of s)if(r.length>0){if(o.predicate.value===`${Ae}node`){for(const a of r)if(t.store.getQuads(o.object,is,a,null).length>0)return s}if(o.predicate.equals(yc)){for(const a of r)if(o.object.equals(a))return s}}else if(o.predicate.equals(Nm)&&o.object.equals(Am))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Mm(i,e,t){for(const r of i){let n=!1;const s=t.store.getObjects(r,Gs,null);for(const o of s){const a=t.store.getObjects(o,`${Ae}path`,null);for(const l of a)if(n=t.store.countQuads(e,l,null,null)>0,n)break}if(n)return s}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Pm={[`${Ae}name`]:(i,e)=>{const t=e;i.name=Xd(i.config.languages,i.name,t)},[`${Ae}description`]:(i,e)=>{const t=e;i.description=Xd(i.config.languages,i.description,t)},[`${Ae}path`]:(i,e)=>{i.path=e.value},[`${Ae}node`]:(i,e)=>{i.node=e},[`${Ae}datatype`]:(i,e)=>{i.datatype=e},[`${Ae}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Ae}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Ae}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Ae}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Ae}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Ae}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Ae}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Ae}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Ae}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Ae}pattern`]:(i,e)=>{i.pattern=e.value},[`${Ae}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${Jd}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${Jd}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${km}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Ae}and`]:(i,e)=>{i.shaclAnd=e.value},[`${Ae}in`]:(i,e)=>{i.shaclIn=e.value},[`${Ae}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=qe.namedNode(pc+"langString")},[`${Ae}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Ae}hasValue`]:(i,e)=>{i.hasValue=e},[`${Ae}qualifiedValueShape`]:(i,e)=>{i.qualifiedValueShape=e},[`${Ae}qualifiedMinCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Ae}qualifiedMaxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[gc.id]:(i,e)=>{i.owlImports.push(e)},[yc.id]:(i,e)=>{i.class=e;const t=i.config.store.getSubjects(is,e,null);t.length>0&&(i.node=t[0])},[`${Ae}or`]:(i,e)=>{const t=i.config.lists[e.value];t!=null&&t.length?i.shaclOr=t:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Ae}xone`]:(i,e)=>{const t=i.config.lists[e.value];t!=null&&t.length?i.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class jm{constructor(e,t,r){this.label="",this.owlImports=[],this.extendedShapes=[],this.parent=t,this.config=r,this.merge(e),this.qualifiedValueShape&&this.merge(r.store.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){var t,r;for(const n of e)(t=Pm[n.predicate.id])==null||t.call(this,this,n.object);if(this.label=((r=this.name)==null?void 0:r.value)||po(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?Cl(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const n=this.config.lists[this.shaclAnd];if(n!=null&&n.length)for(const s of n)this.extendedShapes.push(s)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}const Bm=`form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }
28
+ form.mode-edit { padding-left: 1em; }
29
+ form *, form ::after, form ::before { box-sizing: inherit; }
30
+ shacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }
31
+ shacl-node .remove-button { margin-left: 4px; margin-top: 1px; }
32
+ shacl-node .add-button { color: #555; background-color: transparent; margin: 4px 24px 0 0; border: 0; }
33
+ shacl-node .add-button:hover { color:#222; }
34
+ shacl-node .add-button:focus { box-shadow: none; }
35
+ shacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }
36
+ shacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }
37
+ shacl-property:not(.may-add) > .add-button { display: none; }
38
+ shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }
39
+ shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }
40
+ .mode-view .shacl-group:not(:has(shacl-property)) { display: none; }
41
+ .property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }
42
+ .shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
43
+ .property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }
44
+ .property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; padding-left: 6px; }
45
+ .mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }
46
+ .property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: green; content: '\\2713'; }
47
+ .editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }
48
+ .shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }
49
+ select { overflow: hidden; text-overflow: ellipsis; }
50
+ textarea.editor { resize: vertical; }
51
+ .lang-chooser { position: absolute; top: 6px; right: 26px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }
52
+ .lang-chooser+.editor { padding-right: 55px; }
53
+ .validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: red; cursor: help; }
54
+ .validation-error::before { content: '\\26a0' }
55
+ .validation-error.node { left: -1em; }
56
+ .invalid > .editor { border-color: red !important; }
57
+ .ml-0 { margin-left: 0 !important; }
58
+ .pr-0 { padding-right: 0 !important; }
59
+ .mode-view .property-instance:not(:first-child) > label { visibility: hidden; }
60
+ .mode-view .property-instance label { width: var(--label-width); }
61
+
62
+ .d-flex { display: flex; }
63
+ .lang { opacity: 0.65; font-size: 0.6em; }
64
+ a, a:visited { color: inherit; }
65
+
66
+ .fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }
67
+ .fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}
68
+ @keyframes fadeIn {
69
+ 0% { opacity: 0; transform: scaleY(0.8); }
70
+ 100% { opacity: 1; transform: scaleY(1); }
71
+ }
72
+
73
+ .collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }
74
+ .collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }
75
+ .collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }
76
+ .collapsible.open > .activator::after { transform: rotate(225deg); }
77
+ .collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }
78
+ .collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }
79
+ .collapsible > .property-instance > shacl-node > h1 { display: none; }
80
+ .collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }
81
+ .ref-link { cursor: pointer; }
82
+ .ref-link:hover { text-decoration: underline; }
83
+ .node-id-display { color: #999; font-size: 11px; }`;class Fm{constructor(e){let t=Bm;e&&(t+=`
84
+ `+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,r){const n=document.createElement("div"),s=document.createElement("label");s.innerHTML=e+":",r.description&&s.setAttribute("title",r.description.value),n.appendChild(s);let o=t.value,a=null;if(t instanceof lc){const c=r.config.store.getQuads(o,null,null,null);if(c.length){const d=po(c,r.config.languages);d&&(o=d)}}else t instanceof Ii&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${wr}date`?o=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${wr}dateTime`&&(o=new Date(Date.parse(t.value)).toLocaleString()));let l;return Al(t.value)?(l=document.createElement("a"),l.setAttribute("href",t.value)):l=document.createElement("div"),l.classList.add("d-flex"),l.innerText=o,a&&l.appendChild(a),n.appendChild(l),n}}function qm(i,e,t){var r,n,s;if(t){const o=i.minCount!==void 0&&i.minCount>0;if(i.class)return i.config.theme.createListEditor(i.label,e,o,Ks(i.class,i),i);if(i.shaclIn){const a=i.config.lists[i.shaclIn];if(a!=null&&a.length){const l=$l(a,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,o,l,i)}else console.error("list not found:",i.shaclIn,"existing lists:",i.config.lists)}if(((r=i.datatype)==null?void 0:r.value)===`${pc}langString`||(n=i.languageIn)!=null&&n.length)return i.config.theme.createLangStringEditor(i.label,e,o,i);switch((s=i.datatype)==null?void 0:s.value.replace(wr,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,o,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,o,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,o,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,o,i)}return i.config.theme.createTextEditor(i.label,e,o,i)}else{if(e)return i.config.theme.createViewer(i.label,e,i);const o=document.createElement("div");return o.innerHTML="No value",o}}function Um(i,e,t){if(e==="application/ld+json")return Vm(i);{const r=new dc({format:e,prefixes:t});r.addQuads(i);let n="";return r.end((s,o)=>{s&&console.error(s),n=o}),n}}function Vm(i){const e=[];for(const t of i){const r={"@id":t.subject.id};if(t.predicate===xt)r["@type"]=t.object.id;else{let n=t.object.value;t.object instanceof Ii?t.object.language?n={"@language":t.object.language,"@value":t.object.value}:t.object.datatype&&t.object.datatype.value!==`${wr}#string`&&(n={"@type":t.object.datatype.value,"@value":t.object.value}):n={"@id":t.object.id},r[t.predicate.value]=n}e.push(r)}return JSON.stringify(e)}function zm(i){let e=i.shaclDatatype,t=i.value;if(t){if(i.dataset.class||i.dataset.nodeKind===Ae+"IRI")return qe.namedNode(t);if(i.dataset.link)return JSON.parse(i.dataset.link);if(i.dataset.lang?e=i.dataset.lang:i.type==="number"?t=parseFloat(t):i.type==="file"&&i.binaryData?t=i.binaryData:i.type==="datetime-local"&&(t=new Date(t).toISOString().slice(0,19)),!e&&typeof t=="string"){const r=t.split("^^");r.length===2&&(r[0].startsWith('"')&&r[0].endsWith('"')||r[0].startsWith("'")&&r[0].endsWith("'"))&&r[1].split(":").length===2&&(t=r[0].substring(1,r[0].length-1),e=qe.namedNode(r[1]))}return qe.literal(t,e)}else if((i.type==="checkbox"||i.getAttribute("type")==="checkbox")&&(i.checked||parseInt(i.dataset.minCount||"0")>0))return qe.literal(i.checked?"true":"false",e)}const Hn={};function Hm(i){i.predicate===void 0&&i.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',i):Hn[`${i.predicate}^${i.datatype}`]=i}function Wm(){return Object.entries(Hn).map(i=>i[1])}function Gm(i,e){let t=Hn[`${i}^${e}`];return t||(t=Hn[`${i}^undefined`],t)?t:Hn[`undefined^${e}`]}class c_{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}/**
85
+ * @license
86
+ * Copyright 2019 Google LLC
87
+ * SPDX-License-Identifier: BSD-3-Clause
88
+ */const Ps=globalThis,bc=Ps.ShadowRoot&&(Ps.ShadyCSS===void 0||Ps.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vc=Symbol(),Qd=new WeakMap;let Tf=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==vc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(bc&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Qd.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Qd.set(t,e))}return e}toString(){return this.cssText}};const Km=i=>new Tf(typeof i=="string"?i:i+"",void 0,vc),Ie=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((r,n,s)=>r+(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)+i[s+1],i[0]);return new Tf(t,i,vc)},Jm=(i,e)=>{if(bc)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=Ps.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Yd=bc?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Km(t)})(i):i;/**
89
+ * @license
90
+ * Copyright 2017 Google LLC
91
+ * SPDX-License-Identifier: BSD-3-Clause
92
+ */const{is:Xm,defineProperty:Qm,getOwnPropertyDescriptor:Ym,getOwnPropertyNames:Zm,getOwnPropertySymbols:eg,getPrototypeOf:tg}=Object,tr=globalThis,Zd=tr.trustedTypes,ig=Zd?Zd.emptyScript:"",aa=tr.reactiveElementPolyfillSupport,Wn=(i,e)=>i,Hr={toAttribute(i,e){switch(e){case Boolean:i=i?ig:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},wc=(i,e)=>!Xm(i,e),eu={attribute:!0,type:String,converter:Hr,reflect:!1,useDefault:!1,hasChanged:wc};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),tr.litPropertyMetadata??(tr.litPropertyMetadata=new WeakMap);let Mr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=eu){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Qm(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:s}=Ym(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const a=n==null?void 0:n.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??eu}static _$Ei(){if(this.hasOwnProperty(Wn("elementProperties")))return;const e=tg(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Wn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wn("properties"))){const t=this.properties,r=[...Zm(t),...eg(t)];for(const n of r)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const n of r)t.unshift(Yd(n))}else e!==void 0&&t.push(Yd(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Jm(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var s;const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){const o=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:Hr).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){var s,o;const r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const a=r.getPropertyOptions(n),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:Hr;this._$Em=n,this[n]=l.fromAttribute(t,a.type)??((o=this._$Ej)==null?void 0:o.get(n))??null,this._$Em=null}}requestUpdate(e,t,r){var n;if(e!==void 0){const s=this.constructor,o=this[e];if(r??(r=s.getPropertyOptions(e)),!((r.hasChanged??wc)(o,t)||r.useDefault&&r.reflect&&o===((n=this._$Ej)==null?void 0:n.get(e))&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:s},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n){const{wrapped:a}=o,l=this[s];a!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Mr.elementStyles=[],Mr.shadowRootOptions={mode:"open"},Mr[Wn("elementProperties")]=new Map,Mr[Wn("finalized")]=new Map,aa==null||aa({ReactiveElement:Mr}),(tr.reactiveElementVersions??(tr.reactiveElementVersions=[])).push("2.1.0");/**
93
+ * @license
94
+ * Copyright 2017 Google LLC
95
+ * SPDX-License-Identifier: BSD-3-Clause
96
+ */const Gn=globalThis,Js=Gn.trustedTypes,tu=Js?Js.createPolicy("lit-html",{createHTML:i=>i}):void 0,$f="$lit$",Yi=`lit$${Math.random().toFixed(9).slice(2)}$`,Cf="?"+Yi,rg=`<${Cf}>`,kr=document,rs=()=>kr.createComment(""),ns=i=>i===null||typeof i!="object"&&typeof i!="function",_c=Array.isArray,ng=i=>_c(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",la=`[
97
+ \f\r]`,_n=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,iu=/-->/g,ru=/>/g,pr=RegExp(`>|${la}(?:([^\\s"'>=/]+)(${la}*=${la}*(?:[^
98
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),nu=/'/g,su=/"/g,Af=/^(?:script|style|textarea|title)$/i,sg=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),X=sg(1),At=Symbol.for("lit-noChange"),Ge=Symbol.for("lit-nothing"),ou=new WeakMap,vr=kr.createTreeWalker(kr,129);function Nf(i,e){if(!_c(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return tu!==void 0?tu.createHTML(e):e}const og=(i,e)=>{const t=i.length-1,r=[];let n,s=e===2?"<svg>":e===3?"<math>":"",o=_n;for(let a=0;a<t;a++){const l=i[a];let c,d,f=-1,g=0;for(;g<l.length&&(o.lastIndex=g,d=o.exec(l),d!==null);)g=o.lastIndex,o===_n?d[1]==="!--"?o=iu:d[1]!==void 0?o=ru:d[2]!==void 0?(Af.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=pr):d[3]!==void 0&&(o=pr):o===pr?d[0]===">"?(o=n??_n,f=-1):d[1]===void 0?f=-2:(f=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?pr:d[3]==='"'?su:nu):o===su||o===nu?o=pr:o===iu||o===ru?o=_n:(o=pr,n=void 0);const y=o===pr&&i[a+1].startsWith("/>")?" ":"";s+=o===_n?l+rg:f>=0?(r.push(c),l.slice(0,f)+$f+l.slice(f)+Yi+y):l+Yi+(f===-2?a:y)}return[Nf(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let Nl=class Lf{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0;const a=e.length-1,l=this.parts,[c,d]=og(e,t);if(this.el=Lf.createElement(c,r),vr.currentNode=this.el.content,t===2||t===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(n=vr.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const f of n.getAttributeNames())if(f.endsWith($f)){const g=d[o++],y=n.getAttribute(f).split(Yi),b=/([.?@])?(.*)/.exec(g);l.push({type:1,index:s,name:b[2],strings:y,ctor:b[1]==="."?lg:b[1]==="?"?cg:b[1]==="@"?dg:mo}),n.removeAttribute(f)}else f.startsWith(Yi)&&(l.push({type:6,index:s}),n.removeAttribute(f));if(Af.test(n.tagName)){const f=n.textContent.split(Yi),g=f.length-1;if(g>0){n.textContent=Js?Js.emptyScript:"";for(let y=0;y<g;y++)n.append(f[y],rs()),vr.nextNode(),l.push({type:2,index:++s});n.append(f[g],rs())}}}else if(n.nodeType===8)if(n.data===Cf)l.push({type:2,index:s});else{let f=-1;for(;(f=n.data.indexOf(Yi,f+1))!==-1;)l.push({type:7,index:s}),f+=Yi.length-1}s++}}static createElement(e,t){const r=kr.createElement("template");return r.innerHTML=e,r}};function Wr(i,e,t=i,r){var o,a;if(e===At)return e;let n=r!==void 0?(o=t._$Co)==null?void 0:o[r]:t._$Cl;const s=ns(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==s&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Wr(i,n._$AS(i,e.values),n,r)),e}let ag=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=((e==null?void 0:e.creationScope)??kr).importNode(t,!0);vr.currentNode=n;let s=vr.nextNode(),o=0,a=0,l=r[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new xc(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ug(s,this,e)),this._$AV.push(c),l=r[++a]}o!==(l==null?void 0:l.index)&&(s=vr.nextNode(),o++)}return vr.currentNode=kr,n}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},xc=class Df{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=Ge,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Wr(this,e,t),ns(e)?e===Ge||e==null||e===""?(this._$AH!==Ge&&this._$AR(),this._$AH=Ge):e!==this._$AH&&e!==At&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ng(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Ge&&ns(this._$AH)?this._$AA.nextSibling.data=e:this.T(kr.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Nl.createElement(Nf(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===n)this._$AH.p(t);else{const o=new ag(n,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=ou.get(e.strings);return t===void 0&&ou.set(e.strings,t=new Nl(e)),t}k(e){_c(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const s of e)n===t.length?t.push(r=new Df(this.O(rs()),this.O(rs()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e&&e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},mo=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=Ge,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ge}_$AI(e,t=this,r,n){const s=this.strings;let o=!1;if(s===void 0)e=Wr(this,e,t,0),o=!ns(e)||e!==this._$AH&&e!==At,o&&(this._$AH=e);else{const a=e;let l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Wr(this,a[r+l],t,l),c===At&&(c=this._$AH[l]),o||(o=!ns(c)||c!==this._$AH[l]),c===Ge?e=Ge:e!==Ge&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===Ge?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},lg=class extends mo{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ge?void 0:e}},cg=class extends mo{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Ge)}},dg=class extends mo{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Wr(this,e,t,0)??Ge)===At)return;const r=this._$AH,n=e===Ge&&r!==Ge||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==Ge&&(r===Ge||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},ug=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Wr(this,e)}};const ca=Gn.litHtmlPolyfillSupport;ca==null||ca(Nl,xc),(Gn.litHtmlVersions??(Gn.litHtmlVersions=[])).push("3.3.0");const hg=(i,e,t)=>{const r=(t==null?void 0:t.renderBefore)??e;let n=r._$litPart$;if(n===void 0){const s=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new xc(e.insertBefore(rs(),s),s,void 0,t??{})}return n._$AI(i),n};/**
99
+ * @license
100
+ * Copyright 2017 Google LLC
101
+ * SPDX-License-Identifier: BSD-3-Clause
102
+ */const _r=globalThis;let ct=class extends Mr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=hg(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return At}};var of;ct._$litElement$=!0,ct.finalized=!0,(of=_r.litElementHydrateSupport)==null||of.call(_r,{LitElement:ct});const da=_r.litElementPolyfillSupport;da==null||da({LitElement:ct});(_r.litElementVersions??(_r.litElementVersions=[])).push("4.2.0");var Of=i=>{throw TypeError(i)},Mf=(i,e,t)=>e.has(i)||Of("Cannot "+t),Ji=(i,e,t)=>(Mf(i,e,"read from private field"),t?t.call(i):e.get(i)),fg=(i,e,t)=>e.has(i)?Of("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),pg=(i,e,t,r)=>(Mf(i,e,"write to private field"),e.set(i,t),t);const Ar=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)},js=globalThis,Ec=js.ShadowRoot&&(js.ShadyCSS===void 0||js.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pf=Symbol(),au=new WeakMap;let mg=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==Pf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=e}get styleSheet(){let i=this.o;const e=this.t;if(Ec&&i===void 0){const t=e!==void 0&&e.length===1;t&&(i=au.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&au.set(e,i))}return i}toString(){return this.cssText}};const gg=i=>new mg(typeof i=="string"?i:i+"",void 0,Pf),yg=(i,e)=>{if(Ec)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),n=js.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},lu=Ec?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return gg(t)})(i):i,{is:bg,defineProperty:vg,getOwnPropertyDescriptor:wg,getOwnPropertyNames:_g,getOwnPropertySymbols:xg,getPrototypeOf:Eg}=Object,Gr=globalThis,cu=Gr.trustedTypes,Sg=cu?cu.emptyScript:"",du=Gr.reactiveElementPolyfillSupport,Kn=(i,e)=>i,Xs={toAttribute(i,e){switch(e){case Boolean:i=i?Sg:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Sc=(i,e)=>!bg(i,e),uu={attribute:!0,type:String,converter:Xs,reflect:!1,hasChanged:Sc};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Gr.litPropertyMetadata??(Gr.litPropertyMetadata=new WeakMap);class xn extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=uu){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&vg(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:s}=wg(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);s.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??uu}static _$Ei(){if(this.hasOwnProperty(Kn("elementProperties")))return;const e=Eg(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Kn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Kn("properties"))){const t=this.properties,r=[..._g(t),...xg(t)];for(const n of r)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const n of r)t.unshift(lu(n))}else e!==void 0&&t.push(lu(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return yg(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var r;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const o=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:Xs).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const o=n.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Xs;this._$Em=s,this[s]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??Sc)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(r)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}xn.elementStyles=[],xn.shadowRootOptions={mode:"open"},xn[Kn("elementProperties")]=new Map,xn[Kn("finalized")]=new Map,du==null||du({ReactiveElement:xn}),(Gr.reactiveElementVersions??(Gr.reactiveElementVersions=[])).push("2.0.4");const kg={attribute:!0,type:String,converter:Xs,reflect:!1,hasChanged:Sc},Ig=(i=kg,e,t)=>{const{kind:r,metadata:n}=t;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(t.name,i),r==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,i)},init(a){return a!==void 0&&this.P(o,void 0,i),a}}}if(r==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,i)}}throw Error("Unsupported decorator location: "+r)};function Be(i){return(e,t)=>typeof t=="object"?Ig(i,e,t):((r,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,o?{...r,wrapped:!0}:r),o?Object.getOwnPropertyDescriptor(n,s):void 0})(i,e,t)}function kc(i){return Be({...i,state:!0,attribute:!1})}const Rg=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);function Ni(i,e){return(t,r,n)=>{const s=o=>{var a;return((a=o.renderRoot)==null?void 0:a.querySelector(i))??null};return Rg(t,r,{get(){return s(this)}})}}var Tg=Object.defineProperty,Nr=(i,e,t,r)=>{for(var n=void 0,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=o(e,t,n)||n);return n&&Tg(e,t,n),n};const Ll=class extends ct{constructor(){super(...arguments),this.dense=!1}};Ll.shadowRootOptions={...ct.shadowRootOptions,delegatesFocus:!0},Ll.styles=[Ie`
103
+ :host {
104
+ color-scheme: light dark;
105
+ --rokit-primary-color-inner: var(--rokit-primary-color, #008877);
106
+ --rokit-primary-color-transparent-inner: color-mix(in srgb, var(--rokit-primary-color-inner) 20%, transparent);
107
+ --rokit-error-color-inner: var(--rokit-error-color, #F03333);
108
+ --rokit-background-color-inner: var(--rokit-background-color, #242424);
109
+ --rokit-light-background-color-inner: var(--rokit-light-background-color, color-mix(in srgb, var(--rokit-background-color-inner) 96%, currentColor));
110
+ --rokit-light-background-darker-color-inner: var(--rokit-light-background-darker-color, color-mix(in srgb, var(--rokit-light-background-color-inner) 80%, currentColor));
111
+ --rokit-shadow-color-inner: var(--rokit-shadow-color, color-mix(in srgb, currentColor 40%, transparent));
112
+ --rokit-list-indent-inner: var(--rokit-list-indent, 1em);
113
+ --rokit-list-max-height-inner: var(--rokit-list-max-height, 300);
114
+ --rokit-caret-size-inner: var(--rokit-caret-size, 0.5em);
115
+ --rokit-transition-duration-inner: var(--rokit-transition-duration, 0.2s);
116
+ }
117
+
118
+ @media (prefers-color-scheme: light) {
119
+ :host {
120
+ --rokit-background-color-inner: var(--rokit-background-color, #FFF);
121
+ }
122
+ }
123
+ `];let Lr=Ll;Nr([Be({type:Boolean,reflect:!0})],Lr.prototype,"dense");var pi;const Dl=class extends Lr{constructor(){super(),fg(this,pi),this.value="",this.clearable=!1,this.required=!1,pg(this,pi,this.attachInternals())}checkValidity(){return Ji(this,pi).checkValidity()}reportValidity(){const e=Ji(this,pi).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return Ji(this,pi).validity}get validationMessage(){return Ji(this,pi).validationMessage}setCustomValidity(e,t){e?Ji(this,pi).setValidity({customError:!0},e,t):Ji(this,pi).setValidity(void 0)}updateValidity(e,t,r){Ji(this,pi).setValidity(e,t,r)}setFormValue(e,t){Ji(this,pi).setFormValue(e,t)}};pi=new WeakMap,Dl.formAssociated=!0,Dl.styles=[...Lr.styles,Ie`
124
+ :host { display: inline-flex; align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; position: relative; }
125
+ :host(:focus) { border-color: var(--rokit-primary-color-inner); }
126
+ :host(.invalid) { border-color: var(--rokit-error-color-inner); }
127
+ `];let Li=Dl;Nr([Be()],Li.prototype,"name");Nr([Be()],Li.prototype,"value");Nr([Be({type:Boolean})],Li.prototype,"clearable");Nr([Be({type:Boolean})],Li.prototype,"required");Nr([Be()],Li.prototype,"label");Nr([Be()],Li.prototype,"placeholder");function $g(i){const e=parseFloat(i),t=i.match(/m?s/);let r=0;if(t)switch(t[0]){case"s":r=e*1e3;break;case"ms":r=e;break;default:r=0;break}return r}var Cg=(i,e,t,r)=>{for(var n=e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=o(n)||n);return n};let ss=class extends Lr{render(){return X`<a part="link"><slot><slot></a>`}};ss.styles=[...Lr.styles,Ie`
128
+ :host a { display: flex; min-width: 1em; height: 1em; padding: 0.5em; cursor: pointer; border-radius: 1em; align-items: center; justify-content: center; }
129
+ :host a:hover { font-weight: 600; background-color: var(--rokit-light-background-darker-color-inner); }
130
+ :host([dense]) { font-size: 0.65em; }
131
+ :host(.clear) a:before { content: '\u2715'; }
132
+ :host(.caret) a:before { content:''; width: var(--rokit-caret-size-inner); height: var(--rokit-caret-size-inner); border-style: none solid solid none; border-width: calc(0.3 * var(--rokit-caret-size-inner)); transform: translate(0.15em, -0.15em) rotate(45deg); transition: transform var(--rokit-transition-duration-inner) ease-out; margin-right: calc(0.5 * var(--rokit-caret-size-inner)); }
133
+ :host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
134
+ :host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
135
+ `];ss=Cg([Ar("rokit-button")],ss);var Ag=Object.defineProperty,Ng=Object.getOwnPropertyDescriptor,Dr=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ng(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Ag(e,t,n),n};let Bi=class extends Lr{constructor(){super(...arguments),this.open=!1,this.transitioning=!1,this.closedBeforeTransition=!1}firstUpdated(){const i=this.shadowRoot.querySelector("header");i.addEventListener("mousedown",()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}),i.addEventListener("click",()=>{this.toggle(this.closedBeforeTransition)}),this.transitionDuration=$g(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning)}updateContentHeight(){this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")}toggle(i=!this.open){this.open||this.updateContentHeight(),this.transitioning=!0,this.open=i,this.toggleButton.classList.toggle("down",i),setTimeout(()=>{this.transitioning=!1,this.open&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration)}render(){return X`
136
+ <header part="header">
137
+ <slot name="prefix" part="prefix"></slot>
138
+ <span class="label"><slot name="label" part="label">${this.label}</slot></span>
139
+ <slot name="pre-suffix" part="suffix"></slot>
140
+ <rokit-button id="toggle" part="toggle" class="caret" ?dense="${this.dense}" title="${this.open?"Collapse":"Expand"}"></rokit-button>
141
+ <slot name="suffix" part="suffix"></slot>
142
+ </header>
143
+ <div id="content" part="content">
144
+ <slot @slotchange=${this.updateContentHeight}></slot>
145
+ </div>
146
+ `}};Bi.styles=[...Lr.styles,Ie`
147
+ :host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
148
+ :host header { cursor: pointer; }
149
+ :host([dense]) header { padding: 2px 4px; }
150
+ :host([maxheight]) #content { overflow:auto }
151
+ :host(:not([open])) #content { max-height: 0 !important; }
152
+ :host(:not([open])) #content, :host(.transitioning) #content { overflow: hidden !important; }
153
+ header { display: flex; align-items: center; padding: 6px 8px; background-color: var(--rokit-light-background-color-inner); user-select: none; }
154
+ .label { flex-grow: 1; }
155
+ #content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
156
+ #toggle { margin-left: 3px; }
157
+ `];Dr([Be({type:Boolean,reflect:!0})],Bi.prototype,"open",2);Dr([Be()],Bi.prototype,"label",2);Dr([Be({reflect:!0})],Bi.prototype,"maxHeight",2);Dr([Ni("#content")],Bi.prototype,"content",2);Dr([Ni("#toggle")],Bi.prototype,"toggleButton",2);Dr([kc()],Bi.prototype,"transitioning",2);Bi=Dr([Ar("rokit-collapsible")],Bi);var Lg=Object.defineProperty,Dg=Object.getOwnPropertyDescriptor,jf=i=>{throw TypeError(i)},ti=(i,e,t,r)=>{for(var n=r>1?void 0:r?Dg(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Lg(e,t,n),n},Bf=(i,e,t)=>e.has(i)||jf("Cannot "+t),Og=(i,e,t)=>(Bf(i,e,"read from private field"),e.get(i)),Mg=(i,e,t)=>e.has(i)?jf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),hu=(i,e,t,r)=>(Bf(i,e,"write to private field"),e.set(i,t),t),Fn;let pt=class extends Li{constructor(){super(),this.type="text",this.disabled=!1,this.readonly=!1,this.sticky=!1,this.minWidth=80,Mg(this,Fn,""),this.addEventListener("keydown",i=>{i.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){var i,e;hu(this,Fn,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value});const t=((e=(i=this.shadowRoot)==null?void 0:i.querySelector("label"))==null?void 0:e.scrollWidth)||0,r=this.shadowRoot.querySelector(".wrapper");r.style.minWidth=`${this.minWidth>t?this.minWidth:t}px`}updated(i){i.has("label")&&this.classList.toggle("has-label",this.label!==void 0),i.has("min")&&(this.inputElement.min=this.min||""),i.has("max")&&(this.inputElement.max=this.max||""),i.has("step")&&(this.inputElement.step=this.step||""),i.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),i.has("pattern")&&(this.inputElement.pattern=this.pattern||""),i.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),i.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),i.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==Og(this,Fn)&&(hu(this,Fn,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return X`<input id="input" part="input" size="1" name="${this.name}" type="${this.type}" autocomplete="off" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.type==="file"?"":this.value}">`}render(){return X`
158
+ <slot name="prefix" part="prefix"></slot>
159
+ <div class="wrapper">
160
+ <label for="input" part="label">${this.label}</label>
161
+ ${this.renderInput()}
162
+ ${this.clearable?X`
163
+ <rokit-button class="clear" ?dense="${this.dense}" @click="${i=>{i.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
164
+ `:Ge}
165
+ </div>
166
+ <slot name="suffix" part="suffix"></slot>
167
+ `}};Fn=new WeakMap;pt.styles=[...Li.styles,Ie`
168
+ :host { background-color: var(--rokit-light-background-color-inner); user-select: none; }
169
+ :host([dense]) { padding: 2px 4px; }
170
+ :host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
171
+ :host(.has-focus) label { color: var(--rokit-primary-color-inner); }
172
+ .wrapper { display: flex; position: relative; flex-grow: 1; align-items: center; }
173
+ label { position: absolute; top: 50%; transform: translate(0, -50%); transition-property: top, font-size; transition-duration: var(--rokit-transition-duration-inner); max-width: 100%; overflow: hidden; pointer-events: none; white-space: nowrap; }
174
+ #input { height: 1.3em; border: 0; outline: 0; flex-grow: 1; font-size: 1em; background: none; padding: 0; color: currentColor; font-family: inherit; text-overflow: ellipsis; }
175
+ #input[type='file'] { padding-bottom: 3px; }
176
+ #input[readonly] { caret-color: transparent; }
177
+ #input[readonly]::placeholder { color: transparent; }
178
+ :host(.has-label) #input { margin-top: 0.9em; }
179
+ :host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
180
+ :host(:not(.has-value)) .clear { visibility: hidden; }
181
+ `];ti([Be()],pt.prototype,"type",2);ti([Be({type:Boolean})],pt.prototype,"disabled",2);ti([Be({type:Boolean,reflect:!0})],pt.prototype,"readonly",2);ti([Be({type:Boolean,reflect:!0})],pt.prototype,"sticky",2);ti([Be()],pt.prototype,"pattern",2);ti([Be()],pt.prototype,"minLength",2);ti([Be()],pt.prototype,"maxLength",2);ti([Be()],pt.prototype,"min",2);ti([Be()],pt.prototype,"max",2);ti([Be()],pt.prototype,"step",2);ti([Be()],pt.prototype,"minWidth",2);ti([Ni("#input")],pt.prototype,"inputElement",2);pt=ti([Ar("rokit-input")],pt);var Pg=Object.defineProperty,jg=Object.getOwnPropertyDescriptor,Ff=i=>{throw TypeError(i)},jt=(i,e,t,r)=>{for(var n=r>1?void 0:r?jg(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Pg(e,t,n),n},qf=(i,e,t)=>e.has(i)||Ff("Cannot "+t),fu=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),pu=(i,e,t)=>e.has(i)?Ff("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),As=(i,e,t,r)=>(qf(i,e,"write to private field"),e.set(i,t),t),Pr,Bs;let gt=class extends Li{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,pu(this,Pr,""),pu(this,Bs,""),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)})}firstUpdated(){As(this,Pr,this.value),As(this,Bs,getComputedStyle(this).getPropertyValue("--rokit-list-indent-inner")),this.input.placeholder=this.placeholder===void 0?"Type to filter list...":this.placeholder,this.input.label=this.label,this.inputMinWidth!==void 0&&(this.input.minWidth=this.inputMinWidth),setTimeout(()=>{this.collapsible.maxHeight=parseInt(this.collapsibleMaxHeight!==void 0?this.collapsibleMaxHeight:getComputedStyle(this).getPropertyValue("--rokit-list-max-height-inner")),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight})}updated(i){var e;if(i.has("selectedItem")){const t=this.value;this.value=this.selectedItem?this.itemValue(this.selectedItem):"",this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.input.title=this.input.value,this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.required&&this.value===""?this.updateValidity({valueMissing:!0},"Please select a value",this.listContainer):this.updateValidity(),t!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}i.has("value")&&this.selectItem(this.findItem(this.value)),(i.has("filterableThreshold")||i.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),(e=this.collapsible)!=null&&e.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(i=!0){if(this.input.value){const e=this.findItem(this.input.value);if(e){this.selectItem(e);return}}i&&(this.input.value="",this.input.title="",As(this,Pr,""),this.selectItem(null,!1))}filter(i){var e,t,r;i=i.toLowerCase();let n=!0;for(const s of this.listContainer.querySelectorAll("li"))if(s.id!=="noresult"){const o=this.itemText(s).toLowerCase().indexOf(i)==-1;s.classList.toggle("hidden",o),this.collapse&&(s.classList.remove("open"),(e=s.querySelector("ul"))==null||e.classList.remove("open")),o||(n=!1)}for(const s of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))s.classList.remove("hidden"),i&&this.collapse&&(s.classList.add("open"),(t=s.querySelector("ul"))==null||t.classList.add("open")),n=!1;this.highlightItem(null),(r=this.listContainer.querySelector("#noresult"))==null||r.classList.toggle("hidden",!n)}selectItem(i,e=!0){(i==null?void 0:i.getAttribute("disabled"))!==null&&(i=null),this.selectedItem=i,this.filter(""),this.highlightItem(i,!1),e&&this.value&&As(this,Pr,this.value),setTimeout(()=>this.blur())}findItem(i){if(i){for(const e of this.listContainer.querySelectorAll("li"))if(this.itemValue(e)===i||this.itemText(e)===i)return e}return null}highlightItem(i,e=!0){var t,r;if((t=this.listContainer.querySelector("li.active"))==null||t.classList.remove("active"),i){if(e&&this.listContainer.focus(),i.classList.add("active"),this.collapse)for(let n=i.closest("ul");n;n=n.parentElement.closest("ul"))n.classList.add("open"),(r=n.closest("li"))==null||r.classList.add("open");i.scrollIntoView({block:"nearest"})}}highlightNextItem(){const i=this.listContainer.querySelector("li.active");let e=i;const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(i){for(let r=0;r<t.length;r++)if(t[r]===i&&r<t.length-1){e=t[r+1];break}}else t.length>0&&(e=t[0]);this.highlightItem(e)}highlightPreviousItem(){const i=this.listContainer.querySelector("li.active");let e=null;if(i){const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let r=0;r<t.length;r++)if(t[r]===i&&r>0){e=t[r-1];break}}this.highlightItem(e),e||this.input.focus()}itemValue(i){return i.dataset.value||this.itemText(i)||""}itemText(i){var e;return((e=i.querySelector("div > div"))==null?void 0:e.innerText)||""}elementText(i){var e;let t="";for(const r of i.childNodes)r.nodeType==3&&(t+=(e=r.nodeValue)==null?void 0:e.trim());return t}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let i=null;const e=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if((e==null?void 0:e.length)===1&&(i=Array.prototype.slice.call(e[0].querySelectorAll(":scope > li")),this.copyItems(i,this.listContainer)),this.emptyMessage){const t=document.createElement("li");t.id="noresult",t.setAttribute("disabled",""),t.innerText=this.emptyMessage,this.listContainer.appendChild(t),i&&i.length>0&&t.classList.add("hidden")}this.value=this.value||fu(this,Pr),this.selectItem(this.findItem(this.value))}copyItems(i,e,t=0){if(this.sort!==void 0){const n=this.sort||"asc";i=i.sort((s,o)=>n==="desc"?(this.elementText(o)||this.itemValue(o)).localeCompare(this.elementText(s)||this.itemValue(s)):(this.elementText(s)||this.itemValue(s)).localeCompare(this.elementText(o)||this.itemValue(o)))}let r="";t>0&&(r=`calc(0.3em + ${t}*${fu(this,Bs)})`);for(const n of i){const s=n.cloneNode();s.replaceChildren();const o=document.createElement("div");r&&(o.style.paddingLeft=r);const a=document.createElement("div");o.appendChild(a);for(const c of n.childNodes)if(c.nodeName!=="UL"){const d=c.cloneNode(!0);d.nodeType===3&&d.nodeValue&&(d.nodeValue=d.nodeValue.trim()),a.appendChild(d)}s.appendChild(o),s.title=s.title||this.itemText(s);const l=n.querySelector("ul");if(l!=null&&l.childElementCount){const c=document.createElement("ul");if(s.appendChild(c),this.copyItems(Array.prototype.slice.call(l.children),c,t+1),this.collapse){const d=new ss;d.title="Open",d.dense=!0,d.classList.add("toggle-node","caret"),d.addEventListener("click",f=>{f.stopPropagation(),s.classList.toggle("open"),c.classList.toggle("open"),d.title=s.classList.contains("open")?"Close":"Open"}),o.prepend(d)}else c.classList.add("open")}e.appendChild(s),this.itemCount++}}render(){return X`
182
+ <rokit-collapsible ?dense="${this.dense}" part="collapsible">
183
+ <slot name="prefix" part="prefix" slot="prefix"></slot>
184
+ <slot name="suffix" part="suffix" slot="suffix"></slot>
185
+ <rokit-input id="input" slot="label"
186
+ ?clearable="${this.clearable}"
187
+ ?dense="${this.dense}"
188
+ @change="${()=>{this.checkInputValue(this.input.inputElement.value===""||!this.collapsible.open)}}"
189
+ @input="${()=>{this.filter(this.input.inputElement.value)}}"
190
+ @click="${()=>{this.collapsible.toggle(!0)}}"
191
+ @keydown="${i=>{switch(i.code){case"ArrowDown":i.preventDefault(),this.highlightNextItem();break;case"Enter":{const e=this.findItem(this.input.value);e?this.selectItem(e):this.filter(this.input.value);break}}}}"
192
+ ></rokit-input>
193
+ <ul id="list-container" tabindex="-1" part="list" class="open"
194
+ @mousedown="${i=>{i.preventDefault()}}"
195
+ @click="${i=>{const e=i.target.closest("li");e&&e.getAttribute("disabled")===null&&!e.classList.contains("divider")&&this.selectItem(e)}}"
196
+ @keydown="${i=>{var e,t;switch(i.code){case"Enter":this.selectItem(this.listContainer.querySelector("li.active"));break;case"ArrowDown":i.preventDefault(),this.highlightNextItem();break;case"ArrowUp":i.preventDefault(),this.highlightPreviousItem();break;case"ArrowRight":if(this.collapse){const r=this.listContainer.querySelector("li.active");r&&(i.preventDefault(),r.classList.add("open"),(e=r.querySelector("ul"))==null||e.classList.add("open"))}break;case"ArrowLeft":if(this.collapse){const r=this.listContainer.querySelector("li.active");r&&(i.preventDefault(),r.classList.remove("open"),(t=r.querySelector("ul"))==null||t.classList.remove("open"))}break;case"Escape":this.listContainer.blur();break}}}">
197
+ </ul>
198
+ <slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
199
+ </rokit-collapsible>
200
+ `}};Pr=new WeakMap;Bs=new WeakMap;gt.styles=[...Li.styles,Ie`
201
+ :host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
202
+ :host([dense]) li > div { padding: 4px 2px; }
203
+ :host([dense]) li.large > div, :host([dense]) li.header > div { padding-top: 6px; padding-bottom: 6px; }
204
+ #input { padding: 0; background-color: inherit; }
205
+ rokit-collapsible, #input { display: flex; flex-grow: 1; border: 0; }
206
+ rokit-collapsible::part(content) { display: flex; flex-direction: column; outline: 0; z-index: 1000; position: absolute; top: calc(100% + 2px); background-color: var(--rokit-background-color-inner); }
207
+ rokit-collapsible::part(header) { background-color: inherit !important; }
208
+ rokit-collapsible[open].has-content::part(content), rokit-collapsible.has-content.transitioning::part(content) { border: 2px solid var(--rokit-primary-color-transparent-inner); box-shadow: 0 0 10px var(--rokit-shadow-color-inner); clip-path: inset(0 -13px -13px 0); }
209
+ #list-container { outline: 0; }
210
+ #list-container-slot { display: none; }
211
+ ul { list-style-type: none; margin: 0; padding: 0; width: 100%; box-sizing: border-box; }
212
+ li > div, #noresult { display: flex; align-items:center; line-height: 1em; padding: 8px; white-space: nowrap; transition: all calc(0.5 * var(--rokit-transition-duration-inner)); }
213
+ li:not([disabled]):not(.divider) { cursor: pointer }
214
+ li:not([disabled]):not(.divider) > div:hover { background-color: var(--rokit-light-background-color-inner); }
215
+ li.active > div { color: var(--rokit-primary-color-inner); background-color: var(--rokit-light-background-color-inner); }
216
+ li.divider { border-top: 1px solid var(--rokit-light-background-darker-color-inner); height: 0; padding: 0; }
217
+ li.divider, li.header { pointer-events: none; }
218
+ li.header > div { font-size: 0.7rem; font-weight: bold; padding-top: 8px; }
219
+ li.large > div { padding-top: 10px; padding-bottom: 10px; }
220
+ .hidden { display: none !important; }
221
+ :host([collapse]) li > div { padding-left: 0; }
222
+ :host([collapse]) .toggle-node { position: absolute }
223
+ :host([collapse]) li > div > div { padding-left: 1.8em; }
224
+ :host([collapse]) ul:not(.open) { display: none; }
225
+ :host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
226
+ `];jt([Be()],gt.prototype,"emptyMessage",2);jt([Be()],gt.prototype,"sort",2);jt([Be()],gt.prototype,"collapsibleMaxHeight",2);jt([Be()],gt.prototype,"collapsibleOrientationLeft",2);jt([Be()],gt.prototype,"collapsibleOrientationRight",2);jt([Be()],gt.prototype,"collapsibleWidth",2);jt([Be()],gt.prototype,"inputMinWidth",2);jt([Be({type:Boolean})],gt.prototype,"collapse",2);jt([Be()],gt.prototype,"filterableThreshold",2);jt([Ni("rokit-collapsible")],gt.prototype,"collapsible",2);jt([Ni("#input")],gt.prototype,"input",2);jt([Ni("#list-container")],gt.prototype,"listContainer",2);jt([kc()],gt.prototype,"selectedItem",2);jt([kc()],gt.prototype,"itemCount",2);gt=jt([Ar("rokit-select")],gt);var Bg=Object.defineProperty,Fg=Object.getOwnPropertyDescriptor,go=(i,e,t,r)=>{for(var n=r>1?void 0:r?Fg(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Bg(e,t,n),n};let Kr=class extends pt{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(i){super.updated(i),this.resize==="auto"&&i.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const i=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");i.trim()!==""&&(this.value=i)}renderInput(){return X`
227
+ <textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
228
+ <slot id="content" @slotchange=${this.onSlotChange}></slot>
229
+ `}};Kr.styles=[...pt.styles,Ie`
230
+ :host { align-items: last baseline; }
231
+ #input { height: initial; }
232
+ #content { display: none; }
233
+ .wrapper { align-items: flex-start; }
234
+ `];go([Be()],Kr.prototype,"resize",2);go([Be()],Kr.prototype,"rows",2);go([Be()],Kr.prototype,"cols",2);Kr=go([Ar("rokit-textarea")],Kr);var qg=Object.defineProperty,Ug=Object.getOwnPropertyDescriptor,Uf=i=>{throw TypeError(i)},Di=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ug(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&qg(e,t,n),n},Vf=(i,e,t)=>e.has(i)||Uf("Cannot "+t),We=(i,e,t)=>(Vf(i,e,"read from private field"),t?t.call(i):e.get(i)),ua=(i,e,t)=>e.has(i)?Uf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ns=(i,e,t,r)=>(Vf(i,e,"write to private field"),e.set(i,t),t),it,Mi,jr;const Zi=18;let Fi=class extends pt{constructor(){super(...arguments),this.labelFormatter=i=>String(i),ua(this,it,[0,1]),ua(this,Mi,[We(this,it)[0],We(this,it)[1]]),ua(this,jr)}firstUpdated(){super.firstUpdated(),this.sliderElement.addEventListener("mousedown",i=>this.onKnobDrag(i)),this.sliderElement.addEventListener("touchstart",i=>this.onKnobDrag(i)),new ResizeObserver(()=>{this.updateKnobPositions()}).observe(this.sliderElement)}updated(i){if(super.updated(i),i.has("min")&&(We(this,it)[0]=parseFloat(this.min||"0"),We(this,it)[1]=Math.max(We(this,it)[0],We(this,it)[1])),i.has("max")&&(We(this,it)[1]=parseFloat(this.max||"1"),We(this,it)[0]=Math.min(We(this,it)[0],We(this,it)[1])),i.has("step")&&Ns(this,jr,this.step?parseFloat(this.step):void 0),i.has("value")||i.has("min")||i.has("max"))if(this.value)if(this.range!==void 0){const e=JSON.parse(this.value);Ns(this,Mi,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else Ns(this,Mi,[this.applyConstraints(parseFloat(this.value))]);else Ns(this,Mi,[We(this,it)[0],We(this,it)[1]]);this.updateKnobPositions()}updateValidity(i,e){super.updateValidity(i,e,this.sliderElement)}chooseKnob(i){if(!this.endKnob)return this.startKnob;let e=Math.abs(i-this.startKnob.offsetLeft)<Math.abs(i-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(e.id==="start"&&e.value===We(this,it)[0]?e=this.endKnob:e.id==="end"&&e.value===We(this,it)[1]&&(e=this.startKnob)),e}toScreenSpace(i){return(i-We(this,it)[0])/(We(this,it)[1]-We(this,it)[0])*this.track.offsetWidth}toValueSpace(i){return i/this.track.offsetWidth*(We(this,it)[1]-We(this,it)[0])+We(this,it)[0]}applyConstraints(i,e){let t=Math.min(Math.max(i,We(this,it)[0]),We(this,it)[1]);return We(this,jr)&&(t=Math.round(t/We(this,jr))*We(this,jr)),e!==void 0&&this.endKnob&&(t=e?Math.min(t,this.endKnob.value):Math.max(t,this.startKnob.value)),t}updateKnob(i,e){i.value=e,i.offset=this.toScreenSpace(e),i.label=this.labelFormatter(e),this.endKnob&&(i.id==="start"?this.track.style.borderLeftWidth=i.offset+"px":this.track.style.borderRightWidth=this.track.offsetWidth-i.offset+"px")}updateKnobPositions(){this.updateKnob(this.startKnob,We(this,Mi)[0]),this.endKnob&&this.updateKnob(this.endKnob,We(this,Mi)[1])}onKnobDrag(i){if(i.target instanceof Jr||this.classList.contains("has-value")||this.classList.contains("has-focus")){let e;const t=n=>{let s=0;n.type==="touchmove"||n.type==="touchstart"?s=n.touches[0].clientX:s=n.clientX,s=s-this.track.getBoundingClientRect().left,e||(e=this.chooseKnob(s),e.classList.add("focus")),this.updateKnob(e,this.applyConstraints(this.toValueSpace(s),e.id==="start"))},r=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),document.removeEventListener("mouseup",r),document.removeEventListener("touchend",r),e&&(e.classList.remove("focus"),this.range!==void 0?e.id==="end"?this.value=JSON.stringify([We(this,Mi)[0],e.value]):this.value=JSON.stringify([e.value,We(this,Mi)[1]]):this.value=String(e.value)),e=void 0};this.sliderElement.focus(),document.addEventListener("mousemove",t),document.addEventListener("touchmove",t),document.addEventListener("mouseup",r),document.addEventListener("touchend",r),t(i)}}renderInput(){return X`
235
+ ${super.renderInput()}
236
+ <div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
237
+ <div id="track"></div>
238
+ <rokit-slider-knob id="start"></rokit-slider-knob>
239
+ ${this.range===void 0?Ge:X`
240
+ <rokit-slider-knob id="end"></rokit-slider-knob>
241
+ `}
242
+ </div>
243
+ `}};it=new WeakMap;Mi=new WeakMap;jr=new WeakMap;Fi.styles=[...pt.styles,Ie`
244
+ :host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
245
+ :host(.has-label) .wrapper { padding-top: 1em; }
246
+ :host([sticky]) #slider { margin-top: ${.25*Zi+22}px; }
247
+ #input { display: none; }
248
+ #slider { display: flex; position: relative; align-items: center; width: 100%; height: ${Zi}px; padding: 0 ${Zi/2}px; outline: 0; }
249
+ :host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
250
+ #track { height: 2px; flex-grow: 1; background-color: #CCC; }
251
+ #slider[range] #track { background-color: color-mix(in srgb, var(--rokit-primary-color-inner) 60%, transparent); border-width: 0; border-color: #CCC; border-style: solid; }
252
+ `];Di([Be()],Fi.prototype,"range",2);Di([Be()],Fi.prototype,"labelFormatter",2);Di([Ni("#slider")],Fi.prototype,"sliderElement",2);Di([Ni("#track")],Fi.prototype,"track",2);Di([Ni("#start")],Fi.prototype,"startKnob",2);Di([Ni("#end")],Fi.prototype,"endKnob",2);Fi=Di([Ar("rokit-slider")],Fi);let Jr=class extends ct{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(i){i.has("offset")&&(this.style.left=this.offset+"px")}render(){return X`<label part="label">${this.label}</label>`}};Jr.styles=[Ie`
253
+ :host { position: absolute; width: ${Zi}px; height: ${Zi}px; border-radius: ${Zi}px; background-color: var(--rokit-primary-color-inner); }
254
+ :host(.focus), :host(:hover) { box-shadow: 0 0 0 ${Zi/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
255
+ label {
256
+ position: absolute;
257
+ top: calc(-2em - ${Zi/4}px);
258
+ left: 50%;
259
+ transform: translate(-50%, 0);
260
+ white-space: nowrap;
261
+ font-size: 0.75em;
262
+ font-weight: 500;
263
+ transition-property: top color background-color;
264
+ transition-duration: var(--rokit-transition-duration-inner);
265
+ pointer-events: none;
266
+ color: white;
267
+ background-color: var(--rokit-primary-color-inner);
268
+ padding: 0 4px;
269
+ border-radius: 3px;
270
+ }
271
+ label:after {
272
+ content: '';
273
+ width: 10px;
274
+ height: 10px;
275
+ position: absolute;
276
+ left: 50%;
277
+ bottom: -4px;
278
+ transform: translate(-50%, 0);
279
+ background-color: inherit;
280
+ clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
281
+ }
282
+ `];Di([Be()],Jr.prototype,"offset",2);Di([Be()],Jr.prototype,"label",2);Jr=Di([Ar("rokit-slider-knob")],Jr);class Qs extends HTMLElement{constructor(e,t,r,n){if(super(),this.template=new jm(r.store.getQuads(e,null,null,null),t,r),this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),r.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.appendChild(this.addButton)),this.template.path){let s=[];n&&(t.linked?s=r.store.getQuads(n,this.template.path,null,null):s=r.store.getQuads(n,this.template.path,null,Si));let o=!1;for(const a of s)this.isValueValid(a.object)&&(this.addPropertyInstance(a.object),this.template.hasValue&&a.object.equals(this.template.hasValue)&&(o=!0));r.editMode&&this.template.hasValue&&!o&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}if(r.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)&&(r.editMode&&!t.linked||this.childElementCount>0)){const s=this;s.classList.add("collapsible"),this.template.config.attributes.collapse==="open"&&s.classList.add("open");const o=document.createElement("h1");o.classList.add("activator"),o.innerText=this.template.label,o.addEventListener("click",()=>{s.classList.toggle("open")}),this.prepend(o)}}addPropertyInstance(e){var r,n,s;let t;if((r=this.template.shaclOr)!=null&&r.length||(n=this.template.shaclXone)!=null&&n.length){const o=(s=this.template.shaclOr)!=null&&s.length?this.template.shaclOr:this.template.shaclXone;let a=!1;if(e){const l=Om(o,e,this.template.config);l.length&&(t=Fs(this.template.clone().merge(l),e,!0),a=!0)}a||(t=Rf(o,this,this.template.config),zf(t,""))}else{let o=!1;if(e){const a=this.getRdfClassToLinkOrCreate();a&&this.template.config.store.countQuads(e,xt,a,Si)===0&&(o=!0)}t=Fs(this.template,e,void 0,o||this.template.parent.linked)}return this.addButton?this.insertBefore(t,this.addButton):this.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const r=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r)}toRDF(e,t){for(const r of this.querySelectorAll(":scope > .property-instance")){const n=qe.namedNode(r.dataset.path);if(r.firstChild instanceof ir){const s=r.firstChild.toRDF(e);e.addQuad(t,n,s,this.template.config.valuesGraphId)}else for(const s of r.querySelectorAll(":scope > .editor")){const o=zm(s);o&&e.addQuad(t,n,o,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,is,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const r=this.template.config.store.getObjects(t,is,null);for(const n of r)if(this.template.config.store.countQuads(e,xt,n,null)>0)return!0}return!1}createAddButton(){const e=new gt;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.classList.add("add-button");let t=[],r=this.getRdfClassToLinkOrCreate();if(r&&(t=Ks(r,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",n=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{Dm(s),s.classList.remove("fadeIn")},200)});else{const n=document.createElement("ul"),s=document.createElement("li");s.innerHTML="&#xFF0B; Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),n.appendChild(s);const o=document.createElement("li");o.classList.add("divider"),n.appendChild(o);const a=document.createElement("li");a.classList.add("header"),a.innerText="Or link existing:",n.appendChild(a);for(const l of t){const c=document.createElement("li"),d=typeof l.value=="string"?l.value:l.value.value;c.innerText=l.label?l.label:d,c.dataset.value=JSON.stringify(l.value),n.appendChild(c)}e.appendChild(n),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const l=JSON.parse(e.value);this.insertBefore(Fs(this.template,l,!0,!0),e)}e.value=""})}return e}}function Fs(i,e,t=!1,r=!1){var s;let n;if(i.extendedShapes.length){n=document.createElement("div"),n.classList.add("property-instance");for(const o of i.extendedShapes)n.appendChild(new ir(o,i.config,e,i.parent,i.nodeKind,i.label,r))}else{const o=Gm(i.path,(s=i.datatype)==null?void 0:s.value);o?i.config.editMode&&!r?n=o.createEditor(i,e):n=o.createViewer(i,e):n=qm(i,e||null,i.config.editMode&&!r),n.classList.add("property-instance"),r&&n.classList.add("linked")}return i.config.editMode&&zf(n,i.label,t),n.dataset.path=i.path,n}function zf(i,e,t=!1){const r=new ss;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.addEventListener("click",n=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const s=i.parentElement;i.remove(),s==null||s.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),i.appendChild(r)}window.customElements.define("shacl-property",Qs);function Vg(i,e){const t=document.createElement("div");t.dataset.subject=i,t.classList.add("shacl-group");let r=i;const n=e.store.getQuads(i,null,null,null),s=zn(n,"label",mc,e.languages);s&&(r=s);const o=zn(n,"order");o&&(t.style.order=o);const a=document.createElement("h1");return a.innerText=r,t.appendChild(a),e.attributes.collapse!==null&&(t.classList.add("collapsible"),e.attributes.collapse==="open"&&t.classList.add("open"),a.classList.add("activator"),a.addEventListener("click",()=>{t.classList.toggle("open")})),t}const wt=[];for(let i=0;i<256;++i)wt.push((i+256).toString(16).slice(1));function zg(i,e=0){return(wt[i[e+0]]+wt[i[e+1]]+wt[i[e+2]]+wt[i[e+3]]+"-"+wt[i[e+4]]+wt[i[e+5]]+"-"+wt[i[e+6]]+wt[i[e+7]]+"-"+wt[i[e+8]]+wt[i[e+9]]+"-"+wt[i[e+10]]+wt[i[e+11]]+wt[i[e+12]]+wt[i[e+13]]+wt[i[e+14]]+wt[i[e+15]]).toLowerCase()}let ha;const Hg=new Uint8Array(16);function Wg(){if(!ha){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ha=crypto.getRandomValues.bind(crypto)}return ha(Hg)}const Gg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),mu={randomUUID:Gg};function gu(i,e,t){var n;if(mu.randomUUID&&!i)return mu.randomUUID();i=i||{};const r=i.random??((n=i.rng)==null?void 0:n.call(i))??Wg();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,zg(r)}class ir extends HTMLElement{constructor(e,t,r,n,s,o,a){super(),this.owlImports=[],this.parent=n,this.config=t,this.shaclSubject=e,this.linked=a||!1;let l=r;if(!l){if(!s){const d=t.store.getObjects(e,`${Ae}nodeKind`,null);d.length&&(s=d[0])}s===void 0&&t.attributes.valuesNamespace||(s==null?void 0:s.value)===`${Ae}IRI`?l=qe.namedNode(t.attributes.valuesNamespace+gu()):l=qe.blankNode(gu())}this.nodeId=l;const c=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(c)){o=o||"Link";const d=document.createElement("label");d.innerText=o,d.classList.add("linked"),this.appendChild(d);const f=document.createElement("a");let g=r.termType==="BlankNode"?"_:"+r.value:r.value;f.innerText=g,f.classList.add("ref-link"),f.onclick=()=>{var y;(y=this.config.form.querySelector(`shacl-node[data-node-id='${g}']`))==null||y.scrollIntoView()},this.appendChild(f),this.style.flexDirection="row"}else{if(r&&t.renderedNodes.add(c),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const d=document.createElement("div");d.innerText=`id: ${this.nodeId.id}`,d.classList.add("node-id-display"),this.appendChild(d)}for(const d of t.store.getQuads(e,gc,null,null))this.owlImports.push(d.object);for(const d of t.store.getQuads(e,null,null,null))switch(d.predicate.id){case Gs.id:this.addPropertyInstance(d.object,t,r);break;case`${Ae}and`:const f=t.lists[d.object.value];if(f!=null&&f.length)for(const g of f)this.prepend(new ir(g,t,r,this));else console.error("list not found:",d.object.value,"existing lists:",t.lists);break;case`${Ae}node`:this.prepend(new ir(d.object,t,r,this));break;case`${Ae}targetClass`:this.targetClass=d.object;break;case`${Ae}or`:this.tryResolve(d.object,r,t);break;case`${Ae}xone`:this.tryResolve(d.object,r,t);break}if(o){const d=document.createElement("h1");d.innerText=o,this.prepend(d)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,t);this.targetClass&&e.addQuad(t,xt,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,qe.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,r){let n=this;const s=t.store.getQuads(e,`${Ae}group`,null,null);if(s.length>0){const a=s[0].object.value;if(t.groups.indexOf(a)>-1){let l=this.querySelector(`:scope > .shacl-group[data-subject='${a}']`);l||(l=Vg(a,t),this.appendChild(l)),n=l}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const o=new Qs(e,this,t,r);o.childElementCount>0&&n.appendChild(o)}tryResolve(e,t,r){const n=r.lists[e.value];if(n!=null&&n.length){let s=!1;if(t){const o=Mm(n,t,r);if(o.length){for(const a of o)this.addPropertyInstance(a,r,t);s=!0}}s||this.appendChild(Rf(n,this,r))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",r.lists)}}window.customElements.define("shacl-node",ir);var fa={},pa,yu;function Ic(){return yu||(yu=1,pa=class Hf{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:e,_existing:t,counter:r}=this;return new Hf(e,new Map(t),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),pa}var ma={},bu;function Kg(){return bu||(bu=1,function(i,e){if(i.setImmediate)return;var t=1,r={},n=!1,s=i.document,o;function a(k){typeof k!="function"&&(k=new Function(""+k));for(var v=new Array(arguments.length-1),u=0;u<v.length;u++)v[u]=arguments[u+1];var m={callback:k,args:v};return r[t]=m,o(t),t++}function l(k){delete r[k]}function c(k){var v=k.callback,u=k.args;switch(u.length){case 0:v();break;case 1:v(u[0]);break;case 2:v(u[0],u[1]);break;case 3:v(u[0],u[1],u[2]);break;default:v.apply(e,u);break}}function d(k){if(n)setTimeout(d,0,k);else{var v=r[k];if(v){n=!0;try{c(v)}finally{l(k),n=!1}}}}function f(){o=function(k){process.nextTick(function(){d(k)})}}function g(){if(i.postMessage&&!i.importScripts){var k=!0,v=i.onmessage;return i.onmessage=function(){k=!1},i.postMessage("","*"),i.onmessage=v,k}}function y(){var k="setImmediate$"+Math.random()+"$",v=function(u){u.source===i&&typeof u.data=="string"&&u.data.indexOf(k)===0&&d(+u.data.slice(k.length))};i.addEventListener?i.addEventListener("message",v,!1):i.attachEvent("onmessage",v),o=function(u){i.postMessage(k+u,"*")}}function b(){var k=new MessageChannel;k.port1.onmessage=function(v){var u=v.data;d(u)},o=function(v){k.port2.postMessage(v)}}function _(){var k=s.documentElement;o=function(v){var u=s.createElement("script");u.onreadystatechange=function(){d(v),u.onreadystatechange=null,k.removeChild(u),u=null},k.appendChild(u)}}function E(){o=function(k){setTimeout(d,0,k)}}var S=Object.getPrototypeOf&&Object.getPrototypeOf(i);S=S&&S.setTimeout?S:i,{}.toString.call(i.process)==="[object process]"?f():g()?y():i.MessageChannel?b():s&&"onreadystatechange"in s.createElement("script")?_():E(),S.setImmediate=a,S.clearImmediate=l}(typeof self>"u"?typeof Fr>"u"?ma:Fr:self)),ma}/*!
283
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
284
+ */var ga,vu;function yo(){if(vu)return ga;vu=1,Kg();const i=self.crypto||self.msCrypto;return ga=class{constructor(t){if(!(i&&i.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(`Unsupported algorithm "${t}".`);this._content=""}update(t){this._content+=t}async digest(){const t=new TextEncoder().encode(this._content),r=new Uint8Array(await i.subtle.digest(this.algorithm,t));let n="";for(let s=0;s<r.length;++s)n+=r[s].toString(16).padStart(2,"0");return n}},ga}/*!
285
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
286
+ */var ya,wu;function Wf(){return wu||(wu=1,ya=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,s=0;const o=e.length;for(let a=0;a<o;++a){const l=e[a],c=t.get(l);(n===null||l>n)&&(c&&a>0&&l>e[a-1]||!c&&a<o-1&&l>e[a+1])&&(n=l,s=a)}if(n===null)this.done=!0;else{const a=t.get(n)?s-1:s+1;e[s]=e[a],e[a]=n;for(const l of e)l>n&&t.set(l,!t.get(l))}return r}}),ya}/*!
287
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
288
+ */var ba,_u;function Rc(){if(_u)return ba;_u=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",t="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",n="BlankNode",s="Literal",o="DefaultGraph",a={};(()=>{const y="(?:<([^:]+:[^>]*)>)",_="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�"+"_",E=_+"0-9-·̀-ͯ‿-⁀",k="(_:(?:["+_+"0-9])(?:(?:["+E+".])*(?:["+E+"]))?)",v='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',u="(?:\\^\\^"+y+")",T="(?:"+v+"(?:"+u+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",N="[ \\t]+",$="[ \\t]*",j="(?:"+y+"|"+k+")"+N,R=y+N,P="(?:"+y+"|"+k+"|"+T+")"+$,q="(?:\\.|(?:(?:"+y+"|"+k+")"+$+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+$+"$"),a.quad=new RegExp("^"+$+j+R+P+q+$+"$")})(),ba=class qs{static parse(b){const _=[],E={},S=b.split(a.eoln);let k=0;for(const v of S){if(k++,a.empty.test(v))continue;const u=v.match(a.quad);if(u===null)throw new Error("N-Quads parse error on line "+k+".");const m={subject:null,predicate:null,object:null,graph:null};if(u[1]!==void 0?m.subject={termType:r,value:u[1]}:m.subject={termType:n,value:u[2]},m.predicate={termType:r,value:u[3]},u[4]!==void 0?m.object={termType:r,value:u[4]}:u[5]!==void 0?m.object={termType:n,value:u[5]}:(m.object={termType:s,value:void 0,datatype:{termType:r}},u[7]!==void 0?m.object.datatype.value=u[7]:u[8]!==void 0?(m.object.datatype.value=e,m.object.language=u[8]):m.object.datatype.value=t,m.object.value=g(u[6])),u[9]!==void 0?m.graph={termType:r,value:u[9]}:u[10]!==void 0?m.graph={termType:n,value:u[10]}:m.graph={termType:o,value:""},!(m.graph.value in E))E[m.graph.value]=[m],_.push(m);else{let T=!0;const N=E[m.graph.value];for(const $ of N)if(l($,m)){T=!1;break}T&&(N.push(m),_.push(m))}}return _}static serialize(b){Array.isArray(b)||(b=qs.legacyDatasetToQuads(b));const _=[];for(const E of b)_.push(qs.serializeQuad(E));return _.sort().join("")}static serializeQuadComponents(b,_,E,S){let k="";return b.termType===r?k+=`<${b.value}>`:k+=`${b.value}`,k+=` <${_.value}> `,E.termType===r?k+=`<${E.value}>`:E.termType===n?k+=E.value:(k+=`"${d(E.value)}"`,E.datatype.value===e?E.language&&(k+=`@${E.language}`):E.datatype.value!==t&&(k+=`^^<${E.datatype.value}>`)),S.termType===r?k+=` <${S.value}>`:S.termType===n&&(k+=` ${S.value}`),k+=` .
289
+ `,k}static serializeQuad(b){return qs.serializeQuadComponents(b.subject,b.predicate,b.object,b.graph)}static legacyDatasetToQuads(b){const _=[],E={"blank node":n,IRI:r,literal:s};for(const S in b)b[S].forEach(v=>{const u={};for(const m in v){const T=v[m],N={termType:E[T.type],value:T.value};N.termType===s&&(N.datatype={termType:r},"datatype"in T&&(N.datatype.value=T.datatype),"language"in T?("datatype"in T||(N.datatype.value=e),N.language=T.language):"datatype"in T||(N.datatype.value=t)),u[m]=N}S==="@default"?u.graph={termType:o,value:""}:u.graph={termType:S.startsWith("_:")?n:r,value:S},_.push(u)});return _}};function l(y,b){return!(y.subject.termType===b.subject.termType&&y.object.termType===b.object.termType)||!(y.subject.value===b.subject.value&&y.predicate.value===b.predicate.value&&y.object.value===b.object.value)?!1:y.object.termType!==s?!0:y.object.datatype.termType===b.object.datatype.termType&&y.object.language===b.object.language&&y.object.datatype.value===b.object.datatype.value}const c=/["\\\n\r]/g;function d(y){return y.replace(c,function(b){switch(b){case'"':return'\\"';case"\\":return"\\\\";case`
290
+ `:return"\\n";case"\r":return"\\r"}})}const f=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function g(y){return y.replace(f,function(b,_,E,S){if(_)switch(_){case"t":return" ";case"b":return"\b";case"n":return`
291
+ `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(E)return String.fromCharCode(parseInt(E,16));if(S)throw new Error("Unsupported U escape")})}return ba}/*!
292
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
293
+ */var va,xu;function Gf(){if(xu)return va;xu=1;const i=Ic(),e=yo(),t=Wf(),r=Rc();va=class{constructor({createMessageDigest:o=()=>new e("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",a),this.createMessageDigest=o,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}async main(o){this.deepIterations=new Map,this.quads=o;for(const y of o)this._addBlankNodeQuadInfo({quad:y,component:y.subject}),this._addBlankNodeQuadInfo({quad:y,component:y.object}),this._addBlankNodeQuadInfo({quad:y,component:y.graph});const a=new Map,l=[...this.blankNodeInfo.keys()];let c=0;for(const y of l)++c%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:y,hashToBlankNodes:a});const d=[...a.keys()].sort(),f=[];for(const y of d){const b=a.get(y);if(b.length>1){f.push(b);continue}const _=b[0];this.canonicalIssuer.getId(_)}for(const y of f){const b=[];for(const _ of y){if(this.canonicalIssuer.hasId(_))continue;const E=new i("_:b");E.getId(_);const S=await this.hashNDegreeQuads(_,E);b.push(S)}b.sort(n);for(const _ of b){const E=_.issuer.getOldIds();for(const S of E)this.canonicalIssuer.getId(S)}}const g=[];for(const y of this.quads){const b=r.serializeQuadComponents(this._componentWithCanonicalId(y.subject),y.predicate,this._componentWithCanonicalId(y.object),this._componentWithCanonicalId(y.graph));g.push(b)}return g.sort(),g.join("")}async hashFirstDegreeQuads(o){const a=[],l=this.blankNodeInfo.get(o),c=l.quads;for(const f of c){const g={subject:null,predicate:f.predicate,object:null,graph:null};g.subject=this.modifyFirstDegreeComponent(o,f.subject,"subject"),g.object=this.modifyFirstDegreeComponent(o,f.object,"object"),g.graph=this.modifyFirstDegreeComponent(o,f.graph,"graph"),a.push(r.serializeQuad(g))}a.sort();const d=this.createMessageDigest();for(const f of a)d.update(f);return l.hash=await d.digest(),l.hash}async hashRelatedBlankNode(o,a,l,c){let d;this.canonicalIssuer.hasId(o)?d=this.canonicalIssuer.getId(o):l.hasId(o)?d=l.getId(o):d=this.blankNodeInfo.get(o).hash;const f=this.createMessageDigest();return f.update(c),c!=="g"&&f.update(this.getRelatedPredicate(a)),f.update(d),f.digest()}async hashNDegreeQuads(o,a){const l=this.deepIterations.get(o)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(o,l+1);const c=this.createMessageDigest(),d=await this.createHashToRelated(o,a),f=[...d.keys()].sort();for(const g of f){c.update(g);let y="",b;const _=new t(d.get(g));let E=0;for(;_.hasNext();){const S=_.next();++E%3===0&&await this._yield();let k=a.clone(),v="";const u=[];let m=!1;for(const T of S)if(this.canonicalIssuer.hasId(T)?v+=this.canonicalIssuer.getId(T):(k.hasId(T)||u.push(T),v+=k.getId(T)),y.length!==0&&v>y){m=!0;break}if(!m){for(const T of u){const N=await this.hashNDegreeQuads(T,k);if(v+=k.getId(T),v+=`<${N.hash}>`,k=N.issuer,y.length!==0&&v>y){m=!0;break}}m||(y.length===0||v<y)&&(y=v,b=k)}}c.update(y),a=b}return{hash:await c.digest(),issuer:a}}modifyFirstDegreeComponent(o,a){return a.termType!=="BlankNode"?a:{termType:"BlankNode",value:a.value===o?"_:a":"_:z"}}getRelatedPredicate(o){return`<${o.predicate.value}>`}async createHashToRelated(o,a){const l=new Map,c=this.blankNodeInfo.get(o).quads;let d=0;for(const f of c)++d%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:f,component:f.subject,position:"s",id:o,issuer:a,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:f,component:f.object,position:"o",id:o,issuer:a,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:f,component:f.graph,position:"g",id:o,issuer:a,hashToRelated:l})]);return l}async _hashAndTrackBlankNode({id:o,hashToBlankNodes:a}){const l=await this.hashFirstDegreeQuads(o),c=a.get(l);c?c.push(o):a.set(l,[o])}_addBlankNodeQuadInfo({quad:o,component:a}){if(a.termType!=="BlankNode")return;const l=a.value,c=this.blankNodeInfo.get(l);c?c.quads.add(o):this.blankNodeInfo.set(l,{quads:new Set([o]),hash:null})}async _addRelatedBlankNodeHash({quad:o,component:a,position:l,id:c,issuer:d,hashToRelated:f}){if(!(a.termType==="BlankNode"&&a.value!==c))return;const g=a.value,y=await this.hashRelatedBlankNode(g,o,d,l),b=f.get(y);b?b.push(g):f.set(y,[g])}_componentWithCanonicalId(o){return o.termType==="BlankNode"&&!o.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(o.value)}:o}async _yield(){return new Promise(o=>setImmediate(o))}};function n(s,o){return s.hash<o.hash?-1:s.hash>o.hash?1:0}return va}/*!
294
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
295
+ */var wa,Eu;function Jg(){if(Eu)return wa;Eu=1;const i=yo(),e=Gf();return wa=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,n,s){return n.termType!=="BlankNode"?n:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:n.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}async createHashToRelated(r,n){const s=new Map,o=this.blankNodeInfo.get(r).quads;let a=0;for(const l of o){let c,d;if(l.subject.termType==="BlankNode"&&l.subject.value!==r)d=l.subject.value,c="p";else if(l.object.termType==="BlankNode"&&l.object.value!==r)d=l.object.value,c="r";else continue;++a%100===0&&await this._yield();const f=await this.hashRelatedBlankNode(d,l,n,c),g=s.get(f);g?g.push(d):s.set(f,[d])}return s}},wa}/*!
296
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
297
+ */var _a,Su;function Kf(){if(Su)return _a;Su=1;const i=Ic(),e=yo(),t=Wf(),r=Rc();_a=class{constructor({createMessageDigest:o=()=>new e("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",a),this.createMessageDigest=o,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}main(o){this.deepIterations=new Map,this.quads=o;for(const g of o)this._addBlankNodeQuadInfo({quad:g,component:g.subject}),this._addBlankNodeQuadInfo({quad:g,component:g.object}),this._addBlankNodeQuadInfo({quad:g,component:g.graph});const a=new Map,l=[...this.blankNodeInfo.keys()];for(const g of l)this._hashAndTrackBlankNode({id:g,hashToBlankNodes:a});const c=[...a.keys()].sort(),d=[];for(const g of c){const y=a.get(g);if(y.length>1){d.push(y);continue}const b=y[0];this.canonicalIssuer.getId(b)}for(const g of d){const y=[];for(const b of g){if(this.canonicalIssuer.hasId(b))continue;const _=new i("_:b");_.getId(b);const E=this.hashNDegreeQuads(b,_);y.push(E)}y.sort(n);for(const b of y){const _=b.issuer.getOldIds();for(const E of _)this.canonicalIssuer.getId(E)}}const f=[];for(const g of this.quads){const y=r.serializeQuadComponents(this._componentWithCanonicalId({component:g.subject}),g.predicate,this._componentWithCanonicalId({component:g.object}),this._componentWithCanonicalId({component:g.graph}));f.push(y)}return f.sort(),f.join("")}hashFirstDegreeQuads(o){const a=[],l=this.blankNodeInfo.get(o),c=l.quads;for(const f of c){const g={subject:null,predicate:f.predicate,object:null,graph:null};g.subject=this.modifyFirstDegreeComponent(o,f.subject,"subject"),g.object=this.modifyFirstDegreeComponent(o,f.object,"object"),g.graph=this.modifyFirstDegreeComponent(o,f.graph,"graph"),a.push(r.serializeQuad(g))}a.sort();const d=this.createMessageDigest();for(const f of a)d.update(f);return l.hash=d.digest(),l.hash}hashRelatedBlankNode(o,a,l,c){let d;this.canonicalIssuer.hasId(o)?d=this.canonicalIssuer.getId(o):l.hasId(o)?d=l.getId(o):d=this.blankNodeInfo.get(o).hash;const f=this.createMessageDigest();return f.update(c),c!=="g"&&f.update(this.getRelatedPredicate(a)),f.update(d),f.digest()}hashNDegreeQuads(o,a){const l=this.deepIterations.get(o)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(o,l+1);const c=this.createMessageDigest(),d=this.createHashToRelated(o,a),f=[...d.keys()].sort();for(const g of f){c.update(g);let y="",b;const _=new t(d.get(g));for(;_.hasNext();){const E=_.next();let S=a.clone(),k="";const v=[];let u=!1;for(const m of E)if(this.canonicalIssuer.hasId(m)?k+=this.canonicalIssuer.getId(m):(S.hasId(m)||v.push(m),k+=S.getId(m)),y.length!==0&&k>y){u=!0;break}if(!u){for(const m of v){const T=this.hashNDegreeQuads(m,S);if(k+=S.getId(m),k+=`<${T.hash}>`,S=T.issuer,y.length!==0&&k>y){u=!0;break}}u||(y.length===0||k<y)&&(y=k,b=S)}}c.update(y),a=b}return{hash:c.digest(),issuer:a}}modifyFirstDegreeComponent(o,a){return a.termType!=="BlankNode"?a:{termType:"BlankNode",value:a.value===o?"_:a":"_:z"}}getRelatedPredicate(o){return`<${o.predicate.value}>`}createHashToRelated(o,a){const l=new Map,c=this.blankNodeInfo.get(o).quads;for(const d of c)this._addRelatedBlankNodeHash({quad:d,component:d.subject,position:"s",id:o,issuer:a,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:d,component:d.object,position:"o",id:o,issuer:a,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:d,component:d.graph,position:"g",id:o,issuer:a,hashToRelated:l});return l}_hashAndTrackBlankNode({id:o,hashToBlankNodes:a}){const l=this.hashFirstDegreeQuads(o),c=a.get(l);c?c.push(o):a.set(l,[o])}_addBlankNodeQuadInfo({quad:o,component:a}){if(a.termType!=="BlankNode")return;const l=a.value,c=this.blankNodeInfo.get(l);c?c.quads.add(o):this.blankNodeInfo.set(l,{quads:new Set([o]),hash:null})}_addRelatedBlankNodeHash({quad:o,component:a,position:l,id:c,issuer:d,hashToRelated:f}){if(!(a.termType==="BlankNode"&&a.value!==c))return;const g=a.value,y=this.hashRelatedBlankNode(g,o,d,l),b=f.get(y);b?b.push(g):f.set(y,[g])}_componentWithCanonicalId({component:o}){return o.termType==="BlankNode"&&!o.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(o.value)}:o}};function n(s,o){return s.hash<o.hash?-1:s.hash>o.hash?1:0}return _a}/*!
298
+ * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
299
+ */var xa,ku;function Xg(){if(ku)return xa;ku=1;const i=yo(),e=Kf();return xa=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,n,s){return n.termType!=="BlankNode"?n:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:n.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}createHashToRelated(r,n){const s=new Map,o=this.blankNodeInfo.get(r).quads;for(const a of o){let l,c;if(a.subject.termType==="BlankNode"&&a.subject.value!==r)c=a.subject.value,l="p";else if(a.object.termType==="BlankNode"&&a.object.value!==r)c=a.object.value,l="r";else continue;const d=this.hashRelatedBlankNode(c,a,n,l),f=s.get(d);f?f.push(c):s.set(d,[c])}return s}},xa}const Qg={},Yg=Object.freeze(Object.defineProperty({__proto__:null,default:Qg},Symbol.toStringTag,{value:"Module"})),Zg=Yp(Yg);var Iu;function ey(){return Iu||(Iu=1,function(i){const e=Gf(),t=Jg(),r=Kf(),n=Xg();let s;try{s=Zg}catch{}function o(a){return Array.isArray(a)?a:i.NQuads.legacyDatasetToQuads(a)}i.NQuads=Rc(),i.IdentifierIssuer=Ic(),i._rdfCanonizeNative=function(a){return a&&(s=a),s},i.canonize=async function(a,l){const c=o(a);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((d,f)=>s.canonize(c,l,(g,y)=>g?f(g):d(y)))}if(l.algorithm==="URDNA2015")return new e(l).main(c);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new t(l).main(c)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},i._canonizeSync=function(a,l){const c=o(a);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(c,l)}if(l.algorithm==="URDNA2015")return new r(l).main(c);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(l).main(c)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}}(fa)),fa}var Ea,Ru;function Tc(){return Ru||(Ru=1,Ea=ey()),Ea}var Sa,Tu;function ii(){if(Tu)return Sa;Tu=1;const i={};return Sa=i,i.isArray=Array.isArray,i.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",i.isDouble=e=>i.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),i.isEmptyObject=e=>i.isObject(e)&&Object.keys(e).length===0,i.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",i.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),i.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",i.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",i.isUndefined=e=>typeof e>"u",Sa}var ka,$u;function Gi(){if($u)return ka;$u=1;const i=ii(),e={};return ka=e,e.isSubject=t=>i.isObject(t)&&!("@value"in t||"@set"in t||"@list"in t)?Object.keys(t).length>1||!("@id"in t):!1,e.isSubjectReference=t=>i.isObject(t)&&Object.keys(t).length===1&&"@id"in t,e.isValue=t=>i.isObject(t)&&"@value"in t,e.isList=t=>i.isObject(t)&&"@list"in t,e.isGraph=t=>i.isObject(t)&&"@graph"in t&&Object.keys(t).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=t=>e.isGraph(t)&&!("@id"in t),e.isBlankNode=t=>{if(i.isObject(t)){if("@id"in t){const r=t["@id"];return!i.isString(r)||r.indexOf("_:")===0}return Object.keys(t).length===0||!("@value"in t||"@set"in t||"@list"in t)}return!1},ka}var Ia,Cu;function di(){return Cu||(Cu=1,Ia=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}),Ia}var Ra,Au;function oi(){if(Au)return Ra;Au=1;const i=Gi(),e=ii(),t=Tc().IdentifierIssuer,r=di(),n=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,o=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,a=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l=/^@[a-zA-Z]+$/,c={headers:{accept:"application/ld+json, application/json"}},d={};Ra=d,d.IdentifierIssuer=t,d.REGEX_BCP47=n,d.REGEX_KEYWORD=l,d.clone=function(g){if(g&&typeof g=="object"){let y;if(e.isArray(g)){y=[];for(let b=0;b<g.length;++b)y[b]=d.clone(g[b])}else if(g instanceof Map){y=new Map;for(const[b,_]of g)y.set(b,d.clone(_))}else if(g instanceof Set){y=new Set;for(const b of g)y.add(d.clone(b))}else if(e.isObject(g)){y={};for(const b in g)y[b]=d.clone(g[b])}else y=g.toString();return y}return g},d.asArray=function(g){return Array.isArray(g)?g:[g]},d.buildHeaders=(g={})=>{if(Object.keys(g).some(b=>b.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+c.headers.accept+'" is supported.');return Object.assign({Accept:c.headers.accept},g)},d.parseLinkHeader=g=>{const y={},b=g.match(s);for(let _=0;_<b.length;++_){let E=b[_].match(o);if(!E)continue;const S={target:E[1]},k=E[2];for(;E=a.exec(k);)S[E[1]]=E[2]===void 0?E[3]:E[2];const v=S.rel||"";Array.isArray(y[v])?y[v].push(S):y.hasOwnProperty(v)?y[v]=[y[v],S]:y[v]=S}return y},d.validateTypeValue=(g,y)=>{if(!e.isString(g)&&!(e.isArray(g)&&g.every(b=>e.isString(b)))){if(y&&e.isObject(g))switch(Object.keys(g).length){case 0:return;case 1:if("@default"in g&&d.asArray(g["@default"]).every(b=>e.isString(b)))return}throw new r('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:g})}},d.hasProperty=(g,y)=>{if(g.hasOwnProperty(y)){const b=g[y];return!e.isArray(b)||b.length>0}return!1},d.hasValue=(g,y,b)=>{if(d.hasProperty(g,y)){let _=g[y];const E=i.isList(_);if(e.isArray(_)||E){E&&(_=_["@list"]);for(let S=0;S<_.length;++S)if(d.compareValues(b,_[S]))return!0}else if(!e.isArray(b))return d.compareValues(b,_)}return!1},d.addValue=(g,y,b,_)=>{if(_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1),"valueIsArray"in _||(_.valueIsArray=!1),"allowDuplicate"in _||(_.allowDuplicate=!0),"prependValue"in _||(_.prependValue=!1),_.valueIsArray)g[y]=b;else if(e.isArray(b)){b.length===0&&_.propertyIsArray&&!g.hasOwnProperty(y)&&(g[y]=[]),_.prependValue&&(b=b.concat(g[y]),g[y]=[]);for(let E=0;E<b.length;++E)d.addValue(g,y,b[E],_)}else if(g.hasOwnProperty(y)){const E=!_.allowDuplicate&&d.hasValue(g,y,b);!e.isArray(g[y])&&(!E||_.propertyIsArray)&&(g[y]=[g[y]]),E||(_.prependValue?g[y].unshift(b):g[y].push(b))}else g[y]=_.propertyIsArray?[b]:b},d.getValues=(g,y)=>[].concat(g[y]||[]),d.removeProperty=(g,y)=>{delete g[y]},d.removeValue=(g,y,b,_)=>{_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1);const E=d.getValues(g,y).filter(S=>!d.compareValues(S,b));E.length===0?d.removeProperty(g,y):E.length===1&&!_.propertyIsArray?g[y]=E[0]:g[y]=E},d.relabelBlankNodes=(g,y)=>{y=y||{};const b=y.issuer||new t("_:b");return f(b,g)},d.compareValues=(g,y)=>g===y||i.isValue(g)&&i.isValue(y)&&g["@value"]===y["@value"]&&g["@type"]===y["@type"]&&g["@language"]===y["@language"]&&g["@index"]===y["@index"]?!0:e.isObject(g)&&"@id"in g&&e.isObject(y)&&"@id"in y?g["@id"]===y["@id"]:!1,d.compareShortestLeast=(g,y)=>g.length<y.length?-1:y.length<g.length?1:g===y?0:g<y?-1:1;function f(g,y){if(e.isArray(y))for(let b=0;b<y.length;++b)y[b]=f(g,y[b]);else if(i.isList(y))y["@list"]=f(g,y["@list"]);else if(e.isObject(y)){i.isBlankNode(y)&&(y["@id"]=g.getId(y["@id"]));const b=Object.keys(y).sort();for(let _=0;_<b.length;++_){const E=b[_];E!=="@id"&&(y[E]=f(g,y[E]))}}return y}return Ra}var Ta,Nu;function $c(){if(Nu)return Ta;Nu=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Ta={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Ta}var $a,Lu;function Jf(){return Lu||(Lu=1,$a=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}),$a}var Ca,Du;function or(){if(Du)return Ca;Du=1;const i=ii(),e={};Ca=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(r,n)=>{const s={},o=e.parsers[n||"full"],a=o.regex.exec(r);let l=o.keys.length;for(;l--;)s[o.keys[l]]=a[l]===void 0?null:a[l];return(s.scheme==="https"&&s.port==="443"||s.scheme==="http"&&s.port==="80")&&(s.href=s.href.replace(":"+s.port,""),s.authority=s.authority.replace(":"+s.port,""),s.port=null),s.normalizedPath=e.removeDotSegments(s.path),s},e.prependBase=(r,n)=>{if(r===null||e.isAbsolute(n))return n;(!r||i.isString(r))&&(r=e.parse(r||""));const s=e.parse(n),o={protocol:r.protocol||""};if(s.authority!==null)o.authority=s.authority,o.path=s.path,o.query=s.query;else if(o.authority=r.authority,s.path==="")o.path=r.path,s.query!==null?o.query=s.query:o.query=r.query;else{if(s.path.indexOf("/")===0)o.path=s.path;else{let l=r.path;l=l.substr(0,l.lastIndexOf("/")+1),(l.length>0||r.authority)&&l.substr(-1)!=="/"&&(l+="/"),l+=s.path,o.path=l}o.query=s.query}s.path!==""&&(o.path=e.removeDotSegments(o.path));let a=o.protocol;return o.authority!==null&&(a+="//"+o.authority),a+=o.path,o.query!==null&&(a+="?"+o.query),s.fragment!==null&&(a+="#"+s.fragment),a===""&&(a="./"),a},e.removeBase=(r,n)=>{if(r===null)return n;(!r||i.isString(r))&&(r=e.parse(r||""));let s="";if(r.href!==""?s+=(r.protocol||"")+"//"+(r.authority||""):n.indexOf("//")&&(s+="//"),n.indexOf(s)!==0)return n;const o=e.parse(n.substr(s.length)),a=r.normalizedPath.split("/"),l=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;a.length>0&&l.length>c&&a[0]===l[0];)a.shift(),l.shift();let d="";if(a.length>0){a.pop();for(let f=0;f<a.length;++f)d+="../"}return d+=l.join("/"),o.query!==null&&(d+="?"+o.query),o.fragment!==null&&(d+="#"+o.fragment),d===""&&(d="./"),d},e.removeDotSegments=r=>{if(r.length===0)return"";const n=r.split("/"),s=[];for(;n.length>0;){const o=n.shift(),a=n.length===0;if(o==="."){a&&s.push("");continue}if(o===".."){s.pop(),a&&s.push("");continue}s.push(o)}return r[0]==="/"&&s.length>0&&s[0]!==""&&s.unshift(""),s.length===1&&s[0]===""?"/":s.join("/")};const t=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>i.isString(r)&&t.test(r),e.isRelative=r=>i.isString(r),Ca}var Aa,Ou;function ty(){if(Ou)return Aa;Ou=1;const{parseLinkHeader:i,buildHeaders:e}=oi(),{LINK_HEADER_CONTEXT:t}=$c(),r=di(),n=Jf(),{prependBase:s}=or(),o=/(^|(\r\n))link:/i;Aa=({secure:l,headers:c={},xhr:d}={headers:{}})=>{return c=e(c),new n().wrapLoader(g);async function g(y){if(y.indexOf("http:")!==0&&y.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:y});if(l&&y.indexOf("https")!==0)throw new r(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:y});let b;try{b=await a(d,y,c)}catch(v){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:y,cause:v})}if(b.status>=400)throw new r("URL could not be dereferenced: "+b.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:y,httpStatusCode:b.status});let _={contextUrl:null,documentUrl:y,document:b.response},E=null;const S=b.getResponseHeader("Content-Type");let k;if(o.test(b.getAllResponseHeaders())&&(k=b.getResponseHeader("Link")),k&&S!=="application/ld+json"){const v=i(k),u=v[t];if(Array.isArray(u))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:y});u&&(_.contextUrl=u.target),E=v.alternate,E&&E.type=="application/ld+json"&&!(S||"").match(/^application\/(\w*\+)?json$/)&&(_=await g(s(y,E.target)))}return _}};function a(l,c,d){l=l||XMLHttpRequest;const f=new l;return new Promise((g,y)=>{f.onload=()=>g(f),f.onerror=b=>y(b),f.open("GET",c,!0);for(const b in d)f.setRequestHeader(b,d[b]);f.send()})}return Aa}var Na,Mu;function iy(){if(Mu)return Na;Mu=1;const i=ty(),e={};return Na=e,e.setupDocumentLoaders=function(t){typeof XMLHttpRequest<"u"&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},e.setupGlobals=function(t){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})},Na}var La,Pu;function ry(){return Pu||(Pu=1,La=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),La}var Da,ju;function ny(){if(ju)return Da;ju=1,Da=i,i.Node=n,i.create=i;function i(s){var o=this;if(o instanceof i||(o=new i),o.tail=null,o.head=null,o.length=0,s&&typeof s.forEach=="function")s.forEach(function(c){o.push(c)});else if(arguments.length>0)for(var a=0,l=arguments.length;a<l;a++)o.push(arguments[a]);return o}i.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var o=s.next,a=s.prev;return o&&(o.prev=a),a&&(a.next=o),s===this.head&&(this.head=o),s===this.tail&&(this.tail=a),s.list.length--,s.next=null,s.prev=null,s.list=null,o},i.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var o=this.head;s.list=this,s.next=o,o&&(o.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}},i.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var o=this.tail;s.list=this,s.prev=o,o&&(o.next=s),this.tail=s,this.head||(this.head=s),this.length++}},i.prototype.push=function(){for(var s=0,o=arguments.length;s<o;s++)t(this,arguments[s]);return this.length},i.prototype.unshift=function(){for(var s=0,o=arguments.length;s<o;s++)r(this,arguments[s]);return this.length},i.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}},i.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}},i.prototype.forEach=function(s,o){o=o||this;for(var a=this.head,l=0;a!==null;l++)s.call(o,a.value,l,this),a=a.next},i.prototype.forEachReverse=function(s,o){o=o||this;for(var a=this.tail,l=this.length-1;a!==null;l--)s.call(o,a.value,l,this),a=a.prev},i.prototype.get=function(s){for(var o=0,a=this.head;a!==null&&o<s;o++)a=a.next;if(o===s&&a!==null)return a.value},i.prototype.getReverse=function(s){for(var o=0,a=this.tail;a!==null&&o<s;o++)a=a.prev;if(o===s&&a!==null)return a.value},i.prototype.map=function(s,o){o=o||this;for(var a=new i,l=this.head;l!==null;)a.push(s.call(o,l.value,this)),l=l.next;return a},i.prototype.mapReverse=function(s,o){o=o||this;for(var a=new i,l=this.tail;l!==null;)a.push(s.call(o,l.value,this)),l=l.prev;return a},i.prototype.reduce=function(s,o){var a,l=this.head;if(arguments.length>1)a=o;else if(this.head)l=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var c=0;l!==null;c++)a=s(a,l.value,c),l=l.next;return a},i.prototype.reduceReverse=function(s,o){var a,l=this.tail;if(arguments.length>1)a=o;else if(this.tail)l=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var c=this.length-1;l!==null;c--)a=s(a,l.value,c),l=l.prev;return a},i.prototype.toArray=function(){for(var s=new Array(this.length),o=0,a=this.head;a!==null;o++)s[o]=a.value,a=a.next;return s},i.prototype.toArrayReverse=function(){for(var s=new Array(this.length),o=0,a=this.tail;a!==null;o++)s[o]=a.value,a=a.prev;return s},i.prototype.slice=function(s,o){o=o||this.length,o<0&&(o+=this.length),s=s||0,s<0&&(s+=this.length);var a=new i;if(o<s||o<0)return a;s<0&&(s=0),o>this.length&&(o=this.length);for(var l=0,c=this.head;c!==null&&l<s;l++)c=c.next;for(;c!==null&&l<o;l++,c=c.next)a.push(c.value);return a},i.prototype.sliceReverse=function(s,o){o=o||this.length,o<0&&(o+=this.length),s=s||0,s<0&&(s+=this.length);var a=new i;if(o<s||o<0)return a;s<0&&(s=0),o>this.length&&(o=this.length);for(var l=this.length,c=this.tail;c!==null&&l>o;l--)c=c.prev;for(;c!==null&&l>s;l--,c=c.prev)a.push(c.value);return a},i.prototype.splice=function(s,o,...a){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var l=0,c=this.head;c!==null&&l<s;l++)c=c.next;for(var d=[],l=0;c&&l<o;l++)d.push(c.value),c=this.removeNode(c);c===null&&(c=this.tail),c!==this.head&&c!==this.tail&&(c=c.prev);for(var l=0;l<a.length;l++)c=e(this,c,a[l]);return d},i.prototype.reverse=function(){for(var s=this.head,o=this.tail,a=s;a!==null;a=a.prev){var l=a.prev;a.prev=a.next,a.next=l}return this.head=o,this.tail=s,this};function e(s,o,a){var l=o===s.head?new n(a,null,o,s):new n(a,o,o.next,s);return l.next===null&&(s.tail=l),l.prev===null&&(s.head=l),s.length++,l}function t(s,o){s.tail=new n(o,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function r(s,o){s.head=new n(o,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function n(s,o,a,l){if(!(this instanceof n))return new n(s,o,a,l);this.list=l,this.value=s,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{ry()(i)}catch{}return Da}var Oa,Bu;function Xf(){if(Bu)return Oa;Bu=1;const i=ny(),e=Symbol("max"),t=Symbol("length"),r=Symbol("lengthCalculator"),n=Symbol("allowStale"),s=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),l=Symbol("lruList"),c=Symbol("cache"),d=Symbol("updateAgeOnGet"),f=()=>1;class g{constructor(u){if(typeof u=="number"&&(u={max:u}),u||(u={}),u.max&&(typeof u.max!="number"||u.max<0))throw new TypeError("max must be a non-negative number");this[e]=u.max||1/0;const m=u.length||f;if(this[r]=typeof m!="function"?f:m,this[n]=u.stale||!1,u.maxAge&&typeof u.maxAge!="number")throw new TypeError("maxAge must be a number");this[s]=u.maxAge||0,this[o]=u.dispose,this[a]=u.noDisposeOnSet||!1,this[d]=u.updateAgeOnGet||!1,this.reset()}set max(u){if(typeof u!="number"||u<0)throw new TypeError("max must be a non-negative number");this[e]=u||1/0,_(this)}get max(){return this[e]}set allowStale(u){this[n]=!!u}get allowStale(){return this[n]}set maxAge(u){if(typeof u!="number")throw new TypeError("maxAge must be a non-negative number");this[s]=u,_(this)}get maxAge(){return this[s]}set lengthCalculator(u){typeof u!="function"&&(u=f),u!==this[r]&&(this[r]=u,this[t]=0,this[l].forEach(m=>{m.length=this[r](m.value,m.key),this[t]+=m.length})),_(this)}get lengthCalculator(){return this[r]}get length(){return this[t]}get itemCount(){return this[l].length}rforEach(u,m){m=m||this;for(let T=this[l].tail;T!==null;){const N=T.prev;k(this,u,T,m),T=N}}forEach(u,m){m=m||this;for(let T=this[l].head;T!==null;){const N=T.next;k(this,u,T,m),T=N}}keys(){return this[l].toArray().map(u=>u.key)}values(){return this[l].toArray().map(u=>u.value)}reset(){this[o]&&this[l]&&this[l].length&&this[l].forEach(u=>this[o](u.key,u.value)),this[c]=new Map,this[l]=new i,this[t]=0}dump(){return this[l].map(u=>b(this,u)?!1:{k:u.key,v:u.value,e:u.now+(u.maxAge||0)}).toArray().filter(u=>u)}dumpLru(){return this[l]}set(u,m,T){if(T=T||this[s],T&&typeof T!="number")throw new TypeError("maxAge must be a number");const N=T?Date.now():0,$=this[r](m,u);if(this[c].has(u)){if($>this[e])return E(this,this[c].get(u)),!1;const P=this[c].get(u).value;return this[o]&&(this[a]||this[o](u,P.value)),P.now=N,P.maxAge=T,P.value=m,this[t]+=$-P.length,P.length=$,this.get(u),_(this),!0}const j=new S(u,m,$,N,T);return j.length>this[e]?(this[o]&&this[o](u,m),!1):(this[t]+=j.length,this[l].unshift(j),this[c].set(u,this[l].head),_(this),!0)}has(u){if(!this[c].has(u))return!1;const m=this[c].get(u).value;return!b(this,m)}get(u){return y(this,u,!0)}peek(u){return y(this,u,!1)}pop(){const u=this[l].tail;return u?(E(this,u),u.value):null}del(u){E(this,this[c].get(u))}load(u){this.reset();const m=Date.now();for(let T=u.length-1;T>=0;T--){const N=u[T],$=N.e||0;if($===0)this.set(N.k,N.v);else{const j=$-m;j>0&&this.set(N.k,N.v,j)}}}prune(){this[c].forEach((u,m)=>y(this,m,!1))}}const y=(v,u,m)=>{const T=v[c].get(u);if(T){const N=T.value;if(b(v,N)){if(E(v,T),!v[n])return}else m&&(v[d]&&(T.value.now=Date.now()),v[l].unshiftNode(T));return N.value}},b=(v,u)=>{if(!u||!u.maxAge&&!v[s])return!1;const m=Date.now()-u.now;return u.maxAge?m>u.maxAge:v[s]&&m>v[s]},_=v=>{if(v[t]>v[e])for(let u=v[l].tail;v[t]>v[e]&&u!==null;){const m=u.prev;E(v,u),u=m}},E=(v,u)=>{if(u){const m=u.value;v[o]&&v[o](m.key,m.value),v[t]-=m.length,v[c].delete(m.key),v[l].removeNode(u)}};class S{constructor(u,m,T,N,$){this.key=u,this.value=m,this.length=T,this.now=N,this.maxAge=$||0}}const k=(v,u,m,T)=>{let N=m.value;b(v,N)&&(E(v,m),v[n]||(N=void 0)),N&&u.call(T,N.value,N.key,v)};return Oa=g,Oa}var Ma,Fu;function sy(){if(Fu)return Ma;Fu=1;const i=Xf(),e=10;return Ma=class{constructor({document:r}){this.document=r,this.cache=new i({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,n){this.cache.set(r,n)}},Ma}var Pa,qu;function oy(){if(qu)return Pa;qu=1;const{isArray:i,isObject:e,isString:t}=ii(),{asArray:r}=oi(),{prependBase:n}=or(),s=di(),o=sy(),a=10;Pa=class{constructor({sharedCache:f}){this.perOpCache=new Map,this.sharedCache=f}async resolve({activeCtx:f,context:g,documentLoader:y,base:b,cycles:_=new Set}){g&&e(g)&&g["@context"]&&(g=g["@context"]),g=r(g);const E=[];for(const S of g){if(t(S)){let u=this._get(S);u||(u=await this._resolveRemoteContext({activeCtx:f,url:S,documentLoader:y,base:b,cycles:_})),i(u)?E.push(...u):E.push(u);continue}if(S===null){E.push(new o({document:null}));continue}e(S)||l(g);const k=JSON.stringify(S);let v=this._get(k);v||(v=new o({document:S}),this._cacheResolvedContext({key:k,resolved:v,tag:"static"})),E.push(v)}return E}_get(f){let g=this.perOpCache.get(f);if(!g){const y=this.sharedCache.get(f);y&&(g=y.get("static"),g&&this.perOpCache.set(f,g))}return g}_cacheResolvedContext({key:f,resolved:g,tag:y}){if(this.perOpCache.set(f,g),y!==void 0){let b=this.sharedCache.get(f);b||(b=new Map,this.sharedCache.set(f,b)),b.set(y,g)}return g}async _resolveRemoteContext({activeCtx:f,url:g,documentLoader:y,base:b,cycles:_}){g=n(b,g);const{context:E,remoteDoc:S}=await this._fetchContext({activeCtx:f,url:g,documentLoader:y,cycles:_});b=S.documentUrl||g,c({context:E,base:b});const k=await this.resolve({activeCtx:f,context:E,documentLoader:y,base:b,cycles:_});return this._cacheResolvedContext({key:g,resolved:k,tag:S.tag}),k}async _fetchContext({activeCtx:f,url:g,documentLoader:y,cycles:b}){if(b.size>a)throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:f.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:a});if(b.has(g))throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:f.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:g});b.add(g);let _,E;try{E=await y(g),_=E.document||null,t(_)&&(_=JSON.parse(_))}catch(S){throw new s(`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. URL: "${g}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:g,cause:S})}if(!e(_))throw new s(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${g}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:g});return"@context"in _?_={"@context":_["@context"]}:_={"@context":{}},E.contextUrl&&(i(_["@context"])||(_["@context"]=[_["@context"]]),_["@context"].push(E.contextUrl)),{context:_,remoteDoc:E}}};function l(d){throw new s("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:d})}function c({context:d,base:f}){if(!d)return;const g=d["@context"];if(t(g)){d["@context"]=n(f,g);return}if(i(g)){for(let y=0;y<g.length;++y){const b=g[y];if(t(b)){g[y]=n(f,b);continue}e(b)&&c({context:{"@context":b},base:f})}return}if(e(g))for(const y in g)c({context:g[y],base:f})}return Pa}var ja,Uu;function ay(){return Uu||(Uu=1,ja=Tc().NQuads),ja}var Ba,Vu;function ms(){if(Vu)return Ba;Vu=1;const i=di(),{isArray:e}=ii(),{asArray:t}=oi(),r={};Ba=r,r.defaultEventHandler=null,r.setupEventHandler=({options:o={}})=>{const a=[].concat(o.safe?r.safeEventHandler:[],o.eventHandler?t(o.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return a.length===0?null:a},r.handleEvent=({event:o,options:a})=>{n({event:o,handlers:a.eventHandler})};function n({event:o,handlers:a}){let l=!0;for(let c=0;l&&c<a.length;++c){l=!1;const d=a[c];if(e(d))l=n({event:o,handlers:d});else if(typeof d=="function")d({event:o,next:()=>{l=!0}});else if(typeof d=="object")o.code in d?d[o.code]({event:o,next:()=>{l=!0}}):l=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:o})}return l}const s=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","rdfDirection not set"]);return r.safeEventHandler=function({event:a,next:l}){if(a.level==="warning"&&s.has(a.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:a});l()},r.logEventHandler=function({event:a,next:l}){console.log(`EVENT: ${a.message}`,{event:a}),l()},r.logWarningEventHandler=function({event:a,next:l}){a.level==="warning"&&console.warn(`WARNING: ${a.message}`,{event:a}),l()},r.unhandledEventHandler=function({event:a}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:a})},r.setDefaultEventHandler=function({eventHandler:o}={}){r.defaultEventHandler=o?t(o):null},Ba}var Fa,zu;function Ir(){if(zu)return Fa;zu=1;const i=oi(),e=di(),{isArray:t,isObject:r,isString:n,isUndefined:s}=ii(),{isAbsolute:o,isRelative:a,prependBase:l}=or(),{handleEvent:c}=ms(),{REGEX_BCP47:d,REGEX_KEYWORD:f,asArray:g,compareShortestLeast:y}=oi(),b=new Map,_=1e4,E={};Fa=E,E.process=async({activeCtx:v,localCtx:u,options:m,propagate:T=!0,overrideProtected:N=!1,cycles:$=new Set})=>{if(r(u)&&"@context"in u&&t(u["@context"])&&(u=u["@context"]),g(u).length===0)return v;const R=[],P=[({event:Q,next:A})=>{R.push(Q),A()}];m.eventHandler&&P.push(m.eventHandler);const q=m;m={...m,eventHandler:P};const I=await m.contextResolver.resolve({activeCtx:v,context:u,documentLoader:m.documentLoader,base:m.base});r(I[0].document)&&typeof I[0].document["@propagate"]=="boolean"&&(T=I[0].document["@propagate"]);let L=v;!T&&!L.previousContext&&(L=L.clone(),L.previousContext=v);for(const Q of I){let{document:A}=Q;if(v=L,A===null){if(!N&&Object.keys(v.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"});L=v=E.getInitialContext(m).clone();continue}const Y=Q.getProcessed(v);if(Y){if(q.eventHandler)for(const te of Y.events)c({event:te,options:q});L=v=Y.context;continue}if(r(A)&&"@context"in A&&(A=A["@context"]),!r(A))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:A});L=L.clone();const F=new Map;if("@version"in A){if(A["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+A["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:A});if(v.processingMode&&v.processingMode==="json-ld-1.0")throw new e("@version: "+A["@version"]+" not compatible with "+v.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:A});L.processingMode="json-ld-1.1",L["@version"]=A["@version"],F.set("@version",!0)}if(L.processingMode=L.processingMode||v.processingMode,"@base"in A){let te=A["@base"];if(!(te===null||o(te)))if(a(te))te=l(L["@base"],te);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:A});L["@base"]=te,F.set("@base",!0)}if("@vocab"in A){const te=A["@vocab"];if(te===null)delete L["@vocab"];else if(n(te)){if(!o(te)&&E.processingMode(L,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:A});{const x=S(L,te,{vocab:!0,base:!0},void 0,void 0,m);o(x)||m.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:x}},options:m}),L["@vocab"]=x}}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:A});F.set("@vocab",!0)}if("@language"in A){const te=A["@language"];if(te===null)delete L["@language"];else if(n(te))te.match(d)||m.eventHandler&&c({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:te}},options:m}),L["@language"]=te.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:A});F.set("@language",!0)}if("@direction"in A){const te=A["@direction"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:A});if(te===null)delete L["@direction"];else{if(te!=="ltr"&&te!=="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:A});L["@direction"]=te}F.set("@direction",!0)}if("@propagate"in A){const te=A["@propagate"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:A});if(typeof te!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:u});F.set("@propagate",!0)}if("@import"in A){const te=A["@import"];if(v.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+v.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:A});if(!n(te))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:u});const x=await m.contextResolver.resolve({activeCtx:v,context:te,documentLoader:m.documentLoader,base:m.base});if(x.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:u});const z=x[0].getProcessed(v);if(z)A=z;else{const Z=x[0].document;if("@import"in Z)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:u});for(const J in Z)A.hasOwnProperty(J)||(A[J]=Z[J]);x[0].setProcessed(v,A)}F.set("@import",!0)}F.set("@protected",A["@protected"]||!1);for(const te in A)if(E.createTermDefinition({activeCtx:L,localCtx:A,term:te,defined:F,options:m,overrideProtected:N}),r(A[te])&&"@context"in A[te]){const x=A[te]["@context"];let z=!0;if(n(x)){const Z=l(m.base,x);$.has(Z)?z=!1:$.add(Z)}if(z)try{await E.process({activeCtx:L.clone(),localCtx:A[te]["@context"],overrideProtected:!0,options:m,cycles:$})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:A[te]["@context"],term:te})}}Q.setProcessed(v,{context:L,events:R})}return L},E.createTermDefinition=({activeCtx:v,localCtx:u,term:m,defined:T,options:N,overrideProtected:$=!1})=>{if(T.has(m)){if(T.get(m))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:u,term:m})}T.set(m,!1);let j;if(u.hasOwnProperty(m)&&(j=u[m]),m==="@type"&&r(j)&&(j["@container"]||"@set")==="@set"&&E.processingMode(v,1.1)){const A=["@container","@id","@protected"],Y=Object.keys(j);if(Y.length===0||Y.some(F=>!A.includes(F)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:u,term:m})}else{if(E.isKeyword(m))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:u,term:m});if(m.match(f)){N.eventHandler&&c({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:m}},options:N});return}else if(m==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:u})}const R=v.mappings.get(m);v.mappings.has(m)&&v.mappings.delete(m);let P=!1;if((n(j)||j===null)&&(P=!0,j={"@id":j}),!r(j))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:u});const q={};v.mappings.set(m,q),q.reverse=!1;const I=["@container","@id","@language","@reverse","@type"];E.processingMode(v,1.1)&&I.push("@context","@direction","@index","@nest","@prefix","@protected");for(const A in j)if(!I.includes(A))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+A,"jsonld.SyntaxError",{code:"invalid term definition",context:u});const L=m.indexOf(":");if(q._termHasColon=L>0,"@reverse"in j){if("@id"in j)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:u});if("@nest"in j)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:u});const A=j["@reverse"];if(!n(A))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:u});if(A.match(f)){N.eventHandler&&c({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:A}},options:N}),R?v.mappings.set(m,R):v.mappings.delete(m);return}const Y=S(v,A,{vocab:!0,base:!1},u,T,N);if(!o(Y))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:u});q["@id"]=Y,q.reverse=!0}else if("@id"in j){let A=j["@id"];if(A&&!n(A))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:u});if(A===null)q["@id"]=null;else if(!E.isKeyword(A)&&A.match(f)){N.eventHandler&&c({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:A}},options:N}),R?v.mappings.set(m,R):v.mappings.delete(m);return}else if(A!==m){if(A=S(v,A,{vocab:!0,base:!1},u,T,N),!o(A)&&!E.isKeyword(A))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:u});if(m.match(/(?::[^:])|\//)){const Y=new Map(T).set(m,!0);if(S(v,m,{vocab:!0,base:!1},u,Y,N)!==A)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:u})}q["@id"]=A,q._prefix=P&&!q._termHasColon&&A.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in q))if(q._termHasColon){const A=m.substr(0,L);if(u.hasOwnProperty(A)&&E.createTermDefinition({activeCtx:v,localCtx:u,term:A,defined:T,options:N}),v.mappings.has(A)){const Y=m.substr(L+1);q["@id"]=v.mappings.get(A)["@id"]+Y}else q["@id"]=m}else if(m==="@type")q["@id"]=m;else{if(!("@vocab"in v))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:u,term:m});q["@id"]=v["@vocab"]+m}if((j["@protected"]===!0||T.get("@protected")===!0&&j["@protected"]!==!1)&&(v.protected[m]=!0,q.protected=!0),T.set(m,!0),"@type"in j){let A=j["@type"];if(!n(A))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:u});if(A==="@json"||A==="@none"){if(E.processingMode(v,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${A}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:u})}else if(A!=="@id"&&A!=="@vocab"){if(A=S(v,A,{vocab:!0,base:!1},u,T,N),!o(A))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:u});if(A.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:u})}q["@type"]=A}if("@container"in j){const A=n(j["@container"])?[j["@container"]]:j["@container"]||[],Y=["@list","@set","@index","@language"];let F=!0;const te=A.includes("@set");if(E.processingMode(v,1.1)){if(Y.push("@graph","@id","@type"),A.includes("@list")){if(A.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:u})}else if(A.includes("@graph")){if(A.some(x=>x!=="@graph"&&x!=="@id"&&x!=="@index"&&x!=="@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:u})}else F&=A.length<=(te?2:1);if(A.includes("@type")&&(q["@type"]=q["@type"]||"@id",!["@id","@vocab"].includes(q["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:u})}else F&=!t(j["@container"]),F&=A.length<=1;if(F&=A.every(x=>Y.includes(x)),F&=!(te&&A.includes("@list")),!F)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Y.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:u});if(q.reverse&&!A.every(x=>["@index","@set"].includes(x)))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:u});q["@container"]=A}if("@index"in j){if(!("@container"in j)||!q["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${j["@index"]}" on term "${m}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:u});if(!n(j["@index"])||j["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${j["@index"]}" on term "${m}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:u});q["@index"]=j["@index"]}if("@context"in j&&(q["@context"]=j["@context"]),"@language"in j&&!("@type"in j)){let A=j["@language"];if(A!==null&&!n(A))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:u});A!==null&&(A=A.toLowerCase()),q["@language"]=A}if("@prefix"in j){if(m.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:u});if(E.isKeyword(q["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:u});if(typeof j["@prefix"]=="boolean")q._prefix=j["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:u})}if("@direction"in j){const A=j["@direction"];if(A!==null&&A!=="ltr"&&A!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});q["@direction"]=A}if("@nest"in j){const A=j["@nest"];if(!n(A)||A!=="@nest"&&A.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:u});q["@nest"]=A}// disallow aliasing @context and @preserve
300
+ const Q=q["@id"];if(Q==="@context"||Q==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:u});if(R&&R.protected&&!$&&(v.protected[m]=!0,q.protected=!0,!k(R,q)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:u,term:m})},E.expandIri=(v,u,m,T)=>S(v,u,m,void 0,void 0,T);function S(v,u,m,T,N,$){if(u===null||!n(u)||E.isKeyword(u))return u;if(u.match(f))return null;if(T&&T.hasOwnProperty(u)&&N.get(u)!==!0&&E.createTermDefinition({activeCtx:v,localCtx:T,term:u,defined:N,options:$}),m=m||{},m.vocab){const R=v.mappings.get(u);if(R===null)return null;if(r(R)&&"@id"in R)return R["@id"]}const j=u.indexOf(":");if(j>0){const R=u.substr(0,j),P=u.substr(j+1);if(R==="_"||P.indexOf("//")===0)return u;T&&T.hasOwnProperty(R)&&E.createTermDefinition({activeCtx:v,localCtx:T,term:R,defined:N,options:$});const q=v.mappings.get(R);if(q&&q._prefix)return q["@id"]+P;if(o(u))return u}if(m.vocab&&"@vocab"in v)u=v["@vocab"]+u;else if(m.base){let R,P;"@base"in v?v["@base"]?(P=l($.base,v["@base"]),R=l(P,u)):(P=v["@base"],R=u):(P=$.base,R=l($.base,u)),u=R}return u}E.getInitialContext=v=>{const u=JSON.stringify({processingMode:v.processingMode}),m=b.get(u);if(m)return m;const T={processingMode:v.processingMode,mappings:new Map,inverse:null,getInverse:N,clone:R,revertToPreviousContext:P,protected:{}};return b.size===_&&b.clear(),b.set(u,T),T;function N(){const q=this;if(q.inverse)return q.inverse;const I=q.inverse={},L=q.fastCurieMap={},Q={},A=(q["@language"]||"@none").toLowerCase(),Y=q["@direction"],F=q.mappings,te=[...F.keys()].sort(y);for(const x of te){const z=F.get(x);if(z===null)continue;let Z=z["@container"]||"@none";if(Z=[].concat(Z).sort().join(""),z["@id"]===null)continue;const J=g(z["@id"]);for(const ce of J){let H=I[ce];const W=E.isKeyword(ce);if(H)!W&&!z._termHasColon&&Q[ce].push(x);else if(I[ce]=H={},!W&&!z._termHasColon){Q[ce]=[x];const K={iri:ce,terms:Q[ce]};ce[0]in L?L[ce[0]].push(K):L[ce[0]]=[K]}if(H[Z]||(H[Z]={"@language":{},"@type":{},"@any":{}}),H=H[Z],j(x,H["@any"],"@none"),z.reverse)j(x,H["@type"],"@reverse");else if(z["@type"]==="@none")j(x,H["@any"],"@none"),j(x,H["@language"],"@none"),j(x,H["@type"],"@none");else if("@type"in z)j(x,H["@type"],z["@type"]);else if("@language"in z&&"@direction"in z){const K=z["@language"],V=z["@direction"];K&&V?j(x,H["@language"],`${K}_${V}`.toLowerCase()):K?j(x,H["@language"],K.toLowerCase()):V?j(x,H["@language"],`_${V}`):j(x,H["@language"],"@null")}else"@language"in z?j(x,H["@language"],(z["@language"]||"@null").toLowerCase()):"@direction"in z?z["@direction"]?j(x,H["@language"],`_${z["@direction"]}`):j(x,H["@language"],"@none"):Y?(j(x,H["@language"],`_${Y}`),j(x,H["@language"],"@none"),j(x,H["@type"],"@none")):(j(x,H["@language"],A),j(x,H["@language"],"@none"),j(x,H["@type"],"@none"))}}for(const x in L)$(L,x,1);return I}function $(q,I,L){const Q=q[I],A=q[I]={};let Y,F;for(const te of Q)Y=te.iri,L>=Y.length?F="":F=Y[L],F in A?A[F].push(te):A[F]=[te];for(const te in A)te!==""&&$(A,te,L+1)}function j(q,I,L){I.hasOwnProperty(L)||(I[L]=q)}function R(){const q={};return q.mappings=i.clone(this.mappings),q.clone=this.clone,q.inverse=null,q.getInverse=this.getInverse,q.protected=i.clone(this.protected),this.previousContext&&(q.previousContext=this.previousContext.clone()),q.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(q["@base"]=this["@base"]),"@language"in this&&(q["@language"]=this["@language"]),"@vocab"in this&&(q["@vocab"]=this["@vocab"]),q}function P(){return this.previousContext?this.previousContext.clone():this}},E.getContextValue=(v,u,m)=>{if(u===null)return m==="@context"?void 0:null;if(v.mappings.has(u)){const T=v.mappings.get(u);if(s(m))return T;if(T.hasOwnProperty(m))return T[m]}if(m==="@language"&&m in v||m==="@direction"&&m in v)return v[m];if(m!=="@context")return null},E.processingMode=(v,u)=>u.toString()>="1.1"?!v.processingMode||v.processingMode>="json-ld-"+u.toString():v.processingMode==="json-ld-1.0",E.isKeyword=v=>{if(!n(v)||v[0]!=="@")return!1;switch(v){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 k(v,u){if(!(v&&typeof v=="object")||!(u&&typeof u=="object"))return v===u;const m=Array.isArray(v);if(m!==Array.isArray(u))return!1;if(m){if(v.length!==u.length)return!1;for(let $=0;$<v.length;++$)if(!k(v[$],u[$]))return!1;return!0}const T=Object.keys(v),N=Object.keys(u);if(T.length!==N.length)return!1;for(const $ in v){let j=v[$],R=u[$];if($==="@container"&&Array.isArray(j)&&Array.isArray(R)&&(j=j.slice().sort(),R=R.slice().sort()),!k(j,R))return!1}return!0}return Fa}var qa,Hu;function ly(){if(Hu)return qa;Hu=1;const i=di(),{isArray:e,isObject:t,isEmptyObject:r,isString:n,isUndefined:s}=ii(),{isList:o,isValue:a,isGraph:l,isSubject:c}=Gi(),{expandIri:d,getContextValue:f,isKeyword:g,process:y,processingMode:b}=Ir(),{isAbsolute:_}=or(),{REGEX_BCP47:E,REGEX_KEYWORD:S,addValue:k,asArray:v,getValues:u,validateTypeValue:m}=oi(),{handleEvent:T}=ms(),N={};qa=N,N.expand=async({activeCtx:I,activeProperty:L=null,element:Q,options:A={},insideList:Y=!1,insideIndex:F=!1,typeScopedContext:te=null})=>{if(Q==null)return null;if(L==="@default"&&(A=Object.assign({},A,{isFrame:!1})),!e(Q)&&!t(Q))return!Y&&(L===null||d(I,L,{vocab:!0},A)==="@graph")?(A.eventHandler&&T({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Q}},options:A}),null):R({activeCtx:I,activeProperty:L,value:Q,options:A});if(e(Q)){let K=[];const V=f(I,L,"@container")||[];Y=Y||V.includes("@list");for(let re=0;re<Q.length;++re){let ne=await N.expand({activeCtx:I,activeProperty:L,element:Q[re],options:A,insideIndex:F,typeScopedContext:te});Y&&e(ne)&&(ne={"@list":ne}),ne!==null&&(e(ne)?K=K.concat(ne):K.push(ne))}return K}const x=d(I,L,{vocab:!0},A),z=f(I,L,"@context");te=te||(I.previousContext?I:null);let Z=Object.keys(Q).sort(),J=!F;if(J&&te&&Z.length<=2&&!Z.includes("@context"))for(const K of Z){const V=d(te,K,{vocab:!0},A);if(V==="@value"){J=!1,I=te;break}if(V==="@id"&&Z.length===1){J=!1;break}}J&&(I=I.revertToPreviousContext()),s(z)||(I=await y({activeCtx:I,localCtx:z,propagate:!0,overrideProtected:!0,options:A})),"@context"in Q&&(I=await y({activeCtx:I,localCtx:Q["@context"],options:A})),te=I;let ce=null;for(const K of Z)if(d(I,K,{vocab:!0},A)==="@type"){ce=ce||K;const re=Q[K],ne=Array.isArray(re)?re.length>1?re.slice().sort():re:[re];for(const ge of ne){const be=f(te,ge,"@context");s(be)||(I=await y({activeCtx:I,localCtx:be,options:A,propagate:!1}))}}let H={};await j({activeCtx:I,activeProperty:L,expandedActiveProperty:x,element:Q,expandedParent:H,options:A,insideList:Y,typeKey:ce,typeScopedContext:te}),Z=Object.keys(H);let W=Z.length;if("@value"in H){if("@type"in H&&("@language"in H||"@direction"in H))throw new i('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:H});let K=W-1;if("@type"in H&&(K-=1),"@index"in H&&(K-=1),"@language"in H&&(K-=1),"@direction"in H&&(K-=1),K!==0)throw new i('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:H});const V=H["@value"]===null?[]:v(H["@value"]),re=u(H,"@type");if(!(b(I,1.1)&&re.includes("@json")&&re.length===1))if(V.length===0)A.eventHandler&&T({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:H}},options:A}),H=null;else{if(!V.every(ne=>n(ne)||r(ne))&&"@language"in H)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:H});if(!re.every(ne=>_(ne)&&!(n(ne)&&ne.indexOf("_:")===0)||r(ne)))throw new i('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:H})}}else if("@type"in H&&!e(H["@type"]))H["@type"]=[H["@type"]];else if("@set"in H||"@list"in H){if(W>1&&!(W===2&&"@index"in H))throw new i('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:H});"@set"in H&&(H=H["@set"],Z=Object.keys(H),W=Z.length)}else W===1&&"@language"in H&&(A.eventHandler&&T({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:H}},options:A}),H=null);return t(H)&&!A.keepFreeFloatingNodes&&!Y&&(L===null||x==="@graph"||(f(I,L,"@container")||[]).includes("@graph"))&&(H=$({value:H,count:W,options:A})),H};function $({value:I,count:L,options:Q}){if(L===0||"@value"in I||"@list"in I||L===1&&"@id"in I){if(Q.eventHandler){let A,Y;L===0?(A="empty object",Y="Dropping empty object."):"@value"in I?(A="object with only @value",Y="Dropping object with only @value."):"@list"in I?(A="object with only @list",Y="Dropping object with only @list."):L===1&&"@id"in I&&(A="object with only @id",Y="Dropping object with only @id."),T({event:{type:["JsonLdEvent"],code:A,level:"warning",message:Y,details:{value:I}},options:Q})}return null}return I}async function j({activeCtx:I,activeProperty:L,expandedActiveProperty:Q,element:A,expandedParent:Y,options:F={},insideList:te,typeKey:x,typeScopedContext:z}){const Z=Object.keys(A).sort(),J=[];let ce;const H=A[x]&&d(I,e(A[x])?A[x][0]:A[x],{vocab:!0},{...F,typeExpansion:!0})==="@json";for(const W of Z){let K=A[W],V;if(W==="@context")continue;const re=d(I,W,{vocab:!0},F);if(re===null||!(_(re)||g(re))){F.eventHandler&&T({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:W,expandedProperty:re}},options:F});continue}if(g(re)){if(Q==="@reverse")throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:K});if(re in Y&&re!=="@included"&&re!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:re})}if(re==="@id"){if(!n(K)){if(!F.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:K});if(t(K)){if(!r(K))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:K})}else if(e(K)){if(!K.every(O=>n(O)))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:K})}else throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:K})}k(Y,"@id",v(K).map(O=>{if(n(O)){const G=d(I,O,{base:!0},F);return F.eventHandler&&(G===null?T(O===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:O}},options:F}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:O}},options:F}):_(G)||T({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:O,expandedId:G}},options:F})),G}return O}),{propertyIsArray:F.isFrame});continue}if(re==="@type"){t(K)&&(K=Object.fromEntries(Object.entries(K).map(([O,G])=>[d(z,O,{vocab:!0}),v(G).map(oe=>d(z,oe,{base:!0,vocab:!0},{...F,typeExpansion:!0}))]))),m(K,F.isFrame),k(Y,"@type",v(K).map(O=>{if(n(O)){const G=d(z,O,{base:!0,vocab:!0},{...F,typeExpansion:!0});return G!=="@json"&&!_(G)&&F.eventHandler&&T({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:O}},options:F}),G}return O}),{propertyIsArray:!!F.isFrame});continue}if(re==="@included"&&b(I,1.1)){const O=v(await N.expand({activeCtx:I,activeProperty:L,element:K,options:F}));if(!O.every(G=>c(G)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:K});k(Y,"@included",O,{propertyIsArray:!0});continue}if(re==="@graph"&&!(t(K)||e(K)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:K});if(re==="@value"){ce=K,H&&b(I,1.1)?Y["@value"]=K:k(Y,"@value",K,{propertyIsArray:F.isFrame});continue}if(re==="@language"){if(K===null)continue;if(!n(K)&&!F.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:K});K=v(K).map(O=>n(O)?O.toLowerCase():O);for(const O of K)n(O)&&!O.match(E)&&F.eventHandler&&T({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:F});k(Y,"@language",K,{propertyIsArray:F.isFrame});continue}if(re==="@direction"){if(!n(K)&&!F.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:K});K=v(K);for(const O of K)if(n(O)&&O!=="ltr"&&O!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:K});k(Y,"@direction",K,{propertyIsArray:F.isFrame});continue}if(re==="@index"){if(!n(K))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:K});k(Y,"@index",K);continue}if(re==="@reverse"){if(!t(K))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:K});if(V=await N.expand({activeCtx:I,activeProperty:"@reverse",element:K,options:F}),"@reverse"in V)for(const G in V["@reverse"])k(Y,G,V["@reverse"][G],{propertyIsArray:!0});let O=Y["@reverse"]||null;for(const G in V){if(G==="@reverse")continue;O===null&&(O=Y["@reverse"]={}),k(O,G,[],{propertyIsArray:!0});const oe=V[G];for(let pe=0;pe<oe.length;++pe){const ye=oe[pe];if(a(ye)||o(ye))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:V});k(O,G,ye,{propertyIsArray:!0})}}continue}if(re==="@nest"){J.push(W);continue}let ne=I;const ge=f(I,W,"@context");s(ge)||(ne=await y({activeCtx:I,localCtx:ge,propagate:!0,overrideProtected:!0,options:F}));const be=f(I,W,"@container")||[];if(be.includes("@language")&&t(K)){const O=f(ne,W,"@direction");V=P(ne,K,O,F)}else if(be.includes("@index")&&t(K)){const O=be.includes("@graph"),G=f(ne,W,"@index")||"@index",oe=G!=="@index"&&d(I,G,{vocab:!0},F);V=await q({activeCtx:ne,options:F,activeProperty:W,value:K,asGraph:O,indexKey:G,propertyIndex:oe})}else if(be.includes("@id")&&t(K)){const O=be.includes("@graph");V=await q({activeCtx:ne,options:F,activeProperty:W,value:K,asGraph:O,indexKey:"@id"})}else if(be.includes("@type")&&t(K))V=await q({activeCtx:ne.revertToPreviousContext(),options:F,activeProperty:W,value:K,asGraph:!1,indexKey:"@type"});else{const O=re==="@list";if(O||re==="@set"){let G=L;O&&Q==="@graph"&&(G=null),V=await N.expand({activeCtx:ne,activeProperty:G,element:K,options:F,insideList:O})}else f(I,W,"@type")==="@json"?V={"@type":"@json","@value":K}:V=await N.expand({activeCtx:ne,activeProperty:W,element:K,options:F,insideList:!1})}if(!(V===null&&re!=="@value")){if(re!=="@list"&&!o(V)&&be.includes("@list")&&(V={"@list":v(V)}),be.includes("@graph")&&!be.some(O=>O==="@id"||O==="@index")){if(V=v(V),F.isFrame||(V=V.filter(O=>{const G=Object.keys(O).length;return $({value:O,count:G,options:F})!==null})),V.length===0)continue;V=V.map(O=>({"@graph":v(O)}))}if(ne.mappings.has(W)&&ne.mappings.get(W).reverse){const O=Y["@reverse"]=Y["@reverse"]||{};V=v(V);for(let G=0;G<V.length;++G){const oe=V[G];if(a(oe)||o(oe))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:V});k(O,re,oe,{propertyIsArray:!0})}continue}k(Y,re,V,{propertyIsArray:!0})}}if("@value"in Y&&!(Y["@type"]==="@json"&&b(I,1.1))){if((t(ce)||e(ce))&&!F.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:ce})}for(const W of J){const K=e(A[W])?A[W]:[A[W]];for(const V of K){if(!t(V)||Object.keys(V).some(re=>d(I,re,{vocab:!0},F)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:V});await j({activeCtx:I,activeProperty:L,expandedActiveProperty:Q,element:V,expandedParent:Y,options:F,insideList:te,typeScopedContext:z,typeKey:x})}}}function R({activeCtx:I,activeProperty:L,value:Q,options:A}){if(Q==null)return null;const Y=d(I,L,{vocab:!0},A);if(Y==="@id")return d(I,Q,{base:!0},A);if(Y==="@type")return d(I,Q,{vocab:!0,base:!0},{...A,typeExpansion:!0});const F=f(I,L,"@type");if((F==="@id"||Y==="@graph")&&n(Q)){const x=d(I,Q,{base:!0},A);return x===null&&Q.match(S)&&A.eventHandler&&T({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:L}},options:A}),{"@id":x}}if(F==="@vocab"&&n(Q))return{"@id":d(I,Q,{vocab:!0,base:!0},A)};if(g(Y))return Q;const te={};if(F&&!["@id","@vocab","@none"].includes(F))te["@type"]=F;else if(n(Q)){const x=f(I,L,"@language");x!==null&&(te["@language"]=x);const z=f(I,L,"@direction");z!==null&&(te["@direction"]=z)}return["boolean","number","string"].includes(typeof Q)||(Q=Q.toString()),te["@value"]=Q,te}function P(I,L,Q,A){const Y=[],F=Object.keys(L).sort();for(const te of F){const x=d(I,te,{vocab:!0},A);let z=L[te];e(z)||(z=[z]);for(const Z of z){if(Z===null)continue;if(!n(Z))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:L});const J={"@value":Z};x!=="@none"&&(te.match(E)||A.eventHandler&&T({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:te}},options:A}),J["@language"]=te.toLowerCase()),Q&&(J["@direction"]=Q),Y.push(J)}}return Y}async function q({activeCtx:I,options:L,activeProperty:Q,value:A,asGraph:Y,indexKey:F,propertyIndex:te}){const x=[],z=Object.keys(A).sort(),Z=F==="@type";for(let J of z){if(Z){const W=f(I,J,"@context");s(W)||(I=await y({activeCtx:I,localCtx:W,propagate:!1,options:L}))}let ce=A[J];e(ce)||(ce=[ce]),ce=await N.expand({activeCtx:I,activeProperty:Q,element:ce,options:L,insideList:!1,insideIndex:!0});let H;te?J==="@none"?H="@none":H=R({activeCtx:I,activeProperty:F,value:J,options:L}):H=d(I,J,{vocab:!0},L),F==="@id"?J=d(I,J,{base:!0},L):Z&&(J=H);for(let W of ce){if(Y&&!l(W)&&(W={"@graph":[W]}),F==="@type")H==="@none"||(W["@type"]?W["@type"]=[J].concat(W["@type"]):W["@type"]=[J]);else{if(a(W)&&!["@language","@type","@index"].includes(F))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${F}".`,"jsonld.SyntaxError",{code:"invalid value object",value:W});te?H!=="@none"&&k(W,te,H,{propertyIsArray:!0,prependValue:!0}):H!=="@none"&&!(F in W)&&(W[F]=J)}x.push(W)}}return x}return qa}var Ua,Wu;function bo(){if(Wu)return Ua;Wu=1;const{isKeyword:i}=Ir(),e=Gi(),t=ii(),r=oi(),n=di(),s={};return Ua=s,s.createMergedNodeMap=(o,a)=>{a=a||{};const l=a.issuer||new r.IdentifierIssuer("_:b"),c={"@default":{}};return s.createNodeMap(o,c,"@default",l),s.mergeNodeMaps(c)},s.createNodeMap=(o,a,l,c,d,f)=>{if(t.isArray(o)){for(const _ of o)s.createNodeMap(_,a,l,c,void 0,f);return}if(!t.isObject(o)){f&&f.push(o);return}if(e.isValue(o)){if("@type"in o){let _=o["@type"];_.indexOf("_:")===0&&(o["@type"]=_=c.getId(_))}f&&f.push(o);return}else if(f&&e.isList(o)){const _=[];s.createNodeMap(o["@list"],a,l,c,d,_),f.push({"@list":_});return}if("@type"in o){const _=o["@type"];for(const E of _)E.indexOf("_:")===0&&c.getId(E)}t.isUndefined(d)&&(d=e.isBlankNode(o)?c.getId(o["@id"]):o["@id"]),f&&f.push({"@id":d});const g=a[l],y=g[d]=g[d]||{};y["@id"]=d;const b=Object.keys(o).sort();for(let _ of b){if(_==="@id")continue;if(_==="@reverse"){const S={"@id":d},k=o["@reverse"];for(const v in k){const u=k[v];for(const m of u){let T=m["@id"];e.isBlankNode(m)&&(T=c.getId(T)),s.createNodeMap(m,a,l,c,T),r.addValue(g[T],v,S,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(_==="@graph"){d in a||(a[d]={}),s.createNodeMap(o[_],a,d,c);continue}if(_==="@included"){s.createNodeMap(o[_],a,l,c);continue}if(_!=="@type"&&i(_)){if(_==="@index"&&_ in y&&(o[_]!==y[_]||o[_]["@id"]!==y[_]["@id"]))throw new n("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:y});y[_]=o[_];continue}const E=o[_];if(_.indexOf("_:")===0&&(_=c.getId(_)),E.length===0){r.addValue(y,_,[],{propertyIsArray:!0});continue}for(let S of E)if(_==="@type"&&(S=S.indexOf("_:")===0?c.getId(S):S),e.isSubject(S)||e.isSubjectReference(S)){if("@id"in S&&!S["@id"])continue;const k=e.isBlankNode(S)?c.getId(S["@id"]):S["@id"];r.addValue(y,_,{"@id":k},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(S,a,l,c,k)}else if(e.isValue(S))r.addValue(y,_,S,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(S)){const k=[];s.createNodeMap(S["@list"],a,l,c,d,k),S={"@list":k},r.addValue(y,_,S,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(S,a,l,c,d),r.addValue(y,_,S,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=o=>{const a={};for(const l of Object.keys(o).sort())for(const c of Object.keys(o[l]).sort()){const d=o[l][c];c in a||(a[c]={"@id":c});const f=a[c];for(const g of Object.keys(d).sort())if(i(g)&&g!=="@type")f[g]=r.clone(d[g]);else for(const y of d[g])r.addValue(f,g,r.clone(y),{propertyIsArray:!0,allowDuplicate:!1})}return a},s.mergeNodeMaps=o=>{const a=o["@default"],l=Object.keys(o).sort();for(const c of l){if(c==="@default")continue;const d=o[c];let f=a[c];f?"@graph"in f||(f["@graph"]=[]):a[c]=f={"@id":c,"@graph":[]};const g=f["@graph"];for(const y of Object.keys(d).sort()){const b=d[y];e.isSubjectReference(b)||g.push(b)}}return a},Ua}var Va,Gu;function cy(){if(Gu)return Va;Gu=1;const{isSubjectReference:i}=Gi(),{createMergedNodeMap:e}=bo(),t={};return Va=t,t.flatten=r=>{const n=e(r),s=[],o=Object.keys(n).sort();for(let a=0;a<o.length;++a){const l=n[o[a]];i(l)||s.push(l)}return s},Va}var za,Ku;function dy(){if(Ku)return za;Ku=1;const i=di(),e=Gi(),t=ii(),{REGEX_BCP47:r,addValue:n}=oi(),{handleEvent:s}=ms(),{RDF_LIST:o,RDF_FIRST:a,RDF_REST:l,RDF_NIL:c,RDF_TYPE:d,RDF_JSON_LITERAL:f,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:b,XSD_STRING:_}=$c(),E={};za=E,E.fromRDF=async(k,v)=>{const{useRdfType:u=!1,useNativeTypes:m=!1,rdfDirection:T=null}=v,N={},$={"@default":N},j={};if(T){if(T==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:T});if(T!=="i18n-datatype")throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:T})}for(const q of k){const I=q.graph.termType==="DefaultGraph"?"@default":q.graph.value;I in $||($[I]={}),I!=="@default"&&!(I in N)&&(N[I]={"@id":I});const L=$[I],Q=q.subject.value,A=q.predicate.value,Y=q.object;Q in L||(L[Q]={"@id":Q});const F=L[Q],te=Y.termType.endsWith("Node");if(te&&!(Y.value in L)&&(L[Y.value]={"@id":Y.value}),A===d&&!u&&te){n(F,"@type",Y.value,{propertyIsArray:!0});continue}const x=S(Y,m,T,v);if(n(F,A,x,{propertyIsArray:!0}),te)if(Y.value===c){const z=L[Y.value];"usages"in z||(z.usages=[]),z.usages.push({node:F,property:A,value:x})}else Y.value in j?j[Y.value]=!1:j[Y.value]={node:F,property:A,value:x}}for(const q in $){const I=$[q];if(!(c in I))continue;const L=I[c];if(L.usages){for(let Q of L.usages){let A=Q.node,Y=Q.property,F=Q.value;const te=[],x=[];let z=Object.keys(A).length;for(;Y===l&&t.isObject(j[A["@id"]])&&t.isArray(A[a])&&A[a].length===1&&t.isArray(A[l])&&A[l].length===1&&(z===3||z===4&&t.isArray(A["@type"])&&A["@type"].length===1&&A["@type"][0]===o)&&(te.push(A[a][0]),x.push(A["@id"]),Q=j[A["@id"]],A=Q.node,Y=Q.property,F=Q.value,z=Object.keys(A).length,!!e.isBlankNode(A)););delete F["@id"],F["@list"]=te.reverse();for(const Z of x)delete I[Z]}delete L.usages}}const R=[],P=Object.keys(N).sort();for(const q of P){const I=N[q];if(q in $){const L=I["@graph"]=[],Q=$[q],A=Object.keys(Q).sort();for(const Y of A){const F=Q[Y];e.isSubjectReference(F)||L.push(F)}}e.isSubjectReference(I)||R.push(I)}return R};function S(k,v,u,m){if(k.termType.endsWith("Node"))return{"@id":k.value};const T={"@value":k.value};if(k.language)k.language.match(r)||m.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:k.language}},options:m}),T["@language"]=k.language;else{let N=k.datatype.value;if(N||(N=_),N===f){N="@json";try{T["@value"]=JSON.parse(T["@value"])}catch($){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:T["@value"],cause:$})}}if(v){if(N===g)T["@value"]==="true"?T["@value"]=!0:T["@value"]==="false"&&(T["@value"]=!1);else if(t.isNumeric(T["@value"]))if(N===b){const $=parseInt(T["@value"],10);$.toFixed(0)===T["@value"]&&(T["@value"]=$)}else N===y&&(T["@value"]=parseFloat(T["@value"]));[g,b,y,_].includes(N)||(T["@type"]=N)}else if(u==="i18n-datatype"&&N.startsWith("https://www.w3.org/ns/i18n#")){const[,$,j]=N.split(/[#_]/);$.length>0&&(T["@language"]=$,$.match(r)||m.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:$}},options:m})),T["@direction"]=j}else N!==_&&(T["@type"]=N)}return T}return za}var Ha,Ju;function uy(){return Ju||(Ju=1,Ha=function i(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,r,n)=>{const s=n===0?"":",",o=r===void 0||typeof r=="symbol"?null:r;return t+s+i(o)},"")+"]":"{"+Object.keys(e).sort().reduce((t,r,n)=>{if(e[r]===void 0||typeof e[r]=="symbol")return t;const s=t.length===0?"":",";return t+s+i(r)+":"+i(e[r])},"")+"}"}),Ha}var Wa,Xu;function hy(){if(Xu)return Wa;Xu=1;const{createNodeMap:i}=bo(),{isKeyword:e}=Ir(),t=Gi(),r=uy(),n=di(),s=ii(),o=oi(),{handleEvent:a}=ms(),{RDF_FIRST:l,RDF_REST:c,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:g,RDF_LANGSTRING:y,XSD_BOOLEAN:b,XSD_DOUBLE:_,XSD_INTEGER:E,XSD_STRING:S}=$c(),{isAbsolute:k}=or(),v={};Wa=v,v.toRDF=(N,$)=>{const j=new o.IdentifierIssuer("_:b"),R={"@default":{}};i(N,R,"@default",j);const P=[],q=Object.keys(R).sort();for(const I of q){let L;if(I==="@default")L={termType:"DefaultGraph",value:""};else if(k(I))I.startsWith("_:")?L={termType:"BlankNode"}:L={termType:"NamedNode"},L.value=I;else{$.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:I}},options:$});continue}u(P,R[I],L,j,$)}return P};function u(N,$,j,R,P){const q=Object.keys($).sort();for(const I of q){const L=$[I],Q=Object.keys(L).sort();for(let A of Q){const Y=L[A];if(A==="@type")A=f;else if(e(A))continue;for(const F of Y){const te={termType:I.startsWith("_:")?"BlankNode":"NamedNode",value:I};if(!k(I)){P.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:I}},options:P});continue}const x={termType:A.startsWith("_:")?"BlankNode":"NamedNode",value:A};if(!k(A)){P.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:A}},options:P});continue}if(x.termType==="BlankNode"&&!P.produceGeneralizedRdf){P.eventHandler&&a({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:R.getOldIds().find(Z=>R.getId(Z)===A)}},options:P});continue}const z=T(F,R,N,j,P.rdfDirection,P);z&&N.push({subject:te,predicate:x,object:z,graph:j})}}}}function m(N,$,j,R,P,q){const I={termType:"NamedNode",value:l},L={termType:"NamedNode",value:c},Q={termType:"NamedNode",value:d},A=N.pop(),Y=A?{termType:"BlankNode",value:$.getId()}:Q;let F=Y;for(const te of N){const x=T(te,$,j,R,P,q),z={termType:"BlankNode",value:$.getId()};j.push({subject:F,predicate:I,object:x,graph:R}),j.push({subject:F,predicate:L,object:z,graph:R}),F=z}if(A){const te=T(A,$,j,R,P,q);j.push({subject:F,predicate:I,object:te,graph:R}),j.push({subject:F,predicate:L,object:Q,graph:R})}return Y}function T(N,$,j,R,P,q){const I={};if(t.isValue(N)){I.termType="Literal",I.value=void 0,I.datatype={termType:"NamedNode"};let L=N["@value"];const Q=N["@type"]||null;if(Q==="@json")I.value=r(L),I.datatype.value=g;else if(s.isBoolean(L))I.value=L.toString(),I.datatype.value=Q||b;else if(s.isDouble(L)||Q===_)s.isDouble(L)||(L=parseFloat(L)),I.value=L.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),I.datatype.value=Q||_;else if(s.isNumber(L))I.value=L.toFixed(0),I.datatype.value=Q||E;else if("@direction"in N&&P==="i18n-datatype"){const A=(N["@language"]||"").toLowerCase(),Y=N["@direction"],F=`https://www.w3.org/ns/i18n#${A}_${Y}`;I.datatype.value=F,I.value=L}else{if("@direction"in N&&P==="compound-literal")throw new n("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:P});if("@direction"in N&&P)throw new n("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:P});"@language"in N?("@direction"in N&&!P&&q.eventHandler&&a({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:I.value}},options:q}),I.value=L,I.datatype.value=Q||y,I.language=N["@language"]):("@direction"in N&&!P&&q.eventHandler&&a({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:I.value}},options:q}),I.value=L,I.datatype.value=Q||S)}}else if(t.isList(N)){const L=m(N["@list"],$,j,R,P,q);I.termType=L.termType,I.value=L.value}else{const L=s.isObject(N)?N["@id"]:N;I.termType=L.startsWith("_:")?"BlankNode":"NamedNode",I.value=L}return I.termType==="NamedNode"&&!k(I.value)?(q.eventHandler&&a({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:I.value}},options:q}),null):I}return Wa}var Ga,Qu;function fy(){if(Qu)return Ga;Qu=1;const{isKeyword:i}=Ir(),e=Gi(),t=ii(),r=oi(),n=or(),s=di(),{createNodeMap:o,mergeNodeMapGraphs:a}=bo(),l={};Ga=l,l.frameMergedOrDefault=(u,m,T)=>{const N={options:T,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},$=new r.IdentifierIssuer("_:b");o(u,N.graphMap,"@default",$),T.merged&&(N.graphMap["@merged"]=a(N.graphMap),N.graph="@merged"),N.subjects=N.graphMap[N.graph];const j=[];l.frame(N,Object.keys(N.subjects).sort(),m,j),T.pruneBlankNodeIdentifiers&&(T.bnodesToClear=Object.keys(N.bnodeMap).filter(R=>N.bnodeMap[R].length===1));// remove @preserve from results
301
+ return T.link={},E(j,T)},l.frame=(u,m,T,N,$=null)=>{g(T),T=T[0];const j=u.options,R={embed:f(T,j,"embed"),explicit:f(T,j,"explicit"),requireAll:f(T,j,"requireAll")};u.link.hasOwnProperty(u.graph)||(u.link[u.graph]={});const P=u.link[u.graph],q=y(u,m,T,R),I=Object.keys(q).sort();for(const L of I){const Q=q[L];if($===null?u.uniqueEmbeds={[u.graph]:{}}:u.uniqueEmbeds[u.graph]=u.uniqueEmbeds[u.graph]||{},R.embed==="@link"&&L in P){S(N,$,P[L]);continue}const A={"@id":L};if(L.indexOf("_:")===0&&r.addValue(u.bnodeMap,L,A,{propertyIsArray:!0}),P[L]=A,(R.embed==="@first"||R.embed==="@last")&&u.is11)throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:T});if(!(!u.embedded&&u.uniqueEmbeds[u.graph].hasOwnProperty(L))){if(u.embedded&&(R.embed==="@never"||d(Q,u.graph,u.subjectStack))){S(N,$,A);continue}if(u.embedded&&(R.embed=="@first"||R.embed=="@once")&&u.uniqueEmbeds[u.graph].hasOwnProperty(L)){S(N,$,A);continue}if(R.embed==="@last"&&L in u.uniqueEmbeds[u.graph]&&_(u,L),u.uniqueEmbeds[u.graph][L]={parent:N,property:$},u.subjectStack.push({subject:Q,graph:u.graph}),L in u.graphMap){let Y=!1,F=null;"@graph"in T?(F=T["@graph"][0],Y=!(L==="@merged"||L==="@default"),t.isObject(F)||(F={})):(Y=u.graph!=="@merged",F={}),Y&&l.frame({...u,graph:L,embedded:!1},Object.keys(u.graphMap[L]).sort(),[F],A,"@graph")}"@included"in T&&l.frame({...u,embedded:!1},m,T["@included"],A,"@included");for(const Y of Object.keys(Q).sort()){if(i(Y)){if(A[Y]=r.clone(Q[Y]),Y==="@type")for(const F of Q["@type"])F.indexOf("_:")===0&&r.addValue(u.bnodeMap,F,A,{propertyIsArray:!0});continue}if(!(R.explicit&&!(Y in T)))for(const F of Q[Y]){const te=Y in T?T[Y]:c(R);if(e.isList(F)){const x=T[Y]&&T[Y][0]&&T[Y][0]["@list"]?T[Y][0]["@list"]:c(R),z={"@list":[]};S(A,Y,z);const Z=F["@list"];for(const J of Z)e.isSubjectReference(J)?l.frame({...u,embedded:!0},[J["@id"]],x,z,"@list"):S(z,"@list",r.clone(J))}else e.isSubjectReference(F)?l.frame({...u,embedded:!0},[F["@id"]],te,A,Y):v(te[0],F)&&S(A,Y,r.clone(F))}}for(const Y of Object.keys(T).sort()){if(Y==="@type"){if(!t.isObject(T[Y][0])||!("@default"in T[Y][0]))continue}else if(i(Y))continue;const F=T[Y][0]||{};if(!f(F,j,"omitDefault")&&!(Y in A)){let x="@null";"@default"in F&&(x=r.clone(F["@default"])),t.isArray(x)||(x=[x]),A[Y]=[{"@preserve":x}]}}for(const Y of Object.keys(T["@reverse"]||{}).sort()){const F=T["@reverse"][Y];for(const te of Object.keys(u.subjects))r.getValues(u.subjects[te],Y).some(z=>z["@id"]===L)&&(A["@reverse"]=A["@reverse"]||{},r.addValue(A["@reverse"],Y,[],{propertyIsArray:!0}),l.frame({...u,embedded:!0},[te],F,A["@reverse"][Y],$))}S(N,$,A),u.subjectStack.pop()}}},l.cleanupNull=(u,m)=>{if(t.isArray(u))return u.map(N=>l.cleanupNull(N,m)).filter(N=>N);if(u==="@null")return null;if(t.isObject(u)){if("@id"in u){const T=u["@id"];if(m.link.hasOwnProperty(T)){const N=m.link[T].indexOf(u);if(N!==-1)return m.link[T][N];m.link[T].push(u)}else m.link[T]=[u]}for(const T in u)u[T]=l.cleanupNull(u[T],m)}return u};function c(u){const m={};for(const T in u)u[T]!==void 0&&(m["@"+T]=[u[T]]);return[m]}function d(u,m,T){for(let N=T.length-1;N>=0;--N){const $=T[N];if($.graph===m&&$.subject["@id"]===u["@id"])return!0}return!1}function f(u,m,T){const N="@"+T;let $=N in u?u[N][0]:m[T];if(T==="embed"){if($===!0)$="@once";else if($===!1)$="@never";else if($!=="@always"&&$!=="@never"&&$!=="@link"&&$!=="@first"&&$!=="@last"&&$!=="@once")throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:u})}return $}function g(u){if(!t.isArray(u)||u.length!==1||!t.isObject(u[0]))throw new s("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:u});if("@id"in u[0]){for(const m of r.asArray(u[0]["@id"]))if(!(t.isObject(m)||n.isAbsolute(m))||t.isString(m)&&m.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:u})}if("@type"in u[0]){for(const m of r.asArray(u[0]["@type"]))if(!(t.isObject(m)||n.isAbsolute(m)||m==="@json")||t.isString(m)&&m.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:u})}}function y(u,m,T,N){const $={};for(const j of m){const R=u.graphMap[u.graph][j];b(u,R,T,N)&&($[j]=R)}return $}function b(u,m,T,N){let $=!0,j=!1;for(const R in T){let P=!1;const q=r.getValues(m,R),I=r.getValues(T,R).length===0;if(R==="@id"){if(t.isEmptyObject(T["@id"][0]||{})?P=!0:T["@id"].length>=0&&(P=T["@id"].includes(q[0])),!N.requireAll)return P}else if(R==="@type"){if($=!1,I){if(q.length>0)return!1;P=!0}else if(T["@type"].length===1&&t.isEmptyObject(T["@type"][0]))P=q.length>0;else for(const L of T["@type"])t.isObject(L)&&"@default"in L?P=!0:P=P||q.some(Q=>Q===L);if(!N.requireAll)return P}else{if(i(R))continue;{const L=r.getValues(T,R)[0];let Q=!1;if(L&&(g([L]),Q="@default"in L),$=!1,q.length===0&&Q)continue;if(q.length>0&&I)return!1;if(L===void 0){if(q.length>0)return!1;P=!0}else if(e.isList(L)){const A=L["@list"][0];if(e.isList(q[0])){const Y=q[0]["@list"];e.isValue(A)?P=Y.some(F=>v(A,F)):(e.isSubject(A)||e.isSubjectReference(A))&&(P=Y.some(F=>k(u,A,F,N)))}}else e.isValue(L)?P=q.some(A=>v(L,A)):e.isSubjectReference(L)?P=q.some(A=>k(u,L,A,N)):t.isObject(L)?P=q.length>0:P=!1}}if(!P&&N.requireAll)return!1;j=j||P}return $||j}function _(u,m){const T=u.uniqueEmbeds[u.graph],N=T[m],$=N.parent,j=N.property,R={"@id":m};if(t.isArray($)){for(let q=0;q<$.length;++q)if(r.compareValues($[q],R)){$[q]=R;break}}else{const q=t.isArray($[j]);r.removeValue($,j,R,{propertyIsArray:q}),r.addValue($,j,R,{propertyIsArray:q})}const P=q=>{const I=Object.keys(T);for(const L of I)L in T&&t.isObject(T[L].parent)&&T[L].parent["@id"]===q&&(delete T[L],P(L))};P(m)}/**
302
+ * Removes the @preserve keywords from expanded result of framing.
303
+ *
304
+ * @param input the framed, framed output.
305
+ * @param options the framing options used.
306
+ *
307
+ * @return the resulting output.
308
+ */function E(u,m){if(t.isArray(u))return u.map(T=>E(T,m));if(t.isObject(u)){// remove @preserve
309
+ if("@preserve"in u)return u["@preserve"][0];if(e.isValue(u))return u;if(e.isList(u))return u["@list"]=E(u["@list"],m),u;if("@id"in u){const T=u["@id"];if(m.link.hasOwnProperty(T)){const N=m.link[T].indexOf(u);if(N!==-1)return m.link[T][N];m.link[T].push(u)}else m.link[T]=[u]}for(const T in u){if(T==="@id"&&m.bnodesToClear.includes(u[T])){delete u["@id"];continue}u[T]=E(u[T],m)}}return u}function S(u,m,T){t.isObject(u)?r.addValue(u,m,T,{propertyIsArray:!0}):u.push(T)}function k(u,m,T,N){if(!("@id"in T))return!1;const $=u.subjects[T["@id"]];return $&&b(u,$,m,N)}function v(u,m){const T=m["@value"],N=m["@type"],$=m["@language"],j=u["@value"]?t.isArray(u["@value"])?u["@value"]:[u["@value"]]:[],R=u["@type"]?t.isArray(u["@type"])?u["@type"]:[u["@type"]]:[],P=u["@language"]?t.isArray(u["@language"])?u["@language"]:[u["@language"]]:[];return j.length===0&&R.length===0&&P.length===0?!0:!(!(j.includes(T)||t.isEmptyObject(j[0]))||!(!N&&R.length===0||R.includes(N)||N&&t.isEmptyObject(R[0]))||!(!$&&P.length===0||P.includes($)||$&&t.isEmptyObject(P[0])))}return Ga}var Ka,Yu;function py(){if(Yu)return Ka;Yu=1;const i=di(),{isArray:e,isObject:t,isString:r,isUndefined:n}=ii(),{isList:s,isValue:o,isGraph:a,isSimpleGraph:l,isSubjectReference:c}=Gi(),{expandIri:d,getContextValue:f,isKeyword:g,process:y,processingMode:b}=Ir(),{removeBase:_,prependBase:E}=or(),{REGEX_KEYWORD:S,addValue:k,asArray:v,compareShortestLeast:u}=oi(),m={};Ka=m,m.compact=async({activeCtx:$,activeProperty:j=null,element:R,options:P={}})=>{if(e(R)){let I=[];for(let L=0;L<R.length;++L){const Q=await m.compact({activeCtx:$,activeProperty:j,element:R[L],options:P});Q!==null&&I.push(Q)}return P.compactArrays&&I.length===1&&(f($,j,"@container")||[]).length===0&&(I=I[0]),I}const q=f($,j,"@context");if(n(q)||($=await y({activeCtx:$,localCtx:q,propagate:!0,overrideProtected:!0,options:P})),t(R)){if(P.link&&"@id"in R&&P.link.hasOwnProperty(R["@id"])){const x=P.link[R["@id"]];for(let z=0;z<x.length;++z)if(x[z].expanded===R)return x[z].compacted}if(o(R)||c(R)){const x=m.compactValue({activeCtx:$,activeProperty:j,value:R,options:P});return P.link&&c(R)&&(P.link.hasOwnProperty(R["@id"])||(P.link[R["@id"]]=[]),P.link[R["@id"]].push({expanded:R,compacted:x})),x}if(s(R)&&(f($,j,"@container")||[]).includes("@list"))return m.compact({activeCtx:$,activeProperty:j,element:R["@list"],options:P});const I=j==="@reverse",L={},Q=$;!o(R)&&!c(R)&&($=$.revertToPreviousContext());const A=f(Q,j,"@context");n(A)||($=await y({activeCtx:$,localCtx:A,propagate:!0,overrideProtected:!0,options:P})),P.link&&"@id"in R&&(P.link.hasOwnProperty(R["@id"])||(P.link[R["@id"]]=[]),P.link[R["@id"]].push({expanded:R,compacted:L}));let Y=R["@type"]||[];Y.length>1&&(Y=Array.from(Y).sort());const F=$;for(const x of Y){const z=m.compactIri({activeCtx:F,iri:x,relativeTo:{vocab:!0}}),Z=f(Q,z,"@context");n(Z)||($=await y({activeCtx:$,localCtx:Z,options:P,propagate:!1}))}const te=Object.keys(R).sort();for(const x of te){const z=R[x];if(x==="@id"){let Z=v(z).map(ce=>m.compactIri({activeCtx:$,iri:ce,relativeTo:{vocab:!1},base:P.base}));Z.length===1&&(Z=Z[0]);const J=m.compactIri({activeCtx:$,iri:"@id",relativeTo:{vocab:!0}});L[J]=Z;continue}if(x==="@type"){let Z=v(z).map(K=>m.compactIri({activeCtx:Q,iri:K,relativeTo:{vocab:!0}}));Z.length===1&&(Z=Z[0]);const J=m.compactIri({activeCtx:$,iri:"@type",relativeTo:{vocab:!0}}),W=(f($,J,"@container")||[]).includes("@set")&&b($,1.1)||e(Z)&&z.length===0;k(L,J,Z,{propertyIsArray:W});continue}if(x==="@reverse"){const Z=await m.compact({activeCtx:$,activeProperty:"@reverse",element:z,options:P});for(const J in Z)if($.mappings.has(J)&&$.mappings.get(J).reverse){const ce=Z[J],W=(f($,J,"@container")||[]).includes("@set")||!P.compactArrays;k(L,J,ce,{propertyIsArray:W}),delete Z[J]}if(Object.keys(Z).length>0){const J=m.compactIri({activeCtx:$,iri:x,relativeTo:{vocab:!0}});k(L,J,Z)}continue}if(x==="@preserve"){const Z=await m.compact({activeCtx:$,activeProperty:j,element:z,options:P});e(Z)&&Z.length===0||k(L,x,Z);continue}if(x==="@index"){if((f($,j,"@container")||[]).includes("@index"))continue;const J=m.compactIri({activeCtx:$,iri:x,relativeTo:{vocab:!0}});k(L,J,z);continue}if(x!=="@graph"&&x!=="@list"&&x!=="@included"&&g(x)){const Z=m.compactIri({activeCtx:$,iri:x,relativeTo:{vocab:!0}});k(L,Z,z);continue}if(!e(z))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(z.length===0){const Z=m.compactIri({activeCtx:$,iri:x,value:z,relativeTo:{vocab:!0},reverse:I}),J=$.mappings.has(Z)?$.mappings.get(Z)["@nest"]:null;let ce=L;J&&(N($,J,P),t(L[J])||(L[J]={}),ce=L[J]),k(ce,Z,z,{propertyIsArray:!0})}for(const Z of z){const J=m.compactIri({activeCtx:$,iri:x,value:Z,relativeTo:{vocab:!0},reverse:I}),ce=$.mappings.has(J)?$.mappings.get(J)["@nest"]:null;let H=L;ce&&(N($,ce,P),t(L[ce])||(L[ce]={}),H=L[ce]);const W=f($,J,"@container")||[],K=a(Z),V=s(Z);let re;V?re=Z["@list"]:K&&(re=Z["@graph"]);let ne=await m.compact({activeCtx:$,activeProperty:J,element:V||K?re:Z,options:P});if(V)if(e(ne)||(ne=[ne]),!W.includes("@list"))ne={[m.compactIri({activeCtx:$,iri:"@list",relativeTo:{vocab:!0}})]:ne},"@index"in Z&&(ne[m.compactIri({activeCtx:$,iri:"@index",relativeTo:{vocab:!0}})]=Z["@index"]);else{k(H,J,ne,{valueIsArray:!0,allowDuplicate:!0});continue}if(K)if(W.includes("@graph")&&(W.includes("@id")||W.includes("@index")&&l(Z))){let ge;H.hasOwnProperty(J)?ge=H[J]:H[J]=ge={};const be=(W.includes("@id")?Z["@id"]:Z["@index"])||m.compactIri({activeCtx:$,iri:"@none",relativeTo:{vocab:!0}});k(ge,be,ne,{propertyIsArray:!P.compactArrays||W.includes("@set")})}else W.includes("@graph")&&l(Z)?(e(ne)&&ne.length>1&&(ne={"@included":ne}),k(H,J,ne,{propertyIsArray:!P.compactArrays||W.includes("@set")})):(e(ne)&&ne.length===1&&P.compactArrays&&(ne=ne[0]),ne={[m.compactIri({activeCtx:$,iri:"@graph",relativeTo:{vocab:!0}})]:ne},"@id"in Z&&(ne[m.compactIri({activeCtx:$,iri:"@id",relativeTo:{vocab:!0}})]=Z["@id"]),"@index"in Z&&(ne[m.compactIri({activeCtx:$,iri:"@index",relativeTo:{vocab:!0}})]=Z["@index"]),k(H,J,ne,{propertyIsArray:!P.compactArrays||W.includes("@set")}));else if(W.includes("@language")||W.includes("@index")||W.includes("@id")||W.includes("@type")){let ge;H.hasOwnProperty(J)?ge=H[J]:H[J]=ge={};let be;if(W.includes("@language"))o(ne)&&(ne=ne["@value"]),be=Z["@language"];else if(W.includes("@index")){const O=f($,J,"@index")||"@index",G=m.compactIri({activeCtx:$,iri:O,relativeTo:{vocab:!0}});if(O==="@index")be=Z["@index"],delete ne[G];else{let oe;if([be,...oe]=v(ne[O]||[]),!r(be))be=null;else switch(oe.length){case 0:delete ne[O];break;case 1:ne[O]=oe[0];break;default:ne[O]=oe;break}}}else if(W.includes("@id")){const O=m.compactIri({activeCtx:$,iri:"@id",relativeTo:{vocab:!0}});be=ne[O],delete ne[O]}else if(W.includes("@type")){const O=m.compactIri({activeCtx:$,iri:"@type",relativeTo:{vocab:!0}});let G;switch([be,...G]=v(ne[O]||[]),G.length){case 0:delete ne[O];break;case 1:ne[O]=G[0];break;default:ne[O]=G;break}Object.keys(ne).length===1&&"@id"in Z&&(ne=await m.compact({activeCtx:$,activeProperty:J,element:{"@id":Z["@id"]},options:P}))}be||(be=m.compactIri({activeCtx:$,iri:"@none",relativeTo:{vocab:!0}})),k(ge,be,ne,{propertyIsArray:W.includes("@set")})}else{const ge=!P.compactArrays||W.includes("@set")||W.includes("@list")||e(ne)&&ne.length===0||x==="@list"||x==="@graph";k(H,J,ne,{propertyIsArray:ge})}}}return L}return R},m.compactIri=({activeCtx:$,iri:j,value:R=null,relativeTo:P={vocab:!1},reverse:q=!1,base:I=null})=>{if(j===null)return j;$.isPropertyTermScoped&&$.previousContext&&($=$.previousContext);const L=$.getInverse();if(g(j)&&j in L&&"@none"in L[j]&&"@type"in L[j]["@none"]&&"@none"in L[j]["@none"]["@type"])return L[j]["@none"]["@type"]["@none"];if(P.vocab&&j in L){const te=$["@language"]||"@none",x=[];t(R)&&"@index"in R&&!("@graph"in R)&&x.push("@index","@index@set"),t(R)&&"@preserve"in R&&(R=R["@preserve"][0]),a(R)?("@index"in R&&x.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&x.push("@graph@id","@graph@id@set"),x.push("@graph","@graph@set","@set"),"@index"in R||x.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||x.push("@graph@id","@graph@id@set")):t(R)&&!o(R)&&x.push("@id","@id@set","@type","@set@type");let z="@language",Z="@null";if(q)z="@type",Z="@reverse",x.push("@set");else if(s(R)){"@index"in R||x.push("@list");const ce=R["@list"];if(ce.length===0)z="@any",Z="@none";else{let H=ce.length===0?te:null,W=null;for(let K=0;K<ce.length;++K){const V=ce[K];let re="@none",ne="@none";if(o(V))if("@direction"in V){const ge=(V["@language"]||"").toLowerCase(),be=V["@direction"];re=`${ge}_${be}`}else"@language"in V?re=V["@language"].toLowerCase():"@type"in V?ne=V["@type"]:re="@null";else ne="@id";if(H===null?H=re:re!==H&&o(V)&&(H="@none"),W===null?W=ne:ne!==W&&(W="@none"),H==="@none"&&W==="@none")break}H=H||"@none",W=W||"@none",W!=="@none"?(z="@type",Z=W):Z=H}}else{if(o(R))if("@language"in R&&!("@index"in R)){x.push("@language","@language@set"),Z=R["@language"];const ce=R["@direction"];ce&&(Z=`${Z}_${ce}`)}else"@direction"in R&&!("@index"in R)?Z=`_${R["@direction"]}`:"@type"in R&&(z="@type",Z=R["@type"]);else z="@type",Z="@id";x.push("@set")}x.push("@none"),t(R)&&!("@index"in R)&&x.push("@index","@index@set"),o(R)&&Object.keys(R).length===1&&x.push("@language","@language@set");const J=T($,j,R,x,z,Z);if(J!==null)return J}if(P.vocab&&"@vocab"in $){const te=$["@vocab"];if(j.indexOf(te)===0&&j!==te){const x=j.substr(te.length);if(!$.mappings.has(x))return x}}let Q=null;const A=[];let Y=$.fastCurieMap;const F=j.length-1;for(let te=0;te<F&&j[te]in Y;++te)Y=Y[j[te]],""in Y&&A.push(Y[""][0]);for(let te=A.length-1;te>=0;--te){const x=A[te],z=x.terms;for(const Z of z){const J=Z+":"+j.substr(x.iri.length);$.mappings.get(Z)._prefix&&(!$.mappings.has(J)||R===null&&$.mappings.get(J)["@id"]===j)&&(Q===null||u(J,Q)<0)&&(Q=J)}}if(Q!==null)return Q;for(const[te,x]of $.mappings)if(x&&x._prefix&&j.startsWith(te+":"))throw new i(`Absolute IRI "${j}" confused with prefix "${te}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:$});if(!P.vocab)if("@base"in $)if($["@base"]){const te=_(E(I,$["@base"]),j);return S.test(te)?`./${te}`:te}else return j;else return _(I,j);return j},m.compactValue=({activeCtx:$,activeProperty:j,value:R,options:P})=>{if(o(R)){const Q=f($,j,"@type"),A=f($,j,"@language"),Y=f($,j,"@direction"),F=f($,j,"@container")||[],te="@index"in R&&!F.includes("@index");if(!te&&Q!=="@none"&&(R["@type"]===Q||"@language"in R&&R["@language"]===A&&"@direction"in R&&R["@direction"]===Y||"@language"in R&&R["@language"]===A||"@direction"in R&&R["@direction"]===Y))return R["@value"];const x=Object.keys(R).length,z=x===1||x===2&&"@index"in R&&!te,Z="@language"in $,J=r(R["@value"]),ce=$.mappings.has(j)&&$.mappings.get(j)["@language"]===null;if(z&&Q!=="@none"&&(!Z||!J||ce))return R["@value"];const H={};return te&&(H[m.compactIri({activeCtx:$,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?H[m.compactIri({activeCtx:$,iri:"@type",relativeTo:{vocab:!0}})]=m.compactIri({activeCtx:$,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(H[m.compactIri({activeCtx:$,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(H[m.compactIri({activeCtx:$,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),H[m.compactIri({activeCtx:$,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],H}const q=d($,j,{vocab:!0},P),I=f($,j,"@type"),L=m.compactIri({activeCtx:$,iri:R["@id"],relativeTo:{vocab:I==="@vocab"},base:P.base});return I==="@id"||I==="@vocab"||q==="@graph"?L:{[m.compactIri({activeCtx:$,iri:"@id",relativeTo:{vocab:!0}})]:L}};function T($,j,R,P,q,I){I===null&&(I="@null");const L=[];if((I==="@id"||I==="@reverse")&&t(R)&&"@id"in R){I==="@reverse"&&L.push("@reverse");const A=m.compactIri({activeCtx:$,iri:R["@id"],relativeTo:{vocab:!0}});$.mappings.has(A)&&$.mappings.get(A)&&$.mappings.get(A)["@id"]===R["@id"]?L.push.apply(L,["@vocab","@id"]):L.push.apply(L,["@id","@vocab"])}else{L.push(I);const A=L.find(Y=>Y.includes("_"));A&&L.push(A.replace(/^[^_]+_/,"_"))}L.push("@none");const Q=$.inverse[j];for(const A of P){if(!(A in Q))continue;const Y=Q[A][q];for(const F of L)if(F in Y)return Y[F]}return null}function N($,j,R){if(d($,j,{vocab:!0},R)!=="@nest")throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Ka}var Ja,Zu;function my(){return Zu||(Zu=1,Ja=i=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):i.compact(t,r)},e.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):i.expand(t)},e.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):i.flatten(t)},e}),Ja}/**
310
+ * A JavaScript implementation of the JSON-LD API.
311
+ *
312
+ * @author Dave Longley
313
+ *
314
+ * @license BSD 3-Clause License
315
+ * Copyright (c) 2011-2022 Digital Bazaar, Inc.
316
+ * All rights reserved.
317
+ *
318
+ * Redistribution and use in source and binary forms, with or without
319
+ * modification, are permitted provided that the following conditions are met:
320
+ *
321
+ * Redistributions of source code must retain the above copyright notice,
322
+ * this list of conditions and the following disclaimer.
323
+ *
324
+ * Redistributions in binary form must reproduce the above copyright
325
+ * notice, this list of conditions and the following disclaimer in the
326
+ * documentation and/or other materials provided with the distribution.
327
+ *
328
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
329
+ * contributors may be used to endorse or promote products derived from
330
+ * this software without specific prior written permission.
331
+ *
332
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
333
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
334
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
335
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
336
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
337
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
338
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
339
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
340
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
341
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
342
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
343
+ */var Xa,eh;function gy(){if(eh)return Xa;eh=1;const i=Tc(),e=iy(),t=oi(),r=oy(),n=t.IdentifierIssuer,s=di(),o=Xf(),a=ay(),{expand:l}=ly(),{flatten:c}=cy(),{fromRDF:d}=dy(),{toRDF:f}=hy(),{frameMergedOrDefault:g,cleanupNull:y}=fy(),{isArray:b,isObject:_,isString:E}=ii(),{isSubjectReference:S}=Gi(),{expandIri:k,getInitialContext:v,process:u,processingMode:m}=Ir(),{compact:T,compactIri:N}=py(),{createNodeMap:$,createMergedNodeMap:j,mergeNodeMaps:R}=bo(),{logEventHandler:P,logWarningEventHandler:q,safeEventHandler:I,setDefaultEventHandler:L,setupEventHandler:Q,strictEventHandler:A,unhandledEventHandler:Y}=ms(),F=function(x){const z={},J=new o({max:100});x.compact=async function(H,W,K){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(W===null)throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(H===null)return null;K=ce(K,{base:E(H)?H:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new n("_:b"),contextResolver:new r({sharedCache:J})}),K.link&&(K.skipExpansion=!0),K.compactToRelative||delete K.base;let V;K.skipExpansion?V=H:V=await x.expand(H,K);const re=await x.processContext(v(K),W,K);let ne=await T({activeCtx:re,element:V,options:K});K.compactArrays&&!K.graph&&b(ne)?ne.length===1?ne=ne[0]:ne.length===0&&(ne={}):K.graph&&_(ne)&&(ne=[ne]),_(W)&&"@context"in W&&(W=W["@context"]),W=t.clone(W),b(W)||(W=[W]);const ge=W;W=[];for(let O=0;O<ge.length;++O)(!_(ge[O])||Object.keys(ge[O]).length>0)&&W.push(ge[O]);const be=W.length>0;if(W.length===1&&(W=W[0]),b(ne)){const O=N({activeCtx:re,iri:"@graph",relativeTo:{vocab:!0}}),G=ne;ne={},be&&(ne["@context"]=W),ne[O]=G}else if(_(ne)&&be){const O=ne;ne={"@context":W};for(const G in O)ne[G]=O[G]}return ne},x.expand=async function(H,W){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");W=ce(W,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:J})});const K={},V=[];if("expandContext"in W){const be=t.clone(W.expandContext);_(be)&&"@context"in be?K.expandContext=be:K.expandContext={"@context":be},V.push(K.expandContext)}let re;if(!E(H))K.input=t.clone(H);else{const be=await x.get(H,W);re=be.documentUrl,K.input=be.document,be.contextUrl&&(K.remoteContext={"@context":be.contextUrl},V.push(K.remoteContext))}"base"in W||(W.base=re||"");let ne=v(W);for(const be of V)ne=await u({activeCtx:ne,localCtx:be,options:W});let ge=await l({activeCtx:ne,element:K.input,options:W});return _(ge)&&"@graph"in ge&&Object.keys(ge).length===1?ge=ge["@graph"]:ge===null&&(ge=[]),b(ge)||(ge=[ge]),ge},x.flatten=async function(H,W,K){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof W=="function"?W=null:W=W||null,K=ce(K,{base:E(H)?H:"",contextResolver:new r({sharedCache:J})});const V=await x.expand(H,K),re=c(V);return W===null?re:(K.graph=!0,K.skipExpansion=!0,await x.compact(re,W,K))},x.frame=async function(H,W,K){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(K=ce(K,{base:E(H)?H:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:J})}),E(W)){const pe=await x.get(W,K);if(W=pe.document,pe.contextUrl){let ye=W["@context"];ye?b(ye)?ye.push(pe.contextUrl):ye=[ye,pe.contextUrl]:ye=pe.contextUrl,W["@context"]=ye}}const V=W?W["@context"]||{}:{},re=await x.processContext(v(K),V,K);K.hasOwnProperty("omitGraph")||(K.omitGraph=m(re,1.1)),K.hasOwnProperty("pruneBlankNodeIdentifiers")||(K.pruneBlankNodeIdentifiers=m(re,1.1));const ne=await x.expand(H,K),ge={...K};ge.isFrame=!0,ge.keepFreeFloatingNodes=!0;const be=await x.expand(W,ge),O=Object.keys(W).map(pe=>k(re,pe,{vocab:!0}));ge.merged=!O.includes("@graph"),ge.is11=m(re,1.1);const G=g(ne,be,ge);ge.graph=!K.omitGraph,ge.skipExpansion=!0,ge.link={},ge.framing=!0;let oe=await x.compact(G,V,ge);return ge.link={},oe=y(oe,ge),oe},x.link=async function(H,W,K){const V={};return W&&(V["@context"]=W),V["@embed"]="@link",x.frame(H,V,K)},x.normalize=x.canonize=async function(H,W){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(W=ce(W,{base:E(H)?H:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:J})}),"inputFormat"in W){if(W.inputFormat!=="application/n-quads"&&W.inputFormat!=="application/nquads")throw new s("Unknown canonicalization input format.","jsonld.CanonizeError");const re=a.parse(H);return i.canonize(re,W)}const K={...W};delete K.format,K.produceGeneralizedRdf=!1;const V=await x.toRDF(H,K);return i.canonize(V,W)},x.fromRDF=async function(H,W){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");W=ce(W,{format:E(H)?"application/n-quads":void 0});const{format:K}=W;let{rdfParser:V}=W;if(K){if(V=V||z[K],!V)throw new s("Unknown input format.","jsonld.UnknownFormat",{format:K})}else V=()=>H;const re=await V(H);return d(re,W)},x.toRDF=async function(H,W){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");W=ce(W,{base:E(H)?H:"",skipExpansion:!1,contextResolver:new r({sharedCache:J})});let K;W.skipExpansion?K=H:K=await x.expand(H,W);const V=f(K,W);if(W.format){if(W.format==="application/n-quads"||W.format==="application/nquads")return a.serialize(V);throw new s("Unknown output format.","jsonld.UnknownFormat",{format:W.format})}return V},x.createNodeMap=async function(H,W){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");W=ce(W,{base:E(H)?H:"",contextResolver:new r({sharedCache:J})});const K=await x.expand(H,W);return j(K,W)},x.merge=async function(H,W,K){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(H))throw new TypeError('Could not merge, "docs" must be an array.');typeof W=="function"?W=null:W=W||null,K=ce(K,{contextResolver:new r({sharedCache:J})});const V=await Promise.all(H.map(pe=>{const ye={...K};return x.expand(pe,ye)}));let re=!0;"mergeNodes"in K&&(re=K.mergeNodes);const ne=K.issuer||new n("_:b"),ge={"@default":{}};for(let pe=0;pe<V.length;++pe){const ye=t.relabelBlankNodes(V[pe],{issuer:new n("_:b"+pe+"-")}),we=re||pe===0?ge:{"@default":{}};if($(ye,we,"@default",ne),we!==ge)for(const ie in we){const fe=we[ie];if(!(ie in ge)){ge[ie]=fe;continue}const ve=ge[ie];for(const ue in fe)ue in ve||(ve[ue]=fe[ue])}}const be=R(ge),O=[],G=Object.keys(be).sort();for(let pe=0;pe<G.length;++pe){const ye=be[G[pe]];S(ye)||O.push(ye)}return W===null?O:(K.graph=!0,K.skipExpansion=!0,await x.compact(O,W,K))},Object.defineProperty(x,"documentLoader",{get:()=>x._documentLoader,set:H=>x._documentLoader=H}),x.documentLoader=async H=>{throw new s("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:H})},x.get=async function(H,W){let K;typeof W.documentLoader=="function"?K=W.documentLoader:K=x.documentLoader;const V=await K(H);try{if(!V.document)throw new s("No remote document found at the given URL.","jsonld.NullRemoteDocument");E(V.document)&&(V.document=JSON.parse(V.document))}catch(re){throw new s("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:re,remoteDoc:V})}return V},x.processContext=async function(H,W,K){return K=ce(K,{base:"",contextResolver:new r({sharedCache:J})}),W===null?v(K):(W=t.clone(W),_(W)&&"@context"in W||(W={"@context":W}),u({activeCtx:H,localCtx:W,options:K}))},x.getContextValue=Ir().getContextValue,x.documentLoaders={},x.useDocumentLoader=function(H){if(!(H in x.documentLoaders))throw new s('Unknown document loader type: "'+H+'"',"jsonld.UnknownDocumentLoader",{type:H});x.documentLoader=x.documentLoaders[H].apply(x,Array.prototype.slice.call(arguments,1))},x.registerRDFParser=function(H,W){z[H]=W},x.unregisterRDFParser=function(H){delete z[H]},x.registerRDFParser("application/n-quads",a.parse),x.registerRDFParser("application/nquads",a.parse),x.url=or(),x.logEventHandler=P,x.logWarningEventHandler=q,x.safeEventHandler=I,x.setDefaultEventHandler=L,x.strictEventHandler=A,x.unhandledEventHandler=Y,x.util=t,Object.assign(x,t),x.promises=x,x.RequestQueue=Jf(),x.JsonLdProcessor=my()(x),e.setupGlobals(x),e.setupDocumentLoaders(x);function ce(H,{documentLoader:W=x.documentLoader,...K}){if(H&&"compactionMap"in H)throw new s('"compactionMap" not supported.',"jsonld.OptionsError");if(H&&"expansionMap"in H)throw new s('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:W},K,H,{eventHandler:Q({options:H})})}return x},te=function(){return F(function(){return te()})};return F(te),Xa=te,Xa}var yy=gy();const Qa={},Ya={};let Ol;class by{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=Ol;this.config.prefixes={};const t=[];if(e||(e=new Rt,t.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,Ws))),t.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",e,Si,new Il({blankNodePrefix:""}))),await Promise.all(t),!Ol&&(e==null?void 0:e.size)==0&&this.config.attributes.valuesSubject){const r=[...e.getObjects(this.config.attributes.valuesSubject,xt,Si),...e.getObjects(this.config.attributes.valuesSubject,Tl,Si)],n=[];for(const s of r){const o=this.toURL(s.value);o&&this.loadedExternalUrls.indexOf(o)<0&&(this.loadedExternalUrls.push(o),n.push(this.importRDF(this.fetchRDF(o),e,Ws)))}try{await Promise.allSettled(n)}catch(s){console.warn(s)}}this.config.store=e}async importRDF(e,t,r,n){const s=n||new Il,o=async a=>{const l=[];await new Promise((c,d)=>{s.parse(a,(f,g,y)=>{if(f)return console.warn("failed parsing graph",r,f.message),d(f);if(g){if(t.add(new lo(g.subject,g.predicate,g.object,r)),this.config.attributes.ignoreOwlImports===null&&gc.equals(g.predicate)){const b=this.toURL(g.object.value);b&&this.loadedExternalUrls.indexOf(b)<0&&(this.loadedExternalUrls.push(b),l.push(this.importRDF(this.fetchRDF(b),t,qe.namedNode(b),n)))}if(this.config.classInstanceProvider&&yc.equals(g.predicate)){const b=g.object.value;if(this.loadedClasses.indexOf(b)<0){let _;b in Ya?_=Ya[b]:(_=this.config.classInstanceProvider(b),Ya[b]=_),this.loadedClasses.push(b),l.push(this.importRDF(_,t,r,n))}}return}y&&this.config.registerPrefixes(y),c(null)})});try{await Promise.allSettled(l)}catch(c){console.warn(c)}};if(e instanceof Promise&&(e=await e),e){try{e=await yy.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch{}await o(e)}}async fetchRDF(e){if(e in Qa)return Qa[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(r=>r.text());return Qa[e]=t,t}toURL(e){if(Al(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const r=this.config.prefixes[t[0]];if(r&&(e=e.replace(`${t[0]}:`,r),Al(e)))return e}}return null}}function vy(i){Ol=i}class Za{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class th{constructor(e,t){this.attributes=new Za,this.loader=new by(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new Rt,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(r=>r.length>2?[r.toLocaleLowerCase(),r.substring(0,2)]:r)),""]}updateAttributes(e){const t=new Za;if(Object.keys(t).forEach(r=>{const n=e.dataset[r];n!==void 0&&(t[r]=n)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const r=this.languages.indexOf(t.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(t.language)}t.valuesGraph&&(this.valuesGraphId=qe.namedNode(t.valuesGraph))}static dataAttributes(){const e=new Za;return Object.keys(e).map(t=>(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),"data-"+t))}get store(){return this._store}set store(e){this._store=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects(t=>{this.groups.push(t.id)},xt,`${Ae}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}function wy(i){return"_:"+i.value}function _y(i,e){return[...i].map(t=>e(t)).join(`
344
+ `)+`
345
+ `}function xy(){return""}function Qf(i){return"<"+i.value+">"}const Ey=/["\\\\\n\r]/,Sy=/["\\\\\n\r]/g,ky={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function Iy(i){return ky[i]}function Ry(i){return Ey.test(i)?i.replace(Sy,Iy):i}function Ty(i){const e=Ry(i.value);return i.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':i.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+i.language:'"'+e+'"^^'+Qf(i.datatype)}function $y(i,e){const t=e(i.subject),r=e(i.predicate),n=e(i.object),s=e(i.graph);return`${t} ${r} ${n} ${s?s+" ":""}.`}function Cy(i){return"?"+i.value}function Qt(i){if(!i)return null;if(i.termType==="BlankNode")return wy(i);if(i.termType==="DefaultGraph")return xy();if(i.termType==="Literal")return Ty(i);if(i.termType==="NamedNode")return Qf(i);if(i.termType==="Quad"||i.subject&&i.predicate&&i.object&&i.graph)return $y(i,Qt);if(i.termType==="Variable")return Cy(i);if(i[Symbol.iterator])return _y(i,Qt);throw new Error(`unknown termType ${i.termType}`)}class ln{constructor(e){if(this.index=new Map,e)for(const[t,r]of e)this.set(t,r)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(Qt(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const r of this.entries())e.call(t,r[1],r[0],this)}get(e){const t=this.index.get(Qt(e));return t&&t.value}has(e){return this.index.has(Qt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=Qt(e);return this.index.set(r,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class ih{constructor({dataset:e,end:t,quad:r,start:n}){this.dataset=e,this.end=t,this.quad=r,this.start=n}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function rh(i){try{return Qt(i)}catch{return null}}class ai{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=Qt(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(rh(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(rh(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}let Yf=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Yf.prototype.termType="BlankNode";let Cc=class{equals(e){return!!e&&e.termType===this.termType}};Cc.prototype.termType="DefaultGraph";Cc.prototype.value="";function nh(i,e){if(!e)return null;if(e.termType==="BlankNode")return i.blankNode(e.value);if(e.termType==="DefaultGraph")return i.defaultGraph();if(e.termType==="Literal")return i.literal(e.value,e.language||i.namedNode(e.datatype.value));if(e.termType==="NamedNode")return i.namedNode(e.value);if(e.termType==="Quad"){const t=i.fromTerm(e.subject),r=i.fromTerm(e.predicate),n=i.fromTerm(e.object),s=i.fromTerm(e.graph);return i.quad(t,r,n,s)}if(e.termType==="Variable")return i.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}let Us=class{constructor(e,t,r,n=""){this.value=e,this.language=t,this.datatype=r,this.direction=n}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}};Us.prototype.termType="Literal";let gs=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};gs.prototype.termType="NamedNode";let Ac=class{constructor(e,t,r,n){this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}};Ac.prototype.termType="Quad";Ac.prototype.value="";let Zf=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Zf.prototype.termType="Variable";const Ay=new gs("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),sh=new gs("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Ny=new gs("http://www.w3.org/2001/XMLSchema#string");let ep=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new Cc}}namedNode(e){return new gs(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Yf(e)}literal(e,t){return typeof t=="string"?new Us(e,t,sh):typeof(t==null?void 0:t.language)=="string"?new Us(e,t.language,t.direction?Ay:sh,t.direction):new Us(e,"",t||Ny)}variable(e){return new Zf(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new Ac(e,t,r,n)}fromTerm(e){return nh(this,e)}fromQuad(e){return nh(this,e)}};ep.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const Nc=new ep,Ly={apply:(i,e,t)=>i(t[0]),get:(i,e)=>i(e)};function ui(i,{factory:e=Nc}={}){const t=(r="")=>e.namedNode(`${i}${r.raw||r}`);return typeof Proxy>"u"?t:new Proxy(t,Ly)}ui("http://www.w3.org/2001/XMLSchema#");const wi=ui("http://www.w3.org/1999/02/22-rdf-syntax-ns#");ui("http://www.w3.org/2000/01/rdf-schema#");class Ke{static add({ptr:e,start:t,end:r,subjects:n=[null],predicates:s=[null],objects:o=[null],graphs:a,callback:l}={}){if(!e.factory)throw new Error("add operation requires a factory");let c=()=>{};l&&(c=d=>{l(new ih({dataset:e.dataset,start:t,end:r,quad:d}))});for(const d of n)for(const f of s)for(const g of o)for(const y of a){const b={subject:d,predicate:f,object:g,graph:y};b[t]=e.term;const _=e.factory.quad(b.subject,b.predicate,b.object,b.graph);e.dataset.add(_),c(_)}return e}static addList({ptr:e,predicates:t,items:r,graphs:n}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const s of t)for(const o of n){const a=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,s,a[0]||wi.nil,o));for(let l=0;l<a.length;l++)e.dataset.add(e.factory.quad(a[l],wi.first,r[l],o)),e.dataset.add(e.factory.quad(a[l],wi.rest,a[l+1]||wi.nil,o))}return e}static delete({ptr:e,start:t,subjects:r=[null],predicates:n=[null],objects:s=[null]}){for(const o of r)for(const a of n)for(const l of s){const c={subject:o,predicate:a,object:l};c[t]=e.term;const d=e.dataset.match(c.subject,c.predicate,c.object);for(const f of d)e.dataset.delete(f)}return e}static deleteList({ptr:e,predicates:t}){const r=[];for(const n of t)for(const s of e.dataset.match(e.term,n)){let o=s.object;for(r.push(s);!wi.nil.equals(o);){o=r[r.length-1].object;const a=e.dataset.match(o);if(a.size===0)break;for(const l of a)r.push(l)}}for(const n of r)e.dataset.delete(n);return e}static execute({ptr:e,operation:t="traverse",quantifier:r,start:n,end:s,subjects:o,predicates:a,objects:l,graphs:c,items:d,callback:f}={}){if(t==="add")return Ke.add({ptr:e,start:n,end:s,subjects:o,predicates:a,objects:l,graphs:c,callback:f});if(t==="addList")return Ke.addList({ptr:e,predicates:a,items:d,graphs:c});if(t==="delete")return Ke.delete({ptr:e,start:n,subjects:o,predicates:a,objects:l});if(t==="deleteList")return Ke.deleteList({ptr:e,predicates:a});if(t==="isList")return Ke.isList({ptr:e});if(t==="list")return Ke.list({ptr:e});if(t==="traverse")return Ke.traverse({ptr:e,quantifier:r,start:n,end:s,subjects:o,predicates:a,objects:l,graphs:c});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return e.isAny()?!1:!!(wi.nil.equals(e.term)||Ke.traverse({ptr:e,predicates:[wi.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(wi.nil);){const t=e.out([wi.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([wi.rest]);if(r.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=r[0]}}}}static traverse({ptr:e,quantifier:t="one",start:r="subject",end:n="object",subjects:s=[null],predicates:o=[null],objects:a=[null],graphs:l=[null],callback:c}){if(t==="one")return Ke.traverseOne({ptr:e,start:r,end:n,subjects:s,predicates:o,objects:a,graphs:l,callback:c});if(t==="oneOrMore"){const d=Ke.traverse({ptr:e,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:l,callback:c});return Ke.traverseMore({ptrs:d,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:l,callback:c})}if(t==="zeroOrMore")return Ke.traverseMore({ptrs:[e],end:n,start:r,subjects:s,predicates:o,objects:a,graphs:l,callback:c});if(t==="zeroOrOne")return[e,...Ke.traverse({ptr:e,end:n,start:r,subjects:s,predicates:o,objects:a,graphs:l,callback:c})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:r,subjects:n,predicates:s,objects:o,graphs:a,callback:l}={}){let c=[...e],d,f;do{d=[];for(const g of e)d=[...d,...Ke.traverseOne({ptr:g,end:t,start:r,subjects:n,predicates:s,objects:o,graphs:a,callback:l})];f&&(d=d.filter(g=>!f.has(g.term))),e=d,c=[...c,...d],f=new ai(c.map(g=>g.term))}while(d.length>0);return c}static traverseOne({ptr:e,start:t,end:r,subjects:n,predicates:s,objects:o,graphs:a,callback:l=(c,d)=>d.extend(c)}={}){const c=[];for(const d of n)for(const f of s)for(const g of o)for(const y of a){const b={subject:d,predicate:f,object:g,graph:y};b[t]=e.term;for(const _ of e.dataset.match(b.subject,b.predicate,b.object,b.graph))c.push(l(new ih({dataset:e.dataset,end:r,quad:_,start:t}),e))}return c}}function oh(i,e){return e?t=>e(i.extend(t)):()=>{}}class ah{constructor({dataset:e,edges:t=[],factory:r,graph:n,term:s}){if(!e&&t.length===0)throw new Error("dataset or edges is required");if(t.length===0&&typeof s>"u")throw new Error("edges or term must be given");if(t.length>0&&s)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=r,this._graph=n,t.length===0&&(this._term=s)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,t,r){return Ke.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:oh(this,r)})}addList(e,t){return Ke.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,r){return Ke.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:oh(this,r)})}deleteIn(e,t){return Ke.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Ke.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Ke.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:r,end:n,subjects:s,predicates:o,objects:a,graphs:l,items:c,callback:d}){return Ke.execute({ptr:this,operation:e,quantifier:t,start:r,end:n,subjects:s,predicates:o,objects:a,graphs:l,items:c,callback:d})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Ke.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Ke.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Ke.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Ke.isList({ptr:this})}list(){return Ke.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,t){return Ke.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function lh(i,e){return i?i.equals(e):i===e}function Dy(i,e){return!(i.dataset!==e.dataset||!lh(i.graph,e.graph)||!lh(i.term,e.term))}function ch(i,e){return e?t=>e(new i.constructor({factory:i.factory,ptrs:[t]})):()=>{}}class Ys{constructor({dataset:e,factory:t,ptrs:r,terms:n,graphs:s}){if(this.factory=t,r)this.ptrs=[...r];else{this.ptrs=[];for(const o of n||[null])for(const a of s||[null])this.ptrs.push(new ah({dataset:e,factory:t,graph:a,term:o}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new ai(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e==null?void 0:e.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,r){const n=ch(this,r);for(const s of this.ptrs)s.addIn(e,t,n);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const r of this.ptrs)r.addList(e,t);return this}addOut(e,t,r){const n=ch(this,r);for(const s of this.ptrs)s.addOut(e,t,n);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const r of this.ptrs)r.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const r of this.ptrs)r.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce((t,r)=>(t.some(n=>Dy(n,r))||t.push(r.trim()),t),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(const r of e)t=t.execute(r);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(t=>t.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),t=this;return function*(){for(const r of e)yield t.clone({ptrs:[r]})}()}map(e){return[...this].map(e)}node(e){const t=this.dataset,r=[...e].map(n=>new ah({dataset:t,factory:this.factory,term:n}));return this.clone({ptrs:r})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,t))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}ui("http://www.w3.org/2002/07/owl#");const Rr=ui("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),Oy=ui("http://www.w3.org/2000/01/rdf-schema#"),ae=ui("http://www.w3.org/ns/shacl#"),Ml=ui("https://schemas.link/shacl-next#"),Lc=ui("http://www.w3.org/2001/XMLSchema#");function My(i){return i?`{${[...i.quads()].map(e=>Qt(e)).join(" ")}}`:"{}"}function Py(i){return i?`{${i.map(e=>My(e)).join(" ")}}`:"{}"}var el,dh;function jy(){if(dh)return el;dh=1;var i=/\s/;function e(t){for(var r=t.length;r--&&i.test(t.charAt(r)););return r}return el=e,el}var tl,uh;function By(){if(uh)return tl;uh=1;var i=jy(),e=/^\s+/;function t(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return tl=t,tl}var il,hh;function Fy(){if(hh)return il;hh=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return il=i,il}var rl,fh;function qy(){if(fh)return rl;fh=1;var i=typeof Fr=="object"&&Fr&&Fr.Object===Object&&Fr;return rl=i,rl}var nl,ph;function Uy(){if(ph)return nl;ph=1;var i=qy(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return nl=t,nl}var sl,mh;function tp(){if(mh)return sl;mh=1;var i=Uy(),e=i.Symbol;return sl=e,sl}var ol,gh;function Vy(){if(gh)return ol;gh=1;var i=tp(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,n=i?i.toStringTag:void 0;function s(o){var a=t.call(o,n),l=o[n];try{o[n]=void 0;var c=!0}catch{}var d=r.call(o);return c&&(a?o[n]=l:delete o[n]),d}return ol=s,ol}var al,yh;function zy(){if(yh)return al;yh=1;var i=Object.prototype,e=i.toString;function t(r){return e.call(r)}return al=t,al}var ll,bh;function Hy(){if(bh)return ll;bh=1;var i=tp(),e=Vy(),t=zy(),r="[object Null]",n="[object Undefined]",s=i?i.toStringTag:void 0;function o(a){return a==null?a===void 0?n:r:s&&s in Object(a)?e(a):t(a)}return ll=o,ll}var cl,vh;function Wy(){if(vh)return cl;vh=1;function i(e){return e!=null&&typeof e=="object"}return cl=i,cl}var dl,wh;function Gy(){if(wh)return dl;wh=1;var i=Hy(),e=Wy(),t="[object Symbol]";function r(n){return typeof n=="symbol"||e(n)&&i(n)==t}return dl=r,dl}var ul,_h;function Ky(){if(_h)return ul;_h=1;var i=By(),e=Fy(),t=Gy(),r=NaN,n=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return r;if(e(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=e(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=i(c);var f=s.test(c);return f||o.test(c)?a(c.slice(2),f?2:8):n.test(c)?r:+c}return ul=l,ul}var hl,xh;function Jy(){if(xh)return hl;xh=1;var i=Ky(),e=1/0,t=17976931348623157e292;function r(n){if(!n)return n===0?n:0;if(n=i(n),n===e||n===-e){var s=n<0?-1:1;return s*t}return n===n?n:0}return hl=r,hl}var fl,Eh;function Xy(){if(Eh)return fl;Eh=1;var i=Jy();function e(t){var r=i(t),n=r%1;return r===r?n?r-n:r:0}return fl=e,fl}var pl,Sh;function Qy(){if(Sh)return pl;Sh=1;var i=Xy(),e="Expected a function";function t(r,n){var s;if(typeof n!="function")throw new TypeError(e);return r=i(r),function(){return--r>0&&(s=n.apply(this,arguments)),r<=1&&(n=void 0),s}}return pl=t,pl}var ml,kh;function Yy(){if(kh)return ml;kh=1;var i=Qy();function e(t){return i(2,t)}return ml=e,ml}var Zy=Yy();const mi=Qp(Zy);let Ih=class{constructor({details:e,factory:t,options:r,results:n=[]}={}){this.details=e,this.factory=t,this.options=r,this.results=n,this._conforms=mi(()=>!this.results.some(s=>s.severity.equals(ae.Info)||s.severity.equals(ae.Violation)||s.severity.equals(ae.Warning))),this._ptr=mi(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Ys({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Rr.type],[ae.ValidationReport]).addOut([ae.conforms],[this.factory.literal(this.conforms.toString(),Lc.boolean)]);for(const t of this.results)e.addOut([ae.result],[this.factory.blankNode()],r=>{t.build(r,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function eb(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=Qt(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}let tb=class{constructor({args:e={},constraintComponent:t,factory:r,focusNode:n,message:s=[],path:o,results:a=[],severity:l,shape:c,source:d=[],value:f,valuePaths:g=[]}={}){this.args=e,this.constraintComponent=t,this.factory=r,this.focusNode=n,this.path=o||c.path,this.results=a,this.severity=l,this.shape=c,this.source=d,this.value=f,this.valuePaths=g,this._message=mi(()=>(this.shape.message.length>0&&(s=this.shape.message),s.length===0&&(s=this.shape.ptr.node([this.constraintComponent]).out([ae.message]).terms),s.map(y=>r.literal(eb(y.value,e),y.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Rr.type],[ae.ValidationResult]).addOut([ae.focusNode],this.focusNode.terms).addOut([ae.resultSeverity],[this.severity]).addOut([ae.sourceConstraint],this.source).addOut([ae.sourceConstraintComponent],[this.constraintComponent]).addOut([ae.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ae.resultMessage],this.message);const r=n=>{if(n.quantifier==="one")return n.predicates.length>1?e.node([this.factory.blankNode()]).addList([ae.alternativePath],n.predicates):n.start==="object"?e.node([this.factory.blankNode()]).addOut([ae.inversePath],[n.predicates[0]]):e.node([n.predicates[0]]);if(n.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ae.oneOrMorePath],[n.predicates[0]]);if(n.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ae.zeroOrMorePath],[n.predicates[0]]);if(n.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ae.zeroOrOnePath],[n.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ae.resultPath],r(this.path[0]).terms):e.addList([ae.resultPath],this.path.map(n=>r(n).term))),typeof this.value<"u"&&e.addOut([ae.value],this.value.terms),t)for(const n of this.results)e.addOut([ae.detail],[this.factory.blankNode()],s=>{n.build(s,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class Dc{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:s=new Ih({factory:e,options:r}),results:o=new Map,shape:a,value:l,valueOrNode:c,valuePaths:d,values:f}={}){this.factory=e,this.focusNode=t,this.options=r,this.processed=n,this.report=s,this.results=o,this.shape=a,this.value=l,this.valuePaths=d,this.valueOrNode=c,this.values=f}create({child:e,focusNode:t=this.focusNode,shape:r=this.shape,value:n=this.value,valueOrNode:s=this.valueOrNode,valuePaths:o=this.valuePaths,values:a=this.values}={}){return new Dc({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new Ih({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:n,valueOrNode:s,valuePaths:o,values:a})}id({shape:e=this.shape}={}){return`${Qt(e.ptr.term)} - ${Qt(this.focusNode.term)} - ${Py(this.valuePaths)}`}result(e){const t=new tb({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),r=this.id();this.results.has(r)?this.results.get(r).add(t):this.results.set(r,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:Ml.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Ml.Trace,constraintComponent:e,...t})}test(e,t,r){e?this.debug(t,r):this.violation(t,r)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||ae.Violation,...t})}}function ib(){return{generic:rb()}}function rb(){return i=>{i.trace(Ml.TraversalConstraintComponent,{args:{},message:[i.factory.literal("Traversal")],value:i.valueOrNode})}}class nb{constructor(e){this.validations=new ln(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let r=!1;const n=new Set;for(const s of e.ptr.execute({start:"subject",end:"predicate"})){const o=this.validations.get(s.term);o&&(n.add(o),s.term.equals(ae.property)&&(r=!0))}return t&&e.isPropertyShape&&!r&&n.add(ib),[...n].map(s=>s(e)).filter(Boolean)}}var mr={},gr={},En={},Rh;function ip(){if(Rh)return En;Rh=1,Object.defineProperty(En,"__esModule",{value:!0}),En.BlankNode=void 0;let i=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}};return En.BlankNode=i,En}var Sn={},kn={},Th;function rp(){if(Th)return kn;Th=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.DefaultGraph=void 0;let i=class{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}};return kn.DefaultGraph=i,i.INSTANCE=new i,kn}var In={},Rn={},$h;function Oc(){if($h)return Rn;$h=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.NamedNode=void 0;let i=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}};return Rn.NamedNode=i,Rn}var Ch;function np(){if(Ch)return In;Ch=1,Object.defineProperty(In,"__esModule",{value:!0}),In.Literal=void 0;const i=Oc();let e=class qn{constructor(r,n){this.termType="Literal",this.value=r,typeof n=="string"?(this.language=n,this.datatype=qn.RDF_LANGUAGE_STRING,this.direction=""):n?"termType"in n?(this.language="",this.datatype=n,this.direction=""):(this.language=n.language,this.datatype=n.direction?qn.RDF_DIRECTIONAL_LANGUAGE_STRING:qn.RDF_LANGUAGE_STRING,this.direction=n.direction||""):(this.language="",this.datatype=qn.XSD_STRING,this.direction="")}equals(r){return!!r&&r.termType==="Literal"&&r.value===this.value&&r.language===this.language&&(r.direction===this.direction||!r.direction&&this.direction==="")&&this.datatype.equals(r.datatype)}};return In.Literal=e,e.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string"),In}var Tn={},Ah;function sp(){if(Ah)return Tn;Ah=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.Quad=void 0;let i=class{constructor(t,r,n,s){this.termType="Quad",this.value="",this.subject=t,this.predicate=r,this.object=n,this.graph=s}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}};return Tn.Quad=i,Tn}var $n={},Nh;function op(){if(Nh)return $n;Nh=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.Variable=void 0;let i=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}};return $n.Variable=i,$n}var Lh;function sb(){if(Lh)return Sn;Lh=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.DataFactory=void 0;const i=ip(),e=rp(),t=np(),r=Oc(),n=sp(),s=op();let o=0,a=class{constructor(c){this.blankNodeCounter=0,c=c||{},this.blankNodePrefix=c.blankNodePrefix||`df_${o++}_`}namedNode(c){return new r.NamedNode(c)}blankNode(c){return new i.BlankNode(c||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(c,d){return new t.Literal(c,d)}variable(c){return new s.Variable(c)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(c,d,f,g){return new n.Quad(c,d,f,g||this.defaultGraph())}fromTerm(c){switch(c.termType){case"NamedNode":return this.namedNode(c.value);case"BlankNode":return this.blankNode(c.value);case"Literal":return c.language?this.literal(c.value,c.language):c.datatype.equals(t.Literal.XSD_STRING)?this.literal(c.value):this.literal(c.value,this.fromTerm(c.datatype));case"Variable":return this.variable(c.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(c.subject),this.fromTerm(c.predicate),this.fromTerm(c.object),this.fromTerm(c.graph))}}fromQuad(c){return this.fromTerm(c)}resetBlankNodeCounter(){this.blankNodeCounter=0}};return Sn.DataFactory=a,Sn}var Dh;function ob(){return Dh||(Dh=1,function(i){var e=gr&&gr.__createBinding||(Object.create?function(r,n,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(n,s);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(r,o,a)}:function(r,n,s,o){o===void 0&&(o=s),r[o]=n[s]}),t=gr&&gr.__exportStar||function(r,n){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(n,s)&&e(n,r,s)};Object.defineProperty(i,"__esModule",{value:!0}),t(ip(),i),t(sb(),i),t(rp(),i),t(np(),i),t(Oc(),i),t(sp(),i),t(op(),i)}(gr)),gr}var yr={},Cn={},An={},Oh;function Xr(){if(Oh)return An;Oh=1,Object.defineProperty(An,"__esModule",{value:!0}),An.Translator=void 0;let i=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,r,n){for(const s of r)this.supportedRdfDatatypes.push(s),this.fromRdfHandlers[s.value]=t;for(const s of n){let o=this.toRdfHandlers[s];o||(this.toRdfHandlers[s]=o=[]),o.push(t)}}fromRdf(t,r){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,r):t.value}toRdf(t,r){const n=this.toRdfHandlers[typeof t];if(n)for(const s of n){const o=s.toRdf(t,r);if(o)return o}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return An.Translator=i,An}var Mh;function ab(){if(Mh)return Cn;Mh=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.TypeHandlerBoolean=void 0;const i=Xr();let e=class ap{fromRdf(r,n){switch(r.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return n&&i.Translator.incorrectRdfDataType(r),!1}toRdf(r,{datatype:n,dataFactory:s}){return s.literal(r?"true":"false",n||s.namedNode(ap.TYPE))}};return Cn.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Cn}var Nn={},Ph;function lb(){if(Ph)return Nn;Ph=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.TypeHandlerDate=void 0;const i=Xr();let e=class Pl{fromRdf(r,n){switch(n&&!r.value.match(Pl.VALIDATORS[r.datatype.value.substr(33,r.datatype.value.length)])&&i.Translator.incorrectRdfDataType(r),r.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(r.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const s=r.value.split("-");return new Date(0,parseInt(s[0],10)-1,parseInt(s[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(r.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(r.value+"-01");default:return new Date(r.value)}}toRdf(r,{datatype:n,dataFactory:s}){if(n=n||s.namedNode(Pl.TYPES[0]),!(r instanceof Date))return null;const o=r;let a;switch(n.value){case"http://www.w3.org/2001/XMLSchema#gDay":a=String(o.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":a=o.getUTCMonth()+1+"-"+o.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":a=String(o.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":a=o.getUTCFullYear()+"-"+(o.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":a=o.toISOString().replace(/T.*$/,"");break;default:a=o.toISOString()}return s.literal(a,n)}};return Nn.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},Nn}var Ln={},jh;function cb(){if(jh)return Ln;jh=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.TypeHandlerNumberDouble=void 0;const i=Xr();let e=class lp{fromRdf(r,n){const s=parseFloat(r.value);return n&&isNaN(s)&&i.Translator.incorrectRdfDataType(r),s}toRdf(r,{datatype:n,dataFactory:s}){return n=n||s.namedNode(lp.TYPES[0]),isNaN(r)?s.literal("NaN",n):isFinite(r)?r%1===0?null:s.literal(r.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),n):s.literal(r>0?"INF":"-INF",n)}};return Ln.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Ln}var Dn={},Bh;function db(){if(Bh)return Dn;Bh=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.TypeHandlerNumberInteger=void 0;const i=Xr();let e=class Un{fromRdf(r,n){const s=parseInt(r.value,10);return n&&(isNaN(s)||r.value.indexOf(".")>=0)&&i.Translator.incorrectRdfDataType(r),s}toRdf(r,{datatype:n,dataFactory:s}){return s.literal(String(r),n||(r<=Un.MAX_INT&&r>=Un.MIN_INT?s.namedNode(Un.TYPES[0]):s.namedNode(Un.TYPES[1])))}};return Dn.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,Dn}var On={},Fh;function ub(){if(Fh)return On;Fh=1,Object.defineProperty(On,"__esModule",{value:!0}),On.TypeHandlerString=void 0;let i=class{fromRdf(t){return t.value}toRdf(t,{datatype:r,dataFactory:n}){return n.literal(t,r)}};return On.TypeHandlerString=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],On}var qh;function Uh(){return qh||(qh=1,function(i){var e=yr&&yr.__createBinding||(Object.create?function(r,n,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(n,s);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(r,o,a)}:function(r,n,s,o){o===void 0&&(o=s),r[o]=n[s]}),t=yr&&yr.__exportStar||function(r,n){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(n,s)&&e(n,r,s)};Object.defineProperty(i,"__esModule",{value:!0}),t(ab(),i),t(lb(),i),t(cb(),i),t(db(),i),t(ub(),i)}(yr)),yr}var gl={},Vh;function hb(){return Vh||(Vh=1,Object.defineProperty(gl,"__esModule",{value:!0})),gl}var zh;function fb(){return zh||(zh=1,function(i){var e=mr&&mr.__createBinding||(Object.create?function(y,b,_,E){E===void 0&&(E=_);var S=Object.getOwnPropertyDescriptor(b,_);(!S||("get"in S?!b.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return b[_]}}),Object.defineProperty(y,E,S)}:function(y,b,_,E){E===void 0&&(E=_),y[E]=b[_]}),t=mr&&mr.__exportStar||function(y,b){for(var _ in y)_!=="default"&&!Object.prototype.hasOwnProperty.call(b,_)&&e(b,y,_)};Object.defineProperty(i,"__esModule",{value:!0}),i.fromRdf=l,i.toRdf=c,i.getTermRaw=d,i.getSupportedRdfDatatypes=f,i.getSupportedJavaScriptPrimitives=g;const r=ob(),n=Uh(),s=Xr();t(Uh(),i),t(hb(),i),t(Xr(),i);const o=new r.DataFactory,a=new s.Translator;a.registerHandler(new n.TypeHandlerString,n.TypeHandlerString.TYPES.map(y=>o.namedNode(y)),["string"]),a.registerHandler(new n.TypeHandlerBoolean,[n.TypeHandlerBoolean.TYPE].map(y=>o.namedNode(y)),["boolean"]),a.registerHandler(new n.TypeHandlerNumberDouble,n.TypeHandlerNumberDouble.TYPES.map(y=>o.namedNode(y)),["number"]),a.registerHandler(new n.TypeHandlerNumberInteger,n.TypeHandlerNumberInteger.TYPES.map(y=>o.namedNode(y)),["number"]),a.registerHandler(new n.TypeHandlerDate,n.TypeHandlerDate.TYPES.map(y=>o.namedNode(y)),["object"]);function l(y,b){return a.fromRdf(y,b)}function c(y,b){return b&&"namedNode"in b&&(b={dataFactory:b}),b=b||{},b&&!b.dataFactory&&(b.dataFactory=o),a.toRdf(y,b)}function d(y,b){return y.termType==="Literal"?l(y,b):y.value}function f(){return a.getSupportedRdfDatatypes()}function g(){return a.getSupportedJavaScriptPrimitives()}}(mr)),mr}var os=fb();function Hh(i){if(i.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[i.term]};const e=i.out([ae.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(o=>o.term)};const t=i.out([ae.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const r=i.out([ae.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const n=i.out([ae.zeroOrMorePath]);if(n.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[n.term]};const s=i.out([ae.zeroOrOnePath]);if(s.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}}function pb(i){return i.terms.length===0?null:i.ptrs[0].isList()?[...i.list()].map(e=>Hh(e)):[Hh(i)]}class mb{constructor(e){this.shape=e,this._compiled=mi(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const r of this.compiled)r.node&&await r.node(t),r.generic&&await r.generic(t)}async validateProperty(e){let t;this.shape.isSparqlShape?t=e.focusNode:t=e.focusNode.executeAll(this.shape.path);const r=t.node(new ai(t.terms)),n=[...t].reduce((o,a)=>{const l=a.term,c=t.node([l]);return o.has(l)||o.set(l,{value:c,valuePaths:[]}),o.get(l).valuePaths.push(a),o},new ln).values(),s=e.create({shape:this.shape,values:r});for(const o of this.compiled)o.property&&await o.property(s);for(const{value:o,valuePaths:a}of n){const l=e.create({shape:this.shape,value:o,valueOrNode:o,valuePaths:a});for(const c of this.compiled)c.generic&&await c.generic(l)}}}function jl(i){const e=new ai,r=new Ys({dataset:i.dataset,terms:i.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[Oy.subClassOf]});for(const n of r.ptrs)for(const{term:s}of n.nodes())e.add(s);return e}class gb{constructor(e){this.targetClass=new ai([...jl(e.hasOut([Rr.type],[ae.NodeShape])),...jl(e.out([ae.targetClass]))]),this.targetNode=e.out([ae.targetNode]).terms,this.targetObjectsOf=e.out([ae.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ae.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),r=[...e.focusNode.hasOut([Rr.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],n=e.focusNode.clone({ptrs:r});return n.node([...new ai(n.terms)])}}class yb{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=mi(()=>{const r=this.ptr.out([ae.deactivated]).term;return r&&os.fromRdf(r)}),this._message=mi(()=>this.ptr.out([ae.message]).terms),this._path=mi(()=>pb(this.ptr.out([ae.path]))),this._severity=mi(()=>this.ptr.out([ae.severity]).term),this._shapeValidator=mi(()=>new mb(this)),this._sparql=mi(()=>this.ptr.out([ae.sparql])),this._targetResolver=mi(()=>new gb(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const r of e.results.get(t))e.report.results.push(r);return e}return e.processed.add(t),this.shapeValidator.validate(e)}}function bb(i){const e=parseInt(i.ptr.out([ae.maxCount]).value);return{property:vb(e)}}function vb(i){return e=>{e.test(e.values.terms.length<=i,ae.MaxCountConstraintComponent,{args:{maxCount:i},message:[e.factory.literal("More than {$maxCount} values")]})}}function wb(i){const e=parseInt(i.ptr.out([ae.minCount]).value);return{property:_b(e)}}function _b(i){return e=>{e.test(e.values.terms.length>=i,ae.MinCountConstraintComponent,{args:{minCount:i},message:[e.factory.literal("Less than {$minCount} values")]})}}async function xb(i,e){for(const t of i)if(!await e(t))return!1;return!0}async function Eb(i,e){return(await Promise.all(i.map(t=>e(t)))).filter(Boolean)}async function vo(i,e){return Promise.all(i.map(e))}async function Sb(i,e){for(const t of i)if(await e(t))return!0;return!1}function kb(i){const e=[...i.ptr.out([ae.and])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:Ib(e)}}function Ib(i){return async e=>{const t=await vo(i,async n=>(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=t.every(n=>n.conforms);e.test(r,ae.AndConstraintComponent,{results:t.flatMap(n=>n.results),value:e.valueOrNode})}}function Rb(i){const e=i.validator.shape(i.ptr.out([ae.not]));return{generic:Tb(e)}}function Tb(i){return async e=>{const t=(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!t.conforms;e.test(r,ae.NotConstraintComponent,{args:{not:i.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:t.results,value:e.valueOrNode})}}function $b(i){const e=[...i.ptr.out([ae.or])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:Cb(e)}}function Cb(i){return async e=>{let t=[],r;if(e.options.debug||e.options.details){const n=await vo(i,async s=>(await s.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);t=n.flatMap(s=>s.results),r=n.some(s=>s.conforms)}else r=await Sb(i,async n=>(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(r,ae.OrConstraintComponent,{results:t,value:e.valueOrNode})}}function Ab(i){const e=[...i.ptr.out([ae.xone])].flatMap(t=>[...t.list()]).map(t=>i.validator.shape(t));return{generic:Nb(e)}}function Nb(i){return async e=>{const t=await vo(i,async n=>(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=t.filter(n=>n.conforms).length===1;e.test(r,ae.XoneConstraintComponent,{results:t.flatMap(n=>n.results),value:e.valueOrNode})}}function Lb(i){if(!os.fromRdf(i.ptr.out([ae.closed]).term))return null;const t=i.ptr.out([ae.property]).map(s=>i.validator.shape(s)),r=new ai(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),n=new ai([...i.ptr.out([ae.ignoredProperties]).list()||[]].map(s=>s.term));return{node:Db(r,n)}}function Db(i,e){return t=>{const r=t.focusNode.execute({start:"subject",end:"predicate"}).filter(n=>e.has(n.term)?!1:!i.has(n.term));if(r.ptrs.length>0)for(const n of r)t.violation(ae.ClosedConstraintComponent,{message:[t.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[n.term]}],value:t.focusNode.node([[...n.quads()][0].object])});else t.debug(ae.ClosedConstraintComponent)}}function Ob(i){const e=i.ptr.out([ae.hasValue]).term;return{node:Mb(e),property:Pb(e)}}function Mb(i){return e=>{e.test(i.equals(e.valueOrNode.term),ae.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Pb(i){return e=>{const t=[...e.values].some(r=>i.equals(r.term));e.test(t,ae.HasValueConstraintComponent,{args:{hasValue:i},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function jb(i){const e=new ai([...i.ptr.out([ae.in]).list()].map(t=>t.term));return{generic:Bb(e)}}function Bb(i){return e=>{e.test(i.has(e.valueOrNode.term),ae.InConstraintComponent,{args:{in:[...i].map(t=>t.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function cn(i,e){if(!i||i.termType!=="Literal"||!e||e.termType!=="Literal"||Wh(i)!==Wh(e))return null;const t=os.fromRdf(i),r=os.fromRdf(e);return typeof t!=typeof r?null:typeof t=="string"?t.localeCompare(r):t-r}function Wh(i){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return Lc.dateTime.equals(i.datatype)&&e.test(i.value)}function Fb(i){const e=i.ptr.out([ae.disjoint]).term;return{generic:qb(e)}}function qb(i){return e=>{const t=e.focusNode.dataset.match(e.focusNode.term,i,e.valueOrNode.term);e.test(t.size===0,ae.DisjointConstraintComponent,{args:{disjoint:i},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function Ub(i){const e=i.ptr.out([ae.equals]).term;return{node:Vb(e),property:zb(e)}}function Vb(i){return e=>{const t=e.focusNode.out([i]),r=t.filter(s=>!s.term.equals(e.focusNode.term)),n=t.terms.length!==0&&r.terms.length===0;e.test(n,ae.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function zb(i){return e=>{const t=new ai(e.focusNode.out([i]).terms),r=new ai(e.values.terms),n=[...r].filter(a=>!t.has(a)),s=[...t].filter(a=>!r.has(a)),o=[...n,...s];for(const a of o)e.violation(ae.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([a])});o.length===0&&e.debug(ae.EqualsConstraintComponent,{args:{equals:i},message:[e.factory.literal("Must have same values as {$equals}")]})}}function Hb(i){const e=i.ptr.out([ae.lessThan]).term;return{property:Wb(e)}}function Wb(i){return e=>{const t=e.focusNode.out([i]).terms;for(const r of e.values)for(const n of t){const s=cn(r.term,n);s===null||s>=0?e.violation(ae.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(ae.LessThanConstraintComponent,{args:{lessThan:i},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}}}function Gb(i){const e=i.ptr.out([ae.lessThanOrEquals]).term;return{property:Kb(e)}}function Kb(i){return e=>{const t=e.focusNode.out([i]).terms;for(const r of e.values)for(const n of t){const s=cn(r.term,n);s===null||s>0?e.violation(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:i},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}}}function Jb(i){const e=i.ptr.out([ae.maxExclusive]).term;return{generic:Xb(e)}}function Xb(i){return e=>{const t=cn(e.valueOrNode.term,i);e.test(t!==null&&t<0,ae.MaxExclusiveConstraintComponent,{args:{maxExclusive:i},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Qb(i){const e=i.ptr.out([ae.maxInclusive]).term;return{generic:Yb(e)}}function Yb(i){return e=>{const t=cn(e.valueOrNode.term,i);e.test(t!==null&&t<=0,ae.MaxInclusiveConstraintComponent,{args:{maxInclusive:i},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Zb(i){const e=i.ptr.out([ae.minExclusive]).term;return{generic:ev(e)}}function ev(i){return e=>{const t=cn(e.valueOrNode.term,i);e.test(t!==null&&t>0,ae.MinExclusiveConstraintComponent,{args:{minExclusive:i},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function tv(i){const e=i.ptr.out([ae.minInclusive]).term;return{generic:iv(e)}}function iv(i){return e=>{const t=cn(e.valueOrNode.term,i);e.test(t!==null&&t>=0,ae.MinInclusiveConstraintComponent,{args:{minInclusive:i},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function rv(i){const e=[...i.ptr.out([ae.node])].map(t=>i.validator.shape(t));return{generic:nv(e)}}function nv(i){return async e=>{for(const t of i){const r=await t.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(r.report.conforms,ae.NodeConstraintComponent,{args:{node:t.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:r.report.results,value:e.valueOrNode})}}}function sv(i){const e=[...i.ptr.out([ae.property])].map(t=>i.validator.shape(t));return{generic:ov(e)}}function ov(i){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const r of i)await r.validate(t)}}function av(i){const e=i.validator.shape(i.ptr.out([ae.qualifiedValueShape])),t=i.ptr.out([ae.qualifiedValueShapesDisjoint]).term,r=t?os.fromRdf(t):!1,n=i.ptr.out([ae.qualifiedMaxCount]).term,s=n?parseInt(n.value):null,o=i.ptr.out([ae.qualifiedMinCount]).term,a=o?parseInt(o.value):null;return{property:lv(e,r,s,a)}}function lv(i,e,t,r){return async n=>{const s=[];let o=[];e&&(o=new Set(n.shape.ptr.in([ae.property]).out([ae.property]).out([ae.qualifiedValueShape]).filter(l=>!l.term.equals(i.ptr.term)).map(l=>n.shape.validator.shape(l))));const a=(await Eb(n.values,async l=>{const c=(await i.validate(n.create({child:!0,focusNode:l}))).report;if(s.push(c.results),!c.conforms)return!1;if(o.length===0)return!0;if(n.options.debug||n.options.details){const d=await vo([...o],async f=>(await f.validate(n.create({child:!0,focusNode:l}))).report);return s.push(d.flatMap(f=>f.results)),!d.every(f=>f.conforms)}else return!await xb([...o],async d=>(await d.validate(n.create({child:!0,focusNode:l}))).report.conforms)})).length;t!==null&&n.test(a<=t,ae.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),r!==null&&n.test(a>=r,ae.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:i.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function cv(i,e){return e?e.slice(0,i.length)===i:!1}function dv(i){const e=[...new Set([...i.ptr.out([ae.languageIn]).list()].map(t=>t.value))];return{generic:uv(e)}}function uv(i){return e=>{const t=i.some(r=>cv(r,e.valueOrNode.term.language));e.test(t,ae.LanguageInConstraintComponent,{args:{languageIn:i.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function hv(i){const e=parseInt(i.ptr.out([ae.maxLength]).value);return{generic:fv(e)}}function fv(i){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=i;e.test(t,ae.MaxLengthConstraintComponent,{args:{maxLength:i},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function pv(i){const e=parseInt(i.ptr.out([ae.minLength]).value);return{generic:mv(e)}}function mv(i){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=i;e.test(t,ae.MinLengthConstraintComponent,{args:{minLength:i},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function gv(i){const e=i.ptr.out([ae.pattern]).value,t=i.ptr.out([ae.flags]).value,r=new RegExp(e,t);return{generic:yv(e,t,r)}}function yv(i,e,t){return r=>{r.test(t.test(r.valueOrNode.term.value),ae.PatternConstraintComponent,{args:{flags:e,pattern:i},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}function bv(i){const e=i.ptr.out([ae.uniqueLang]).term;return e.value==="true"&&Lc.boolean.equals(e.datatype)?{property:vv()}:null}function vv(){return i=>{const t=Object.entries(i.values.terms.reduce((r,n)=>(n.language&&(r[n.language]=(r[n.language]||0)+1),r),{})).filter(([,r])=>r>1);for(const[r]of t)i.violation(ae.UniqueLangConstraintComponent,{args:{lang:r},message:[i.factory.literal('Language "{?lang}" used more than once')]});t.length===0&&i.debug(ae.UniqueLangConstraintComponent)}}const Vs=ui("http://www.w3.org/ns/shacl#"),cp=ui("https://schemas.link/shacl-next#");class Qr{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(Vs.Info)||e.severity.equals(Vs.Violation)||e.severity.equals(Vs.Warning))}}function wv(i,e){return Object.entries(e).reduce((t,[r,n])=>(n&&n.termType&&(n=Qt(n)),t.replace(`{$${r}}`,n).replace(`{?${r}}`,n)),i)}class Zs{constructor({args:e={},factory:t,message:r=[],severity:n=Vs.Violation}={}){this.severity=n,this.message=r.map(s=>t.literal(wv(s.value,e),s.language||null))}}class Mc{constructor({factory:e=Nc}={}){this.factory=e}clone({factory:e}={}){return new Mc({factory:e||this.factory})}validate(){return new Qr}validateSimple(){return!0}}class dn extends Mc{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new dn({datatypes:this.datatypes,factory:e||this.factory})}}class _v{constructor({factory:e=Nc,validations:t}={}){if(this.factory=e,this.validations=new ln,t)for(const r of Object.values(t)){const n=r.clone({factory:this.factory});for(const s of n.datatypes)this.validations.set(s,n)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new Qr}validateSimple(e){const t=this.validations.get(e.datatype);return t?t.validateSimple(e):!0}}class Ze extends dn{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Ze(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(r=>{let n;r.test(e.value)&&(n=cp.Debug);const s={pattern:this.factory.literal(r.toString()),this:e};return new Zs({args:s,factory:this.factory,message:this.message,severity:n})});return new Qr({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const xv=/^([-+]?[0-9]+)$/;class Bt extends Ze{constructor(e=null,t=null,r,{factory:n}={}){super(xv,r,{factory:n}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){var t,r;return new Bt((t=this.minInclusive)==null?void 0:t.toString(),(r=this.maxInclusive)==null?void 0:r.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!cp.Debug.equals(t[0].severity))return new Qr({results:t});const r=BigInt(e.value);if(this.minInclusive!==null&&r<this.minInclusive){const n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,s=[this.factory.literal(n)];t.push(new Zs({factory:this.factory,message:s}))}if(this.maxInclusive!==null&&r>this.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,s=[this.factory.literal(n)];t.push(new Zs({factory:this.factory,message:s}))}return new Qr({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}}class Pc extends dn{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new Pc(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const r=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,n=[this.factory.literal(r)];t.push(new Zs({factory:this.factory,message:n}))}return new Qr({results:t})}validateSimple(e){return this.values.has(e.value)}}const Fe={xsd:ui("http://www.w3.org/2001/XMLSchema#")},Ev=new dn({datatypes:Fe.xsd.anySimpleType}),Sv=new dn({datatypes:Fe.xsd.anyAtomicType}),wo=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,kv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,dp=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,jc=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,up=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Iv=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Rv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Tv=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,$v=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Cv=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Av=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Nv=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Lv=/^(([0-9a-fA-F]{2})*)$/,Dv=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Ov=new Ze(wo,Fe.xsd.string),Mv=new Pc(["1","true","0","false"],Fe.xsd.boolean),Pv=new Ze(kv,Fe.xsd.decimal),jv=new Ze(dp,Fe.xsd.float),Bv=new Ze(dp,Fe.xsd.double),Fv=new Ze(jc,Fe.xsd.duration),qv=new Ze(up,Fe.xsd.dateTime),Uv=new Ze(Iv,Fe.xsd.time),Vv=new Ze(Rv,Fe.xsd.date),zv=new Ze(Tv,Fe.xsd.gYearMonth),Hv=new Ze($v,Fe.xsd.gYear),Wv=new Ze(Cv,Fe.xsd.gMonthDay),Gv=new Ze(Av,Fe.xsd.gDay),Kv=new Ze(Nv,Fe.xsd.gMonth),Jv=new Ze(Lv,Fe.xsd.hexBinary),Xv=new Ze(Dv,Fe.xsd.base64Binary),Qv=new Ze(wo,Fe.xsd.anyURI),hp=/^([^\u000d\u000a\u0009]*)$/,Yv=/^([^ ]+( [^ ]+)*)*$/,Zv=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,e0=/^([^DT]*)$/,t0=/^([^YM]*[DT].*)$/,i0=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,r0=new Ze([wo,hp],Fe.xsd.normalizedString),n0=new Ze([wo,hp,Yv],Fe.xsd.token),s0=new Ze(Zv,Fe.xsd.language),o0=new Bt(null,null,Fe.xsd.integer),a0=new Bt(null,"0",Fe.xsd.nonPositiveInteger),l0=new Bt(null,"-1",Fe.xsd.negativeInteger),c0=new Bt("-9223372036854775808","9223372036854775807",Fe.xsd.long),d0=new Bt("-2147483648","2147483647",Fe.xsd.int),u0=new Bt("-32768","32767",Fe.xsd.short),h0=new Bt("-128","127",Fe.xsd.byte),f0=new Bt("0",null,Fe.xsd.nonNegativeInteger),p0=new Bt("0","18446744073709551615",Fe.xsd.unsignedLong),m0=new Bt("0","4294967295",Fe.xsd.unsignedInt),g0=new Bt("0","65535",Fe.xsd.unsignedShort),y0=new Bt("0","255",Fe.xsd.unsignedByte),b0=new Bt("1",null,Fe.xsd.positiveInteger),v0=new Ze([jc,e0],Fe.xsd.yearMonthDuration),w0=new Ze([jc,t0],Fe.xsd.dayTimeDuration),_0=new Ze([up,i0],Fe.xsd.dateTimeStamp),x0=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:Sv,anySimpleType:Ev,anyURI:Qv,base64Binary:Xv,boolean:Mv,byte:h0,date:Vv,dateTime:qv,dateTimeStamp:_0,dayTimeDuration:w0,decimal:Pv,double:Bv,duration:Fv,float:jv,gDay:Gv,gMonth:Kv,gMonthDay:Wv,gYear:Hv,gYearMonth:zv,hexBinary:Jv,int:d0,integer:o0,language:s0,long:c0,negativeInteger:l0,nonNegativeInteger:f0,nonPositiveInteger:a0,normalizedString:r0,positiveInteger:b0,short:u0,string:Ov,time:Uv,token:n0,unsignedByte:y0,unsignedInt:m0,unsignedLong:p0,unsignedShort:g0,yearMonthDuration:v0},Symbol.toStringTag,{value:"Module"}));class E0 extends _v{constructor({factory:e}={}){super({factory:e,validations:{...x0}})}}const S0=new ln([[ae.BlankNode,new Set(["BlankNode"])],[ae.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ae.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ae.IRI,new Set(["NamedNode"])],[ae.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ae.Literal,new Set(["Literal"])]]);function k0(i){const e=i.ptr.out([ae.class]).map(t=>jl(t));return{generic:I0(e)}}function I0(i){return e=>{const t=new ai(e.valueOrNode.out([Rr.type]).terms);for(const r of i){const n=[...t].some(s=>r.has(s));e.test(n,ae.ClassConstraintComponent,{value:e.valueOrNode})}}}function R0(i){const e=i.ptr.out([ae.datatype]).term,t=new E0;return{generic:T0(e,t)}}function T0(i,e){return t=>{const r=i.equals(t.valueOrNode.term.datatype)&&e.validateSimple(t.valueOrNode.term);t.test(r,ae.DatatypeConstraintComponent,{args:{datatype:i},message:[t.factory.literal("Value does not have datatype {$datatype}")],value:t.valueOrNode})}}function $0(i){const e=i.ptr.out([ae.nodeKind]).term,t=S0.get(e);return{generic:C0(e,t)}}function C0(i,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),ae.NodeKindConstraintComponent,{args:{nodeKind:i},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const A0=new ln([[ae.maxCount,bb],[ae.minCount,wb],[ae.and,kb],[ae.not,Rb],[ae.or,$b],[ae.xone,Ab],[ae.closed,Lb],[ae.hasValue,Ob],[ae.in,jb],[ae.disjoint,Fb],[ae.equals,Ub],[ae.lessThan,Hb],[ae.lessThanOrEquals,Gb],[ae.maxExclusive,Jb],[ae.maxInclusive,Qb],[ae.minExclusive,Zb],[ae.minInclusive,tv],[ae.node,rv],[ae.property,sv],[ae.qualifiedValueShape,av],[ae.languageIn,dv],[ae.maxLength,hv],[ae.minLength,pv],[ae.pattern,gv],[ae.uniqueLang,bv],[ae.class,k0],[ae.datatype,R0],[ae.nodeKind,$0]]);class N0{constructor(e,{factory:t,...r}){if(this.factory=t,this.options=r,this.registry=new nb(A0),this.shapesPtr=new Ys({dataset:e,factory:t}),this.shapes=new ln,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[s,o]of this.options.validations)this.registry.validations.set(s,o);const n=[...this.shapesPtr.hasOut([ae.targetClass]),...this.shapesPtr.hasOut([ae.targetNode]),...this.shapesPtr.hasOut([ae.targetObjectsOf]),...this.shapesPtr.hasOut([ae.targetSubjectsOf]),...this.shapesPtr.hasOut([Rr.type],[ae.NodeShape]),...this.shapesPtr.hasOut([Rr.type],[ae.PropertyShape])];for(const s of n)this.shape(s)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new yb(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const r=new Ys({...e,factory:this.factory}),n=new Dc({factory:this.factory,focusNode:r,options:this.options,validator:this});t?t=t.map(s=>this.shape(this.shapesPtr.node(s.terms))):t=this.shapes.values();for(const s of t){const o=n.create({shape:s});let a;r.isAny()?a=s.resolveTargets(o):a=r;for(const l of a)await s.validate(o.create({focusNode:l}))}return n.report}}let L0=class extends HTMLElement{constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new th(e,this.form),this.form.addEventListener("change",t=>{t.stopPropagation(),this.config.editMode&&this.validate(!0).then(r=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:r.conforms,report:r}}))}).catch(r=>{console.warn(r)})})}static get observedAttributes(){return th.dataAttributes()}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout(async()=>{this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{await this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(r=>{this.form.classList.remove(r)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const r of Wm())r.stylesheet&&t.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new ir(e,this.config,this.config.attributes.valuesSubject?qe.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const r=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);r.addEventListener("click",n=>{n.preventDefault(),this.form.reportValidity()&&this.validate().then(s=>{var o;s!=null&&s.conforms?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):(o=this.form.querySelector(":scope .invalid > .editor"))==null||o.focus()})}),this.form.appendChild(r)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(qe.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,Ws)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}},200)}serialize(e="text/turtle",t=this.toRDF()){const r=t.getQuads(null,null,null,null);return Um(r,e,this.config.prefixes)}toRDF(e=new Rt){var t;return(t=this.shape)==null||t.toRDF(e),e}registerPlugin(e){Hm(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){vy(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){var t,r,n,s,o,a;for(const l of this.form.querySelectorAll(":scope .validation-error"))l.remove();for(const l of this.form.querySelectorAll(":scope .property-instance"))l.classList.remove("invalid"),(t=l.querySelector(":scope > .editor"))!=null&&t.value?l.classList.add("valid"):l.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),(r=this.shape)==null||r.toRDF(this.config.store),this.shape&&this.config.store.add(new lo(this.shape.shaclSubject,qe.namedNode(Ae+"targetNode"),this.shape.nodeId,this.config.valuesGraphId));try{const l=this.config.store,c=await new N0(l,{details:!0,factory:qe}).validate({dataset:l});for(const d of c.results)if((s=(n=d.focusNode)==null?void 0:n.ptrs)!=null&&s.length)for(const f of d.focusNode.ptrs){const g=f._term;if((o=d.path)!=null&&o.length){const y=d.path[0].predicates[0];let b=this.form.querySelectorAll(`:scope shacl-node[data-node-id='${g.id}'] > shacl-property > .property-instance[data-path='${y.id}'] > .editor, :scope shacl-node[data-node-id='${g.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${y.id}'] > .editor`);b.length===0&&(b=this.form.querySelectorAll(`:scope [data-node-id='${g.id}'] > * > [data-path='${y.id}']`));for(const _ of b)if(_.classList.contains("editor")){if(!e||_.value){let E=_.parentElement;E.classList.add("invalid"),E.classList.remove("valid"),E.appendChild(this.createValidationErrorDisplay(d));do E.classList.contains("collapsible")&&E.classList.add("open"),E=E.parentElement;while(E)}}else e||(_.classList.add("invalid"),_.classList.remove("valid"),_.appendChild(this.createValidationErrorDisplay(d,"node")))}else e||(a=this.form.querySelector(`:scope [data-node-id='${g.id}']`))==null||a.prepend(this.createValidationErrorDisplay(d,"node"))}return c}catch(l){return console.error(l),!1}}createValidationErrorDisplay(e,t){var n,s;const r=document.createElement("span");if(r.classList.add("validation-error"),t&&r.classList.add(t),e)if(((n=e.message)==null?void 0:n.length)>0)for(const o of e.message)r.title+=o.value+`
346
+ `;else r.title=(s=e.sourceConstraintComponent)==null?void 0:s.value;return r}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=qe.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,xt,Cs,null).length===0){console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`);return}}else if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,Si)>0){const t=qe.namedNode(this.config.attributes.valuesSubject),r=[...this.config.store.getQuads(t,xt,null,Si),...this.config.store.getQuads(t,Tl,null,Si)];if(r.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${xt.id} nor ${Tl.id} statement`);return}for(const n of r)if(this.config.store.getQuads(n.object,xt,Cs,null).length>0){e=n.object;break}if(!e){const n=this.config.store.getQuads(null,is,r[0].object,null);if(n.length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);return}if(n.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${n[0].subject})`),this.config.store.getQuads(n[0].subject,xt,Cs,null).length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${n[0].subject})`);return}e=n[0].subject}}else{const t=this.config.store.getQuads(null,xt,Cs,null);if(t.length==0){console.warn("shapes graph does not contain any root shapes");return}t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}removeFromDataGraph(e){this.config.attributes.valuesSubject;for(const t of this.config.store.getQuads(e,null,null,Si))this.config.store.delete(t),(t.object.termType==="NamedNode"||t.object.termType==="BlankNode")&&this.removeFromDataGraph(t.object)}};function Gh(i){return i!==null&&typeof i=="object"&&"constructor"in i&&i.constructor===Object}function Bc(i={},e={}){const t=["__proto__","constructor","prototype"];Object.keys(e).filter(r=>t.indexOf(r)<0).forEach(r=>{typeof i[r]>"u"?i[r]=e[r]:Gh(e[r])&&Gh(i[r])&&Object.keys(e[r]).length>0&&Bc(i[r],e[r])})}const fp={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function zt(){const i=typeof document<"u"?document:{};return Bc(i,fp),i}const D0={document:fp,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(i){return typeof setTimeout>"u"?(i(),null):setTimeout(i,0)},cancelAnimationFrame(i){typeof setTimeout>"u"||clearTimeout(i)}};function ar(){const i=typeof window<"u"?window:{};return Bc(i,D0),i}const O0=i=>(i==null?void 0:i.nodeName.toLowerCase())??"",ys=(i,e)=>(i==null?void 0:i.nodeName.toLowerCase())===e.toLowerCase(),dt=i=>typeof i=="function",ut=i=>typeof i=="string",_o=i=>typeof i=="number",M0=i=>typeof i=="boolean",at=i=>typeof i>"u",Fc=i=>i===null,qc=i=>typeof Window<"u"&&i instanceof Window,Uc=i=>typeof Document<"u"&&i instanceof Document,qi=i=>typeof Element<"u"&&i instanceof Element,P0=i=>typeof Node<"u"&&i instanceof Node,Ur=i=>!dt(i)&&!qc(i)&&_o(i.length),Pi=i=>typeof i=="object"&&i!==null,eo=i=>Uc(i)?i.documentElement:i,xo=i=>i.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),pp=i=>i&&i.replace(/^./,i[0].toLowerCase()).replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),mp=()=>!1,rt=(i,e)=>{for(let t=0;t<i.length;t+=1)if(e.call(i[t],i[t],t)===!1)return i;return i},Nt=(i,e)=>{const t=Object.keys(i);for(let r=0;r<t.length;r+=1){const n=t[r];if(e.call(i[n],n,i[n])===!1)return i}return i};class Tt{constructor(e){return this.length=0,e?(rt(e,(t,r)=>{this[r]=t}),this.length=e.length,this):this}}const to=(i=zt())=>/complete|interactive/.test(i.readyState),Eo=i=>zt().createElement(i),Vc=(i,e)=>i.appendChild(e),zc=i=>i.parentNode?i.parentNode.removeChild(i):i,gp=(i,e)=>{const t=Eo(e);return t.innerHTML=i,[].slice.call(t.childNodes)},j0=()=>{const i=function(e){if(!e)return new Tt;if(e instanceof Tt)return e;if(dt(e)){const t=zt();return to(t)?e.call(t,i):t.addEventListener("DOMContentLoaded",()=>e.call(t,i),{once:!0}),new Tt([t])}if(ut(e)){const t=e.trim();if(t.startsWith("<")&&t.endsWith(">")){let n="div";return Nt({li:"ul",tr:"tbody",td:"tr",th:"tr",tbody:"table",option:"select"},(o,a)=>{if(t.startsWith(`<${o}`))return n=a,!1}),new Tt(gp(t,n))}const r=zt();return new Tt(r.querySelectorAll(e))}return Ur(e)&&!P0(e)?new Tt(e):new Tt([e])};return i.fn=Tt.prototype,i},se=j0(),Hc=(i,e)=>(rt(e,t=>{i.push(t)}),i),bs=i=>[...new Set(i)];se.fn.get=function(i){return i===void 0?[].slice.call(this):this[i>=0?i:i+this.length]};se.fn.add=function(i){return new Tt(bs(Hc(this.get(),se(i).get())))};const yp=(i,e,t)=>{const r=i.getAttribute(e);return Fc(r)?t:r},bp=(i,e)=>{i.removeAttribute(e)},vp=(i,e,t)=>{Fc(t)?bp(i,e):i.setAttribute(e,t)};se.fn.each=function(i){return rt(this,(e,t)=>i.call(e,t,e))};rt(["add","remove","toggle"],i=>{se.fn[`${i}Class`]=function(e){return i==="remove"&&!arguments.length?this.each((t,r)=>{vp(r,"class","")}):this.each((t,r)=>{if(!qi(r))return;const n=(dt(e)?e.call(r,t,yp(r,"class","")):e).split(" ").filter(s=>s);rt(n,s=>{r.classList[i](s)})})}});rt(["insertBefore","insertAfter"],(i,e)=>{se.fn[i]=function(t){const r=e?se(this.get().reverse()):this,n=se(t),s=[];return n.each((o,a)=>{a.parentNode&&r.each((l,c)=>{const d=o?c.cloneNode(!0):c,f=e?a.nextSibling:a;s.push(d),a.parentNode.insertBefore(d,f)})}),se(e?s.reverse():s)}});const B0=i=>ut(i)&&!(i.startsWith("<")&&i.endsWith(">"));rt(["before","after"],(i,e)=>{se.fn[i]=function(...t){return e===1&&(t=t.reverse()),this.each((r,n)=>{const s=dt(t[0])?[t[0].call(n,r,n.innerHTML)]:t;rt(s,o=>{let a;B0(o)?a=se(gp(o,"div")):r&&qi(o)?a=se(o.cloneNode(!0)):a=se(o),a[e?"insertAfter":"insertBefore"](n)})})}});function wp(i,e){return Ur(i)?rt(i,(t,r)=>e.call(t,r,t)):Nt(i,e)}function Jn(i,e){const t=ar();let r;const n=[];return wp(i,(s,o)=>{r=e.call(t,o,s),r!=null&&n.push(r)}),[].concat(...n)}se.fn.map=function(i){return new Tt(Jn(this,(e,t)=>i.call(e,t,e)))};se.fn.clone=function(){return this.map(function(){return this.cloneNode(!0)})};se.fn.is=function(i){let e=!1;if(dt(i))return this.each((r,n)=>{i.call(n,r,n)&&(e=!0)}),e;if(ut(i))return this.each((r,n)=>{Uc(n)||qc(n)||n.matches.call(n,i)&&(e=!0)}),e;const t=se(i);return this.each((r,n)=>{t.each((s,o)=>{n===o&&(e=!0)})}),e};se.fn.remove=function(i){return this.each((e,t)=>{(!i||se(t).is(i))&&zc(t)})};rt(["prepend","append"],(i,e)=>{se.fn[i]=function(...t){return this.each((r,n)=>{const s=n.childNodes,o=s.length,a=o?s[e?o-1:0]:Eo("div");o||Vc(n,a);let l=dt(t[0])?[t[0].call(n,r,n.innerHTML)]:t;r&&(l=l.map(c=>ut(c)?c:se(c).clone())),se(a)[e?"after":"before"](...l),o||zc(a)})}});rt(["appendTo","prependTo"],(i,e)=>{se.fn[i]=function(t){const r=[],n=se(t).map((o,a)=>{const l=a.childNodes,c=l.length;if(c)return l[e?0:c-1];const d=Eo("div");return Vc(a,d),r.push(d),d}),s=this[e?"insertBefore":"insertAfter"](n);return se(r).remove(),s}});const So=(i,e)=>ar().getComputedStyle(i).getPropertyValue(pp(e)),_p=i=>So(i,"box-sizing")==="border-box",Bl=(i,e,t)=>{const r=e==="width"?["Left","Right"]:["Top","Bottom"];return[0,1].reduce((n,s,o)=>{let a=t+r[o];return t==="border"&&(a+="Width"),n+parseFloat(So(i,a)||"0")},0)},ko=(i,e)=>{if(e==="width"||e==="height"){const t=i.getBoundingClientRect()[e];return _p(i)?`${t}px`:`${t-Bl(i,e,"border")-Bl(i,e,"padding")}px`}return So(i,e)},F0=["animation-iteration-count","column-count","fill-opacity","flex-grow","flex-shrink","font-weight","grid-area","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","line-height","opacity","order","orphans","widows","z-index","zoom"];rt(["attr","prop","css"],(i,e)=>{const t=(n,s,o)=>{if(at(o))return;if(e===0)return vp(n,s,o);if(e===1){n[s]=o;return}s=pp(s);const a=()=>s.startsWith("--")||F0.includes(s)?"":"px";n.style.setProperty(s,_o(o)?`${o}${a()}`:o)},r=(n,s)=>e===0?yp(n,s):e===1?n[s]:ko(n,s);se.fn[i]=function(n,s){if(Pi(n))return Nt(n,(o,a)=>{this[i](o,a)}),this;if(arguments.length===1){const o=this[0];return qi(o)?r(o,n):void 0}return this.each((o,a)=>{t(a,n,dt(s)?s.call(a,o,r(a,n)):s)})}});se.fn.children=function(i){const e=[];return this.each((t,r)=>{rt(r.childNodes,n=>{qi(n)&&(!i||se(n).is(i))&&e.push(n)})}),new Tt(bs(e))};se.fn.slice=function(...i){return new Tt([].slice.apply(this,i))};se.fn.eq=function(i){const e=i===-1?this.slice(i):this.slice(i,+i+1);return new Tt(e)};const Wc=(i,e,t,r,n)=>{const s=[];let o;return i.each((a,l)=>{for(o=l[t];o&&qi(o);){if(e===2){if(r&&se(o).is(r))break;(!n||se(o).is(n))&&s.push(o)}else if(e===0){(!r||se(o).is(r))&&s.push(o);break}else(!r||se(o).is(r))&&s.push(o);o=o[t]}}),new Tt(bs(s))};rt(["","s","sUntil"],(i,e)=>{se.fn[`parent${i}`]=function(t,r){const n=e?se(this.get().reverse()):this;return Wc(n,e,"parentNode",t,r)}});se.fn.closest=function(i){if(this.is(i))return this;const e=[];return this.parents().each((t,r)=>{if(se(r).is(i))return e.push(r),!1}),new Tt(e)};const Io=new WeakMap,vs=i=>Io.get(i)??{},xp=(i,e)=>{const t=vs(i),r=xo(e);return r in t?t[r]:void 0},Gc=(i,e)=>{const t=vs(i);Nt(e,(r,n)=>{t[xo(r)]=n}),Io.set(i,t)},Ep=(i,e,t)=>{Gc(i,{[e]:t})},q0=i=>{Io.delete(i)},U0=(i,e)=>{const t=vs(i);rt(e,r=>{const n=xo(r);delete t[n]}),Io.set(i,t)},V0=/^(?:{[\w\W]*\}|\[[\w\W]*\])$/,z0=i=>i==="true"?!0:i==="false"?!1:i==="null"?null:i===+i+""?+i:V0.test(i)?JSON.parse(i):i,Kh=(i,e,t)=>{if(at(t)&&i.nodeType===1&&(t=i.dataset[e],ut(t)))try{t=z0(t)}catch{}return t};se.fn.data=function(i,e){if(at(i)){if(!this.length)return;const t=this[0],r=vs(t);return t.nodeType!==1||Nt(t.dataset,n=>{r[n]=Kh(t,n,r[n])}),r}if(Pi(i))return this.each(function(){Gc(this,i)});if(arguments.length===2&&at(e))return this;if(!at(e))return this.each(function(){Ep(this,i,e)});if(this.length)return Kh(this[0],xo(i),xp(this[0],i))};se.fn.empty=function(){return this.each((i,e)=>{e.innerHTML=""})};se.fn.extend=function(i){return Nt(i,(e,t)=>{se.fn[e]=t}),this};se.fn.filter=function(i){if(dt(i))return this.map((t,r)=>i.call(r,t,r)?r:void 0);if(ut(i))return this.map((t,r)=>se(r).is(i)?r:void 0);const e=se(i);return this.map((t,r)=>e.get().includes(r)?r:void 0)};se.fn.find=function(i){const e=[];return this.each((t,r)=>{Hc(e,se(r.querySelectorAll(i)).get())}),new Tt(e)};se.fn.first=function(){return this.eq(0)};const Kc=(i,e)=>i!==e&&eo(i).contains(e);se.fn.has=function(i){const e=ut(i)?this.find(i):se(i),{length:t}=e;return this.map(function(){for(let r=0;r<t;r+=1)if(Kc(this,e[r]))return this})};se.fn.hasClass=function(i){return this[0].classList.contains(i)};const Sp=(i,e,t,r,n,s)=>{const o=a=>Bl(i,e.toLowerCase(),a)*s;return r===2&&n&&(t+=o("margin")),_p(i)?(r===0&&(t-=o("border")),r===1&&(t-=o("border"),t-=o("padding"))):(r===0&&(t+=o("padding")),r===2&&(t+=o("border"),t+=o("padding"))),t},kp=(i,e,t,r)=>{const n=zt(),s=`client${e}`,o=`scroll${e}`,a=`offset${e}`,l=`inner${e}`;if(qc(i))return t===2?i[l]:eo(n)[s];if(Uc(i)){const d=eo(i);return Math.max(i.body[o],d[o],i.body[a],d[a],d[s])}const c=parseFloat(So(i,e.toLowerCase())||"0");return Sp(i,e,c,t,r,1)},H0=(i,e,t,r,n,s)=>{let o=dt(s)?s.call(i,e,kp(i,t,r,n)):s;if(o==null)return;const a=se(i),l=t.toLowerCase();if(ut(o)&&["auto","inherit",""].includes(o)){a.css(l,o);return}const c=o.toString().replace(/\b[0-9.]*/,""),d=parseFloat(o);o=Sp(i,t,d,r,n,-1)+(c||"px"),a.css(l,o)};rt(["Width","Height"],i=>{rt([`inner${i}`,i.toLowerCase(),`outer${i}`],(e,t)=>{se.fn[e]=function(r,n){const s=arguments.length&&(t<2||!M0(r)),o=r===!0||n===!0;return s?this.each((a,l)=>H0(l,a,i,t,o,r)):this.length?kp(this[0],i,t,o):void 0}})});se.fn.hide=function(){return this.each((i,e)=>{e.style.display="none"})};rt(["val","html","text"],(i,e)=>{const r=["value","innerHTML","textContent"][e],n=o=>{if(e===2)return Jn(o,c=>eo(c)[r]).join("");if(!o.length)return;const a=o[0],l=se(a);return e===0&&l.is("select[multiple]")?Jn(l.find("option:checked"),c=>c.value):a[r]},s=(o,a)=>{if(at(a)){if(e!==0)return;a=""}e===1&&qi(a)&&(a=a.outerHTML),o[r]=a};se.fn[i]=function(o){return arguments.length?this.each((a,l)=>{const c=se(l),d=dt(o)?o.call(l,a,n(c)):o;e===0&&Array.isArray(d)?c.is("select[multiple]")?Jn(c.find("option"),f=>f.selected=d.includes(f.value)):l.checked=d.includes(l.value):s(l,d)}):n(this)}});se.fn.index=function(i){return arguments.length?ut(i)?se(i).get().indexOf(this[0]):this.get().indexOf(se(i)[0]):this.eq(0).parent().children().get().indexOf(this[0])};se.fn.last=function(){return this.eq(-1)};rt(["","All","Until"],(i,e)=>{se.fn[`next${i}`]=function(t,r){return Wc(this,e,"nextElementSibling",t,r)}});se.fn.not=function(i){const e=this.filter(i);return this.map((t,r)=>e.index(r)>-1?void 0:r)};const W0=ar().CustomEvent;class G0 extends W0{constructor(e,t){super(e,t),this.data=t.data,this.namespace=t.namespace}}const yl=new WeakMap;let K0=1;const Fl=i=>(yl.has(i)||yl.set(i,++K0),yl.get(i)),Jh=new Map,io=i=>{const e=Fl(i);return Jh.get(e)||Jh.set(e,[]).get(e)},Jc=i=>{const e=i.split(".");return{type:e[0],namespace:e.slice(1).sort().join(" ")}},Ip=i=>new RegExp("(?:^| )"+i.replace(" "," .* ?")+"(?: |$)"),J0=(i,e,t,r)=>{const n=Jc(e);return io(i).filter(s=>s&&(!n.type||s.type===n.type)&&(!n.namespace||Ip(n.namespace).test(s.namespace))&&(!t||Fl(s.func)===Fl(t))&&(!r||s.selector===r))},X0=(i,e,t,r,n)=>{let s=!1;Pi(r)&&r.useCapture&&(s=!0),e.split(" ").forEach(o=>{if(!o)return;const a=Jc(o),l=(f,g)=>{t.apply(g,f.detail===null?[f]:[f].concat(f.detail))===!1&&(f.preventDefault(),f.stopPropagation())},c=f=>{f.namespace&&!Ip(f.namespace).test(a.namespace)||(f.data=r,n?se(i).find(n).get().reverse().forEach(g=>{(g===f.target||Kc(g,f.target))&&l(f,g)}):l(f,i))},d={type:a.type,namespace:a.namespace,func:t,selector:n,id:io(i).length,proxy:c};io(i).push(d),i.addEventListener(d.type,c,s)})},Q0=(i,e,t,r)=>{const n=io(i),s=o=>{delete n[o.id],i.removeEventListener(o.type,o.proxy,!1)};e?e.split(" ").forEach(o=>{o&&J0(i,o,t,r).forEach(a=>{s(a)})}):n.forEach(o=>{s(o)})};se.fn.off=function(i,e,t){return Pi(i)?(Nt(i,(r,n)=>{this.off(r,e,n)}),this):((e===!1||dt(e))&&(t=e,e=void 0),t===!1&&(t=mp),this.each(function(){Q0(this,i,t,e)}))};function Ro(i,...e){return rt(e,t=>{Nt(t,(r,n)=>{at(n)||(i[r]=n)})}),i}se.fn.offsetParent=function(){const i=zt();return this.map(function(){let e=this.offsetParent;for(;e&&se(e).css("position")==="static";)e=e.offsetParent;return e||i.documentElement})};const Ls=(i,e)=>parseFloat(i.css(e));se.fn.position=function(){if(!this.length)return;const i=this.eq(0);let e,t={left:0,top:0};if(i.css("position")==="fixed")e=i[0].getBoundingClientRect();else{e=i.offset();const r=i.offsetParent();t=r.offset(),t.top+=Ls(r,"border-top-width"),t.left+=Ls(r,"border-left-width")}return{top:e.top-t.top-Ls(i,"margin-top"),left:e.left-t.left-Ls(i,"margin-left")}};const Rp=i=>{if(!i.getClientRects().length)return{top:0,left:0};const{top:e,left:t}=i.getBoundingClientRect(),{pageYOffset:r,pageXOffset:n}=i.ownerDocument.defaultView;return{top:e+r,left:t+n}},Y0=(i,e,t)=>{const r=se(i),n=r.css("position");n==="static"&&r.css("position","relative");const s=Rp(i),o=r.css("top"),a=r.css("left");let l,c;if((n==="absolute"||n==="fixed")&&(o+a).includes("auto")){const g=r.position();l=g.top,c=g.left}else l=parseFloat(o),c=parseFloat(a);const f=dt(e)?e.call(i,t,Ro({},s)):e;r.css({top:f.top!=null?f.top-s.top+l:void 0,left:f.left!=null?f.left-s.left+c:void 0})};se.fn.offset=function(i){return arguments.length?this.each(function(e){Y0(this,i,e)}):this.length?Rp(this[0]):void 0};se.fn.on=function(i,e,t,r,n){if(Pi(i))return ut(e)||(t=t||e,e=void 0),Nt(i,(s,o)=>{this.on(s,e,t,o,n)}),this;if(t==null&&r==null?(r=e,t=e=void 0):r==null&&(ut(e)?(r=t,t=void 0):(r=t,t=e,e=void 0)),r===!1)r=mp;else if(!r)return this;if(n){const s=this,o=r;r=function(a,...l){return s.off(a.type,e,r),o.call(this,a,...l)}}return this.each(function(){X0(this,i,r,t,e)})};se.fn.one=function(i,e,t,r){return this.on(i,e,t,r,!0)};rt(["","All","Until"],(i,e)=>{se.fn[`prev${i}`]=function(t,r){const n=e?se(this.get().reverse()):this;return Wc(n,e,"previousElementSibling",t,r)}});se.fn.removeAttr=function(i){const e=i.split(" ").filter(t=>t);return this.each(function(){rt(e,t=>{bp(this,t)})})};const Tp=(i,e)=>{if(at(e))return q0(i);const t=ut(e)?e.split(" ").filter(r=>r):e;U0(i,t)};se.fn.removeData=function(i){return this.each((e,t)=>{Tp(t,i)})};se.fn.removeProp=function(i){return this.each((e,t)=>{try{delete t[i]}catch{}})};se.fn.replaceWith=function(i){return this.each((e,t)=>{let r=i;dt(r)?r=r.call(t,e,t.innerHTML):e&&!ut(r)&&(r=se(r).clone()),se(t).before(r)}),this.remove()};se.fn.replaceAll=function(i){return se(i).map((e,t)=>(se(t).replaceWith(e?this.clone():this),this.get()))};const Xc=i=>{if(!Pi(i)&&!Array.isArray(i))return"";const e=[],t=(r,n)=>{let s;Pi(n)?Nt(n,(o,a)=>{s=Array.isArray(n)&&!Pi(a)?"":o,t(`${r}[${s}]`,a)}):(s=n==null||n===""?"=":`=${encodeURIComponent(n)}`,e.push(encodeURIComponent(r)+s))};return Array.isArray(i)?rt(i,({name:r,value:n})=>t(r,n)):Nt(i,t),e.join("&")},Br=new WeakMap,$p=i=>{const e=[...i.elements],t=Br.get(i)||[],r=(n,s)=>n.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1;return[...e,...t].sort(r)},Cp=i=>{const e=[];return i.each((t,r)=>{const n=r instanceof HTMLFormElement?$p(r):[r];se(n).each((s,o)=>{const a=se(o),l=o.type,c=o.nodeName.toLowerCase();c!=="fieldset"&&o.name&&!o.disabled&&["input","select","textarea","keygen","mdui-checkbox","mdui-radio-group","mdui-switch","mdui-text-field","mdui-select","mdui-slider","mdui-range-slider","mdui-segmented-button-group"].includes(c)&&!["submit","button","image","reset","file"].includes(l)&&(!["radio","checkbox"].includes(l)||o.checked)&&(!["mdui-checkbox","mdui-switch"].includes(c)||o.checked)&&e.push({name:o.name,value:a.val()})})}),e};se.fn.serializeArray=function(){return Cp(this).map(i=>Array.isArray(i.value)?i.value.map(e=>({name:i.name,value:e})):i).flat()};se.fn.serialize=function(){return Xc(this.serializeArray())};se.fn.serializeObject=function(){const i={};return Cp(this).forEach(e=>{const{name:t,value:r}=e;if(!Object.prototype.hasOwnProperty.call(i,t))i[t]=r;else{const n=i[t];Array.isArray(n)||(i[t]=[n]),Array.isArray(r)?i[t].push(...r):i[t].push(r)}}),i};const bl={},Z0=i=>{const e=zt();let t,r;return bl[i]||(t=Eo(i),Vc(e.body,t),r=ko(t,"display"),zc(t),r==="none"&&(r="block"),bl[i]=r),bl[i]};se.fn.show=function(){return this.each((i,e)=>{e.style.display==="none"&&(e.style.display=""),ko(e,"display")==="none"&&(e.style.display=Z0(e.nodeName))})};se.fn.siblings=function(i){return this.prevAll(i).add(this.nextAll(i))};se.fn.toggle=function(){return this.each((i,e)=>{ko(e,"display")==="none"?se(e).show():se(e).hide()})};se.fn.trigger=function(i,e=null,t){const{type:r,namespace:n}=Jc(i),s=new G0(r,{detail:e,data:null,namespace:n,bubbles:!0,cancelable:!1,composed:!0,...t});return this.each((o,a)=>{a.dispatchEvent(s)})};const ew="ajaxStart",Xh="ajaxSuccess",Ds="ajaxError",vl="ajaxComplete",Xn={},tw=i=>["GET","HEAD"].includes(i),Qh=(i,e)=>`${i}&${e}`.replace(/[&?]{1,2}/,"?"),iw=i=>{const e=ar();return/^([\w-]+:)?\/\/([^/]+)/.test(i)&&RegExp.$2!==e.location.host},rw=i=>i>=200&&i<300||[0,304].includes(i),nw=i=>{const e={url:"",method:"GET",data:"",processData:!0,async:!0,cache:!0,username:"",password:"",headers:{},xhrFields:{},statusCode:{},dataType:"",contentType:"application/x-www-form-urlencoded",timeout:0,global:!0};return Nt(Xn,(t,r)=>{!["beforeSend","success","error","complete","statusCode"].includes(t)&&!at(r)&&(e[t]=r)}),Ro({},e,i)},Ap=i=>{const e=zt(),t=ar();let r=!1;const n={},s={},o=nw(i),a=o.method.toUpperCase();let{data:l,url:c}=o;c=c||t.location.toString();const{processData:d,async:f,cache:g,username:y,password:b,headers:_,xhrFields:E,statusCode:S,dataType:k,contentType:v,timeout:u,global:m}=o,T=tw(a);l&&(T||d)&&!ut(l)&&!(l instanceof ArrayBuffer)&&!(l instanceof Blob)&&!(l instanceof Document)&&!(l instanceof FormData)&&(l=Xc(l)),l&&T&&(c=Qh(c,l),l=null);const N=(j,R,...P)=>{m&&se(e).trigger(j,R==="success"?s:n);let q,I;R in Xn&&(q=Xn[R](...P)),o[R]&&(I=o[R](...P)),R==="beforeSend"&&[q,I].includes(!1)&&(r=!0)};return(()=>{let j;return new Promise((R,P)=>{const q=Q=>P(new Error(Q));T&&!g&&(c=Qh(c,`_=${Date.now()}`));const I=new XMLHttpRequest;I.open(a,c,f,y,b),(v||l&&!T&&v!==!1)&&I.setRequestHeader("Content-Type",v),k==="json"&&I.setRequestHeader("Accept","application/json, text/javascript"),Nt(_,(Q,A)=>{at(A)||I.setRequestHeader(Q,A+"")}),iw(c)||I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Nt(E,(Q,A)=>{I[Q]=A}),n.xhr=s.xhr=I,n.options=s.options=o;let L;if(I.onload=()=>{L&&clearTimeout(L);const Q=rw(I.status);let A;if(Q)if(j=I.status===204||a==="HEAD"?"nocontent":I.status===304?"notmodified":"success",k==="json"||!k&&(I.getResponseHeader("content-type")||"").includes("json")){try{A=a==="HEAD"?void 0:JSON.parse(I.responseText),s.response=A}catch{j="parsererror",N(Ds,"error",I,j),q(j)}j!=="parsererror"&&(N(Xh,"success",A,j,I),R(A))}else A=a==="HEAD"?void 0:I.responseType==="text"||I.responseType===""?I.responseText:I.response,s.response=A,N(Xh,"success",A,j,I),R(A);else j="error",N(Ds,"error",I,j),q(j);rt([Xn.statusCode??{},S],Y=>{Y[I.status]&&(Q?Y[I.status](A,j,I):Y[I.status](I,j))}),N(vl,"complete",I,j)},I.onerror=()=>{L&&clearTimeout(L),N(Ds,"error",I,I.statusText),N(vl,"complete",I,"error"),q(I.statusText)},I.onabort=()=>{let Q="abort";L&&(Q="timeout",clearTimeout(L)),N(Ds,"error",I,Q),N(vl,"complete",I,Q),q(Q)},N(ew,"beforeSend",I,o),r)return q("cancel");u>0&&(L=t.setTimeout(()=>I.abort(),u)),I.send(l)})})()};se.ajax=Ap;const sw=i=>Ro(Xn,i);se.ajaxSetup=sw;se.contains=Kc;function ow(i,e,t){return Pi(e)?(Gc(i,e),e):at(t)?at(e)?vs(i):xp(i,e):(Ep(i,e,t),t)}se.data=ow;se.each=wp;se.extend=function(i,...e){return e.length?Ro(i,...e):(Nt(i,(t,r)=>{this[t]=r}),this)};se.map=Jn;se.merge=Hc;se.param=Xc;se.removeData=Tp;se.unique=bs;function w(i,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}/**
347
+ * @license
348
+ * Copyright 2017 Google LLC
349
+ * SPDX-License-Identifier: BSD-3-Clause
350
+ */const Re=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
351
+ * @license
352
+ * Copyright 2017 Google LLC
353
+ * SPDX-License-Identifier: BSD-3-Clause
354
+ */const aw={attribute:!0,type:String,converter:Hr,reflect:!1,hasChanged:wc},lw=(i=aw,e,t)=>{const{kind:r,metadata:n}=t;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),s.set(t.name,i),r==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,i)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(r==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,i)}}throw Error("Unsupported decorator location: "+r)};function D(i){return(e,t)=>typeof t=="object"?lw(i,e,t):((r,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,r),o?Object.getOwnPropertyDescriptor(n,s):void 0})(i,e,t)}/**
355
+ * @license
356
+ * Copyright 2017 Google LLC
357
+ * SPDX-License-Identifier: BSD-3-Clause
358
+ */function Oe(i){return D({...i,state:!0,attribute:!1})}/**
359
+ * @license
360
+ * Copyright 2017 Google LLC
361
+ * SPDX-License-Identifier: BSD-3-Clause
362
+ */const cw=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);/**
363
+ * @license
364
+ * Copyright 2021 Google LLC
365
+ * SPDX-License-Identifier: BSD-3-Clause
366
+ */function ri(i){return(e,t)=>{const{slot:r,selector:n}=i??{},s="slot"+(r?`[name=${r}]`:":not([name])");return cw(e,t,{get(){var l;const o=(l=this.renderRoot)==null?void 0:l.querySelector(s),a=(o==null?void 0:o.assignedElements(i))??[];return n===void 0?a:a.filter(c=>c.matches(n))}})}}/**
367
+ * @license
368
+ * Copyright 2018 Google LLC
369
+ * SPDX-License-Identifier: BSD-3-Clause
370
+ */const De=i=>i??Ge;/**
371
+ * @license
372
+ * Copyright 2017 Google LLC
373
+ * SPDX-License-Identifier: BSD-3-Clause
374
+ */const Ei={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},un=i=>(...e)=>({_$litDirective$:i,values:e});let ws=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
375
+ * @license
376
+ * Copyright 2018 Google LLC
377
+ * SPDX-License-Identifier: BSD-3-Clause
378
+ */const Np="important",dw=" !"+Np,xr=un(class extends ws{constructor(i){var e;if(super(i),i.type!==Ei.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,t)=>{const r=i[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[e]){const{style:t}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const n=e[r];if(n!=null){this.ft.add(r);const s=typeof n=="string"&&n.endsWith(dw);r.includes("-")||s?t.setProperty(r,s?n.slice(0,-11):n,s?Np:""):t[r]=n}}return At}});class Ue extends ct{emit(e,t){const r=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(r)}}class bt{constructor(e,...t){this.slotNames=[],(this.host=e).addController(this),this.slotNames=t,this.onSlotChange=this.onSlotChange.bind(this)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.onSlotChange),to()||se(()=>{this.host.requestUpdate()})}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.onSlotChange)}test(e){return e==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(e)}hasDefaultSlot(){return[...this.host.childNodes].some(e=>e.nodeType===e.TEXT_NODE&&e.textContent.trim()!==""||e.nodeType===e.ELEMENT_NODE&&!e.hasAttribute("slot"))}hasNamedSlot(e){return this.host.querySelector(`:scope > [slot="${e}"]`)!==null}onSlotChange(e){const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()}}const He=X`${Ge}`,Me=Ie`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}:host :focus,:host :focus-visible,:host(:focus),:host(:focus-visible){outline:0}[hidden]{display:none!important}`;/**
379
+ * @license
380
+ * Copyright 2017 Google LLC
381
+ * SPDX-License-Identifier: BSD-3-Clause
382
+ */let ql=class extends ws{constructor(e){if(super(e),this.it=Ge,e.type!==Ei.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Ge||e==null)return this._t=void 0,this.it=e;if(e===At)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};ql.directiveName="unsafeHTML",ql.resultType=1;/**
383
+ * @license
384
+ * Copyright 2017 Google LLC
385
+ * SPDX-License-Identifier: BSD-3-Clause
386
+ */class Ul extends ql{}Ul.directiveName="unsafeSVG",Ul.resultType=2;const Lp=un(Ul);/**
387
+ * @license
388
+ * Copyright 2020 Google LLC
389
+ * SPDX-License-Identifier: BSD-3-Clause
390
+ */const uw=i=>i===null||typeof i!="object"&&typeof i!="function",Dp=i=>i.strings===void 0,hw={},fw=(i,e=hw)=>i._$AH=e;/**
391
+ * @license
392
+ * Copyright 2017 Google LLC
393
+ * SPDX-License-Identifier: BSD-3-Clause
394
+ */const Qn=(i,e)=>{var r;const t=i._$AN;if(t===void 0)return!1;for(const n of t)(r=n._$AO)==null||r.call(n,e,!1),Qn(n,e);return!0},ro=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while((t==null?void 0:t.size)===0)},Op=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),gw(e)}};function pw(i){this._$AN!==void 0?(ro(this),this._$AM=i,Op(this)):this._$AM=i}function mw(i,e=!1,t=0){const r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)Qn(r[s],!1),ro(r[s]);else r!=null&&(Qn(r,!1),ro(r));else Qn(this,i)}const gw=i=>{i.type==Ei.CHILD&&(i._$AP??(i._$AP=mw),i._$AQ??(i._$AQ=pw))};class Mp extends ws{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),Op(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,n;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(n=this.disconnected)==null||n.call(this)),t&&(Qn(this,e),ro(this))}setValue(e){if(Dp(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/**
395
+ * @license
396
+ * Copyright 2021 Google LLC
397
+ * SPDX-License-Identifier: BSD-3-Clause
398
+ */class yw{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class bw{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??(this.Y=new Promise(e=>this.Z=e))}resume(){var e;(e=this.Z)==null||e.call(this),this.Y=this.Z=void 0}}/**
399
+ * @license
400
+ * Copyright 2017 Google LLC
401
+ * SPDX-License-Identifier: BSD-3-Clause
402
+ */const Yh=i=>!uw(i)&&typeof i.then=="function",Zh=1073741823;class vw extends Mp{constructor(){super(...arguments),this._$Cwt=Zh,this._$Cbt=[],this._$CK=new yw(this),this._$CX=new bw}render(...e){return e.find(t=>!Yh(t))??At}update(e,t){const r=this._$Cbt;let n=r.length;this._$Cbt=t;const s=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let a=0;a<t.length&&!(a>this._$Cwt);a++){const l=t[a];if(!Yh(l))return this._$Cwt=a,l;a<n&&l===r[a]||(this._$Cwt=Zh,n=0,Promise.resolve(l).then(async c=>{for(;o.get();)await o.get();const d=s.deref();if(d!==void 0){const f=d._$Cbt.indexOf(l);f>-1&&f<d._$Cwt&&(d._$Cwt=f,d.setValue(c))}}))}return At}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}const ww=un(vw),_w=Ie`:host{display:inline-block;width:1em;height:1em;font-weight:400;font-family:'Material Icons';font-display:block;font-style:normal;line-height:1;direction:ltr;letter-spacing:normal;white-space:nowrap;text-transform:none;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;-moz-osx-font-smoothing:grayscale;font-size:1.5rem}::slotted(svg),svg{width:100%;height:100%;fill:currentcolor}`;let as=class extends Ue{constructor(){super(...arguments),this.hasSlotController=new bt(this,"[default]")}render(){const e=()=>{if(this.name){const[t,r]=this.name.split("--");return X`<span translate="no" style="${xr({fontFamily:new Map([["outlined","Material Icons Outlined"],["filled","Material Icons"],["rounded","Material Icons Round"],["sharp","Material Icons Sharp"],["two-tone","Material Icons Two Tone"]]).get(r)})}">${t}</span>`}return this.src?X`${ww(Ap({url:this.src}).then(Lp))}`:X``};return this.hasSlotController.test("[default]")?X`<slot></slot>`:e()}};as.styles=[Me,_w];w([D({reflect:!0})],as.prototype,"name",void 0);w([D({reflect:!0})],as.prototype,"src",void 0);as=w([Re("mdui-icon")],as);const xw=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;white-space:nowrap;vertical-align:middle;border-radius:var(--shape-corner);-webkit-user-select:none;user-select:none;width:2.5rem;height:2.5rem;background-color:rgb(var(--mdui-color-primary-container));color:rgb(var(--mdui-color-on-primary-container));font-size:var(--mdui-typescale-title-medium-size);font-weight:var(--mdui-typescale-title-medium-weight);letter-spacing:var(--mdui-typescale-title-medium-tracking);line-height:var(--mdui-typescale-title-medium-line-height)}img{width:100%;height:100%}::slotted(mdui-icon),mdui-icon{font-size:1.5em}`;let Tr=class extends Ue{constructor(){super(...arguments),this.hasSlotController=new bt(this,"[default]")}render(){return this.hasSlotController.test("[default]")?X`<slot></slot>`:this.src?X`<img part="image" alt="${De(this.label)}" src="${this.src}" style="${xr({objectFit:this.fit})}">`:this.icon?X`<mdui-icon part="icon" name="${this.icon}"></mdui-icon>`:He}};Tr.styles=[Me,xw];w([D({reflect:!0})],Tr.prototype,"src",void 0);w([D({reflect:!0})],Tr.prototype,"fit",void 0);w([D({reflect:!0})],Tr.prototype,"icon",void 0);w([D({reflect:!0})],Tr.prototype,"label",void 0);Tr=w([Re("mdui-avatar")],Tr);const Ew=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:var(--shape-corner);padding-left:.25rem;padding-right:.25rem;color:rgb(var(--mdui-color-on-error));background-color:rgb(var(--mdui-color-error));height:1rem;min-width:1rem;font-size:var(--mdui-typescale-label-small-size);font-weight:var(--mdui-typescale-label-small-weight);letter-spacing:var(--mdui-typescale-label-small-tracking);line-height:var(--mdui-typescale-label-small-line-height)}:host([variant=small]){min-width:0;padding:0;width:.375rem;height:.375rem}`;let no=class extends Ue{constructor(){super(...arguments),this.variant="large"}render(){return this.variant==="small"?He:X`<slot></slot>`}};no.styles=[Me,Ew];w([D({reflect:!0})],no.prototype,"variant",void 0);no=w([Re("mdui-badge")],no);const me=i=>i!==null&&i.toLowerCase()!=="false";class vt{constructor(e,t){this.defined=!1,(this.host=e).addController(this),this.relatedElements=t.relatedElements,this.needDomReady=t.needDomReady||!!t.relatedElements,this.onSlotChange=this.onSlotChange.bind(this)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.onSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.onSlotChange)}isDefined(){return this.defined?!0:(this.defined=(!this.needDomReady||to())&&!this.getUndefinedLocalNames().length,this.defined)}async whenDefined(){if(this.defined)return Promise.resolve();const e=zt();this.needDomReady&&!to(e)&&await new Promise(r=>{e.addEventListener("DOMContentLoaded",()=>r(),{once:!0})});const t=this.getUndefinedLocalNames();if(t.length){const r=[];t.forEach(n=>{r.push(customElements.whenDefined(n))}),await Promise.all(r)}this.defined=!0}getScopeLocalNameSelector(){const e=this.relatedElements;return e?Array.isArray(e)?e.map(t=>`${t}:not(:defined)`).join(","):Object.keys(e).filter(t=>!e[t]).map(t=>`${t}:not(:defined)`).join(","):null}getGlobalLocalNameSelector(){const e=this.relatedElements;return!e||Array.isArray(e)?null:Object.keys(e).filter(t=>e[t]).map(t=>`${t}:not(:defined)`).join(",")}getUndefinedLocalNames(){const e=this.getScopeLocalNameSelector(),t=this.getGlobalLocalNameSelector(),r=e?[...this.host.querySelectorAll(e)]:[],n=t?[...zt().querySelectorAll(t)]:[],s=[...r,...n].map(o=>o.localName);return bs(s)}onSlotChange(){const e=this.getScopeLocalNameSelector();e&&this.host.querySelectorAll(e).length&&(this.defined=!1)}}function Ee(i,e=!1){return(t,r)=>{const{update:n}=t;i in t&&(t.update=function(s){if(s.has(i)){const o=s.get(i),a=this[i];o!==a&&(!e||this.hasUpdated)&&this[r](o,a)}n.call(this,s)})}}const Os=new WeakMap,Qc=i=>{class e extends i{constructor(...r){super(...r),this.scrollBehaviorDefinedController=new vt(this,{needDomReady:!0}),this.lastScrollTopThreshold=0,this.lastScrollTopNoThreshold=0,this.isParentLayout=!1,this.onListeningScroll=this.onListeningScroll.bind(this)}get scrollPaddingPosition(){throw new Error("Must implement scrollPaddingPosition getter")}async onScrollTargetChange(r,n){const s=this.hasUpdated;if(await this.scrollBehaviorDefinedController.whenDefined(),s&&(this.setContainerPadding("remove",r),this.setContainerPadding("add",n)),!this.scrollBehavior)return;const o=this.getListening(r);o&&o.removeEventListener("scroll",this.onListeningScroll);const a=this.getListening(n);a&&(this.updateScrollTop(a),a.addEventListener("scroll",this.onListeningScroll))}async onScrollBehaviorChange(){await this.scrollBehaviorDefinedController.whenDefined();const r=this.getListening(this.scrollTarget);r&&(this.scrollBehavior?(this.updateScrollTop(r),r.addEventListener("scroll",this.onListeningScroll)):r.removeEventListener("scroll",this.onListeningScroll))}connectedCallback(){super.connectedCallback(),this.scrollBehaviorDefinedController.whenDefined().then(()=>{this.isParentLayout=ys(this.parentElement,"mdui-layout"),this.setContainerPadding("add",this.scrollTarget)})}disconnectedCallback(){super.disconnectedCallback(),this.scrollBehaviorDefinedController.whenDefined().then(()=>{this.setContainerPadding("remove",this.scrollTarget)})}hasScrollBehavior(r){var s;const n=((s=this.scrollBehavior)==null?void 0:s.split(" "))??[];return Array.isArray(r)?!!n.filter(o=>r.includes(o)).length:n.includes(r)}runScrollThreshold(r,n){}runScrollNoThreshold(r,n){}setContainerPadding(r,n){const s=this.getContainer(n);if(!s||this.isParentLayout)return;const o=this.scrollPaddingPosition,a=o==="top"?"paddingTop":"paddingBottom";if(r==="add"||r==="update"){const l=["fixed","absolute"].includes(se(this).css("position"))?this.offsetHeight:null;if(se(s).css({[a]:l}),r==="add"&&l!==null){const c=Os.get(s)??{top:[],bottom:[]};c[o].push(this),Os.set(s,c)}}if(r==="remove"){const l=Os.get(s);if(!l)return;const c=l[o].indexOf(this);c>-1&&(l[o].splice(c,1),Os.set(s,l)),l[o].length||se(s).css({[a]:null})}}onListeningScroll(){const r=this.getListening(this.scrollTarget);window.requestAnimationFrame(()=>this.onScroll(r))}onScroll(r){const n=r.scrollY??r.scrollTop;this.lastScrollTopNoThreshold!==n&&(this.runScrollNoThreshold(n<this.lastScrollTopNoThreshold,n),this.lastScrollTopNoThreshold=n),Math.abs(n-this.lastScrollTopThreshold)>(this.scrollThreshold||0)&&(this.runScrollThreshold(n<this.lastScrollTopThreshold,n),this.lastScrollTopThreshold=n)}updateScrollTop(r){this.lastScrollTopThreshold=this.lastScrollTopNoThreshold=r.scrollY??r.scrollTop}getListening(r){return r?se(r)[0]:window}getContainer(r){return r?se(r)[0]:document.body}}return w([D({attribute:"scroll-target"})],e.prototype,"scrollTarget",void 0),w([D({reflect:!0,attribute:"scroll-behavior"})],e.prototype,"scrollBehavior",void 0),w([D({type:Number,reflect:!0,attribute:"scroll-threshold"})],e.prototype,"scrollThreshold",void 0),w([Ee("scrollTarget")],e.prototype,"onScrollTargetChange",null),w([Ee("scrollBehavior")],e.prototype,"onScrollBehaviorChange",null),e};let Sw=0;const lr=()=>++Sw;let Xi,wl;const cr=(i,e)=>{const t=se(i),r=lr(),n={unobserve:()=>{t.each((s,o)=>{const a=Xi.get(o),l=a.coArr.findIndex(c=>c.key===r);l!==-1&&a.coArr.splice(l,1),a.coArr.length?Xi.set(o,a):(wl.unobserve(o),Xi.delete(o))})}};return Xi||(Xi=new WeakMap,wl=new ResizeObserver(s=>{s.forEach(o=>{const a=o.target,l=Xi.get(a);l.entry=o,l.coArr.forEach(c=>{c.callback.call(n,o,n)})})})),t.each((s,o)=>{const a=Xi.get(o)??{coArr:[]};a.coArr.length&&a.entry&&e.call(n,a.entry,n),a.coArr.push({callback:e,key:r}),Xi.set(o,a),wl.observe(o)}),n};class kw{constructor(){this.states=[]}registerMain(e){this.$main=se(e)}unregisterMain(){this.$main=void 0}registerItem(e){const t={element:e};this.states.push(t),t.observeResize=cr(t.element,()=>{this.updateLayout(t.element,{width:this.isNoWidth(t)?0:void 0})}),this.items=void 0,this.resort(),this.updateLayout()}unregisterItem(e){var n;const t=this.states.findIndex(s=>s.element===e);if(t<0)return;(n=this.states[t].observeResize)==null||n.unobserve(),this.items=void 0,this.states.splice(t,1),this.states[t]&&this.updateLayout(this.states[t].element)}getItems(){if(!this.items){const e=this.states.map(t=>t.element);this.items=e.sort((t,r)=>{const n=t.compareDocumentPosition(r);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0})}return this.items}getMain(){return this.$main?this.$main[0]:void 0}getItemsAndMain(){return[...this.getItems(),this.getMain()].filter(e=>e)}updateOrder(){this.resort(),this.updateLayout()}updateLayout(e,t){const r=e?{element:e,width:t==null?void 0:t.width,height:t==null?void 0:t.height}:void 0,n=r?this.states.findIndex(o=>o.element===r.element):0;if(n<0)return;Object.assign(this.states[n],r),this.states.forEach((o,a)=>{if(a<n)return;const l=o.element.layoutPlacement,c=a>0?this.states[a-1]:void 0,d=(c==null?void 0:c.top)??0,f=(c==null?void 0:c.right)??0,g=(c==null?void 0:c.bottom)??0,y=(c==null?void 0:c.left)??0;switch(Object.assign(o,{top:d,right:f,bottom:g,left:y}),l){case"top":case"bottom":o[l]+=o.height??o.element.offsetHeight;break;case"right":case"left":o[l]+=(this.isNoWidth(o)?0:o.width)??o.element.offsetWidth;break}o.height=o.width=void 0,se(o.element).css({position:"absolute",top:l==="bottom"?null:d,right:l==="left"?null:f,bottom:l==="top"?null:g,left:l==="right"?null:y})});const s=this.states[this.states.length-1];this.$main&&this.$main.css({paddingTop:s.top,paddingRight:s.right,paddingBottom:s.bottom,paddingLeft:s.left})}resort(){const e=this.getItems();this.states.sort((t,r)=>{const n=t.element.order??0,s=r.element.order??0;return n>s?1:n<s?-1:e.indexOf(t.element)>e.indexOf(r.element)?1:e.indexOf(t.element)<e.indexOf(r.element)?-1:0})}isNoWidth(e){return ys(e.element,"mdui-navigation-drawer")&&e.element.isModal}}const _l=new WeakMap,Pp=i=>(_l.has(i)||_l.set(i,new kw),_l.get(i));class dr extends Ue{constructor(){super(...arguments),this.isParentLayout=!1}get layoutPlacement(){throw new Error("Must implement placement getter!")}onOrderChange(){var e;(e=this.layoutManager)==null||e.updateOrder()}connectedCallback(){super.connectedCallback();const e=this.parentElement;this.isParentLayout=ys(e,"mdui-layout"),this.isParentLayout&&(this.layoutManager=Pp(e),this.layoutManager.registerItem(this))}disconnectedCallback(){super.disconnectedCallback(),this.layoutManager&&this.layoutManager.unregisterItem(this)}}w([D({type:Number,reflect:!0})],dr.prototype,"order",void 0);w([Ee("order",!0)],dr.prototype,"onOrderChange",null);const Iw=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;right:0;bottom:0;left:0;display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition:bottom var(--mdui-motion-duration-long2) var(--mdui-motion-easing-emphasized);padding:0 1rem;height:5rem;background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2)}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([hide]:not([hide=false i])){transition-duration:var(--mdui-motion-duration-short4);bottom:-5.625rem}::slotted(:not(:first-child)){margin-left:.5rem}::slotted(mdui-fab){box-shadow:var(--mdui-elevation-level0)}:host([fab-detach]:not([fab-detach=false i])) ::slotted(mdui-fab){position:absolute;transition:bottom var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard);right:1rem;bottom:.75rem}:host([fab-detach][hide][scroll-behavior~=hide]:not([hide=false i],[fab-detach=false i])) ::slotted(mdui-fab){transition-duration:var(--mdui-motion-duration-short4);bottom:1rem;box-shadow:var(--mdui-elevation-level2)}:host([fab-detach][hide][scroll-behavior~=hide][scroll-target]:not([fab-detach=false i],[hide=false i],[scroll-target=''])) ::slotted(mdui-fab){bottom:6.625rem}:host([hide]:not([hide=false i])) ::slotted(:not(mdui-fab)),:host([hide]:not([hide=false i],[fab-detach])) ::slotted(mdui-fab),:host([hide][fab-detach=false i]:not([hide=false i])) ::slotted(mdui-fab){transform:translateY(8.75rem);transition:transform var(--mdui-motion-duration-0) var(--mdui-motion-easing-emphasized-accelerate) var(--mdui-motion-duration-short4)}::slotted(:first-child){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short1)}::slotted(:nth-child(2)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short3)}::slotted(:nth-child(3)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short4)}::slotted(:nth-child(4)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium1)}::slotted(:nth-child(5)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium2)}::slotted(:nth-child(6)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium3)}`;let Yr=class extends Qc(dr){constructor(){super(...arguments),this.hide=!1,this.fabDetach=!1}get scrollPaddingPosition(){return"bottom"}get layoutPlacement(){return"bottom"}firstUpdated(e){super.firstUpdated(e),this.addEventListener("transitionend",t=>{t.target===this&&this.emit(this.hide?"hidden":"shown")})}render(){return X`<slot></slot>`}runScrollThreshold(e){!e&&!this.hide&&this.emit("hide",{cancelable:!0})&&(this.hide=!0),e&&this.hide&&this.emit("show",{cancelable:!0})&&(this.hide=!1)}};Yr.styles=[Me,Iw];w([D({type:Boolean,reflect:!0,converter:me})],Yr.prototype,"hide",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"fab-detach"})],Yr.prototype,"fabDetach",void 0);w([D({reflect:!0,attribute:"scroll-behavior"})],Yr.prototype,"scrollBehavior",void 0);Yr=w([Re("mdui-bottom-app-bar")],Yr);/**
403
+ * @license
404
+ * Copyright 2020 Google LLC
405
+ * SPDX-License-Identifier: BSD-3-Clause
406
+ */const Ne=()=>new Rw;class Rw{}const xl=new WeakMap,$e=un(class extends Mp{render(i){return Ge}update(i,[e]){var r;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=i.options)==null?void 0:r.host,this.rt(this.ct=i.element)),Ge}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=xl.get(e);t===void 0&&(t=new WeakMap,xl.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,i),i!==void 0&&this.G.call(this.ht,i)}else this.G.value=i}get lt(){var i,e;return typeof this.G=="function"?(i=xl.get(this.ht??globalThis))==null?void 0:i.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Ri(i){if(typeof i=="string"||typeof i=="number")return""+i;let e="";if(Array.isArray(i))for(let t=0,r;t<i.length;t++)(r=Ri(i[t]))!==""&&(e+=(e&&" ")+r);else for(let t in i)i[t]&&(e+=(e&&" ")+t);return e}const Mn=new WeakMap,ft=new WeakMap;class Ki{constructor(e,t){(this.host=e).addController(this),this.definedController=new vt(e,{needDomReady:!0}),this.options={form:r=>{const n=se(r).attr("form");return n?r.getRootNode().getElementById(n):r.closest("form")},name:r=>r.name,value:r=>r.value,defaultValue:r=>r.defaultValue,setValue:(r,n)=>r.value=n,disabled:r=>r.disabled,reportValidity:r=>dt(r.reportValidity)?r.reportValidity():!0,...t},this.onFormData=this.onFormData.bind(this),this.onFormSubmit=this.onFormSubmit.bind(this),this.onFormReset=this.onFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this)}hostConnected(){this.definedController.whenDefined().then(()=>{this.form=this.options.form(this.host),this.form&&this.attachForm(this.form)})}hostDisconnected(){this.detachForm()}hostUpdated(){this.definedController.whenDefined().then(()=>{const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e))})}getForm(){return this.form??null}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}attachForm(e){if(!e){this.form=void 0;return}this.form=e,Br.has(this.form)?Br.get(this.form).add(this.host):Br.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.onFormData),this.form.addEventListener("submit",this.onFormSubmit),this.form.addEventListener("reset",this.onFormReset),Mn.has(this.form)||(Mn.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())}detachForm(){this.form&&(Br.get(this.form).delete(this.host),this.form.removeEventListener("formdata",this.onFormData),this.form.removeEventListener("submit",this.onFormSubmit),this.form.removeEventListener("reset",this.onFormReset),Mn.has(this.form)&&!Br.get(this.form).size&&(this.form.reportValidity=Mn.get(this.form),Mn.delete(this.form)))}doAction(e,t){if(!this.form)return;const r=se(`<button type="${e}">`).css({position:"absolute",width:0,height:0,clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap"}),n=r[0];t&&(n.name=t.name,n.value=t.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(s=>{r.attr(s,se(t).attr(s))})),this.form.append(n),n.click(),n.remove()}onFormData(e){const t=this.options.disabled(this.host),r=this.options.name(this.host),n=this.options.value(this.host),s=["mdui-button","mdui-button-icon","mdui-chip","mdui-fab","mdui-segmented-button"].includes(this.host.tagName.toLowerCase());!t&&!s&&ut(r)&&r&&!at(n)&&(Array.isArray(n)?n.forEach(o=>{e.formData.append(r,o.toString())}):e.formData.append(r,n.toString()))}onFormSubmit(e){const t=this.options.disabled(this.host),r=this.options.reportValidity;this.form&&!this.form.noValidate&&!t&&!r(this.host)&&(e.preventDefault(),e.stopImmediatePropagation())}onFormReset(){this.form&&(this.options.setValue(this.host,this.options.defaultValue(this.host)),this.host.invalid=!1,ft.has(this.form)?ft.get(this.form).add(this.host):ft.set(this.form,new Set([this.host])))}reportFormValidity(){if(this.form&&!this.form.noValidate){const e=$p(this.form);for(const t of e)if(dt(t.reportValidity)&&!t.reportValidity())return!1}return!0}}const hn=i=>{class e extends i{renderAnchor({id:r,className:n,part:s,content:o=X`<slot></slot>`,refDirective:a,tabIndex:l}){return X`<a ${a} id="${De(r)}" class="_a ${n||""}" part="${De(s)}" href="${De(this.href)}" download="${De(this.download)}" target="${De(this.target)}" rel="${De(this.rel)}" tabindex="${De(l)}">${o}</a>`}}return w([D({reflect:!0})],e.prototype,"href",void 0),w([D({reflect:!0})],e.prototype,"download",void 0),w([D({reflect:!0})],e.prototype,"target",void 0),w([D({reflect:!0})],e.prototype,"rel",void 0),e};let Yc=!0;const jp=zt();jp.addEventListener("pointerdown",()=>{Yc=!0});jp.addEventListener("keydown",()=>{Yc=!1});const ni=i=>{class e extends i{constructor(){super(...arguments),this.autofocus=!1,this.focused=!1,this.focusVisible=!1,this.focusableDefinedController=new vt(this,{relatedElements:[""]}),this._manipulatingTabindex=!1,this._tabIndex=0}get tabIndex(){const r=se(this);if(this.focusElement===this)return Number(r.attr("tabindex")||-1);const n=Number(r.attr("tabindex")||0);return this.focusDisabled||n<0?-1:this.focusElement?this.focusElement.tabIndex:n}set tabIndex(r){if(this._manipulatingTabindex){this._manipulatingTabindex=!1;return}const n=se(this);if(this.focusElement===this){r!==null&&(this._tabIndex=r),n.attr("tabindex",this.focusDisabled?null:r);return}const s=()=>{this.tabIndex===-1&&(this.tabIndex=0,this.focus({preventScroll:!0}))};if(r===-1?this.addEventListener("pointerdown",s):(this._manipulatingTabindex=!0,this.removeEventListener("pointerdown",s)),r===-1||this.focusDisabled){n.attr("tabindex",-1),r!==-1&&this.manageFocusElementTabindex(r);return}this.hasAttribute("tabindex")||(this._manipulatingTabindex=!1),this.manageFocusElementTabindex(r)}get focusDisabled(){throw new Error("Must implement focusDisabled getter!")}get focusElement(){throw new Error("Must implement focusElement getter!")}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.manageAutoFocus()})})}click(){this.focusDisabled||(this.focusElement!==this?this.focusElement.click():HTMLElement.prototype.click.apply(this))}focus(r){this.focusDisabled||!this.focusElement||(this.focusElement!==this?this.focusElement.focus(r):HTMLElement.prototype.focus.apply(this,[r]))}blur(){this.focusElement!==this?this.focusElement.blur():HTMLElement.prototype.blur.apply(this)}firstUpdated(r){super.firstUpdated(r),this.focusElement.addEventListener("focus",()=>{this.focused=!0,this.focusVisible=!Yc}),this.focusElement.addEventListener("blur",()=>{this.focused=!1,this.focusVisible=!1})}update(r){if(this._lastFocusDisabled===void 0||this._lastFocusDisabled!==this.focusDisabled){this._lastFocusDisabled=this.focusDisabled;const n=se(this);this.focusDisabled?n.removeAttr("tabindex"):this.focusElement===this?(this._manipulatingTabindex=!0,n.attr("tabindex",this._tabIndex)):this.tabIndex>-1&&n.removeAttr("tabindex")}super.update(r)}updated(r){super.updated(r),this.focused&&this.focusDisabled&&this.blur()}async manageFocusElementTabindex(r){this.focusElement||await this.updateComplete,r===null?this.focusElement.removeAttribute("tabindex"):this.focusElement.tabIndex=r}manageAutoFocus(){this.autofocus&&(this.dispatchEvent(new KeyboardEvent("keydown",{code:"Tab"})),this.focusElement.focus())}}return w([D({type:Boolean,reflect:!0,converter:me})],e.prototype,"autofocus",void 0),w([D({type:Boolean,reflect:!0,converter:me})],e.prototype,"focused",void 0),w([D({type:Boolean,reflect:!0,converter:me,attribute:"focus-visible"})],e.prototype,"focusVisible",void 0),w([D({type:Number,attribute:"tabindex"})],e.prototype,"tabIndex",null),e};/**
407
+ * @license
408
+ * Copyright 2018 Google LLC
409
+ * SPDX-License-Identifier: BSD-3-Clause
410
+ */const lt=un(class extends ws{constructor(i){var e;if(super(i),i.type!==Ei.ATTRIBUTE||i.name!=="class"||((e=i.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(e=>i[e]).join(" ")+" "}update(i,[e]){var r,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((r=this.nt)!=null&&r.has(s))&&this.st.add(s);return this.render(e)}const t=i.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(n=this.nt)!=null&&n.has(s)||(o?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return At}}),Tw=Ie`:host{position:relative;display:inline-block;flex-shrink:0;width:2.5rem;height:2.5rem;stroke:rgb(var(--mdui-color-primary))}.progress{position:relative;display:inline-block;width:100%;height:100%;text-align:left;transition:opacity var(--mdui-motion-duration-medium1) var(--mdui-motion-easing-linear)}.determinate svg{transform:rotate(-90deg);fill:transparent}.determinate .track{stroke:transparent}.determinate .circle{stroke:inherit;transition:stroke-dashoffset var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}.indeterminate{font-size:0;letter-spacing:0;white-space:nowrap;animation:mdui-comp-circular-progress-rotate 1568ms var(--mdui-motion-easing-linear) infinite}.indeterminate .circle,.indeterminate .layer{position:absolute;width:100%;height:100%}.indeterminate .layer{animation:mdui-comp-circular-progress-layer-rotate 5332ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .circle{fill:transparent;stroke:inherit}.indeterminate .gap-patch{position:absolute;top:0;left:47.5%;width:5%;height:100%;overflow:hidden}.indeterminate .gap-patch .circle{left:-900%;width:2000%;transform:rotate(180deg)}.indeterminate .clipper{position:relative;display:inline-block;width:50%;height:100%;overflow:hidden}.indeterminate .clipper .circle{width:200%}.indeterminate .clipper.left .circle{animation:mdui-comp-circular-progress-left-spin 1333ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .clipper.right .circle{left:-100%;animation:mdui-comp-circular-progress-right-spin 1333ms var(--mdui-motion-easing-standard) infinite both}@keyframes mdui-comp-circular-progress-rotate{to{transform:rotate(360deg)}}@keyframes mdui-comp-circular-progress-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdui-comp-circular-progress-left-spin{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes mdui-comp-circular-progress-right-spin{0%{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}100%{transform:rotate(-265deg)}}`;let ls=class extends Ue{constructor(){super(...arguments),this.max=1}render(){const e=!at(this.value);return X`<div class="progress ${lt({determinate:e,indeterminate:!e})}">${e?this.renderDeterminate():this.renderInDeterminate()}</div>`}renderDeterminate(){const e=this.value,t=4,r=18,n=3.1415926,s=r+t/2,o=2*n*r,a=(1-e/Math.max(this.max??e,e))*o;return X`<svg viewBox="0 0 ${s*2} ${s*2}"><circle class="track" cx="${s}" cy="${s}" r="${r}" stroke-width="${t}"></circle><circle class="circle" cx="${s}" cy="${s}" r="${r}" stroke-dasharray="${2*n*r}" stroke-dashoffset="${a}" stroke-width="${t}"></circle></svg>`}renderInDeterminate(){const r=3.1415926,n=18+4/2,s=2*r*18,o=.5*s,a=l=>X`<svg class="circle" viewBox="0 0 ${n*2} ${n*2}"><circle cx="${n}" cy="${n}" r="${18}" stroke-dasharray="${s}" stroke-dashoffset="${o}" stroke-width="${l}"></circle></svg>`;return X`<div class="layer"><div class="clipper left">${a(4)}</div><div class="gap-patch">${a(4*.8)}</div><div class="clipper right">${a(4)}</div></div>`}};ls.styles=[Me,Tw];w([D({type:Number,reflect:!0})],ls.prototype,"max",void 0);w([D({type:Number})],ls.prototype,"value",void 0);ls=w([Re("mdui-circular-progress")],ls);const $w=Ie`:host{position:absolute;top:0;left:0;display:block;width:100%;height:100%;overflow:hidden;pointer-events:none}.surface{position:absolute;top:0;left:0;width:100%;height:100%;transition-duration:280ms;transition-property:background-color;pointer-events:none;transition-timing-function:var(--mdui-motion-easing-standard)}.hover{background-color:rgba(var(--mdui-comp-ripple-state-layer-color,var(--mdui-color-on-surface)),var(--mdui-state-layer-hover))}:host-context([focus-visible]) .focused{background-color:rgba(var(--mdui-comp-ripple-state-layer-color,var(--mdui-color-on-surface)),var(--mdui-state-layer-focus))}.dragged{background-color:rgba(var(--mdui-comp-ripple-state-layer-color,var(--mdui-color-on-surface)),var(--mdui-state-layer-dragged))}.wave{position:absolute;z-index:1;background-color:rgb(var(--mdui-comp-ripple-state-layer-color,var(--mdui-color-on-surface)));border-radius:50%;transform:translate3d(0,0,0) scale(.4);opacity:0;animation:225ms ease 0s 1 normal forwards running mdui-comp-ripple-radius-in,75ms ease 0s 1 normal forwards running mdui-comp-ripple-opacity-in;pointer-events:none}.out{transform:translate3d(var(--mdui-comp-ripple-transition-x,0),var(--mdui-comp-ripple-transition-y,0),0) scale(1);animation:150ms ease 0s 1 normal none running mdui-comp-ripple-opacity-out}@keyframes mdui-comp-ripple-radius-in{from{transform:translate3d(0,0,0) scale(.4);animation-timing-function:var(--mdui-motion-easing-standard)}to{transform:translate3d(var(--mdui-comp-ripple-transition-x,0),var(--mdui-comp-ripple-transition-y,0),0) scale(1)}}@keyframes mdui-comp-ripple-opacity-in{from{opacity:0;animation-timing-function:linear}to{opacity:var(--mdui-state-layer-pressed)}}@keyframes mdui-comp-ripple-opacity-out{from{animation-timing-function:linear;opacity:var(--mdui-state-layer-pressed)}to{opacity:0}}`;let $r=class extends Ue{constructor(){super(...arguments),this.noRipple=!1,this.hover=!1,this.focused=!1,this.dragged=!1,this.surfaceRef=Ne()}startPress(e){if(this.noRipple)return;const t=se(this.surfaceRef.value),r=t.innerHeight(),n=t.innerWidth();let s,o;if(!e)s=n/2,o=r/2;else{const f=typeof TouchEvent<"u"&&e instanceof TouchEvent&&e.touches.length?e.touches[0]:e,g=t.offset();if(f.pageX<g.left||f.pageX>g.left+n||f.pageY<g.top||f.pageY>g.top+r)return;s=f.pageX-g.left,o=f.pageY-g.top}const a=Math.max(Math.pow(Math.pow(r,2)+Math.pow(n,2),.5),48),l=`${-s+n/2}px`,c=`${-o+r/2}px`,d=`translate3d(${l}, ${c}, 0) scale(1)`;se('<div class="wave"></div>').css({width:a,height:a,marginTop:-a/2,marginLeft:-a/2,left:s,top:o}).each((f,g)=>{g.style.setProperty("--mdui-comp-ripple-transition-x",l),g.style.setProperty("--mdui-comp-ripple-transition-y",c)}).prependTo(this.surfaceRef.value).each((f,g)=>g.clientLeft).css("transform",d).on("animationend",function(f){f.animationName==="mdui-comp-ripple-radius-in"&&se(this).data("filled",!0)})}endPress(){const e=se(this.surfaceRef.value).children().filter((r,n)=>!se(n).data("removing")).data("removing",!0),t=r=>{r.addClass("out").each((n,s)=>s.clientLeft).on("animationend",function(){se(this).remove()})};e.filter((r,n)=>!se(n).data("filled")).on("animationend",function(r){r.animationName==="mdui-comp-ripple-radius-in"&&t(se(this))}),t(e.filter((r,n)=>!!se(n).data("filled")))}startHover(){this.hover=!0}endHover(){this.hover=!1}startFocus(){this.focused=!0}endFocus(){this.focused=!1}startDrag(){this.dragged=!0}endDrag(){this.dragged=!1}render(){return X`<div ${$e(this.surfaceRef)} class="surface ${lt({hover:this.hover,focused:this.focused,dragged:this.dragged})}"></div>`}};$r.styles=[Me,$w];w([D({type:Boolean,reflect:!0,converter:me,attribute:"no-ripple"})],$r.prototype,"noRipple",void 0);w([Oe()],$r.prototype,"hover",void 0);w([Oe()],$r.prototype,"focused",void 0);w([Oe()],$r.prototype,"dragged",void 0);$r=w([Re("mdui-ripple")],$r);const vi=i=>{class e extends i{constructor(){super(...arguments),this.noRipple=!1,this.rippleIndex=void 0,this.getRippleIndex=()=>this.rippleIndex}get rippleElement(){throw new Error("Must implement rippleElement getter!")}get rippleDisabled(){throw new Error("Must implement rippleDisabled getter!")}get rippleTarget(){return this}firstUpdated(r){super.firstUpdated(r);const n=se(this.rippleTarget),s=a=>{Ur(this.rippleTarget)&&(this.rippleIndex=n.index(a.target))};(Ur(this.rippleTarget)?this.rippleTarget:[this.rippleTarget]).forEach(a=>{a.addEventListener("pointerdown",l=>{s(l),this.startPress(l)}),a.addEventListener("pointerenter",l=>{s(l),this.startHover(l)}),a.addEventListener("pointerleave",l=>{s(l),this.endHover(l)}),a.addEventListener("focus",l=>{s(l),this.startFocus()}),a.addEventListener("blur",l=>{s(l),this.endFocus()})})}startHover(r){r.pointerType!=="mouse"||this.isRippleDisabled()||(this.getRippleTarget().setAttribute("hover",""),this.getRippleElement().startHover())}endHover(r){r.pointerType!=="mouse"||this.isRippleDisabled()||(this.getRippleTarget().removeAttribute("hover"),this.getRippleElement().endHover())}isRippleDisabled(){const r=this.rippleDisabled;if(!Array.isArray(r))return r;const n=this.getRippleIndex();return n!==void 0?r[n]:r.length?r[0]:!1}getRippleElement(){const r=this.rippleElement;if(!Ur(r))return r;const n=this.getRippleIndex();return n!==void 0?r[n]:r[0]}getRippleTarget(){const r=this.rippleTarget;if(!Ur(r))return r;const n=this.getRippleIndex();return n!==void 0?r[n]:r[0]}startFocus(){this.isRippleDisabled()||this.getRippleElement().startFocus()}endFocus(){this.isRippleDisabled()||this.getRippleElement().endFocus()}startPress(r){if(this.isRippleDisabled()||r.button)return;const n=this.getRippleTarget();if(n.setAttribute("pressed",""),["touch","pen"].includes(r.pointerType)){let s=!1,o=setTimeout(()=>{o=0,this.getRippleElement().startPress(r)},70);const a=()=>{o&&(clearTimeout(o),o=0,this.getRippleElement().startPress(r)),s||(s=!0,this.endPress()),n.removeEventListener("pointerup",a),n.removeEventListener("pointercancel",a)},l=()=>{o&&(clearTimeout(o),o=0),n.removeEventListener("touchmove",l)};n.addEventListener("touchmove",l),n.addEventListener("pointerup",a),n.addEventListener("pointercancel",a)}if(r.pointerType==="mouse"&&r.button===0){const s=()=>{this.endPress(),n.removeEventListener("pointerup",s),n.removeEventListener("pointercancel",s),n.removeEventListener("pointerleave",s)};this.getRippleElement().startPress(r),n.addEventListener("pointerup",s),n.addEventListener("pointercancel",s),n.addEventListener("pointerleave",s)}}endPress(){this.isRippleDisabled()||(this.getRippleTarget().removeAttribute("pressed"),this.getRippleElement().endPress())}startDrag(){this.isRippleDisabled()||this.getRippleElement().startDrag()}endDrag(){this.isRippleDisabled()||this.getRippleElement().endDrag()}}return w([D({type:Boolean,reflect:!0,converter:me,attribute:"no-ripple"})],e.prototype,"noRipple",void 0),e},Cw=Ie`.button{position:relative;display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0;overflow:hidden;color:inherit;font-size:inherit;font-family:inherit;font-weight:inherit;letter-spacing:inherit;white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background:0 0;border:none;outline:0;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}`;class ot extends hn(vi(ni(Ue))){constructor(){super(...arguments),this.disabled=!1,this.loading=!1,this.name="",this.value="",this.type="button",this.formNoValidate=!1,this.formController=new Ki(this)}get validity(){if(this.isButton())return this.focusElement.validity}get validationMessage(){if(this.isButton())return this.focusElement.validationMessage}get rippleDisabled(){return this.disabled||this.loading}get focusElement(){var e,t;return this.isButton()?(e=this.renderRoot)==null?void 0:e.querySelector("._button"):this.focusDisabled?this:(t=this.renderRoot)==null?void 0:t.querySelector("._a")}get focusDisabled(){return this.disabled||this.loading}checkValidity(){if(this.isButton()){const e=this.focusElement.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}return!0}reportValidity(){if(this.isButton()){const e=!this.focusElement.reportValidity();return e&&this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),!e}return!0}setCustomValidity(e){this.isButton()&&this.focusElement.setCustomValidity(e)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",()=>{this.type==="submit"&&this.formController.submit(this),this.type==="reset"&&this.formController.reset(this)})}renderLoading(){return this.loading?X`<mdui-circular-progress part="loading"></mdui-circular-progress>`:He}renderButton({id:e,className:t,part:r,content:n=X`<slot></slot>`}){return X`<button id="${De(e)}" class="${Ri(["_button",t])}" part="${De(r)}" ?disabled="${this.rippleDisabled||this.focusDisabled}">${n}</button>`}isButton(){return!this.href}}ot.styles=[Me,Cw];w([D({type:Boolean,reflect:!0,converter:me})],ot.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ot.prototype,"loading",void 0);w([D({reflect:!0})],ot.prototype,"name",void 0);w([D({reflect:!0})],ot.prototype,"value",void 0);w([D({reflect:!0})],ot.prototype,"type",void 0);w([D({reflect:!0})],ot.prototype,"form",void 0);w([D({reflect:!0,attribute:"formaction"})],ot.prototype,"formAction",void 0);w([D({reflect:!0,attribute:"formenctype"})],ot.prototype,"formEnctype",void 0);w([D({reflect:!0,attribute:"formmethod"})],ot.prototype,"formMethod",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"formnovalidate"})],ot.prototype,"formNoValidate",void 0);w([D({reflect:!0,attribute:"formtarget"})],ot.prototype,"formTarget",void 0);const Aw=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);min-width:3rem;height:2.5rem;color:rgb(var(--mdui-color-primary));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{width:100%;padding:0 1rem}:host([full-width]:not([full-width=false i])){display:block}:host([variant=elevated]){box-shadow:var(--mdui-elevation-level1);background-color:rgb(var(--mdui-color-surface-container-low));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
411
+ --mdui-color-on-secondary-container
412
+ )}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=text]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=outlined][focus-visible]){border-color:rgb(var(--mdui-color-primary))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=tonal][hover]){box-shadow:var(--mdui-elevation-level1)}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([variant=elevated][disabled]:not([disabled=false i])),:host([variant=filled][disabled]:not([disabled=false i])),:host([variant=tonal][disabled]:not([disabled=false i])){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([variant=outlined][disabled]:not([disabled=false i])){border-color:rgba(var(--mdui-color-on-surface),12%)}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon{display:inline-flex;font-size:1.28571429em}.end-icon mdui-icon,.icon mdui-icon,::slotted([slot=end-icon]),::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([variant=filled]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([variant=tonal]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;let Ui=class extends ot{constructor(){super(...arguments),this.variant="filled",this.fullWidth=!1,this.rippleRef=Ne()}get rippleElement(){return this.rippleRef.value}render(){return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:"button",part:"button",content:this.renderInner()}):this.disabled||this.loading?X`<span part="button" class="button _a">${this.renderInner()}</span>`:this.renderAnchor({className:"button",part:"button",content:this.renderInner()})}`}renderIcon(){return this.loading?this.renderLoading():X`<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderLabel(){return X`<slot part="label" class="label"></slot>`}renderEndIcon(){return X`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};Ui.styles=[ot.styles,Aw];w([D({reflect:!0})],Ui.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-width"})],Ui.prototype,"fullWidth",void 0);w([D({reflect:!0})],Ui.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],Ui.prototype,"endIcon",void 0);Ui=w([Re("mdui-button")],Ui);const Nw=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;font-size:1.5rem;width:2.5rem;height:2.5rem}:host([variant=standard]){color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=filled]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-surface-variant));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined][pressed]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([variant=standard][selected]:not([selected=false i])){color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]:not([selectable])),:host([variant=filled][selectable=false i]),:host([variant=filled][selected]:not([selected=false i])){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]:not([selectable])),:host([variant=tonal][selectable=false i]),:host([variant=tonal][selected]:not([selected=false i])){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
413
+ --mdui-color-on-secondary-container
414
+ )}:host([variant=outlined][selected]:not([selected=false i])){border:none;color:rgb(var(--mdui-color-inverse-on-surface));background-color:rgb(var(--mdui-color-inverse-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}:host([variant=filled][disabled]:not([disabled=false i])),:host([variant=outlined][disabled]:not([disabled=false i])),:host([variant=tonal][disabled]:not([disabled=false i])){background-color:rgba(var(--mdui-color-on-surface),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),.38)!important}.button{float:left;width:100%}:host([loading]:not([loading=false i])) .button,:host([loading]:not([loading=false i])) mdui-ripple{opacity:0}.icon,.selected-icon mdui-icon,::slotted(*){font-size:inherit}mdui-circular-progress{display:flex;position:absolute;top:calc(50% - 1.5rem / 2);left:calc(50% - 1.5rem / 2);width:1.5rem;height:1.5rem}:host([variant=filled]:not([disabled])) mdui-circular-progress,:host([variant=filled][disabled=false i]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;let Vi=class extends ot{constructor(){super(...arguments),this.variant="standard",this.selectable=!1,this.selected=!1,this.rippleRef=Ne(),this.hasSlotController=new bt(this,"[default]","selected-icon")}get rippleElement(){return this.rippleRef.value}onSelectedChange(){this.emit("change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",()=>{!this.selectable||this.disabled||(this.selected=!this.selected)})}render(){return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:"button",part:"button",content:this.renderIcon()}):this.disabled||this.loading?X`<span part="button" class="button _a">${this.renderIcon()}</span>`:this.renderAnchor({className:"button",part:"button",content:this.renderIcon()})} ${this.renderLoading()}`}renderIcon(){const e=()=>this.hasSlotController.test("[default]")?X`<slot></slot>`:this.icon?X`<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`:He,t=()=>this.hasSlotController.test("selected-icon")||this.selectedIcon?X`<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${this.selectedIcon}"></mdui-icon></slot>`:e();return this.selected?t():e()}};Vi.styles=[ot.styles,Nw];w([D({reflect:!0})],Vi.prototype,"variant",void 0);w([D({reflect:!0})],Vi.prototype,"icon",void 0);w([D({reflect:!0,attribute:"selected-icon"})],Vi.prototype,"selectedIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Vi.prototype,"selectable",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Vi.prototype,"selected",void 0);w([Ee("selected",!0)],Vi.prototype,"onSelectedChange",null);Vi=w([Re("mdui-button-icon")],Vi);const Lw=Ie`:host{--shape-corner:var(--mdui-shape-corner-medium);position:relative;display:inline-block;overflow:hidden;border-radius:var(--shape-corner);-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([clickable]:not([clickable=false i])){cursor:pointer}:host([variant=elevated]){background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([variant=filled]){background-color:rgb(var(--mdui-color-surface-container-highest))}:host([variant=outlined]){background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=outlined][hover]){box-shadow:var(--mdui-elevation-level1)}:host([variant=elevated][dragged]),:host([variant=filled][dragged]),:host([variant=outlined][dragged]){box-shadow:var(--mdui-elevation-level3)}:host([disabled]:not([disabled=false i])){opacity:.38;cursor:default;-webkit-user-select:none;user-select:none}:host([variant=elevated][disabled]:not([disabled=false i])){background-color:rgb(var(--mdui-color-surface-variant));box-shadow:var(--mdui-elevation-level0)}:host([variant=filled][disabled]:not([disabled=false i])){background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level1)}:host([variant=outlined][disabled]:not([disabled=false i])){box-shadow:var(--mdui-elevation-level0);border-color:rgba(var(--mdui-color-outline),.32)}.link{position:relative;display:inline-block;width:100%;height:100%;color:inherit;font-size:inherit;letter-spacing:inherit;text-decoration:none;touch-action:manipulation;-webkit-user-drag:none}`;let Zr=class extends hn(vi(ni(Ue))){constructor(){super(...arguments),this.variant="elevated",this.clickable=!1,this.disabled=!1,this.rippleRef=Ne()}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled||!this.href&&!this.clickable}get focusElement(){return this.href&&!this.disabled?this.renderRoot.querySelector("._a"):this}get focusDisabled(){return this.rippleDisabled}render(){return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:"link",content:X`<slot></slot>`}):X`<slot></slot>`}`}};Zr.styles=[Me,Lw];w([D({reflect:!0})],Zr.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zr.prototype,"clickable",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zr.prototype,"disabled",void 0);Zr=w([Re("mdui-card")],Zr);/**
415
+ * @license
416
+ * Copyright 2020 Google LLC
417
+ * SPDX-License-Identifier: BSD-3-Clause
418
+ */const en=un(class extends ws{constructor(i){if(super(i),i.type!==Ei.PROPERTY&&i.type!==Ei.ATTRIBUTE&&i.type!==Ei.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Dp(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[e]){if(e===At||e===Ge)return e;const t=i.element,r=i.name;if(i.type===Ei.PROPERTY){if(e===t[r])return At}else if(i.type===Ei.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return At}else if(i.type===Ei.ATTRIBUTE&&t.getAttribute(r)===e+"")return At;return fw(i),e}});function ur(i="value"){return(e,t)=>{const r=e.constructor,n=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(s,o,a){const l=r.getPropertyOptions(i),c=ut(l.attribute)?l.attribute:i;if(s===c){const d=l.converter||Hr,g=(dt(d)?d:(d==null?void 0:d.fromAttribute)??Hr.fromAttribute)(a,l.type);this[i]!==g&&(this[t]=g)}n.call(this,s,o,a)}}}const hi=Ie`:host{display:inline-block;width:1em;height:1em;line-height:1;font-size:1.5rem}`,fi=i=>X`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor">${Lp(i)}</svg>`;let Vl=class extends ct{render(){return fi('<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>')}};Vl.styles=hi;Vl=w([Re("mdui-icon-check-box-outline-blank")],Vl);let zl=class extends ct{render(){return fi('<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>')}};zl.styles=hi;zl=w([Re("mdui-icon-check-box")],zl);let Hl=class extends ct{render(){return fi('<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"/>')}};Hl.styles=hi;Hl=w([Re("mdui-icon-indeterminate-check-box")],Hl);const Dw=Ie`:host{position:relative;display:inline-flex;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:.125rem;font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}label{display:inline-flex;align-items:center;width:100%;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.125rem;height:1.125rem;margin:0 0 0 .6875rem}.icon{display:flex;position:absolute;opacity:1;transform:scale(1);color:rgb(var(--mdui-color-on-surface));font-size:1.5rem;transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.checked-icon,.indeterminate-icon{opacity:0;transform:scale(.5);transition-property:color,opacity,transform;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard)}.icon .i,::slotted([slot=checked-icon]),::slotted([slot=indeterminate-icon]),::slotted([slot=unchecked-icon]){color:inherit;font-size:inherit}i{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;border-radius:50%;width:2.5rem;height:2.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.label{display:flex;width:100%;padding-top:.625rem;padding-bottom:.625rem;color:rgb(var(--mdui-color-on-surface));transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}:host([checked]:not([checked=false i])) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]:not([checked=false i])) .icon{color:rgb(var(--mdui-color-primary))}:host([checked]:not([checked=false i])) .indeterminate-icon{opacity:0;transform:scale(.5)}:host([checked]:not([checked=false i])) .checked-icon{opacity:1;transform:scale(1)}:host([indeterminate]:not([indeterminate=false i])) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([indeterminate]:not([indeterminate=false i])) .icon{color:rgb(var(--mdui-color-primary))}:host([indeterminate]:not([indeterminate=false i])) .checked-icon{opacity:0;transform:scale(.5)}:host([indeterminate]:not([indeterminate=false i])) .indeterminate-icon{opacity:1;transform:scale(1)}.invalid i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}.invalid .icon{color:rgb(var(--mdui-color-error))}.invalid .label{color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])) .icon{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled]:not([disabled=false i])) .label{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled][checked]:not([disabled=false i],[checked=false i])) .unchecked-icon,:host([disabled][indeterminate]:not([disabled=false i],[indeterminate=false i])) .unchecked-icon{opacity:0}`;let yt=class extends vi(ni(Ue)){constructor(){super(...arguments),this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.name="",this.value="on",this.invalid=!1,this.inputRef=Ne(),this.rippleRef=Ne(),this.formController=new Ki(this,{value:e=>e.checked?e.value:void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){return this.inputRef.value}get focusDisabled(){return this.disabled}async onDisabledChange(){await this.updateComplete,this.invalid=!this.inputRef.value.checkValidity()}async onCheckedChange(){var t;await this.updateComplete;const e=this.formController.getForm();e&&((t=ft.get(e))!=null&&t.has(this))?(this.invalid=!1,ft.get(e).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1})||(this.blur(),this.focus())),!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}render(){return X`<label class="${lt({invalid:this.invalid})}"><input ${$e(this.inputRef)} type="checkbox" name="${De(this.name)}" value="${De(this.value)}" .indeterminate="${en(this.indeterminate)}" .disabled="${this.disabled}" .checked="${en(this.checked)}" .required="${this.required}" @change="${this.onChange}"> <i part="control"><mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon?X`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-check-box-outline-blank class="i"></mdui-icon-check-box-outline-blank>`}</slot><slot name="checked-icon" part="checked-icon" class="icon checked-icon">${this.checkedIcon?X`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-check-box class="i"></mdui-icon-check-box>`}</slot><slot name="indeterminate-icon" part="indeterminate-icon" class="icon indeterminate-icon">${this.indeterminateIcon?X`<mdui-icon name="${this.indeterminateIcon}" class="i"></mdui-icon>`:X`<mdui-icon-indeterminate-check-box class="i"></mdui-icon-indeterminate-check-box>`}</slot></i><slot part="label" class="label"></slot></label>`}onChange(){this.checked=this.inputRef.value.checked,this.indeterminate=!1,this.emit("change")}};yt.styles=[Me,Dw];w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"checked",void 0);w([ur("checked")],yt.prototype,"defaultChecked",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"indeterminate",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yt.prototype,"required",void 0);w([D({reflect:!0})],yt.prototype,"form",void 0);w([D({reflect:!0})],yt.prototype,"name",void 0);w([D({reflect:!0})],yt.prototype,"value",void 0);w([D({reflect:!0,attribute:"unchecked-icon"})],yt.prototype,"uncheckedIcon",void 0);w([D({reflect:!0,attribute:"checked-icon"})],yt.prototype,"checkedIcon",void 0);w([D({reflect:!0,attribute:"indeterminate-icon"})],yt.prototype,"indeterminateIcon",void 0);w([Oe()],yt.prototype,"invalid",void 0);w([Ee("disabled",!0),Ee("indeterminate",!0),Ee("required",!0)],yt.prototype,"onDisabledChange",null);w([Ee("checked",!0)],yt.prototype,"onCheckedChange",null);yt=w([Re("mdui-checkbox")],yt);let Wl=class extends ct{render(){return fi('<path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>')}};Wl.styles=hi;Wl=w([Re("mdui-icon-check")],Wl);let Gl=class extends ct{render(){return fi('<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>')}};Gl.styles=hi;Gl=w([Re("mdui-icon-clear")],Gl);const Ow=Ie`:host{--shape-corner:var(--mdui-shape-corner-small);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);height:2rem;background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.button{padding-right:.4375rem;padding-left:.4375rem}:host([variant=input]) .button{padding-right:.1875rem;padding-left:.1875rem}:host([selected]:not([selected=false i])) .button{padding-right:.5rem;padding-left:.5rem}:host([selected][variant=input]:not([selected=false i])) .button{padding-right:.25rem;padding-left:.25rem}:host([elevated]:not([elevated=false i])) .button{padding-right:.5rem;padding-left:.5rem}:host([variant=assist]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([elevated]:not([elevated=false i])){border-width:0;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([selected]:not([selected=false i])){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));border-width:0;--mdui-comp-ripple-state-layer-color:var(
419
+ --mdui-color-on-secondary-container
420
+ )}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){border-color:rgba(var(--mdui-color-on-surface),12%);color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([disabled][elevated]:not([disabled=false i],[elevated=false i])),:host([disabled][selected]:not([disabled=false i],[selected=false i])){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([selected][hover]:not([selected=false i])){box-shadow:var(--mdui-elevation-level1)}:host([elevated][hover]:not([elevated=false i])){color:rgb(var(--mdui-color-on-secondary-container));box-shadow:var(--mdui-elevation-level2)}:host([variant=filter][hover]),:host([variant=input][hover]),:host([variant=suggestion][hover]){color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=filter][focus-visible]),:host([variant=input][focus-visible]),:host([variant=suggestion][focus-visible]){border-color:rgb(var(--mdui-color-on-surface-variant))}:host([dragged]),:host([dragged][hover]){box-shadow:var(--mdui-elevation-level4)}.button{overflow:visible}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon,.selected-icon{display:inline-flex;font-size:1.28571429em;color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=assist]) .end-icon,:host([variant=assist]) .icon,:host([variant=assist]) .selected-icon{color:rgb(var(--mdui-color-primary))}:host([selected]:not([selected=false i])) .end-icon,:host([selected]:not([selected=false i])) .icon,:host([selected]:not([selected=false i])) .selected-icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]:not([disabled=false i])) .end-icon,:host([disabled]:not([disabled=false i])) .icon,:host([disabled]:not([disabled=false i])) .selected-icon{opacity:.38;color:rgb(var(--mdui-color-on-surface))}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}:host([variant=input]) .has-icon .icon,:host([variant=input]) .has-icon .selected-icon,:host([variant=input]) .has-icon mdui-circular-progress{margin-left:.25rem}:host([variant=input]) .has-end-icon .end-icon{margin-right:.25rem}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}::slotted(mdui-avatar[slot=end-icon]),::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){width:1.5rem;height:1.5rem}:host([disabled]:not([disabled=false i])) ::slotted(mdui-avatar[slot=end-icon]),:host([disabled]:not([disabled=false i])) ::slotted(mdui-avatar[slot=icon]),:host([disabled]:not([disabled=false i])) ::slotted(mdui-avatar[slot=selected-icon]){opacity:.38}::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){margin-left:-.25rem;margin-right:-.125rem}::slotted(mdui-avatar[slot=end-icon]){margin-right:-.25rem;margin-left:-.125rem}.delete-icon{display:inline-flex;font-size:1.28571429em;transition:background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);border-radius:var(--mdui-shape-corner-full);margin-right:-.25rem;margin-left:-.25rem;padding:.25rem;color:rgb(var(--mdui-color-on-surface-variant))}.delete-icon:hover{background-color:rgba(var(--mdui-color-on-surface-variant),12%)}.has-end-icon .delete-icon{margin-left:.25rem}:host([variant=assiat]) .delete-icon{color:rgb(var(--mdui-color-primary))}:host([variant=input]) .delete-icon{margin-right:.0625rem}:host([disabled]:not([disabled=false i])) .delete-icon{color:rgba(var(--mdui-color-on-surface),38%)}.delete-icon .i,::slotted([slot=delete-icon]){font-size:inherit}::slotted(mdui-avatar[slot=delete-icon]){width:1.125rem;height:1.125rem}`;let Yt=class extends ot{constructor(){super(),this.variant="assist",this.elevated=!1,this.selectable=!1,this.selected=!1,this.deletable=!1,this.rippleRef=Ne(),this.hasSlotController=new bt(this,"icon","selected-icon","end-icon"),this.onClick=this.onClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}get rippleElement(){return this.rippleRef.value}onSelectedChange(){this.emit("change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}render(){const e=this.icon||this.hasSlotController.test("icon"),t=this.endIcon||this.hasSlotController.test("end-icon"),r=this.selectedIcon||["assist","filter"].includes(this.variant)||e||this.hasSlotController.test("selected-icon"),n=Ri({button:!0,"has-icon":this.loading||!this.selected&&e||this.selected&&r,"has-end-icon":t});return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:n,part:"button",content:this.renderInner()}):this.disabled||this.loading?X`<span part="button" class="${n} _a">${this.renderInner()}</span>`:this.renderAnchor({className:n,part:"button",content:this.renderInner()})}`}onClick(){this.disabled||this.loading||this.selectable&&(this.selected=!this.selected)}onKeyDown(e){this.disabled||this.loading||(this.selectable&&e.key===" "&&(e.preventDefault(),this.selected=!this.selected),this.deletable&&["Delete","Backspace"].includes(e.key)&&this.emit("delete"))}onDelete(e){e.stopPropagation(),this.emit("delete")}renderIcon(){if(this.loading)return this.renderLoading();const e=()=>this.icon?X`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He,t=()=>this.selectedIcon?X`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:this.variant==="assist"||this.variant==="filter"?X`<mdui-icon-check class="i"></mdui-icon-check>`:e();return this.selected?X`<slot name="selected-icon" part="selected-icon" class="selected-icon">${t()}</slot>`:X`<slot name="icon" part="icon" class="icon">${e()}</slot>`}renderLabel(){return X`<slot part="label" class="label"></slot>`}renderEndIcon(){return X`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderDeleteIcon(){return this.deletable?X`<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon?X`<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`:X`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`:He}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon(),this.renderDeleteIcon()]}};Yt.styles=[ot.styles,Ow];w([D({reflect:!0})],Yt.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Yt.prototype,"elevated",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Yt.prototype,"selectable",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Yt.prototype,"selected",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Yt.prototype,"deletable",void 0);w([D({reflect:!0})],Yt.prototype,"icon",void 0);w([D({reflect:!0,attribute:"selected-icon"})],Yt.prototype,"selectedIcon",void 0);w([D({reflect:!0,attribute:"end-icon"})],Yt.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"delete-icon"})],Yt.prototype,"deleteIcon",void 0);w([Ee("selected",!0)],Yt.prototype,"onSelectedChange",null);Yt=w([Re("mdui-chip")],Yt);const tn=(i,e)=>{if(i.length!==e.length)return!1;const t=[...i].sort(),r=[...e].sort();return t.every((n,s)=>n===r[s])},Mw=Ie`:host{display:block}`;let Ti=class extends Ue{constructor(){super(...arguments),this.accordion=!1,this.disabled=!1,this.activeKeys=[],this.isInitial=!0,this.definedController=new vt(this,{relatedElements:["mdui-collapse-item"]})}async onActiveKeysChange(){var t;await this.definedController.whenDefined();const e=this.accordion?(t=this.items.find(r=>this.activeKeys.includes(r.key)))==null?void 0:t.value:this.items.filter(r=>this.activeKeys.includes(r.key)).map(r=>r.value);this.setValue(e),this.isInitial||this.emit("change")}async onValueChange(){if(this.isInitial=!this.hasUpdated,await this.definedController.whenDefined(),this.accordion){const e=this.value;if(!e)this.setActiveKeys([]);else{const t=this.items.find(r=>r.value===e);this.setActiveKeys(t?[t.key]:[])}}else{const e=this.value;if(!e.length)this.setActiveKeys([]);else{const t=this.items.filter(r=>e.includes(r.value)).map(r=>r.key);this.setActiveKeys(t)}}this.updateItems()}render(){return X`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}setActiveKeys(e){tn(this.activeKeys,e)||(this.activeKeys=e)}setValue(e){this.accordion||at(this.value)||at(e)?this.value=e:tn(this.value,e)||(this.value=e)}onClick(e){if(this.disabled||e.button)return;const r=e.target.closest("mdui-collapse-item");if(!r||r.disabled)return;const n=e.composedPath();if(!(r.trigger&&!n.find(s=>qi(s)&&se(s).is(r.trigger)))&&n.find(s=>qi(s)&&s.part.contains("header"))){if(this.accordion)this.activeKeys.includes(r.key)?this.setActiveKeys([]):this.setActiveKeys([r.key]);else{const s=[...this.activeKeys];s.includes(r.key)?s.splice(s.indexOf(r.key),1):s.push(r.key),this.setActiveKeys(s)}this.isInitial=!1,this.updateItems()}}async onSlotChange(){await this.definedController.whenDefined(),this.updateItems()}updateItems(){this.items.forEach(e=>{e.active=this.activeKeys.includes(e.key),e.isInitial=this.isInitial})}};Ti.styles=[Me,Mw];w([D({type:Boolean,reflect:!0,converter:me})],Ti.prototype,"accordion",void 0);w([D()],Ti.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ti.prototype,"disabled",void 0);w([Oe()],Ti.prototype,"activeKeys",void 0);w([ri({selector:"mdui-collapse-item",flatten:!0})],Ti.prototype,"items",void 0);w([Ee("activeKeys",!0)],Ti.prototype,"onActiveKeysChange",null);w([Ee("value")],Ti.prototype,"onValueChange",null);Ti=w([Re("mdui-collapse")],Ti);const Pw=Ie`:host{display:flex;flex-direction:column}.header{display:block}.body{display:block;overflow:hidden;transition:height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-emphasized)}.body.opened{overflow:visible}.body.active{transition-duration:var(--mdui-motion-duration-medium4)}`;let $i=class extends Ue{constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.state="closed",this.isInitial=!0,this.key=lr(),this.bodyRef=Ne()}onActiveChange(){this.isInitial?(this.state=this.active?"opened":"closed",this.hasUpdated&&this.updateBodyHeight()):(this.state=this.active?"open":"close",this.emit(this.state),this.updateBodyHeight())}firstUpdated(e){super.firstUpdated(e),this.updateBodyHeight()}render(){return X`<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${lt({opened:this.state==="opened",active:this.active})}" ${$e(this.bodyRef)} @transitionend="${this.onTransitionEnd}"></slot>`}onTransitionEnd(e){e.target===this.bodyRef.value&&(this.state=this.active?"opened":"closed",this.emit(this.state),this.updateBodyHeight())}updateBodyHeight(){const e=this.bodyRef.value.scrollHeight;this.state==="close"&&(se(this.bodyRef.value).height(e),this.bodyRef.value.clientLeft),se(this.bodyRef.value).height(this.state==="opened"?"auto":this.state==="open"?e:0)}};$i.styles=[Me,Pw];w([D({reflect:!0})],$i.prototype,"value",void 0);w([D({reflect:!0})],$i.prototype,"header",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$i.prototype,"disabled",void 0);w([D()],$i.prototype,"trigger",void 0);w([Oe()],$i.prototype,"active",void 0);w([Oe()],$i.prototype,"state",void 0);w([Ee("active")],$i.prototype,"onActiveChange",null);$i=w([Re("mdui-collapse-item")],$i);/**
421
+ * @license
422
+ * Copyright 2021 Google LLC
423
+ * SPDX-License-Identifier: BSD-3-Clause
424
+ */function Ye(i,e,t){return i?e(i):t==null?void 0:t(i)}function Je(i,e,t){return i?new Promise(r=>{if(t.duration===1/0)throw new Error("Promise-based animations must be finite.");_o(t.duration)&&isNaN(t.duration)&&(t.duration=0),t.easing===""&&(t.easing="linear");const n=i.animate(e,t);n.addEventListener("cancel",r,{once:!0}),n.addEventListener("finish",r,{once:!0})}):Promise.resolve()}function qt(i){return i?Promise.all(i.getAnimations().map(e=>new Promise(t=>{const r=requestAnimationFrame(t);e.addEventListener("cancel",()=>r,{once:!0}),e.addEventListener("finish",()=>r,{once:!0}),e.cancel()}))):Promise.resolve()}function ef(i){const e=ar(),t=i.localName;return i.getAttribute("tabindex")==="-1"||i.hasAttribute("disabled")||i.hasAttribute("aria-disabled")&&i.getAttribute("aria-disabled")!=="false"||t==="input"&&i.getAttribute("type")==="radio"&&!i.hasAttribute("checked")||i.offsetParent===null||e.getComputedStyle(i).visibility==="hidden"?!1:(t==="audio"||t==="video")&&i.hasAttribute("controls")||i.hasAttribute("tabindex")||i.hasAttribute("contenteditable")&&i.getAttribute("contenteditable")!=="false"?!0:["button","input","select","textarea","a","audio","video","summary"].includes(t)}function jw(i){const e=[];function t(s){s instanceof HTMLElement&&(e.push(s),s.shadowRoot!==null&&s.shadowRoot.mode==="open"&&t(s.shadowRoot)),[...s.children].forEach(a=>t(a))}t(i);const r=e.find(s=>ef(s))??null,n=e.reverse().find(s=>ef(s))??null;return{start:r,end:n}}let Pn=[];class Bp{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){Pn.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Pn=Pn.filter(e=>e!==this.element),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Pn[Pn.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=jw(this.element),r=this.tabDirection==="forward"?e:t;typeof(r==null?void 0:r.focus)=="function"&&r.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){e.key==="Tab"&&e.shiftKey&&(this.tabDirection="backward"),requestAnimationFrame(()=>this.checkFocus())}handleKeyUp(){this.tabDirection="forward"}}const Vt=(i,e)=>{const t=`--mdui-motion-easing-${e}`;return se(i).css(t).trim()},gi=(i,e)=>{const t=`--mdui-motion-duration-${e}`,r=se(i).css(t).trim().toLowerCase();return r.endsWith("ms")?parseFloat(r):parseFloat(r)*1e3};let El;const Bw=i=>{if(at(document))return 0;if(El===void 0){const e=se("<div>").css({width:"100%",height:"200px"}),t=se("<div>").css({position:"absolute",top:"0",left:"0",pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}).append(e).appendTo(document.body),r=e[0].offsetWidth;t.css("overflow","scroll");let n=e[0].offsetWidth;r===n&&(n=t[0].clientWidth),t.remove(),El=r-n}return El},Fw=i=>i.scrollHeight>i.clientHeight,Yn=new WeakMap,Fp="mdui-lock-screen",Kl=(i,e)=>{const t=zt();e??(e=t.documentElement),Yn.has(e)||Yn.set(e,new Set),Yn.get(e).add(i);const n=se(e);Fw(e)&&n.css("width",`calc(100% - ${Bw()}px)`),n.addClass(Fp)},Zn=(i,e)=>{const t=zt();e??(e=t.documentElement);const r=Yn.get(e);r&&(r.delete(i),r.size===0&&(Yn.delete(e),se(e).removeClass(Fp).width("")))};/**
425
+ * @license
426
+ * Copyright 2021 Google LLC
427
+ * SPDX-License-Identifier: BSD-3-Clause
428
+ */const qw="lit-localize-status";/**
429
+ * @license
430
+ * Copyright 2021 Google LLC
431
+ * SPDX-License-Identifier: BSD-3-Clause
432
+ */const Uw=i=>typeof i!="string"&&"strTag"in i,Vw=(i,e,t)=>{let r=i[0];for(let n=1;n<i.length;n++)r+=e[n-1],r+=i[n];return r};/**
433
+ * @license
434
+ * Copyright 2021 Google LLC
435
+ * SPDX-License-Identifier: BSD-3-Clause
436
+ */const zw=i=>Uw(i)?Vw(i.strings,i.values):i;let Hw=zw;/**
437
+ * @license
438
+ * Copyright 2020 Google LLC
439
+ * SPDX-License-Identifier: BSD-3-Clause
440
+ */class Ww{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}/**
441
+ * @license
442
+ * Copyright 2014 Travis Webb
443
+ * SPDX-License-Identifier: MIT
444
+ */for(let i=0;i<256;i++)(i>>4&15).toString(16)+(i&15).toString(16);/**
445
+ * @license
446
+ * Copyright 2021 Google LLC
447
+ * SPDX-License-Identifier: BSD-3-Clause
448
+ */let Gw=new Ww;Gw.resolve();let tf=!1;const zs=new Map,Kw=(i,e)=>{tf||(tf=!0,ar().addEventListener(qw,n=>{n.detail.status==="ready"&&zs.forEach(s=>{s.forEach(o=>o())})}));const t=zs.get(i)||[];t.push(e),zs.set(i,t)},Hs=i=>{zs.delete(i)},Jw=Ie`:host{--shape-corner:var(--mdui-shape-corner-extra-large);--z-index:2300;position:fixed;z-index:var(--z-index);display:none;align-items:center;justify-content:center;inset:0;padding:3rem}::slotted(mdui-top-app-bar[slot=header]){position:absolute;border-top-left-radius:var(--mdui-shape-corner-extra-large);border-top-right-radius:var(--mdui-shape-corner-extra-large);background-color:rgb(var(--mdui-color-surface-container-high))}:host([fullscreen]:not([fullscreen=false i])){--shape-corner:var(--mdui-shape-corner-none);padding:0}:host([fullscreen]:not([fullscreen=false i])) ::slotted(mdui-top-app-bar[slot=header]){border-top-left-radius:var(--mdui-shape-corner-none);border-top-right-radius:var(--mdui-shape-corner-none)}.overlay{position:fixed;inset:0;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{--mdui-color-background:var(--mdui-color-surface-container-high);position:relative;display:flex;flex-direction:column;max-height:100%;border-radius:var(--shape-corner);outline:0;transform-origin:top;min-width:17.5rem;max-width:35rem;padding:1.5rem;background-color:rgb(var(--mdui-color-surface-container-high));box-shadow:var(--mdui-elevation-level3)}:host([fullscreen]:not([fullscreen=false i])) .panel{width:100%;max-width:100%;height:100%;max-height:100%;box-shadow:var(--mdui-elevation-level0)}.header{display:flex;flex-direction:column}.has-icon .header{align-items:center}.icon{display:flex;color:rgb(var(--mdui-color-secondary));font-size:1.5rem}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}.headline{display:flex;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.icon+.headline{padding-top:1rem}.body{overflow:auto}.header+.body{margin-top:1rem}.description{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([fullscreen]:not([fullscreen=false i])) .description{color:rgb(var(--mdui-color-on-surface))}.has-description.has-default .description{margin-bottom:1rem}.action{display:flex;justify-content:flex-end;padding-top:1.5rem}.action::slotted(:not(:first-child)){margin-left:.5rem}:host([stacked-actions]:not([stacked-actions=false i])) .action{flex-direction:column;align-items:end}:host([stacked-actions]:not([stacked-actions=false i])) .action::slotted(:not(:first-child)){margin-left:0;margin-top:.5rem}`;let Zt=class extends Ue{constructor(){super(...arguments),this.open=!1,this.fullscreen=!1,this.closeOnEsc=!1,this.closeOnOverlayClick=!1,this.stackedActions=!1,this.overlayRef=Ne(),this.panelRef=Ne(),this.bodyRef=Ne(),this.hasSlotController=new bt(this,"header","icon","headline","description","action","[default]"),this.definedController=new vt(this,{relatedElements:["mdui-top-app-bar"]})}async onOpenChange(){const e=this.hasUpdated;if(!this.open&&!e)return;await this.definedController.whenDefined(),e||await this.updateComplete;const t=Array.from(this.panelRef.value.querySelectorAll(".header, .body, .actions")),r=Vt(this,"linear"),n=Vt(this,"emphasized-decelerate"),s=Vt(this,"emphasized-accelerate"),o=()=>Promise.all([qt(this.overlayRef.value),qt(this.panelRef.value),...t.map(a=>qt(a))]);if(this.open){if(e&&!this.emit("open",{cancelable:!0}))return;this.style.display="flex";const a=this.topAppBarElements??[];if(a.length){const c=a[0];c.scrollTarget||(c.scrollTarget=this.bodyRef.value),this.bodyRef.value.style.marginTop="0"}this.originalTrigger=document.activeElement,this.modalHelper.activate(),Kl(this),await o(),requestAnimationFrame(()=>{const c=this.querySelector("[autofocus]");c?c.focus({preventScroll:!0}):this.panelRef.value.focus({preventScroll:!0})});const l=gi(this,"medium4");await Promise.all([Je(this.overlayRef.value,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:e?l:0,easing:r}),Je(this.panelRef.value,[{transform:"translateY(-1.875rem) scaleY(0)"},{transform:"translateY(0) scaleY(1)"}],{duration:e?l:0,easing:n}),Je(this.panelRef.value,[{opacity:0},{opacity:1,offset:.1},{opacity:1}],{duration:e?l:0,easing:r}),...t.map(c=>Je(c,[{opacity:0},{opacity:0,offset:.2},{opacity:1,offset:.8},{opacity:1}],{duration:e?l:0,easing:r}))]),e&&this.emit("opened")}else{if(!this.emit("close",{cancelable:!0}))return;this.modalHelper.deactivate(),await o();const l=gi(this,"short4");await Promise.all([Je(this.overlayRef.value,[{opacity:1},{opacity:0}],{duration:l,easing:r}),Je(this.panelRef.value,[{transform:"translateY(0) scaleY(1)"},{transform:"translateY(-1.875rem) scaleY(0.6)"}],{duration:l,easing:s}),Je(this.panelRef.value,[{opacity:1},{opacity:1,offset:.75},{opacity:0}],{duration:l,easing:r}),...t.map(d=>Je(d,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:l,easing:r}))]),this.style.display="none",Zn(this);const c=this.originalTrigger;typeof(c==null?void 0:c.focus)=="function"&&setTimeout(()=>c.focus()),this.emit("closed")}}disconnectedCallback(){super.disconnectedCallback(),Zn(this),Hs(this)}firstUpdated(e){super.firstUpdated(e),this.modalHelper=new Bp(this),this.addEventListener("keydown",t=>{this.open&&this.closeOnEsc&&t.key==="Escape"&&(t.stopPropagation(),this.open=!1)})}render(){const e=this.hasSlotController.test("action"),t=this.hasSlotController.test("[default]"),r=!!this.icon||this.hasSlotController.test("icon"),n=!!this.headline||this.hasSlotController.test("headline"),s=!!this.description||this.hasSlotController.test("description"),o=r||n||this.hasSlotController.test("header"),a=s||t;return X`<div ${$e(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${$e(this.panelRef)} part="panel" class="panel ${lt({"has-icon":r,"has-description":s,"has-default":t})}" tabindex="0">${Ye(o,()=>X`<slot name="header" part="header" class="header">${Ye(r,()=>this.renderIcon())} ${Ye(n,()=>this.renderHeadline())}</slot>`)} ${Ye(a,()=>X`<div ${$e(this.bodyRef)} part="body" class="body">${Ye(s,()=>this.renderDescription())}<slot></slot></div>`)} ${Ye(e,()=>X`<slot name="action" part="action" class="action"></slot>`)}</div>`}onOverlayClick(){this.emit("overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}renderIcon(){return X`<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderHeadline(){return X`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`}renderDescription(){return X`<slot name="description" part="description" class="description">${this.description}</slot>`}};Zt.styles=[Me,Jw];w([D({reflect:!0})],Zt.prototype,"icon",void 0);w([D({reflect:!0})],Zt.prototype,"headline",void 0);w([D({reflect:!0})],Zt.prototype,"description",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"open",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Zt.prototype,"fullscreen",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-esc"})],Zt.prototype,"closeOnEsc",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-overlay-click"})],Zt.prototype,"closeOnOverlayClick",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"stacked-actions"})],Zt.prototype,"stackedActions",void 0);w([ri({slot:"header",selector:"mdui-top-app-bar",flatten:!0})],Zt.prototype,"topAppBarElements",void 0);w([Ee("open")],Zt.prototype,"onOpenChange",null);Zt=w([Re("mdui-dialog")],Zt);const Xw=Ie`:host{display:block;height:.0625rem;background-color:rgb(var(--mdui-color-surface-variant))}:host([inset]:not([inset=false i])){margin-left:1rem}:host([middle]:not([middle=false i])){margin-left:1rem;margin-right:1rem}:host([vertical]:not([vertical=false i])){height:100%;width:.0625rem}`;let rn=class extends Ue{constructor(){super(...arguments),this.vertical=!1,this.inset=!1,this.middle=!1}render(){return X``}};rn.styles=[Me,Xw];w([D({type:Boolean,reflect:!0,converter:me})],rn.prototype,"vertical",void 0);w([D({type:Boolean,reflect:!0,converter:me})],rn.prototype,"inset",void 0);w([D({type:Boolean,reflect:!0,converter:me})],rn.prototype,"middle",void 0);rn=w([Re("mdui-divider")],rn);function Zc(){return typeof window<"u"}function qp(i){return Up(i)?(i.nodeName||"").toLowerCase():"#document"}function _s(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function Qw(i){var e;return(e=(Up(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function Up(i){return Zc()?i instanceof Node||i instanceof _s(i).Node:!1}function Yw(i){return Zc()?i instanceof HTMLElement||i instanceof _s(i).HTMLElement:!1}function rf(i){return!Zc()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof _s(i).ShadowRoot}const Zw=new Set(["inline","contents"]);function Vp(i){const{overflow:e,overflowX:t,overflowY:r,display:n}=i1(i);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!Zw.has(n)}const e1=new Set(["html","body","#document"]);function t1(i){return e1.has(qp(i))}function i1(i){return _s(i).getComputedStyle(i)}function r1(i){if(qp(i)==="html")return i;const e=i.assignedSlot||i.parentNode||rf(i)&&i.host||Qw(i);return rf(e)?e.host:e}function zp(i){const e=r1(i);return t1(e)?i.ownerDocument?i.ownerDocument.body:i.body:Yw(e)&&Vp(e)?e:zp(e)}function so(i,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=zp(i),s=n===((r=i.ownerDocument)==null?void 0:r.body),o=_s(n);if(s){const a=n1(o);return e.concat(o,o.visualViewport||[],Vp(n)?n:[],a&&t?so(a):[])}return e.concat(n,so(n,[],t))}function n1(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}const s1=Ie`:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;let Lt=class extends Ue{constructor(){super(),this.open=!1,this.disabled=!1,this.trigger="click",this.placement="auto",this.stayOpenOnClick=!1,this.openDelay=150,this.closeDelay=150,this.openOnPointer=!1,this.panelRef=Ne(),this.definedController=new vt(this,{relatedElements:[""]}),this.onDocumentClick=this.onDocumentClick.bind(this),this.onDocumentKeydown=this.onDocumentKeydown.bind(this),this.onWindowScroll=this.onWindowScroll.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onClick=this.onClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onPanelClick=this.onPanelClick.bind(this)}get triggerElement(){return this.triggerElements[0]}async onPositionChange(){this.open&&(await this.definedController.whenDefined(),this.updatePositioner())}async onOpenChange(){var s,o;const e=this.hasUpdated;if(!this.open&&!e)return;await this.definedController.whenDefined(),e||await this.updateComplete;const t=Vt(this,"linear"),r=Vt(this,"emphasized-decelerate"),n=Vt(this,"emphasized-accelerate");if(this.open){if(e&&!this.emit("open",{cancelable:!0}))return;const a=this.panelElements.find(c=>dt(c.focus));setTimeout(()=>{a==null||a.focus()});const l=gi(this,"medium4");await qt(this.panelRef.value),this.panelRef.value.hidden=!1,this.updatePositioner(),await Promise.all([Je(this.panelRef.value,[{transform:`${this.getCssScaleName()}(0.45)`},{transform:`${this.getCssScaleName()}(1)`}],{duration:e?l:0,easing:r}),Je(this.panelRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:e?l:0,easing:t})]),e&&this.emit("opened")}else{if(!this.emit("close",{cancelable:!0}))return;!this.hasTrigger("focus")&&dt((s=this.triggerElement)==null?void 0:s.focus)&&(this.contains(document.activeElement)||this.contains(((o=document.activeElement)==null?void 0:o.assignedSlot)??null))&&this.triggerElement.focus();const l=gi(this,"short4");await qt(this.panelRef.value),await Promise.all([Je(this.panelRef.value,[{transform:`${this.getCssScaleName()}(1)`},{transform:`${this.getCssScaleName()}(0.45)`}],{duration:l,easing:n}),Je(this.panelRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:l,easing:t})]),this.panelRef.value&&(this.panelRef.value.hidden=!0),this.emit("closed")}}connectedCallback(){super.connectedCallback(),this.definedController.whenDefined().then(()=>{document.addEventListener("pointerdown",this.onDocumentClick),document.addEventListener("keydown",this.onDocumentKeydown),this.overflowAncestors=so(this.triggerElement),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=cr(this.triggerElement,()=>{this.updatePositioner()})})}disconnectedCallback(){var e,t;!this.open&&this.panelRef.value&&(this.panelRef.value.hidden=!0),super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),(e=this.overflowAncestors)==null||e.forEach(r=>{r.removeEventListener("scroll",this.onWindowScroll)}),(t=this.observeResize)==null||t.unobserve()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("mouseleave",this.onMouseLeave),this.definedController.whenDefined().then(()=>{this.triggerElement.addEventListener("focus",this.onFocus),this.triggerElement.addEventListener("click",this.onClick),this.triggerElement.addEventListener("contextmenu",this.onContextMenu),this.triggerElement.addEventListener("mouseenter",this.onMouseEnter)})}render(){return X`<slot name="trigger" part="trigger" class="trigger"></slot><slot ${$e(this.panelRef)} part="panel" class="panel" hidden @click="${this.onPanelClick}"></slot>`}getCssScaleName(){return this.animateDirection==="horizontal"?"scaleX":"scaleY"}onDocumentClick(e){if(this.disabled||!this.open)return;const t=e.composedPath();t.includes(this)||(this.open=!1),this.hasTrigger("contextmenu")&&!this.hasTrigger("click")&&t.includes(this.triggerElement)&&(this.open=!1)}onDocumentKeydown(e){var t;if(!(this.disabled||!this.open)){if(e.key==="Escape"){this.open=!1;return}e.key==="Tab"&&(!this.hasTrigger("focus")&&dt((t=this.triggerElement)==null?void 0:t.focus)&&e.preventDefault(),this.open=!1)}}onWindowScroll(){window.requestAnimationFrame(()=>this.onPositionChange())}hasTrigger(e){return this.trigger.split(" ").includes(e)}onFocus(){this.disabled||this.open||!this.hasTrigger("focus")||(this.open=!0)}onClick(e){this.disabled||e.button||!this.hasTrigger("click")||this.open&&(this.hasTrigger("hover")||this.hasTrigger("focus"))||(this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!this.open)}onPanelClick(e){!this.disabled&&!this.stayOpenOnClick&&se(e.target).is("mdui-menu-item")&&(this.open=!1)}onContextMenu(e){this.disabled||!this.hasTrigger("contextmenu")||(e.preventDefault(),this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!0)}onMouseEnter(){this.disabled||!this.hasTrigger("hover")||(window.clearTimeout(this.closeTimeout),this.openDelay?this.openTimeout=window.setTimeout(()=>{this.open=!0},this.openDelay):this.open=!0)}onMouseLeave(){this.disabled||!this.hasTrigger("hover")||(window.clearTimeout(this.openTimeout),this.closeTimeout=window.setTimeout(()=>{this.open=!1},this.closeDelay||50))}updatePositioner(){const e=se(this.panelRef.value),t=se(window),r=this.panelElements,n={width:Math.max(...(r==null?void 0:r.map(_=>_.offsetWidth))??[]),height:r==null?void 0:r.map(_=>_.offsetHeight).reduce((_,E)=>_+E,0)},s=this.triggerElement.getBoundingClientRect(),o=this.openOnPointer?{top:this.pointerOffsetY+s.top,left:this.pointerOffsetX+s.left,width:0,height:0}:s,a=8;let l,c,d,f,g=this.placement;if(g==="auto"){const _=t.width(),E=t.height();let S,k;E-o.top-o.height>n.height+a?S="bottom":o.top>n.height+a?S="top":_-o.left-o.width>n.width+a?S="right":o.left>n.width+a?S="left":S="bottom",["top","bottom"].includes(S)?_-o.left>n.width+a?k="start":o.left+o.width/2>n.width/2+a&&_-o.left-o.width/2>n.width/2+a?k=void 0:o.left+o.width>n.width+a?k="end":k="start":E-o.top>n.height+a?k="start":o.top+o.height/2>n.height/2+a&&E-o.top-o.height/2>n.height/2+a?k=void 0:o.top+o.height>n.height+a?k="end":k="start",g=k?[S,k].join("-"):S}const[y,b]=g.split("-");switch(this.animateDirection=["top","bottom"].includes(y)?"vertical":"horizontal",y){case"top":c="bottom",d=o.top-n.height;break;case"bottom":c="top",d=o.top+o.height;break;default:switch(c="center",b){case"start":d=o.top;break;case"end":d=o.top+o.height-n.height;break;default:d=o.top+o.height/2-n.height/2;break}break}switch(y){case"left":l="right",f=o.left-n.width;break;case"right":l="left",f=o.left+o.width;break;default:switch(l="center",b){case"start":f=o.left;break;case"end":f=o.left+o.width-n.width;break;default:f=o.left+o.width/2-n.width/2;break}break}e.css({top:d,left:f,transformOrigin:[l,c].join(" ")})}};Lt.styles=[Me,s1];w([D({type:Boolean,reflect:!0,converter:me})],Lt.prototype,"open",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Lt.prototype,"disabled",void 0);w([D({reflect:!0})],Lt.prototype,"trigger",void 0);w([D({reflect:!0})],Lt.prototype,"placement",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"stay-open-on-click"})],Lt.prototype,"stayOpenOnClick",void 0);w([D({type:Number,reflect:!0,attribute:"open-delay"})],Lt.prototype,"openDelay",void 0);w([D({type:Number,reflect:!0,attribute:"close-delay"})],Lt.prototype,"closeDelay",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"open-on-pointer"})],Lt.prototype,"openOnPointer",void 0);w([ri({slot:"trigger",flatten:!0})],Lt.prototype,"triggerElements",void 0);w([ri({flatten:!0})],Lt.prototype,"panelElements",void 0);w([Ee("placement",!0),Ee("openOnPointer",!0)],Lt.prototype,"onPositionChange",null);w([Ee("open")],Lt.prototype,"onOpenChange",null);Lt=w([Re("mdui-dropdown")],Lt);const Hp=(i=0)=>new Promise(e=>setTimeout(e,i)),o1=Ie`:host{--shape-corner-small:var(--mdui-shape-corner-small);--shape-corner-normal:var(--mdui-shape-corner-large);--shape-corner-large:var(--mdui-shape-corner-extra-large);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner-normal);cursor:pointer;-webkit-tap-highlight-color:transparent;transition-property:box-shadow;transition-timing-function:var(--mdui-motion-easing-emphasized);transition-duration:var(--mdui-motion-duration-medium4);width:3.5rem;height:3.5rem;box-shadow:var(--mdui-elevation-level3);font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{padding:0 1rem}:host([size=small]) .button{padding:0 .5rem}:host([size=large]) .button{padding:0 1.875rem}:host([lowered]){box-shadow:var(--mdui-elevation-level1)}:host([focus-visible]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][focus-visible]){box-shadow:var(--mdui-elevation-level1)}:host([pressed]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][pressed]){box-shadow:var(--mdui-elevation-level1)}:host([hover]){box-shadow:var(--mdui-elevation-level4)}:host([lowered][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=primary]){color:rgb(var(--mdui-color-on-primary-container));background-color:rgb(var(--mdui-color-primary-container));--mdui-comp-ripple-state-layer-color:var(
449
+ --mdui-color-on-primary-container
450
+ )}:host([variant=surface]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-high));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=surface][lowered]){background-color:rgb(var(--mdui-color-surface-container-low))}:host([variant=secondary]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
451
+ --mdui-color-on-secondary-container
452
+ )}:host([variant=tertiary]){color:rgb(var(--mdui-color-on-tertiary-container));background-color:rgb(var(--mdui-color-tertiary-container));--mdui-comp-ripple-state-layer-color:var(
453
+ --mdui-color-on-tertiary-container
454
+ )}:host([size=small]){border-radius:var(--shape-corner-small);width:2.5rem;height:2.5rem}:host([size=large]){border-radius:var(--shape-corner-large);width:6rem;height:6rem}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),38%);background-color:rgba(var(--mdui-color-on-surface),12%);box-shadow:var(--mdui-elevation-level0)}:host([extended]:not([extended=false i])){width:auto}.label{display:inline-flex;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short2);padding-left:.25rem;padding-right:.25rem}.has-icon .label{margin-left:.5rem}:host([size=small]) .has-icon .label{margin-left:.25rem}:host([size=large]) .has-icon .label{margin-left:1rem}:host(:not([extended])) .label,:host([extended=false i]) .label{opacity:0;transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1)}:host([size=large]) .label{font-size:1.5em}.icon{display:inline-flex;font-size:1.71428571em}:host([size=large]) .icon{font-size:2.57142857em}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.5rem;height:1.5rem}:host([size=large]) mdui-circular-progress{width:2.25rem;height:2.25rem}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;let rr=class extends ot{constructor(){super(...arguments),this.variant="primary",this.size="normal",this.extended=!1,this.rippleRef=Ne(),this.hasSlotController=new bt(this,"icon"),this.definedController=new vt(this,{relatedElements:[""]})}get rippleElement(){return this.rippleRef.value}async onExtendedChange(){const e=this.hasUpdated;this.extended?this.style.width=`${this.scrollWidth}px`:this.style.width="",await this.definedController.whenDefined(),await this.updateComplete,this.extended&&!e&&(this.style.width=`${this.scrollWidth}px`),e||(await Hp(),this.style.transitionProperty="box-shadow, width, bottom, transform")}render(){const e=Ri({button:!0,"has-icon":this.icon||this.hasSlotController.test("icon")});return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:e,part:"button",content:this.renderInner()}):this.disabled||this.loading?X`<span part="button" class="_a ${e}">${this.renderInner()}</span>`:this.renderAnchor({className:e,part:"button",content:this.renderInner()})}`}renderLabel(){return X`<slot part="label" class="label"></slot>`}renderIcon(){return this.loading?this.renderLoading():X`<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel()]}};rr.styles=[ot.styles,o1];w([D({reflect:!0})],rr.prototype,"variant",void 0);w([D({reflect:!0})],rr.prototype,"size",void 0);w([D({reflect:!0})],rr.prototype,"icon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],rr.prototype,"extended",void 0);w([Ee("extended")],rr.prototype,"onExtendedChange",null);rr=w([Re("mdui-fab")],rr);const a1=Ie`:host{position:relative;display:flex;flex:1 1 auto;overflow:hidden}:host([full-height]:not([full-height=false i])){height:100%}`;let oo=class extends Ue{constructor(){super(...arguments),this.fullHeight=!1}render(){return X`<slot></slot>`}};oo.styles=[Me,a1];w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-height"})],oo.prototype,"fullHeight",void 0);oo=w([Re("mdui-layout")],oo);const l1=Ie`:host{display:flex;z-index:1}`;let cs=class extends dr{constructor(){super(...arguments),this.placement="top"}get layoutPlacement(){return this.placement}onPlacementChange(){var e;(e=this.layoutManager)==null||e.updateLayout(this)}render(){return X`<slot></slot>`}};cs.styles=[Me,l1];w([D({reflect:!0})],cs.prototype,"placement",void 0);w([Ee("placement",!0)],cs.prototype,"onPlacementChange",null);cs=w([Re("mdui-layout-item")],cs);const c1=Ie`:host{flex:1 0 auto;max-width:100%;overflow:auto}`;let Jl=class extends Ue{connectedCallback(){super.connectedCallback();const e=this.parentElement;ys(e,"mdui-layout")&&(this.layoutManager=Pp(e),this.layoutManager.registerMain(this))}disconnectedCallback(){super.disconnectedCallback(),this.layoutManager&&this.layoutManager.unregisterMain()}render(){return X`<slot></slot>`}};Jl.styles=[Me,c1];Jl=w([Re("mdui-layout-main")],Jl);const d1=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);position:relative;display:inline-block;width:100%;overflow:hidden;border-radius:var(--shape-corner);background-color:rgb(var(--mdui-color-surface-container-highest));height:.25rem}.determinate,.indeterminate{background-color:rgb(var(--mdui-color-primary))}.determinate{height:100%;transition:width var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}.indeterminate::before{position:absolute;top:0;bottom:0;left:0;background-color:inherit;animation:mdui-comp-progress-indeterminate 2s var(--mdui-motion-easing-linear) infinite;content:' '}.indeterminate::after{position:absolute;top:0;bottom:0;left:0;background-color:inherit;animation:mdui-comp-progress-indeterminate-short 2s var(--mdui-motion-easing-linear) infinite;content:' '}@keyframes mdui-comp-progress-indeterminate{0%{left:0;width:0}50%{left:30%;width:70%}75%{left:100%;width:0}}@keyframes mdui-comp-progress-indeterminate-short{0%{left:0;width:0}50%{left:0;width:0}75%{left:0;width:25%}100%{left:100%;width:0}}`;let ds=class extends Ue{constructor(){super(...arguments),this.max=1}render(){if(!at(this.value)){const t=this.value;return X`<div part="indicator" class="determinate" style="${xr({width:`${t/Math.max(this.max??t,t)*100}%`})}"></div>`}return X`<div part="indicator" class="indeterminate"></div>`}};ds.styles=[Me,d1];w([D({type:Number,reflect:!0})],ds.prototype,"max",void 0);w([D({type:Number})],ds.prototype,"value",void 0);ds=w([Re("mdui-linear-progress")],ds);const u1=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);--shape-corner-rounded:var(--mdui-shape-corner-extra-large);position:relative;display:block;border-radius:var(--shape-corner);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([rounded]:not([rounded=false i])),:host([rounded]:not([rounded=false i])) mdui-ripple{border-radius:var(--shape-corner-rounded)}:host([active]:not([active=false i])){background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
455
+ --mdui-color-on-secondary-container
456
+ )}:host([disabled]:not([disabled=false i])){pointer-events:none}.container{cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;color:inherit;-webkit-tap-highlight-color:transparent}:host([disabled]:not([disabled=false i])) .container{cursor:default;opacity:.38}:host([nonclickable]:not([href],[nonclickable=false i])) .container{cursor:auto;-webkit-user-select:auto;user-select:auto}.preset{display:flex;align-items:center;padding:.5rem 1.5rem .5rem 1rem;min-height:3.5rem}:host([alignment=start]) .preset{align-items:flex-start}:host([alignment=end]) .preset{align-items:flex-end}.body{display:flex;flex:1 1 100%;flex-direction:column;justify-content:center;min-width:0}.headline{display:block;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}:host([active]:not([active=false i])) .headline{color:rgb(var(--mdui-color-on-secondary-container))}.description{display:none;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([disabled]:not([disabled=false i])) .description,:host([focused]) .description,:host([hover]) .description,:host([pressed]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description .description{display:block}:host([description-line='1']) .description,:host([headline-line='1']) .headline{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([description-line='2']) .description,:host([description-line='3']) .description,:host([headline-line='2']) .headline,:host([headline-line='3']) .headline{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}:host([description-line='2']) .description,:host([headline-line='2']) .headline{-webkit-line-clamp:2}:host([description-line='3']) .description,:host([headline-line='3']) .headline{-webkit-line-clamp:3}.end-icon,.icon{display:flex;flex:0 0 auto;font-size:var(--mdui-typescale-label-small-size);font-weight:var(--mdui-typescale-label-small-weight);letter-spacing:var(--mdui-typescale-label-small-tracking);line-height:var(--mdui-typescale-label-small-line-height);color:rgb(var(--mdui-color-on-surface-variant))}:host([disabled]:not([disabled=false i])) .end-icon,:host([disabled]:not([disabled=false i])) .icon,:host([focused]) .end-icon,:host([focused]) .icon,:host([hover]) .end-icon,:host([hover]) .icon,:host([pressed]) .end-icon,:host([pressed]) .icon{color:rgb(var(--mdui-color-on-surface))}:host([active]:not([active=false i])) .end-icon,:host([active]:not([active=false i])) .icon{color:rgb(var(--mdui-color-on-secondary-container))}.end-icon mdui-icon,.icon mdui-icon,.is-end-icon ::slotted([slot=end-icon]),.is-icon ::slotted([slot=icon]){font-size:1.5rem}.has-icon .icon{margin-right:1rem}.has-icon ::slotted(mdui-checkbox[slot=icon]),.has-icon ::slotted(mdui-radio[slot=icon]){margin-left:-.5rem}.has-end-icon .end-icon{margin-left:1rem}.has-end-icon ::slotted(mdui-checkbox[slot=end-icon]),.has-end-icon ::slotted(mdui-radio[slot=end-icon]){margin-right:-.5rem}`;let $t=class extends hn(vi(ni(Ue))){constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.nonclickable=!1,this.rounded=!1,this.alignment="center",this.rippleRef=Ne(),this.itemRef=Ne(),this.hasSlotController=new bt(this,"[default]","description","icon","end-icon","custom")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.focusDisabled}get focusElement(){return this.href&&!this.disabled?this.itemRef.value:this}get focusDisabled(){return this.href?this.disabled:this.disabled||this.nonclickable}render(){const e=!this.hasSlotController.test("custom"),t=this.icon||this.hasSlotController.test("icon"),r=this.endIcon||this.hasSlotController.test("end-icon"),n=this.description||this.hasSlotController.test("description"),s=a=>ys(a,"mdui-icon")||O0(a).startsWith("mdui-icon-"),o=Ri({container:!0,preset:e,"has-icon":t,"has-end-icon":r,"has-description":n,"is-icon":s(this.iconElements[0]),"is-end-icon":s(this.endIconElements[0])});return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:o,content:this.renderInner(),part:"container",refDirective:$e(this.itemRef)}):X`<div part="container" class="${o}" ${$e(this.itemRef)}>${this.renderInner()}</div>`}`}renderInner(){const e=this.hasSlotController.test("[default]");return X`<slot name="custom"><slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot><div part="body" class="body">${e?X`<slot part="headline" class="headline"></slot>`:X`<div part="headline" class="headline">${this.headline}</div>`}<slot name="description" part="description" class="description">${this.description}</slot></div><slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot></slot>`}};$t.styles=[Me,u1];w([D({reflect:!0})],$t.prototype,"headline",void 0);w([D({type:Number,reflect:!0,attribute:"headline-line"})],$t.prototype,"headlineLine",void 0);w([D({reflect:!0})],$t.prototype,"description",void 0);w([D({type:Number,reflect:!0,attribute:"description-line"})],$t.prototype,"descriptionLine",void 0);w([D({reflect:!0})],$t.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],$t.prototype,"endIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$t.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$t.prototype,"active",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$t.prototype,"nonclickable",void 0);w([D({type:Boolean,reflect:!0,converter:me})],$t.prototype,"rounded",void 0);w([D({reflect:!0})],$t.prototype,"alignment",void 0);w([ri({slot:"icon",flatten:!0})],$t.prototype,"iconElements",void 0);w([ri({slot:"end-icon",flatten:!0})],$t.prototype,"endIconElements",void 0);$t=w([Re("mdui-list-item")],$t);const h1=Ie`:host{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-label-small-size);font-weight:var(--mdui-typescale-label-small-weight);letter-spacing:var(--mdui-typescale-label-small-tracking);line-height:var(--mdui-typescale-label-small-line-height);padding-left:1rem;padding-right:1.5rem;height:3.5rem;line-height:3.5rem}`;let Xl=class extends Ue{render(){return X`<slot></slot>`}};Xl.styles=[Me,h1];Xl=w([Re("mdui-list-subheader")],Xl);const f1=Ie`:host{display:block;padding:.5rem 0}::slotted(mdui-divider[middle]){margin-left:1rem;margin-right:1.5rem}`;let Ql=class extends Ue{render(){return X`<slot></slot>`}};Ql.styles=[Me,f1];Ql=w([Re("mdui-list")],Ql);let Yl=class extends ct{render(){return fi('<path d="m10 17 5-5-5-5v10z"/>')}};Yl.styles=hi;Yl=w([Re("mdui-icon-arrow-right")],Yl);const p1=Ie`:host{position:relative;display:block}:host([selected]){background-color:rgba(var(--mdui-color-primary),12%)}:host([disabled]:not([disabled=false i])){pointer-events:none}.container{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host([disabled]:not([disabled=false i])) .container{cursor:default;opacity:.38}.preset{display:flex;align-items:center;text-decoration:none;height:3rem;padding:0 .75rem}.preset.dense{height:2rem}.label-container{flex:1 1 100%;min-width:0}.label{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking)}.end-icon,.end-text,.icon,.selected-icon{display:none;flex:0 0 auto;color:rgb(var(--mdui-color-on-surface-variant))}.has-end-icon .end-icon,.has-end-text .end-text,.has-icon .icon,.has-icon .selected-icon{display:flex}.end-icon,.icon,.selected-icon{font-size:1.5rem}.end-icon::slotted(mdui-avatar),.icon::slotted(mdui-avatar),.selected-icon::slotted(mdui-avatar){width:1.5rem;height:1.5rem}.dense .end-icon,.dense .icon,.dense .selected-icon{font-size:1.125rem}.dense .end-icon::slotted(mdui-avatar),.dense .icon::slotted(mdui-avatar),.dense .selected-icon::slotted(mdui-avatar){width:1.125rem;height:1.125rem}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}.end-text{font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.icon,.selected-icon{margin-right:.75rem}.end-icon,.end-text{margin-left:.75rem}.arrow-right{color:rgb(var(--mdui-color-on-surface))}.submenu{--shape-corner:var(--mdui-shape-corner-extra-small);display:block;position:absolute;z-index:1;border-radius:var(--shape-corner);background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2);min-width:7rem;max-width:17.5rem;padding-top:.5rem;padding-bottom:.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.submenu::slotted(mdui-divider){margin-top:.5rem;margin-bottom:.5rem}`;let ht=class extends hn(vi(ni(Ue))){constructor(){super(),this.disabled=!1,this.submenuOpen=!1,this.selected=!1,this.dense=!1,this.focusable=!1,this.key=lr(),this.rippleRef=Ne(),this.containerRef=Ne(),this.submenuRef=Ne(),this.hasSlotController=new bt(this,"[default]","icon","end-icon","end-text","submenu","custom"),this.definedController=new vt(this,{relatedElements:[""]}),this.onOuterClick=this.onOuterClick.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this)}get focusDisabled(){return this.disabled||!this.focusable}get focusElement(){return this.href&&!this.disabled?this.containerRef.value:this}get rippleDisabled(){return this.disabled}get rippleElement(){return this.rippleRef.value}get hasSubmenu(){return this.hasSlotController.test("submenu")}async onOpenChange(){const e=this.hasUpdated;if(!this.submenuOpen&&!e)return;await this.definedController.whenDefined(),e||await this.updateComplete;const t=Vt(this,"linear"),r=Vt(this,"emphasized-decelerate"),n=Vt(this,"emphasized-accelerate");if(this.submenuOpen){if(e&&!this.emit("submenu-open",{cancelable:!0}))return;const s=gi(this,"medium4");await qt(this.submenuRef.value),this.submenuRef.value.hidden=!1,this.updateSubmenuPositioner(),await Promise.all([Je(this.submenuRef.value,[{transform:"scaleY(0.45)"},{transform:"scaleY(1)"}],{duration:e?s:0,easing:r}),Je(this.submenuRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:e?s:0,easing:t})]),e&&this.emit("submenu-opened")}else{if(!this.emit("submenu-close",{cancelable:!0}))return;const o=gi(this,"short4");await qt(this.submenuRef.value),await Promise.all([Je(this.submenuRef.value,[{transform:"scaleY(1)"},{transform:"scaleY(0.45)"}],{duration:o,easing:n}),Je(this.submenuRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:o,easing:t})]),this.submenuRef.value&&(this.submenuRef.value.hidden=!0),this.emit("submenu-closed")}}connectedCallback(){super.connectedCallback(),this.definedController.whenDefined().then(()=>{document.addEventListener("pointerdown",this.onOuterClick)})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onOuterClick)}firstUpdated(e){super.firstUpdated(e),this.definedController.whenDefined().then(()=>{this.addEventListener("focus",this.onFocus),this.addEventListener("blur",this.onBlur),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeydown),this.addEventListener("mouseenter",this.onMouseEnter),this.addEventListener("mouseleave",this.onMouseLeave)})}render(){const e=this.hasSubmenu,t=this.hasSlotController.test("custom"),r=this.hasSlotController.test("end-icon"),n=!this.endIcon&&e&&!r,s=this.endIcon||e||r,o=!at(this.icon)||this.selects==="single"||this.selects==="multiple"||this.hasSlotController.test("icon"),a=!!this.endText||this.hasSlotController.test("end-text"),l=Ri({container:!0,dense:this.dense,preset:!t,"has-icon":o,"has-end-text":a,"has-end-icon":s});return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({part:"container",className:l,content:this.renderInner(n,o),refDirective:$e(this.containerRef),tabIndex:this.focusable?0:-1}):X`<div part="container" ${$e(this.containerRef)} class="${l}">${this.renderInner(n,o)}</div>`} ${Ye(e,()=>X`<slot name="submenu" ${$e(this.submenuRef)} part="submenu" class="submenu" hidden></slot>`)}`}onOuterClick(e){!this.disabled&&this.submenuOpen&&this!==e.target&&!se.contains(this,e.target)&&(this.submenuOpen=!1)}hasTrigger(e){return this.submenuTrigger?this.submenuTrigger.split(" ").includes(e):!1}onFocus(){this.disabled||this.submenuOpen||!this.hasTrigger("focus")||!this.hasSubmenu||(this.submenuOpen=!0)}onBlur(){this.disabled||!this.submenuOpen||!this.hasTrigger("focus")||!this.hasSubmenu||(this.submenuOpen=!1)}onClick(e){this.disabled||e.button||!this.hasTrigger("click")||e.target!==this||!this.hasSubmenu||this.submenuOpen&&(this.hasTrigger("hover")||this.hasTrigger("focus"))||(this.submenuOpen=!this.submenuOpen)}onKeydown(e){this.disabled||!this.hasSubmenu||(!this.submenuOpen&&e.key==="Enter"&&(e.stopPropagation(),this.submenuOpen=!0),this.submenuOpen&&e.key==="Escape"&&(e.stopPropagation(),this.submenuOpen=!1))}onMouseEnter(){this.disabled||!this.hasTrigger("hover")||!this.hasSubmenu||(window.clearTimeout(this.submenuCloseTimeout),this.submenuOpenDelay?this.submenuOpenTimeout=window.setTimeout(()=>{this.submenuOpen=!0},this.submenuOpenDelay):this.submenuOpen=!0)}onMouseLeave(){this.disabled||!this.hasTrigger("hover")||!this.hasSubmenu||(window.clearTimeout(this.submenuOpenTimeout),this.submenuCloseTimeout=window.setTimeout(()=>{this.submenuOpen=!1},this.submenuCloseDelay||50))}updateSubmenuPositioner(){const e=se(window),t=se(this.submenuRef.value),r=this.getBoundingClientRect(),n=t.innerWidth(),s=t.innerHeight(),o=8;let a="bottom",l="right";e.height()-r.top>s+o?a="bottom":r.top+r.height>s+o&&(a="top"),e.width()-r.left-r.width>n+o?l="right":r.left>n+o&&(l="left"),se(this.submenuRef.value).css({top:a==="bottom"?0:r.height-s,left:l==="right"?r.width:-n,transformOrigin:[l==="right"?0:"100%",a==="bottom"?0:"100%"].join(" ")})}renderInner(e,t){return X`<slot name="custom">${this.selected?X`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?X`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:X`<slot name="icon" part="icon" class="icon">${t?X`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He}</slot>`}<div class="label-container"><slot part="label" class="label"></slot></div><slot name="end-text" part="end-text" class="end-text">${this.endText}</slot>${e?X`<mdui-icon-arrow-right part="end-icon" class="end-icon arrow-right"></mdui-icon-arrow-right>`:X`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}"></mdui-icon>`:He}</slot>`}</slot>`}};ht.styles=[Me,p1];w([D({reflect:!0})],ht.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ht.prototype,"disabled",void 0);w([D({reflect:!0})],ht.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],ht.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"end-text"})],ht.prototype,"endText",void 0);w([D({reflect:!0,attribute:"selected-icon"})],ht.prototype,"selectedIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"submenu-open"})],ht.prototype,"submenuOpen",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ht.prototype,"selected",void 0);w([Oe()],ht.prototype,"dense",void 0);w([Oe()],ht.prototype,"selects",void 0);w([Oe()],ht.prototype,"submenuTrigger",void 0);w([Oe()],ht.prototype,"submenuOpenDelay",void 0);w([Oe()],ht.prototype,"submenuCloseDelay",void 0);w([Oe()],ht.prototype,"focusable",void 0);w([Ee("submenuOpen")],ht.prototype,"onOpenChange",null);ht=w([Re("mdui-menu-item")],ht);const m1=Ie`:host{--shape-corner:var(--mdui-shape-corner-extra-small);position:relative;display:block;border-radius:var(--shape-corner);background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2);min-width:7rem;max-width:17.5rem;padding-top:.5rem;padding-bottom:.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}::slotted(mdui-divider){margin-top:.5rem;margin-bottom:.5rem}`;let Dt=class extends Ue{constructor(){super(...arguments),this.dense=!1,this.submenuTrigger="click hover",this.submenuOpenDelay=200,this.submenuCloseDelay=200,this.selectedKeys=[],this.isInitial=!0,this.lastActiveItems=[],this.definedController=new vt(this,{relatedElements:["mdui-menu-item"]})}get items(){return se(this.childrenItems).find("mdui-menu-item").add(this.childrenItems).get()}get itemsEnabled(){return this.items.filter(e=>!e.disabled)}get isSingle(){return this.selects==="single"}get isMultiple(){return this.selects==="multiple"}get isSelectable(){return this.isSingle||this.isMultiple}get isSubmenu(){return!se(this).parent().length}get lastActiveItem(){const e=this.lastActiveItems.length?this.lastActiveItems.length-1:0;return this.lastActiveItems[e]}set lastActiveItem(e){const t=this.lastActiveItems.length?this.lastActiveItems.length-1:0;this.lastActiveItems[t]=e}async onSlotChange(){await this.definedController.whenDefined(),this.items.forEach(e=>{e.dense=this.dense,e.selects=this.selects,e.submenuTrigger=this.submenuTrigger,e.submenuOpenDelay=this.submenuOpenDelay,e.submenuCloseDelay=this.submenuCloseDelay})}async onSelectsChange(){this.isSelectable?this.isSingle&&this.setSelectedKeys(this.selectedKeys.slice(0,1)):this.setSelectedKeys([]),await this.onSelectedKeysChange()}async onSelectedKeysChange(){await this.definedController.whenDefined();const e=this.itemsEnabled.filter(r=>this.selectedKeys.includes(r.key)).map(r=>r.value),t=this.isMultiple?e:e[0]||void 0;this.setValue(t),this.isInitial||this.emit("change")}async onValueChange(){if(this.isInitial=!this.hasUpdated,await this.definedController.whenDefined(),!this.isSelectable){this.updateSelected();return}const e=(this.isSingle?[this.value]:ut(this.value)?[this.value]:this.value).filter(t=>t);if(!e.length)this.setSelectedKeys([]);else if(this.isSingle){const t=this.itemsEnabled.find(r=>r.value===e[0]);this.setSelectedKeys(t?[t.key]:[])}else this.isMultiple&&this.setSelectedKeys(this.itemsEnabled.filter(t=>e.includes(t.value)).map(t=>t.key));this.updateSelected(),this.updateFocusable()}focus(e){this.lastActiveItem&&this.focusOne(this.lastActiveItem,e)}blur(){this.lastActiveItem&&this.lastActiveItem.blur()}firstUpdated(e){super.firstUpdated(e),this.definedController.whenDefined().then(()=>{this.updateFocusable(),this.lastActiveItem=this.items.find(t=>t.focusable)}),this.addEventListener("submenu-open",t=>{const r=se(t.target),n=r.children("mdui-menu-item:not([disabled])").get(),s=r.parents("mdui-menu-item").length+1;n.length&&(this.lastActiveItems[s]=n[0],this.updateFocusable(),this.focusOne(this.lastActiveItems[s]))}),this.addEventListener("submenu-close",t=>{const n=se(t.target).parents("mdui-menu-item").length+1;this.lastActiveItems.length-1===n&&(this.lastActiveItems.pop(),this.updateFocusable(),this.lastActiveItems[n-1]&&this.focusOne(this.lastActiveItems[n-1]))})}render(){return X`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}" @keydown="${this.onKeyDown}"></slot>`}setSelectedKeys(e){tn(this.selectedKeys,e)||(this.selectedKeys=e)}setValue(e){this.isSingle||at(this.value)||at(e)?this.value=e:tn(this.value,e)||(this.value=e)}getSiblingsItems(e,t=!1){return se(e).parent().children(`mdui-menu-item${t?":not([disabled])":""}`).get()}updateFocusable(){if(this.lastActiveItem){this.items.forEach(e=>{e.focusable=e.key===this.lastActiveItem.key});return}if(!this.selectedKeys.length){this.itemsEnabled.forEach((e,t)=>{e.focusable=!t});return}if(this.isSingle){this.items.forEach(e=>{e.focusable=this.selectedKeys.includes(e.key)});return}if(this.isMultiple){const e=this.items.find(t=>t.focusable);(!(e!=null&&e.key)||!this.selectedKeys.includes(e.key))&&this.itemsEnabled.filter(t=>this.selectedKeys.includes(t.key)).forEach((t,r)=>t.focusable=!r)}}updateSelected(){this.items.forEach(e=>{e.selected=this.selectedKeys.includes(e.key)})}selectOne(e){if(this.isMultiple){const t=[...this.selectedKeys];t.includes(e.key)?t.splice(t.indexOf(e.key),1):t.push(e.key),this.setSelectedKeys(t)}this.isSingle&&(this.selectedKeys.includes(e.key)?this.setSelectedKeys([]):this.setSelectedKeys([e.key])),this.isInitial=!1,this.updateSelected()}async focusableOne(e){this.items.forEach(t=>t.focusable=t.key===e.key),await Hp()}focusOne(e,t){e.focus(t)}async onClick(e){if(!this.definedController.isDefined()||this.isSubmenu||e.button)return;const r=e.target.closest("mdui-menu-item");!r||r.disabled||(this.lastActiveItem=r,this.isSelectable&&r.value&&this.selectOne(r),await this.focusableOne(r),this.focusOne(r))}async onKeyDown(e){if(!this.definedController.isDefined()||this.isSubmenu)return;const t=e.target;if(e.key==="Enter"&&(e.preventDefault(),t.click()),e.key===" "&&(e.preventDefault(),this.isSelectable&&t.value&&(this.selectOne(t),await this.focusableOne(t),this.focusOne(t))),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){const r=this.getSiblingsItems(t,!0),n=r.find(o=>o.focusable);let s=n?r.indexOf(n):0;if(r.length>0){e.preventDefault(),e.key==="ArrowDown"?s++:e.key==="ArrowUp"?s--:e.key==="Home"?s=0:e.key==="End"&&(s=r.length-1),s<0&&(s=r.length-1),s>r.length-1&&(s=0),this.lastActiveItem=r[s],await this.focusableOne(r[s]),this.focusOne(r[s]);return}}}};Dt.styles=[Me,m1];w([D({reflect:!0})],Dt.prototype,"selects",void 0);w([D()],Dt.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Dt.prototype,"dense",void 0);w([D({reflect:!0,attribute:"submenu-trigger"})],Dt.prototype,"submenuTrigger",void 0);w([D({type:Number,reflect:!0,attribute:"submenu-open-delay"})],Dt.prototype,"submenuOpenDelay",void 0);w([D({type:Number,reflect:!0,attribute:"submenu-close-delay"})],Dt.prototype,"submenuCloseDelay",void 0);w([Oe()],Dt.prototype,"selectedKeys",void 0);w([ri({flatten:!0,selector:"mdui-menu-item"})],Dt.prototype,"childrenItems",void 0);w([Ee("dense"),Ee("selects"),Ee("submenuTrigger"),Ee("submenuOpenDelay"),Ee("submenuCloseDelay")],Dt.prototype,"onSlotChange",null);w([Ee("selects",!0)],Dt.prototype,"onSelectsChange",null);w([Ee("selectedKeys",!0)],Dt.prototype,"onSelectedKeysChange",null);w([Ee("value")],Dt.prototype,"onValueChange",null);Dt=w([Re("mdui-menu")],Dt);const g1=Ie`:host{--shape-corner-indicator:var(--mdui-shape-corner-full);position:relative;z-index:0;flex:1;overflow:hidden;min-width:3rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;padding-top:.75rem;padding-bottom:.75rem}.container:not(.initial){transition:padding var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}mdui-ripple{z-index:1;left:50%;transform:translateX(-50%);width:4rem;height:2rem;margin-top:.75rem;border-radius:var(--mdui-shape-corner-full)}mdui-ripple:not(.initial){transition:margin-top var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.indicator{position:relative;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:var(--shape-corner-indicator);height:2rem;width:2rem}:not(.initial) .indicator{transition:background-color var(--mdui-motion-duration-short1) var(--mdui-motion-easing-standard),width var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.active-icon,.icon{color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}.active-icon mdui-icon,.icon mdui-icon,::slotted([slot=active]),::slotted([slot=icon]){font-size:inherit}.icon{display:flex}.active-icon{display:none}.label{display:flex;align-items:center;height:1rem;color:rgb(var(--mdui-color-on-surface-variant));margin-top:.25rem;margin-bottom:.25rem;font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height)}:not(.initial) .label{transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear)}:host(:not([active])) mdui-ripple.label-visibility-selected,mdui-ripple.label-visibility-unlabeled{margin-top:1.5rem}.container.label-visibility-unlabeled,:host(:not([active])) .container.label-visibility-selected{padding-top:1.5rem;padding-bottom:0}.container.label-visibility-unlabeled .label,:host(:not([active])) .container.label-visibility-selected .label{opacity:0}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]) .indicator{width:4rem;background-color:rgb(var(--mdui-color-secondary-container))}:host([active]) .active-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([active]) .has-active-icon .active-icon{display:flex}:host([active]) .has-active-icon .icon{display:none}:host([active]) .label{color:rgb(var(--mdui-color-on-surface))}`;let Ci=class extends hn(vi(ni(Ue))){constructor(){super(...arguments),this.isInitial=!0,this.active=!1,this.disabled=!1,this.key=lr(),this.rippleRef=Ne(),this.hasSlotController=new bt(this,"active-icon")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){var e;return this.href?(e=this.renderRoot)==null?void 0:e.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=Ri({"label-visibility-selected":this.labelVisibility==="selected","label-visibility-labeled":this.labelVisibility==="labeled","label-visibility-unlabeled":this.labelVisibility==="unlabeled",initial:this.isInitial}),t=Ri([{container:!0,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon")},e]);return X`<mdui-ripple .noRipple="${!this.active||this.noRipple}" class="${e}" ${$e(this.rippleRef)}></mdui-ripple>${this.href?this.renderAnchor({part:"container",className:t,content:this.renderInner()}):X`<div part="container" class="${t}">${this.renderInner()}</div>`}`}renderInner(){return X`<div part="indicator" class="indicator"><slot name="badge" part="badge" class="badge"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon?X`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:He}</slot><slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot></div><slot part="label" class="label"></slot>`}};Ci.styles=[Me,g1];w([D({reflect:!0})],Ci.prototype,"icon",void 0);w([D({reflect:!0,attribute:"active-icon"})],Ci.prototype,"activeIcon",void 0);w([D({reflect:!0})],Ci.prototype,"value",void 0);w([Oe()],Ci.prototype,"labelVisibility",void 0);w([Oe()],Ci.prototype,"isInitial",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ci.prototype,"active",void 0);w([Oe()],Ci.prototype,"disabled",void 0);Ci=w([Re("mdui-navigation-bar-item")],Ci);const y1=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;right:0;bottom:0;left:0;display:flex;flex:0 0 auto;overflow:hidden;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition-property:transform;transition-duration:var(--mdui-motion-duration-long2);transition-timing-function:var(--mdui-motion-easing-emphasized);height:5rem;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level2)}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([hide]:not([hide=false i])){transform:translateY(5.625rem);transition-duration:var(--mdui-motion-duration-short4)}`;let li=class extends Qc(dr){constructor(){super(...arguments),this.hide=!1,this.labelVisibility="auto",this.activeKey=0,this.isInitial=!0,this.definedController=new vt(this,{relatedElements:["mdui-navigation-bar-item"]})}get scrollPaddingPosition(){return"bottom"}get layoutPlacement(){return"bottom"}async onActiveKeyChange(){await this.definedController.whenDefined();const e=this.items.find(t=>t.key===this.activeKey);this.value=e==null?void 0:e.value,this.isInitial||this.emit("change")}async onValueChange(){this.isInitial=!this.hasUpdated,await this.definedController.whenDefined();const e=this.items.find(t=>t.value===this.value);this.activeKey=(e==null?void 0:e.key)??0,this.updateItems()}async onLabelVisibilityChange(){await this.definedController.whenDefined(),this.updateItems()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("transitionend",t=>{t.target===this&&this.emit(this.hide?"hidden":"shown")})}render(){return X`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}runScrollThreshold(e){!e&&!this.hide&&this.emit("hide",{cancelable:!0})&&(this.hide=!0),e&&this.hide&&this.emit("show",{cancelable:!0})&&(this.hide=!1)}onClick(e){if(e.button)return;const r=e.target.closest("mdui-navigation-bar-item");r&&(this.activeKey=r.key,this.isInitial=!1,this.updateItems())}updateItems(){const e=this.items,t=this.labelVisibility==="auto"?e.length<=3?"labeled":"selected":this.labelVisibility;e.forEach(r=>{r.active=this.activeKey===r.key,r.labelVisibility=t,r.isInitial=this.isInitial})}async onSlotChange(){await this.definedController.whenDefined(),this.updateItems()}};li.styles=[Me,y1];w([D({type:Boolean,reflect:!0,converter:me})],li.prototype,"hide",void 0);w([D({reflect:!0,attribute:"label-visibility"})],li.prototype,"labelVisibility",void 0);w([D({reflect:!0})],li.prototype,"value",void 0);w([D({reflect:!0,attribute:"scroll-behavior"})],li.prototype,"scrollBehavior",void 0);w([Oe()],li.prototype,"activeKey",void 0);w([ri({selector:"mdui-navigation-bar-item",flatten:!0})],li.prototype,"items",void 0);w([Ee("activeKey",!0)],li.prototype,"onActiveKeyChange",null);w([Ee("value")],li.prototype,"onValueChange",null);w([Ee("labelVisibility",!0)],li.prototype,"onLabelVisibilityChange",null);li=w([Re("mdui-navigation-bar")],li);const Zl=i=>{const e=ar(),t=zt(),r=e.getComputedStyle(t.documentElement),n=qi(i)?se(i).innerWidth():_o(i)?i:se(e).innerWidth(),s=a=>{const l=r.getPropertyValue(`--mdui-breakpoint-${a}`).toLowerCase();return parseFloat(l)},o=a=>{switch(a){case"xs":return"sm";case"sm":return"md";case"md":return"lg";case"lg":return"xl";case"xl":return"xxl"}};return{up(a){return n>=s(a)},down(a){return n<s(a)},only(a){return a==="xxl"?this.up(a):this.up(a)&&this.down(o(a))},not(a){return!this.only(a)},between(a,l){return this.up(a)&&this.down(l)}}},b1=Ie`:host{--shape-corner:var(--mdui-shape-corner-large);--z-index:2200;display:none;position:fixed;top:0;bottom:0;left:0;z-index:1;width:22.5rem}:host([placement=right]){left:initial;right:0}:host([mobile]),:host([modal]:not([modal=false i])){top:0!important;right:0;bottom:0!important;width:initial;z-index:var(--z-index)}:host([placement=right][mobile]),:host([placement=right][modal]:not([modal=false i])){left:0}:host([contained]:not([contained=false i])){position:absolute}.overlay{position:absolute;inset:0;z-index:inherit;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{display:block;position:absolute;top:0;bottom:0;left:0;width:100%;overflow:auto;z-index:inherit;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level0)}:host([placement=right]) .panel{left:initial;right:0}:host([mobile]) .panel,:host([modal]:not([modal=false i])) .panel{border-radius:0 var(--shape-corner) var(--shape-corner) 0;max-width:80%;width:22.5rem;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([placement=right][mobile]) .panel,:host([placement=right][modal]:not([modal=false i])) .panel{border-radius:var(--shape-corner) 0 0 var(--shape-corner)}`;let Ht=class extends dr{constructor(){super(...arguments),this.open=!1,this.modal=!1,this.closeOnEsc=!1,this.closeOnOverlayClick=!1,this.placement="left",this.contained=!1,this.mobile=!1,this.overlayRef=Ne(),this.panelRef=Ne(),this.definedController=new vt(this,{needDomReady:!0})}get layoutPlacement(){return this.placement}get lockTarget(){return this.contained||this.isParentLayout?this.parentElement:document.documentElement}get isModal(){return this.mobile||this.modal}async onContainedChange(){var e;await this.definedController.whenDefined(),(e=this.observeResize)==null||e.unobserve(),this.setObserveResize()}onPlacementChange(){this.isParentLayout&&this.layoutManager.updateLayout(this)}async onMobileChange(){!this.open||this.isParentLayout||this.contained||(await this.definedController.whenDefined(),this.isModal?(Kl(this,this.lockTarget),await this.getLockTargetAnimate(!1,0)):(Zn(this,this.lockTarget),await this.getLockTargetAnimate(!0,0)))}async onOpenChange(){let e=this.panelRef.value,t=this.overlayRef.value;const r=this.placement==="right",n=Vt(this,"linear"),s=Vt(this,"emphasized"),o=(l,c)=>{se(this.layoutManager.getItemsAndMain()).css("transition",Fc(l)?null:`all ${l}ms ${c}`)},a=async()=>{const l=[];if(this.isModal?l.push(t,e):this.isParentLayout||l.push(this.lockTarget),this.isParentLayout){const c=this.layoutManager.getItemsAndMain(),d=c.indexOf(this);l.push(...c.slice(d))}!this.isModal&&!l.includes(this)&&l.push(this),await Promise.all(l.map(c=>qt(c)))};if(this.open){const l=this.hasUpdated;if(l||(await this.updateComplete,e=this.panelRef.value,t=this.overlayRef.value),l&&!this.emit("open",{cancelable:!0}))return;await this.definedController.whenDefined(),this.style.display="block",this.originalTrigger=document.activeElement,this.isModal&&(this.modalHelper.activate(),this.contained||Kl(this,this.lockTarget)),await a(),requestAnimationFrame(()=>{const f=this.querySelector("[autofocus]");f?f.focus({preventScroll:!0}):e.focus({preventScroll:!0})});const c=gi(this,"long2"),d=[];if(this.isModal?d.push(Je(t,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:l?c:0,easing:n})):this.isParentLayout||d.push(this.getLockTargetAnimate(!0,l?c:0)),this.isParentLayout&&l&&(o(c,s),this.layoutManager.updateLayout(this)),d.push(Je(this.isModal?e:this,[{transform:`translateX(${r?"":"-"}100%)`},{transform:"translateX(0)"}],{duration:l?c:0,easing:s})),await Promise.all(d),!this.open)return;this.isParentLayout&&l&&o(null),l&&this.emit("opened")}else if(this.hasUpdated){if(!this.emit("close",{cancelable:!0}))return;await this.definedController.whenDefined(),this.isModal&&this.modalHelper.deactivate(),await a();const c=gi(this,"short4"),d=[];if(this.isModal?d.push(Je(t,[{opacity:1},{opacity:0}],{duration:c,easing:n})):this.isParentLayout||d.push(this.getLockTargetAnimate(!1,c)),this.isParentLayout&&(o(c,s),this.layoutManager.updateLayout(this,{width:0})),d.push(Je(this.isModal?e:this,[{transform:"translateX(0)"},{transform:`translateX(${r?"":"-"}100%)`}],{duration:c,easing:s})),await Promise.all(d),this.open)return;this.isParentLayout&&o(null),this.style.display="none",this.isModal&&!this.contained&&Zn(this,this.lockTarget);const f=this.originalTrigger;dt(f==null?void 0:f.focus)&&setTimeout(()=>f.focus()),this.emit("closed")}}connectedCallback(){super.connectedCallback(),this.modalHelper=new Bp(this),this.definedController.whenDefined().then(()=>{this.setObserveResize()})}disconnectedCallback(){var e;super.disconnectedCallback(),Zn(this,this.lockTarget),(e=this.observeResize)==null||e.unobserve()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",t=>{this.open&&this.closeOnEsc&&t.key==="Escape"&&this.isModal&&(t.stopPropagation(),this.open=!1)})}render(){return X`${Ye(this.isModal,()=>X`<div ${$e(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}"></div>`)}<slot ${$e(this.panelRef)} part="panel" class="panel" tabindex="0"></slot>`}setObserveResize(){this.observeResize=cr(this.contained?this.parentElement:document.documentElement,()=>{const e=this.contained?this.parentElement:void 0;this.mobile=Zl(e).down("md"),this.isParentLayout&&this.layoutManager.updateLayout(this,{width:this.isModal?0:void 0})})}onOverlayClick(){this.emit("overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}getLockTargetAnimate(e,t){const r=this.placement==="right"?"paddingRight":"paddingLeft",n=se(this.panelRef.value).innerWidth()+"px";return Je(this.lockTarget,[{[r]:e?0:n},{[r]:e?n:0}],{duration:t,easing:Vt(this,"emphasized"),fill:"forwards"})}};Ht.styles=[Me,b1];w([D({type:Boolean,reflect:!0,converter:me})],Ht.prototype,"open",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ht.prototype,"modal",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-esc"})],Ht.prototype,"closeOnEsc",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"close-on-overlay-click"})],Ht.prototype,"closeOnOverlayClick",void 0);w([D({reflect:!0})],Ht.prototype,"placement",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ht.prototype,"contained",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ht.prototype,"mobile",void 0);w([Ee("contained",!0)],Ht.prototype,"onContainedChange",null);w([Ee("placement",!0)],Ht.prototype,"onPlacementChange",null);w([Ee("mobile",!0),Ee("modal",!0)],Ht.prototype,"onMobileChange",null);w([Ee("open")],Ht.prototype,"onOpenChange",null);Ht=w([Re("mdui-navigation-drawer")],Ht);const v1=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;top:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;border-radius:0 var(--shape-corner) var(--shape-corner) 0;z-index:var(--z-index);width:5rem;background-color:rgb(var(--mdui-color-surface));padding:.375rem .75rem}:host([contained]:not([contained=false i])){position:absolute}:host([divider]:not([divider=false i])){border-right:.0625rem solid rgb(var(--mdui-color-surface-variant));width:5.0625rem}:host([placement=right]){left:initial;right:0;border-radius:var(--shape-corner) 0 0 var(--shape-corner)}:host([placement=right][divider]:not([divider=false i])){border-right:none;border-left:.0625rem solid rgb(var(--mdui-color-surface-variant))}.bottom,.items,.top{display:flex;flex-direction:column;align-items:center;width:100%}.top{margin-bottom:1.75rem}.bottom{margin-top:1.75rem}::slotted([slot=bottom]),::slotted([slot=top]),::slotted(mdui-navigation-rail-item){margin-top:.375rem;margin-bottom:.375rem}:host([alignment=start]) .top-spacer{flex-grow:0}:host([alignment=start]) .bottom-spacer{flex-grow:1}:host([alignment=end]) .top-spacer{flex-grow:1}:host([alignment=end]) .bottom-spacer{flex-grow:0}:host([alignment=center]){justify-content:center}:host([alignment=center]) .bottom,:host([alignment=center]) .top{position:absolute}:host([alignment=center]) .top{top:.375rem}:host([alignment=center]) .bottom{bottom:.375rem}`;let Wt=class extends dr{constructor(){super(...arguments),this.placement="left",this.alignment="start",this.contained=!1,this.divider=!1,this.activeKey=0,this.hasSlotController=new bt(this,"top","bottom"),this.definedController=new vt(this,{relatedElements:["mdui-navigation-rail-item"]}),this.isInitial=!0}get layoutPlacement(){return this.placement}get parentTarget(){return this.contained||this.isParentLayout?this.parentElement:document.body}get isRight(){return this.placement==="right"}get paddingValue(){return["fixed","absolute"].includes(se(this).css("position"))?this.offsetWidth:void 0}async onActiveKeyChange(){await this.definedController.whenDefined();const e=this.items.find(t=>t.key===this.activeKey);this.value=e==null?void 0:e.value,this.isInitial||this.emit("change")}async onValueChange(){this.isInitial=!this.hasUpdated,await this.definedController.whenDefined();const e=this.items.find(t=>t.value===this.value);this.activeKey=(e==null?void 0:e.key)??0,this.updateItems()}async onContainedChange(){this.isParentLayout||(await this.definedController.whenDefined(),se(document.body).css({paddingLeft:this.contained||this.isRight?null:this.paddingValue,paddingRight:this.contained||!this.isRight?null:this.paddingValue}),se(this.parentElement).css({paddingLeft:this.contained&&!this.isRight?this.paddingValue:null,paddingRight:this.contained&&this.isRight?this.paddingValue:null}))}async onPlacementChange(){var e;await this.definedController.whenDefined(),(e=this.layoutManager)==null||e.updateLayout(this),this.items.forEach(t=>{t.placement=this.placement}),this.isParentLayout||se(this.parentTarget).css({paddingLeft:this.isRight?null:this.paddingValue,paddingRight:this.isRight?this.paddingValue:null})}connectedCallback(){super.connectedCallback(),this.isParentLayout||this.definedController.whenDefined().then(()=>{se(this.parentTarget).css({paddingLeft:this.isRight?null:this.paddingValue,paddingRight:this.isRight?this.paddingValue:null})})}disconnectedCallback(){super.disconnectedCallback(),!this.isParentLayout&&this.definedController.isDefined()&&se(this.parentTarget).css({paddingLeft:this.isRight?void 0:null,paddingRight:this.isRight?null:void 0})}render(){const e=this.hasSlotController.test("top"),t=this.hasSlotController.test("bottom");return X`${Ye(e,()=>X`<slot name="top" part="top" class="top"></slot>`)} <span class="top-spacer"></span><slot part="items" class="items" @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><span class="bottom-spacer"></span> ${Ye(t,()=>X`<slot name="bottom" part="bottom" class="bottom"></slot>`)}`}onClick(e){if(e.button)return;const r=e.target.closest("mdui-navigation-rail-item");r&&(this.activeKey=r.key,this.isInitial=!1,this.updateItems())}updateItems(){this.items.forEach(e=>{e.active=this.activeKey===e.key,e.placement=this.placement,e.isInitial=this.isInitial})}async onSlotChange(){await this.definedController.whenDefined(),this.updateItems()}};Wt.styles=[Me,v1];w([D({reflect:!0})],Wt.prototype,"value",void 0);w([D({reflect:!0})],Wt.prototype,"placement",void 0);w([D({reflect:!0})],Wt.prototype,"alignment",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Wt.prototype,"contained",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Wt.prototype,"divider",void 0);w([Oe()],Wt.prototype,"activeKey",void 0);w([ri({selector:"mdui-navigation-rail-item",flatten:!0})],Wt.prototype,"items",void 0);w([Ee("activeKey",!0)],Wt.prototype,"onActiveKeyChange",null);w([Ee("value")],Wt.prototype,"onValueChange",null);w([Ee("contained",!0)],Wt.prototype,"onContainedChange",null);w([Ee("placement",!0)],Wt.prototype,"onPlacementChange",null);Wt=w([Re("mdui-navigation-rail")],Wt);const w1=Ie`:host{--shape-corner-indicator:var(--mdui-shape-corner-full);position:relative;z-index:0;width:100%;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:3.5rem}.container:not(.initial){transition:padding var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}mdui-ripple{z-index:1;width:3.5rem;height:2rem;border-radius:var(--mdui-shape-corner-full)}.container:not(.has-label)+mdui-ripple{height:3.5rem}.indicator{position:relative;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:var(--shape-corner-indicator);height:2rem;width:2rem}:not(.initial) .indicator{transition:background-color var(--mdui-motion-duration-short1) var(--mdui-motion-easing-standard),width var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard),height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}.placement-right::slotted([slot=badge]){transform:translate(-50%,-50%)}::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.placement-right::slotted([slot=badge][variant=small]){transform:translate(-.5625rem,-.5625rem)}.active-icon,.icon{color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}.active-icon mdui-icon,.icon mdui-icon,::slotted([slot=active-icon]),::slotted([slot=icon]){font-size:inherit}.icon{display:flex}.active-icon{display:none}.label{display:flex;align-items:center;height:1rem;color:rgb(var(--mdui-color-on-surface-variant));margin-top:.25rem;margin-bottom:.25rem;font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height)}:not(.initial) .label{transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]) .indicator{width:3.5rem;background-color:rgb(var(--mdui-color-secondary-container))}:host([active]) :not(.has-label) .indicator{height:3.5rem}:host([active]) .active-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([active]) .has-active-icon .active-icon{display:flex}:host([active]) .has-active-icon .icon{display:none}:host([active]) .label{color:rgb(var(--mdui-color-on-surface))}`;let Ai=class extends hn(vi(ni(Ue))){constructor(){super(...arguments),this.active=!1,this.isInitial=!0,this.placement="left",this.disabled=!1,this.key=lr(),this.rippleRef=Ne(),this.hasSlotController=new bt(this,"[default]","active-icon")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){var e;return this.href?(e=this.renderRoot)==null?void 0:e.querySelector("._a"):this}get focusDisabled(){return this.disabled}render(){const e=this.hasSlotController.test("[default]"),t=Ri({container:!0,"has-label":e,"has-active-icon":this.activeIcon||this.hasSlotController.test("active-icon"),initial:this.isInitial});return X`${this.href?this.renderAnchor({part:"container",className:t,content:this.renderInner(e)}):X`<div part="container" class="${t}">${this.renderInner(e)}</div>`}<mdui-ripple .noRipple="${!this.active||this.noRipple}" ${$e(this.rippleRef)}></mdui-ripple>`}renderInner(e){return X`<div part="indicator" class="indicator"><slot name="badge" part="badge" class="${lt({badge:!0,"placement-right":this.placement==="right"})}"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon?X`<mdui-icon name="${this.activeIcon}"></mdui-icon>`:He}</slot><slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot></div>${e?X`<slot part="label" class="label"></slot>`:Ge}`}};Ai.styles=[Me,w1];w([D({reflect:!0})],Ai.prototype,"icon",void 0);w([D({reflect:!0,attribute:"active-icon"})],Ai.prototype,"activeIcon",void 0);w([D({reflect:!0})],Ai.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ai.prototype,"active",void 0);w([Oe()],Ai.prototype,"isInitial",void 0);w([Oe()],Ai.prototype,"placement",void 0);w([Oe()],Ai.prototype,"disabled",void 0);Ai=w([Re("mdui-navigation-rail-item")],Ai);let ec=class extends ct{render(){return fi('<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"/>')}};ec.styles=hi;ec=w([Re("mdui-icon-circle")],ec);let tc=class extends ct{render(){return fi('<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/>')}};tc.styles=hi;tc=w([Re("mdui-icon-radio-button-unchecked")],tc);const _1=Ie`:host{position:relative;display:inline-flex;align-items:center;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none;border-radius:.125rem;font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.icon{display:flex;position:absolute;font-size:1.5rem}:not(.initial) .icon{transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard)}.unchecked-icon{transition-property:color;color:rgb(var(--mdui-color-on-surface-variant))}:host([focused]) .unchecked-icon,:host([hover]) .unchecked-icon,:host([pressed]) .unchecked-icon{color:rgb(var(--mdui-color-on-surface))}.checked-icon{opacity:0;transform:scale(.2);transition-property:color,opacity,transform;color:rgb(var(--mdui-color-primary))}.icon .i,::slotted([slot=checked-icon]),::slotted([slot=unchecked-icon]){color:inherit;font-size:inherit}i{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;border-radius:50%;width:2.5rem;height:2.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.label{display:flex;width:100%;padding-top:.625rem;padding-bottom:.625rem;color:rgb(var(--mdui-color-on-surface))}.label:not(.initial){transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}:host([checked]:not([checked=false i])) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]:not([checked=false i])) .icon{color:rgb(var(--mdui-color-primary))}:host([checked]:not([checked=false i])) .checked-icon{opacity:1;transform:scale(.5)}i.invalid{--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}i.invalid .icon{color:rgb(var(--mdui-color-error))}.label.invalid{color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])),:host([group-disabled]){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])) .icon,:host([group-disabled]) .icon{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled]:not([disabled=false i])) .label,:host([group-disabled]) .label{color:rgba(var(--mdui-color-on-surface),38%)}`;let ei=class extends vi(ni(Ue)){constructor(){super(...arguments),this.value="",this.disabled=!1,this.checked=!1,this.invalid=!1,this.groupDisabled=!1,this.focusable=!0,this.isInitial=!0,this.rippleRef=Ne()}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.isDisabled()}get focusElement(){return this}get focusDisabled(){return this.isDisabled()||!this.focusable}onCheckedChange(){this.emit("change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",()=>{this.isDisabled()||(this.checked=!0)})}render(){const e=lt({invalid:this.invalid,initial:this.isInitial});return X`<i part="control" class="${e}"><mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon?X`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-radio-button-unchecked class="i"></mdui-icon-radio-button-unchecked>`}</slot><slot name="checked-icon" part="checked-icon" class="icon checked-icon">${this.checkedIcon?X`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-circle class="i"></mdui-icon-circle>`}</slot></i><slot part="label" class="label ${e}"></slot>`}isDisabled(){return this.disabled||this.groupDisabled}};ei.styles=[Me,_1];w([D({reflect:!0})],ei.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ei.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ei.prototype,"checked",void 0);w([D({reflect:!0,attribute:"unchecked-icon"})],ei.prototype,"uncheckedIcon",void 0);w([D({reflect:!0,attribute:"checked-icon"})],ei.prototype,"checkedIcon",void 0);w([Oe()],ei.prototype,"invalid",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"group-disabled"})],ei.prototype,"groupDisabled",void 0);w([Oe()],ei.prototype,"focusable",void 0);w([Oe()],ei.prototype,"isInitial",void 0);w([Ee("checked",!0)],ei.prototype,"onCheckedChange",null);ei=w([Re("mdui-radio")],ei);const x1=Ie`:host{display:inline-block}fieldset{border:none;padding:0;margin:0;min-width:0}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.25rem;height:1.25rem;margin:0 0 0 .625rem}`;let ci=class extends Ue{constructor(){super(...arguments),this.disabled=!1,this.name="",this.value="",this.defaultValue="",this.required=!1,this.invalid=!1,this.isInitial=!0,this.inputRef=Ne(),this.formController=new Ki(this),this.definedController=new vt(this,{relatedElements:["mdui-radio"]})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get items(){return se(this).find("mdui-radio").get()}get itemsEnabled(){return se(this).find("mdui-radio:not([disabled])").get()}async onValueChange(){var t;this.isInitial=!1,await this.definedController.whenDefined(),this.emit("input"),this.emit("change"),this.updateItems(),this.updateRadioFocusable(),await this.updateComplete;const e=this.formController.getForm();e&&((t=ft.get(e))!=null&&t.has(this))?(this.invalid=!1,ft.get(e).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}async onInvalidChange(){await this.definedController.whenDefined(),this.updateItems()}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1})||(this.inputRef.value.blur(),this.inputRef.value.focus())),!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}render(){return X`<fieldset><input ${$e(this.inputRef)} type="radio" class="input" name="${De(this.name)}" value="${De(this.value)}" .checked="${!!this.value}" .required="${this.required}" tabindex="-1" @keydown="${this.onKeyDown}"><slot @click="${this.onClick}" @keydown="${this.onKeyDown}" @slotchange="${this.onSlotChange}" @change="${this.onCheckedChange}"></slot></fieldset>`}updateRadioFocusable(){const e=this.items,t=e.find(r=>r.checked);t?e.forEach(r=>{r.focusable=r===t}):this.itemsEnabled.forEach((r,n)=>{r.focusable=!n})}async onClick(e){await this.definedController.whenDefined();const r=e.target.closest("mdui-radio");!r||r.disabled||(this.value=r.value,await this.updateComplete,r.focus())}async onKeyDown(e){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key))return;e.preventDefault(),await this.definedController.whenDefined();const t=this.itemsEnabled,r=t.find(o=>o.checked)??t[0],n=e.key===" "?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1;let s=t.indexOf(r)+n;s<0&&(s=t.length-1),s>t.length-1&&(s=0),this.value=t[s].value,await this.updateComplete,t[s].focus()}async onSlotChange(){await this.definedController.whenDefined(),this.updateItems(),this.updateRadioFocusable()}onCheckedChange(e){e.stopPropagation()}updateItems(){this.items.forEach(e=>{e.checked=e.value===this.value,e.invalid=this.invalid,e.groupDisabled=this.disabled,e.isInitial=this.isInitial})}};ci.styles=[Me,x1];w([D({type:Boolean,reflect:!0,converter:me})],ci.prototype,"disabled",void 0);w([D({reflect:!0})],ci.prototype,"form",void 0);w([D({reflect:!0})],ci.prototype,"name",void 0);w([D({reflect:!0})],ci.prototype,"value",void 0);w([ur()],ci.prototype,"defaultValue",void 0);w([D({type:Boolean,reflect:!0,converter:me})],ci.prototype,"required",void 0);w([Oe()],ci.prototype,"invalid",void 0);w([Ee("value",!0)],ci.prototype,"onValueChange",null);w([Ee("invalid",!0),Ee("disabled")],ci.prototype,"onInvalidChange",null);ci=w([Re("mdui-radio-group")],ci);/**
457
+ * @license
458
+ * Copyright 2021 Google LLC
459
+ * SPDX-License-Identifier: BSD-3-Clause
460
+ */function*Vr(i,e){if(i!==void 0){let t=0;for(const r of i)yield e(r,t++)}}const E1=Ie`:host{position:relative;display:block;width:100%;-webkit-tap-highlight-color:transparent;height:2.5rem;padding:0 1.25rem}label{position:relative;display:block;width:100%;height:100%}input[type=range]{position:absolute;inset:0;z-index:4;height:100%;cursor:pointer;opacity:0;appearance:none;width:calc(100% + 20rem * 2 / 16);margin:0 -1.25rem;padding:0 .75rem}:host([disabled]:not([disabled=false i])) input[type=range]{cursor:not-allowed}.track-active,.track-inactive{position:absolute;top:50%;height:.25rem;margin-top:-.125rem}.track-inactive{left:-.125rem;right:-.125rem;border-radius:var(--mdui-shape-corner-full);background-color:rgb(var(--mdui-color-surface-container-highest))}.invalid .track-inactive{background-color:rgba(var(--mdui-color-error),.12)}:host([disabled]:not([disabled=false i])) .track-inactive{background-color:rgba(var(--mdui-color-on-surface),.12)}.track-active{background-color:rgb(var(--mdui-color-primary))}.invalid .track-active{background-color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])) .track-active{background-color:rgba(var(--mdui-color-on-surface),.38)}.handle{position:absolute;top:50%;transform:translate(-50%);cursor:pointer;z-index:2;width:2.5rem;height:2.5rem;margin-top:-1.25rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}.invalid .handle{--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}.handle .elevation,.handle::before{position:absolute;display:block;content:' ';left:.625rem;top:.625rem;width:1.25rem;height:1.25rem;border-radius:var(--mdui-shape-corner-full)}.handle .elevation{background-color:rgb(var(--mdui-color-primary));box-shadow:var(--mdui-elevation-level1)}.invalid .handle .elevation{background-color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])) .handle .elevation{background-color:rgba(var(--mdui-color-on-surface),.38);box-shadow:var(--mdui-elevation-level0)}.handle::before{background-color:rgb(var(--mdui-color-background))}.handle mdui-ripple{border-radius:var(--mdui-shape-corner-full)}.label{position:absolute;left:50%;transform:translateX(-50%) scale(0);transform-origin:center bottom;display:flex;align-items:center;justify-content:center;cursor:default;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;transition:transform var(--mdui-motion-duration-short2) var(--mdui-motion-easing-standard);bottom:2.5rem;min-width:1.75rem;height:1.75rem;padding:.375rem .5rem;border-radius:var(--mdui-shape-corner-full);color:rgb(var(--mdui-color-on-primary));font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height);background-color:rgb(var(--mdui-color-primary))}.invalid .label{color:rgb(var(--mdui-color-on-error));background-color:rgb(var(--mdui-color-error))}.label::after{content:' ';position:absolute;z-index:-1;transform:rotate(45deg);width:.875rem;height:.875rem;bottom:-.125rem;background-color:rgb(var(--mdui-color-primary))}.invalid .label::after{background-color:rgb(var(--mdui-color-error))}.label-visible{transform:translateX(-50%) scale(1);transition:transform var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.tickmark{position:absolute;top:50%;transform:translate(-50%);width:.125rem;height:.125rem;margin-top:-.0625rem;border-radius:var(--mdui-shape-corner-full);background-color:rgba(var(--mdui-color-on-surface-variant),.38)}.invalid .tickmark{background-color:rgba(var(--mdui-color-error),.38)}.tickmark.active{background-color:rgba(var(--mdui-color-on-primary),.38)}.invalid .tickmark.active{background-color:rgba(var(--mdui-color-on-error),.38)}:host([disabled]:not([disabled=false i])) .tickmark{background-color:rgba(var(--mdui-color-on-surface),.38)}`;class St extends vi(ni(Ue)){constructor(){super(...arguments),this.min=0,this.max=100,this.step=1,this.tickmarks=!1,this.nolabel=!1,this.disabled=!1,this.name="",this.invalid=!1,this.labelVisible=!1,this.inputRef=Ne(),this.trackActiveRef=Ne(),this.labelFormatter=e=>e.toString()}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get rippleDisabled(){return this.disabled}get focusElement(){return this.inputRef.value}get focusDisabled(){return this.disabled}onDisabledChange(){this.invalid=!this.inputRef.value.checkValidity()}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1})||(this.blur(),this.focus())),!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}fixValue(e){const{min:t,max:r,step:n}=this;e=Math.min(Math.max(e,t),r);const s=Math.round((e-t)/n);let o=t+s*n;return o>r&&(o-=n),o}getCandidateValues(){return Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).filter(e=>!((e-this.min)%this.step))}renderLabel(e){return Ye(!this.nolabel,()=>X`<div part="label" class="label ${lt({"label-visible":this.labelVisible})}">${this.labelFormatter(e)}</div>`)}onChange(){this.emit("change")}}St.styles=[Me,E1];w([D({type:Number,reflect:!0})],St.prototype,"min",void 0);w([D({type:Number,reflect:!0})],St.prototype,"max",void 0);w([D({type:Number,reflect:!0})],St.prototype,"step",void 0);w([D({type:Boolean,reflect:!0,converter:me})],St.prototype,"tickmarks",void 0);w([D({type:Boolean,reflect:!0,converter:me})],St.prototype,"nolabel",void 0);w([D({type:Boolean,reflect:!0,converter:me})],St.prototype,"disabled",void 0);w([D({reflect:!0})],St.prototype,"form",void 0);w([D({reflect:!0})],St.prototype,"name",void 0);w([Oe()],St.prototype,"invalid",void 0);w([Oe()],St.prototype,"labelVisible",void 0);w([D({attribute:!1})],St.prototype,"labelFormatter",void 0);w([Ee("disabled",!0)],St.prototype,"onDisabledChange",null);let nn=class extends St{constructor(){super(...arguments),this.defaultValue=[],this.currentHandle="start",this.rippleStartRef=Ne(),this.rippleEndRef=Ne(),this.handleStartRef=Ne(),this.handleEndRef=Ne(),this.formController=new Ki(this),this._value=[],this.getRippleIndex=()=>this.hoverHandle?this.hoverHandle==="start"?0:1:this.currentHandle==="start"?0:1}get value(){return this._value}set value(e){const t=[...this._value];this._value=[this.fixValue(e[0]),this.fixValue(e[1])],this.requestUpdate("value",t),this.updateComplete.then(()=>{var n;this.updateStyle();const r=this.formController.getForm();r&&((n=ft.get(r))!=null&&n.has(this))?(this.invalid=!1,ft.get(r).delete(this)):this.invalid=!this.inputRef.value.checkValidity()})}get rippleElement(){return[this.rippleStartRef.value,this.rippleEndRef.value]}connectedCallback(){super.connectedCallback(),this.value.length||(this.value=[this.min,this.max]),this.value[0]=this.fixValue(this.value[0]),this.value[1]=this.fixValue(this.value[1]),this.defaultValue.length||(this.defaultValue=[...this.value])}firstUpdated(e){super.firstUpdated(e);const t=s=>{const o=se(this),a=parseFloat(o.css("padding-left")),l=parseFloat(o.css("padding-right")),c=(s.offsetX-a)/(this.clientWidth-a-l),d=(this.max-this.min)*c+this.min,f=(this.value[1]-this.value[0])/2+this.value[0];return d>f?"end":"start"},r=()=>{this.disabled||(this.labelVisible=!0)},n=()=>{this.disabled||(this.labelVisible=!1)};this.addEventListener("touchstart",r),this.addEventListener("mousedown",r),this.addEventListener("touchend",n),this.addEventListener("mouseup",n),this.addEventListener("pointerdown",s=>{this.currentHandle=t(s)}),this.addEventListener("pointermove",s=>{const o=t(s);this.hoverHandle!==o&&(this.endHover(s),this.hoverHandle=o,this.startHover(s))}),this.updateStyle()}render(){return X`<label class="${lt({invalid:this.invalid})}"><input ${$e(this.inputRef)} type="range" step="${this.step}" min="${this.min}" max="${this.max}" ?disabled="${this.disabled}" @input="${this.onInput}" @change="${this.onChange}"><div part="track-inactive" class="track-inactive"></div><div ${$e(this.trackActiveRef)} part="track-active" class="track-active"></div><div ${$e(this.handleStartRef)} part="handle" class="handle start" style="${xr({"z-index":this.currentHandle==="start"?"2":"1"})}"><div class="elevation"></div><mdui-ripple ${$e(this.rippleStartRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value[0])}</div><div ${$e(this.handleEndRef)} part="handle" class="handle end" style="${xr({"z-index":this.currentHandle==="end"?"2":"1"})}"><div class="elevation"></div><mdui-ripple ${$e(this.rippleEndRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value[1])}</div>${Ye(this.tickmarks,()=>Vr(this.getCandidateValues(),e=>X`<div part="tickmark" class="tickmark ${lt({active:e>this.value[0]&&e<this.value[1]})}" style="${xr({left:`${(e-this.min)/this.max*100}%`,display:e===this.value[0]||e===this.value[1]?"none":"block"})}"></div>`))}</label>`}updateStyle(){const e=n=>(n-this.min)/(this.max-this.min)*100,t=e(this.value[0]),r=e(this.value[1]);this.trackActiveRef.value.style.width=`${r-t}%`,this.trackActiveRef.value.style.left=`${t}%`,this.handleStartRef.value.style.left=`${t}%`,this.handleEndRef.value.style.left=`${r}%`}onInput(){const e=this.currentHandle==="start",t=parseFloat(this.inputRef.value.value),r=this.value[0],n=this.value[1],s=()=>{this.updateStyle()};e?t<=n?(this.value=[t,n],s()):r!==n&&(this.value=[n,n],s()):t>=r?(this.value=[r,t],s()):r!==n&&(this.value=[r,r],s())}};nn.styles=[St.styles];w([ur()],nn.prototype,"defaultValue",void 0);w([Oe()],nn.prototype,"currentHandle",void 0);w([D({type:Array,attribute:!1})],nn.prototype,"value",null);nn=w([Re("mdui-range-slider")],nn);const S1=Ie`:host{position:relative;display:inline-flex;flex-grow:1;flex-shrink:0;float:left;height:100%;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;border:.0625rem solid rgb(var(--mdui-color-outline))}.button{width:100%;padding:0 .75rem}:host([invalid]){color:rgb(var(--mdui-color-error));border-color:rgb(var(--mdui-color-error))}:host([invalid]) .button{background-color:rgb(var(--mdui-color-error-container))}:host([selected]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
461
+ --mdui-color-on-secondary-container
462
+ )}:host([disabled]:not([disabled=false i])),:host([group-disabled]){cursor:default;pointer-events:none;color:rgba(var(--mdui-color-on-surface),38%);border-color:rgba(var(--mdui-color-on-surface),12%)}:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host(:not(.mdui-segmented-button-first)){margin-left:-.0625rem}:host(.mdui-segmented-button-first){border-radius:var(--shape-corner) 0 0 var(--shape-corner)}:host(.mdui-segmented-button-last){border-radius:0 var(--shape-corner) var(--shape-corner) 0}.end-icon,.icon,.selected-icon{display:inline-flex;font-size:1.28571429em}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}mdui-circular-progress{width:1.125rem;height:1.125rem}:host([disabled]:not([disabled=false i])) mdui-circular-progress{opacity:.38}.label{display:inline-flex}.has-icon .label{padding-left:.5rem}.has-end-icon .label{padding-right:.5rem}`;let zi=class extends ot{constructor(){super(...arguments),this.selected=!1,this.invalid=!1,this.groupDisabled=!1,this.key=lr(),this.rippleRef=Ne(),this.hasSlotController=new bt(this,"[default]","icon","end-icon")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.isDisabled()||this.loading}get focusDisabled(){return this.isDisabled()||this.loading}render(){const e=Ri({button:!0,"has-icon":this.icon||this.selected||this.loading||this.hasSlotController.test("icon"),"has-end-icon":this.endIcon||this.hasSlotController.test("end-icon")});return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:e,part:"button",content:this.renderInner()}):this.isDisabled()||this.loading?X`<span part="button" class="_a ${e}">${this.renderInner()}</span>`:this.renderAnchor({className:e,part:"button",content:this.renderInner()})}`}isDisabled(){return this.disabled||this.groupDisabled}renderIcon(){return this.loading?this.renderLoading():this.selected?X`<slot name="selected-icon" part="selected-icon" class="selected-icon">${this.selectedIcon?X`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:X`<mdui-icon-check class="i"></mdui-icon-check>`}</slot>`:X`<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He}</slot>`}renderLabel(){return this.hasSlotController.test("[default]")?X`<slot part="label" class="label"></slot>`:He}renderEndIcon(){return X`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon()]}};zi.styles=[ot.styles,S1];w([D({reflect:!0})],zi.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],zi.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"selected-icon"})],zi.prototype,"selectedIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],zi.prototype,"selected",void 0);w([D({type:Boolean,reflect:!0,converter:me})],zi.prototype,"invalid",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"group-disabled"})],zi.prototype,"groupDisabled",void 0);zi=w([Re("mdui-segmented-button")],zi);const k1=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-flex;vertical-align:middle;height:2.5rem;font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height);color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([full-width]:not([full-width=false i])){display:flex;flex-wrap:nowrap}input,select{position:absolute;width:100%;height:100%;padding:0;opacity:0;pointer-events:none}`;let Et=class extends Ue{constructor(){super(...arguments),this.fullWidth=!1,this.disabled=!1,this.required=!1,this.name="",this.value="",this.defaultValue="",this.selectedKeys=[],this.invalid=!1,this.isInitial=!0,this.inputRef=Ne(),this.formController=new Ki(this),this.definedController=new vt(this,{relatedElements:["mdui-segmented-button"]})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get items(){return se(this).find("mdui-segmented-button").get()}get itemsEnabled(){return se(this).find("mdui-segmented-button:not([disabled])").get()}get isSingle(){return this.selects==="single"}get isMultiple(){return this.selects==="multiple"}get isSelectable(){return this.isSingle||this.isMultiple}async onSelectsChange(){this.isSelectable?this.isSingle&&this.setSelectedKeys(this.selectedKeys.slice(0,1)):this.setSelectedKeys([]),await this.onSelectedKeysChange()}async onSelectedKeysChange(){await this.definedController.whenDefined();const e=this.itemsEnabled.filter(r=>this.selectedKeys.includes(r.key)).map(r=>r.value),t=this.isMultiple?e:e[0]||"";this.setValue(t),this.isInitial||this.emit("change")}async onValueChange(){var t;if(this.isInitial=!this.hasUpdated,await this.definedController.whenDefined(),!this.isSelectable){this.updateItems();return}const e=(this.isSingle?[this.value]:ut(this.value)?[this.value]:this.value).filter(r=>r);if(!e.length)this.setSelectedKeys([]);else if(this.isSingle){const r=this.itemsEnabled.find(n=>n.value===e[0]);this.setSelectedKeys(r?[r.key]:[])}else this.isMultiple&&this.setSelectedKeys(this.itemsEnabled.filter(r=>e.includes(r.value)).map(r=>r.key));if(this.updateItems(),!this.isInitial){const r=this.formController.getForm();r&&((t=ft.get(r))!=null&&t.has(this))?(this.invalid=!1,ft.get(r).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}}async onInvalidChange(){await this.definedController.whenDefined(),this.updateItems()}connectedCallback(){super.connectedCallback(),this.value=this.isMultiple&&ut(this.value)?this.value?[this.value]:[]:this.value,this.defaultValue=this.selects==="multiple"?[]:""}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1})||(this.inputRef.value.blur(),this.inputRef.value.focus())),!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}render(){return X`${Ye(this.isSelectable&&this.isSingle,()=>X`<input ${$e(this.inputRef)} type="radio" name="${De(this.name)}" value="1" .disabled="${this.disabled}" .required="${this.required}" .checked="${!!this.value}" tabindex="-1" @keydown="${this.onInputKeyDown}">`)}${Ye(this.isSelectable&&this.isMultiple,()=>X`<select ${$e(this.inputRef)} name="${De(this.name)}" .disabled="${this.disabled}" .required="${this.required}" multiple="multiple" tabindex="-1" @keydown="${this.onInputKeyDown}">${Vr(this.value,e=>X`<option selected="selected" value="${e}"></option>`)}</select>`)}<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}selectOne(e){if(this.isMultiple){const t=[...this.selectedKeys];t.includes(e.key)?t.splice(t.indexOf(e.key),1):t.push(e.key),this.setSelectedKeys(t)}this.isSingle&&(this.selectedKeys.includes(e.key)?this.setSelectedKeys([]):this.setSelectedKeys([e.key])),this.isInitial=!1,this.updateItems()}async onClick(e){if(e.button)return;await this.definedController.whenDefined();const r=e.target.closest("mdui-segmented-button");!r||r.disabled||this.isSelectable&&r.value&&this.selectOne(r)}async onInputKeyDown(e){if(["Enter"," "].includes(e.key)){if(e.preventDefault(),await this.definedController.whenDefined(),this.isSingle){const t=e.target;t.checked=!t.checked,this.selectOne(this.itemsEnabled[0]),this.itemsEnabled[0].focus()}this.isMultiple&&(this.selectOne(this.itemsEnabled[0]),this.itemsEnabled[0].focus())}}async onSlotChange(){await this.definedController.whenDefined(),this.updateItems(!0)}setSelectedKeys(e){tn(this.selectedKeys,e)||(this.selectedKeys=e)}setValue(e){this.isSingle?this.value=e:tn(this.value,e)||(this.value=e)}updateItems(e=!1){const t=this.items;t.forEach((r,n)=>{r.invalid=this.invalid,r.groupDisabled=this.disabled,r.selected=this.selectedKeys.includes(r.key),e&&(r.classList.toggle("mdui-segmented-button-first",n===0),r.classList.toggle("mdui-segmented-button-last",n===t.length-1))})}};Et.styles=[Me,k1];w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-width"})],Et.prototype,"fullWidth",void 0);w([D({reflect:!0})],Et.prototype,"selects",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Et.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Et.prototype,"required",void 0);w([D({reflect:!0})],Et.prototype,"form",void 0);w([D({reflect:!0})],Et.prototype,"name",void 0);w([D()],Et.prototype,"value",void 0);w([ur()],Et.prototype,"defaultValue",void 0);w([Oe()],Et.prototype,"selectedKeys",void 0);w([Oe()],Et.prototype,"invalid",void 0);w([Ee("selects",!0)],Et.prototype,"onSelectsChange",null);w([Ee("selectedKeys",!0)],Et.prototype,"onSelectedKeysChange",null);w([Ee("value")],Et.prototype,"onValueChange",null);w([Ee("invalid",!0),Ee("disabled")],Et.prototype,"onInvalidChange",null);Et=w([Re("mdui-segmented-button-group")],Et);let ic=class extends ct{render(){return fi('<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"/>')}};ic.styles=hi;ic=w([Re("mdui-icon-cancel--outlined")],ic);let rc=class extends ct{render(){return fi('<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>')}};rc.styles=hi;rc=w([Re("mdui-icon-error")],rc);let nc=class extends ct{render(){return fi('<path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46A11.804 11.804 0 0 0 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/>')}};nc.styles=hi;nc=w([Re("mdui-icon-visibility-off")],nc);let sc=class extends ct{render(){return fi('<path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>')}};sc.styles=hi;sc=w([Re("mdui-icon-visibility")],sc);const I1=Ie`:host{display:inline-block;width:100%}:host([disabled]:not([disabled=false i])){pointer-events:none}:host([type=hidden]){display:none}.container{position:relative;display:flex;align-items:center;height:100%;padding:.125rem .125rem .125rem 1rem;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.container.has-icon{padding-left:.75rem}.container.has-action,.container.has-right-icon,.container.has-suffix{padding-right:.75rem}:host([variant=filled]) .container{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-surface-variant));background-color:rgb(var(--mdui-color-surface-container-highest));border-radius:var(--mdui-shape-corner-extra-small) var(--mdui-shape-corner-extra-small) 0 0}:host([variant=outlined]) .container{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-outline));border-radius:var(--mdui-shape-corner-extra-small)}:host([variant=filled]) .container.invalid,:host([variant=filled]) .container.invalid-style{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-error))}:host([variant=outlined]) .container.invalid,:host([variant=outlined]) .container.invalid-style{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-error))}:host([variant=filled]:hover) .container{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-surface))}:host([variant=outlined]:hover) .container{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-on-surface))}:host([variant=filled]:hover) .container.invalid,:host([variant=filled]:hover) .container.invalid-style{box-shadow:inset 0 -.0625rem 0 0 rgb(var(--mdui-color-on-error-container))}:host([variant=outlined]:hover) .container.invalid,:host([variant=outlined]:hover) .container.invalid-style{box-shadow:inset 0 0 0 .0625rem rgb(var(--mdui-color-on-error-container))}:host([variant=filled][focused-style]) .container,:host([variant=filled][focused]) .container{box-shadow:inset 0 -.125rem 0 0 rgb(var(--mdui-color-primary))}:host([variant=outlined][focused-style]) .container,:host([variant=outlined][focused]) .container{box-shadow:inset 0 0 0 .125rem rgb(var(--mdui-color-primary))}:host([variant=filled][focused-style]) .container.invalid,:host([variant=filled][focused-style]) .container.invalid-style,:host([variant=filled][focused]) .container.invalid,:host([variant=filled][focused]) .container.invalid-style{box-shadow:inset 0 -.125rem 0 0 rgb(var(--mdui-color-error))}:host([variant=outlined][focused-style]) .container.invalid,:host([variant=outlined][focused-style]) .container.invalid-style,:host([variant=outlined][focused]) .container.invalid,:host([variant=outlined][focused]) .container.invalid-style{box-shadow:inset 0 0 0 .125rem rgb(var(--mdui-color-error))}:host([variant=filled][disabled]:not([disabled=false i])) .container{box-shadow:inset 0 -.0625rem 0 0 rgba(var(--mdui-color-on-surface),38%);background-color:rgba(var(--mdui-color-on-surface),4%)}:host([variant=outlined][disabled]:not([disabled=false i])) .container{box-shadow:inset 0 0 0 .125rem rgba(var(--mdui-color-on-surface),12%)}.action,.icon,.prefix,.right-icon,.suffix{display:flex;-webkit-user-select:none;user-select:none;color:rgb(var(--mdui-color-on-surface-variant))}:host([disabled]:not([disabled=false i])) .action,:host([disabled]:not([disabled=false i])) .icon,:host([disabled]:not([disabled=false i])) .prefix,:host([disabled]:not([disabled=false i])) .right-icon,:host([disabled]:not([disabled=false i])) .suffix{color:rgba(var(--mdui-color-on-surface),38%)}.invalid .right-icon,.invalid-style .right-icon{color:rgb(var(--mdui-color-error))}:host(:hover) .invalid .right-icon,:host(:hover) .invalid-style .right-icon{color:rgb(var(--mdui-color-on-error-container))}:host([focused-style]) .invalid .right-icon,:host([focused-style]) .invalid-style .right-icon,:host([focused]) .invalid .right-icon,:host([focused]) .invalid-style .right-icon{color:rgb(var(--mdui-color-error))}.action,.icon,.right-icon{font-size:1.5rem}.action mdui-button-icon,.icon mdui-button-icon,.right-icon mdui-button-icon,::slotted(mdui-button-icon[slot]){margin-left:-.5rem;margin-right:-.5rem}.action .i,.icon .i,.right-icon .i,::slotted([slot$=icon]){font-size:inherit}.has-icon .icon{margin-right:1rem}.has-prefix .prefix{padding-right:.125rem}.has-action .action{margin-left:.75rem}.has-suffix .suffix{padding-right:.25rem;padding-left:.125rem}.has-right-icon .right-icon{margin-left:.75rem}.prefix,.suffix{display:none;font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}:host([variant=filled][label]) .prefix,:host([variant=filled][label]) .suffix{padding-top:1rem}.has-value .prefix,.has-value .suffix,:host([focused-style]) .prefix,:host([focused-style]) .suffix,:host([focused]) .prefix,:host([focused]) .suffix{display:flex}.input-container{display:flex;width:100%;height:100%}.label{position:absolute;pointer-events:none;max-width:calc(100% - 1rem);display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;transition:all var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard);top:1rem;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}.invalid .label,.invalid-style .label{color:rgb(var(--mdui-color-error))}:host([variant=outlined]) .label{padding:0 .25rem;margin:0 -.25rem}:host([variant=outlined]:hover) .label{color:rgb(var(--mdui-color-on-surface))}:host([variant=filled]:hover) .invalid .label,:host([variant=filled]:hover) .invalid-style .label,:host([variant=outlined]:hover) .invalid .label,:host([variant=outlined]:hover) .invalid-style .label{color:rgb(var(--mdui-color-on-error-container))}:host([variant=filled][focused-style]) .label,:host([variant=filled][focused]) .label,:host([variant=outlined][focused-style]) .label,:host([variant=outlined][focused]) .label{color:rgb(var(--mdui-color-primary))}:host([variant=filled]) .has-value .label,:host([variant=filled][focused-style]) .label,:host([variant=filled][focused]) .label,:host([variant=filled][type=date]) .label,:host([variant=filled][type=datetime-local]) .label,:host([variant=filled][type=month]) .label,:host([variant=filled][type=time]) .label,:host([variant=filled][type=week]) .label{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height);top:.25rem}:host([variant=outlined]) .has-value .label,:host([variant=outlined][focused-style]) .label,:host([variant=outlined][focused]) .label,:host([variant=outlined][type=date]) .label,:host([variant=outlined][type=datetime-local]) .label,:host([variant=outlined][type=month]) .label,:host([variant=outlined][type=time]) .label,:host([variant=outlined][type=week]) .label{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height);top:-.5rem;left:.75rem;background-color:rgb(var(--mdui-color-background))}:host([variant=filled][focused-style]) .invalid .label,:host([variant=filled][focused-style]) .invalid-style .label,:host([variant=filled][focused]) .invalid .label,:host([variant=filled][focused]) .invalid-style .label,:host([variant=outlined][focused-style]) .invalid .label,:host([variant=outlined][focused-style]) .invalid-style .label,:host([variant=outlined][focused]) .invalid .label,:host([variant=outlined][focused]) .invalid-style .label{color:rgb(var(--mdui-color-error))}:host([variant=filled][disabled]:not([disabled=false i])) .label,:host([variant=outlined][disabled]:not([disabled=false i])) .label{color:rgba(var(--mdui-color-on-surface),38%)}.input{display:block;width:100%;border:none;outline:0;background:0 0;appearance:none;resize:none;cursor:inherit;font-family:inherit;padding:.875rem .875rem .875rem 0;font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height);color:rgb(var(--mdui-color-on-surface));caret-color:rgb(var(--mdui-color-primary))}.has-action .input,.has-right-icon .input{padding-right:.25rem}.has-suffix .input{padding-right:0}.input.hide-input{opacity:0;height:0;min-height:0;width:0;padding:0!important;overflow:hidden}.input::placeholder{color:rgb(var(--mdui-color-on-surface-variant))}.invalid .input,.invalid-style .input{caret-color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])) .input{color:rgba(var(--mdui-color-on-surface),38%)}:host([end-aligned]:not([end-aligned=false i])) .input{text-align:right}textarea.input{padding-top:0;margin-top:.875rem}:host([variant=filled]) .label+.input{padding-top:1.375rem;padding-bottom:.375rem}:host([variant=filled]) .label+textarea.input{padding-top:0;margin-top:1.375rem}.supporting{display:flex;justify-content:space-between;padding:.25rem 1rem;color:rgb(var(--mdui-color-on-surface-variant))}.supporting.invalid,.supporting.invalid-style{color:rgb(var(--mdui-color-error))}.helper{display:block;opacity:1;transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}:host([disabled]:not([disabled=false i])) .helper{color:rgba(var(--mdui-color-on-surface),38%)}:host([helper-on-focus]:not([helper-on-focus=false i])) .helper{opacity:0}:host([helper-on-focus][focused-style]:not([helper-on-focus=false i])) .helper,:host([helper-on-focus][focused]:not([helper-on-focus=false i])) .helper{opacity:1}.error{font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}.counter{flex-wrap:nowrap;padding-left:1rem;font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}::-ms-reveal{display:none}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;display:none}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}`;let Te=class extends ni(Ue){constructor(){super(...arguments),this.variant="filled",this.type="text",this.name="",this.value="",this.defaultValue="",this.helperOnFocus=!1,this.clearable=!1,this.endAligned=!1,this.readonly=!1,this.disabled=!1,this.required=!1,this.autosize=!1,this.counter=!1,this.togglePassword=!1,this.spellcheck=!1,this.invalid=!1,this.invalidStyle=!1,this.focusedStyle=!1,this.isPasswordVisible=!1,this.hasValue=!1,this.error="",this.inputRef=Ne(),this.formController=new Ki(this),this.hasSlotController=new bt(this,"icon","end-icon","helper","input"),this.readonlyButClearable=!1}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get valueAsNumber(){var e;return((e=this.inputRef.value)==null?void 0:e.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(e){const t=document.createElement("input");t.type="number",t.valueAsNumber=e,this.value=t.value}get focusElement(){return this.inputRef.value}get focusDisabled(){return this.disabled}get isFocusedStyle(){return this.focused||this.focusedStyle}get isTextarea(){return this.rows&&this.rows>1||this.autosize}onDisabledChange(){this.inputRef.value.disabled=this.disabled,this.invalid=!this.inputRef.value.checkValidity()}async onValueChange(){var e;if(this.hasValue=!["",null].includes(this.value),this.hasUpdated){await this.updateComplete,this.setTextareaHeight();const t=this.formController.getForm();t&&((e=ft.get(t))!=null&&e.has(this))?(this.invalid=!1,ft.get(t).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}}onRowsChange(){this.setTextareaHeight()}async onMaxRowsChange(){if(!this.autosize)return;this.hasUpdated||await this.updateComplete;const e=se(this.inputRef.value);e.css("max-height",parseFloat(e.css("line-height"))*(this.maxRows??1)+parseFloat(e.css("padding-top"))+parseFloat(e.css("padding-bottom")))}async onMinRowsChange(){if(!this.autosize)return;this.hasUpdated||await this.updateComplete;const e=se(this.inputRef.value);e.css("min-height",parseFloat(e.css("line-height"))*(this.minRows??1)+parseFloat(e.css("padding-top"))+parseFloat(e.css("padding-bottom")))}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.setTextareaHeight(),this.observeResize=cr(this.inputRef.value,()=>this.setTextareaHeight())})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.observeResize)==null||e.unobserve(),Hs(this)}select(){this.inputRef.value.select()}setSelectionRange(e,t,r="none"){this.inputRef.value.setSelectionRange(e,t,r)}setRangeText(e,t,r,n="preserve"){this.inputRef.value.setRangeText(e,t,r,n),this.value!==this.inputRef.value.value&&(this.value=this.inputRef.value.value,this.setTextareaHeight(),this.emit("input"),this.emit("change"))}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),this.focus()),!this.invalid}setCustomValidity(e){this.setCustomValidityInternal(e),Hs(this)}render(){const e=!!this.icon||this.hasSlotController.test("icon"),t=!!this.endIcon||this.hasSlotController.test("end-icon"),r=this.invalid||this.invalidStyle,n=this.type==="password"&&this.togglePassword&&!this.disabled,s=this.clearable&&!this.disabled&&(!this.readonly||this.readonlyButClearable)&&(typeof this.value=="number"||this.value.length>0),o=!!this.prefix||this.hasSlotController.test("prefix"),a=!!this.suffix||this.hasSlotController.test("suffix"),l=!!this.helper||this.hasSlotController.test("helper"),c=r&&!!(this.error||this.inputRef.value.validationMessage),d=this.counter&&!!this.maxlength,f=this.hasSlotController.test("input"),g={invalid:this.invalid,"invalid-style":this.invalidStyle},y=lt({container:!0,"has-value":this.hasValue,"has-icon":e,"has-right-icon":t||r,"has-action":s||n,"has-prefix":o,"has-suffix":a,"is-firefox":navigator.userAgent.includes("Firefox"),...g});return X`<div part="container" class="${y}">${this.renderPrefix()}<div class="input-container">${this.renderLabel()} ${this.isTextarea?this.renderTextArea(f):this.renderInput(f)} ${Ye(f,()=>X`<slot name="input" class="input"></slot>`)}</div>${this.renderSuffix()}${this.renderClearButton(s)} ${this.renderTogglePasswordButton(n)} ${this.renderRightIcon(r)}</div>${Ye(c||l||d,()=>X`<div part="supporting" class="${lt({supporting:!0,...g})}">${this.renderHelper(c,l)} ${this.renderCounter(d)}</div>`)}`}setCustomValidityInternal(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity(),this.requestUpdate()}onChange(){this.value=this.inputRef.value.value,this.isTextarea&&this.setTextareaHeight(),this.emit("change")}onClear(e){this.value="",this.emit("clear"),this.emit("input"),this.emit("change"),this.focus(),e.stopPropagation()}onInput(e){e.stopPropagation(),this.value=this.inputRef.value.value,this.isTextarea&&this.setTextareaHeight(),this.emit("input")}onInvalid(e){e.preventDefault()}onKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!t&&setTimeout(()=>{e.defaultPrevented||this.formController.submit()})}onTextAreaKeyUp(){if(this.pattern){const e=new RegExp(this.pattern);this.value&&!this.value.match(e)?(this.setCustomValidityInternal(this.getPatternErrorMsg()),Kw(this,()=>{this.setCustomValidityInternal(this.getPatternErrorMsg())})):(this.setCustomValidityInternal(""),Hs(this))}}onTogglePassword(){this.isPasswordVisible=!this.isPasswordVisible}getPatternErrorMsg(){return Hw("Please match the requested format.")}setTextareaHeight(){this.autosize?(this.inputRef.value.style.height="auto",this.inputRef.value.style.height=`${this.inputRef.value.scrollHeight}px`):this.inputRef.value.style.height=void 0}renderLabel(){return this.label?X`<label part="label" class="label">${this.label}</label>`:He}renderPrefix(){return X`<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:He}</slot><slot name="prefix" part="prefix" class="prefix">${this.prefix}</slot>`}renderSuffix(){return X`<slot name="suffix" part="suffix" class="suffix">${this.suffix}</slot>`}renderRightIcon(e){return e?X`<slot name="error-icon" part="error-icon" class="right-icon">${this.errorIcon?X`<mdui-icon name="${this.errorIcon}" class="i"></mdui-icon>`:X`<mdui-icon-error class="i"></mdui-icon-error>`}</slot>`:X`<slot name="end-icon" part="end-icon" class="end-icon right-icon">${this.endIcon?X`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:He}</slot>`}renderClearButton(e){return Ye(e,()=>X`<slot name="clear-button" part="clear-button" class="action" @click="${this.onClear}"><mdui-button-icon tabindex="-1"><slot name="clear-icon" part="clear-icon">${this.clearIcon?X`<mdui-icon name="${this.clearIcon}" class="i"></mdui-icon>`:X`<mdui-icon-cancel--outlined class="i"></mdui-icon-cancel--outlined>`}</slot></mdui-button-icon></slot>`)}renderTogglePasswordButton(e){return Ye(e,()=>X`<slot name="toggle-password-button" part="toggle-password-button" class="action" @click="${this.onTogglePassword}"><mdui-button-icon tabindex="-1">${this.isPasswordVisible?X`<slot name="show-password-icon" part="show-password-icon">${this.showPasswordIcon?X`<mdui-icon name="${this.showPasswordIcon}" class="i"></mdui-icon>`:X`<mdui-icon-visibility-off class="i"></mdui-icon-visibility-off>`}</slot>`:X`<slot name="hide-password-icon" part="hide-password-icon">${this.hidePasswordIcon?X`<mdui-icon name="${this.hidePasswordIcon}" class="i"></mdui-icon>`:X`<mdui-icon-visibility class="i"></mdui-icon-visibility>`}</slot>`}</mdui-button-icon></slot>`)}renderInput(e){return X`<input ${$e(this.inputRef)} part="input" class="input ${lt({"hide-input":e})}" type="${this.type==="password"&&this.isPasswordVisible?"text":this.type}" name="${De(this.name)}" .value="${en(this.value)}" placeholder="${De(!this.label||this.isFocusedStyle||this.hasValue?this.placeholder:void 0)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${De(this.minlength)}" maxlength="${De(this.maxlength)}" min="${De(this.min)}" max="${De(this.max)}" step="${De(this.step)}" autocapitalize="${De(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${this.autocomplete}" autocorrect="${De(this.type==="password"?"off":this.autocorrect)}" spellcheck="${De(this.spellcheck)}" pattern="${De(this.pattern)}" enterkeyhint="${De(this.enterkeyhint)}" inputmode="${De(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}">`}renderTextArea(e){return X`<textarea ${$e(this.inputRef)} part="input" class="input ${lt({"hide-input":e})}" name="${De(this.name)}" .value="${en(this.value)}" placeholder="${De(!this.label||this.isFocusedStyle||this.hasValue?this.placeholder:void 0)}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" ?required="${this.required}" minlength="${De(this.minlength)}" maxlength="${De(this.maxlength)}" rows="${this.rows??1}" autocapitalize="${De(this.autocapitalize)}" autocorrect="${De(this.autocorrect)}" spellcheck="${De(this.spellcheck)}" enterkeyhint="${De(this.enterkeyhint)}" inputmode="${De(this.inputmode)}" @change="${this.onChange}" @input="${this.onInput}" @invalid="${this.onInvalid}" @keydown="${this.onKeyDown}" @keyup="${this.onTextAreaKeyUp}"></textarea>`}renderHelper(e,t){return e?X`<div part="error" class="error">${this.error||this.inputRef.value.validationMessage}</div>`:t?X`<slot name="helper" part="helper" class="helper">${this.helper}</slot>`:X`<span></span>`}renderCounter(e){return e?X`<div part="counter" class="counter">${this.value.length}/${this.maxlength}</div>`:He}};Te.styles=[Me,I1];w([D({reflect:!0})],Te.prototype,"variant",void 0);w([D({reflect:!0})],Te.prototype,"type",void 0);w([D({reflect:!0})],Te.prototype,"name",void 0);w([D()],Te.prototype,"value",void 0);w([ur()],Te.prototype,"defaultValue",void 0);w([D({reflect:!0})],Te.prototype,"label",void 0);w([D({reflect:!0})],Te.prototype,"placeholder",void 0);w([D({reflect:!0})],Te.prototype,"helper",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"helper-on-focus"})],Te.prototype,"helperOnFocus",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"clearable",void 0);w([D({reflect:!0,attribute:"clear-icon"})],Te.prototype,"clearIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"end-aligned"})],Te.prototype,"endAligned",void 0);w([D({reflect:!0})],Te.prototype,"prefix",void 0);w([D({reflect:!0})],Te.prototype,"suffix",void 0);w([D({reflect:!0})],Te.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],Te.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"error-icon"})],Te.prototype,"errorIcon",void 0);w([D({reflect:!0})],Te.prototype,"form",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"readonly",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"required",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"rows",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"autosize",void 0);w([D({type:Number,reflect:!0,attribute:"min-rows"})],Te.prototype,"minRows",void 0);w([D({type:Number,reflect:!0,attribute:"max-rows"})],Te.prototype,"maxRows",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"minlength",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"maxlength",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"counter",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"min",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"max",void 0);w([D({type:Number,reflect:!0})],Te.prototype,"step",void 0);w([D({reflect:!0})],Te.prototype,"pattern",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"toggle-password"})],Te.prototype,"togglePassword",void 0);w([D({reflect:!0,attribute:"show-password-icon"})],Te.prototype,"showPasswordIcon",void 0);w([D({reflect:!0,attribute:"hide-password-icon"})],Te.prototype,"hidePasswordIcon",void 0);w([D({reflect:!0})],Te.prototype,"autocapitalize",void 0);w([D({reflect:!0})],Te.prototype,"autocorrect",void 0);w([D({reflect:!0})],Te.prototype,"autocomplete",void 0);w([D({reflect:!0})],Te.prototype,"enterkeyhint",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Te.prototype,"spellcheck",void 0);w([D({reflect:!0})],Te.prototype,"inputmode",void 0);w([Oe()],Te.prototype,"invalid",void 0);w([Oe()],Te.prototype,"invalidStyle",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"focused-style"})],Te.prototype,"focusedStyle",void 0);w([Oe()],Te.prototype,"isPasswordVisible",void 0);w([Oe()],Te.prototype,"hasValue",void 0);w([Oe()],Te.prototype,"error",void 0);w([Ee("disabled",!0)],Te.prototype,"onDisabledChange",null);w([Ee("value")],Te.prototype,"onValueChange",null);w([Ee("rows",!0)],Te.prototype,"onRowsChange",null);w([Ee("maxRows")],Te.prototype,"onMaxRowsChange",null);w([Ee("minRows")],Te.prototype,"onMinRowsChange",null);Te=w([Re("mdui-text-field")],Te);const R1=Ie`:host{display:inline-block;width:100%}.hidden-input{display:none}.text-field{cursor:pointer}.chips{display:flex;flex-wrap:wrap;margin:-.5rem -.25rem;min-height:2.5rem}:host([variant=filled][label]) .chips{margin:0 -.25rem -1rem -.25rem}.chip{margin:.25rem}mdui-menu{max-width:none}`;let Xe=class extends ni(Ue){constructor(){super(...arguments),this.variant="filled",this.multiple=!1,this.name="",this.value="",this.defaultValue="",this.clearable=!1,this.placement="auto",this.endAligned=!1,this.readonly=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.menuRef=Ne(),this.textFieldRef=Ne(),this.hiddenInputRef=Ne(),this.formController=new Ki(this),this.hasSlotController=new bt(this,"icon","end-icon","error-icon","prefix","suffix","clear-button","clear-icon","helper"),this.definedController=new vt(this,{relatedElements:["mdui-menu-item"]})}get validity(){return this.hiddenInputRef.value.validity}get validationMessage(){return this.hiddenInputRef.value.validationMessage}get focusElement(){return this.textFieldRef.value}get focusDisabled(){return this.disabled}connectedCallback(){super.connectedCallback(),this.value=this.multiple&&ut(this.value)?this.value?[this.value]:[]:this.value,this.defaultValue=this.multiple?[]:"",this.definedController.whenDefined().then(()=>{this.requestUpdate()}),this.updateComplete.then(()=>{this.observeResize=cr(this.textFieldRef.value,()=>this.resizeMenu())})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.observeResize)==null||e.unobserve()}checkValidity(){const e=this.hiddenInputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.hiddenInputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),this.focus()),!this.invalid}setCustomValidity(e){this.hiddenInputRef.value.setCustomValidity(e),this.invalid=!this.hiddenInputRef.value.checkValidity()}render(){var t;const e=this.multiple?!!this.value.length:!!this.value;return X`${this.multiple?X`<select ${$e(this.hiddenInputRef)} class="hidden-input" name="${De(this.name)}" value="${De(this.value)}" .required="${this.required}" .disabled="${this.disabled}" multiple="multiple" tabindex="-1">${Vr(this.value,r=>X`<option selected="selected" value="${r}"></option>`)}</select>`:X`<input ${$e(this.hiddenInputRef)} type="radio" class="hidden-input" name="${De(this.name)}" value="${De(this.value)}" .required="${this.required}" .disabled="${this.disabled}" .checked="${e}" tabindex="-1">`}<mdui-dropdown .stayOpenOnClick="${this.multiple}" .disabled="${this.readonly||this.disabled}" .placement="${this.placement==="top"?"top-start":this.placement==="bottom"?"bottom-start":"auto"}" @open="${this.onDropdownOpen}" @close="${this.onDropdownClose}"><mdui-text-field ${$e(this.textFieldRef)} slot="trigger" part="text-field" class="text-field" exportparts="${["container","icon","end-icon","error-icon","prefix","suffix","label","input","clear-button","clear-icon","supporting","helper","error"].map(r=>`${r}:text-field__${r}`).join(",")}" readonly="readonly" .readonlyButClearable="${!0}" .variant="${this.variant}" .name="${this.name}" .value="${this.multiple?this.value.length?" ":"":this.getMenuItemLabelByValue(this.value)}" .label="${this.label}" .placeholder="${this.placeholder}" .helper="${this.helper}" .error="${(t=this.hiddenInputRef.value)==null?void 0:t.validationMessage}" .clearable="${this.clearable}" .clearIcon="${this.clearIcon}" .endAligned="${this.endAligned}" .prefix="${this.prefix}" .suffix="${this.suffix}" .icon="${this.icon}" .endIcon="${this.endIcon}" .errorIcon="${this.errorIcon}" .form="${this.form}" .disabled="${this.disabled}" .required="${this.required}" .invalidStyle="${this.invalid}" @clear="${this.onClear}" @change="${r=>r.stopPropagation()}" @keydown="${this.onTextFieldKeyDown}">${Vr(["icon","end-icon","error-icon","prefix","suffix","clear-button","clear-icon","helper"],r=>this.hasSlotController.test(r)?X`<slot name="${r}" slot="${r}"></slot>`:Ge)} ${Ye(this.multiple&&this.value.length,()=>X`<div slot="input" class="chips" part="chips">${Vr(this.value,r=>X`<mdui-chip class="chip" part="chip" exportparts="${["button","label","delete-icon"].map(n=>`${n}:chip__${n}`).join(",")}" variant="input" deletable tabindex="-1" @delete="${()=>this.onDeleteOneValue(r)}">${this.getMenuItemLabelByValue(r)}</mdui-chip>`)}</div>`)}</mdui-text-field><mdui-menu ${$e(this.menuRef)} part="menu" .selects="${this.multiple?"multiple":"single"}" .value="${this.value}" @change="${this.onValueChange}"><slot></slot></mdui-menu></mdui-dropdown>`}getMenuItemLabelByValue(e){var t,r;return this.menuItems.length&&((r=(t=this.menuItems.find(n=>n.value===e))==null?void 0:t.textContent)==null?void 0:r.trim())||e}resizeMenu(){this.menuRef.value.style.width=`${this.textFieldRef.value.clientWidth}px`}async onDropdownOpen(){this.textFieldRef.value.focusedStyle=!0}onDropdownClose(){var e;this.textFieldRef.value.focusedStyle=!1,(this.contains(document.activeElement)||this.contains(((e=document.activeElement)==null?void 0:e.assignedSlot)??null))&&setTimeout(()=>{this.focus()})}async onValueChange(e){var n;const t=e.target;this.value=this.multiple?t.value.map(s=>s??""):t.value??"",await this.updateComplete;const r=this.formController.getForm();r&&((n=ft.get(r))!=null&&n.has(this))?(this.invalid=!1,ft.get(r).delete(this)):this.invalid=!this.hiddenInputRef.value.checkValidity()}onDeleteOneValue(e){const t=[...this.value];t.includes(e)&&t.splice(t.indexOf(e),1),this.value=t}onClear(){this.value=this.multiple?[]:""}onTextFieldKeyDown(e){e.key==="Enter"&&(e.preventDefault(),this.textFieldRef.value.click())}};Xe.styles=[Me,R1];w([D({reflect:!0})],Xe.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Xe.prototype,"multiple",void 0);w([D({reflect:!0})],Xe.prototype,"name",void 0);w([D()],Xe.prototype,"value",void 0);w([ur()],Xe.prototype,"defaultValue",void 0);w([D({reflect:!0})],Xe.prototype,"label",void 0);w([D({reflect:!0})],Xe.prototype,"placeholder",void 0);w([D({reflect:!0})],Xe.prototype,"helper",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Xe.prototype,"clearable",void 0);w([D({reflect:!0,attribute:"clear-icon"})],Xe.prototype,"clearIcon",void 0);w([D({reflect:!0})],Xe.prototype,"placement",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"end-aligned"})],Xe.prototype,"endAligned",void 0);w([D({reflect:!0})],Xe.prototype,"prefix",void 0);w([D({reflect:!0})],Xe.prototype,"suffix",void 0);w([D({reflect:!0})],Xe.prototype,"icon",void 0);w([D({reflect:!0,attribute:"end-icon"})],Xe.prototype,"endIcon",void 0);w([D({reflect:!0,attribute:"error-icon"})],Xe.prototype,"errorIcon",void 0);w([D({reflect:!0})],Xe.prototype,"form",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Xe.prototype,"readonly",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Xe.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Xe.prototype,"required",void 0);w([Oe()],Xe.prototype,"invalid",void 0);w([ri({flatten:!0,selector:"mdui-menu-item"})],Xe.prototype,"menuItems",void 0);Xe=w([Re("mdui-select")],Xe);const T1=Ie`.track-active{left:-.125rem;border-radius:var(--mdui-shape-corner-full) 0 0 var(--mdui-shape-corner-full)}`;let sn=class extends St{constructor(){super(...arguments),this.value=0,this.defaultValue=0,this.rippleRef=Ne(),this.handleRef=Ne(),this.formController=new Ki(this)}get rippleElement(){return this.rippleRef.value}async onValueChange(){var t;this.value=this.fixValue(this.value);const e=this.formController.getForm();e&&((t=ft.get(e))!=null&&t.has(this))?(this.invalid=!1,ft.get(e).delete(this)):(await this.updateComplete,this.invalid=!this.inputRef.value.checkValidity()),this.updateStyle()}connectedCallback(){super.connectedCallback(),this.value=this.fixValue(this.value)}firstUpdated(e){super.firstUpdated(e);const t=()=>{this.disabled||(this.labelVisible=!0)},r=()=>{this.disabled||(this.labelVisible=!1)};this.addEventListener("touchstart",t),this.addEventListener("mousedown",t),this.addEventListener("touchend",r),this.addEventListener("mouseup",r),this.updateStyle()}render(){return X`<label class="${lt({invalid:this.invalid})}"><input ${$e(this.inputRef)} type="range" step="${this.step}" min="${this.min}" max="${this.max}" ?disabled="${this.disabled}" .value="${en(this.value.toString())}" @input="${this.onInput}" @change="${this.onChange}"><div part="track-inactive" class="track-inactive"></div><div ${$e(this.trackActiveRef)} part="track-active" class="track-active"></div><div ${$e(this.handleRef)} part="handle" class="handle"><div class="elevation"></div><mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.renderLabel(this.value)}</div>${Ye(this.tickmarks,()=>Vr(this.getCandidateValues(),e=>X`<div part="tickmark" class="tickmark ${lt({active:e<this.value})}" style="${xr({left:`${(e-this.min)/this.max*100}%`,display:e===this.value?"none":"block"})}"></div>`))}</label>`}updateStyle(){const e=(this.value-this.min)/(this.max-this.min)*100;this.trackActiveRef.value.style.width=`${e}%`,this.handleRef.value.style.left=`${e}%`}onInput(){this.value=parseFloat(this.inputRef.value.value),this.updateStyle()}};sn.styles=[St.styles,T1];w([D({type:Number})],sn.prototype,"value",void 0);w([ur()],sn.prototype,"defaultValue",void 0);w([Ee("value",!0)],sn.prototype,"onValueChange",null);sn=w([Re("mdui-slider")],sn);const $1=Ie`:host{--shape-corner:var(--mdui-shape-corner-extra-small);--z-index:2400;position:fixed;z-index:var(--z-index);display:none;align-items:center;flex-wrap:wrap;border-radius:var(--shape-corner);transform:scaleY(0);transition:transform 0s var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short4);min-width:20rem;max-width:36rem;padding:.25rem 0;box-shadow:var(--mdui-elevation-level3);background-color:rgb(var(--mdui-color-inverse-surface));color:rgb(var(--mdui-color-inverse-on-surface));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([placement^=top]){transform-origin:top}:host([placement^=bottom]){transform-origin:bottom}:host([placement=bottom-start]:not([mobile])),:host([placement=top-start]:not([mobile])){left:1rem}:host([placement=bottom-end]:not([mobile])),:host([placement=top-end]:not([mobile])){right:1rem}:host([placement=bottom]:not([mobile])),:host([placement=top]:not([mobile])){left:50%;transform:scaleY(0) translateX(-50%)}:host([mobile]){min-width:0;left:1rem;right:1rem}:host([open]){transform:scaleY(1);transition:top var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard),bottom var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard),transform var(--mdui-motion-duration-medium4) var(--mdui-motion-easing-emphasized-decelerate)}:host([placement=bottom][open]:not([mobile])),:host([placement=top][open]:not([mobile])){transform:scaleY(1) translateX(-50%)}.message{display:block;margin:.625rem 1rem}:host([message-line='1']) .message{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([message-line='2']) .message{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2}.action-group{display:flex;align-items:center;margin-left:auto;padding-right:.5rem}.action,.close-button{display:inline-flex;align-items:center;justify-content:center}.action{color:rgb(var(--mdui-color-inverse-primary));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking)}.action mdui-button,::slotted(mdui-button[slot=action][variant=outlined]),::slotted(mdui-button[slot=action][variant=text]){color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-primary)}.action mdui-button::part(button){padding:0 .5rem}.close-button{margin:0 -.25rem 0 .25rem;font-size:1.5rem;color:rgb(var(--mdui-color-inverse-on-surface))}.close-button mdui-button-icon,::slotted(mdui-button-icon[slot=close-button][variant=outlined]),::slotted(mdui-button-icon[slot=close-button][variant=standard]){font-size:inherit;color:inherit;--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}.close-button .i,::slotted([slot=close-icon]){font-size:inherit}`,_i=[];let Sl=!1,Ot=class extends Ue{constructor(){super(),this.open=!1,this.placement="bottom",this.actionLoading=!1,this.closeable=!1,this.autoCloseDelay=5e3,this.closeOnOutsideClick=!1,this.mobile=!1,this.onDocumentClick=this.onDocumentClick.bind(this)}async onOpenChange(){const e=Vt(this,"linear"),t=Array.from(this.renderRoot.querySelectorAll(".message, .action-group"));if(this.open){const r=this.hasUpdated;if(r||await this.updateComplete,r&&!this.emit("open",{cancelable:!0}))return;window.clearTimeout(this.closeTimeout),this.autoCloseDelay&&(this.closeTimeout=window.setTimeout(()=>{this.open=!1},this.autoCloseDelay)),this.style.display="flex",await Promise.all([qt(this),...t.map(s=>qt(s))]),_i.push({height:this.clientHeight,snackbar:this}),await this.reorderStack(this);const n=gi(this,"medium4");await Promise.all([Je(this,[{opacity:0},{opacity:1,offset:.5},{opacity:1}],{duration:r?n:0,easing:e,fill:"forwards"}),...t.map(s=>Je(s,[{opacity:0},{opacity:0,offset:.2},{opacity:1,offset:.8},{opacity:1}],{duration:r?n:0,easing:e}))]),r&&this.emit("opened");return}if(!this.open&&this.hasUpdated){if(!this.emit("close",{cancelable:!0}))return;window.clearTimeout(this.closeTimeout),await Promise.all([qt(this),...t.map(o=>qt(o))]);const n=gi(this,"short4");await Promise.all([Je(this,[{opacity:1},{opacity:0}],{duration:n,easing:e,fill:"forwards"}),...t.map(o=>Je(o,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:n,easing:e}))]),this.style.display="none",this.emit("closed");const s=_i.findIndex(o=>o.snackbar===this);_i.splice(s,1),_i[s]&&await this.reorderStack(_i[s].snackbar);return}}async onStackChange(){await this.reorderStack(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),this.mobile=Zl().down("sm"),this.observeResize=cr(document.documentElement,async()=>{const e=Zl().down("sm");this.mobile!==e&&(this.mobile=e,Sl||(Sl=!0,await this.reorderStack(),Sl=!1))})}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),window.clearTimeout(this.closeTimeout),this.open&&(this.open=!1),(e=this.observeResize)==null||e.unobserve()}render(){return X`<slot part="message" class="message"></slot><div class="action-group"><slot name="action" part="action" class="action" @click="${this.onActionClick}">${this.action?X`<mdui-button variant="text" loading="${this.actionLoading}">${this.action}</mdui-button>`:He}</slot>${Ye(this.closeable,()=>X`<slot name="close-button" part="close-button" class="close-button" @click="${this.onCloseClick}"><mdui-button-icon><slot name="close-icon" part="close-icon">${this.closeIcon?X`<mdui-icon name="${this.closeIcon}" class="i"></mdui-icon>`:X`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot></mdui-button-icon></slot>`)}</div>`}async reorderStack(e){const t=e?_i.findIndex(r=>r.snackbar===e):0;for(let r=t;r<_i.length;r++){const s=_i[r].snackbar;this.mobile?["top","bottom"].forEach(o=>{if(s.placement.startsWith(o)){const a=_i.filter((c,d)=>d<r&&c.snackbar.placement.startsWith(o)),l=a.reduce((c,d)=>c+d.height,0);s.style[o]=`calc(${l}px + ${a.length+1}rem)`,s.style[o==="top"?"bottom":"top"]="auto"}}):["top","top-start","top-end","bottom","bottom-start","bottom-end"].forEach(o=>{if(s.placement===o){const a=_i.filter((c,d)=>d<r&&c.snackbar.placement===o),l=a.reduce((c,d)=>c+d.height,0);s.style[o.startsWith("top")?"top":"bottom"]=`calc(${l}px + ${a.length+1}rem)`,s.style[o.startsWith("top")?"bottom":"top"]="auto"}})}}onDocumentClick(e){if(!this.open||!this.closeOnOutsideClick)return;const t=e.target;!this.contains(t)&&this!==t&&(this.open=!1)}onActionClick(e){e.stopPropagation(),this.emit("action-click")}onCloseClick(){this.open=!1}};Ot.styles=[Me,$1];w([D({type:Boolean,reflect:!0,converter:me})],Ot.prototype,"open",void 0);w([D({reflect:!0})],Ot.prototype,"placement",void 0);w([D({reflect:!0,attribute:"action"})],Ot.prototype,"action",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"action-loading"})],Ot.prototype,"actionLoading",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ot.prototype,"closeable",void 0);w([D({reflect:!0,attribute:"close-icon"})],Ot.prototype,"closeIcon",void 0);w([D({type:Number,reflect:!0,attribute:"message-line"})],Ot.prototype,"messageLine",void 0);w([D({type:Number,reflect:!0,attribute:"auto-close-delay"})],Ot.prototype,"autoCloseDelay",void 0);w([D({type:Boolean,reflect:!0,attribute:"close-on-outside-click",converter:me})],Ot.prototype,"closeOnOutsideClick",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Ot.prototype,"mobile",void 0);w([Ee("open")],Ot.prototype,"onOpenChange",null);w([Ee("placement",!0),Ee("messageLine",!0)],Ot.prototype,"onStackChange",null);Ot=w([Re("mdui-snackbar")],Ot);const C1=Ie`:host{--shape-corner:var(--mdui-shape-corner-full);--shape-corner-thumb:var(--mdui-shape-corner-full);position:relative;display:inline-block;cursor:pointer;-webkit-tap-highlight-color:transparent;height:2.5rem}:host([disabled]:not([disabled=false i])){cursor:default;pointer-events:none}label{display:inline-flex;align-items:center;width:100%;height:100%;white-space:nowrap;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}.track{position:relative;display:flex;align-items:center;border-radius:var(--shape-corner);transition-property:background-color,border-width;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);height:2rem;width:3.25rem;border:.125rem solid rgb(var(--mdui-color-outline));background-color:rgb(var(--mdui-color-surface-container-highest))}:host([checked]:not([checked=false i])) .track{background-color:rgb(var(--mdui-color-primary));border-width:0}.invalid .track{background-color:rgb(var(--mdui-color-error-container));border-color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])) .track{background-color:rgba(var(--mdui-color-surface-container-highest),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled][checked]:not([disabled=false i],[checked=false i])) .track{background-color:rgba(var(--mdui-color-on-surface),.12)}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.25rem;height:1.25rem;margin:0 0 0 .625rem}mdui-ripple{border-radius:50%;transition-property:left,top;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);width:2.5rem;height:2.5rem}.thumb{position:absolute;display:flex;align-items:center;justify-content:center;border-radius:var(--shape-corner-thumb);transition-property:width,height,left,background-color;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard);height:1rem;width:1rem;left:.375rem;background-color:rgb(var(--mdui-color-outline));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.thumb mdui-ripple{left:-.75rem;top:-.75rem}.has-unchecked-icon .thumb{height:1.5rem;width:1.5rem;left:.125rem}.has-unchecked-icon .thumb mdui-ripple{left:-.5rem;top:-.5rem}:host([focus-visible]) .thumb,:host([hover]) .thumb,:host([pressed]) .thumb{background-color:rgb(var(--mdui-color-on-surface-variant))}:host([checked]:not([checked=false i])) .thumb{height:1.5rem;width:1.5rem;left:1.5rem;background-color:rgb(var(--mdui-color-on-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]:not([checked=false i])) .thumb mdui-ripple{left:-.5rem;top:-.5rem}:host([pressed]) .thumb{height:1.75rem;width:1.75rem;left:0}:host([pressed]) .thumb mdui-ripple{left:-.375rem;top:-.375rem}:host([pressed][checked]:not([checked=false i])) .thumb{left:1.375rem}:host([focus-visible][checked]:not([checked=false i])) .thumb,:host([hover][checked]:not([checked=false i])) .thumb,:host([pressed][checked]:not([checked=false i])) .thumb{background-color:rgb(var(--mdui-color-primary-container))}.invalid .thumb{background-color:rgb(var(--mdui-color-error));--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}:host([focus-visible]) .invalid .thumb,:host([hover]) .invalid .thumb,:host([pressed]) .invalid .thumb{background-color:rgb(var(--mdui-color-error))}:host([disabled]:not([disabled=false i])) .thumb{background-color:rgba(var(--mdui-color-on-surface),.38)}:host([disabled][checked]:not([disabled=false i],[checked=false i])) .thumb{background-color:rgb(var(--mdui-color-surface))}.checked-icon,.unchecked-icon{display:flex;position:absolute;transition-property:opacity,transform;font-size:1rem}.unchecked-icon{opacity:1;transform:scale(1);transition-delay:var(--mdui-motion-duration-short1);transition-duration:var(--mdui-motion-duration-short3);transition-timing-function:var(--mdui-motion-easing-linear);color:rgb(var(--mdui-color-surface-container-highest))}:host([checked]:not([checked=false i])) .unchecked-icon{opacity:0;transform:scale(.92);transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1)}:host([disabled]:not([disabled=false i])) .unchecked-icon{color:rgba(var(--mdui-color-surface-container-highest),.38)}.checked-icon{opacity:0;transform:scale(.92);transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1);transition-timing-function:var(--mdui-motion-easing-linear);color:rgb(var(--mdui-color-on-primary-container))}:host([checked]:not([checked=false i])) .checked-icon{opacity:1;transform:scale(1);transition-delay:var(--mdui-motion-duration-short1);transition-duration:var(--mdui-motion-duration-short3)}.invalid .checked-icon{color:rgb(var(--mdui-color-error-container))}:host([disabled]:not([disabled=false i])) .checked-icon{color:rgba(var(--mdui-color-on-surface),.38)}.checked-icon .i,.unchecked-icon .i,::slotted([slot=checked-icon]),::slotted([slot=unchecked-icon]){font-size:inherit;color:inherit}`;let Mt=class extends vi(ni(Ue)){constructor(){super(...arguments),this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.required=!1,this.name="",this.value="on",this.invalid=!1,this.rippleRef=Ne(),this.inputRef=Ne(),this.formController=new Ki(this,{value:e=>e.checked?e.value:void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.hasSlotController=new bt(this,"unchecked-icon")}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){return this.inputRef.value}get focusDisabled(){return this.disabled}async onDisabledChange(){await this.updateComplete,this.invalid=!this.inputRef.value.checkValidity()}async onCheckedChange(){var t;await this.updateComplete;const e=this.formController.getForm();e&&((t=ft.get(e))!=null&&t.has(this))?(this.invalid=!1,ft.get(e).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}checkValidity(){const e=this.inputRef.value.checkValidity();return e||this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){return this.invalid=!this.inputRef.value.reportValidity(),this.invalid&&(this.emit("invalid",{bubbles:!1,cancelable:!0,composed:!1})||(this.blur(),this.focus())),!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}render(){return X`<label class="${lt({invalid:this.invalid,"has-unchecked-icon":this.uncheckedIcon||this.hasSlotController.test("unchecked-icon")})}"><input ${$e(this.inputRef)} type="checkbox" name="${De(this.name)}" value="${De(this.value)}" .disabled="${this.disabled}" .checked="${en(this.checked)}" .required="${this.required}" @change="${this.onChange}"><div part="track" class="track"><div part="thumb" class="thumb"><mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="checked-icon" part="checked-icon" class="checked-icon">${this.checkedIcon?X`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:this.checkedIcon===""?He:X`<mdui-icon-check class="i"></mdui-icon-check>`}</slot><slot name="unchecked-icon" part="unchecked-icon" class="unchecked-icon">${this.uncheckedIcon?X`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:He}</slot></div></div></label>`}onChange(){this.checked=this.inputRef.value.checked,this.emit("change")}};Mt.styles=[Me,C1];w([D({type:Boolean,reflect:!0,converter:me})],Mt.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Mt.prototype,"checked",void 0);w([ur("checked")],Mt.prototype,"defaultChecked",void 0);w([D({reflect:!0,attribute:"unchecked-icon"})],Mt.prototype,"uncheckedIcon",void 0);w([D({reflect:!0,attribute:"checked-icon"})],Mt.prototype,"checkedIcon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Mt.prototype,"required",void 0);w([D({reflect:!0})],Mt.prototype,"form",void 0);w([D({reflect:!0})],Mt.prototype,"name",void 0);w([D({reflect:!0})],Mt.prototype,"value",void 0);w([Oe()],Mt.prototype,"invalid",void 0);w([Ee("disabled",!0),Ee("required",!0)],Mt.prototype,"onDisabledChange",null);w([Ee("checked",!0)],Mt.prototype,"onCheckedChange",null);Mt=w([Re("mdui-switch")],Mt);const A1=Ie`:host{position:relative;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}.container{display:flex;justify-content:center;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:100%}.preset{flex-direction:column;min-height:3rem;padding:.625rem 1rem}:host([inline]:not([inline=false i])) .preset{flex-direction:row}.icon-container,.label-container{position:relative;display:flex;align-items:center;justify-content:center}.icon-container ::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}.icon-container ::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.label-container ::slotted([slot=badge]){position:absolute;left:100%;bottom:100%;transform:translate(-.75rem,.625rem)}.label-container ::slotted([slot=badge][variant=small]){transform:translate(-.375rem,.375rem)}.icon,.label{display:flex;color:rgb(var(--mdui-color-on-surface-variant))}:host([focused]) .icon,:host([focused]) .label,:host([hover]) .icon,:host([hover]) .label,:host([pressed]) .icon,:host([pressed]) .label{color:rgb(var(--mdui-color-on-surface))}:host([active]) .icon,:host([active]) .label{color:rgb(var(--mdui-color-primary))}:host([active]) .variant-secondary .icon,:host([active]) .variant-secondary .label{color:rgb(var(--mdui-color-on-surface))}.icon{font-size:1.5rem}.label{font-size:var(--mdui-typescale-title-small-size);font-weight:var(--mdui-typescale-title-small-weight);letter-spacing:var(--mdui-typescale-title-small-tracking);line-height:var(--mdui-typescale-title-small-line-height)}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit;color:inherit}`;let nr=class extends vi(ni(Ue)){constructor(){super(...arguments),this.inline=!1,this.active=!1,this.variant="primary",this.key=lr(),this.rippleRef=Ne(),this.hasSlotController=new bt(this,"icon","custom")}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return!1}get focusElement(){return this}get focusDisabled(){return!1}render(){const e=this.icon||this.hasSlotController.test("icon"),t=this.hasSlotController.test("custom"),r=()=>X`<slot name="badge"></slot>`;return X`<mdui-ripple ${$e(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><div part="container" class="${lt({container:!0,preset:!t,"variant-secondary":this.variant==="secondary"})}"><slot name="custom"><div class="icon-container">${Ye(e||this.icon,r)}<slot name="icon" part="icon" class="icon">${this.icon?X`<mdui-icon name="${this.icon}"></mdui-icon>`:He}</slot></div><div class="label-container">${Ye(!e,r)}<slot part="label" class="label"></slot></div></slot></div>`}};nr.styles=[Me,A1];w([D({reflect:!0})],nr.prototype,"value",void 0);w([D({reflect:!0})],nr.prototype,"icon",void 0);w([D({type:Boolean,reflect:!0,converter:me})],nr.prototype,"inline",void 0);w([D({type:Boolean,reflect:!0,converter:me})],nr.prototype,"active",void 0);w([Oe()],nr.prototype,"variant",void 0);nr=w([Re("mdui-tab")],nr);const N1=Ie`:host{display:block;overflow-y:auto;flex:1 1 auto}:host(:not([active])){display:none}`;let us=class extends Ue{constructor(){super(...arguments),this.active=!1}render(){return X`<slot></slot>`}};us.styles=[Me,N1];w([D({reflect:!0})],us.prototype,"value",void 0);w([D({type:Boolean,reflect:!0,converter:me})],us.prototype,"active",void 0);us=w([Re("mdui-tab-panel")],us);const L1=Ie`:host{position:relative;display:flex}:host([placement^=top]){flex-direction:column}:host([placement^=bottom]){flex-direction:column-reverse}:host([placement^=left]){flex-direction:row}:host([placement^=right]){flex-direction:row-reverse}.container{position:relative;display:flex;flex:0 0 auto;overflow-x:auto;background-color:rgb(var(--mdui-color-surface))}:host([placement^=bottom]) .container,:host([placement^=top]) .container{flex-direction:row}:host([placement^=left]) .container,:host([placement^=right]) .container{flex-direction:column}:host([placement$='-start']) .container{justify-content:flex-start}:host([placement=bottom]) .container,:host([placement=left]) .container,:host([placement=right]) .container,:host([placement=top]) .container{justify-content:center}:host([placement$='-end']) .container{justify-content:flex-end}.container::after{content:' ';position:absolute;background-color:rgb(var(--mdui-color-surface-variant))}:host([placement^=bottom]) .container::after,:host([placement^=top]) .container::after{left:0;width:100%;height:.0625rem}:host([placement^=top]) .container::after{bottom:0}:host([placement^=bottom]) .container::after{top:0}:host([placement^=left]) .container::after,:host([placement^=right]) .container::after{top:0;height:100%;width:.0625rem}:host([placement^=left]) .container::after{right:0}:host([placement^=right]) .container::after{left:0}.indicator{position:absolute;z-index:1;background-color:rgb(var(--mdui-color-primary))}.container:not(.initial) .indicator{transition-duration:var(--mdui-motion-duration-medium2);transition-timing-function:var(--mdui-motion-easing-standard-decelerate)}:host([placement^=bottom]) .indicator,:host([placement^=top]) .indicator{transition-property:transform,left,width}:host([placement^=left]) .indicator,:host([placement^=right]) .indicator{transition-property:transform,top,height}:host([placement^=top]) .indicator{bottom:0}:host([placement^=bottom]) .indicator{top:0}:host([placement^=left]) .indicator{right:0}:host([placement^=right]) .indicator{left:0}:host([placement^=bottom][variant=primary]) .indicator,:host([placement^=top][variant=primary]) .indicator{height:.1875rem}:host([placement^=bottom][variant=secondary]) .indicator,:host([placement^=top][variant=secondary]) .indicator{height:.125rem}:host([placement^=left][variant=primary]) .indicator,:host([placement^=right][variant=primary]) .indicator{width:.1875rem}:host([placement^=left][variant=secondary]) .indicator,:host([placement^=right][variant=secondary]) .indicator{width:.125rem}:host([placement^=top][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-top-right-radius:.1875rem}:host([placement^=bottom][variant=primary]) .indicator{border-bottom-right-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=left][variant=primary]) .indicator{border-top-left-radius:.1875rem;border-bottom-left-radius:.1875rem}:host([placement^=right][variant=primary]) .indicator{border-top-right-radius:.1875rem;border-bottom-right-radius:.1875rem}:host([full-width]:not([full-width=false i])) ::slotted(mdui-tab){flex:1}`;let Gt=class extends Ue{constructor(){super(...arguments),this.variant="primary",this.placement="top-start",this.fullWidth=!1,this.activeKey=0,this.isInitial=!0,this.containerRef=Ne(),this.indicatorRef=Ne(),this.definedController=new vt(this,{relatedElements:["mdui-tab","mdui-tab-panel"]})}async onActiveKeyChange(){var e;await this.definedController.whenDefined(),this.value=(e=this.tabs.find(t=>t.key===this.activeKey))==null?void 0:e.value,this.updateActive(),this.isInitial||this.emit("change")}async onValueChange(){this.isInitial=!this.hasUpdated,await this.definedController.whenDefined();const e=this.tabs.find(t=>t.value===this.value);this.activeKey=(e==null?void 0:e.key)??0}async onIndicatorChange(){await this.updateComplete,this.updateIndicator()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.observeResize=cr(this.containerRef.value,()=>this.updateIndicator())})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.observeResize)==null||e.unobserve()}render(){return X`<div ${$e(this.containerRef)} part="container" class="container ${lt({initial:this.isInitial})}"><slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><div ${$e(this.indicatorRef)} part="indicator" class="indicator"></div></div><slot name="panel" @slotchange="${this.onSlotChange}"></slot>`}async onSlotChange(){await this.definedController.whenDefined(),this.updateActive()}async onClick(e){if(e.button)return;await this.definedController.whenDefined();const r=e.target.closest("mdui-tab");r&&(this.activeKey=r.key,this.isInitial=!1,this.updateActive())}updateActive(){this.activeTab=this.tabs.map(e=>(e.active=this.activeKey===e.key,e)).find(e=>e.active),this.panels.forEach(e=>{var t;return e.active=e.value===((t=this.activeTab)==null?void 0:t.value)}),this.updateIndicator()}updateIndicator(){const e=this.activeTab,t=se(this.indicatorRef.value),r=this.placement.startsWith("left")||this.placement.startsWith("right");if(!e){t.css({transform:r?"scaleY(0)":"scaleX(0)"});return}const n=se(e),s=e.offsetTop,o=e.offsetLeft,a=r?{transform:"scaleY(1)",width:"",left:""}:{transform:"scaleX(1)",height:"",top:""};let l={};if(this.variant==="primary"){const c=n.find(':scope > [slot="custom"]'),d=c.length?c.get():se(e.renderRoot).find('slot[name="custom"]').children().get();if(r){const f=Math.min(...d.map(y=>y.offsetTop))+s,g=Math.max(...d.map(y=>y.offsetTop+y.offsetHeight))+s;l={top:f,height:g-f}}else{const f=Math.min(...d.map(y=>y.offsetLeft))+o,g=Math.max(...d.map(y=>y.offsetLeft+y.offsetWidth))+o;l={left:f,width:g-f}}}this.variant==="secondary"&&(l=r?{top:s,height:e.offsetHeight}:{left:o,width:e.offsetWidth}),t.css({...a,...l})}};Gt.styles=[Me,L1];w([D({reflect:!0})],Gt.prototype,"variant",void 0);w([D({reflect:!0})],Gt.prototype,"value",void 0);w([D({reflect:!0})],Gt.prototype,"placement",void 0);w([D({type:Boolean,reflect:!0,converter:me,attribute:"full-width"})],Gt.prototype,"fullWidth",void 0);w([Oe()],Gt.prototype,"activeKey",void 0);w([Oe()],Gt.prototype,"isInitial",void 0);w([ri({selector:"mdui-tab",flatten:!0})],Gt.prototype,"tabs",void 0);w([ri({selector:"mdui-tab-panel",slot:"panel",flatten:!0})],Gt.prototype,"panels",void 0);w([Ee("activeKey",!0)],Gt.prototype,"onActiveKeyChange",null);w([Ee("value")],Gt.prototype,"onValueChange",null);w([Ee("variant",!0),Ee("placement",!0),Ee("fullWidth",!0)],Gt.prototype,"onIndicatorChange",null);Gt=w([Re("mdui-tabs")],Gt);class D1{constructor(e,t){this.isHover=!1,this.uniqueID=lr(),this.enterEventName=`mouseenter.${this.uniqueID}.hoverController`,this.leaveEventName=`mouseleave.${this.uniqueID}.hoverController`,this.mouseEnterItems=[],this.mouseLeaveItems=[],(this.host=e).addController(this),this.elementRef=t}hostConnected(){this.host.updateComplete.then(()=>{se(this.elementRef.value).on(this.enterEventName,()=>{this.isHover=!0;for(let e=this.mouseEnterItems.length-1;e>=0;e--){const t=this.mouseEnterItems[e];t.callback(),t.one&&this.mouseEnterItems.splice(e,1)}}).on(this.leaveEventName,()=>{this.isHover=!1;for(let e=this.mouseLeaveItems.length-1;e>=0;e--){const t=this.mouseLeaveItems[e];t.callback(),t.one&&this.mouseLeaveItems.splice(e,1)}})})}hostDisconnected(){se(this.elementRef.value).off(this.enterEventName).off(this.leaveEventName)}onMouseEnter(e,t=!1){this.mouseEnterItems.push({callback:e,one:t})}onMouseLeave(e,t=!1){this.mouseLeaveItems.push({callback:e,one:t})}}const O1=Ie`:host{--shape-corner-plain:var(--mdui-shape-corner-extra-small);--shape-corner-rich:var(--mdui-shape-corner-medium);--z-index:2500;display:contents}.popup{position:fixed;display:flex;flex-direction:column;z-index:var(--z-index);border-radius:var(--shape-corner-plain);background-color:rgb(var(--mdui-color-inverse-surface));padding:0 .5rem;min-width:1.75rem;max-width:20rem}:host([variant=rich]) .popup{border-radius:var(--shape-corner-rich);background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2);padding:.75rem 1rem .5rem 1rem}.headline{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-title-small-size);font-weight:var(--mdui-typescale-title-small-weight);letter-spacing:var(--mdui-typescale-title-small-tracking);line-height:var(--mdui-typescale-title-small-line-height)}.content{display:flex;padding:.25rem 0;color:rgb(var(--mdui-color-inverse-on-surface));font-size:var(--mdui-typescale-body-small-size);font-weight:var(--mdui-typescale-body-small-weight);letter-spacing:var(--mdui-typescale-body-small-tracking);line-height:var(--mdui-typescale-body-small-line-height)}:host([variant=rich]) .content{color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}.action{display:flex;justify-content:flex-start;padding-top:.5rem}.action ::slotted(:not(:last-child)){margin-right:.5rem}`;let Kt=class extends Ue{constructor(){super(),this.variant="plain",this.placement="auto",this.openDelay=150,this.closeDelay=150,this.trigger="hover focus",this.disabled=!1,this.open=!1,this.popupRef=Ne(),this.hasSlotController=new bt(this,"headline","action"),this.hoverController=new D1(this,this.popupRef),this.definedController=new vt(this,{needDomReady:!0}),this.onDocumentClick=this.onDocumentClick.bind(this),this.onWindowScroll=this.onWindowScroll.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this)}get target(){return[...this.children].find(e=>e.tagName.toLowerCase()!=="style"&&e.getAttribute("slot")!=="content")}async onPositionChange(){this.open&&(await this.definedController.whenDefined(),this.updatePositioner())}async onOpenChange(){const e=this.hasUpdated,t=gi(this,"short4"),r=Vt(this,"standard");if(this.open){if(await this.definedController.whenDefined(),se(`mdui-tooltip[variant="${this.variant}"]`).filter((n,s)=>s!==this).prop("open",!1),e||await this.updateComplete,e&&!this.emit("open",{cancelable:!0}))return;await qt(this.popupRef.value),this.popupRef.value.hidden=!1,this.updatePositioner(),await Je(this.popupRef.value,[{transform:"scale(0)"},{transform:"scale(1)"}],{duration:e?t:0,easing:r}),e&&this.emit("opened");return}if(!this.open&&e){if(!this.emit("close",{cancelable:!0}))return;await qt(this.popupRef.value),await Je(this.popupRef.value,[{transform:"scale(1)"},{transform:"scale(0)"}],{duration:t,easing:r}),this.popupRef.value.hidden=!0,this.emit("closed")}}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),this.definedController.whenDefined().then(()=>{this.overflowAncestors=so(this.target),this.overflowAncestors.forEach(e=>{e.addEventListener("scroll",this.onWindowScroll)}),this.observeResize=cr(this.target,()=>{this.updatePositioner()})})}disconnectedCallback(){var e,t;super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),(e=this.overflowAncestors)==null||e.forEach(r=>{r.removeEventListener("scroll",this.onWindowScroll)}),(t=this.observeResize)==null||t.unobserve()}firstUpdated(e){super.firstUpdated(e),this.definedController.whenDefined().then(()=>{const t=this.target;t.addEventListener("focus",this.onFocus),t.addEventListener("blur",this.onBlur),t.addEventListener("pointerdown",this.onClick),t.addEventListener("keydown",this.onKeydown),t.addEventListener("mouseenter",this.onMouseEnter),t.addEventListener("mouseleave",this.onMouseLeave)})}render(){const e=this.isRich()&&(this.headline||this.hasSlotController.test("headline")),t=this.isRich()&&this.hasSlotController.test("action");return X`<slot></slot><div ${$e(this.popupRef)} part="popup" class="popup" hidden>${Ye(e,()=>X`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`)}<slot name="content" part="content" class="content">${this.content}</slot>${Ye(t,()=>X`<slot name="action" part="action" class="action"></slot>`)}</div>`}isRich(){return this.variant==="rich"}requestClose(){if(!this.hoverController.isHover){this.open=!1;return}this.hoverController.onMouseLeave(()=>{this.hasTrigger("hover")?this.hoverTimeout=window.setTimeout(()=>{this.open=!1},this.closeDelay||50):this.open=!1},!0)}hasTrigger(e){return this.trigger.split(" ").includes(e)}onFocus(){this.disabled||this.open||!this.hasTrigger("focus")||(this.open=!0)}onBlur(){this.disabled||!this.open||!this.hasTrigger("focus")||this.requestClose()}onClick(e){this.disabled||e.button||!this.hasTrigger("click")||this.open&&(this.hasTrigger("hover")||this.hasTrigger("focus"))||(this.open=!this.open)}onKeydown(e){this.disabled||!this.open||e.key!=="Escape"||(e.stopPropagation(),this.requestClose())}onMouseEnter(){this.disabled||this.open||!this.hasTrigger("hover")||(this.openDelay?(window.clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>{this.open=!0},this.openDelay)):this.open=!0)}onMouseLeave(){window.clearTimeout(this.hoverTimeout),!(this.disabled||!this.open||!this.hasTrigger("hover"))&&(this.hoverTimeout=window.setTimeout(()=>{this.requestClose()},this.closeDelay||50))}onDocumentClick(e){if(this.disabled||!this.open)return;e.composedPath().includes(this)||this.requestClose()}onWindowScroll(){window.requestAnimationFrame(()=>this.updatePositioner())}updatePositioner(){const e=se(this.popupRef.value),t=this.isRich()?0:4,r=4,n=this.target.getBoundingClientRect(),s=n.top,o=n.left,a=n.height,l=n.width,c=this.popupRef.value.offsetHeight,d=this.popupRef.value.offsetWidth,f=d+t+r,g=c+t+r;let y,b,_,E,S=this.placement;if(S==="auto"){const u=se(window),m=s>g,T=u.height()-s-a>g,N=o>f,$=u.width()-o-l>f;this.isRich()?(S="bottom-right",T&&$?S="bottom-right":T&&N?S="bottom-left":m&&$?S="top-right":m&&N?S="top-left":T?S="bottom":m?S="top":$?S="right":N&&(S="left")):(S="top",m?S="top":T?S="bottom":N?S="left":$&&(S="right"))}const[k,v]=S.split("-");switch(k){case"top":b="bottom",_=s-c-t;break;case"bottom":b="top",_=s+a+t;break;default:switch(b="center",v){case"start":_=s;break;case"end":_=s+a-c;break;default:_=s+a/2-c/2;break}break}switch(k){case"left":y="right",E=o-d-t;break;case"right":y="left",E=o+l+t;break;default:switch(y="center",v){case"start":E=o;break;case"end":E=o+l-d;break;case"left":y="right",E=o-d-t;break;case"right":y="left",E=o+l+t;break;default:E=o+l/2-d/2;break}break}e.css({top:_,left:E,transformOrigin:[y,b].join(" ")})}};Kt.styles=[Me,O1];w([D({reflect:!0})],Kt.prototype,"variant",void 0);w([D({reflect:!0})],Kt.prototype,"placement",void 0);w([D({type:Number,reflect:!0,attribute:"open-delay"})],Kt.prototype,"openDelay",void 0);w([D({type:Number,reflect:!0,attribute:"close-delay"})],Kt.prototype,"closeDelay",void 0);w([D({reflect:!0})],Kt.prototype,"headline",void 0);w([D({reflect:!0})],Kt.prototype,"content",void 0);w([D({reflect:!0})],Kt.prototype,"trigger",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Kt.prototype,"disabled",void 0);w([D({type:Boolean,reflect:!0,converter:me})],Kt.prototype,"open",void 0);w([Ee("placement",!0),Ee("content",!0)],Kt.prototype,"onPositionChange",null);w([Ee("open")],Kt.prototype,"onOpenChange",null);Kt=w([Re("mdui-tooltip")],Kt);const M1=i=>{const e=i.assignedNodes({flatten:!0});let t="";return[...e].forEach(r=>{r.nodeType===Node.ELEMENT_NODE&&(t+=r.outerHTML),r.nodeType===Node.TEXT_NODE&&(t+=r.textContent)}),t},P1=Ie`:host{display:block;width:100%;flex-shrink:initial!important;overflow:hidden;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-title-large-size);font-weight:var(--mdui-typescale-title-large-weight);letter-spacing:var(--mdui-typescale-title-large-tracking);line-height:var(--mdui-typescale-title-large-line-height);line-height:2.5rem}.label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:1;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear)}.label.variant-center-aligned{text-align:center}.label.variant-large:not(.shrink),.label.variant-medium:not(.shrink){opacity:0}.label.variant-large.shrink,.label.variant-medium.shrink{transition-delay:var(--mdui-motion-duration-short2)}.label-large{display:none;position:absolute;width:100%;left:0;margin-right:0;padding:0 1rem;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear)}.label-large.variant-large,.label-large.variant-medium{display:block}.label-large.variant-medium{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;bottom:.75rem;font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.label-large.variant-large{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2;bottom:1.25rem;font-size:var(--mdui-typescale-headline-medium-size);font-weight:var(--mdui-typescale-headline-medium-weight);letter-spacing:var(--mdui-typescale-headline-medium-tracking);line-height:var(--mdui-typescale-headline-medium-line-height)}.label-large.variant-large:not(.shrink),.label-large.variant-medium:not(.shrink){opacity:1;transition-delay:var(--mdui-motion-duration-short2)}.label-large.variant-large.shrink,.label-large.variant-medium.shrink{opacity:0;z-index:-1}`;let hs=class extends Ue{constructor(){super(...arguments),this.variant="small",this.shrink=!1,this.hasSlotController=new bt(this,"label-large"),this.labelLargeRef=Ne(),this.defaultSlotRef=Ne()}render(){const e=this.hasSlotController.test("label-large"),t=lt({shrink:this.shrink,"variant-center-aligned":this.variant==="center-aligned","variant-small":this.variant==="small","variant-medium":this.variant==="medium","variant-large":this.variant==="large"});return X`<slot part="label" class="label ${t}" ${$e(this.defaultSlotRef)} @slotchange="${()=>this.onSlotChange(e)}"></slot>${e?X`<slot name="label-large" part="label-large" class="label-large ${t}"></slot>`:X`<div ${$e(this.labelLargeRef)} part="label-large" class="label-large ${t}"></div>`}`}onSlotChange(e){e||(this.labelLargeRef.value.innerHTML=M1(this.defaultSlotRef.value))}};hs.styles=[Me,P1];w([Oe()],hs.prototype,"variant",void 0);w([Oe()],hs.prototype,"shrink",void 0);hs=w([Re("mdui-top-app-bar-title")],hs);const j1=Ie`:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;top:0;right:0;left:0;display:flex;flex:0 0 auto;align-items:flex-start;justify-content:flex-start;border-bottom-left-radius:var(--shape-corner);border-bottom-right-radius:var(--shape-corner);z-index:var(--z-index);transition:top var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),height var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear),background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);padding:.75rem .5rem;height:4rem;background-color:rgb(var(--mdui-color-surface))}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([scroll-behavior~=shrink]){transition-duration:var(--mdui-motion-duration-short4)}:host([scrolling]){background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2)}::slotted(mdui-button-icon){color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}::slotted(mdui-button-icon:first-child){color:rgb(var(--mdui-color-on-surface))}::slotted(mdui-avatar){width:1.875rem;height:1.875rem;margin-top:.3125rem;margin-bottom:.3125rem}::slotted(*){flex-shrink:0}::slotted(:not(:last-child)){margin-right:.5rem}:host([variant=medium]){height:7rem}:host([variant=large]){height:9.5rem}:host([hide]:not([hide=false i])){transition-duration:var(--mdui-motion-duration-short4);top:-4.625rem}:host([hide][variant=medium]:not([hide=false i])){top:-7.625rem}:host([hide][variant=large]:not([hide=false i])){top:-10.125rem}:host([shrink][variant=large]:not([shrink=false i])),:host([shrink][variant=medium]:not([shrink=false i])){transition-duration:var(--mdui-motion-duration-short4);height:4rem}`;let yi=class extends Qc(dr){constructor(){super(...arguments),this.variant="small",this.hide=!1,this.shrink=!1,this.scrolling=!1,this.definedController=new vt(this,{relatedElements:["mdui-top-app-bar-title"]})}get scrollPaddingPosition(){return"top"}get layoutPlacement(){return"top"}async onVariantChange(){this.hasUpdated?this.addEventListener("transitionend",async()=>{await this.scrollBehaviorDefinedController.whenDefined(),this.setContainerPadding("update",this.scrollTarget)},{once:!0}):await this.updateComplete,await this.definedController.whenDefined(),this.titleElements.forEach(e=>{e.variant=this.variant})}async onShrinkChange(){this.hasUpdated||await this.updateComplete,await this.definedController.whenDefined(),this.titleElements.forEach(e=>{e.shrink=this.shrink})}firstUpdated(e){super.firstUpdated(e),this.addEventListener("transitionend",t=>{t.target===this&&this.emit(this.hide?"hidden":"shown")})}render(){return X`<slot></slot>`}runScrollNoThreshold(e,t){this.hasScrollBehavior("shrink")&&e&&t<8&&(this.shrink=!1)}runScrollThreshold(e,t){this.hasScrollBehavior("elevate")&&(this.scrolling=!!t),this.hasScrollBehavior("shrink")&&(e||(this.shrink=!0)),this.hasScrollBehavior("hide")&&(!e&&!this.hide&&this.emit("hide",{cancelable:!0})&&(this.hide=!0),e&&this.hide&&this.emit("show",{cancelable:!0})&&(this.hide=!1))}};yi.styles=[Me,j1];w([D({reflect:!0})],yi.prototype,"variant",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yi.prototype,"hide",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yi.prototype,"shrink",void 0);w([D({reflect:!0,attribute:"scroll-behavior"})],yi.prototype,"scrollBehavior",void 0);w([D({type:Boolean,reflect:!0,converter:me})],yi.prototype,"scrolling",void 0);w([ri({selector:"mdui-top-app-bar-title",flatten:!0})],yi.prototype,"titleElements",void 0);w([Ee("variant")],yi.prototype,"onVariantChange",null);w([Ee("shrink")],yi.prototype,"onShrinkChange",null);yi=w([Re("mdui-top-app-bar")],yi);/**
463
+ * @license
464
+ * Copyright 2021 Google LLC
465
+ *
466
+ * Licensed under the Apache License, Version 2.0 (the "License");
467
+ * you may not use this file except in compliance with the License.
468
+ * You may obtain a copy of the License at
469
+ *
470
+ * http://www.apache.org/licenses/LICENSE-2.0
471
+ *
472
+ * Unless required by applicable law or agreed to in writing, software
473
+ * distributed under the License is distributed on an "AS IS" BASIS,
474
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
475
+ * See the License for the specific language governing permissions and
476
+ * limitations under the License.
477
+ */function Ft(i){return i<0?-1:i===0?0:1}function es(i,e,t){return(1-t)*i+t*e}function B1(i,e,t){return t<i?i:t>e?e:t}function ao(i,e,t){return t<i?i:t>e?e:t}function F1(i){return i=i%360,i<0&&(i=i+360),i}function oc(i,e){const t=i[0]*e[0][0]+i[1]*e[0][1]+i[2]*e[0][2],r=i[0]*e[1][0]+i[1]*e[1][1]+i[2]*e[1][2],n=i[0]*e[2][0]+i[1]*e[2][1]+i[2]*e[2][2];return[t,r,n]}/**
478
+ * @license
479
+ * Copyright 2021 Google LLC
480
+ *
481
+ * Licensed under the Apache License, Version 2.0 (the "License");
482
+ * you may not use this file except in compliance with the License.
483
+ * You may obtain a copy of the License at
484
+ *
485
+ * http://www.apache.org/licenses/LICENSE-2.0
486
+ *
487
+ * Unless required by applicable law or agreed to in writing, software
488
+ * distributed under the License is distributed on an "AS IS" BASIS,
489
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
490
+ * See the License for the specific language governing permissions and
491
+ * limitations under the License.
492
+ */const q1=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],U1=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],V1=[95.047,100,108.883];function ed(i,e,t){return(255<<24|(i&255)<<16|(e&255)<<8|t&255)>>>0}function nf(i){const e=Er(i[0]),t=Er(i[1]),r=Er(i[2]);return ed(e,t,r)}function z1(i){return i>>16&255}function H1(i){return i>>8&255}function W1(i){return i&255}function G1(i,e,t){const r=U1,n=r[0][0]*i+r[0][1]*e+r[0][2]*t,s=r[1][0]*i+r[1][1]*e+r[1][2]*t,o=r[2][0]*i+r[2][1]*e+r[2][2]*t,a=Er(n),l=Er(s),c=Er(o);return ed(a,l,c)}function K1(i){const e=zr(z1(i)),t=zr(H1(i)),r=zr(W1(i));return oc([e,t,r],q1)}function J1(i){const e=er(i),t=Er(e);return ed(t,t,t)}function sf(i){const e=K1(i)[1];return 116*Wp(e/100)-16}function er(i){return 100*Q1((i+16)/116)}function ac(i){return Wp(i/100)*116-16}function zr(i){const e=i/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function Er(i){const e=i/100;let t=0;return e<=.0031308?t=e*12.92:t=1.055*Math.pow(e,1/2.4)-.055,B1(0,255,Math.round(t*255))}function X1(){return V1}function Wp(i){const e=.008856451679035631,t=24389/27;return i>e?Math.pow(i,1/3):(t*i+16)/116}function Q1(i){const e=.008856451679035631,t=24389/27,r=i*i*i;return r>e?r:(116*i-16)/t}/**
493
+ * @license
494
+ * Copyright 2021 Google LLC
495
+ *
496
+ * Licensed under the Apache License, Version 2.0 (the "License");
497
+ * you may not use this file except in compliance with the License.
498
+ * You may obtain a copy of the License at
499
+ *
500
+ * http://www.apache.org/licenses/LICENSE-2.0
501
+ *
502
+ * Unless required by applicable law or agreed to in writing, software
503
+ * distributed under the License is distributed on an "AS IS" BASIS,
504
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505
+ * See the License for the specific language governing permissions and
506
+ * limitations under the License.
507
+ */class ki{static make(e=X1(),t=200/Math.PI*er(50)/100,r=50,n=2,s=!1){const o=e,a=o[0]*.401288+o[1]*.650173+o[2]*-.051461,l=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,c=o[0]*-.002079+o[1]*.048952+o[2]*.953127,d=.8+n/10,f=d>=.9?es(.59,.69,(d-.9)*10):es(.525,.59,(d-.8)*10);let g=s?1:d*(1-1/3.6*Math.exp((-t-42)/92));g=g>1?1:g<0?0:g;const y=d,b=[g*(100/a)+1-g,g*(100/l)+1-g,g*(100/c)+1-g],_=1/(5*t+1),E=_*_*_*_,S=1-E,k=E*t+.1*S*S*Math.cbrt(5*t),v=er(r)/e[1],u=1.48+Math.sqrt(v),m=.725/Math.pow(v,.2),T=m,N=[Math.pow(k*b[0]*a/100,.42),Math.pow(k*b[1]*l/100,.42),Math.pow(k*b[2]*c/100,.42)],$=[400*N[0]/(N[0]+27.13),400*N[1]/(N[1]+27.13),400*N[2]/(N[2]+27.13)],j=(2*$[0]+$[1]+.05*$[2])*m;return new ki(v,j,m,T,f,y,b,k,Math.pow(k,.25),u)}constructor(e,t,r,n,s,o,a,l,c,d){this.n=e,this.aw=t,this.nbb=r,this.ncb=n,this.c=s,this.nc=o,this.rgbD=a,this.fl=l,this.fLRoot=c,this.z=d}}ki.DEFAULT=ki.make();/**
508
+ * @license
509
+ * Copyright 2021 Google LLC
510
+ *
511
+ * Licensed under the Apache License, Version 2.0 (the "License");
512
+ * you may not use this file except in compliance with the License.
513
+ * You may obtain a copy of the License at
514
+ *
515
+ * http://www.apache.org/licenses/LICENSE-2.0
516
+ *
517
+ * Unless required by applicable law or agreed to in writing, software
518
+ * distributed under the License is distributed on an "AS IS" BASIS,
519
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
520
+ * See the License for the specific language governing permissions and
521
+ * limitations under the License.
522
+ */class Xt{constructor(e,t,r,n,s,o,a,l,c){this.hue=e,this.chroma=t,this.j=r,this.q=n,this.m=s,this.s=o,this.jstar=a,this.astar=l,this.bstar=c}distance(e){const t=this.jstar-e.jstar,r=this.astar-e.astar,n=this.bstar-e.bstar,s=Math.sqrt(t*t+r*r+n*n);return 1.41*Math.pow(s,.63)}static fromInt(e){return Xt.fromIntInViewingConditions(e,ki.DEFAULT)}static fromIntInViewingConditions(e,t){const r=(e&16711680)>>16,n=(e&65280)>>8,s=e&255,o=zr(r),a=zr(n),l=zr(s),c=.41233895*o+.35762064*a+.18051042*l,d=.2126*o+.7152*a+.0722*l,f=.01932141*o+.11916382*a+.95034478*l,g=.401288*c+.650173*d-.051461*f,y=-.250268*c+1.204414*d+.045854*f,b=-.002079*c+.048952*d+.953127*f,_=t.rgbD[0]*g,E=t.rgbD[1]*y,S=t.rgbD[2]*b,k=Math.pow(t.fl*Math.abs(_)/100,.42),v=Math.pow(t.fl*Math.abs(E)/100,.42),u=Math.pow(t.fl*Math.abs(S)/100,.42),m=Ft(_)*400*k/(k+27.13),T=Ft(E)*400*v/(v+27.13),N=Ft(S)*400*u/(u+27.13),$=(11*m+-12*T+N)/11,j=(m+T-2*N)/9,R=(20*m+20*T+21*N)/20,P=(40*m+20*T+N)/20,I=Math.atan2(j,$)*180/Math.PI,L=I<0?I+360:I>=360?I-360:I,Q=L*Math.PI/180,A=P*t.nbb,Y=100*Math.pow(A/t.aw,t.c*t.z),F=4/t.c*Math.sqrt(Y/100)*(t.aw+4)*t.fLRoot,te=L<20.14?L+360:L,x=.25*(Math.cos(te*Math.PI/180+2)+3.8),Z=5e4/13*x*t.nc*t.ncb*Math.sqrt($*$+j*j)/(R+.305),J=Math.pow(Z,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),ce=J*Math.sqrt(Y/100),H=ce*t.fLRoot,W=50*Math.sqrt(J*t.c/(t.aw+4)),K=(1+100*.007)*Y/(1+.007*Y),V=1/.0228*Math.log(1+.0228*H),re=V*Math.cos(Q),ne=V*Math.sin(Q);return new Xt(L,ce,Y,F,H,W,K,re,ne)}static fromJch(e,t,r){return Xt.fromJchInViewingConditions(e,t,r,ki.DEFAULT)}static fromJchInViewingConditions(e,t,r,n){const s=4/n.c*Math.sqrt(e/100)*(n.aw+4)*n.fLRoot,o=t*n.fLRoot,a=t/Math.sqrt(e/100),l=50*Math.sqrt(a*n.c/(n.aw+4)),c=r*Math.PI/180,d=(1+100*.007)*e/(1+.007*e),f=1/.0228*Math.log(1+.0228*o),g=f*Math.cos(c),y=f*Math.sin(c);return new Xt(r,t,e,s,o,l,d,g,y)}static fromUcs(e,t,r){return Xt.fromUcsInViewingConditions(e,t,r,ki.DEFAULT)}static fromUcsInViewingConditions(e,t,r,n){const s=t,o=r,a=Math.sqrt(s*s+o*o),c=(Math.exp(a*.0228)-1)/.0228/n.fLRoot;let d=Math.atan2(o,s)*(180/Math.PI);d<0&&(d+=360);const f=e/(1-(e-100)*.007);return Xt.fromJchInViewingConditions(f,c,d,n)}toInt(){return this.viewed(ki.DEFAULT)}viewed(e){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),a=s*(5e4/13)*e.nc*e.ncb,l=o/e.nbb,c=Math.sin(n),d=Math.cos(n),f=23*(l+.305)*r/(23*a+11*r*d+108*r*c),g=f*d,y=f*c,b=(460*l+451*g+288*y)/1403,_=(460*l-891*g-261*y)/1403,E=(460*l-220*g-6300*y)/1403,S=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),k=Ft(b)*(100/e.fl)*Math.pow(S,1/.42),v=Math.max(0,27.13*Math.abs(_)/(400-Math.abs(_))),u=Ft(_)*(100/e.fl)*Math.pow(v,1/.42),m=Math.max(0,27.13*Math.abs(E)/(400-Math.abs(E))),T=Ft(E)*(100/e.fl)*Math.pow(m,1/.42),N=k/e.rgbD[0],$=u/e.rgbD[1],j=T/e.rgbD[2],R=1.86206786*N-1.01125463*$+.14918677*j,P=.38752654*N+.62144744*$-.00897398*j,q=-.0158415*N-.03412294*$+1.04996444*j;return G1(R,P,q)}static fromXyzInViewingConditions(e,t,r,n){const s=.401288*e+.650173*t-.051461*r,o=-.250268*e+1.204414*t+.045854*r,a=-.002079*e+.048952*t+.953127*r,l=n.rgbD[0]*s,c=n.rgbD[1]*o,d=n.rgbD[2]*a,f=Math.pow(n.fl*Math.abs(l)/100,.42),g=Math.pow(n.fl*Math.abs(c)/100,.42),y=Math.pow(n.fl*Math.abs(d)/100,.42),b=Ft(l)*400*f/(f+27.13),_=Ft(c)*400*g/(g+27.13),E=Ft(d)*400*y/(y+27.13),S=(11*b+-12*_+E)/11,k=(b+_-2*E)/9,v=(20*b+20*_+21*E)/20,u=(40*b+20*_+E)/20,T=Math.atan2(k,S)*180/Math.PI,N=T<0?T+360:T>=360?T-360:T,$=N*Math.PI/180,j=u*n.nbb,R=100*Math.pow(j/n.aw,n.c*n.z),P=4/n.c*Math.sqrt(R/100)*(n.aw+4)*n.fLRoot,q=N<20.14?N+360:N,I=1/4*(Math.cos(q*Math.PI/180+2)+3.8),Q=5e4/13*I*n.nc*n.ncb*Math.sqrt(S*S+k*k)/(v+.305),A=Math.pow(Q,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),Y=A*Math.sqrt(R/100),F=Y*n.fLRoot,te=50*Math.sqrt(A*n.c/(n.aw+4)),x=(1+100*.007)*R/(1+.007*R),z=Math.log(1+.0228*F)/.0228,Z=z*Math.cos($),J=z*Math.sin($);return new Xt(N,Y,R,P,F,te,x,Z,J)}xyzInViewingConditions(e){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),a=s*(5e4/13)*e.nc*e.ncb,l=o/e.nbb,c=Math.sin(n),d=Math.cos(n),f=23*(l+.305)*r/(23*a+11*r*d+108*r*c),g=f*d,y=f*c,b=(460*l+451*g+288*y)/1403,_=(460*l-891*g-261*y)/1403,E=(460*l-220*g-6300*y)/1403,S=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),k=Ft(b)*(100/e.fl)*Math.pow(S,1/.42),v=Math.max(0,27.13*Math.abs(_)/(400-Math.abs(_))),u=Ft(_)*(100/e.fl)*Math.pow(v,1/.42),m=Math.max(0,27.13*Math.abs(E)/(400-Math.abs(E))),T=Ft(E)*(100/e.fl)*Math.pow(m,1/.42),N=k/e.rgbD[0],$=u/e.rgbD[1],j=T/e.rgbD[2],R=1.86206786*N-1.01125463*$+.14918677*j,P=.38752654*N+.62144744*$-.00897398*j,q=-.0158415*N-.03412294*$+1.04996444*j;return[R,P,q]}}/**
523
+ * @license
524
+ * Copyright 2021 Google LLC
525
+ *
526
+ * Licensed under the Apache License, Version 2.0 (the "License");
527
+ * you may not use this file except in compliance with the License.
528
+ * You may obtain a copy of the License at
529
+ *
530
+ * http://www.apache.org/licenses/LICENSE-2.0
531
+ *
532
+ * Unless required by applicable law or agreed to in writing, software
533
+ * distributed under the License is distributed on an "AS IS" BASIS,
534
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
535
+ * See the License for the specific language governing permissions and
536
+ * limitations under the License.
537
+ */class Ce{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const t=e/100;let r=0;return t<=.0031308?r=t*12.92:r=1.055*Math.pow(t,1/2.4)-.055,r*255}static chromaticAdaptation(e){const t=Math.pow(Math.abs(e),.42);return Ft(e)*400*t/(t+27.13)}static hueOf(e){const t=oc(e,Ce.SCALED_DISCOUNT_FROM_LINRGB),r=Ce.chromaticAdaptation(t[0]),n=Ce.chromaticAdaptation(t[1]),s=Ce.chromaticAdaptation(t[2]),o=(11*r+-12*n+s)/11,a=(r+n-2*s)/9;return Math.atan2(a,o)}static areInCyclicOrder(e,t,r){const n=Ce.sanitizeRadians(t-e),s=Ce.sanitizeRadians(r-e);return n<s}static intercept(e,t,r){return(t-e)/(r-e)}static lerpPoint(e,t,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t,e[2]+(r[2]-e[2])*t]}static setCoordinate(e,t,r,n){const s=Ce.intercept(e[n],t,r[n]);return Ce.lerpPoint(e,s,r)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,t){const r=Ce.Y_FROM_LINRGB[0],n=Ce.Y_FROM_LINRGB[1],s=Ce.Y_FROM_LINRGB[2],o=t%4<=1?0:100,a=t%2===0?0:100;if(t<4){const l=o,c=a,d=(e-l*n-c*s)/r;return Ce.isBounded(d)?[d,l,c]:[-1,-1,-1]}else if(t<8){const l=o,c=a,d=(e-c*r-l*s)/n;return Ce.isBounded(d)?[c,d,l]:[-1,-1,-1]}else{const l=o,c=a,d=(e-l*r-c*n)/s;return Ce.isBounded(d)?[l,c,d]:[-1,-1,-1]}}static bisectToSegment(e,t){let r=[-1,-1,-1],n=r,s=0,o=0,a=!1,l=!0;for(let c=0;c<12;c++){const d=Ce.nthVertex(e,c);if(d[0]<0)continue;const f=Ce.hueOf(d);if(!a){r=d,n=d,s=f,o=f,a=!0;continue}(l||Ce.areInCyclicOrder(s,f,o))&&(l=!1,Ce.areInCyclicOrder(s,t,f)?(n=d,o=f):(r=d,s=f))}return[r,n]}static midpoint(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,t){const r=Ce.bisectToSegment(e,t);let n=r[0],s=Ce.hueOf(n),o=r[1];for(let a=0;a<3;a++)if(n[a]!==o[a]){let l=-1,c=255;n[a]<o[a]?(l=Ce.criticalPlaneBelow(Ce.trueDelinearized(n[a])),c=Ce.criticalPlaneAbove(Ce.trueDelinearized(o[a]))):(l=Ce.criticalPlaneAbove(Ce.trueDelinearized(n[a])),c=Ce.criticalPlaneBelow(Ce.trueDelinearized(o[a])));for(let d=0;d<8&&!(Math.abs(c-l)<=1);d++){const f=Math.floor((l+c)/2),g=Ce.CRITICAL_PLANES[f],y=Ce.setCoordinate(n,g,o,a),b=Ce.hueOf(y);Ce.areInCyclicOrder(s,t,b)?(o=y,c=f):(n=y,s=b,l=f)}}return Ce.midpoint(n,o)}static inverseChromaticAdaptation(e){const t=Math.abs(e),r=Math.max(0,27.13*t/(400-t));return Ft(e)*Math.pow(r,1/.42)}static findResultByJ(e,t,r){let n=Math.sqrt(r)*11;const s=ki.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,s.n),.73),l=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,c=Math.sin(e),d=Math.cos(e);for(let f=0;f<5;f++){const g=n/100,y=t===0||n===0?0:t/Math.sqrt(g),b=Math.pow(y*o,1/.9),E=s.aw*Math.pow(g,1/s.c/s.z)/s.nbb,S=23*(E+.305)*b/(23*l+11*b*d+108*b*c),k=S*d,v=S*c,u=(460*E+451*k+288*v)/1403,m=(460*E-891*k-261*v)/1403,T=(460*E-220*k-6300*v)/1403,N=Ce.inverseChromaticAdaptation(u),$=Ce.inverseChromaticAdaptation(m),j=Ce.inverseChromaticAdaptation(T),R=oc([N,$,j],Ce.LINRGB_FROM_SCALED_DISCOUNT);if(R[0]<0||R[1]<0||R[2]<0)return 0;const P=Ce.Y_FROM_LINRGB[0],q=Ce.Y_FROM_LINRGB[1],I=Ce.Y_FROM_LINRGB[2],L=P*R[0]+q*R[1]+I*R[2];if(L<=0)return 0;if(f===4||Math.abs(L-r)<.002)return R[0]>100.01||R[1]>100.01||R[2]>100.01?0:nf(R);n=n-(L-r)*n/(2*L)}return 0}static solveToInt(e,t,r){if(t<1e-4||r<1e-4||r>99.9999)return J1(r);e=F1(e);const n=e/180*Math.PI,s=er(r),o=Ce.findResultByJ(n,t,s);if(o!==0)return o;const a=Ce.bisectToLimit(s,n);return nf(a)}static solveToCam(e,t,r){return Xt.fromInt(Ce.solveToInt(e,t,r))}}Ce.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];Ce.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];Ce.Y_FROM_LINRGB=[.2126,.7152,.0722];Ce.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];/**
538
+ * @license
539
+ * Copyright 2021 Google LLC
540
+ *
541
+ * Licensed under the Apache License, Version 2.0 (the "License");
542
+ * you may not use this file except in compliance with the License.
543
+ * You may obtain a copy of the License at
544
+ *
545
+ * http://www.apache.org/licenses/LICENSE-2.0
546
+ *
547
+ * Unless required by applicable law or agreed to in writing, software
548
+ * distributed under the License is distributed on an "AS IS" BASIS,
549
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
550
+ * See the License for the specific language governing permissions and
551
+ * limitations under the License.
552
+ */class Sr{static from(e,t,r){return new Sr(Ce.solveToInt(e,t,r))}static fromInt(e){return new Sr(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(Ce.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(Ce.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(Ce.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const t=Xt.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=sf(e),this.argb=e}setInternalState(e){const t=Xt.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=sf(e),this.argb=e}inViewingConditions(e){const r=Xt.fromInt(this.toInt()).xyzInViewingConditions(e),n=Xt.fromXyzInViewingConditions(r[0],r[1],r[2],ki.make());return Sr.from(n.hue,n.chroma,ac(r[1]))}}/**
553
+ * @license
554
+ * Copyright 2022 Google LLC
555
+ *
556
+ * Licensed under the Apache License, Version 2.0 (the "License");
557
+ * you may not use this file except in compliance with the License.
558
+ * You may obtain a copy of the License at
559
+ *
560
+ * http://www.apache.org/licenses/LICENSE-2.0
561
+ *
562
+ * Unless required by applicable law or agreed to in writing, software
563
+ * distributed under the License is distributed on an "AS IS" BASIS,
564
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
565
+ * See the License for the specific language governing permissions and
566
+ * limitations under the License.
567
+ */class mt{static ratioOfTones(e,t){return e=ao(0,100,e),t=ao(0,100,t),mt.ratioOfYs(er(e),er(t))}static ratioOfYs(e,t){const r=e>t?e:t,n=r===t?e:t;return(r+5)/(n+5)}static lighter(e,t){if(e<0||e>100)return-1;const r=er(e),n=t*(r+5)-5,s=mt.ratioOfYs(n,r),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const a=ac(n)+.4;return a<0||a>100?-1:a}static darker(e,t){if(e<0||e>100)return-1;const r=er(e),n=(r+5)/t-5,s=mt.ratioOfYs(r,n),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const a=ac(n)-.4;return a<0||a>100?-1:a}static lighterUnsafe(e,t){const r=mt.lighter(e,t);return r<0?100:r}static darkerUnsafe(e,t){const r=mt.darker(e,t);return r<0?0:r}}/**
568
+ * @license
569
+ * Copyright 2023 Google LLC
570
+ *
571
+ * Licensed under the Apache License, Version 2.0 (the "License");
572
+ * you may not use this file except in compliance with the License.
573
+ * You may obtain a copy of the License at
574
+ *
575
+ * http://www.apache.org/licenses/LICENSE-2.0
576
+ *
577
+ * Unless required by applicable law or agreed to in writing, software
578
+ * distributed under the License is distributed on an "AS IS" BASIS,
579
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
+ * See the License for the specific language governing permissions and
581
+ * limitations under the License.
582
+ */class td{static isDisliked(e){const t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,r=Math.round(e.chroma)>16,n=Math.round(e.tone)<65;return t&&r&&n}static fixIfDisliked(e){return td.isDisliked(e)?Sr.from(e.hue,e.chroma,70):e}}/**
583
+ * @license
584
+ * Copyright 2022 Google LLC
585
+ *
586
+ * Licensed under the Apache License, Version 2.0 (the "License");
587
+ * you may not use this file except in compliance with the License.
588
+ * You may obtain a copy of the License at
589
+ *
590
+ * http://www.apache.org/licenses/LICENSE-2.0
591
+ *
592
+ * Unless required by applicable law or agreed to in writing, software
593
+ * distributed under the License is distributed on an "AS IS" BASIS,
594
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
595
+ * See the License for the specific language governing permissions and
596
+ * limitations under the License.
597
+ */class Se{static fromPalette(e){return new Se(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,t,r,n,s,o,a,l){if(this.name=e,this.palette=t,this.tone=r,this.isBackground=n,this.background=s,this.secondBackground=o,this.contrastCurve=a,this.toneDeltaPair=l,this.hctCache=new Map,!s&&o)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!s&&a)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(s&&!a)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){const t=this.hctCache.get(e);if(t!=null)return t;const r=this.getTone(e),n=this.palette(e).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){const t=e.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(e),n=r.roleA,s=r.roleB,o=r.delta,a=r.polarity,l=r.stayTogether,d=this.background(e).getTone(e),f=a==="nearer"||a==="lighter"&&!e.isDark||a==="darker"&&e.isDark,g=f?n:s,y=f?s:n,b=this.name===g.name,_=e.isDark?1:-1,E=g.contrastCurve.get(e.contrastLevel),S=y.contrastCurve.get(e.contrastLevel),k=g.tone(e);let v=mt.ratioOfTones(d,k)>=E?k:Se.foregroundTone(d,E);const u=y.tone(e);let m=mt.ratioOfTones(d,u)>=S?u:Se.foregroundTone(d,S);return t&&(v=Se.foregroundTone(d,E),m=Se.foregroundTone(d,S)),(m-v)*_>=o||(m=ao(0,100,v+o*_),(m-v)*_>=o||(v=ao(0,100,m-o*_))),50<=v&&v<60?_>0?(v=60,m=Math.max(m,v+o*_)):(v=49,m=Math.min(m,v+o*_)):50<=m&&m<60&&(l?_>0?(v=60,m=Math.max(m,v+o*_)):(v=49,m=Math.min(m,v+o*_)):_>0?m=60:m=49),b?v:m}else{let r=this.tone(e);if(this.background==null)return r;const n=this.background(e).getTone(e),s=this.contrastCurve.get(e.contrastLevel);if(mt.ratioOfTones(n,r)>=s||(r=Se.foregroundTone(n,s)),t&&(r=Se.foregroundTone(n,s)),this.isBackground&&50<=r&&r<60&&(mt.ratioOfTones(49,n)>=s?r=49:r=60),this.secondBackground){const[o,a]=[this.background,this.secondBackground],[l,c]=[o(e).getTone(e),a(e).getTone(e)],[d,f]=[Math.max(l,c),Math.min(l,c)];if(mt.ratioOfTones(d,r)>=s&&mt.ratioOfTones(f,r)>=s)return r;const g=mt.lighter(d,s),y=mt.darker(f,s),b=[];return g!==-1&&b.push(g),y!==-1&&b.push(y),Se.tonePrefersLightForeground(l)||Se.tonePrefersLightForeground(c)?g<0?100:g:b.length===1?b[0]:y<0?0:y}return r}}static foregroundTone(e,t){const r=mt.lighterUnsafe(e,t),n=mt.darkerUnsafe(e,t),s=mt.ratioOfTones(r,e),o=mt.ratioOfTones(n,e);if(Se.tonePrefersLightForeground(e)){const l=Math.abs(s-o)<.1&&s<t&&o<t;return s>=t||s>=o||l?r:n}else return o>=t||o>=s?n:r}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return Se.tonePrefersLightForeground(e)&&!Se.toneAllowsLightForeground(e)?49:e}}/**
598
+ * @license
599
+ * Copyright 2023 Google LLC
600
+ *
601
+ * Licensed under the Apache License, Version 2.0 (the "License");
602
+ * you may not use this file except in compliance with the License.
603
+ * You may obtain a copy of the License at
604
+ *
605
+ * http://www.apache.org/licenses/LICENSE-2.0
606
+ *
607
+ * Unless required by applicable law or agreed to in writing, software
608
+ * distributed under the License is distributed on an "AS IS" BASIS,
609
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
610
+ * See the License for the specific language governing permissions and
611
+ * limitations under the License.
612
+ */class Le{constructor(e,t,r,n){this.low=e,this.normal=t,this.medium=r,this.high=n}get(e){return e<=-1?this.low:e<0?es(this.low,this.normal,(e- -1)/1):e<.5?es(this.normal,this.medium,(e-0)/.5):e<1?es(this.medium,this.high,(e-.5)/.5):this.high}}/**
613
+ * @license
614
+ * Copyright 2023 Google LLC
615
+ *
616
+ * Licensed under the Apache License, Version 2.0 (the "License");
617
+ * you may not use this file except in compliance with the License.
618
+ * You may obtain a copy of the License at
619
+ *
620
+ * http://www.apache.org/licenses/LICENSE-2.0
621
+ *
622
+ * Unless required by applicable law or agreed to in writing, software
623
+ * distributed under the License is distributed on an "AS IS" BASIS,
624
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
625
+ * See the License for the specific language governing permissions and
626
+ * limitations under the License.
627
+ */class Jt{constructor(e,t,r,n,s){this.roleA=e,this.roleB=t,this.delta=r,this.polarity=n,this.stayTogether=s}}/**
628
+ * @license
629
+ * Copyright 2022 Google LLC
630
+ *
631
+ * Licensed under the Apache License, Version 2.0 (the "License");
632
+ * you may not use this file except in compliance with the License.
633
+ * You may obtain a copy of the License at
634
+ *
635
+ * http://www.apache.org/licenses/LICENSE-2.0
636
+ *
637
+ * Unless required by applicable law or agreed to in writing, software
638
+ * distributed under the License is distributed on an "AS IS" BASIS,
639
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
+ * See the License for the specific language governing permissions and
641
+ * limitations under the License.
642
+ */var fs;(function(i){i[i.MONOCHROME=0]="MONOCHROME",i[i.NEUTRAL=1]="NEUTRAL",i[i.TONAL_SPOT=2]="TONAL_SPOT",i[i.VIBRANT=3]="VIBRANT",i[i.EXPRESSIVE=4]="EXPRESSIVE",i[i.FIDELITY=5]="FIDELITY",i[i.CONTENT=6]="CONTENT",i[i.RAINBOW=7]="RAINBOW",i[i.FRUIT_SALAD=8]="FRUIT_SALAD"})(fs||(fs={}));/**
643
+ * @license
644
+ * Copyright 2022 Google LLC
645
+ *
646
+ * Licensed under the Apache License, Version 2.0 (the "License");
647
+ * you may not use this file except in compliance with the License.
648
+ * You may obtain a copy of the License at
649
+ *
650
+ * http://www.apache.org/licenses/LICENSE-2.0
651
+ *
652
+ * Unless required by applicable law or agreed to in writing, software
653
+ * distributed under the License is distributed on an "AS IS" BASIS,
654
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
+ * See the License for the specific language governing permissions and
656
+ * limitations under the License.
657
+ */function fn(i){return i.variant===fs.FIDELITY||i.variant===fs.CONTENT}function st(i){return i.variant===fs.MONOCHROME}function Y1(i,e,t,r){let n=t,s=Sr.from(i,e,t);if(s.chroma<e){let o=s.chroma;for(;s.chroma<e;){n+=r?-1:1;const a=Sr.from(i,e,n);if(o>a.chroma||Math.abs(a.chroma-e)<.4)break;const l=Math.abs(a.chroma-e),c=Math.abs(s.chroma-e);l<c&&(s=a),o=Math.max(o,a.chroma)}}return n}class de{static highestSurface(e){return e.isDark?de.surfaceBright:de.surfaceDim}}de.contentAccentToneDelta=15;de.primaryPaletteKeyColor=Se.fromPalette({name:"primary_palette_key_color",palette:i=>i.primaryPalette,tone:i=>i.primaryPalette.keyColor.tone});de.secondaryPaletteKeyColor=Se.fromPalette({name:"secondary_palette_key_color",palette:i=>i.secondaryPalette,tone:i=>i.secondaryPalette.keyColor.tone});de.tertiaryPaletteKeyColor=Se.fromPalette({name:"tertiary_palette_key_color",palette:i=>i.tertiaryPalette,tone:i=>i.tertiaryPalette.keyColor.tone});de.neutralPaletteKeyColor=Se.fromPalette({name:"neutral_palette_key_color",palette:i=>i.neutralPalette,tone:i=>i.neutralPalette.keyColor.tone});de.neutralVariantPaletteKeyColor=Se.fromPalette({name:"neutral_variant_palette_key_color",palette:i=>i.neutralVariantPalette,tone:i=>i.neutralVariantPalette.keyColor.tone});de.background=Se.fromPalette({name:"background",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:98,isBackground:!0});de.onBackground=Se.fromPalette({name:"on_background",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:10,background:i=>de.background,contrastCurve:new Le(3,3,4.5,7)});de.surface=Se.fromPalette({name:"surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:98,isBackground:!0});de.surfaceDim=Se.fromPalette({name:"surface_dim",palette:i=>i.neutralPalette,tone:i=>i.isDark?6:new Le(87,87,80,75).get(i.contrastLevel),isBackground:!0});de.surfaceBright=Se.fromPalette({name:"surface_bright",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(24,24,29,34).get(i.contrastLevel):98,isBackground:!0});de.surfaceContainerLowest=Se.fromPalette({name:"surface_container_lowest",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(4,4,2,0).get(i.contrastLevel):100,isBackground:!0});de.surfaceContainerLow=Se.fromPalette({name:"surface_container_low",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(10,10,11,12).get(i.contrastLevel):new Le(96,96,96,95).get(i.contrastLevel),isBackground:!0});de.surfaceContainer=Se.fromPalette({name:"surface_container",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(12,12,16,20).get(i.contrastLevel):new Le(94,94,92,90).get(i.contrastLevel),isBackground:!0});de.surfaceContainerHigh=Se.fromPalette({name:"surface_container_high",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(17,17,21,25).get(i.contrastLevel):new Le(92,92,88,85).get(i.contrastLevel),isBackground:!0});de.surfaceContainerHighest=Se.fromPalette({name:"surface_container_highest",palette:i=>i.neutralPalette,tone:i=>i.isDark?new Le(22,22,26,30).get(i.contrastLevel):new Le(90,90,84,80).get(i.contrastLevel),isBackground:!0});de.onSurface=Se.fromPalette({name:"on_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:10,background:i=>de.highestSurface(i),contrastCurve:new Le(4.5,7,11,21)});de.surfaceVariant=Se.fromPalette({name:"surface_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?30:90,isBackground:!0});de.onSurfaceVariant=Se.fromPalette({name:"on_surface_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?80:30,background:i=>de.highestSurface(i),contrastCurve:new Le(3,4.5,7,11)});de.inverseSurface=Se.fromPalette({name:"inverse_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?90:20});de.inverseOnSurface=Se.fromPalette({name:"inverse_on_surface",palette:i=>i.neutralPalette,tone:i=>i.isDark?20:95,background:i=>de.inverseSurface,contrastCurve:new Le(4.5,7,11,21)});de.outline=Se.fromPalette({name:"outline",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?60:50,background:i=>de.highestSurface(i),contrastCurve:new Le(1.5,3,4.5,7)});de.outlineVariant=Se.fromPalette({name:"outline_variant",palette:i=>i.neutralVariantPalette,tone:i=>i.isDark?30:80,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5)});de.shadow=Se.fromPalette({name:"shadow",palette:i=>i.neutralPalette,tone:i=>0});de.scrim=Se.fromPalette({name:"scrim",palette:i=>i.neutralPalette,tone:i=>0});de.surfaceTint=Se.fromPalette({name:"surface_tint",palette:i=>i.primaryPalette,tone:i=>i.isDark?80:40,isBackground:!0});de.primary=Se.fromPalette({name:"primary",palette:i=>i.primaryPalette,tone:i=>st(i)?i.isDark?100:0:i.isDark?80:40,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(3,4.5,7,7),toneDeltaPair:i=>new Jt(de.primaryContainer,de.primary,10,"nearer",!1)});de.onPrimary=Se.fromPalette({name:"on_primary",palette:i=>i.primaryPalette,tone:i=>st(i)?i.isDark?10:90:i.isDark?20:100,background:i=>de.primary,contrastCurve:new Le(4.5,7,11,21)});de.primaryContainer=Se.fromPalette({name:"primary_container",palette:i=>i.primaryPalette,tone:i=>fn(i)?i.sourceColorHct.tone:st(i)?i.isDark?85:25:i.isDark?30:90,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.primaryContainer,de.primary,10,"nearer",!1)});de.onPrimaryContainer=Se.fromPalette({name:"on_primary_container",palette:i=>i.primaryPalette,tone:i=>fn(i)?Se.foregroundTone(de.primaryContainer.tone(i),4.5):st(i)?i.isDark?0:100:i.isDark?90:30,background:i=>de.primaryContainer,contrastCurve:new Le(3,4.5,7,11)});de.inversePrimary=Se.fromPalette({name:"inverse_primary",palette:i=>i.primaryPalette,tone:i=>i.isDark?40:80,background:i=>de.inverseSurface,contrastCurve:new Le(3,4.5,7,7)});de.secondary=Se.fromPalette({name:"secondary",palette:i=>i.secondaryPalette,tone:i=>i.isDark?80:40,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(3,4.5,7,7),toneDeltaPair:i=>new Jt(de.secondaryContainer,de.secondary,10,"nearer",!1)});de.onSecondary=Se.fromPalette({name:"on_secondary",palette:i=>i.secondaryPalette,tone:i=>st(i)?i.isDark?10:100:i.isDark?20:100,background:i=>de.secondary,contrastCurve:new Le(4.5,7,11,21)});de.secondaryContainer=Se.fromPalette({name:"secondary_container",palette:i=>i.secondaryPalette,tone:i=>{const e=i.isDark?30:90;return st(i)?i.isDark?30:85:fn(i)?Y1(i.secondaryPalette.hue,i.secondaryPalette.chroma,e,!i.isDark):e},isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.secondaryContainer,de.secondary,10,"nearer",!1)});de.onSecondaryContainer=Se.fromPalette({name:"on_secondary_container",palette:i=>i.secondaryPalette,tone:i=>st(i)?i.isDark?90:10:fn(i)?Se.foregroundTone(de.secondaryContainer.tone(i),4.5):i.isDark?90:30,background:i=>de.secondaryContainer,contrastCurve:new Le(3,4.5,7,11)});de.tertiary=Se.fromPalette({name:"tertiary",palette:i=>i.tertiaryPalette,tone:i=>st(i)?i.isDark?90:25:i.isDark?80:40,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(3,4.5,7,7),toneDeltaPair:i=>new Jt(de.tertiaryContainer,de.tertiary,10,"nearer",!1)});de.onTertiary=Se.fromPalette({name:"on_tertiary",palette:i=>i.tertiaryPalette,tone:i=>st(i)?i.isDark?10:90:i.isDark?20:100,background:i=>de.tertiary,contrastCurve:new Le(4.5,7,11,21)});de.tertiaryContainer=Se.fromPalette({name:"tertiary_container",palette:i=>i.tertiaryPalette,tone:i=>{if(st(i))return i.isDark?60:49;if(!fn(i))return i.isDark?30:90;const e=i.tertiaryPalette.getHct(i.sourceColorHct.tone);return td.fixIfDisliked(e).tone},isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.tertiaryContainer,de.tertiary,10,"nearer",!1)});de.onTertiaryContainer=Se.fromPalette({name:"on_tertiary_container",palette:i=>i.tertiaryPalette,tone:i=>st(i)?i.isDark?0:100:fn(i)?Se.foregroundTone(de.tertiaryContainer.tone(i),4.5):i.isDark?90:30,background:i=>de.tertiaryContainer,contrastCurve:new Le(3,4.5,7,11)});de.error=Se.fromPalette({name:"error",palette:i=>i.errorPalette,tone:i=>i.isDark?80:40,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(3,4.5,7,7),toneDeltaPair:i=>new Jt(de.errorContainer,de.error,10,"nearer",!1)});de.onError=Se.fromPalette({name:"on_error",palette:i=>i.errorPalette,tone:i=>i.isDark?20:100,background:i=>de.error,contrastCurve:new Le(4.5,7,11,21)});de.errorContainer=Se.fromPalette({name:"error_container",palette:i=>i.errorPalette,tone:i=>i.isDark?30:90,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.errorContainer,de.error,10,"nearer",!1)});de.onErrorContainer=Se.fromPalette({name:"on_error_container",palette:i=>i.errorPalette,tone:i=>st(i)?i.isDark?90:10:i.isDark?90:30,background:i=>de.errorContainer,contrastCurve:new Le(3,4.5,7,11)});de.primaryFixed=Se.fromPalette({name:"primary_fixed",palette:i=>i.primaryPalette,tone:i=>st(i)?40:90,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.primaryFixed,de.primaryFixedDim,10,"lighter",!0)});de.primaryFixedDim=Se.fromPalette({name:"primary_fixed_dim",palette:i=>i.primaryPalette,tone:i=>st(i)?30:80,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.primaryFixed,de.primaryFixedDim,10,"lighter",!0)});de.onPrimaryFixed=Se.fromPalette({name:"on_primary_fixed",palette:i=>i.primaryPalette,tone:i=>st(i)?100:10,background:i=>de.primaryFixedDim,secondBackground:i=>de.primaryFixed,contrastCurve:new Le(4.5,7,11,21)});de.onPrimaryFixedVariant=Se.fromPalette({name:"on_primary_fixed_variant",palette:i=>i.primaryPalette,tone:i=>st(i)?90:30,background:i=>de.primaryFixedDim,secondBackground:i=>de.primaryFixed,contrastCurve:new Le(3,4.5,7,11)});de.secondaryFixed=Se.fromPalette({name:"secondary_fixed",palette:i=>i.secondaryPalette,tone:i=>st(i)?80:90,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.secondaryFixed,de.secondaryFixedDim,10,"lighter",!0)});de.secondaryFixedDim=Se.fromPalette({name:"secondary_fixed_dim",palette:i=>i.secondaryPalette,tone:i=>st(i)?70:80,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.secondaryFixed,de.secondaryFixedDim,10,"lighter",!0)});de.onSecondaryFixed=Se.fromPalette({name:"on_secondary_fixed",palette:i=>i.secondaryPalette,tone:i=>10,background:i=>de.secondaryFixedDim,secondBackground:i=>de.secondaryFixed,contrastCurve:new Le(4.5,7,11,21)});de.onSecondaryFixedVariant=Se.fromPalette({name:"on_secondary_fixed_variant",palette:i=>i.secondaryPalette,tone:i=>st(i)?25:30,background:i=>de.secondaryFixedDim,secondBackground:i=>de.secondaryFixed,contrastCurve:new Le(3,4.5,7,11)});de.tertiaryFixed=Se.fromPalette({name:"tertiary_fixed",palette:i=>i.tertiaryPalette,tone:i=>st(i)?40:90,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.tertiaryFixed,de.tertiaryFixedDim,10,"lighter",!0)});de.tertiaryFixedDim=Se.fromPalette({name:"tertiary_fixed_dim",palette:i=>i.tertiaryPalette,tone:i=>st(i)?30:80,isBackground:!0,background:i=>de.highestSurface(i),contrastCurve:new Le(1,1,3,4.5),toneDeltaPair:i=>new Jt(de.tertiaryFixed,de.tertiaryFixedDim,10,"lighter",!0)});de.onTertiaryFixed=Se.fromPalette({name:"on_tertiary_fixed",palette:i=>i.tertiaryPalette,tone:i=>st(i)?100:10,background:i=>de.tertiaryFixedDim,secondBackground:i=>de.tertiaryFixed,contrastCurve:new Le(4.5,7,11,21)});de.onTertiaryFixedVariant=Se.fromPalette({name:"on_tertiary_fixed_variant",palette:i=>i.tertiaryPalette,tone:i=>st(i)?90:30,background:i=>de.tertiaryFixedDim,secondBackground:i=>de.tertiaryFixed,contrastCurve:new Le(3,4.5,7,11)});const Z1=`:host {
658
+ --mdui-color-primary-light: var(--mdui-color-primary-light);
659
+ --mdui-color-primary-dark: var(--mdui-color-primary-dark);
660
+ --mdui-color-background-light: var(--mdui-color-background-light);
661
+ }
662
+ /* this prevents hiding the date picker icon and number controls */
663
+ mdui-text-field::part(input) {
664
+ clip-path: none;
665
+ appearance: inherit;
666
+ }
667
+ form.mode-edit { --label-width: 0em; }
668
+ .property-instance { margin-bottom:14px; }
669
+ .mode-edit .property-instance *[required]::part(icon) { align-self: flex-start; padding-top: 0.7em; }
670
+ .mode-edit .property-instance *[required]::part(icon)::before { color: red; content: '\\2736'; font-size: 0.6em; }`;class e_ extends Fm{constructor(){super(Z1)}createDefaultTemplate(e,t,r,n,s){var l;n.classList.add("editor"),s!=null&&s.datatype?n.shaclDatatype=s.datatype:t instanceof Ii&&(n.shaclDatatype=t.datatype),(s==null?void 0:s.minCount)!==void 0&&(n.dataset.minCount=String(s.minCount)),s!=null&&s.class&&(n.dataset.class=s.class.value),s!=null&&s.nodeKind&&(n.dataset.nodeKind=s.nodeKind.value),(s!=null&&s.hasValue||s!=null&&s.readonly)&&(n.disabled=!0),n.value=(t==null?void 0:t.value)||((l=s==null?void 0:s.defaultValue)==null?void 0:l.value)||"";const o=s!=null&&s.description?s.description.value:s!=null&&s.pattern?s.pattern:null;o&&n.setAttribute("placeholder",o),r&&n.setAttribute("required","true");const a=document.createElement("div");if(e){const c=document.createElement("label");c.htmlFor=n.id,c.innerText=e,a.appendChild(c)}return a.appendChild(n),a}createTextEditor(e,t,r,n){const s=new Te;return s.variant="outlined",s.label=e,s.type="text",n.description&&(s.helper=n.description.value),n.singleLine===!1&&(s.rows=5),n.pattern&&(s.pattern=n.pattern),this.createDefaultTemplate("",t,r,s,n)}createNumberEditor(e,t,r,n){var l,c;const s=new Te;s.variant="outlined",s.type="number",s.label=e,s.helper=((l=n.description)==null?void 0:l.value)||"";const o=n.minInclusive!==void 0?n.minInclusive:n.minExclusive!==void 0?n.minExclusive+1:void 0,a=n.maxInclusive!==void 0?n.maxInclusive:n.maxExclusive!==void 0?n.maxExclusive-1:void 0;return o!==void 0&&s.setAttribute("min",String(o)),a!==void 0&&s.setAttribute("max",String(a)),((c=n.datatype)==null?void 0:c.value)!==wr+"integer"&&s.setAttribute("step","0.1"),this.createDefaultTemplate("",t,r,s,n)}createListEditor(e,t,r,n,s){var c;const o=new Xe;o.variant="outlined",o.label=e,o.helper=(c=s==null?void 0:s.description)==null?void 0:c.value,o.clearable=!0;const a=this.createDefaultTemplate("",null,r,o,s);let l=!0;for(const d of n){const f=new ht;let g="";typeof d.value=="string"?g=d.value:g=d.value.id;const y=d.label?d.label:g;if(f.value=g,f.textContent=y||g,d.indent)for(let b=0;b<d.indent;b++)f.innerHTML="&#160;&#160;"+f.innerHTML;g===""&&(l=!1,f.ariaLabel="blank"),o.appendChild(f)}if(l){const d=new ht;d.ariaLabel="blank",o.prepend(d)}return t&&(o.value=t.value),a}createBooleanEditor(e,t,r,n){const s=new yt,o=this.createDefaultTemplate("",t,r,s,n);return s.removeAttribute("required"),t instanceof Ii&&(s.checked=t.value==="true"),s.innerText=e,o}createDateEditor(e,t,r,n){var a,l,c;const s=new Te;s.variant="outlined",s.helper=((a=n==null?void 0:n.description)==null?void 0:a.value)||(n==null?void 0:n.label)||"",((l=n.datatype)==null?void 0:l.value)===wr+"dateTime"?(s.type="datetime-local",s.setAttribute("step","1")):s.type="date",s.classList.add("pr-0");const o=this.createDefaultTemplate("",null,r,s,n);if(t)try{let d=new Date(t.value).toISOString();((c=n.datatype)==null?void 0:c.value)===wr+"dateTime"?d=d.slice(0,19):d=d.slice(0,10),s.value=d}catch(d){console.error(d,t)}return o}createLangStringEditor(e,t,r,n){var l;const s=this.createTextEditor(e,t,r,n),o=s.querySelector(":scope .editor");let a;if((l=n.languageIn)!=null&&l.length){a=document.createElement("select");for(const c of n.languageIn){const d=document.createElement("option");d.innerText=c.value,a.appendChild(d)}}else a=document.createElement("input"),a.maxLength=5,a.placeholder="lang?";return a.title="Language of the text",a.classList.add("lang-chooser"),a.addEventListener("change",c=>{c.stopPropagation(),o&&(o.dataset.lang=a.value,o.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof Ii&&(a.value=t.language),o.dataset.lang=a.value,o.after(a),s}createFileEditor(e,t,r,n){const s=document.createElement("input");return s.type="file",s.addEventListener("change",o=>{var a;if((a=s.files)!=null&&a.length){o.stopPropagation();const l=new FileReader;l.readAsDataURL(s.files[0]),l.onload=()=>{var c;s.binaryData=btoa(l.result),(c=s.parentElement)==null||c.dispatchEvent(new Event("change",{bubbles:!0}))}}else s.binaryData=void 0}),this.createDefaultTemplate(e,t,r,s,n)}createButton(e,t){let r;return t?(r=new Ui,r.classList.add("primary")):(r=new Ui,r.classList.add("secondary")),r.innerHTML=e,r}}class t_ extends L0{constructor(){super(new e_)}}window.customElements.define("shacl-form",t_);export{th as Config,by as Loader,c_ as Plugin,t_ as ShaclForm,jm as ShaclPropertyTemplate,Fm as Theme,po as findLabel,Hm as registerPlugin,vy as setSharedShapesGraph};